From 9ac1cca5242f528c5e2f3e4120928d76a1731d5b Mon Sep 17 00:00:00 2001
From: sgiehl
Date: Thu, 7 Nov 2024 11:10:09 +0100
Subject: [PATCH 1/8] Migrate NumberFormatter to vue.js
---
plugins/CoreHome/CoreHome.php | 1 -
plugins/CoreHome/vue/dist/CoreHome.umd.js | 304 ++++++++++++++++--
plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 98 +++---
.../NumberFormatter.adapter.ts | 9 +
.../NumberFormatter/NumberFormatter.spec.ts | 226 +++++++++++++
.../src/NumberFormatter/NumberFormatter.ts | 217 +++++++++++++
.../CoreHome/vue/src/NumberFormatter/index.ts | 9 +
.../vue/src/NumberFormatter/utilities.ts | 33 ++
plugins/CoreHome/vue/src/createVueApp.ts | 4 +
.../CoreHome/vue/src/getFormattedEvolution.ts | 8 +-
plugins/CoreHome/vue/src/index.ts | 2 +
plugins/CoreVue/types/index.d.ts | 10 +-
12 files changed, 835 insertions(+), 86 deletions(-)
create mode 100644 plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.adapter.ts
create mode 100644 plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.spec.ts
create mode 100644 plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts
create mode 100644 plugins/CoreHome/vue/src/NumberFormatter/index.ts
create mode 100644 plugins/CoreHome/vue/src/NumberFormatter/utilities.ts
diff --git a/plugins/CoreHome/CoreHome.php b/plugins/CoreHome/CoreHome.php
index 2e35e87ecaa..75a69c78415 100644
--- a/plugins/CoreHome/CoreHome.php
+++ b/plugins/CoreHome/CoreHome.php
@@ -186,7 +186,6 @@ public function getJsFiles(&$jsFiles)
$jsFiles[] = "libs/jqplot/jqplot-custom.min.js";
$jsFiles[] = "plugins/CoreHome/javascripts/color_manager.js";
$jsFiles[] = "plugins/CoreHome/javascripts/notification.js";
- $jsFiles[] = "plugins/CoreHome/javascripts/numberFormatter.js";
$jsFiles[] = "plugins/CoreHome/javascripts/listingFormatter.js";
// we have to load these CorePluginsAdmin files here. If we loaded them in CorePluginsAdmin,
diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js
index ab85171ba9b..7d8913286e4 100644
--- a/plugins/CoreHome/vue/dist/CoreHome.umd.js
+++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js
@@ -155,12 +155,16 @@ __webpack_require__.d(__webpack_exports__, "Week", function() { return /* reexpo
__webpack_require__.d(__webpack_exports__, "Month", function() { return /* reexport */ Month_MonthPeriod; });
__webpack_require__.d(__webpack_exports__, "Year", function() { return /* reexport */ Year_YearPeriod; });
__webpack_require__.d(__webpack_exports__, "Range", function() { return /* reexport */ Range_RangePeriod; });
-__webpack_require__.d(__webpack_exports__, "format", function() { return /* reexport */ format; });
+__webpack_require__.d(__webpack_exports__, "format", function() { return /* reexport */ utilities_format; });
__webpack_require__.d(__webpack_exports__, "getToday", function() { return /* reexport */ getToday; });
__webpack_require__.d(__webpack_exports__, "parseDate", function() { return /* reexport */ parseDate; });
__webpack_require__.d(__webpack_exports__, "todayIsInRange", function() { return /* reexport */ todayIsInRange; });
__webpack_require__.d(__webpack_exports__, "getWeekNumber", function() { return /* reexport */ getWeekNumber; });
__webpack_require__.d(__webpack_exports__, "datesAreInTheSamePeriod", function() { return /* reexport */ datesAreInTheSamePeriod; });
+__webpack_require__.d(__webpack_exports__, "NumberFormatter", function() { return /* reexport */ src_NumberFormatter_NumberFormatter; });
+__webpack_require__.d(__webpack_exports__, "formatNumber", function() { return /* reexport */ utilities_formatNumber; });
+__webpack_require__.d(__webpack_exports__, "formatPercent", function() { return /* reexport */ utilities_formatPercent; });
+__webpack_require__.d(__webpack_exports__, "formatCurrency", function() { return /* reexport */ utilities_formatCurrency; });
__webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return /* reexport */ DropdownMenu; });
__webpack_require__.d(__webpack_exports__, "FocusAnywhereButHere", function() { return /* reexport */ FocusAnywhereButHere; });
__webpack_require__.d(__webpack_exports__, "FocusIf", function() { return /* reexport */ FocusIf; });
@@ -378,7 +382,7 @@ var Periods = /*#__PURE__*/function () {
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-function format(date) {
+function utilities_format(date) {
return $.datepicker.formatDate('yy-mm-dd', date);
}
function getToday() {
@@ -535,7 +539,7 @@ var Day_DayPeriod = /*#__PURE__*/function () {
Day_createClass(DayPeriod, [{
key: "getPrettyString",
value: function getPrettyString() {
- return format(this.dateInPeriod);
+ return utilities_format(this.dateInPeriod);
}
}, {
key: "getDateRange",
@@ -596,8 +600,8 @@ var Week_WeekPeriod = /*#__PURE__*/function () {
key: "getPrettyString",
value: function getPrettyString() {
var weekDates = this.getDateRange();
- var startWeek = format(weekDates[0]);
- var endWeek = format(weekDates[1]);
+ var startWeek = utilities_format(weekDates[0]);
+ var endWeek = utilities_format(weekDates[1]);
return translate('General_DateRangeFromTo', [startWeek, endWeek]);
}
}, {
@@ -818,8 +822,8 @@ var Range_RangePeriod = /*#__PURE__*/function () {
Range_createClass(RangePeriod, [{
key: "getPrettyString",
value: function getPrettyString() {
- var start = format(this.startDate);
- var end = format(this.endDate);
+ var start = utilities_format(this.startDate);
+ var end = utilities_format(this.endDate);
return translate('General_DateRangeFromTo', [start, end]);
}
}, {
@@ -1301,8 +1305,8 @@ var MatomoUrl_MatomoUrl = /*#__PURE__*/function () {
MatomoUrl_piwik.period = period;
var dateRange = Periods_Periods.parse(period, date).getDateRange();
- MatomoUrl_piwik.startDateString = format(dateRange[0]);
- MatomoUrl_piwik.endDateString = format(dateRange[1]);
+ MatomoUrl_piwik.startDateString = utilities_format(dateRange[0]);
+ MatomoUrl_piwik.endDateString = utilities_format(dateRange[1]);
MatomoUrl_piwik.updateDateInTitle(date, period); // do not set anything to previousN/lastN, as it's more useful to plugins
// to have the dates than previousN/lastN.
@@ -2173,6 +2177,214 @@ var AjaxHelper_AjaxHelper = /*#__PURE__*/function () {
// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/AjaxHelper/AjaxHelper.adapter.ts
window.ajaxHelper = AjaxHelper_AjaxHelper;
+// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts
+function NumberFormatter_slicedToArray(arr, i) { return NumberFormatter_arrayWithHoles(arr) || NumberFormatter_iterableToArrayLimit(arr, i) || NumberFormatter_unsupportedIterableToArray(arr, i) || NumberFormatter_nonIterableRest(); }
+
+function NumberFormatter_nonIterableRest() { 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 NumberFormatter_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return NumberFormatter_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 NumberFormatter_arrayLikeToArray(o, minLen); }
+
+function NumberFormatter_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 NumberFormatter_iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
+
+function NumberFormatter_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
+
+function NumberFormatter_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+function NumberFormatter_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 NumberFormatter_createClass(Constructor, protoProps, staticProps) { if (protoProps) NumberFormatter_defineProperties(Constructor.prototype, protoProps); if (staticProps) NumberFormatter_defineProperties(Constructor, staticProps); return Constructor; }
+
+function NumberFormatter_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 https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+var NumberFormatter_window = window,
+ NumberFormatter_$ = NumberFormatter_window.$;
+/**
+ * Number Formatter for formatting numbers, percent and currencies values
+ *
+ * @type {object}
+ */
+
+var NumberFormatter_NumberFormatter = /*#__PURE__*/function () {
+ function NumberFormatter() {
+ NumberFormatter_classCallCheck(this, NumberFormatter);
+
+ NumberFormatter_defineProperty(this, "defaultMinFractionDigits", 0);
+
+ NumberFormatter_defineProperty(this, "defaultMaxFractionDigits", 2);
+ }
+
+ NumberFormatter_createClass(NumberFormatter, [{
+ key: "format",
+ value:
+ /**
+ * Formats the given numeric value with the given pattern
+ *
+ * @param value
+ * @param pattern
+ * @returns {string}
+ */
+ function format(val, formatPattern, maxFractionDigits, minFractionDigits) {
+ if (!NumberFormatter_$.isNumeric(val)) {
+ return String(val);
+ }
+
+ var value = val;
+ var pattern = formatPattern || Matomo_Matomo.numbers.patternNumber;
+ var patterns = pattern.split(';');
+
+ if (patterns.length === 1) {
+ // No explicit negative pattern was provided, construct it.
+ patterns.push("-".concat(patterns[0]));
+ } // Ensure that the value is positive and has the right number of digits.
+
+
+ var negative = value < 0;
+ pattern = negative ? patterns[1] : patterns[0];
+ value = Math.abs(value); // round value to maximal number of fraction digits
+
+ if (maxFractionDigits >= 0) {
+ var factionFactor = Math.pow(10, maxFractionDigits);
+ value = Math.round(value * factionFactor) / factionFactor;
+ } // Split the number into major and minor digits.
+
+
+ var valueParts = value.toString().split('.');
+ var majorDigits = valueParts[0]; // Account for maxFractionDigits = 0, where the number won't
+ // have a decimal point, and $valueParts[1] won't be set.
+
+ var minorDigits = valueParts[1] || '';
+ var usesGrouping = pattern.indexOf(',') !== -1; // if pattern has number groups, parse them.
+
+ if (usesGrouping) {
+ var primaryGroupMatches = pattern.match(/#+0/);
+ var primaryGroupSize = (primaryGroupMatches === null || primaryGroupMatches === void 0 ? void 0 : primaryGroupMatches[0].length) || 0;
+ var secondaryGroupSize = (primaryGroupMatches === null || primaryGroupMatches === void 0 ? void 0 : primaryGroupMatches[0].length) || 0;
+ var numberGroups = pattern.split(','); // check for distinct secondary group size.
+
+ if (numberGroups.length > 2) {
+ secondaryGroupSize = numberGroups[1].length;
+ } // Reverse the major digits, since they are grouped from the right.
+
+
+ var digits = majorDigits.split('').reverse(); // Group the major digits.
+
+ var groups = [];
+ groups.push(digits.splice(0, primaryGroupSize).reverse().join(''));
+
+ while (digits.length) {
+ groups.push(digits.splice(0, secondaryGroupSize).reverse().join(''));
+ } // Reverse the groups and the digits inside of them.
+
+
+ groups = groups.reverse(); // Reconstruct the major digits.
+
+ majorDigits = groups.join(',');
+ }
+
+ if (minFractionDigits > 0) {
+ // Strip any trailing zeroes.
+ minorDigits = minorDigits.replace(/0+$/, '');
+
+ if (minorDigits.length < minFractionDigits && minorDigits.length < maxFractionDigits) {
+ // Now there are too few digits, re-add trailing zeroes
+ // until the desired length is reached.
+ var neededZeroes = minFractionDigits - minorDigits.length;
+ minorDigits += new Array(neededZeroes + 1).join('0');
+ }
+ } // Assemble the final number and insert it into the pattern.
+
+
+ var result = minorDigits ? "".concat(majorDigits, ".").concat(minorDigits) : majorDigits;
+ result = pattern.replace(/#(?:[.,]#+)*0(?:[,.][0#]+)*/, result); // Localize the number.
+
+ return this.replaceSymbols(result);
+ }
+ /**
+ * Replaces the placeholders with real symbols
+ *
+ * @param value
+ * @returns {string}
+ */
+
+ }, {
+ key: "replaceSymbols",
+ value: function replaceSymbols(value) {
+ var replacements = {
+ '.': Matomo_Matomo.numbers.symbolDecimal,
+ ',': Matomo_Matomo.numbers.symbolGroup,
+ '+': Matomo_Matomo.numbers.symbolPlus,
+ '-': Matomo_Matomo.numbers.symbolMinus,
+ '%': Matomo_Matomo.numbers.symbolPercent
+ };
+ var newValue = '';
+ var valueParts = value.split('');
+ valueParts.forEach(function (val) {
+ var valueReplaced = val;
+ Object.entries(replacements).some(function (_ref) {
+ var _ref2 = NumberFormatter_slicedToArray(_ref, 2),
+ _char = _ref2[0],
+ replacement = _ref2[1];
+
+ if (valueReplaced.indexOf(_char) !== -1) {
+ valueReplaced = valueReplaced.replace(_char, replacement);
+ return true;
+ }
+
+ return false;
+ });
+ newValue += valueReplaced;
+ });
+ return newValue;
+ }
+ }, {
+ key: "valOrDefault",
+ value: function valOrDefault(def, val) {
+ if (typeof val === 'undefined') {
+ return def;
+ }
+
+ return val;
+ }
+ }, {
+ key: "formatNumber",
+ value: function formatNumber(value, maxFractionDigits, minFractionDigits) {
+ return this.format(value, Matomo_Matomo.numbers.patternNumber, this.valOrDefault(this.defaultMaxFractionDigits, maxFractionDigits), this.valOrDefault(this.defaultMinFractionDigits, minFractionDigits));
+ }
+ }, {
+ key: "formatPercent",
+ value: function formatPercent(value, maxFractionDigits, minFractionDigits) {
+ return this.format(value, Matomo_Matomo.numbers.patternPercent, this.valOrDefault(this.defaultMaxFractionDigits, maxFractionDigits), this.valOrDefault(this.defaultMinFractionDigits, minFractionDigits));
+ }
+ }, {
+ key: "formatCurrency",
+ value: function formatCurrency(value, currency, maxFractionDigits, minFractionDigits) {
+ var formatted = this.format(value, Matomo_Matomo.numbers.patternCurrency, this.valOrDefault(this.defaultMaxFractionDigits, maxFractionDigits), this.valOrDefault(this.defaultMinFractionDigits, minFractionDigits));
+ return formatted.replace('¤', currency);
+ }
+ }, {
+ key: "formatEvolution",
+ value: function formatEvolution(evolution, maxFractionDigits, minFractionDigits) {
+ var formattedEvolution = this.formatPercent(evolution, maxFractionDigits, minFractionDigits);
+ return "".concat(evolution > 0 ? Matomo_Matomo.numbers.symbolPlus : '').concat(formattedEvolution);
+ }
+ }]);
+
+ return NumberFormatter;
+}();
+
+/* harmony default export */ var src_NumberFormatter_NumberFormatter = (new NumberFormatter_NumberFormatter());
+// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.adapter.ts
+
+window.NumberFormatter = src_NumberFormatter_NumberFormatter;
// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/PopoverHandler/PopoverHandler.ts
function PopoverHandler_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -2422,6 +2634,32 @@ function externalLink(url) {
return '';
}
+// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/NumberFormatter/utilities.ts
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+function utilities_formatNumber(val, maxFractionDigits, minFractionDigits) {
+ return src_NumberFormatter_NumberFormatter.formatNumber(val, maxFractionDigits, minFractionDigits);
+}
+function utilities_formatPercent(val, maxFractionDigits, minFractionDigits) {
+ return src_NumberFormatter_NumberFormatter.formatPercent(val, maxFractionDigits, minFractionDigits);
+}
+function utilities_formatCurrency(val, cur, maxFractionDigits, minFractionDigits) {
+ return src_NumberFormatter_NumberFormatter.formatCurrency(val, cur, maxFractionDigits, minFractionDigits);
+}
+// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/NumberFormatter/index.ts
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+
// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/createVueApp.ts
/*!
* Matomo - free/libre analytics platform
@@ -2432,6 +2670,7 @@ function externalLink(url) {
+
function createVueApp() {
var app = external_commonjs_vue_commonjs2_vue_root_Vue_["createApp"].apply(void 0, arguments);
app.config.globalProperties.$sanitize = window.vueSanitize;
@@ -2439,6 +2678,9 @@ function createVueApp() {
app.config.globalProperties.translateOrDefault = translateOrDefault;
app.config.globalProperties.externalLink = externalLink;
app.config.globalProperties.externalRawLink = externalRawLink;
+ app.config.globalProperties.formatNumber = utilities_formatNumber;
+ app.config.globalProperties.formatPercent = utilities_formatPercent;
+ app.config.globalProperties.formatCurrency = utilities_formatCurrency;
return app;
}
// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/importPluginUmd.ts
@@ -2631,13 +2873,9 @@ function calculateEvolution(currentValue, pastValue) {
return evolution;
}
-function formatEvolution(evolution) {
- return "".concat(evolution > 0 ? Matomo_Matomo.numbers.symbolPlus : '').concat(Math.round(evolution), "}%");
-}
-
function getFormattedEvolution(currentValue, pastValue) {
var evolution = calculateEvolution(currentValue, pastValue);
- return formatEvolution(evolution);
+ return src_NumberFormatter_NumberFormatter.formatEvolution(evolution);
}
// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/clone.ts
/*!
@@ -5300,8 +5538,8 @@ var DATE_FORMAT = 'YYYY-MM-DD';
},
rangeChanged: function rangeChanged() {
this.$emit('rangeChange', {
- start: this.fromPickerSelectedDates[0] ? format(this.fromPickerSelectedDates[0]) : null,
- end: this.toPickerSelectedDates[0] ? format(this.toPickerSelectedDates[0]) : null
+ start: this.fromPickerSelectedDates[0] ? utilities_format(this.fromPickerSelectedDates[0]) : null,
+ end: this.toPickerSelectedDates[0] ? utilities_format(this.toPickerSelectedDates[0]) : null
});
}
}
@@ -7865,7 +8103,7 @@ function isValidDate(d) {
return translate('General_Error');
}
- date = format(this.dateValue);
+ date = utilities_format(this.dateValue);
}
try {
@@ -7904,7 +8142,7 @@ function isValidDate(d) {
}
if (this.comparePeriodType === 'previousYear') {
- var dateStr = this.selectedPeriod === 'range' ? "".concat(this.startRangeDate, ",").concat(this.endRangeDate) : format(this.dateValue);
+ var dateStr = this.selectedPeriod === 'range' ? "".concat(this.startRangeDate, ",").concat(this.endRangeDate) : utilities_format(this.dateValue);
var currentDateRange = Periods_Periods.parse(this.selectedPeriod, dateStr).getDateRange();
currentDateRange[0].setFullYear(currentDateRange[0].getFullYear() - 1);
currentDateRange[1].setFullYear(currentDateRange[1].getFullYear() - 1);
@@ -7913,14 +8151,14 @@ function isValidDate(d) {
return {
comparePeriods: ['range'],
comparePeriodType: 'previousYear',
- compareDates: ["".concat(format(currentDateRange[0]), ",").concat(format(currentDateRange[1]))]
+ compareDates: ["".concat(utilities_format(currentDateRange[0]), ",").concat(utilities_format(currentDateRange[1]))]
};
}
return {
comparePeriods: [this.selectedPeriod],
comparePeriodType: 'previousYear',
- compareDates: [format(currentDateRange[0])]
+ compareDates: [utilities_format(currentDateRange[0])]
};
}
@@ -7934,11 +8172,11 @@ function isValidDate(d) {
var newEndDate = Range_RangePeriod.getLastNRange('day', 2, currentStartRange).startDate;
var rangeSize = Math.floor((currentEndRange.valueOf() - currentStartRange.valueOf()) / 86400000);
var newRange = Range_RangePeriod.getLastNRange('day', 1 + rangeSize, newEndDate);
- return "".concat(format(newRange.startDate), ",").concat(format(newRange.endDate));
+ return "".concat(utilities_format(newRange.startDate), ",").concat(utilities_format(newRange.endDate));
}
var newStartDate = Range_RangePeriod.getLastNRange(this.selectedPeriod, 2, this.dateValue).startDate;
- return format(newStartDate);
+ return utilities_format(newStartDate);
},
selectedDateString: function selectedDateString() {
if (this.selectedPeriod === 'range') {
@@ -7957,7 +8195,7 @@ function isValidDate(d) {
return "".concat(dateFrom, ",").concat(dateTo);
}
- return format(this.dateValue);
+ return utilities_format(this.dateValue);
},
isErrorDisplayed: function isErrorDisplayed() {
return this.currentlyViewingText === translate('General_Error');
@@ -7995,7 +8233,7 @@ function isValidDate(d) {
this.periodValue = period;
this.selectedPeriod = period;
this.dateValue = date;
- var currentDateString = format(date);
+ var currentDateString = utilities_format(date);
this.setRangeStartEndFromPeriod(period, currentDateString);
this.propagateNewUrlParams(currentDateString, this.selectedPeriod);
window.initTopControls();
@@ -8073,8 +8311,8 @@ function isValidDate(d) {
startDate = _periodObj$getDateRan2[0],
endDate = _periodObj$getDateRan2[1];
- this.compareStartDate = format(startDate);
- this.compareEndDate = format(endDate);
+ this.compareStartDate = utilities_format(startDate);
+ this.compareEndDate = utilities_format(endDate);
},
updateSelectedValuesFromHash: function updateSelectedValuesFromHash() {
var date = src_MatomoUrl_MatomoUrl.parsed.value.date;
@@ -8100,8 +8338,8 @@ function isValidDate(d) {
endDate = _periodObj$getDateRan4[1];
this.dateValue = startDate;
- this.startRangeDate = format(startDate);
- this.endRangeDate = format(endDate);
+ this.startRangeDate = utilities_format(startDate);
+ this.endRangeDate = utilities_format(endDate);
} else {
this.dateValue = parseDate(date);
this.setRangeStartEndFromPeriod(period, date);
@@ -8109,8 +8347,8 @@ function isValidDate(d) {
},
setRangeStartEndFromPeriod: function setRangeStartEndFromPeriod(period, dateStr) {
var dateRange = Periods_Periods.parse(period, dateStr).getDateRange();
- this.startRangeDate = format(dateRange[0] < PeriodSelectorvue_type_script_lang_ts_piwikMinDate ? PeriodSelectorvue_type_script_lang_ts_piwikMinDate : dateRange[0]);
- this.endRangeDate = format(dateRange[1] > PeriodSelectorvue_type_script_lang_ts_piwikMaxDate ? PeriodSelectorvue_type_script_lang_ts_piwikMaxDate : dateRange[1]);
+ this.startRangeDate = utilities_format(dateRange[0] < PeriodSelectorvue_type_script_lang_ts_piwikMinDate ? PeriodSelectorvue_type_script_lang_ts_piwikMinDate : dateRange[0]);
+ this.endRangeDate = utilities_format(dateRange[1] > PeriodSelectorvue_type_script_lang_ts_piwikMaxDate ? PeriodSelectorvue_type_script_lang_ts_piwikMaxDate : dateRange[1]);
},
getPeriodDisplayText: function getPeriodDisplayText(periodLabel) {
return Periods_Periods.get(periodLabel).getDisplayText();
@@ -10947,8 +11185,8 @@ function Sparklinevue_type_script_lang_ts_typeof(obj) { "@babel/helpers - typeof
dateRange[0] = piwikMinDate;
}
- var startDateStr = format(dateRange[0]);
- var endDateStr = format(dateRange[1]);
+ var startDateStr = utilities_format(dateRange[0]);
+ var endDateStr = utilities_format(dateRange[1]);
return "".concat(startDateStr, ",").concat(endDateStr);
}
}
@@ -12223,6 +12461,8 @@ function scrollToAnchorInUrl() {
+
+
diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js
index 10325fea3b2..307c2caa27e 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 https://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,"createVueApp",(function(){return ft})),n.d(t,"importPluginUmd",(function(){return yt})),n.d(t,"useExternalPluginComponent",(function(){return Ot})),n.d(t,"DirectiveUtilities",(function(){return wt})),n.d(t,"debounce",(function(){return St})),n.d(t,"getFormattedEvolution",(function(){return Dt})),n.d(t,"clone",(function(){return Pt})),n.d(t,"VueEntryContainer",(function(){return It})),n.d(t,"ActivityIndicator",(function(){return qt})),n.d(t,"MatomoLoader",(function(){return Ut})),n.d(t,"translate",(function(){return a})),n.d(t,"translateOrDefault",(function(){return i})),n.d(t,"externalRawLink",(function(){return mt})),n.d(t,"externalLink",(function(){return pt})),n.d(t,"Alert",(function(){return Yt})),n.d(t,"AjaxHelper",(function(){return Ze})),n.d(t,"setCookie",(function(){return it})),n.d(t,"getCookie",(function(){return lt})),n.d(t,"deleteCookie",(function(){return ct})),n.d(t,"MatomoUrl",(function(){return De})),n.d(t,"Matomo",(function(){return ue})),n.d(t,"Periods",(function(){return m})),n.d(t,"Day",(function(){return k})),n.d(t,"Week",(function(){return P})),n.d(t,"Month",(function(){return x})),n.d(t,"Year",(function(){return _})),n.d(t,"Range",(function(){return K})),n.d(t,"format",(function(){return p})),n.d(t,"getToday",(function(){return f})),n.d(t,"parseDate",(function(){return h})),n.d(t,"todayIsInRange",(function(){return b})),n.d(t,"getWeekNumber",(function(){return g})),n.d(t,"datesAreInTheSamePeriod",(function(){return v})),n.d(t,"DropdownMenu",(function(){return Jt})),n.d(t,"FocusAnywhereButHere",(function(){return tn})),n.d(t,"FocusIf",(function(){return rn})),n.d(t,"Tooltips",(function(){return sn})),n.d(t,"MatomoDialog",(function(){return pn})),n.d(t,"ExpandOnClick",(function(){return wn})),n.d(t,"ExpandOnHover",(function(){return Pn})),n.d(t,"ShowSensitiveData",(function(){return Nn})),n.d(t,"DropdownButton",(function(){return Bn})),n.d(t,"SelectOnFocus",(function(){return Rn})),n.d(t,"CopyToClipboard",(function(){return $n})),n.d(t,"SideNav",(function(){return qn})),n.d(t,"EnrichedHeadline",(function(){return lr})),n.d(t,"ContentBlock",(function(){return yr})),n.d(t,"Comparisons",(function(){return Zr})),n.d(t,"ComparisonsStore",(function(){return Kr})),n.d(t,"ComparisonsStoreInstance",(function(){return Qr})),n.d(t,"MenuItemsDropdown",(function(){return fo})),n.d(t,"DatePicker",(function(){return jo})),n.d(t,"DateRangePicker",(function(){return Po})),n.d(t,"PeriodDatePicker",(function(){return xo})),n.d(t,"Notification",(function(){return qo})),n.d(t,"NotificationGroup",(function(){return oa})),n.d(t,"NotificationsStore",(function(){return na})),n.d(t,"ShowHelpLink",(function(){return ua})),n.d(t,"SitesStore",(function(){return ba})),n.d(t,"SiteSelector",(function(){return Ma})),n.d(t,"QuickAccess",(function(){return ti})),n.d(t,"FieldArray",(function(){return hi})),n.d(t,"MultiPairField",(function(){return Ii})),n.d(t,"PeriodSelector",(function(){return yl})),n.d(t,"ReportingMenu",(function(){return wc})),n.d(t,"ReportingMenuStore",(function(){return ic})),n.d(t,"ReportingPagesStore",(function(){return ql})),n.d(t,"ReportMetadataStore",(function(){return Pc})),n.d(t,"WidgetsStore",(function(){return pc})),n.d(t,"WidgetLoader",(function(){return Mc})),n.d(t,"WidgetContainer",(function(){return Xc})),n.d(t,"WidgetByDimensionContainer",(function(){return fs})),n.d(t,"Widget",(function(){return js})),n.d(t,"ReportingPage",(function(){return $s})),n.d(t,"ReportExport",(function(){return ku})),n.d(t,"Sparkline",(function(){return Pu})),n.d(t,"Progressbar",(function(){return Au})),n.d(t,"ContentIntro",(function(){return Lu})),n.d(t,"ContentTable",(function(){return Mu})),n.d(t,"AjaxForm",(function(){return $u})),n.d(t,"Passthrough",(function(){return zu})),n.d(t,"DataTableActions",(function(){return Zd})),n.d(t,"VersionInfoHeaderMessage",(function(){return mm})),n.d(t,"MobileLeftMenu",(function(){return Bm})),n.d(t,"scrollToAnchorInUrl",(function(){return $m})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}n("2342");
+ */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"createVueApp",(function(){return Nt})),n.d(t,"importPluginUmd",(function(){return Mt})),n.d(t,"useExternalPluginComponent",(function(){return Lt})),n.d(t,"DirectiveUtilities",(function(){return Ft})),n.d(t,"debounce",(function(){return Ht})),n.d(t,"getFormattedEvolution",(function(){return $t})),n.d(t,"clone",(function(){return qt})),n.d(t,"VueEntryContainer",(function(){return Yt})),n.d(t,"ActivityIndicator",(function(){return ln})),n.d(t,"MatomoLoader",(function(){return on})),n.d(t,"translate",(function(){return a})),n.d(t,"translateOrDefault",(function(){return i})),n.d(t,"externalRawLink",(function(){return Et})),n.d(t,"externalLink",(function(){return Dt})),n.d(t,"Alert",(function(){return dn})),n.d(t,"AjaxHelper",(function(){return Ze})),n.d(t,"setCookie",(function(){return Ot})),n.d(t,"getCookie",(function(){return jt})),n.d(t,"deleteCookie",(function(){return wt})),n.d(t,"MatomoUrl",(function(){return De})),n.d(t,"Matomo",(function(){return ue})),n.d(t,"Periods",(function(){return m})),n.d(t,"Day",(function(){return k})),n.d(t,"Week",(function(){return P})),n.d(t,"Month",(function(){return x})),n.d(t,"Year",(function(){return _})),n.d(t,"Range",(function(){return K})),n.d(t,"format",(function(){return p})),n.d(t,"getToday",(function(){return f})),n.d(t,"parseDate",(function(){return h})),n.d(t,"todayIsInRange",(function(){return b})),n.d(t,"getWeekNumber",(function(){return v})),n.d(t,"datesAreInTheSamePeriod",(function(){return g})),n.d(t,"NumberFormatter",(function(){return pt})),n.d(t,"formatNumber",(function(){return Pt})),n.d(t,"formatPercent",(function(){return Tt})),n.d(t,"formatCurrency",(function(){return Vt})),n.d(t,"DropdownMenu",(function(){return mn})),n.d(t,"FocusAnywhereButHere",(function(){return gn})),n.d(t,"FocusIf",(function(){return On})),n.d(t,"Tooltips",(function(){return Cn})),n.d(t,"MatomoDialog",(function(){return Tn})),n.d(t,"ExpandOnClick",(function(){return _n})),n.d(t,"ExpandOnHover",(function(){return qn})),n.d(t,"ShowSensitiveData",(function(){return Gn})),n.d(t,"DropdownButton",(function(){return Kn})),n.d(t,"SelectOnFocus",(function(){return nr})),n.d(t,"CopyToClipboard",(function(){return ar})),n.d(t,"SideNav",(function(){return ir})),n.d(t,"EnrichedHeadline",(function(){return kr})),n.d(t,"ContentBlock",(function(){return Ar})),n.d(t,"Comparisons",(function(){return bo})),n.d(t,"ComparisonsStore",(function(){return po})),n.d(t,"ComparisonsStoreInstance",(function(){return fo})),n.d(t,"MenuItemsDropdown",(function(){return Vo})),n.d(t,"DatePicker",(function(){return Lo})),n.d(t,"DateRangePicker",(function(){return qo})),n.d(t,"PeriodDatePicker",(function(){return Jo})),n.d(t,"Notification",(function(){return ia})),n.d(t,"NotificationGroup",(function(){return Oa})),n.d(t,"NotificationsStore",(function(){return ga})),n.d(t,"ShowHelpLink",(function(){return Ea})),n.d(t,"SitesStore",(function(){return Ia})),n.d(t,"SiteSelector",(function(){return Za})),n.d(t,"QuickAccess",(function(){return vi})),n.d(t,"FieldArray",(function(){return Ni})),n.d(t,"MultiPairField",(function(){return Yi})),n.d(t,"PeriodSelector",(function(){return Al})),n.d(t,"ReportingMenu",(function(){return _c})),n.d(t,"ReportingMenuStore",(function(){return wc})),n.d(t,"ReportingPagesStore",(function(){return ic})),n.d(t,"ReportMetadataStore",(function(){return qc})),n.d(t,"WidgetsStore",(function(){return Tc})),n.d(t,"WidgetLoader",(function(){return Zc})),n.d(t,"WidgetContainer",(function(){return fs})),n.d(t,"WidgetByDimensionContainer",(function(){return Vs})),n.d(t,"Widget",(function(){return Ls})),n.d(t,"ReportingPage",(function(){return au})),n.d(t,"ReportExport",(function(){return Fu})),n.d(t,"Sparkline",(function(){return qu})),n.d(t,"Progressbar",(function(){return Qu})),n.d(t,"ContentIntro",(function(){return Xu})),n.d(t,"ContentTable",(function(){return Zu})),n.d(t,"AjaxForm",(function(){return ad})),n.d(t,"Passthrough",(function(){return cd})),n.d(t,"DataTableActions",(function(){return hm})),n.d(t,"VersionInfoHeaderMessage",(function(){return Pm})),n.d(t,"MobileLeftMenu",(function(){return Km})),n.d(t,"scrollToAnchorInUrl",(function(){return ap})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}n("2342");
/*!
* Matomo - free/libre analytics platform
*
@@ -24,7 +24,7 @@ function a(e){if(!e)return"";for(var t=arguments.length,n=new Array(t>1?t-1:0),r
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-function p(e){return $.datepicker.formatDate("yy-mm-dd",e)}function f(){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 h(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 f();if("yesterday"===t||"yesterdaySameTime"===t){var n=f();return n.setDate(n.getDate()-1),n}if(t.match(/last[ -]?week/i)){var r=f();return r.setDate(r.getDate()-7),r}if(t.match(/last[ -]?month/i)){var o=f();return o.setDate(1),o.setMonth(o.getMonth()-1),o}if(t.match(/last[ -]?year/i)){var a=f();return a.setFullYear(a.getFullYear()-1),a}return $.datepicker.parseDate("yy-mm-dd",t)}function b(e){return 2===e.length&&(f()>=e[0]&&f()<=e[1])}function g(e){var t=new Date(e.valueOf()),n=(e.getDay()+6)%7;t.setDate(t.getDate()-n+3);var r=t.valueOf();if(t.setMonth(0,1),4!==t.getDay()){var o=(4-t.getDay()+7)%7;t.setMonth(0,1+o)}return 1+Math.ceil((r-t.valueOf())/6048e5)}function v(e,t,n){var r=e.getFullYear(),o=e.getMonth(),a=e.getDate(),i=g(e),l=t.getFullYear(),c=t.getMonth(),s=t.getDate(),u=g(t);switch(n){case"day":return r===l&&o===c&&a===s;case"week":return r===l&&i===u;case"month":return r===l&&o===c;case"year":return r===l;default:return!1}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n=e[0]&&f()<=e[1])}function v(e){var t=new Date(e.valueOf()),n=(e.getDay()+6)%7;t.setDate(t.getDate()-n+3);var r=t.valueOf();if(t.setMonth(0,1),4!==t.getDay()){var o=(4-t.getDay()+7)%7;t.setMonth(0,1+o)}return 1+Math.ceil((r-t.valueOf())/6048e5)}function g(e,t,n){var r=e.getFullYear(),o=e.getMonth(),a=e.getDate(),i=v(e),l=t.getFullYear(),c=t.getMonth(),s=t.getDate(),u=v(t);switch(n){case"day":return r===l&&o===c&&a===s;case"week":return r===l&&i===u;case"month":return r===l&&o===c;case"year":return r===l;default:return!1}}function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?this.stringify(e):e,r=Object.keys(t).length?this.getFinalHashParams(t,e):{},o=this.stringify(r),a="?".concat(n);o.length&&(a="".concat(a,"#?").concat(o)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,a)}},{key:"getFinalHashParams",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?e:this.parse(e),r="string"!==typeof e?t:this.parse(t);return Object.assign({period:r.period||this.parsed.value.period,date:r.date||this.parsed.value.date,segment:r.segment||this.parsed.value.segment},n)}},{key:"updateLocation",value:function(e){ue.helper.isReportingPage()?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:"parse",value:function(e){return ke.getValuesFromUrl("?".concat(e),!0)}},{key:"stringify",value:function(e){var t=Object.fromEntries(Object.entries(e).filter((function(e){var t=de(e,2),n=t[1];return""!==n&&null!==n&&void 0!==n})));return $.param(t).replace(/%5B%5D/g,"[]").replace(/%2C/g,",").replace(/\+/g,"%20")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(Se(t,e)&&(we.period!==t||we.currentDateString!==e)){we.period=t;var n=m.parse(t,e).getDateRange();we.startDateString=p(n[0]),we.endDateString=p(n[1]),we.updateDateInTitle(e,t),"range"===we.period&&(e="".concat(we.startDateString,",").concat(we.endDateString)),we.currentDateString=e}}}]),e}(),Ee=new Ce,De=Ee;function Pe(e){return Pe="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},Pe(e)}function Te(e){return xe(e)||Ie(e)||Ne(e)||Ve()}function Ve(){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 Ne(e,t){if(e){if("string"===typeof e)return Be(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)?Be(e,t):void 0}}function Ie(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function xe(e){if(Array.isArray(e))return Be(e)}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?this.stringify(e):e,r=Object.keys(t).length?this.getFinalHashParams(t,e):{},o=this.stringify(r),a="?".concat(n);o.length&&(a="".concat(a,"#?").concat(o)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,a)}},{key:"getFinalHashParams",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?e:this.parse(e),r="string"!==typeof e?t:this.parse(t);return Object.assign({period:r.period||this.parsed.value.period,date:r.date||this.parsed.value.date,segment:r.segment||this.parsed.value.segment},n)}},{key:"updateLocation",value:function(e){ue.helper.isReportingPage()?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:"parse",value:function(e){return ke.getValuesFromUrl("?".concat(e),!0)}},{key:"stringify",value:function(e){var t=Object.fromEntries(Object.entries(e).filter((function(e){var t=de(e,2),n=t[1];return""!==n&&null!==n&&void 0!==n})));return $.param(t).replace(/%5B%5D/g,"[]").replace(/%2C/g,",").replace(/\+/g,"%20")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(Se(t,e)&&(we.period!==t||we.currentDateString!==e)){we.period=t;var n=m.parse(t,e).getDateRange();we.startDateString=p(n[0]),we.endDateString=p(n[1]),we.updateDateInTitle(e,t),"range"===we.period&&(e="".concat(we.startDateString,",").concat(we.endDateString)),we.currentDateString=e}}}]),e}(),Ee=new Ce,De=Ee;function Pe(e){return Pe="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},Pe(e)}function Te(e){return xe(e)||Ie(e)||Ne(e)||Ve()}function Ve(){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 Ne(e,t){if(e){if("string"===typeof e)return Be(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)?Be(e,t):void 0}}function Ie(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function xe(e){if(Array.isArray(e))return Be(e)}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=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"),a[e]>1?i+="".concat(e," (").concat(a[e],"x)"):i+=e}));var l=null,c="toast";Ke(e.errorElement).length&&i.length&&(Ke(e.errorElement).show(),l=e.errorElement,c=null);var s=!document.querySelector("#login_form");if(i&&s){var u=window["require"]("piwik/UI"),d=new u.Notification;d.show(i,{placeat:l,context:"error",type:c,id:"ajaxHelper"}),d.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,ue.ajaxRequestFinished&&ue.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return Ke.ajax(o)}},{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()||ue.shouldPropagateTokenAuth?{token_auth:ue.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Object.assign(Object.assign({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=De.getSearchParam("segment"),r={idSite:ue.idSite?ue.idSite.toString():broadcast.getValueFromUrl("idSite"),period:ue.period||broadcast.getValueFromUrl("period"),segment:n},o=e;return o.token_auth&&(o.token_auth=null,delete o.token_auth),Object.keys(r).forEach((function(e){!t.useGETDefaultParameter(e)||null!==o[e]&&"undefined"!==typeof o[e]&&""!==o[e]||null!==t.postParams[e]&&"undefined"!==typeof t.postParams[e]&&""!==t.postParams[e]||!r[e]||(o[e]=r[e])})),!this.useGETDefaultParameter("date")||o.date||this.postParams.date||(o.date=ue.currentDateString),o}},{key:"getRequestHandle",value:function(){return this.requestHandle}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;n.withTokenInUrl&&r.withTokenInUrl(),n.errorElement&&r.setErrorElement(n.errorElement),n.redirectOnSuccess&&r.redirectOnSuccess(!0!==n.redirectOnSuccess?n.redirectOnSuccess:void 0),r.setFormat(n.format||"json"),Array.isArray(t)?r.setBulkRequests.apply(r,Te(t)):(Object.keys(t).forEach((function(e){if(/password/i.test(e))throw new Error("Password parameters are not allowed to be sent as GET parameter. Please send ".concat(e," as POST parameter instead."))})),r.addParams(Object.assign(Object.assign({module:"API",format:n.format||"json"},t),{},{segment:t.segment?encodeURIComponent(t.segment):void 0}),"get")),n.postParams&&r.addParams(n.postParams,"post"),n.headers&&(r.headers=Object.assign(Object.assign({},r.headers),n.headers));var o=!0;return"undefined"===typeof n.createErrorNotification||n.createErrorNotification||(r.useCallbackInCaseOfError(),r.setErrorCallback(null),o=!1),n.abortController&&(r.abortController=n.abortController),n.returnResponseObject&&(r.resolveWithHelper=!0),r.send().then((function(t){var n=t instanceof e?t.requestHandle.responseJSON:t,o="API.getBulkRequest"===r.postParams.method&&Array.isArray(n)?n:[n],a=o.filter((function(e){return"error"===e.result})).map((function(e){return e.message}));if(a.length)throw new Xe(a.filter((function(e){return e.length})).join("\n"));return t})).catch((function(e){if(o||e instanceof Xe)throw e;var t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)}))}},{key:"post",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fetch(t,Object.assign(Object.assign({},r),{},{postParams:n}))}},{key:"oneAtATime",value:function(t,n){var r=null;return function(o,a){return r&&r.abort(),r=new AbortController,e.post(Object.assign(Object.assign({},o),{},{method:t}),a,Object.assign(Object.assign({},n),{},{abortController:r})).finally((function(){r=null}))}}}]),e}();function et(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tt(e,t){for(var n=0;n=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"),a[e]>1?i+="".concat(e," (").concat(a[e],"x)"):i+=e}));var l=null,c="toast";Ke(e.errorElement).length&&i.length&&(Ke(e.errorElement).show(),l=e.errorElement,c=null);var s=!document.querySelector("#login_form");if(i&&s){var u=window["require"]("piwik/UI"),d=new u.Notification;d.show(i,{placeat:l,context:"error",type:c,id:"ajaxHelper"}),d.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,ue.ajaxRequestFinished&&ue.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return Ke.ajax(o)}},{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()||ue.shouldPropagateTokenAuth?{token_auth:ue.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Object.assign(Object.assign({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=De.getSearchParam("segment"),r={idSite:ue.idSite?ue.idSite.toString():broadcast.getValueFromUrl("idSite"),period:ue.period||broadcast.getValueFromUrl("period"),segment:n},o=e;return o.token_auth&&(o.token_auth=null,delete o.token_auth),Object.keys(r).forEach((function(e){!t.useGETDefaultParameter(e)||null!==o[e]&&"undefined"!==typeof o[e]&&""!==o[e]||null!==t.postParams[e]&&"undefined"!==typeof t.postParams[e]&&""!==t.postParams[e]||!r[e]||(o[e]=r[e])})),!this.useGETDefaultParameter("date")||o.date||this.postParams.date||(o.date=ue.currentDateString),o}},{key:"getRequestHandle",value:function(){return this.requestHandle}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;n.withTokenInUrl&&r.withTokenInUrl(),n.errorElement&&r.setErrorElement(n.errorElement),n.redirectOnSuccess&&r.redirectOnSuccess(!0!==n.redirectOnSuccess?n.redirectOnSuccess:void 0),r.setFormat(n.format||"json"),Array.isArray(t)?r.setBulkRequests.apply(r,Te(t)):(Object.keys(t).forEach((function(e){if(/password/i.test(e))throw new Error("Password parameters are not allowed to be sent as GET parameter. Please send ".concat(e," as POST parameter instead."))})),r.addParams(Object.assign(Object.assign({module:"API",format:n.format||"json"},t),{},{segment:t.segment?encodeURIComponent(t.segment):void 0}),"get")),n.postParams&&r.addParams(n.postParams,"post"),n.headers&&(r.headers=Object.assign(Object.assign({},r.headers),n.headers));var o=!0;return"undefined"===typeof n.createErrorNotification||n.createErrorNotification||(r.useCallbackInCaseOfError(),r.setErrorCallback(null),o=!1),n.abortController&&(r.abortController=n.abortController),n.returnResponseObject&&(r.resolveWithHelper=!0),r.send().then((function(t){var n=t instanceof e?t.requestHandle.responseJSON:t,o="API.getBulkRequest"===r.postParams.method&&Array.isArray(n)?n:[n],a=o.filter((function(e){return"error"===e.result})).map((function(e){return e.message}));if(a.length)throw new Xe(a.filter((function(e){return e.length})).join("\n"));return t})).catch((function(e){if(o||e instanceof Xe)throw e;var t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)}))}},{key:"post",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fetch(t,Object.assign(Object.assign({},r),{},{postParams:n}))}},{key:"oneAtATime",value:function(t,n){var r=null;return function(o,a){return r&&r.abort(),r=new AbortController,e.post(Object.assign(Object.assign({},o),{},{method:t}),a,Object.assign(Object.assign({},n),{},{abortController:r})).finally((function(){r=null}))}}}]),e}();function et(e,t){return at(e)||ot(e,t)||nt(e,t)||tt()}function tt(){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 nt(e,t){if(e){if("string"===typeof e)return rt(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)?rt(e,t):void 0}}function rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0){var c=Math.pow(10,n);o=Math.round(o*c)/c}var s=o.toString().split("."),u=s[0],d=s[1]||"",m=-1!==a.indexOf(",");if(m){var p=a.match(/#+0/),f=(null===p||void 0===p?void 0:p[0].length)||0,h=(null===p||void 0===p?void 0:p[0].length)||0,b=a.split(",");b.length>2&&(h=b[1].length);var v=u.split("").reverse(),g=[];g.push(v.splice(0,f).reverse().join(""));while(v.length)g.push(v.splice(0,h).reverse().join(""));g=g.reverse(),u=g.join(",")}if(r>0&&(d=d.replace(/0+$/,""),d.length0?ue.numbers.symbolPlus:"").concat(r)}}]),e}(),pt=new mt;function ft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(e,t){for(var n=0;n1?t-1:0),r=1;r0&&(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null,n=(arguments.length<=1?0:arguments.length-1)>1&&(arguments.length<=2?void 0:arguments[2])?arguments.length<=2?void 0:arguments[2]:null,r=(arguments.length<=1?0:arguments.length-1)>2&&(arguments.length<=3?void 0:arguments[3])?arguments.length<=3?void 0:arguments[3]:null,o=Et(e,t,n,r);return''}
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */function Pt(e,t,n){return pt.formatNumber(e,t,n)}function Tt(e,t,n){return pt.formatPercent(e,t,n)}function Vt(e,t,n,r){return pt.formatCurrency(e,t,n,r)}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-function mt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r0&&(arguments.length<=1?void 0:arguments[1])?arguments.length<=1?void 0:arguments[1]:null,n=(arguments.length<=1?0:arguments.length-1)>1&&(arguments.length<=2?void 0:arguments[2])?arguments.length<=2?void 0:arguments[2]:null,r=(arguments.length<=1?0:arguments.length-1)>2&&(arguments.length<=3?void 0:arguments[3])?arguments.length<=3?void 0:arguments[3]:null,o=mt(e,t,n,r);return''}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function ft(){var e=X["createApp"].apply(void 0,arguments);return e.config.globalProperties.$sanitize=window.vueSanitize,e.config.globalProperties.translate=a,e.config.globalProperties.translateOrDefault=i,e.config.globalProperties.externalLink=pt,e.config.globalProperties.externalRawLink=mt,e}
+ */function Nt(){var e=X["createApp"].apply(void 0,arguments);return e.config.globalProperties.$sanitize=window.vueSanitize,e.config.globalProperties.translate=a,e.config.globalProperties.translateOrDefault=i,e.config.globalProperties.externalLink=Dt,e.config.globalProperties.externalRawLink=Et,e.config.globalProperties.formatNumber=Pt,e.config.globalProperties.formatPercent=Tt,e.config.globalProperties.formatCurrency=Vt,e}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */ue.on("Matomo.topControlsRendered",(function(){dt()}));var ht={},bt=120,gt=50,vt=1e3;function yt(e){if(ht[e])return ht[e];if(window[e])return Promise.resolve(window[e]);var t,n,r,o="?module=Proxy&action=getPluginUmdJs&plugin=".concat(e),a=document.createElement("script");a.charset="utf-8",a.timeout=bt,a.src=o;var i=new Error,l=function(o){a.onerror=null,a.onload=null,clearTimeout(r);var l=0;function c(){if(l+=gt,t&&n)if(window[e]&&n)try{n(window[e])}finally{t=void 0,n=void 0}else if(l>vt)try{var r=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;i.message="Loading plugin ".concat(e," on demand failed.\n(").concat(r,": ").concat(a,")"),i.name="PluginOnDemandLoadError",i.type=r,i.request=a,t(i)}finally{t=void 0,n=void 0}else setTimeout(c,gt)}setTimeout(c,gt)};return r=setTimeout((function(){l({type:"timeout",target:a})}),bt),a.onerror=l,a.onload=l,document.head.appendChild(a),new Promise((function(e,r){n=e,t=r}))}
+ */ue.on("Matomo.topControlsRendered",(function(){Ct()}));var It={},xt=120,Bt=50,At=1e3;function Mt(e){if(It[e])return It[e];if(window[e])return Promise.resolve(window[e]);var t,n,r,o="?module=Proxy&action=getPluginUmdJs&plugin=".concat(e),a=document.createElement("script");a.charset="utf-8",a.timeout=xt,a.src=o;var i=new Error,l=function(o){a.onerror=null,a.onload=null,clearTimeout(r);var l=0;function c(){if(l+=Bt,t&&n)if(window[e]&&n)try{n(window[e])}finally{t=void 0,n=void 0}else if(l>At)try{var r=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;i.message="Loading plugin ".concat(e," on demand failed.\n(").concat(r,": ").concat(a,")"),i.name="PluginOnDemandLoadError",i.type=r,i.request=a,t(i)}finally{t=void 0,n=void 0}else setTimeout(c,Bt)}setTimeout(c,Bt)};return r=setTimeout((function(){l({type:"timeout",target:a})}),xt),a.onerror=l,a.onload=l,document.head.appendChild(a),new Promise((function(e,r){n=e,t=r}))}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function Ot(e,t){return Object(X["defineAsyncComponent"])((function(){return yt(e).then((function(e){return e||resolve(null),e[t]}))}))}
+ */function Lt(e,t){return Object(X["defineAsyncComponent"])((function(){return Mt(e).then((function(e){return e||resolve(null),e[t]}))}))}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function jt(e,t){var n;return e instanceof HTMLElement?e:null===(n=t.instance)||void 0===n?void 0:n.$refs[e]}var wt={getRef:jt},kt=300;function St(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:kt;return function(){for(var r=this,o=arguments.length,a=new Array(o),i=0;i1&&void 0!==arguments[1]?arguments[1]:Rt;return function(){for(var r=this,o=arguments.length,a=new Array(o),i=0;i0?ue.numbers.symbolPlus:"").concat(Math.round(e),"}%")}function Dt(e,t){var n=Ct(e,t);return Et(n)}
+ */function Ut(e,t){var n,r=parseInt(t,10),o=parseInt(e,10)-r;return n=0===o||Number.isNaN(o)?0:0===r||Number.isNaN(r)?100:o/r*100,n}function $t(e,t){var n=Ut(e,t);return pt.formatEvolution(n)}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function Pt(e){return"undefined"===typeof e?e:JSON.parse(JSON.stringify(e))}var Tt={ref:"root"};function Vt(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Tt,[e.componentWrapper?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(e.componentWrapper),{key:0})):Object(X["createCommentVNode"])("",!0)],512)}var Nt=Object(X["defineComponent"])({props:{html:String},mounted:function(){ue.helper.compileVueEntryComponents(this.$refs.root)},beforeUnmount:function(){ue.helper.destroyVueComponent(this.$refs.root)},computed:{componentWrapper:function(){return this.html?Object(X["markRaw"])({template:this.html}):null}}});Nt.render=Vt;var It=Nt,xt={class:"loadingPiwik"};function Bt(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("MatomoLoader");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",xt,[Object(X["createVNode"])(i),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.loadingMessage),1)],512)),[[X["vShow"],e.loading]])}var At={class:"matomo-loader"},Lt=Object(X["createElementVNode"])("span",null,null,-1),Mt=Object(X["createElementVNode"])("span",null,null,-1),_t=Object(X["createElementVNode"])("span",null,null,-1),Ft=[Lt,Mt,_t];function Rt(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("span",At,Ft)}var Ht=Object(X["defineComponent"])({});Ht.render=Rt;var Ut=Ht,$t=Object(X["defineComponent"])({components:{MatomoLoader:Ut},props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:a("General_LoadingData")}}});$t.render=Bt;var qt=$t;function Wt(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zt(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["alert",Wt({},"alert-".concat(e.severity),!0)])},[Object(X["renderSlot"])(e.$slots,"default")],2)}var Gt=Object(X["defineComponent"])({props:{severity:{type:String,required:!0}}});Gt.render=zt;var Yt=Gt,Jt={mounted:function(e,t){var n={};$(e).addClass("matomo-dropdown-menu");var r,o=!!$(e).parent().closest(".dropdown-content").length;o&&(n={hover:!0},$(e).addClass("submenu"),$((null===(r=t.value)||void 0===r?void 0:r.activates)||$(e).data("target")).addClass("submenu-dropdown-content"),$(e).parents(".dropdown-content").addClass("submenu-container"));$(e).dropdown(n)},updated:function(e){Object(X["nextTick"])((function(){$(e).addClass("matomo-dropdown-menu")}))}};
+ */function qt(e){return"undefined"===typeof e?e:JSON.parse(JSON.stringify(e))}var Wt={ref:"root"};function zt(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Wt,[e.componentWrapper?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(e.componentWrapper),{key:0})):Object(X["createCommentVNode"])("",!0)],512)}var Gt=Object(X["defineComponent"])({props:{html:String},mounted:function(){ue.helper.compileVueEntryComponents(this.$refs.root)},beforeUnmount:function(){ue.helper.destroyVueComponent(this.$refs.root)},computed:{componentWrapper:function(){return this.html?Object(X["markRaw"])({template:this.html}):null}}});Gt.render=zt;var Yt=Gt,Jt={class:"loadingPiwik"};function Kt(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("MatomoLoader");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Jt,[Object(X["createVNode"])(i),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.loadingMessage),1)],512)),[[X["vShow"],e.loading]])}var Qt={class:"matomo-loader"},Xt=Object(X["createElementVNode"])("span",null,null,-1),Zt=Object(X["createElementVNode"])("span",null,null,-1),en=Object(X["createElementVNode"])("span",null,null,-1),tn=[Xt,Zt,en];function nn(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("span",Qt,tn)}var rn=Object(X["defineComponent"])({});rn.render=nn;var on=rn,an=Object(X["defineComponent"])({components:{MatomoLoader:on},props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:a("General_LoadingData")}}});an.render=Kt;var ln=an;function cn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sn(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["alert",cn({},"alert-".concat(e.severity),!0)])},[Object(X["renderSlot"])(e.$slots,"default")],2)}var un=Object(X["defineComponent"])({props:{severity:{type:String,required:!0}}});un.render=sn;var dn=un,mn={mounted:function(e,t){var n={};$(e).addClass("matomo-dropdown-menu");var r,o=!!$(e).parent().closest(".dropdown-content").length;o&&(n={hover:!0},$(e).addClass("submenu"),$((null===(r=t.value)||void 0===r?void 0:r.activates)||$(e).data("target")).addClass("submenu-dropdown-content"),$(e).parents(".dropdown-content").addClass("submenu-container"));$(e).dropdown(n)},updated:function(e){Object(X["nextTick"])((function(){$(e).addClass("matomo-dropdown-menu")}))}};
/*!
* Matomo - free/libre analytics platform
*
@@ -147,145 +165,145 @@ function mt(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r"))}function cn(e,t){var n,r,o,a,i,l;an(e).tooltip({track:!0,content:(null===(n=t.value)||void 0===n?void 0:n.content)||ln,show:"undefined"!==typeof(null===(r=t.value)||void 0===r?void 0:r.show)?null===(o=t.value)||void 0===o?void 0:o.show:{delay:(null===(a=t.value)||void 0===a?void 0:a.delay)||700,duration:(null===(i=t.value)||void 0===i?void 0:i.duration)||200},hide:!1,tooltipClass:null===(l=t.value)||void 0===l?void 0:l.tooltipClass})}var sn={mounted:function(e,t){setTimeout((function(){return cn(e,t)}))},updated:function(e,t){setTimeout((function(){return cn(e,t)}))},beforeUnmount:function(e){try{window.$(e).tooltip("destroy")}catch(t){}}},un={ref:"root"};function dn(e,t,n,r,o,a){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",un,[Object(X["renderSlot"])(e.$slots,"default")],512)),[[X["vShow"],e.modelValue]])}var mn=Object(X["defineComponent"])({props:{modelValue:{type:Boolean,required:!0}},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.$refs.root.firstElementChild;ue.helper.modalConfirm(r,{yes:function(){n.$emit("yes")},no:function(){n.$emit("no")},validation:function(){n.$emit("validation")}},{onCloseEnd:function(){n.$refs.root.appendChild(r),n.$emit("update:modelValue",!1),n.$emit("closeEnd")}})}else!1===e&&!0===t&&($(".modal.open").modal("close"),this.$emit("close"))}}});mn.render=dn;var pn=mn;
+ */function kn(){var e=wn(this).attr("title")||"";return window.vueSanitize(e.replace(/\n/g,"
"))}function Sn(e,t){var n,r,o,a,i,l;wn(e).tooltip({track:!0,content:(null===(n=t.value)||void 0===n?void 0:n.content)||kn,show:"undefined"!==typeof(null===(r=t.value)||void 0===r?void 0:r.show)?null===(o=t.value)||void 0===o?void 0:o.show:{delay:(null===(a=t.value)||void 0===a?void 0:a.delay)||700,duration:(null===(i=t.value)||void 0===i?void 0:i.duration)||200},hide:!1,tooltipClass:null===(l=t.value)||void 0===l?void 0:l.tooltipClass})}var Cn={mounted:function(e,t){setTimeout((function(){return Sn(e,t)}))},updated:function(e,t){setTimeout((function(){return Sn(e,t)}))},beforeUnmount:function(e){try{window.$(e).tooltip("destroy")}catch(t){}}},En={ref:"root"};function Dn(e,t,n,r,o,a){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",En,[Object(X["renderSlot"])(e.$slots,"default")],512)),[[X["vShow"],e.modelValue]])}var Pn=Object(X["defineComponent"])({props:{modelValue:{type:Boolean,required:!0}},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.$refs.root.firstElementChild;ue.helper.modalConfirm(r,{yes:function(){n.$emit("yes")},no:function(){n.$emit("no")},validation:function(){n.$emit("validation")}},{onCloseEnd:function(){n.$refs.root.appendChild(r),n.$emit("update:modelValue",!1),n.$emit("closeEnd")}})}else!1===e&&!0===t&&($(".modal.open").modal("close"),this.$emit("close"))}}});Pn.render=Dn;var Tn=Pn;
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function fn(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&ue.helper.setMarginLeftToBeInViewport(t)}function hn(e,t,n){var r,o=t.value.isMouseDown&&t.value.hasScrolled;(t.value.isMouseDown=!1,t.value.hasScrolled=!1,o)||(e.contains(n.target)||(e.classList.remove("expanded"),null!==(r=t.value)&&void 0!==r&&r.onClosed&&t.value.onClosed()))}function bn(e){e.value.hasScrolled=!0}function gn(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function vn(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}var yn=document.documentElement,On=window,jn=On.$,wn={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=fn.bind(null,e),t.value.onEscapeHandler=vn.bind(null,e,t),t.value.onMouseDown=gn.bind(null,t),t.value.onClickOutsideElement=hn.bind(null,e,t),t.value.onScroll=bn.bind(null,t),setTimeout((function(){var e=wt.getRef(t.value.expander,t);e&&jn(e).on("click",t.value.onExpand)})),yn.addEventListener("keyup",t.value.onEscapeHandler),yn.addEventListener("mousedown",t.value.onMouseDown),yn.addEventListener("mouseup",t.value.onClickOutsideElement),yn.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){var n=wt.getRef(t.value.expander,t);n&&jn(n).off("click",t.value.onExpand),yn.removeEventListener("keyup",t.value.onEscapeHandler),yn.removeEventListener("mousedown",t.value.onMouseDown),yn.removeEventListener("mouseup",t.value.onClickOutsideElement),yn.removeEventListener("scroll",t.value.onScroll)}};
+ */function Vn(e){e.classList.toggle("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&ue.helper.setMarginLeftToBeInViewport(t)}function Nn(e,t,n){var r,o=t.value.isMouseDown&&t.value.hasScrolled;(t.value.isMouseDown=!1,t.value.hasScrolled=!1,o)||(e.contains(n.target)||(e.classList.remove("expanded"),null!==(r=t.value)&&void 0!==r&&r.onClosed&&t.value.onClosed()))}function In(e){e.value.hasScrolled=!0}function xn(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function Bn(e,t,n){27===n.which&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,e.classList.remove("expanded"))}var An=document.documentElement,Mn=window,Ln=Mn.$,_n={mounted:function(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onExpand=Vn.bind(null,e),t.value.onEscapeHandler=Bn.bind(null,e,t),t.value.onMouseDown=xn.bind(null,t),t.value.onClickOutsideElement=Nn.bind(null,e,t),t.value.onScroll=In.bind(null,t),setTimeout((function(){var e=Ft.getRef(t.value.expander,t);e&&Ln(e).on("click",t.value.onExpand)})),An.addEventListener("keyup",t.value.onEscapeHandler),An.addEventListener("mousedown",t.value.onMouseDown),An.addEventListener("mouseup",t.value.onClickOutsideElement),An.addEventListener("scroll",t.value.onScroll)},unmounted:function(e,t){var n=Ft.getRef(t.value.expander,t);n&&Ln(n).off("click",t.value.onExpand),An.removeEventListener("keyup",t.value.onEscapeHandler),An.removeEventListener("mousedown",t.value.onMouseDown),An.removeEventListener("mouseup",t.value.onClickOutsideElement),An.removeEventListener("scroll",t.value.onScroll)}};
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-function kn(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&ue.helper.setMarginLeftToBeInViewport(t)}function Sn(e){e.classList.remove("expanded")}function Cn(e,t){e.contains(t.target)||e.classList.remove("expanded")}function En(e,t){27===t.which&&e.classList.remove("expanded")}var Dn=document.documentElement,Pn={mounted:function(e,t){t.value.onMouseEnter=kn.bind(null,e),t.value.onMouseLeave=Sn.bind(null,e),t.value.onClickOutsideElement=Cn.bind(null,e),t.value.onEscapeHandler=En.bind(null,e),setTimeout((function(){var e=wt.getRef(t.value.expander,t);e&&e.addEventListener("mouseenter",t.value.onMouseEnter)})),e.addEventListener("mouseleave",t.value.onMouseLeave),Dn.addEventListener("keyup",t.value.onEscapeHandler),Dn.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){var n=wt.getRef(t.value.expander,t);n&&n.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}},Tn=window,Vn=Tn.$,Nn={mounted:function(e,t){var n=Vn(e),r=t.value.sensitiveData,o=t.value.showCharacters||6,i=t.value.clickElementSelector||n,l="";function c(){n.html(r),Vn(i).css({cursor:""}),Vn(i).tooltip("destroy")}o>0&&(l+=r.slice(0,o)),l+=r.slice(o).replace(/./g,"*"),n.html(l),Vn(i).tooltip({content:a("CoreHome_ClickToSeeFullInformation"),items:"*",track:!0}),Vn(i).one("click",c),Vn(i).css({cursor:"pointer"})}},In=window,xn=In.$,Bn={mounted:function(e){var t=xn(e);!t.attr("data-target")&&t.attr("data-activates")&&t.attr("data-target",t.attr("data-activates"));var n=t.attr("data-target");n&&xn("#".concat(n)).length&&t.dropdown({inDuration:300,outDuration:225,constrainWidth:!1,belowOrigin:!0})}},An=window,Ln=An.$;function Mn(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,Ln(t.target).select())}function _n(e){var t=document.createRange();t.selectNode(e.target);var n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),n&&n.addRange(t)}function Fn(e){delete e.value.focusedElement}var Rn={mounted:function(e,t){var n=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===n,t.value.elementSupportsSelect?(t.value.onFocusHandler=Mn.bind(null,t),t.value.onBlurHandler=Fn.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=_n,e.addEventListener("click",t.value.onClickHandler))},unmounted:function(e,t){t.value.elementSupportsSelect?(e.removeEventListener("focus",t.value.onFocusHandler),e.removeEventListener("blur",t.value.onBlurHandler)):e.removeEventListener("click",t.value.onClickHandler)}};
+function Fn(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&ue.helper.setMarginLeftToBeInViewport(t)}function Rn(e){e.classList.remove("expanded")}function Hn(e,t){e.contains(t.target)||e.classList.remove("expanded")}function Un(e,t){27===t.which&&e.classList.remove("expanded")}var $n=document.documentElement,qn={mounted:function(e,t){t.value.onMouseEnter=Fn.bind(null,e),t.value.onMouseLeave=Rn.bind(null,e),t.value.onClickOutsideElement=Hn.bind(null,e),t.value.onEscapeHandler=Un.bind(null,e),setTimeout((function(){var e=Ft.getRef(t.value.expander,t);e&&e.addEventListener("mouseenter",t.value.onMouseEnter)})),e.addEventListener("mouseleave",t.value.onMouseLeave),$n.addEventListener("keyup",t.value.onEscapeHandler),$n.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){var n=Ft.getRef(t.value.expander,t);n&&n.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}},Wn=window,zn=Wn.$,Gn={mounted:function(e,t){var n=zn(e),r=t.value.sensitiveData,o=t.value.showCharacters||6,i=t.value.clickElementSelector||n,l="";function c(){n.html(r),zn(i).css({cursor:""}),zn(i).tooltip("destroy")}o>0&&(l+=r.slice(0,o)),l+=r.slice(o).replace(/./g,"*"),n.html(l),zn(i).tooltip({content:a("CoreHome_ClickToSeeFullInformation"),items:"*",track:!0}),zn(i).one("click",c),zn(i).css({cursor:"pointer"})}},Yn=window,Jn=Yn.$,Kn={mounted:function(e){var t=Jn(e);!t.attr("data-target")&&t.attr("data-activates")&&t.attr("data-target",t.attr("data-activates"));var n=t.attr("data-target");n&&Jn("#".concat(n)).length&&t.dropdown({inDuration:300,outDuration:225,constrainWidth:!1,belowOrigin:!0})}},Qn=window,Xn=Qn.$;function Zn(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,Xn(t.target).select())}function er(e){var t=document.createRange();t.selectNode(e.target);var n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),n&&n.addRange(t)}function tr(e){delete e.value.focusedElement}var nr={mounted:function(e,t){var n=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===n,t.value.elementSupportsSelect?(t.value.onFocusHandler=Zn.bind(null,t),t.value.onBlurHandler=tr.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=er,e.addEventListener("click",t.value.onClickHandler))},unmounted:function(e,t){t.value.elementSupportsSelect?(e.removeEventListener("focus",t.value.onFocusHandler),e.removeEventListener("blur",t.value.onBlurHandler)):e.removeEventListener("click",t.value.onClickHandler)}};
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function Hn(e){if(e){var t=document.createElement("textarea");t.value=e.innerText,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),t.focus(),document.execCommand("copy"),document.body.removeChild(t);var n=e.parentElement;if(n){var r=n.getElementsByTagName("i")[0];r&&(r.classList.remove("copyToClipboardIcon"),r.classList.add("copyToClipboardIconCheck"));var o=n.getElementsByClassName("copyToClipboardCopiedDiv")[0];o&&(o.style.display="inline-block",setTimeout((function(){o.style.display="none"}),2500))}}}function Un(e,t){if(t.value.transitionOpen){var n=e.parentElement;if(n){var r=n.getElementsByTagName("i")[0];r&&(r.classList.remove("copyToClipboardIconCheck"),r.classList.add("copyToClipboardIcon"))}t.value.transitionOpen=!1}else t.value.transitionOpen=!0}var $n={mounted:function(e,t){var n=e.tagName.toLowerCase();if("pre"===n){var r=document.createElement("button");r.setAttribute("type","button"),r.className="copyToClipboardButton";var o=document.createElement("div");o.className="copyToClipboardPositionDiv";var i=document.createElement("i");i.className="copyToClipboardIcon",r.appendChild(i);var l=document.createElement("span");l.className="copyToClipboardSpan",l.innerHTML=a("General_Copy"),r.appendChild(l),o.appendChild(r);var c=document.createElement("div");c.className="copyToClipboardCopiedDiv",c.innerHTML=a("General_CopiedToClipboard"),o.appendChild(c);var s=e.parentElement;s&&(s.classList.add("copyToClipboardWrapper"),s.appendChild(o)),t.value.onClickHandler=Hn.bind(null,e),r.addEventListener("click",t.value.onClickHandler),t.value.onTransitionEndHandler=Un.bind(null,e,t),r.addEventListener("transitionend",t.value.onTransitionEndHandler)}},unmounted:function(e,t){e.removeEventListener("click",t.value.onClickHandler),e.removeEventListener("transitionend",t.value.onTransitionEndHandler)}},qn={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!t.value.initialized){t.value.initialized=!0;var n=wt.getRef(t.value.activator,t);if(n){window.$(n).show();var r=n.getAttribute("data-target");window.$("#".concat(r)).sidenav({closeOnClick:!0})}}e.classList.contains("collapsible")&&window.$(e).collapsible()}))}},Wn={key:0,class:"title",tabindex:"6"},zn=["href","title"],Gn={class:"iconsBar"},Yn=["href","title"],Jn=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),Kn=[Jn],Qn=["title"],Xn=Object(X["createElementVNode"])("span",{class:"icon-info"},null,-1),Zn=[Xn],er={key:2,class:"ratingIcons"},tr={class:"inlineHelp"},nr=["innerHTML"],rr=["innerHTML"],or=["href"];
+ */function rr(e){if(e){var t=document.createElement("textarea");t.value=e.innerText,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),t.focus(),document.execCommand("copy"),document.body.removeChild(t);var n=e.parentElement;if(n){var r=n.getElementsByTagName("i")[0];r&&(r.classList.remove("copyToClipboardIcon"),r.classList.add("copyToClipboardIconCheck"));var o=n.getElementsByClassName("copyToClipboardCopiedDiv")[0];o&&(o.style.display="inline-block",setTimeout((function(){o.style.display="none"}),2500))}}}function or(e,t){if(t.value.transitionOpen){var n=e.parentElement;if(n){var r=n.getElementsByTagName("i")[0];r&&(r.classList.remove("copyToClipboardIconCheck"),r.classList.add("copyToClipboardIcon"))}t.value.transitionOpen=!1}else t.value.transitionOpen=!0}var ar={mounted:function(e,t){var n=e.tagName.toLowerCase();if("pre"===n){var r=document.createElement("button");r.setAttribute("type","button"),r.className="copyToClipboardButton";var o=document.createElement("div");o.className="copyToClipboardPositionDiv";var i=document.createElement("i");i.className="copyToClipboardIcon",r.appendChild(i);var l=document.createElement("span");l.className="copyToClipboardSpan",l.innerHTML=a("General_Copy"),r.appendChild(l),o.appendChild(r);var c=document.createElement("div");c.className="copyToClipboardCopiedDiv",c.innerHTML=a("General_CopiedToClipboard"),o.appendChild(c);var s=e.parentElement;s&&(s.classList.add("copyToClipboardWrapper"),s.appendChild(o)),t.value.onClickHandler=rr.bind(null,e),r.addEventListener("click",t.value.onClickHandler),t.value.onTransitionEndHandler=or.bind(null,e,t),r.addEventListener("transitionend",t.value.onTransitionEndHandler)}},unmounted:function(e,t){e.removeEventListener("click",t.value.onClickHandler),e.removeEventListener("transitionend",t.value.onTransitionEndHandler)}},ir={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!t.value.initialized){t.value.initialized=!0;var n=Ft.getRef(t.value.activator,t);if(n){window.$(n).show();var r=n.getAttribute("data-target");window.$("#".concat(r)).sidenav({closeOnClick:!0})}}e.classList.contains("collapsible")&&window.$(e).collapsible()}))}},lr={key:0,class:"title",tabindex:"6"},cr=["href","title"],sr={class:"iconsBar"},ur=["href","title"],dr=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),mr=[dr],pr=["title"],fr=Object(X["createElementVNode"])("span",{class:"icon-info"},null,-1),hr=[fr],br={key:2,class:"ratingIcons"},vr={class:"inlineHelp"},gr=["innerHTML"],yr=["innerHTML"],Or=["href"];
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function ar(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["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(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Wn,[Object(X["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.htmlEntities(e.actualFeatureName))},[Object(X["renderSlot"])(e.$slots,"default")],8,zn)):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",Gn,[e.helpUrl&&!e.actualInlineHelp?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},Kn,8,Yn)):Object(X["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(X["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},Zn,10,Qn)):Object(X["createCommentVNode"])("",!0),e.showRateFeature?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",er,[(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(e.rateFeature),{title:e.actualFeatureName},null,8,["title"]))])):Object(X["createCommentVNode"])("",!0)],512),[[X["vShow"],e.showIcons||e.showInlineHelp]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",tr,[Object(X["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,nr),""!=e.reportGenerated?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,class:"helpDate",innerHTML:e.$sanitize(e.reportGenerated)},null,8,rr)):Object(X["createCommentVNode"])("",!0),e.helpUrl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(X["toDisplayString"])(e.translate("General_MoreDetails")),9,or)):Object(X["createCommentVNode"])("",!0)],512),[[X["vShow"],e.showInlineHelp]])],544)}var ir=Object(X["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},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,t=this.$refs.root;if(!this.actualInlineHelp){var n,r=t.querySelector(".title .inlineHelp");if(!r&&null!==(n=t.parentElement)&&void 0!==n&&n.nextElementSibling&&(r=t.parentElement.nextElementSibling.querySelector(".reportDocumentation")),r){var o,a=null===(o=r.getAttribute("data-content"))||void 0===o?void 0:o.trim();a&&a.length&&(this.actualInlineHelp="".concat(a,"
"),setTimeout((function(){return r.remove()}),0))}}this.actualFeatureName||(this.actualFeatureName=null===(e=t.querySelector(".title"))||void 0===e?void 0:e.textContent);if(ue.period&&ue.currentDateString){var i=m.parse(ue.period,ue.currentDateString);this.reportGenerated&&i.containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:this.reportGenerated,items:"div",show:!1,hide:!1})}},methods:{htmlEntities:function(e){return ue.helper.htmlEntities(e)}},computed:{showRateFeature:function(){return"Feedback_SendFeedback"!==i("Feedback_SendFeedback")},rateFeature:function(){return this.showRateFeature?Ot("Feedback","RateFeature"):""}}});ir.render=ar;var lr=ir,cr={class:"card-content"},sr={key:0,class:"card-title"},ur={key:1,class:"card-title"},dr={ref:"content"},mr={key:0,class:"card-image hide-on-med-and-down"},pr=["src","alt"];function fr(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("EnrichedHeadline");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])({card:!0,"card-with-image":!!this.imageUrl}),ref:"root"},[Object(X["createElementVNode"])("div",cr,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("h2",sr,Object(X["toDisplayString"])(e.decode(e.contentTitle)),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(X["openBlock"])(),Object(X["createElementBlock"])("h2",ur,[Object(X["createVNode"])(i,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(X["withCtx"])((function(){return[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.decode(e.contentTitle)),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",dr,[Object(X["renderSlot"])(e.$slots,"default")],512)]),e.imageUrl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",mr,[Object(X["createElementVNode"])("img",{src:e.imageUrl,alt:e.actualImageAltText},null,8,pr)])):Object(X["createCommentVNode"])("",!0)],2)}var hr=null,br=window,gr=br.$,vr=Object(X["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String,imageUrl:String,imageAltText:String},components:{EnrichedHeadline:lr},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText,actualImageAltText:this.imageAltText?this.imageAltText:this.contentTitle}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e=this,t=this.$refs.root,n=this.$refs.content;if(this.anchor&&t&&t.parentElement){var r=document.createElement("a");r.id=this.anchor,gr(t.parentElement).prepend(r)}setTimeout((function(){var t=n.querySelector(".contentHelp");t&&(e.actualHelpText=t.innerHTML,t.remove())}),0),this.actualFeature&&"true"===this.actualFeature&&(this.actualFeature=this.contentTitle),null===hr&&(hr=document.querySelector("#content.admin"));var o=null;if(hr&&(o=hr.offsetTop),o||0===o){var a=t.closest(".widgetLoader"),i=a?a.offsetTop:t.offsetTop;i-o<17&&(t.style.marginTop="0")}},methods:{decode:function(e){return ue.helper.htmlDecode(e)}}});vr.render=fr;var yr=vr,Or={key:0,ref:"root",class:"matomo-comparisons"},jr={class:"comparison-type"},wr=["title"],kr=["href"],Sr=["title"],Cr={class:"comparison-period-label"},Er=["onClick"],Dr=["title"],Pr={class:"loadingPiwik",style:{display:"none"}},Tr=["alt"];function Vr(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("tooltips");return e.isComparing?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Or,[Object(X["createElementVNode"])("h3",null,Object(X["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.segmentComparisons,(function(t,n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(X["createElementVNode"])("div",jr,Object(X["toDisplayString"])(e.translate("General_Segment")),1),Object(X["createElementVNode"])("div",{class:"title",title:e.getTitleTooltip(t)},[Object(X["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(X["toDisplayString"])(t.title),9,kr)],8,wr),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.periodComparisons,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(X["createElementVNode"])("span",{class:"comparison-dot",style:Object(X["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(X["createElementVNode"])("span",Cr,Object(X["toDisplayString"])(n.title)+" ("+Object(X["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,Sr)})),128)),e.segmentComparisons.length>1?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(X["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,Dr)],8,Er)):Object(X["createCommentVNode"])("",!0)])})),128)),Object(X["createElementVNode"])("div",Pr,[Object(X["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Tr),Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)),[[i,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(X["createCommentVNode"])("",!0)}function Nr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ir(e,t){for(var n=0;n".concat(a,"
"),setTimeout((function(){return r.remove()}),0))}}this.actualFeatureName||(this.actualFeatureName=null===(e=t.querySelector(".title"))||void 0===e?void 0:e.textContent);if(ue.period&&ue.currentDateString){var i=m.parse(ue.period,ue.currentDateString);this.reportGenerated&&i.containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:this.reportGenerated,items:"div",show:!1,hide:!1})}},methods:{htmlEntities:function(e){return ue.helper.htmlEntities(e)}},computed:{showRateFeature:function(){return"Feedback_SendFeedback"!==i("Feedback_SendFeedback")},rateFeature:function(){return this.showRateFeature?Lt("Feedback","RateFeature"):""}}});wr.render=jr;var kr=wr,Sr={class:"card-content"},Cr={key:0,class:"card-title"},Er={key:1,class:"card-title"},Dr={ref:"content"},Pr={key:0,class:"card-image hide-on-med-and-down"},Tr=["src","alt"];function Vr(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("EnrichedHeadline");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])({card:!0,"card-with-image":!!this.imageUrl}),ref:"root"},[Object(X["createElementVNode"])("div",Sr,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("h2",Cr,Object(X["toDisplayString"])(e.decode(e.contentTitle)),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(X["openBlock"])(),Object(X["createElementBlock"])("h2",Er,[Object(X["createVNode"])(i,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(X["withCtx"])((function(){return[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.decode(e.contentTitle)),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",Dr,[Object(X["renderSlot"])(e.$slots,"default")],512)]),e.imageUrl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Pr,[Object(X["createElementVNode"])("img",{src:e.imageUrl,alt:e.actualImageAltText},null,8,Tr)])):Object(X["createCommentVNode"])("",!0)],2)}var Nr=null,Ir=window,xr=Ir.$,Br=Object(X["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String,imageUrl:String,imageAltText:String},components:{EnrichedHeadline:kr},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText,actualImageAltText:this.imageAltText?this.imageAltText:this.contentTitle}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e=this,t=this.$refs.root,n=this.$refs.content;if(this.anchor&&t&&t.parentElement){var r=document.createElement("a");r.id=this.anchor,xr(t.parentElement).prepend(r)}setTimeout((function(){var t=n.querySelector(".contentHelp");t&&(e.actualHelpText=t.innerHTML,t.remove())}),0),this.actualFeature&&"true"===this.actualFeature&&(this.actualFeature=this.contentTitle),null===Nr&&(Nr=document.querySelector("#content.admin"));var o=null;if(Nr&&(o=Nr.offsetTop),o||0===o){var a=t.closest(".widgetLoader"),i=a?a.offsetTop:t.offsetTop;i-o<17&&(t.style.marginTop="0")}},methods:{decode:function(e){return ue.helper.htmlDecode(e)}}});Br.render=Vr;var Ar=Br,Mr={key:0,ref:"root",class:"matomo-comparisons"},Lr={class:"comparison-type"},_r=["title"],Fr=["href"],Rr=["title"],Hr={class:"comparison-period-label"},Ur=["onClick"],$r=["title"],qr={class:"loadingPiwik",style:{display:"none"}},Wr=["alt"];function zr(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("tooltips");return e.isComparing?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Mr,[Object(X["createElementVNode"])("h3",null,Object(X["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.segmentComparisons,(function(t,n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(X["createElementVNode"])("div",Lr,Object(X["toDisplayString"])(e.translate("General_Segment")),1),Object(X["createElementVNode"])("div",{class:"title",title:e.getTitleTooltip(t)},[Object(X["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(X["toDisplayString"])(t.title),9,Fr)],8,_r),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.periodComparisons,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(X["createElementVNode"])("span",{class:"comparison-dot",style:Object(X["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(X["createElementVNode"])("span",Hr,Object(X["toDisplayString"])(n.title)+" ("+Object(X["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,Rr)})),128)),e.segmentComparisons.length>1?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(X["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,$r)],8,Ur)):Object(X["createCommentVNode"])("",!0)])})),128)),Object(X["createElementVNode"])("div",qr,[Object(X["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Wr),Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)),[[i,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(X["createCommentVNode"])("",!0)}function Gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yr(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%Gr;if(0===n)return this.colors["series".concat(r)];var o=n%Yr;return this.colors["series".concat(r,"-shade").concat(o)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%Gr);return t>0&&(n+="-shade".concat(t%Yr)),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(o){t.push({index:n,params:Object.assign(Object.assign({},o.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=Mr(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={},o={},a=!1,i=!1;e.forEach((function(e){a?r[e.params.segment]=!0:a=!0})),t.forEach((function(e){i?o["".concat(e.params.period,"|").concat(e.params.date)]=!0:i=!0}));var l=[],c=[];Object.keys(o).forEach((function(e){var t=e.split("|");l.push(t[0]),c.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:l,compareDates:c},u=ue.helper.isReportingPage()?De.hashParsed.value:De.urlParsed.value;De.updateLocation(Object.assign(Object.assign(Object.assign({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=ue.ColorManager;if(!e)return[];for(var t=[],n=0;n")):e}return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r,transformTooltipContent:o}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),Qr.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return a("CoreHome_PeriodRange");var n=a("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]},getTitleTooltip:function(e){return"".concat(this.htmlentities(e.title),"
")+"".concat(this.htmlentities(decodeURIComponent(e.params.segment)))},getUrlToSegment:function(e){var t=Object.assign({},De.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(De.stringify(t))},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,Qr.isComparing()){var t=Qr.getPeriodComparisons(),n=Qr.getSegmentComparisons();Ze.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:De.getSearchParam("compareSegments"),comparePeriods:De.getSearchParam("comparePeriods"),compareDates:De.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var o=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=o}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=Qr.getComparisonSeriesIndex(t.index,0),o=e.reportData.comparisons[r],i=Qr.getComparisonSeriesIndex(t.index,n.index),l=e.reportData.comparisons[i],c=e.reportData.comparisons[n.index],s='',u=(l.nb_visits/o.nb_visits*100).toFixed(2);return u="".concat(u,"%"),s+=a("General_ComparisonCardTooltip1",["'".concat(l.compareSegmentPretty,"'"),l.comparePeriodPretty,u,l.nb_visits.toString(),o.nb_visits.toString()]),t.index>0&&(s+="
",s+=a("General_ComparisonCardTooltip2",[l.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),s+="
",s},htmlentities:function(e){return ue.helper.htmlEntities(e)}},mounted:function(){var e=this;ue.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged()}});Xr.render=Vr;var Zr=Xr,eo={ref:"root",class:"menuDropdown"},to=["title"],no=["innerHTML"],ro=Object(X["createElementVNode"])("span",{class:"icon-chevron-down reporting-menu-sub-icon"},null,-1),oo={class:"items"},ao={key:0,class:"search"},io=["placeholder"],lo=["title"],co=["title"];function so(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("focus-if"),l=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",eo,[Object(X["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(X["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,no),ro],8,to),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",oo,[e.showSearch&&e.showItems?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ao,[Object(X["withDirectives"])(Object(X["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,io),[[X["vModelText"],e.searchTerm],[i,{focused:e.showItems}]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",{class:"search_ico icon-search",title:e.translate("General_Search")},null,8,lo),[[X["vShow"],!e.searchTerm]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",{onClick:t[3]||(t[3]=function(t){e.searchTerm="",e.searchItems("")}),class:"reset icon-close",title:e.translate("General_Clear")},null,8,co),[[X["vShow"],e.searchTerm]])])):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(X["renderSlot"])(e.$slots,"default")])],512),[[X["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var uo=window,mo=uo.$,po=Object(X["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:Boolean},directives:{FocusAnywhereButHere:tn,FocusIf:rn},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")||(this.menuTitleChangeOnClick&&(this.actualMenuTitle=(e.target.textContent||"").replace(/[\u0000-\u2666]/g,(function(e){return"".concat(e.charCodeAt(0),";")}))),this.showItems=!1,mo(this.$slots.default()[0].el).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect",e.target))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();mo(this.$refs.root).find(".item").each((function(e,n){var r=mo(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});po.render=so;var fo=po,ho={ref:"root"};function bo(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ho,null,512)}var go=1,vo=window,yo=vo.$,Oo=Object(X["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(X["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 o=r.length?r:t;o.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function o(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return a(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function a(e,t,n){var r,a=e.parent(),i=a.children("td");if(a.is(":first-child")){var l=a.children("td:not(.ui-datepicker-other-month)").first();return r=o(l,t,n),r.setDate(i.index(e)-i.index(l)+1),r}var c=a.children("td:not(.ui-datepicker-other-month)").last();return r=o(c,t,n),r.setDate(r.getDate()+i.index(e)-i.index(c)),r}function i(){var e=yo(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),o=parseInt(t.attr("data-year"),10);return[r,o]}function l(){var e=yo(n.value),t=e.find(".ui-datepicker-calendar"),a=i(),l=t.find("td"),c=l.first(),s=o(c,a[0],a[1]);l.each((function(){r(yo(this),s),s.setDate(s.getDate()+1)}))}function c(){if(!e.viewDate)return!1;var t;if("string"===typeof e.viewDate)try{t=h(e.viewDate)}catch(a){return!1}else t=e.viewDate;var r=yo(n.value),o=i();return(o[0]!==t.getMonth()||o[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function s(){var e=yo(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 u(){var t=yo(n.value),r=e.stepMonths||go;if(t.datepicker("option","stepMonths")===r)return!1;var o=yo(".ui-datepicker-month",t).val(),a=yo(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(a,o)),s(),!0}function d(){var t=yo(n.value),r=t.find(".ui-datepicker-month")[0];r&&(r.disabled=e.disableMonthDropdown)}function m(){if(yo(this).hasClass("ui-state-hover")){var e=yo(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function p(){d(),l()}return Object(X["watch"])((function(){return Object.assign({},e)}),(function(e,t){var n=!1;[function(e){return e.selectedDateStart},function(e){return e.selectedDateEnd},function(e){return e.highlightedDateStart},function(e){return e.highlightedDateEnd}].forEach((function(r){if(!n){var o=r(e),a=r(t);!o&&a&&(n=!0),o&&!a&&(n=!0),o&&a&&o.getTime()!==a.getTime()&&(n=!0)}})),e.viewDate!==t.viewDate&&c()&&(n=!0),e.stepMonths!==t.stepMonths&&u(),e.disableMonthDropdown!==t.disableMonthDropdown&&d(),n&&l()})),Object(X["onMounted"])((function(){var r=yo(n.value),a=e.options||{},f=Object.assign(Object.assign(Object.assign({},ue.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:function(){setTimeout((function(){s()}))}});r.datepicker(f),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=i(),n=yo(this),r=o(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",m),r.on("click",(function(e){e.preventDefault();var t=yo(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&p()})),r.on("click","td[data-month]",(function(e){var n=yo(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),o=parseInt(n.attr("data-year"),10),a=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(o,r,a)})}));var h=u();c(),d(),h||s(),l()})),{root:n}}});Oo.render=bo;var jo=Oo,wo={class:"dateRangePicker"},ko={id:"calendarRangeFrom"},So={id:"calendarRangeTo"};function Co(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DatePicker");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",wo,[Object(X["createElementVNode"])("div",ko,[Object(X["createElementVNode"])("h6",null,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(X["withDirectives"])(Object(X["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),[[X["vModelText"],e.startDateText]])]),Object(X["createVNode"])(i,{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(X["createElementVNode"])("div",So,[Object(X["createElementVNode"])("h6",null,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(X["withDirectives"])(Object(X["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),[[X["vModelText"],e.endDateText]])]),Object(X["createVNode"])(i,{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 Eo="YYYY-MM-DD",Do=Object(X["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:jo},data:function(){var e=null;try{this.startDate&&(e=h(this.startDate))}catch(n){}var t=null;try{this.endDate&&(t=h(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){this.startDateInvalid=!0;var t=null;try{e&&e.length===Eo.length&&(t=h(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){this.endDateInvalid=!0;var t=null;try{e&&e.length===Eo.length&&(t=h(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:this.fromPickerSelectedDates[0]?p(this.fromPickerSelectedDates[0]):null,end:this.toPickerSelectedDates[0]?p(this.toPickerSelectedDates[0]):null})}}});Do.render=Co;var Po=Do;function To(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DatePicker");return Object(X["openBlock"])(),Object(X["createBlock"])(i,{"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 Vo=new Date(ue.minDateYear,ue.minDateMonth-1,ue.minDateDay),No=new Date(ue.maxDateYear,ue.maxDateMonth-1,ue.maxDateDay),Io=Object(X["defineComponent"])({props:{period:{type:String,required:!0},date:[String,Date]},components:{DatePicker:jo},emits:["select"],setup:function(e,t){var n=Object(X["ref"])(e.date),r=Object(X["ref"])([null,null]),o=Object(X["ref"])([null,null]);function a(t){var n=m.get(e.period).parse(t).getDateRange();return n[0]=Von[1]?n[1]:No,n}function i(t,n){var r=tNo,i=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);o.value=r||i?[null,null]:a(t)}function l(){o.value=[null,null]}function c(e){t.emit("select",{date:e})}function s(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=a(e.date),n.value=h(e.date)}return Object(X["watch"])(e,s),s(),{selectedDates:r,highlightedDates:o,viewDate:n,onHoverNormalCell:i,onHoverLeaveNormalCells:l,onDateSelected:c}}});Io.render=To;var xo=Io,Bo={key:0},Ao=["data-notification-instance-id"],Lo={key:1},Mo={class:"notification-body"},_o=["innerHTML"],Fo={key:1};function Ro(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createBlock"])(X["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(X["withCtx"])((function(){return[e.deleted?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Bo,[Object(X["createVNode"])(X["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(X["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",{class:Object(X["normalizeClass"])(["notification system",e.cssClasses]),style:Object(X["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(X["createCommentVNode"])("",!0),e.title?(Object(X["openBlock"])(),Object(X["createElementBlock"])("strong",Lo,Object(X["toDisplayString"])(e.title),1)):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",Mo,[e.message?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,_o)):Object(X["createCommentVNode"])("",!0),e.message?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Fo,[Object(X["renderSlot"])(e.$slots,"default")]))])],14,Ao)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var Ho=window,Uo=Ho.$,$o=Object(X["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&&Uo(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(X["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(X["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Ze.post({module:"CoreHome",action:"markNotificationAsRead"},{notificationId:this.notificationId},{withTokenInUrl:!0})}}});$o.render=Ro;var qo=$o,Wo={class:"notification-group"},zo=["innerHTML"];function Go(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Notification");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Wo,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.notifications,(function(t,n){return Object(X["openBlock"])(),Object(X["createBlock"])(i,{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(X["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(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,zo)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}function Yo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Jo(e,t){for(var n=0;n1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%so;if(0===n)return this.colors["series".concat(r)];var o=n%uo;return this.colors["series".concat(r,"-shade").concat(o)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%so);return t>0&&(n+="-shade".concat(t%uo)),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(o){t.push({index:n,params:Object.assign(Object.assign({},o.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=Zr(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={},o={},a=!1,i=!1;e.forEach((function(e){a?r[e.params.segment]=!0:a=!0})),t.forEach((function(e){i?o["".concat(e.params.period,"|").concat(e.params.date)]=!0:i=!0}));var l=[],c=[];Object.keys(o).forEach((function(e){var t=e.split("|");l.push(t[0]),c.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:l,compareDates:c},u=ue.helper.isReportingPage()?De.hashParsed.value:De.urlParsed.value;De.updateLocation(Object.assign(Object.assign(Object.assign({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=ue.ColorManager;if(!e)return[];for(var t=[],n=0;n")):e}return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r,transformTooltipContent:o}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),fo.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return a("CoreHome_PeriodRange");var n=a("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]},getTitleTooltip:function(e){return"".concat(this.htmlentities(e.title),"
")+"".concat(this.htmlentities(decodeURIComponent(e.params.segment)))},getUrlToSegment:function(e){var t=Object.assign({},De.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(De.stringify(t))},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,fo.isComparing()){var t=fo.getPeriodComparisons(),n=fo.getSegmentComparisons();Ze.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:De.getSearchParam("compareSegments"),comparePeriods:De.getSearchParam("comparePeriods"),compareDates:De.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var o=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=o}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=fo.getComparisonSeriesIndex(t.index,0),o=e.reportData.comparisons[r],i=fo.getComparisonSeriesIndex(t.index,n.index),l=e.reportData.comparisons[i],c=e.reportData.comparisons[n.index],s='',u=(l.nb_visits/o.nb_visits*100).toFixed(2);return u="".concat(u,"%"),s+=a("General_ComparisonCardTooltip1",["'".concat(l.compareSegmentPretty,"'"),l.comparePeriodPretty,u,l.nb_visits.toString(),o.nb_visits.toString()]),t.index>0&&(s+="
",s+=a("General_ComparisonCardTooltip2",[l.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),s+="
",s},htmlentities:function(e){return ue.helper.htmlEntities(e)}},mounted:function(){var e=this;ue.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged()}});ho.render=zr;var bo=ho,vo={ref:"root",class:"menuDropdown"},go=["title"],yo=["innerHTML"],Oo=Object(X["createElementVNode"])("span",{class:"icon-chevron-down reporting-menu-sub-icon"},null,-1),jo={class:"items"},wo={key:0,class:"search"},ko=["placeholder"],So=["title"],Co=["title"];function Eo(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("focus-if"),l=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",vo,[Object(X["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(X["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,yo),Oo],8,go),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",jo,[e.showSearch&&e.showItems?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",wo,[Object(X["withDirectives"])(Object(X["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,ko),[[X["vModelText"],e.searchTerm],[i,{focused:e.showItems}]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",{class:"search_ico icon-search",title:e.translate("General_Search")},null,8,So),[[X["vShow"],!e.searchTerm]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",{onClick:t[3]||(t[3]=function(t){e.searchTerm="",e.searchItems("")}),class:"reset icon-close",title:e.translate("General_Clear")},null,8,Co),[[X["vShow"],e.searchTerm]])])):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(X["renderSlot"])(e.$slots,"default")])],512),[[X["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var Do=window,Po=Do.$,To=Object(X["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:Boolean},directives:{FocusAnywhereButHere:gn,FocusIf:On},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")||(this.menuTitleChangeOnClick&&(this.actualMenuTitle=(e.target.textContent||"").replace(/[\u0000-\u2666]/g,(function(e){return"".concat(e.charCodeAt(0),";")}))),this.showItems=!1,Po(this.$slots.default()[0].el).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect",e.target))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();Po(this.$refs.root).find(".item").each((function(e,n){var r=Po(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});To.render=Eo;var Vo=To,No={ref:"root"};function Io(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",No,null,512)}var xo=1,Bo=window,Ao=Bo.$,Mo=Object(X["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(X["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 o=r.length?r:t;o.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function o(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return a(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function a(e,t,n){var r,a=e.parent(),i=a.children("td");if(a.is(":first-child")){var l=a.children("td:not(.ui-datepicker-other-month)").first();return r=o(l,t,n),r.setDate(i.index(e)-i.index(l)+1),r}var c=a.children("td:not(.ui-datepicker-other-month)").last();return r=o(c,t,n),r.setDate(r.getDate()+i.index(e)-i.index(c)),r}function i(){var e=Ao(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),o=parseInt(t.attr("data-year"),10);return[r,o]}function l(){var e=Ao(n.value),t=e.find(".ui-datepicker-calendar"),a=i(),l=t.find("td"),c=l.first(),s=o(c,a[0],a[1]);l.each((function(){r(Ao(this),s),s.setDate(s.getDate()+1)}))}function c(){if(!e.viewDate)return!1;var t;if("string"===typeof e.viewDate)try{t=h(e.viewDate)}catch(a){return!1}else t=e.viewDate;var r=Ao(n.value),o=i();return(o[0]!==t.getMonth()||o[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function s(){var e=Ao(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 u(){var t=Ao(n.value),r=e.stepMonths||xo;if(t.datepicker("option","stepMonths")===r)return!1;var o=Ao(".ui-datepicker-month",t).val(),a=Ao(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(a,o)),s(),!0}function d(){var t=Ao(n.value),r=t.find(".ui-datepicker-month")[0];r&&(r.disabled=e.disableMonthDropdown)}function m(){if(Ao(this).hasClass("ui-state-hover")){var e=Ao(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function p(){d(),l()}return Object(X["watch"])((function(){return Object.assign({},e)}),(function(e,t){var n=!1;[function(e){return e.selectedDateStart},function(e){return e.selectedDateEnd},function(e){return e.highlightedDateStart},function(e){return e.highlightedDateEnd}].forEach((function(r){if(!n){var o=r(e),a=r(t);!o&&a&&(n=!0),o&&!a&&(n=!0),o&&a&&o.getTime()!==a.getTime()&&(n=!0)}})),e.viewDate!==t.viewDate&&c()&&(n=!0),e.stepMonths!==t.stepMonths&&u(),e.disableMonthDropdown!==t.disableMonthDropdown&&d(),n&&l()})),Object(X["onMounted"])((function(){var r=Ao(n.value),a=e.options||{},f=Object.assign(Object.assign(Object.assign({},ue.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:function(){setTimeout((function(){s()}))}});r.datepicker(f),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=i(),n=Ao(this),r=o(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",m),r.on("click",(function(e){e.preventDefault();var t=Ao(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&p()})),r.on("click","td[data-month]",(function(e){var n=Ao(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),o=parseInt(n.attr("data-year"),10),a=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(o,r,a)})}));var h=u();c(),d(),h||s(),l()})),{root:n}}});Mo.render=Io;var Lo=Mo,_o={class:"dateRangePicker"},Fo={id:"calendarRangeFrom"},Ro={id:"calendarRangeTo"};function Ho(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DatePicker");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",_o,[Object(X["createElementVNode"])("div",Fo,[Object(X["createElementVNode"])("h6",null,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(X["withDirectives"])(Object(X["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),[[X["vModelText"],e.startDateText]])]),Object(X["createVNode"])(i,{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(X["createElementVNode"])("div",Ro,[Object(X["createElementVNode"])("h6",null,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(X["withDirectives"])(Object(X["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),[[X["vModelText"],e.endDateText]])]),Object(X["createVNode"])(i,{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 Uo="YYYY-MM-DD",$o=Object(X["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:Lo},data:function(){var e=null;try{this.startDate&&(e=h(this.startDate))}catch(n){}var t=null;try{this.endDate&&(t=h(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){this.startDateInvalid=!0;var t=null;try{e&&e.length===Uo.length&&(t=h(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){this.endDateInvalid=!0;var t=null;try{e&&e.length===Uo.length&&(t=h(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:this.fromPickerSelectedDates[0]?p(this.fromPickerSelectedDates[0]):null,end:this.toPickerSelectedDates[0]?p(this.toPickerSelectedDates[0]):null})}}});$o.render=Ho;var qo=$o;function Wo(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DatePicker");return Object(X["openBlock"])(),Object(X["createBlock"])(i,{"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 zo=new Date(ue.minDateYear,ue.minDateMonth-1,ue.minDateDay),Go=new Date(ue.maxDateYear,ue.maxDateMonth-1,ue.maxDateDay),Yo=Object(X["defineComponent"])({props:{period:{type:String,required:!0},date:[String,Date]},components:{DatePicker:Lo},emits:["select"],setup:function(e,t){var n=Object(X["ref"])(e.date),r=Object(X["ref"])([null,null]),o=Object(X["ref"])([null,null]);function a(t){var n=m.get(e.period).parse(t).getDateRange();return n[0]=zon[1]?n[1]:Go,n}function i(t,n){var r=tGo,i=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);o.value=r||i?[null,null]:a(t)}function l(){o.value=[null,null]}function c(e){t.emit("select",{date:e})}function s(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=a(e.date),n.value=h(e.date)}return Object(X["watch"])(e,s),s(),{selectedDates:r,highlightedDates:o,viewDate:n,onHoverNormalCell:i,onHoverLeaveNormalCells:l,onDateSelected:c}}});Yo.render=Wo;var Jo=Yo,Ko={key:0},Qo=["data-notification-instance-id"],Xo={key:1},Zo={class:"notification-body"},ea=["innerHTML"],ta={key:1};function na(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createBlock"])(X["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(X["withCtx"])((function(){return[e.deleted?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ko,[Object(X["createVNode"])(X["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(X["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",{class:Object(X["normalizeClass"])(["notification system",e.cssClasses]),style:Object(X["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(X["createCommentVNode"])("",!0),e.title?(Object(X["openBlock"])(),Object(X["createElementBlock"])("strong",Xo,Object(X["toDisplayString"])(e.title),1)):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",Zo,[e.message?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,ea)):Object(X["createCommentVNode"])("",!0),e.message?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ta,[Object(X["renderSlot"])(e.$slots,"default")]))])],14,Qo)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var ra=window,oa=ra.$,aa=Object(X["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&&oa(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(X["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(X["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Ze.post({module:"CoreHome",action:"markNotificationAsRead"},{notificationId:this.notificationId},{withTokenInUrl:!0})}}});aa.render=na;var ia=aa,la={class:"notification-group"},ca=["innerHTML"];function sa(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Notification");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",la,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.notifications,(function(t,n){return Object(X["openBlock"])(),Object(X["createBlock"])(i,{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(X["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(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,ca)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}function ua(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function da(e,t){for(var n=0;n'),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var a=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,a);var i=(this.nextNotificationId+=1).toString();return t.call(this,Object.assign(Object.assign({},e),{},{noclear:!!e.noclear,group:a,notificationId:e.id,notificationInstanceId:i,type:e.type||"transient"})),i}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&ue.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=e.placeat?Zo(e.placeat):void 0;if(!t||!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=ft({render:function(){return Object(X["createVNode"])(qo,Object.assign(Object.assign({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){if(e){var n=Zo(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,o=ft({template:'',data:function(){return{group:t}}});o.component("NotificationGroup",r),o.mount(n[0])}}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),ta=new ea,na=ta;Zo((function(){return ta.parseNotificationDivs()}));var ra=Object(X["defineComponent"])({props:{group:String},components:{Notification:qo},computed:{notifications:function(){var e=this;return na.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){na.remove(e)}}});ra.render=Go;var oa=ra,aa=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),ia=[aa];
+ */var fa=window,ha=fa.$,ba=function(){function e(){ua(this,e),pa(this,"privateState",Object(X["reactive"])({notifications:[]})),pa(this,"nextNotificationId",0)}return ma(e,[{key:"state",get:function(){return Object(X["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=ha('[data-role="notification"]'),n=[];t.each((function(e,r){var o=ha(r),a=o.data(),i=o.html();i&&n.push(Object.assign(Object.assign({},a),{},{message:i,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",o=document.querySelector(r);o&&(o.querySelector("#modalNotificationContainer")||ha(o).prepend(''),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var a=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,a);var i=(this.nextNotificationId+=1).toString();return t.call(this,Object.assign(Object.assign({},e),{},{noclear:!!e.noclear,group:a,notificationId:e.id,notificationInstanceId:i,type:e.type||"transient"})),i}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&ue.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=e.placeat?ha(e.placeat):void 0;if(!t||!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=Nt({render:function(){return Object(X["createVNode"])(ia,Object.assign(Object.assign({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){if(e){var n=ha(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,o=Nt({template:'',data:function(){return{group:t}}});o.component("NotificationGroup",r),o.mount(n[0])}}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),va=new ba,ga=va;ha((function(){return va.parseNotificationDivs()}));var ya=Object(X["defineComponent"])({props:{group:String},components:{Notification:ia},computed:{notifications:function(){var e=this;return ga.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){ga.remove(e)}}});ya.render=sa;var Oa=ya,ja=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),wa=[ja];
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function la(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{class:"item-help-icon",tabindex:"5",href:"javascript:",onClick:t[0]||(t[0]=function(){return e.showHelp&&e.showHelp.apply(e,arguments)})},ia)}var ca="reportingMenu-help",sa=Object(X["defineComponent"])({props:{message:{type:String,required:!0},name:{type:String,required:!0}},data:function(){return{currentName:""}},methods:{showHelp:function(){if(""!==this.currentName)return na.remove(ca),void(this.currentName="");na.show({context:"info",id:ca,type:"help",noclear:!0,class:"help-notification",message:this.message,placeat:"#notificationContainer",prepend:!0}),""!==this.name&&(this.currentName=this.name)}}});sa.render=la;var ua=sa;function da(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ma(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.state.isInitialized&&0===n.length?Promise.resolve(Object(X["readonly"])(this.state.initialSites)):this.stateFiltered.isInitialized&&n.length===this.stateFiltered.excludedSites.length&&n.every((function(t,n){return t===e.stateFiltered.excludedSites[n]}))?Promise.resolve(Object(X["readonly"])(this.stateFiltered.initialSites)):(n.length>0&&this.searchSite("%",t,n).then((function(t){e.stateFiltered.isInitialized=!0,e.stateFiltered.excludedSites=n,null!==t&&(e.stateFiltered.initialSites=t)})),this.state.isInitialized?Promise.resolve(Object(X["readonly"])(this.state.initialSites)):this.searchSite("%",t,n).then((function(t){return e.state.isInitialized=!0,null!==t&&(e.state.initialSites=t),t})))}},{key:"loadSite",value:function(e){"all"===e?De.updateUrl(Object.assign(Object.assign({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period})):De.updateUrl(Object.assign(Object.assign({},De.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},De.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Ze.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(o){var a=o.value,i="SitesManager.getPatternMatchSites";return n&&(i="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Ze.fetch({method:i,limit:a,pattern:e,sitesToExclude:r},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites(n,r)}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Object.assign(Object.assign({},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:0})),t):[]}}]),e}(),ba=new ha,ga=["value","name"],va=["title"],ya=["textContent"],Oa={key:1,class:"placeholder"},ja={class:"dropdown"},wa={class:"custom_select_search"},ka=["placeholder"],Sa={key:0},Ca={class:"custom_select_container"},Ea=["onClick"],Da=["innerHTML","href","title"],Pa={class:"custom_select_ul_list"},Ta={class:"noresult"},Va={key:1};function Na(e,t,n,r,o,a){var i,l,c,s,u=Object(X["resolveComponent"])("AllSitesLink"),d=Object(X["resolveDirective"])("focus-if"),m=Object(X["resolveDirective"])("tooltips"),p=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(X["openBlock"])(),Object(X["createElementBlock"])("input",{key:0,type:"hidden",value:null===(i=e.displayedModelValue)||void 0===i?void 0:i.id,name:e.name},null,8,ga)):Object(X["createCommentVNode"])("",!0),Object(X["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(X["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(X["createElementVNode"])("span",{class:Object(X["normalizeClass"])(["icon icon-chevron-down",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(X["createElementVNode"])("span",null,[null!==(l=e.displayedModelValue)&&void 0!==l&&l.name||!e.placeholder?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,textContent:Object(X["toDisplayString"])((null===(c=e.displayedModelValue)||void 0===c?void 0:c.name)||e.firstSiteName)},null,8,ya)):Object(X["createCommentVNode"])("",!0),null!==(s=e.displayedModelValue)&&void 0!==s&&s.name||!e.placeholder?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",Oa,Object(X["toDisplayString"])(e.placeholder),1))])],42,va),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",ja,[Object(X["withDirectives"])(Object(X["createElementVNode"])("div",wa,[Object(X["withDirectives"])(Object(X["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,ka),[[X["vModelText"],e.searchTerm],[d,{focused:e.shouldFocusOnSearch}]]),Object(X["withDirectives"])(Object(X["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),[[X["vShow"],e.searchTerm]])],512),[[X["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Sa,[Object(X["createVNode"])(u,{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(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",Ca,[Object(X["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.sites,(function(n,r){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{onClick:function(t){return e.switchSite(Object.assign(Object.assign({},n),{},{id:n.idsite}),t)},key:r},[Object(X["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,Da)],8,Ea)),[[X["vShow"],!(!e.showSelectedSite&&"".concat(e.activeSiteId)==="".concat(n.idsite))]])})),128))]),Object(X["withDirectives"])(Object(X["createElementVNode"])("ul",Pa,[Object(X["createElementVNode"])("li",null,[Object(X["createElementVNode"])("div",Ta,Object(X["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[X["vShow"],!e.sites.length&&e.searchTerm]])],512),[[m,{content:e.tooltipContent}]]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Va,[Object(X["createVNode"])(u,{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(X["createCommentVNode"])("",!0)],512),[[X["vShow"],e.showSitesList]])],2)),[[p,{blur:e.onBlur}]])}var Ia=["innerHTML","href"];function xa(e,t,n,r,o,a){var i=this;return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return i.onClick(e)}),class:"custom_select_all"},[Object(X["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Ia)])}var Ba=Object(X["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Ba.render=xa;var Aa=Ba,La=Object(X["defineComponent"])({props:{modelValue:Object,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:a("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean,sitesToExclude:{type:Array,default:function(){return[]}}},emits:["update:modelValue","blur"],components:{AllSitesLink:Aa},directives:{FocusAnywhereButHere:tn,FocusIf:rn,Tooltips:sn},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:"".concat(ue.idSite),showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(ue.config.autocomplete_min_sites,10)}},created:function(){this.searchSite=St(this.searchSite),!this.modelValue&&ue.idSite&&this.$emit("update:modelValue",{id:ue.idSite,name:ue.helper.htmlDecode(ue.siteName)})},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.shouldDefaultToFirstSite&&e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=a("CoreHome_ShortcutWebsiteSelector");ue.helper.registerShortcut("w",t,(function(t){if(!t.altKey){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e.$refs.selectorLink;n&&(n.click(),n.focus())}}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?a("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){var e=ba.initialSitesFiltered.value&&ba.initialSitesFiltered.value.length?ba.initialSitesFiltered.value:ba.initialSites.value;return e&&e.length>1},firstSiteName:function(){var e=ba.initialSitesFiltered.value&&ba.initialSitesFiltered.value.length?ba.initialSitesFiltered.value:ba.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=De.stringify(Object.assign(Object.assign({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period}));return"?".concat(e)},shouldDefaultToFirstSite:function(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue:function(){return this.modelValue?this.modelValue:ue.idSite?{id:ue.idSite,name:ue.helper.htmlDecode(ue.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null},tooltipContent:function(){return function(){var e=$(this).attr("title")||"";return ue.helper.htmlEntities(e)}}},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({id:"all",name:this.$props.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.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&ba.loadSite(e.id))},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 this.htmlEntities(e);var n=this.htmlEntities(e.substring(0,t)),r=this.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'').concat(this.searchTerm,"").concat(r)},loadInitialSites:function(){var e=this;return ba.loadInitialSites(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,ba.searchSite(e,this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=De.stringify(Object.assign(Object.assign({},De.urlParsed.value),{},{segment:"",idSite:e})),n=De.stringify(Object.assign(Object.assign({},De.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)},htmlEntities:function(e){return ue.helper.htmlEntities(e)}}});La.render=Na;var Ma=La,_a={ref:"root",class:"quickAccessInside"},Fa=["title","placeholder"],Ra={class:"dropdown"},Ha={class:"no-result"},Ua=["onClick"],$a=["onMouseenter","onClick"],qa={class:"quickAccessMatomoSearch"},Wa=["onMouseenter","onClick"],za=["textContent"],Ga={class:"quick-access-category helpCategory"},Ya=["href"];function Ja(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("focus-if"),l=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",_a,[Object(X["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,32),Object(X["withDirectives"])(Object(X["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,placeholder:e.translate("General_Search"),ref:"input"},null,40,Fa),[[X["vModelText"],e.searchTerm],[i,{focused:e.searchActive}]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",Ra,[Object(X["withDirectives"])(Object(X["createElementVNode"])("ul",null,[Object(X["createElementVNode"])("li",Ha,Object(X["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[X["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menuItems,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",{key:t.title},[Object(X["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(X["toDisplayString"])(t.title),9,Ua),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.items,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["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(X["createElementVNode"])("a",null,Object(X["toDisplayString"])(t.name.trim()),1)],42,$a)})),128))])})),128)),Object(X["createElementVNode"])("ul",qa,[Object(X["withDirectives"])(Object(X["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(X["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[X["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("li",{class:"no-result"},Object(X["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[X["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.sites,(function(t,n){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["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(X["createElementVNode"])("a",{textContent:Object(X["toDisplayString"])(t.name)},null,8,za)],42,Wa)),[[X["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(X["createElementVNode"])("ul",null,[Object(X["createElementVNode"])("li",Ga,Object(X["toDisplayString"])(e.translate("General_HelpResources")),1),Object(X["createElementVNode"])("li",{class:Object(X["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(X["createElementVNode"])("a",{href:"https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(X["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,Ya)],34)])],512),[[X["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}var Ka=window,Qa=Ka.ListingFormatter;function Xa(e){var t=e.getBoundingClientRect(),n=window.$(window);return t.top>=0&&t.left>=0&&t.bottom<=n.height()&&t.right<=n.width()}function Za(e){e&&e.scrollIntoView&&e.scrollIntoView()}var ei=Object(X["defineComponent"])({directives:{FocusAnywhereButHere:tn,FocusIf:rn},watch:{searchActive:function(e){var t=this.$refs.root;if(t&&t.parentElement){var n=t.parentElement.classList;n.toggle("active",e),n.toggle("expanded",e)}}},mounted:function(){var e=this,t=this.$refs.root;t&&t.parentElement&&t.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),ue.helper.registerShortcut("f",a("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),Za(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=St(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector('.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]')},quickAccessTitle:function(){var e=[a("CoreHome_MenuEntries")];return this.hasSegmentSelector&&e.push(a("CoreHome_Segments")),this.hasSitesSelector&&e.push(a("SitesManager_Sites")),a("CoreHome_QuickAccessTitle",Qa.formatAnd(e))}},emits:["itemSelected","blur"],methods:{onKeypress:function(e){var t=this,n=this.searchTerm&&this.searchActive,r=9===e.which,o=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||o&&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.input&&this.$refs.input.blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!Xa(e)&&Za(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");if(e&&e.length&&e.item(this.searchIndex))return e.item(this.searchIndex)},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,o={},a=[],i=function(e){var t=Object.assign({},e);r+=1,t.menuIndex=r;var n=t.category;n in o||(a.push({title:n,items:[]}),o[n]=a.length-1);var i=o[n];a[i].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,ba.searchSite(n).then((function(e){e&&(t.sites=e)})).finally((function(){t.isLoading=!1})));var l=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 c=this.topMenuItems.filter(l),s=this.leftMenuItems.filter(l),u=this.segmentItems.filter(l);c.forEach(i),s.forEach(i),u.forEach(i),this.numMenuItems=c.length+s.length+u.length,this.menuItems=a},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){ba.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=a("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a, nav .sidenav li > div > a").forEach((function(r){var o,a,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();(!i||null!=r.parentElement&&null!=r.parentElement.tagName&&"DIV"===r.parentElement.tagName)&&(i=null===(a=r.getAttribute("title"))||void 0===a?void 0:a.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,o=window.$(n).find("> .item"),a=(null===(r=o[0])||void 0===r?void 0:r.innerText.trim())||"";a&&-1!==a.lastIndexOf("\n")&&(a=a.slice(0,a.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,r){var o,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();i&&(t.push({name:i,category:a,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=a("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var o,a,i=null===(o=r.querySelector(".segname"))||void 0===o||null===(a=o.textContent)||void 0===a?void 0:a.trim();i&&(n.push({name:i,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});ei.render=Ja;var ti=ei;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={class:"fieldArray form-group"},oi={key:0,class:"fieldUiControl"},ai=["onClick","title"];function ii(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ri,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.modelValue,(function(t,n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",ni({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",oi,[Object(X["createVNode"])(i,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},"model-modifiers":e.field.modelModifiers,placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n),"template-file":e.field.templateFile,component:e.field.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","title","name","template-file","component"])])):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,ai),[[X["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function li(e){return di(e)||ui(e)||si(e)||ci()}function ci(){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 si(e,t){if(e){if("string"===typeof e)return mi(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)?mi(e,t):void 0}}function ui(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function di(e){if(Array.isArray(e))return mi(e)}function mi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.modelValue){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});fi.render=ii;var hi=fi;function bi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var gi={class:"multiPairField form-group"},vi={key:1,class:"fieldUiControl fieldUiControl2"},yi={key:2,class:"fieldUiControl fieldUiControl3"},Oi={key:3,class:"fieldUiControl fieldUiControl4"},ji=["onClick","title"];function wi(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",gi,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.modelValue,(function(t,n){var r;return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},bi(r,"multiPairFieldTable".concat(n),!0),bi(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,class:Object(X["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(X["createVNode"])(i,{"full-width":!0,"model-value":t[e.field1.key],options:e.field1.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field1.key,t)},"model-modifiers":e.field1.modelModifiers,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title,"template-file":e.field1.templateFile,component:e.field1.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","name","title","template-file","component"])],2)):Object(X["createCommentVNode"])("",!0),e.field2?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",vi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field2.key,t)},"model-value":t[e.field2.key],"model-modifiers":e.field2.modelModifiers,placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title,"template-file":e.field2.templateFile,component:e.field2.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),e.field3?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",yi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field3.key,t)},"model-value":t[e.field3.key],"model-modifiers":e.field3.modelModifiers,placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title,"template-file":e.field3.templateFile,component:e.field3.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),e.field4?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Oi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field4.key,t)},"model-value":t[e.field4.key],"model-modifiers":e.field4.modelModifiers,placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title,"template-file":e.field4.templateFile,component:e.field4.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,ji),[[X["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function ki(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Si(e){return Pi(e)||Di(e)||Ei(e)||Ci()}function Ci(){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 Ei(e,t){if(e){if("string"===typeof e)return Ti(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)?Ti(e,t):void 0}}function Di(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Pi(e){if(Array.isArray(e))return Ti(e)}function Ti(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.modelValue){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}}});Ni.render=wi;var Ii=Ni,xi=["disabled"],Bi=Object(X["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),Ai=[Bi],Li=["title"],Mi=Object(X["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),_i={id:"periodMore",class:"dropdown"},Fi={class:"flex"},Ri={key:0,class:"period-date"},Hi={class:"period-type"},Ui={id:"otherPeriods"},$i=["onDblclick","title"],qi=["id","checked","onChange","onDblclick"],Wi={key:0,class:"compare-checkbox"},zi={id:"comparePeriodToDropdown"},Gi={key:1,class:"compare-date-range"},Yi={id:"comparePeriodStartDate"},Ji=Object(X["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),Ki={id:"comparePeriodEndDate"},Qi={class:"apply-button-container"},Xi=["disabled","value"],Zi={key:2,id:"ajaxLoadingCalendar"},el={class:"loadingSegment"},tl=["disabled"],nl=Object(X["createElementVNode"])("span",{class:"icon-chevron-right"},null,-1),rl=[nl];function ol(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DateRangePicker"),l=Object(X["resolveComponent"])("PeriodDatePicker"),c=Object(X["resolveComponent"])("Field"),s=Object(X["resolveComponent"])("ActivityIndicator"),u=Object(X["resolveDirective"])("expand-on-click");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{ref:"root",class:Object(X["normalizeClass"])(["periodSelector piwikSelector",{"periodSelector-withPrevNext":e.canShowMovePeriod}])},[e.canShowMovePeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:0,class:"move-period move-period-prev",onClick:t[0]||(t[0]=function(t){return e.movePeriod(-1)}),disabled:e.isPeriodMoveDisabled(-1)},Ai,8,xi)):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Mi,Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.currentlyViewingText),1)],8,Li),Object(X["createElementVNode"])("div",_i,[Object(X["createElementVNode"])("div",Fi,[Object(X["createElementVNode"])("div",null,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[1]||(t[1]=function(t){return e.onRangeChange(t.start,t.end)}),onSubmit:t[2]||(t[2]=function(t){return e.onApplyClicked()})},null,8,["start-date","end-date"]),[[X["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ri,[Object(X["createVNode"])(l,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[3]||(t[3]=function(t){return e.setPiwikPeriodAndDate(e.selectedPeriod,t.date)})},null,8,["period","date"])])):Object(X["createCommentVNode"])("",!0)]),Object(X["createElementVNode"])("div",Hi,[Object(X["createElementVNode"])("h6",null,Object(X["toDisplayString"])(e.translate("General_Period")),1),Object(X["createElementVNode"])("div",Ui,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.periodsFiltered,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("p",{key:n},[Object(X["createElementVNode"])("label",{class:Object(X["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(X["withDirectives"])(Object(X["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_".concat(n),"onUpdate:modelValue":t[4]||(t[4]=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,qi),[[X["vModelRadio"],e.selectedPeriod]]),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,$i)])})),128))])])]),e.isComparisonEnabled?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Wi,[Object(X["createElementVNode"])("label",null,[Object(X["withDirectives"])(Object(X["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=function(t){return e.isComparing=t})},null,512),[[X["vModelCheckbox"],e.isComparing]]),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(X["createElementVNode"])("div",zi,[Object(X["createVNode"])(c,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.comparePeriodType=t}),style:Object(X["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(X["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Gi,[Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",Yi,[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(c,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[7]||(t[7]=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"])])]),Ji,Object(X["createElementVNode"])("div",Ki,[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(c,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[8]||(t[8]=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(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",Qi,[Object(X["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[9]||(t[9]=function(t){return e.onApplyClicked()}),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,Xi)]),e.isLoadingNewPage?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Zi,[Object(X["createVNode"])(s,{loading:!0}),Object(X["createElementVNode"])("div",el,Object(X["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(X["createCommentVNode"])("",!0)]),e.canShowMovePeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:1,class:"move-period move-period-next",onClick:t[10]||(t[10]=function(t){return e.movePeriod(1)}),disabled:e.isPeriodMoveDisabled(1)},rl,8,tl)):Object(X["createCommentVNode"])("",!0)],2)),[[u,{expander:"title"}]])}function al(e,t){return ul(e)||sl(e,t)||ll(e,t)||il()}function il(){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 ll(e,t){if(e){if("string"===typeof e)return cl(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)?cl(e,t):void 0}}function cl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr?(window.$("#alert").find("h2").text(a("General_InvalidDateRange")),ue.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return p(this.dateValue)},isErrorDisplayed:function(){return this.currentlyViewingText===a("General_Error")},isRangeSelection:function(){return"range"===this.periodValue},canShowMovePeriod:function(){return!this.isRangeSelection&&!this.isErrorDisplayed}},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(e){e!==this.periodValue&&"range"!==e&&this.setPiwikPeriodAndDate(e,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=p(t);this.setRangeStartEndFromPeriod(e,n),this.propagateNewUrlParams(n,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams:function(e,t){var n,r=this.selectedComparisonParams;ue.helper.isReportingPage()?(this.closePeriodSelector(),n=De.hashParsed.value):(this.isLoadingNewPage=!0,n=De.parsed.value);var o=Object.assign({},n);delete o.comparePeriods,delete o.comparePeriodType,delete o.compareDates,De.updateLocation(Object.assign(Object.assign({},o),{},{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)},updateComparisonValuesFromStore:function(){this.comparePeriodType="previousPeriod",this.compareStartDate="",this.compareEndDate="";var e=Qr.getPeriodComparisons();if(!(e.length<2)){var t=De.parsed.value.comparePeriodType;if(pl.includes(t)&&(this.comparePeriodType=t,"custom"===this.comparePeriodType&&"range"===e[1].params.period)){var n;try{n=m.parse(e[1].params.period,e[1].params.date)}catch(l){return}var r=n.getDateRange(),o=al(r,2),a=o[0],i=o[1];this.compareStartDate=p(a),this.compareEndDate=p(i)}}},updateSelectedValuesFromHash:function(){var e=De.parsed.value.date,t=De.parsed.value.period;this.periodValue=t,this.selectedPeriod=t,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{m.parse(t,e)}catch(l){return}if("range"===t){var n=m.get(t).parse(e),r=n.getDateRange(),o=al(r,2),a=o[0],i=o[1];this.dateValue=a,this.startRangeDate=p(a),this.endRangeDate=p(i)}else this.dateValue=h(e),this.setRangeStartEndFromPeriod(t,e)},setRangeStartEndFromPeriod:function(e,t){var n=m.parse(e,t).getDateRange();this.startRangeDate=p(n[0]bl?bl:n[1])},getPeriodDisplayText:function(e){return m.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{h(this.compareStartDate)}catch(e){return!1}try{h(this.compareEndDate)}catch(e){return!1}return!0},movePeriod:function(e){if(this.canMovePeriod(e)){var t=new Date;switch(null!=this.dateValue&&(t=this.dateValue),this.periodValue){case"day":t.setDate(t.getDate()+e);break;case"week":t.setDate(t.getDate()+7*e);break;case"month":t.setMonth(t.getMonth()+e);break;case"year":t.setFullYear(t.getFullYear()+e);break;default:break}this.dateValuebl&&(this.dateValue=bl),this.onApplyClicked()}},isPeriodMoveDisabled:function(e){return null===this.dateValue?this.isRangeSelection:this.isRangeSelection||!this.canMovePeriod(e)},canMovePeriod:function(e){if(null===this.dateValue)return!1;var t=-1===e?hl:bl;return!v(this.dateValue,t,this.periodValue)}}});vl.render=ol;var yl=vl,Ol={class:"reportingMenu"},jl=["aria-label"],wl=["data-category-id"],kl=["onClick"],Sl={class:"hidden"},Cl={key:2,role:"menu"},El=["href","onClick","title"],Dl=["href","onClick"],Pl=["onClick"],Tl=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),Vl=[Tl],Nl={id:"mobile-left-menu",class:"sidenav sidenav--reporting-menu-mobile hide-on-large-only"},Il=["data-category-id"],xl={key:1,class:"collapsible collapsible-accordion"},Bl={class:"collapsible-header"},Al={class:"collapsible-body"},Ll=["onClick","href"],Ml=["onClick","href"];function _l(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("MenuItemsDropdown"),l=Object(X["resolveDirective"])("side-nav");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ol,[Object(X["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down collapsible",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menu,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id,"data-category-id":t.id},[t.component?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(t.component),{key:0,onAction:function(n){return e.loadCategory(t)}},null,8,["onAction"])):Object(X["createCommentVNode"])("",!0),t.component?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"item",tabindex:"5",href:"",onClick:Object(X["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(X["createElementVNode"])("span",{class:Object(X["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:t.subcategories&&t.id===e.activeCategory?"icon-chevron-down":"icon-chevron-right"))},null,2),Object(X["createTextVNode"])(Object(X["toDisplayString"])(t.name)+" ",1),Object(X["createElementVNode"])("span",Sl,Object(X["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,kl)),t.component?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",Cl,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{role:"menuitem",class:Object(X["normalizeClass"])({active:(n.id===e.displayedSubcategory||n.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:n.id},[n.isGroup?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(X["withCtx"])((function(){return[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(n.subcategories,(function(r){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{class:Object(X["normalizeClass"])(["item",{active:r.id===e.activeSubsubcategory&&n.id===e.displayedSubcategory&&t.id===e.displayedCategory}]),tabindex:"5",href:"#?".concat(e.makeUrl(t,r)),onClick:function(n){return e.loadSubcategory(t,r,n)},title:r.tooltip,key:r.id},Object(X["toDisplayString"])(r.name),11,El)})),128))]})),_:2},1032,["menu-title"])):Object(X["createCommentVNode"])("",!0),n.isGroup?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(X["toDisplayString"])(n.name),9,Dl)),n.help?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:2,class:Object(X["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)}},Vl,10,Pl)):Object(X["createCommentVNode"])("",!0)],2)})),128))]))],10,wl)})),128))],8,jl),Object(X["createElementVNode"])("ul",Nl,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menu,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:"no-padding",key:t.id,"data-category-id":t.id},[t.component?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(t.component),{key:0,onAction:function(n){return e.loadCategory(t)}},null,8,["onAction"])):Object(X["createCommentVNode"])("",!0),t.component?Object(X["createCommentVNode"])("",!0):Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",xl,[Object(X["createElementVNode"])("li",null,[Object(X["createElementVNode"])("a",Bl,[Object(X["createElementVNode"])("i",{class:Object(X["normalizeClass"])(t.icon?t.icon:"icon-chevron-down")},null,2),Object(X["createTextVNode"])(Object(X["toDisplayString"])(t.name),1)]),Object(X["createElementVNode"])("div",Al,[Object(X["createElementVNode"])("ul",null,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],{key:0},Object(X["renderList"])(n.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(X["toDisplayString"])(n.name),9,Ll)})),128)):Object(X["createCommentVNode"])("",!0),n.isGroup?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(X["toDisplayString"])(n.name),9,Ml))])})),128))])])])],512)),[[l,{activator:e.sideNavActivator}]])],8,Il)})),128))])])}function Fl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rl(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.state.isInitialized&&0===n.length?Promise.resolve(Object(X["readonly"])(this.state.initialSites)):this.stateFiltered.isInitialized&&n.length===this.stateFiltered.excludedSites.length&&n.every((function(t,n){return t===e.stateFiltered.excludedSites[n]}))?Promise.resolve(Object(X["readonly"])(this.stateFiltered.initialSites)):(n.length>0&&this.searchSite("%",t,n).then((function(t){e.stateFiltered.isInitialized=!0,e.stateFiltered.excludedSites=n,null!==t&&(e.stateFiltered.initialSites=t)})),this.state.isInitialized?Promise.resolve(Object(X["readonly"])(this.state.initialSites)):this.searchSite("%",t,n).then((function(t){return e.state.isInitialized=!0,null!==t&&(e.state.initialSites=t),t})))}},{key:"loadSite",value:function(e){"all"===e?De.updateUrl(Object.assign(Object.assign({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period})):De.updateUrl(Object.assign(Object.assign({},De.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},De.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Ze.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(o){var a=o.value,i="SitesManager.getPatternMatchSites";return n&&(i="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Ze.fetch({method:i,limit:a,pattern:e,sitesToExclude:r},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites(n,r)}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Object.assign(Object.assign({},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:0})),t):[]}}]),e}(),Ia=new Na,xa=["value","name"],Ba=["title"],Aa=["textContent"],Ma={key:1,class:"placeholder"},La={class:"dropdown"},_a={class:"custom_select_search"},Fa=["placeholder"],Ra={key:0},Ha={class:"custom_select_container"},Ua=["onClick"],$a=["innerHTML","href","title"],qa={class:"custom_select_ul_list"},Wa={class:"noresult"},za={key:1};function Ga(e,t,n,r,o,a){var i,l,c,s,u=Object(X["resolveComponent"])("AllSitesLink"),d=Object(X["resolveDirective"])("focus-if"),m=Object(X["resolveDirective"])("tooltips"),p=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(X["openBlock"])(),Object(X["createElementBlock"])("input",{key:0,type:"hidden",value:null===(i=e.displayedModelValue)||void 0===i?void 0:i.id,name:e.name},null,8,xa)):Object(X["createCommentVNode"])("",!0),Object(X["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(X["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(X["createElementVNode"])("span",{class:Object(X["normalizeClass"])(["icon icon-chevron-down",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(X["createElementVNode"])("span",null,[null!==(l=e.displayedModelValue)&&void 0!==l&&l.name||!e.placeholder?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,textContent:Object(X["toDisplayString"])((null===(c=e.displayedModelValue)||void 0===c?void 0:c.name)||e.firstSiteName)},null,8,Aa)):Object(X["createCommentVNode"])("",!0),null!==(s=e.displayedModelValue)&&void 0!==s&&s.name||!e.placeholder?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",Ma,Object(X["toDisplayString"])(e.placeholder),1))])],42,Ba),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",La,[Object(X["withDirectives"])(Object(X["createElementVNode"])("div",_a,[Object(X["withDirectives"])(Object(X["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,Fa),[[X["vModelText"],e.searchTerm],[d,{focused:e.shouldFocusOnSearch}]]),Object(X["withDirectives"])(Object(X["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),[[X["vShow"],e.searchTerm]])],512),[[X["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ra,[Object(X["createVNode"])(u,{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(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",Ha,[Object(X["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.sites,(function(n,r){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{onClick:function(t){return e.switchSite(Object.assign(Object.assign({},n),{},{id:n.idsite}),t)},key:r},[Object(X["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,$a)],8,Ua)),[[X["vShow"],!(!e.showSelectedSite&&"".concat(e.activeSiteId)==="".concat(n.idsite))]])})),128))]),Object(X["withDirectives"])(Object(X["createElementVNode"])("ul",qa,[Object(X["createElementVNode"])("li",null,[Object(X["createElementVNode"])("div",Wa,Object(X["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[X["vShow"],!e.sites.length&&e.searchTerm]])],512),[[m,{content:e.tooltipContent}]]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",za,[Object(X["createVNode"])(u,{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(X["createCommentVNode"])("",!0)],512),[[X["vShow"],e.showSitesList]])],2)),[[p,{blur:e.onBlur}]])}var Ya=["innerHTML","href"];function Ja(e,t,n,r,o,a){var i=this;return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return i.onClick(e)}),class:"custom_select_all"},[Object(X["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Ya)])}var Ka=Object(X["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Ka.render=Ja;var Qa=Ka,Xa=Object(X["defineComponent"])({props:{modelValue:Object,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:a("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean,sitesToExclude:{type:Array,default:function(){return[]}}},emits:["update:modelValue","blur"],components:{AllSitesLink:Qa},directives:{FocusAnywhereButHere:gn,FocusIf:On,Tooltips:Cn},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:"".concat(ue.idSite),showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(ue.config.autocomplete_min_sites,10)}},created:function(){this.searchSite=Ht(this.searchSite),!this.modelValue&&ue.idSite&&this.$emit("update:modelValue",{id:ue.idSite,name:ue.helper.htmlDecode(ue.siteName)})},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.shouldDefaultToFirstSite&&e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=a("CoreHome_ShortcutWebsiteSelector");ue.helper.registerShortcut("w",t,(function(t){if(!t.altKey){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e.$refs.selectorLink;n&&(n.click(),n.focus())}}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?a("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){var e=Ia.initialSitesFiltered.value&&Ia.initialSitesFiltered.value.length?Ia.initialSitesFiltered.value:Ia.initialSites.value;return e&&e.length>1},firstSiteName:function(){var e=Ia.initialSitesFiltered.value&&Ia.initialSitesFiltered.value.length?Ia.initialSitesFiltered.value:Ia.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=De.stringify(Object.assign(Object.assign({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period}));return"?".concat(e)},shouldDefaultToFirstSite:function(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue:function(){return this.modelValue?this.modelValue:ue.idSite?{id:ue.idSite,name:ue.helper.htmlDecode(ue.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null},tooltipContent:function(){return function(){var e=$(this).attr("title")||"";return ue.helper.htmlEntities(e)}}},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({id:"all",name:this.$props.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.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&Ia.loadSite(e.id))},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 this.htmlEntities(e);var n=this.htmlEntities(e.substring(0,t)),r=this.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'').concat(this.searchTerm,"").concat(r)},loadInitialSites:function(){var e=this;return Ia.loadInitialSites(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Ia.searchSite(e,this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=De.stringify(Object.assign(Object.assign({},De.urlParsed.value),{},{segment:"",idSite:e})),n=De.stringify(Object.assign(Object.assign({},De.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)},htmlEntities:function(e){return ue.helper.htmlEntities(e)}}});Xa.render=Ga;var Za=Xa,ei={ref:"root",class:"quickAccessInside"},ti=["title","placeholder"],ni={class:"dropdown"},ri={class:"no-result"},oi=["onClick"],ai=["onMouseenter","onClick"],ii={class:"quickAccessMatomoSearch"},li=["onMouseenter","onClick"],ci=["textContent"],si={class:"quick-access-category helpCategory"},ui=["href"];function di(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("focus-if"),l=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ei,[Object(X["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,32),Object(X["withDirectives"])(Object(X["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,placeholder:e.translate("General_Search"),ref:"input"},null,40,ti),[[X["vModelText"],e.searchTerm],[i,{focused:e.searchActive}]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",ni,[Object(X["withDirectives"])(Object(X["createElementVNode"])("ul",null,[Object(X["createElementVNode"])("li",ri,Object(X["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[X["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menuItems,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",{key:t.title},[Object(X["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(X["toDisplayString"])(t.title),9,oi),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.items,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["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(X["createElementVNode"])("a",null,Object(X["toDisplayString"])(t.name.trim()),1)],42,ai)})),128))])})),128)),Object(X["createElementVNode"])("ul",ii,[Object(X["withDirectives"])(Object(X["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(X["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[X["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("li",{class:"no-result"},Object(X["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[X["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.sites,(function(t,n){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["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(X["createElementVNode"])("a",{textContent:Object(X["toDisplayString"])(t.name)},null,8,ci)],42,li)),[[X["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(X["createElementVNode"])("ul",null,[Object(X["createElementVNode"])("li",si,Object(X["toDisplayString"])(e.translate("General_HelpResources")),1),Object(X["createElementVNode"])("li",{class:Object(X["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(X["createElementVNode"])("a",{href:"https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(X["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,ui)],34)])],512),[[X["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}var mi=window,pi=mi.ListingFormatter;function fi(e){var t=e.getBoundingClientRect(),n=window.$(window);return t.top>=0&&t.left>=0&&t.bottom<=n.height()&&t.right<=n.width()}function hi(e){e&&e.scrollIntoView&&e.scrollIntoView()}var bi=Object(X["defineComponent"])({directives:{FocusAnywhereButHere:gn,FocusIf:On},watch:{searchActive:function(e){var t=this.$refs.root;if(t&&t.parentElement){var n=t.parentElement.classList;n.toggle("active",e),n.toggle("expanded",e)}}},mounted:function(){var e=this,t=this.$refs.root;t&&t.parentElement&&t.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),ue.helper.registerShortcut("f",a("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),hi(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=Ht(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector('.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]')},quickAccessTitle:function(){var e=[a("CoreHome_MenuEntries")];return this.hasSegmentSelector&&e.push(a("CoreHome_Segments")),this.hasSitesSelector&&e.push(a("SitesManager_Sites")),a("CoreHome_QuickAccessTitle",pi.formatAnd(e))}},emits:["itemSelected","blur"],methods:{onKeypress:function(e){var t=this,n=this.searchTerm&&this.searchActive,r=9===e.which,o=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||o&&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.input&&this.$refs.input.blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!fi(e)&&hi(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");if(e&&e.length&&e.item(this.searchIndex))return e.item(this.searchIndex)},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,o={},a=[],i=function(e){var t=Object.assign({},e);r+=1,t.menuIndex=r;var n=t.category;n in o||(a.push({title:n,items:[]}),o[n]=a.length-1);var i=o[n];a[i].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Ia.searchSite(n).then((function(e){e&&(t.sites=e)})).finally((function(){t.isLoading=!1})));var l=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 c=this.topMenuItems.filter(l),s=this.leftMenuItems.filter(l),u=this.segmentItems.filter(l);c.forEach(i),s.forEach(i),u.forEach(i),this.numMenuItems=c.length+s.length+u.length,this.menuItems=a},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){Ia.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=a("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a, nav .sidenav li > div > a").forEach((function(r){var o,a,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();(!i||null!=r.parentElement&&null!=r.parentElement.tagName&&"DIV"===r.parentElement.tagName)&&(i=null===(a=r.getAttribute("title"))||void 0===a?void 0:a.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,o=window.$(n).find("> .item"),a=(null===(r=o[0])||void 0===r?void 0:r.innerText.trim())||"";a&&-1!==a.lastIndexOf("\n")&&(a=a.slice(0,a.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,r){var o,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();i&&(t.push({name:i,category:a,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=a("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var o,a,i=null===(o=r.querySelector(".segname"))||void 0===o||null===(a=o.textContent)||void 0===a?void 0:a.trim();i&&(n.push({name:i,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});bi.render=di;var vi=bi;function gi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yi={class:"fieldArray form-group"},Oi={key:0,class:"fieldUiControl"},ji=["onClick","title"];function wi(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",yi,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.modelValue,(function(t,n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",gi({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Oi,[Object(X["createVNode"])(i,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},"model-modifiers":e.field.modelModifiers,placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n),"template-file":e.field.templateFile,component:e.field.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","title","name","template-file","component"])])):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,ji),[[X["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function ki(e){return Di(e)||Ei(e)||Ci(e)||Si()}function Si(){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 Ci(e,t){if(e){if("string"===typeof e)return Pi(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)?Pi(e,t):void 0}}function Ei(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Di(e){if(Array.isArray(e))return Pi(e)}function Pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.modelValue){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});Vi.render=wi;var Ni=Vi;function Ii(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xi={class:"multiPairField form-group"},Bi={key:1,class:"fieldUiControl fieldUiControl2"},Ai={key:2,class:"fieldUiControl fieldUiControl3"},Mi={key:3,class:"fieldUiControl fieldUiControl4"},Li=["onClick","title"];function _i(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",xi,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.modelValue,(function(t,n){var r;return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},Ii(r,"multiPairFieldTable".concat(n),!0),Ii(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,class:Object(X["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(X["createVNode"])(i,{"full-width":!0,"model-value":t[e.field1.key],options:e.field1.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field1.key,t)},"model-modifiers":e.field1.modelModifiers,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title,"template-file":e.field1.templateFile,component:e.field1.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","name","title","template-file","component"])],2)):Object(X["createCommentVNode"])("",!0),e.field2?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Bi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field2.key,t)},"model-value":t[e.field2.key],"model-modifiers":e.field2.modelModifiers,placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title,"template-file":e.field2.templateFile,component:e.field2.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),e.field3?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ai,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field3.key,t)},"model-value":t[e.field3.key],"model-modifiers":e.field3.modelModifiers,placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title,"template-file":e.field3.templateFile,component:e.field3.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),e.field4?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Mi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field4.key,t)},"model-value":t[e.field4.key],"model-modifiers":e.field4.modelModifiers,placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title,"template-file":e.field4.templateFile,component:e.field4.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Li),[[X["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}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}function Ri(e){return qi(e)||$i(e)||Ui(e)||Hi()}function Hi(){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 Ui(e,t){if(e){if("string"===typeof e)return Wi(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)?Wi(e,t):void 0}}function $i(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function qi(e){if(Array.isArray(e))return Wi(e)}function Wi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.modelValue){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}}});Gi.render=_i;var Yi=Gi,Ji=["disabled"],Ki=Object(X["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),Qi=[Ki],Xi=["title"],Zi=Object(X["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),el={id:"periodMore",class:"dropdown"},tl={class:"flex"},nl={key:0,class:"period-date"},rl={class:"period-type"},ol={id:"otherPeriods"},al=["onDblclick","title"],il=["id","checked","onChange","onDblclick"],ll={key:0,class:"compare-checkbox"},cl={id:"comparePeriodToDropdown"},sl={key:1,class:"compare-date-range"},ul={id:"comparePeriodStartDate"},dl=Object(X["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),ml={id:"comparePeriodEndDate"},pl={class:"apply-button-container"},fl=["disabled","value"],hl={key:2,id:"ajaxLoadingCalendar"},bl={class:"loadingSegment"},vl=["disabled"],gl=Object(X["createElementVNode"])("span",{class:"icon-chevron-right"},null,-1),yl=[gl];function Ol(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DateRangePicker"),l=Object(X["resolveComponent"])("PeriodDatePicker"),c=Object(X["resolveComponent"])("Field"),s=Object(X["resolveComponent"])("ActivityIndicator"),u=Object(X["resolveDirective"])("expand-on-click");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{ref:"root",class:Object(X["normalizeClass"])(["periodSelector piwikSelector",{"periodSelector-withPrevNext":e.canShowMovePeriod}])},[e.canShowMovePeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:0,class:"move-period move-period-prev",onClick:t[0]||(t[0]=function(t){return e.movePeriod(-1)}),disabled:e.isPeriodMoveDisabled(-1)},Qi,8,Ji)):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Zi,Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.currentlyViewingText),1)],8,Xi),Object(X["createElementVNode"])("div",el,[Object(X["createElementVNode"])("div",tl,[Object(X["createElementVNode"])("div",null,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[1]||(t[1]=function(t){return e.onRangeChange(t.start,t.end)}),onSubmit:t[2]||(t[2]=function(t){return e.onApplyClicked()})},null,8,["start-date","end-date"]),[[X["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",nl,[Object(X["createVNode"])(l,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[3]||(t[3]=function(t){return e.setPiwikPeriodAndDate(e.selectedPeriod,t.date)})},null,8,["period","date"])])):Object(X["createCommentVNode"])("",!0)]),Object(X["createElementVNode"])("div",rl,[Object(X["createElementVNode"])("h6",null,Object(X["toDisplayString"])(e.translate("General_Period")),1),Object(X["createElementVNode"])("div",ol,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.periodsFiltered,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("p",{key:n},[Object(X["createElementVNode"])("label",{class:Object(X["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(X["withDirectives"])(Object(X["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_".concat(n),"onUpdate:modelValue":t[4]||(t[4]=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,il),[[X["vModelRadio"],e.selectedPeriod]]),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,al)])})),128))])])]),e.isComparisonEnabled?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ll,[Object(X["createElementVNode"])("label",null,[Object(X["withDirectives"])(Object(X["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=function(t){return e.isComparing=t})},null,512),[[X["vModelCheckbox"],e.isComparing]]),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(X["createElementVNode"])("div",cl,[Object(X["createVNode"])(c,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.comparePeriodType=t}),style:Object(X["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(X["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",sl,[Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",ul,[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(c,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[7]||(t[7]=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"])])]),dl,Object(X["createElementVNode"])("div",ml,[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(c,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[8]||(t[8]=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(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",pl,[Object(X["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[9]||(t[9]=function(t){return e.onApplyClicked()}),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,fl)]),e.isLoadingNewPage?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",hl,[Object(X["createVNode"])(s,{loading:!0}),Object(X["createElementVNode"])("div",bl,Object(X["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(X["createCommentVNode"])("",!0)]),e.canShowMovePeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:1,class:"move-period move-period-next",onClick:t[10]||(t[10]=function(t){return e.movePeriod(1)}),disabled:e.isPeriodMoveDisabled(1)},yl,8,vl)):Object(X["createCommentVNode"])("",!0)],2)),[[u,{expander:"title"}]])}function jl(e,t){return El(e)||Cl(e,t)||kl(e,t)||wl()}function wl(){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 kl(e,t){if(e){if("string"===typeof e)return Sl(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)?Sl(e,t):void 0}}function Sl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr?(window.$("#alert").find("h2").text(a("General_InvalidDateRange")),ue.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return p(this.dateValue)},isErrorDisplayed:function(){return this.currentlyViewingText===a("General_Error")},isRangeSelection:function(){return"range"===this.periodValue},canShowMovePeriod:function(){return!this.isRangeSelection&&!this.isErrorDisplayed}},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(e){e!==this.periodValue&&"range"!==e&&this.setPiwikPeriodAndDate(e,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=p(t);this.setRangeStartEndFromPeriod(e,n),this.propagateNewUrlParams(n,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams:function(e,t){var n,r=this.selectedComparisonParams;ue.helper.isReportingPage()?(this.closePeriodSelector(),n=De.hashParsed.value):(this.isLoadingNewPage=!0,n=De.parsed.value);var o=Object.assign({},n);delete o.comparePeriods,delete o.comparePeriodType,delete o.compareDates,De.updateLocation(Object.assign(Object.assign({},o),{},{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)},updateComparisonValuesFromStore:function(){this.comparePeriodType="previousPeriod",this.compareStartDate="",this.compareEndDate="";var e=fo.getPeriodComparisons();if(!(e.length<2)){var t=De.parsed.value.comparePeriodType;if(Tl.includes(t)&&(this.comparePeriodType=t,"custom"===this.comparePeriodType&&"range"===e[1].params.period)){var n;try{n=m.parse(e[1].params.period,e[1].params.date)}catch(l){return}var r=n.getDateRange(),o=jl(r,2),a=o[0],i=o[1];this.compareStartDate=p(a),this.compareEndDate=p(i)}}},updateSelectedValuesFromHash:function(){var e=De.parsed.value.date,t=De.parsed.value.period;this.periodValue=t,this.selectedPeriod=t,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{m.parse(t,e)}catch(l){return}if("range"===t){var n=m.get(t).parse(e),r=n.getDateRange(),o=jl(r,2),a=o[0],i=o[1];this.dateValue=a,this.startRangeDate=p(a),this.endRangeDate=p(i)}else this.dateValue=h(e),this.setRangeStartEndFromPeriod(t,e)},setRangeStartEndFromPeriod:function(e,t){var n=m.parse(e,t).getDateRange();this.startRangeDate=p(n[0]Il?Il:n[1])},getPeriodDisplayText:function(e){return m.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{h(this.compareStartDate)}catch(e){return!1}try{h(this.compareEndDate)}catch(e){return!1}return!0},movePeriod:function(e){if(this.canMovePeriod(e)){var t=new Date;switch(null!=this.dateValue&&(t=this.dateValue),this.periodValue){case"day":t.setDate(t.getDate()+e);break;case"week":t.setDate(t.getDate()+7*e);break;case"month":t.setMonth(t.getMonth()+e);break;case"year":t.setFullYear(t.getFullYear()+e);break;default:break}this.dateValueIl&&(this.dateValue=Il),this.onApplyClicked()}},isPeriodMoveDisabled:function(e){return null===this.dateValue?this.isRangeSelection:this.isRangeSelection||!this.canMovePeriod(e)},canMovePeriod:function(e){if(null===this.dateValue)return!1;var t=-1===e?Nl:Il;return!g(this.dateValue,t,this.periodValue)}}});Bl.render=Ol;var Al=Bl,Ml={class:"reportingMenu"},Ll=["aria-label"],_l=["data-category-id"],Fl=["onClick"],Rl={class:"hidden"},Hl={key:2,role:"menu"},Ul=["href","onClick","title"],$l=["href","onClick"],ql=["onClick"],Wl=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),zl=[Wl],Gl={id:"mobile-left-menu",class:"sidenav sidenav--reporting-menu-mobile hide-on-large-only"},Yl=["data-category-id"],Jl={key:1,class:"collapsible collapsible-accordion"},Kl={class:"collapsible-header"},Ql={class:"collapsible-body"},Xl=["onClick","href"],Zl=["onClick","href"];function ec(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("MenuItemsDropdown"),l=Object(X["resolveDirective"])("side-nav");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ml,[Object(X["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down collapsible",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menu,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id,"data-category-id":t.id},[t.component?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(t.component),{key:0,onAction:function(n){return e.loadCategory(t)}},null,8,["onAction"])):Object(X["createCommentVNode"])("",!0),t.component?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"item",tabindex:"5",href:"",onClick:Object(X["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(X["createElementVNode"])("span",{class:Object(X["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:t.subcategories&&t.id===e.activeCategory?"icon-chevron-down":"icon-chevron-right"))},null,2),Object(X["createTextVNode"])(Object(X["toDisplayString"])(t.name)+" ",1),Object(X["createElementVNode"])("span",Rl,Object(X["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,Fl)),t.component?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",Hl,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{role:"menuitem",class:Object(X["normalizeClass"])({active:(n.id===e.displayedSubcategory||n.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:n.id},[n.isGroup?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(X["withCtx"])((function(){return[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(n.subcategories,(function(r){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{class:Object(X["normalizeClass"])(["item",{active:r.id===e.activeSubsubcategory&&n.id===e.displayedSubcategory&&t.id===e.displayedCategory}]),tabindex:"5",href:"#?".concat(e.makeUrl(t,r)),onClick:function(n){return e.loadSubcategory(t,r,n)},title:r.tooltip,key:r.id},Object(X["toDisplayString"])(r.name),11,Ul)})),128))]})),_:2},1032,["menu-title"])):Object(X["createCommentVNode"])("",!0),n.isGroup?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(X["toDisplayString"])(n.name),9,$l)),n.help?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:2,class:Object(X["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)}},zl,10,ql)):Object(X["createCommentVNode"])("",!0)],2)})),128))]))],10,_l)})),128))],8,Ll),Object(X["createElementVNode"])("ul",Gl,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menu,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:"no-padding",key:t.id,"data-category-id":t.id},[t.component?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(t.component),{key:0,onAction:function(n){return e.loadCategory(t)}},null,8,["onAction"])):Object(X["createCommentVNode"])("",!0),t.component?Object(X["createCommentVNode"])("",!0):Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",Jl,[Object(X["createElementVNode"])("li",null,[Object(X["createElementVNode"])("a",Kl,[Object(X["createElementVNode"])("i",{class:Object(X["normalizeClass"])(t.icon?t.icon:"icon-chevron-down")},null,2),Object(X["createTextVNode"])(Object(X["toDisplayString"])(t.name),1)]),Object(X["createElementVNode"])("div",Ql,[Object(X["createElementVNode"])("ul",null,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],{key:0},Object(X["renderList"])(n.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(X["toDisplayString"])(n.name),9,Xl)})),128)):Object(X["createCommentVNode"])("",!0),n.isGroup?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(X["toDisplayString"])(n.name),9,Zl))])})),128))])])])],512)),[[l,{activator:e.sideNavActivator}]])],8,Yl)})),128))])])}function tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nc(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.order?1:0})),t}
+ */function pc(e){var t=lc(e||[]);return t.sort((function(e,t){return e.ordert.order?1:0})),t}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function Xl(e){var t=e;return t.subcategories?t.subcategories:[]}
+ */function fc(e){var t=e;return t.subcategories?t.subcategories:[]}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function Zl(e){var t=e;return t.subcategories?t.subcategories:[]}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;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var t=e.widget.split("."),n=fc(t,2),r=n[0],o=n[1];e.component=Ot(r,o)}})),e},activeCategory:function(){return ic.activeCategory.value},activeSubcategory:function(){return ic.activeSubcategory.value},activeSubsubcategory:function(){return ic.activeSubsubcategory.value},displayedCategory:function(){return De.parsed.value.category},displayedSubcategory:function(){return De.parsed.value.subcategory}},created:function(){var e=this;ic.fetchMenuItems().then((function(t){if(!De.parsed.value.subcategory){var n=t[0],r=n.subcategories[0];ic.enterSubcategory(n,r),e.propagateUrlChange(n,r)}})),Object(X["watch"])((function(){return De.parsed.value}),(function(e){var t=ic.findSubcategory(e.category,e.subcategory);ic.enterSubcategory(t.category,t.subcategory,t.subsubcategory)})),ue.on("matomoPageChange",(function(){e.initialLoad||window.globalAjaxQueue.abort(),e.helpShownCategory=null,e.showSubcategoryHelpOnLoad&&(e.showHelp(e.showSubcategoryHelpOnLoad.category,e.showSubcategoryHelpOnLoad.subcategory),e.showSubcategoryHelpOnLoad=null),window.$("#loadingError,#loadingRateLimitError").hide(),e.initialLoad=!1})),ue.on("updateReportingMenu",(function(){ic.reloadMenuItems().then((function(){var e=De.parsed.value.category,t=De.parsed.value.subcategory;if(e&&t){var n=ic.findSubcategory(e,t);n.category&&ic.enterSubcategory(n.category,n.subcategory,n.subsubcategory)}})),pc.reloadAvailableWidgets()}))},methods:{propagateUrlChange:function(e,t){var n=De.parsed.value;n.category===e.id&&n.subcategory===t.id?this.loadSubcategory(e,t):De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory:function(e){na.remove(Oc);var t=ic.toggleCategory(e),n=e.subcategories,r=n&&1===n.length||e.widget&&n&&n.length;if(t&&r){this.helpShownCategory=null;var o=e.subcategories[0];this.propagateUrlChange(e,o)}},loadSubcategory:function(e,t,n){n&&(n.shiftKey||n.ctrlKey||n.metaKey)||(na.remove(Oc),t&&t.id===De.parsed.value.subcategory&&e.id===De.parsed.value.category&&(this.helpShownCategory=null,setTimeout((function(){ue.postEvent("loadPage",e.id,t.id)}))))},makeUrl:function(e,t){var n=De.parsed.value,r=n.idSite,o=n.period,a=n.date,i=n.segment,l=n.comparePeriods,c=n.compareDates,s=n.compareSegments;return De.stringify({idSite:r,period:o,date:a,segment:i,comparePeriods:l,compareDates:c,compareSegments:s,category:e.id,subcategory:t.id})},htmlEntities:function(e){return ue.helper.htmlEntities(e)},showHelp:function(e,t,n){var r=De.parsed.value,o=r.category,i=r.subcategory;if((o!==e.id||i!==t.id)&&n)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return na.remove(Oc),void(this.helpShownCategory=null);var l=a("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),c="".concat(l,"
");na.show({context:"info",id:Oc,type:"help",noclear:!0,class:"help-notification",message:c+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});jc.render=_l;var wc=jc;function kc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sc(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var t=e.widget.split("."),n=Vc(t,2),r=n[0],o=n[1];e.component=Lt(r,o)}})),e},activeCategory:function(){return wc.activeCategory.value},activeSubcategory:function(){return wc.activeSubcategory.value},activeSubsubcategory:function(){return wc.activeSubsubcategory.value},displayedCategory:function(){return De.parsed.value.category},displayedSubcategory:function(){return De.parsed.value.subcategory}},created:function(){var e=this;wc.fetchMenuItems().then((function(t){if(!De.parsed.value.subcategory){var n=t[0],r=n.subcategories[0];wc.enterSubcategory(n,r),e.propagateUrlChange(n,r)}})),Object(X["watch"])((function(){return De.parsed.value}),(function(e){var t=wc.findSubcategory(e.category,e.subcategory);wc.enterSubcategory(t.category,t.subcategory,t.subsubcategory)})),ue.on("matomoPageChange",(function(){e.initialLoad||window.globalAjaxQueue.abort(),e.helpShownCategory=null,e.showSubcategoryHelpOnLoad&&(e.showHelp(e.showSubcategoryHelpOnLoad.category,e.showSubcategoryHelpOnLoad.subcategory),e.showSubcategoryHelpOnLoad=null),window.$("#loadingError,#loadingRateLimitError").hide(),e.initialLoad=!1})),ue.on("updateReportingMenu",(function(){wc.reloadMenuItems().then((function(){var e=De.parsed.value.category,t=De.parsed.value.subcategory;if(e&&t){var n=wc.findSubcategory(e,t);n.category&&wc.enterSubcategory(n.category,n.subcategory,n.subsubcategory)}})),Tc.reloadAvailableWidgets()}))},methods:{propagateUrlChange:function(e,t){var n=De.parsed.value;n.category===e.id&&n.subcategory===t.id?this.loadSubcategory(e,t):De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory:function(e){ga.remove(Mc);var t=wc.toggleCategory(e),n=e.subcategories,r=n&&1===n.length||e.widget&&n&&n.length;if(t&&r){this.helpShownCategory=null;var o=e.subcategories[0];this.propagateUrlChange(e,o)}},loadSubcategory:function(e,t,n){n&&(n.shiftKey||n.ctrlKey||n.metaKey)||(ga.remove(Mc),t&&t.id===De.parsed.value.subcategory&&e.id===De.parsed.value.category&&(this.helpShownCategory=null,setTimeout((function(){ue.postEvent("loadPage",e.id,t.id)}))))},makeUrl:function(e,t){var n=De.parsed.value,r=n.idSite,o=n.period,a=n.date,i=n.segment,l=n.comparePeriods,c=n.compareDates,s=n.compareSegments;return De.stringify({idSite:r,period:o,date:a,segment:i,comparePeriods:l,compareDates:c,compareSegments:s,category:e.id,subcategory:t.id})},htmlEntities:function(e){return ue.helper.htmlEntities(e)},showHelp:function(e,t,n){var r=De.parsed.value,o=r.category,i=r.subcategory;if((o!==e.id||i!==t.id)&&n)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return ga.remove(Mc),void(this.helpShownCategory=null);var l=a("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),c="".concat(l,"
");ga.show({context:"info",id:Mc,type:"help",noclear:!0,class:"help-notification",message:c+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});Lc.render=ec;var _c=Lc;function Fc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rc(e,t){for(var n=0;n .card-content .card-title");i.length||(i=a.find("> h2")),i.length&&i.html(ue.helper.htmlEntities(n.widgetName))}ue.helper.compileVueEntryComponents(a),na.parseNotificationDivs(),setTimeout((function(){ue.postEvent("widget:loaded",{parameters:e,element:a})}))}})).catch((function(e){t===n.changeCounter&&(n.lastWidgetAbortController=null,n.cleanupLastWidgetContent(),n.loading=!1,"abort"!==e.xhrStatus&&(429===e.status&&(n.loadingFailedRateLimit=!0),n.loadingFailed=!0))}))}}});Lc.render=Ac;var Mc=Lc,_c={class:"widget-container"};function Fc(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Widget");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",_c,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.actualContainer,(function(e,t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:t},[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(i,{widget:e,"prevent-recursion":!0},null,8,["widget"])])])})),128))])}function Rc(e){return $c(e)||Uc(e)||zc(e)||Hc()}function Hc(){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 Uc(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function $c(e){if(Array.isArray(e))return Gc(e)}function qc(e,t){return Jc(e)||Yc(e,t)||zc(e,t)||Wc()}function Wc(){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 zc(e,t){if(e){if("string"===typeof e)return Gc(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)?Gc(e,t):void 0}}function Gc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n"))}return{tooltipContent:e}},created:function(){var e=this,t=this.actualWidget;if(t&&t.middlewareParameters){var n=t.middlewareParameters;Ze.fetch(n).then((function(t){e.showWidget=!!t}))}else this.showWidget=!0},computed:{allWidgets:function(){return pc.widgets.value},actualWidget:function(){var e=this,t=this.widget;if(t){var n=Object.assign({},t);if(t&&t.isReport&&!t.documentation){var r=Pc.findReport(t.module,t.action);r&&r.documentation&&(n.documentation=r.documentation)}return t}if(this.containerid){var o=ys(this.allWidgets,this.containerid);if(o){var a=Object.assign({},o);if(this.widgetized){a.isFirstInPage=!0,a.parameters=Object.assign(Object.assign({},a.parameters),{},{widget:"1"});var i=dc(a);i&&(a.widgets=i.map((function(t){return Object.assign(Object.assign({},t),{},{parameters:Object.assign(Object.assign({},t.parameters),{},{widget:"1",containerId:e.containerid})})})))}return a}}return null}}});Os.render=vs;var js=Os,ws={class:"reporting-page"},ks={key:1,class:"col s12 l6 leftWidgetColumn"},Ss={key:2,class:"col s12 l6 rightWidgetColumn"};function Cs(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("ActivityIndicator"),l=Object(X["resolveComponent"])("Widget");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ws,[Object(X["createVNode"])(i,{loading:e.loading},null,8,["loading"]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",null,Object(X["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[X["vShow"],e.hasNoPage]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.widgets,(function(e){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createBlock"])(l,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ks,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.left,(function(e){return Object(X["openBlock"])(),Object(X["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(X["createCommentVNode"])("",!0),e.group?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ss,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.right,(function(e){return Object(X["openBlock"])(),Object(X["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(X["createCommentVNode"])("",!0)])})),128))])}function Es(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ds(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n .card-content .card-title");i.length||(i=a.find("> h2")),i.length&&i.html(ue.helper.htmlEntities(n.widgetName))}ue.helper.compileVueEntryComponents(a),ga.parseNotificationDivs(),setTimeout((function(){ue.postEvent("widget:loaded",{parameters:e,element:a})}))}})).catch((function(e){t===n.changeCounter&&(n.lastWidgetAbortController=null,n.cleanupLastWidgetContent(),n.loading=!1,"abort"!==e.xhrStatus&&(429===e.status&&(n.loadingFailedRateLimit=!0),n.loadingFailed=!0))}))}}});Xc.render=Qc;var Zc=Xc,es={class:"widget-container"};function ts(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Widget");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",es,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.actualContainer,(function(e,t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:t},[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(i,{widget:e,"prevent-recursion":!0},null,8,["widget"])])])})),128))])}function ns(e){return as(e)||os(e)||cs(e)||rs()}function rs(){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 os(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function as(e){if(Array.isArray(e))return ss(e)}function is(e,t){return ds(e)||us(e,t)||cs(e,t)||ls()}function ls(){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 cs(e,t){if(e){if("string"===typeof e)return ss(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)?ss(e,t):void 0}}function ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n"))}return{tooltipContent:e}},created:function(){var e=this,t=this.actualWidget;if(t&&t.middlewareParameters){var n=t.middlewareParameters;Ze.fetch(n).then((function(t){e.showWidget=!!t}))}else this.showWidget=!0},computed:{allWidgets:function(){return Tc.widgets.value},actualWidget:function(){var e=this,t=this.widget;if(t){var n=Object.assign({},t);if(t&&t.isReport&&!t.documentation){var r=qc.findReport(t.module,t.action);r&&r.documentation&&(n.documentation=r.documentation)}return t}if(this.containerid){var o=As(this.allWidgets,this.containerid);if(o){var a=Object.assign({},o);if(this.widgetized){a.isFirstInPage=!0,a.parameters=Object.assign(Object.assign({},a.parameters),{},{widget:"1"});var i=Dc(a);i&&(a.widgets=i.map((function(t){return Object.assign(Object.assign({},t),{},{parameters:Object.assign(Object.assign({},t.parameters),{},{widget:"1",containerId:e.containerid})})})))}return a}}return null}}});Ms.render=Bs;var Ls=Ms,_s={class:"reporting-page"},Fs={key:1,class:"col s12 l6 leftWidgetColumn"},Rs={key:2,class:"col s12 l6 rightWidgetColumn"};function Hs(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("ActivityIndicator"),l=Object(X["resolveComponent"])("Widget");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",_s,[Object(X["createVNode"])(i,{loading:e.loading},null,8,["loading"]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",null,Object(X["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[X["vShow"],e.hasNoPage]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.widgets,(function(e){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createBlock"])(l,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Fs,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.left,(function(e){return Object(X["openBlock"])(),Object(X["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(X["createCommentVNode"])("",!0),e.group?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Rs,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.right,(function(e){return Object(X["openBlock"])(),Object(X["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(X["createCommentVNode"])("",!0)])})),128))])}function Us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $s(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n'),"");ue.visitorLogEnabled||(n=a("CoreHome_PeriodHasOnlyRawDataNoVisitsLog")),na.show({id:"onlyRawData",animate:!1,context:"info",message:n,type:"transient"})}function Hs(){na.remove("onlyRawData")}var Us=Object(X["defineComponent"])({components:{ActivityIndicator:qt,Widget:js},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;Fs.resetPage(),this.loading=!0,this.renderInitialPage(),Object(X["watch"])((function(){return De.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(Hs(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory,t.period,t.date,t.segment))})),ue.on("loadPage",(function(t,n){var r=De.parsed.value;e.renderPage(t,n,r.period,r.date,r.segment)}))},computed:{widgets:function(){return Fs.widgets.value}},methods:{renderPage:function(e,t,n,r,o){var i=this;if(!e||!t)return Fs.resetPage(),void(this.loading=!1);try{m.parse(n,r)}catch(c){return na.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),Fs.resetPage(),void(this.loading=!1)}na.remove("invalidDate"),ue.postEvent("matomoPageChange",{}),na.clearTransientNotifications(),m.parse(n,r).containsToday()&&this.showOnlyRawDataMessageIfRequired(e,t,n,r,o);var l={category:e,subcategory:t};if(ue.postEvent("ReportingPage.loadPage",l),l.promise)return this.loading=!0,void Promise.resolve(l.promise).finally((function(){i.loading=!1}));Fs.fetchPage(e,t).then((function(){var t=!Fs.page.value;if(t){var n=ql.findPageInCategory(e);if(n&&n.subcategory)return void De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{subcategory:n.subcategory.id}))}i.hasNoPage=t,i.loading=!1}))},renderInitialPage:function(){var e=De.parsed.value;this.renderPage(e.category,e.subcategory,e.period,e.date,e.segment)},showOnlyRawDataMessageIfRequired:function(e,t,n,r,o){var a=this;if(this.hasRawData&&this.hasNoVisits&&Rs(),o)Hs();else{var i=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],l=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"];if(-1===i.indexOf(t)&&-1===l.indexOf(e)&&-1===t.toLowerCase().indexOf("manage")){var c=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()0?(a.hasNoVisits=!1,void Hs()):(a.hasNoVisits=!0,a.hasRawData?void Rs():Ze.fetch({method:"Live.getMostRecentVisitsDateTime",date:r,period:n}).then((function(e){if(!e||""===e.value)return a.hasRawData=!1,void Hs();a.hasRawData=!0,Rs()})))}))}else Hs()}}}});Us.render=Cs;var $s=Us,qs={class:"report-export-popover row",id:"reportExport"},Ws={class:"col l6"},zs={name:"format"},Gs={name:"option_flat"},Ys={name:"option_expanded"},Js={name:"option_format_metrics"},Ks={class:"col l6"},Qs={name:"filter_type"},Xs={class:"filter_limit"},Zs={name:"filter_limit_all"},eu={key:0,name:"filter_limit"},tu={key:1,name:"filter_limit"},nu={class:"col l12"},ru=["value"],ou=Object(X["createTextVNode"])("\n "),au=[ou],iu=["innerHTML"],lu={class:"col l12"},cu=["href","title"],su=["innerHTML"];function uu(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field"),l=Object(X["resolveDirective"])("select-on-focus");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",qs,[Object(X["createElementVNode"])("div",Ws,[Object(X["createElementVNode"])("div",zs,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",Gs,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[X["vShow"],e.hasSubtables]])])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",Ys,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[X["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",Js,[Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(X["createElementVNode"])("div",Ks,[Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",Qs,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(X["createElementVNode"])("div",Xs,[Object(X["withDirectives"])(Object(X["createElementVNode"])("div",Zs,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[X["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",eu,[Object(X["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(X["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",tu,[Object(X["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(X["createCommentVNode"])("",!0)])]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",nu,[Object(X["withDirectives"])(Object(X["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},au,8,ru),[[l,{}]]),Object(X["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,iu)],512),[[X["vShow"],e.showUrl]]),Object(X["createElementVNode"])("div",lu,[Object(X["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(X["toDisplayString"])(e.translate("General_Export")),9,cu),Object(X["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(X["withDirectives"])(Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[X["vShow"],!e.showUrl]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[X["vShow"],e.showUrl]])])]),e.additionalContent?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,class:"col l12 report-export-popover-footer",innerHTML:e.$sanitize(e.additionalContent)},null,8,su)):Object(X["createCommentVNode"])("",!0)])}function du(e,t){return bu(e)||hu(e,t)||pu(e,t)||mu()}function mu(){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 pu(e,t){if(e){if("string"===typeof e)return fu(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)?fu(e,t):void 0}}function fu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.reportFormat,n=this.apiMethod,r=this.reportType,o=this.dataTable;if(t){var a={},i="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams?a=JSON.parse(this.requestParams):this.requestParams&&"object"===gu(this.requestParams)&&(a=this.requestParams);var l=o.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,m=l.idSite,p=o.param,f=p.date,h=p.period;"RSS"===t&&(f="last10"),"undefined"!==typeof o.param.dateUsedInGraph&&(f=o.param.dateUsedInGraph);var b=ue.config.datatable_export_range_as_day.toLowerCase();-1!==b.indexOf(t.toLowerCase())&&"range"===o.param.period&&(h="day"),"range"===o.param.period&&"graphEvolution"===o.param.viewDataTable&&(h="day");var g={module:"API",format:t,idSite:m,period:h,date:f};if("processed"===r){g.method="API.getProcessedReport";var v=n.split("."),y=du(v,2);g.apiModule=y[0],g.apiAction=y[1]}else g.method=n;if(o.param.compareDates&&o.param.compareDates.length&&(g.compareDates=o.param.compareDates,g.compare="1"),o.param.comparePeriods&&o.param.comparePeriods.length&&(g.comparePeriods=o.param.comparePeriods,g.compare="1"),o.param.compareSegments&&o.param.compareSegments.length&&(g.compareSegments=o.param.compareSegments,g.compare="1"),"undefined"!==typeof o.param.filter_pattern&&(g.filter_pattern=o.param.filter_pattern),"undefined"!==typeof o.param.filter_pattern_recursive&&(g.filter_pattern_recursive=o.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=du(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),g[n]=o})),this.optionFlat&&(g.flat=1,"undefined"!==typeof o.param.include_aggregate_rows&&"1"===o.param.include_aggregate_rows&&(g.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(g.expanded=1),this.optionFormatMetrics&&(g.format_metrics=1),o.param.pivotBy&&(g.pivotBy=o.param.pivotBy,g.pivotByColumnLimit=20,o.props.pivot_by_column&&(g.pivotByColumn=o.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(g.translateColumnNames=1,g.language=ue.language),"undefined"!==typeof c&&(g.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(g.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(g.idDimension=d),s){var O=s.split(",");if(O.length>1)g.label=O;else{var j=du(O,1);g.label=j[0]}}g.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(g.token_auth=ue.token_auth,g.force_api_session=1),g.filter_limit=i;var w=window.location.href.split("?")[0];return"".concat(w,"?").concat(De.stringify(g))}}}});yu.render=uu;var Ou=yu,ju=window,wu=ju.$,ku={mounted:function(e,t){e.addEventListener("click",(function(){var n=De.hashParsed.value.popover,r=wu(e).closest("[data-report]").data("uiControlObject"),o=window.Piwik_Popover.showLoading("Export"),i=t.value.reportFormats,l=r.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,s={initialReportType:"default",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"yes":"no",initialOptionFlat:c,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:c||r.numberOfSubtables>0,availableReportFormats:{default:i,processed:{XML:i.XML,JSON:i.JSON}},availableReportTypes:{default:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},u=ft({template:'\n ',data:function(){return{bind:s}}});u.component("popover",Ou);var d=document.createElement("div");u.mount(d);var m=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(a("General_Export")," ").concat(ue.helper.htmlEntities(m))),window.Piwik_Popover.setContent(d),window.Piwik_Popover.onClose((function(){u.unmount(),""!==n&&setTimeout((function(){De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),wu(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}},Su=["src","width","height"];
+ */function Xs(e){return!!(e.isContainer&&e.layout&&"ByDimension"===e.layout||"bydimension"===e.viewDataTable)||(!!e.isWide||e.viewDataTable&&("tableAllColumns"===e.viewDataTable||"sparklines"===e.viewDataTable||"graphEvolution"===e.viewDataTable))}function Zs(e){if(e&&e[0]){var t=zs(e),n=e[0];return n.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:Zs(n.left||[]),right:Zs(n.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}var eu=function(){function e(){var t=this;Us(this,e),Ws(this,"privateState",Object(X["reactive"])({})),Ws(this,"state",Object(X["computed"])((function(){return Object(X["readonly"])(t.privateState)}))),Ws(this,"page",Object(X["computed"])((function(){return t.state.value.page}))),Ws(this,"widgets",Object(X["computed"])((function(){var e=t.page.value;if(!e)return[];var n=[],r={},o=function(e){return e.isReport&&r["".concat(e.module,".").concat(e.action)]},a=function(e){if(!e.isReport)return[];var t=qc.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){o(e)||(a(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=pc(n),1===n.length)return Zs(n);for(var i=[],l=0;l'),"");ue.visitorLogEnabled||(n=a("CoreHome_PeriodHasOnlyRawDataNoVisitsLog")),ga.show({id:"onlyRawData",animate:!1,context:"info",message:n,type:"transient"})}function ru(){ga.remove("onlyRawData")}var ou=Object(X["defineComponent"])({components:{ActivityIndicator:ln,Widget:Ls},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;tu.resetPage(),this.loading=!0,this.renderInitialPage(),Object(X["watch"])((function(){return De.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(ru(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory,t.period,t.date,t.segment))})),ue.on("loadPage",(function(t,n){var r=De.parsed.value;e.renderPage(t,n,r.period,r.date,r.segment)}))},computed:{widgets:function(){return tu.widgets.value}},methods:{renderPage:function(e,t,n,r,o){var i=this;if(!e||!t)return tu.resetPage(),void(this.loading=!1);try{m.parse(n,r)}catch(c){return ga.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),tu.resetPage(),void(this.loading=!1)}ga.remove("invalidDate"),ue.postEvent("matomoPageChange",{}),ga.clearTransientNotifications(),m.parse(n,r).containsToday()&&this.showOnlyRawDataMessageIfRequired(e,t,n,r,o);var l={category:e,subcategory:t};if(ue.postEvent("ReportingPage.loadPage",l),l.promise)return this.loading=!0,void Promise.resolve(l.promise).finally((function(){i.loading=!1}));tu.fetchPage(e,t).then((function(){var t=!tu.page.value;if(t){var n=ic.findPageInCategory(e);if(n&&n.subcategory)return void De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{subcategory:n.subcategory.id}))}i.hasNoPage=t,i.loading=!1}))},renderInitialPage:function(){var e=De.parsed.value;this.renderPage(e.category,e.subcategory,e.period,e.date,e.segment)},showOnlyRawDataMessageIfRequired:function(e,t,n,r,o){var a=this;if(this.hasRawData&&this.hasNoVisits&&nu(),o)ru();else{var i=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],l=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"];if(-1===i.indexOf(t)&&-1===l.indexOf(e)&&-1===t.toLowerCase().indexOf("manage")){var c=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()0?(a.hasNoVisits=!1,void ru()):(a.hasNoVisits=!0,a.hasRawData?void nu():Ze.fetch({method:"Live.getMostRecentVisitsDateTime",date:r,period:n}).then((function(e){if(!e||""===e.value)return a.hasRawData=!1,void ru();a.hasRawData=!0,nu()})))}))}else ru()}}}});ou.render=Hs;var au=ou,iu={class:"report-export-popover row",id:"reportExport"},lu={class:"col l6"},cu={name:"format"},su={name:"option_flat"},uu={name:"option_expanded"},du={name:"option_format_metrics"},mu={class:"col l6"},pu={name:"filter_type"},fu={class:"filter_limit"},hu={name:"filter_limit_all"},bu={key:0,name:"filter_limit"},vu={key:1,name:"filter_limit"},gu={class:"col l12"},yu=["value"],Ou=Object(X["createTextVNode"])("\n "),ju=[Ou],wu=["innerHTML"],ku={class:"col l12"},Su=["href","title"],Cu=["innerHTML"];function Eu(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field"),l=Object(X["resolveDirective"])("select-on-focus");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",iu,[Object(X["createElementVNode"])("div",lu,[Object(X["createElementVNode"])("div",cu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",su,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[X["vShow"],e.hasSubtables]])])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",uu,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[X["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",du,[Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(X["createElementVNode"])("div",mu,[Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",pu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(X["createElementVNode"])("div",fu,[Object(X["withDirectives"])(Object(X["createElementVNode"])("div",hu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[X["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",bu,[Object(X["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(X["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",vu,[Object(X["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(X["createCommentVNode"])("",!0)])]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",gu,[Object(X["withDirectives"])(Object(X["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},ju,8,yu),[[l,{}]]),Object(X["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,wu)],512),[[X["vShow"],e.showUrl]]),Object(X["createElementVNode"])("div",ku,[Object(X["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(X["toDisplayString"])(e.translate("General_Export")),9,Su),Object(X["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(X["withDirectives"])(Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[X["vShow"],!e.showUrl]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[X["vShow"],e.showUrl]])])]),e.additionalContent?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,class:"col l12 report-export-popover-footer",innerHTML:e.$sanitize(e.additionalContent)},null,8,Cu)):Object(X["createCommentVNode"])("",!0)])}function Du(e,t){return Iu(e)||Nu(e,t)||Tu(e,t)||Pu()}function Pu(){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 Tu(e,t){if(e){if("string"===typeof e)return Vu(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)?Vu(e,t):void 0}}function Vu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.reportFormat,n=this.apiMethod,r=this.reportType,o=this.dataTable;if(t){var a={},i="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams?a=JSON.parse(this.requestParams):this.requestParams&&"object"===xu(this.requestParams)&&(a=this.requestParams);var l=o.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,m=l.idSite,p=o.param,f=p.date,h=p.period;"RSS"===t&&(f="last10"),"undefined"!==typeof o.param.dateUsedInGraph&&(f=o.param.dateUsedInGraph);var b=ue.config.datatable_export_range_as_day.toLowerCase();-1!==b.indexOf(t.toLowerCase())&&"range"===o.param.period&&(h="day"),"range"===o.param.period&&"graphEvolution"===o.param.viewDataTable&&(h="day");var v={module:"API",format:t,idSite:m,period:h,date:f};if("processed"===r){v.method="API.getProcessedReport";var g=n.split("."),y=Du(g,2);v.apiModule=y[0],v.apiAction=y[1]}else v.method=n;if(o.param.compareDates&&o.param.compareDates.length&&(v.compareDates=o.param.compareDates,v.compare="1"),o.param.comparePeriods&&o.param.comparePeriods.length&&(v.comparePeriods=o.param.comparePeriods,v.compare="1"),o.param.compareSegments&&o.param.compareSegments.length&&(v.compareSegments=o.param.compareSegments,v.compare="1"),"undefined"!==typeof o.param.filter_pattern&&(v.filter_pattern=o.param.filter_pattern),"undefined"!==typeof o.param.filter_pattern_recursive&&(v.filter_pattern_recursive=o.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=Du(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),v[n]=o})),this.optionFlat&&(v.flat=1,"undefined"!==typeof o.param.include_aggregate_rows&&"1"===o.param.include_aggregate_rows&&(v.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(v.expanded=1),this.optionFormatMetrics&&(v.format_metrics=1),o.param.pivotBy&&(v.pivotBy=o.param.pivotBy,v.pivotByColumnLimit=20,o.props.pivot_by_column&&(v.pivotByColumn=o.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(v.translateColumnNames=1,v.language=ue.language),"undefined"!==typeof c&&(v.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(v.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(v.idDimension=d),s){var O=s.split(",");if(O.length>1)v.label=O;else{var j=Du(O,1);v.label=j[0]}}v.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(v.token_auth=ue.token_auth,v.force_api_session=1),v.filter_limit=i;var w=window.location.href.split("?")[0];return"".concat(w,"?").concat(De.stringify(v))}}}});Au.render=Eu;var Mu=Au,Lu=window,_u=Lu.$,Fu={mounted:function(e,t){e.addEventListener("click",(function(){var n=De.hashParsed.value.popover,r=_u(e).closest("[data-report]").data("uiControlObject"),o=window.Piwik_Popover.showLoading("Export"),i=t.value.reportFormats,l=r.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,s={initialReportType:"default",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"yes":"no",initialOptionFlat:c,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:c||r.numberOfSubtables>0,availableReportFormats:{default:i,processed:{XML:i.XML,JSON:i.JSON}},availableReportTypes:{default:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},u=Nt({template:'\n ',data:function(){return{bind:s}}});u.component("popover",Mu);var d=document.createElement("div");u.mount(d);var m=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(a("General_Export")," ").concat(ue.helper.htmlEntities(m))),window.Piwik_Popover.setContent(d),window.Piwik_Popover.onClose((function(){u.unmount(),""!==n&&setTimeout((function(){De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),_u(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}},Ru=["src","width","height"];
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function Cu(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("img",{class:"sparklineImg",loading:"lazy",alt:"",src:e.sparklineUrl,width:e.width,height:e.height},null,8,Su)}function Eu(e){return Eu="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},Eu(e)}var Du=Object(X["defineComponent"])({props:{seriesIndices:Array,params:[Object,String],width:Number,height:Number},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=ue.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),o={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate,segment:De.parsed.value.segment},a="object"===Eu(t)?t:De.parse(t.substring(t.indexOf("?")+1)),i=new Ze,l=i.mixinDefaultGetParams(Object.assign(Object.assign({},o),a)),c=De.parsed.value.token_auth;return c&&c.length&&ue.shouldPropagateTokenAuth&&(l.token_auth=c),"?".concat(De.stringify(l))},defaultDate:function(){if("range"===ue.period)return"".concat(ue.startDateString,",").concat(ue.endDateString);var e=K.getLastNRange(ue.period,30,ue.currentDateString).getDateRange(),t=new Date(ue.minDateYear,ue.minDateMonth-1,ue.minDateDay);e[0]100?100:this.progress<0?0:this.progress}}});Bu.render=xu;var Au=Bu,Lu={mounted:function(e){e.classList.add("piwik-content-intro")},updated:function(e){Object(X["nextTick"])((function(){e.classList.add("piwik-content-intro")}))}},Mu={mounted:function(e,t){var n;null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.off||e.classList.add("card","card-table","entityTable")},updated:function(e,t){var n;null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.off||Object(X["nextTick"])((function(){e.classList.add("card","card-table","entityTable")}))}},_u={ref:"root"};
+ */function Hu(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("img",{class:"sparklineImg",loading:"lazy",alt:"",src:e.sparklineUrl,width:e.width,height:e.height},null,8,Ru)}function Uu(e){return Uu="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},Uu(e)}var $u=Object(X["defineComponent"])({props:{seriesIndices:Array,params:[Object,String],width:Number,height:Number},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=ue.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),o={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate,segment:De.parsed.value.segment},a="object"===Uu(t)?t:De.parse(t.substring(t.indexOf("?")+1)),i=new Ze,l=i.mixinDefaultGetParams(Object.assign(Object.assign({},o),a)),c=De.parsed.value.token_auth;return c&&c.length&&ue.shouldPropagateTokenAuth&&(l.token_auth=c),"?".concat(De.stringify(l))},defaultDate:function(){if("range"===ue.period)return"".concat(ue.startDateString,",").concat(ue.endDateString);var e=K.getLastNRange(ue.period,30,ue.currentDateString).getDateRange(),t=new Date(ue.minDateYear,ue.minDateMonth-1,ue.minDateDay);e[0]100?100:this.progress<0?0:this.progress}}});Ku.render=Ju;var Qu=Ku,Xu={mounted:function(e){e.classList.add("piwik-content-intro")},updated:function(e){Object(X["nextTick"])((function(){e.classList.add("piwik-content-intro")}))}},Zu={mounted:function(e,t){var n;null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.off||e.classList.add("card","card-table","entityTable")},updated:function(e,t){var n;null!==t&&void 0!==t&&null!==(n=t.value)&&void 0!==n&&n.off||Object(X["nextTick"])((function(){e.classList.add("card","card-table","entityTable")}))}},ed={ref:"root"};
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function Fu(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",_u,[Object(X["renderSlot"])(e.$slots,"default",{formData:e.formData,submitApiMethod:e.submitApiMethod,sendJsonPayload:e.sendJsonPayload,noErrorNotification:e.noErrorNotification,noSuccessNotification:e.noSuccessNotification,submitForm:e.submitForm,isSubmitting:e.isSubmitting,successfulPostResponse:e.successfulPostResponse,errorPostResponse:e.errorPostResponse})],512)}var Ru=window,Hu=Ru.$,Uu=Object(X["defineComponent"])({props:{formData:{type:Object,required:!0},submitApiMethod:{type:String,required:!0},sendJsonPayload:Boolean,noErrorNotification:Boolean,noSuccessNotification:Boolean},data:function(){return{isSubmitting:!1,successfulPostResponse:null,errorPostResponse:null}},emits:["update:modelValue"],mounted:function(){var e=this;Hu(this.$refs.root).on("click","input[type=submit]",(function(){e.submitForm()}))},methods:{submitForm:function(){var e=this;this.successfulPostResponse=null,this.errorPostResponse=null;var t=this.formData;this.sendJsonPayload&&(t={data:JSON.stringify(this.formData)}),this.isSubmitting=!0,Ze.post({module:"API",method:this.submitApiMethod},t,{createErrorNotification:!this.noErrorNotification}).then((function(t){if(e.successfulPostResponse=t,!e.noSuccessNotification){var n=na.show({message:a("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});na.scrollToNotification(n)}})).catch((function(t){e.errorPostResponse=t.message})).finally((function(){e.isSubmitting=!1}))}}});Uu.render=Fu;var $u=Uu;function qu(e,t,n,r,o,a){return Object(X["renderSlot"])(e.$slots,"default")}var Wu=Object(X["defineComponent"])({});Wu.render=qu;var zu=Wu,Gu={key:0},Yu=["data-target"],Ju=Object(X["createElementVNode"])("span",{class:"icon-configure"},null,-1),Ku=[Ju],Qu=["data-target"],Xu=["title"],Zu=["title","src"],ed=["id"],td=["data-footer-icon-id"],nd=["title"],rd=["title","src"],od={key:2},ad=Object(X["createElementVNode"])("li",{class:"divider"},null,-1),id=Object(X["createElementVNode"])("li",{class:"divider"},null,-1),ld=["title"],cd=Object(X["createElementVNode"])("span",{class:"icon-export"},null,-1),sd=[cd],ud=["title"],dd=Object(X["createElementVNode"])("span",{class:"icon-image"},null,-1),md=[dd],pd=["title"],fd=Object(X["createElementVNode"])("span",{class:"icon-annotation"},null,-1),hd=[fd],bd=["title"],gd=Object(X["createElementVNode"])("span",{class:"icon-search",draggable:"false"},null,-1),vd=["title"],yd=["id","title"],Od=["title"],jd=["title","src"],wd=["id"],kd={key:0},Sd=["innerHTML"],Cd={key:1},Ed=["innerHTML"],Dd={key:2},Pd=["innerHTML"],Td={key:3},Vd=["innerHTML"],Nd={key:4},Id=["innerHTML"],xd={key:5},Bd=["innerHTML"],Ad=["title","data-target"],Ld=Object(X["createElementVNode"])("span",{class:"icon-calendar"},null,-1),Md={class:"periodName"},_d=["id"],Fd=["data-period"];function Rd(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Passthrough"),l=Object(X["resolveDirective"])("dropdown-button"),c=Object(X["resolveDirective"])("report-export");return e.showFooter&&e.showFooterIcons?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Gu,[e.hasConfigItems&&(e.isAnyConfigureIconHighlighted||e.isTableView)?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:Object(X["normalizeClass"])(["dropdown-button dropdownConfigureIcon dataTableAction",{highlighted:e.isAnyConfigureIconHighlighted}]),href:"",onClick:t[0]||(t[0]=Object(X["withModifiers"])((function(){}),["prevent"])),"data-target":"dropdownConfigure".concat(e.randomIdForDropdown),style:{"margin-right":"3.5px"}},Ku,10,Yu)),[[l]]):Object(X["createCommentVNode"])("",!0),e.hasFooterIconsToShow?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"dropdown-button dataTableAction activateVisualizationSelection",href:"","data-target":"dropdownVisualizations".concat(e.randomIdForDropdown),style:{"margin-right":"3.5px"},onClick:t[1]||(t[1]=Object(X["withModifiers"])((function(){}),["prevent"]))},[/^icon-/.test(e.activeFooterIcon||"")?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,title:e.translate("CoreHome_ChangeVisualization"),class:Object(X["normalizeClass"])(e.activeFooterIcon)},null,10,Xu)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("img",{key:1,title:e.translate("CoreHome_ChangeVisualization"),width:"16",height:"16",src:e.activeFooterIcon},null,8,Zu))],8,Qu)),[[l]]):Object(X["createCommentVNode"])("",!0),e.showFooterIcons?(Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",{key:2,id:"dropdownVisualizations".concat(e.randomIdForDropdown),class:"dropdown-content dataTableFooterIcons"},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.footerIcons,(function(t,n){return Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:n},{default:Object(X["withCtx"])((function(){return[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.buttons.filter((function(e){return!!e.icon})),(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{key:n.id},[Object(X["createElementVNode"])("a",{class:Object(X["normalizeClass"])("".concat(t.class," tableIcon\n ").concat(-1!==e.activeFooterIconIds.indexOf(n.id)?"activeIcon":"")),"data-footer-icon-id":n.id},[/^icon-/.test(n.icon||"")?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,title:n.title,class:Object(X["normalizeClass"])(n.icon),style:{"margin-right":"5.5px"}},null,10,nd)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("img",{key:1,width:"16",height:"16",title:n.title,src:n.icon,style:{"margin-right":"5.5px"}},null,8,rd)),n.title?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",od,Object(X["toDisplayString"])(n.title),1)):Object(X["createCommentVNode"])("",!0)],10,td)])})),128)),ad]})),_:2},1024)})),128)),id],8,ed)):Object(X["createCommentVNode"])("",!0),e.showExport?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:3,class:"dataTableAction activateExportSelection",title:e.translate("General_ExportThisReport"),href:"",style:{"margin-right":"3.5px"},onClick:t[2]||(t[2]=Object(X["withModifiers"])((function(){}),["prevent"]))},sd,8,ld)),[[c,{reportTitle:e.reportTitle,requestParams:e.requestParams,apiMethod:e.apiMethodToRequestDataTable,reportFormats:e.reportFormats,maxFilterLimit:e.maxFilterLimit}]]):Object(X["createCommentVNode"])("",!0),e.showExportAsImageIcon?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:4,class:"dataTableAction tableIcon",href:"",id:"dataTableFooterExportAsImageIcon",onClick:t[3]||(t[3]=Object(X["withModifiers"])((function(t){return e.showExportImage(t)}),["prevent"])),title:e.translate("General_ExportAsImage"),style:{"margin-right":"3.5px"}},md,8,ud)):Object(X["createCommentVNode"])("",!0),e.showAnnotations?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:5,class:"dataTableAction annotationView",href:"",title:e.translate("Annotations_Annotations"),onClick:t[4]||(t[4]=Object(X["withModifiers"])((function(){}),["prevent"])),style:{"margin-right":"3.5px"}},hd,8,pd)):Object(X["createCommentVNode"])("",!0),e.showSearch?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:6,class:"dropdown-button dataTableAction searchAction",href:"",title:e.translate("General_Search"),style:{"margin-right":"3.5px"},draggable:"false",onClick:t[5]||(t[5]=Object(X["withModifiers"])((function(){}),["prevent"]))},[gd,Object(X["createElementVNode"])("span",{class:"icon-close",draggable:"false",title:e.translate("CoreHome_CloseSearch")},null,8,vd),Object(X["createElementVNode"])("input",{id:"widgetSearch_".concat(e.reportId),title:e.translate("CoreHome_DataTableHowToSearch"),type:"text",class:"dataTableSearchInput"},null,8,yd)],8,bd)):Object(X["createCommentVNode"])("",!0),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.dataTableActions,(function(e){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:e.id,class:Object(X["normalizeClass"])("dataTableAction ".concat(e.id)),href:"",onClick:t[6]||(t[6]=Object(X["withModifiers"])((function(){}),["prevent"])),title:e.title,style:{"margin-right":"3.5px"}},[/^icon-/.test(e.icon||"")?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,class:Object(X["normalizeClass"])(e.icon)},null,2)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("img",{key:1,width:"16",height:"16",title:e.title,src:e.icon},null,8,jd))],10,Od)})),128)),Object(X["createElementVNode"])("ul",{id:"dropdownConfigure".concat(e.randomIdForDropdown),class:"dropdown-content tableConfiguration"},[e.showFlattenTable?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",kd,[Object(X["createElementVNode"])("div",{class:"configItem dataTableFlatten",innerHTML:e.$sanitize(e.flattenItemText)},null,8,Sd)])):Object(X["createCommentVNode"])("",!0),e.showDimensionsConfigItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Cd,[Object(X["createElementVNode"])("div",{class:"configItem dataTableShowDimensions",innerHTML:e.$sanitize(e.showDimensionsText)},null,8,Ed)])):Object(X["createCommentVNode"])("",!0),e.showFlatConfigItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Dd,[Object(X["createElementVNode"])("div",{class:"configItem dataTableIncludeAggregateRows",innerHTML:e.$sanitize(e.includeAggregateRowsText)},null,8,Pd)])):Object(X["createCommentVNode"])("",!0),e.showTotalsConfigItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Td,[Object(X["createElementVNode"])("div",{class:"configItem dataTableShowTotalsRow",innerHTML:e.$sanitize(e.keepTotalsRowText)},null,8,Vd)])):Object(X["createCommentVNode"])("",!0),e.showExcludeLowPopulation?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Nd,[Object(X["createElementVNode"])("div",{class:"configItem dataTableExcludeLowPopulation",innerHTML:e.$sanitize(e.excludeLowPopText)},null,8,Id)])):Object(X["createCommentVNode"])("",!0),e.showPivotBySubtable?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",xd,[Object(X["createElementVNode"])("div",{class:"configItem dataTablePivotBySubtable",innerHTML:e.$sanitize(e.pivotByText)},null,8,Bd)])):Object(X["createCommentVNode"])("",!0)],8,wd),e.showPeriods?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:7,class:"dropdown-button dataTableAction activatePeriodsSelection",href:"",onClick:t[7]||(t[7]=Object(X["withModifiers"])((function(){}),["prevent"])),title:e.translate("CoreHome_ChangePeriod"),"data-target":"dropdownPeriods".concat(e.randomIdForDropdown)},[Object(X["createElementVNode"])("div",null,[Ld,Object(X["createElementVNode"])("span",Md,Object(X["toDisplayString"])(e.translations[e.clientSideParameters.period]||e.clientSideParameters.period),1)])],8,Ad)),[[l]]):Object(X["createCommentVNode"])("",!0),e.showPeriods?(Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",{key:8,id:"dropdownPeriods".concat(e.randomIdForDropdown),class:"dropdown-content dataTablePeriods"},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.selectablePeriods,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{key:t},[Object(X["createElementVNode"])("a",{"data-period":t,class:Object(X["normalizeClass"])("tableIcon ".concat(e.clientSideParameters.period===t?"activeIcon":""))},[Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translations[t]||t),1)],10,Fd)])})),128))],8,_d)):Object(X["createCommentVNode"])("",!0)])):Object(X["createCommentVNode"])("",!0)}function Hd(e){return Wd(e)||qd(e)||$d(e)||Ud()}function Ud(){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 $d(e,t){if(e){if("string"===typeof e)return zd(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)?zd(e,t):void 0}}function qd(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Wd(e){if(Array.isArray(e))return zd(e)}function zd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n'];n&&r.push(n);var o=a.apply(void 0,[e].concat(r));return t&&(o+=" (".concat(a("CoreHome_Default"),")")),o+="",o}return a(e)}function Kd(e,t,n){return e?Jd(t,!0):Jd(n)}function Qd(e){return!!e&&"0"!==e}var Xd=Object(X["defineComponent"])({props:{showPeriods:Boolean,showFooter:Boolean,showFooterIcons:Boolean,showSearch:Boolean,showFlattenTable:Boolean,footerIcons:{type:Array,required:!0},viewDataTable:{type:String,required:!0},reportTitle:String,requestParams:{type:Object,required:!0},apiMethodToRequestDataTable:{type:String,required:!0},maxFilterLimit:{type:Number,required:!0},showExport:Boolean,showExportAsImageIcon:Boolean,showAnnotations:Boolean,reportId:{type:String,required:!0},dataTableActions:{type:Array,required:!0},clientSideParameters:{type:Object,required:!0},hasMultipleDimensions:Boolean,isDataTableEmpty:Boolean,showTotalsRow:Boolean,showExcludeLowPopulation:Boolean,showPivotBySubtable:Boolean,selectablePeriods:Array,translations:{type:Object,required:!0},pivotDimensionName:String},components:{Passthrough:zu},directives:{DropdownButton:Bn,ReportExport:ku},methods:{showExportImage:function(e){Yd(e.target).closest(".dataTable").find("div.jqplot-target").trigger("piwikExportAsImage")}},computed:{randomIdForDropdown:function(){return Math.floor(999999*Math.random())},allFooterIcons:function(){return this.footerIcons.reduce((function(e,t){return e.push.apply(e,Hd(t.buttons)),e}),[])},activeFooterIcons:function(){var e=this,t=this.clientSideParameters,n=[this.viewDataTable];return 0===t.abandonedCarts||"0"===t.abandonedCarts?n.push("ecommerceOrder"):1!==t.abandonedCarts&&"1"!==t.abandonedCarts||n.push("ecommerceAbandonedCart"),n.map((function(t){return e.allFooterIcons.find((function(e){return e.id===t}))})).filter((function(e){return!!e}))},activeFooterIcon:function(){var e;return null===(e=this.activeFooterIcons[0])||void 0===e?void 0:e.icon},activeFooterIconIds:function(){return this.activeFooterIcons.map((function(e){return e.id}))},numIcons:function(){return this.allFooterIcons.length},hasFooterIconsToShow:function(){return!!this.activeFooterIcons.length&&this.numIcons>1},reportFormats:function(){var e={CSV:"CSV",TSV:"TSV (Excel)",XML:"XML",JSON:"Json",HTML:"HTML",RSS:"RSS"};return e},showDimensionsConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)&&this.hasMultipleDimensions},showFlatConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)},showTotalsConfigItem:function(){return!this.isDataTableEmpty&&this.showTotalsRow},hasConfigItems:function(){return this.showFlattenTable||this.showDimensionsConfigItem||this.showFlatConfigItem||this.showTotalsConfigItem||this.showExcludeLowPopulation||this.showPivotBySubtable},flattenItemText:function(){var e=this.clientSideParameters;return Kd(Qd(e.flat),"CoreHome_UnFlattenDataTable","CoreHome_FlattenDataTable")},keepTotalsRowText:function(){var e=this.clientSideParameters;return Kd(Qd(e.keep_totals_row),"CoreHome_RemoveTotalsRowDataTable","CoreHome_AddTotalsRowDataTable")},includeAggregateRowsText:function(){var e=this.clientSideParameters;return Kd(Qd(e.include_aggregate_rows),"CoreHome_DataTableExcludeAggregateRows","CoreHome_DataTableIncludeAggregateRows")},showDimensionsText:function(){var e=this.clientSideParameters;return Kd(Qd(e.show_dimensions),"CoreHome_DataTableCombineDimensions","CoreHome_DataTableShowDimensions")},pivotByText:function(){var e=this.clientSideParameters;return Qd(e.pivotBy)?Jd("CoreHome_UndoPivotBySubtable",!0):Jd("CoreHome_PivotBySubtable",!1,this.pivotDimensionName)},excludeLowPopText:function(){var e=this.clientSideParameters;return Kd(Qd(e.enable_filter_excludelowpop),"CoreHome_IncludeRowsWithLowPopulation","CoreHome_ExcludeRowsWithLowPopulation")},isAnyConfigureIconHighlighted:function(){var e=this.clientSideParameters;return Qd(e.flat)||Qd(e.keep_totals_row)||Qd(e.include_aggregate_rows)||Qd(e.show_dimensions)||Qd(e.pivotBy)||Qd(e.enable_filter_excludelowpop)},isTableView:function(){return"table"===this.viewDataTable||"tableAllColumns"===this.viewDataTable||"tableGoals"===this.viewDataTable}}});Xd.render=Rd;var Zd=Xd,em={key:0,class:"title",style:{cursor:"pointer"},ref:"expander"},tm=Object(X["createElementVNode"])("span",{class:"icon-warning"},null,-1),nm={key:1,class:"title",href:"?module=CoreUpdater&action=newVersionAvailable",style:{cursor:"pointer"},ref:"expander"},rm=Object(X["createElementVNode"])("span",{class:"icon-warning"},null,-1),om=["innerHTML"],am=["href"],im={id:"updateCheckLinkContainer"},lm={class:"dropdown positionInViewport"},cm=["innerHTML"],sm=["innerHTML"];function um(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Passthrough"),l=Object(X["resolveDirective"])("expand-on-hover");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{id:"header_message",class:Object(X["normalizeClass"])(["piwikSelector",{header_info:!e.latestVersionAvailable||e.lastUpdateCheckFailed,update_available:e.latestVersionAvailable}])},[e.latestVersionAvailable&&!e.isPiwikDemo?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:0},{default:Object(X["withCtx"])((function(){return[e.isMultiServerEnvironment?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",em,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),tm],512)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",nm,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),rm],512))]})),_:1})):e.isSuperUser&&(e.isAdminArea||e.lastUpdateCheckFailed)?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:1},{default:Object(X["withCtx"])((function(){return[e.isInternetEnabled?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:"title",innerHTML:e.$sanitize(e.updateCheck)},null,8,om)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"title",href:e.externalRawLink("https://matomo.org/changelog/"),target:"_blank",rel:"noreferrer noopener"},[Object(X["createElementVNode"])("span",im,Object(X["toDisplayString"])(e.translate("CoreHome_SeeAvailableVersions")),1)],8,am))]})),_:1})):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",lm,[e.latestVersionAvailable&&e.isSuperUser?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.updateNowText)},null,8,cm)):e.latestVersionAvailable&&!e.isPiwikDemo&&e.hasSomeViewAccess&&!e.isAnonymous?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.updateAvailableText)},null,8,sm)):Object(X["createCommentVNode"])("",!0),Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.translate("General_YouAreCurrentlyUsing",e.piwikVersion)),1)])],2)),[[l,{expander:"expander"}]])}var dm=Object(X["defineComponent"])({props:{isMultiServerEnvironment:Boolean,lastUpdateCheckFailed:Boolean,latestVersionAvailable:String,isPiwikDemo:Boolean,isSuperUser:Boolean,isAdminArea:Boolean,isInternetEnabled:Boolean,updateCheck:String,isAnonymous:Boolean,hasSomeViewAccess:Boolean,contactEmail:String,piwikVersion:String},components:{Passthrough:zu},directives:{ExpandOnHover:Pn},computed:{updateNowText:function(){var e="";if(this.isMultiServerEnvironment){var t=mt("https://builds.matomo.org/matomo-".concat(this.latestVersionAvailable,".zip"));e=a("CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment",'builds.matomo.org'))}else e=a("General_PiwikXIsAvailablePleaseUpdateNow",this.latestVersionAvailable||"",'
',"",pt("https://matomo.org/changelog/"),"");return"".concat(e,"
")},updateAvailableText:function(){var e=a("General_NewUpdatePiwikX",this.latestVersionAvailable||""),t=pt("https://matomo.org/")+"Matomo",n=pt("https://matomo.org/changelog/"),r=a("General_PiwikXIsAvailablePleaseNotifyPiwikAdmin","".concat(t," ").concat(n).concat(this.latestVersionAvailable,""),''),"");return"".concat(r,"
")}}});dm.render=um;var mm=dm;function pm(e,t){return vm(e)||gm(e,t)||hm(e,t)||fm()}function fm(){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 hm(e,t){if(e){if("string"===typeof e)return bm(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)?bm(e,t):void 0}}function bm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n'];n&&r.push(n);var o=a.apply(void 0,[e].concat(r));return t&&(o+=" (".concat(a("CoreHome_Default"),")")),o+="",o}return a(e)}function mm(e,t,n){return e?dm(t,!0):dm(n)}function pm(e){return!!e&&"0"!==e}var fm=Object(X["defineComponent"])({props:{showPeriods:Boolean,showFooter:Boolean,showFooterIcons:Boolean,showSearch:Boolean,showFlattenTable:Boolean,footerIcons:{type:Array,required:!0},viewDataTable:{type:String,required:!0},reportTitle:String,requestParams:{type:Object,required:!0},apiMethodToRequestDataTable:{type:String,required:!0},maxFilterLimit:{type:Number,required:!0},showExport:Boolean,showExportAsImageIcon:Boolean,showAnnotations:Boolean,reportId:{type:String,required:!0},dataTableActions:{type:Array,required:!0},clientSideParameters:{type:Object,required:!0},hasMultipleDimensions:Boolean,isDataTableEmpty:Boolean,showTotalsRow:Boolean,showExcludeLowPopulation:Boolean,showPivotBySubtable:Boolean,selectablePeriods:Array,translations:{type:Object,required:!0},pivotDimensionName:String},components:{Passthrough:cd},directives:{DropdownButton:Kn,ReportExport:Fu},methods:{showExportImage:function(e){um(e.target).closest(".dataTable").find("div.jqplot-target").trigger("piwikExportAsImage")}},computed:{randomIdForDropdown:function(){return Math.floor(999999*Math.random())},allFooterIcons:function(){return this.footerIcons.reduce((function(e,t){return e.push.apply(e,rm(t.buttons)),e}),[])},activeFooterIcons:function(){var e=this,t=this.clientSideParameters,n=[this.viewDataTable];return 0===t.abandonedCarts||"0"===t.abandonedCarts?n.push("ecommerceOrder"):1!==t.abandonedCarts&&"1"!==t.abandonedCarts||n.push("ecommerceAbandonedCart"),n.map((function(t){return e.allFooterIcons.find((function(e){return e.id===t}))})).filter((function(e){return!!e}))},activeFooterIcon:function(){var e;return null===(e=this.activeFooterIcons[0])||void 0===e?void 0:e.icon},activeFooterIconIds:function(){return this.activeFooterIcons.map((function(e){return e.id}))},numIcons:function(){return this.allFooterIcons.length},hasFooterIconsToShow:function(){return!!this.activeFooterIcons.length&&this.numIcons>1},reportFormats:function(){var e={CSV:"CSV",TSV:"TSV (Excel)",XML:"XML",JSON:"Json",HTML:"HTML",RSS:"RSS"};return e},showDimensionsConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)&&this.hasMultipleDimensions},showFlatConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)},showTotalsConfigItem:function(){return!this.isDataTableEmpty&&this.showTotalsRow},hasConfigItems:function(){return this.showFlattenTable||this.showDimensionsConfigItem||this.showFlatConfigItem||this.showTotalsConfigItem||this.showExcludeLowPopulation||this.showPivotBySubtable},flattenItemText:function(){var e=this.clientSideParameters;return mm(pm(e.flat),"CoreHome_UnFlattenDataTable","CoreHome_FlattenDataTable")},keepTotalsRowText:function(){var e=this.clientSideParameters;return mm(pm(e.keep_totals_row),"CoreHome_RemoveTotalsRowDataTable","CoreHome_AddTotalsRowDataTable")},includeAggregateRowsText:function(){var e=this.clientSideParameters;return mm(pm(e.include_aggregate_rows),"CoreHome_DataTableExcludeAggregateRows","CoreHome_DataTableIncludeAggregateRows")},showDimensionsText:function(){var e=this.clientSideParameters;return mm(pm(e.show_dimensions),"CoreHome_DataTableCombineDimensions","CoreHome_DataTableShowDimensions")},pivotByText:function(){var e=this.clientSideParameters;return pm(e.pivotBy)?dm("CoreHome_UndoPivotBySubtable",!0):dm("CoreHome_PivotBySubtable",!1,this.pivotDimensionName)},excludeLowPopText:function(){var e=this.clientSideParameters;return mm(pm(e.enable_filter_excludelowpop),"CoreHome_IncludeRowsWithLowPopulation","CoreHome_ExcludeRowsWithLowPopulation")},isAnyConfigureIconHighlighted:function(){var e=this.clientSideParameters;return pm(e.flat)||pm(e.keep_totals_row)||pm(e.include_aggregate_rows)||pm(e.show_dimensions)||pm(e.pivotBy)||pm(e.enable_filter_excludelowpop)},isTableView:function(){return"table"===this.viewDataTable||"tableAllColumns"===this.viewDataTable||"tableGoals"===this.viewDataTable}}});fm.render=nm;var hm=fm,bm={key:0,class:"title",style:{cursor:"pointer"},ref:"expander"},vm=Object(X["createElementVNode"])("span",{class:"icon-warning"},null,-1),gm={key:1,class:"title",href:"?module=CoreUpdater&action=newVersionAvailable",style:{cursor:"pointer"},ref:"expander"},ym=Object(X["createElementVNode"])("span",{class:"icon-warning"},null,-1),Om=["innerHTML"],jm=["href"],wm={id:"updateCheckLinkContainer"},km={class:"dropdown positionInViewport"},Sm=["innerHTML"],Cm=["innerHTML"];function Em(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Passthrough"),l=Object(X["resolveDirective"])("expand-on-hover");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{id:"header_message",class:Object(X["normalizeClass"])(["piwikSelector",{header_info:!e.latestVersionAvailable||e.lastUpdateCheckFailed,update_available:e.latestVersionAvailable}])},[e.latestVersionAvailable&&!e.isPiwikDemo?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:0},{default:Object(X["withCtx"])((function(){return[e.isMultiServerEnvironment?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",bm,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),vm],512)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",gm,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),ym],512))]})),_:1})):e.isSuperUser&&(e.isAdminArea||e.lastUpdateCheckFailed)?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:1},{default:Object(X["withCtx"])((function(){return[e.isInternetEnabled?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:"title",innerHTML:e.$sanitize(e.updateCheck)},null,8,Om)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"title",href:e.externalRawLink("https://matomo.org/changelog/"),target:"_blank",rel:"noreferrer noopener"},[Object(X["createElementVNode"])("span",wm,Object(X["toDisplayString"])(e.translate("CoreHome_SeeAvailableVersions")),1)],8,jm))]})),_:1})):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",km,[e.latestVersionAvailable&&e.isSuperUser?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.updateNowText)},null,8,Sm)):e.latestVersionAvailable&&!e.isPiwikDemo&&e.hasSomeViewAccess&&!e.isAnonymous?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.updateAvailableText)},null,8,Cm)):Object(X["createCommentVNode"])("",!0),Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.translate("General_YouAreCurrentlyUsing",e.piwikVersion)),1)])],2)),[[l,{expander:"expander"}]])}var Dm=Object(X["defineComponent"])({props:{isMultiServerEnvironment:Boolean,lastUpdateCheckFailed:Boolean,latestVersionAvailable:String,isPiwikDemo:Boolean,isSuperUser:Boolean,isAdminArea:Boolean,isInternetEnabled:Boolean,updateCheck:String,isAnonymous:Boolean,hasSomeViewAccess:Boolean,contactEmail:String,piwikVersion:String},components:{Passthrough:cd},directives:{ExpandOnHover:qn},computed:{updateNowText:function(){var e="";if(this.isMultiServerEnvironment){var t=Et("https://builds.matomo.org/matomo-".concat(this.latestVersionAvailable,".zip"));e=a("CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment",'builds.matomo.org'))}else e=a("General_PiwikXIsAvailablePleaseUpdateNow",this.latestVersionAvailable||"",'
',"",Dt("https://matomo.org/changelog/"),"");return"".concat(e,"
")},updateAvailableText:function(){var e=a("General_NewUpdatePiwikX",this.latestVersionAvailable||""),t=Dt("https://matomo.org/")+"Matomo",n=Dt("https://matomo.org/changelog/"),r=a("General_PiwikXIsAvailablePleaseNotifyPiwikAdmin","".concat(t," ").concat(n).concat(this.latestVersionAvailable,""),''),"");return"".concat(r,"
")}}});Dm.render=Em;var Pm=Dm;function Tm(e,t){return Bm(e)||xm(e,t)||Nm(e,t)||Vm()}function Vm(){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 Nm(e,t){if(e){if("string"===typeof e)return Im(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)?Im(e,t):void 0}}function Im(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n {
+
+ const numberTestData: Array> = [
+ // english formats
+ ['en', 5, 0, 0, '5'],
+ ['en', -5, 0, 3, '-5'],
+ ['en', 5.299, 0, 0, '5'],
+ ['en', 5.299, 3, 0, '5.299'],
+ ['en', -50, 3, 3, '-50.000'],
+ ['en', 5000, 0, 0, '5,000'],
+ ['en', 5000000, 0, 0, '5,000,000'],
+ ['en', -5000000, 0, 0, '-5,000,000'],
+
+ // foreign languages
+ ['ar', 51239.56, 3, 0, '51٬239٫56'],
+ ['be', 51239.56, 3, 0, '51 239,56'],
+ ['de', 51239.56, 3, 0, '51.239,56'],
+ ['he', 152551239.56, 3, 0, '152,551,239.56'],
+ ['he', -152551239.56, 3, 0, '-152,551,239.56'],
+ ['hi', 152551239.56, 0, 0, '15,25,51,240'],
+ ['lt', -152551239.56, 0, 0, '−152 551 240'],
+ ];
+
+ numberTestData.forEach((testdata) => {
+ const [ lang, input, maxFractionDigits, minFractionDigits, expected ] = testdata;
+
+ it(`should correctly format number with (${lang}, ${input}, ${maxFractionDigits}, ${minFractionDigits})`, () => {
+
+ window.piwik.numbers = formats[lang];
+
+ const result = NumberFormatter.formatNumber(input as number, maxFractionDigits as number, minFractionDigits as number);
+
+ expect(result).toEqual(expected);
+ })
+ });
+
+ const percentNumberTestData: Array> = [
+ // english formats
+ ['en', 5, 0, 0, '5%'],
+ ['en', -5, 0, 3, '-5%'],
+ ['en', 5.299, 0, 0, '5%'],
+ ['en', 5.299, 3, 0, '5.299%'],
+ ['en', -50, 3, 3, '-50.000%'],
+ ['en', -50, 1, 1, '-50.0%'],
+ ['en', -50.1, 3, 3, '-50.100%'],
+ ['en', 5000, 0, 0, '5,000%'],
+ ['en', +5000, 0, 0, '5,000%'],
+ ['en', 5000000, 0, 0, '5,000,000%'],
+ ['en', -5000000, 0, 0, '-5,000,000%'],
+
+ // foreign languages
+ ['ar', 51239.56, 3, 0, '51٬239٫56٪'],
+ ['be', 51239.56, 3, 0, '51 239,56 %'],
+ ['de', 51239.56, 3, 0, '51.239,56 %'],
+ ['he', 152551239.56, 3, 0, '152,551,239.56%'],
+ ['hi', 152551239.56, 0, 0, '15,25,51,240%'],
+ ['lt', -152551239.56, 0, 0, '−152 551 240 %'],
+ ];
+
+ percentNumberTestData.forEach((testdata) => {
+ const [ lang, input, maxFractionDigits, minFractionDigits, expected ] = testdata;
+
+ it(`should correctly format percent with (${lang}, ${input}, ${maxFractionDigits}, ${minFractionDigits})`, () => {
+
+ window.piwik.numbers = formats[lang];
+
+ const result = NumberFormatter.formatPercent(input as number, maxFractionDigits as number, minFractionDigits as number);
+
+ expect(result).toEqual(expected);
+ })
+ });
+
+ const currencyTestData: Array> = [
+ // english formats
+ ['en', 5, '$', 0, 0, '$5'],
+ ['en', -5, '$', 0, 3, '-$5'],
+ ['en', 5.299, '$', 0, 0, '$5'],
+ ['en', 5.299, '$', 3, 0, '$5.299'],
+ ['en', -50, '$', 3, 3, '-$50.000'],
+ ['en', -50, '$', 1, 1, '-$50.0'],
+ ['en', -50.1, '$', 3, 3, '-$50.100'],
+ ['en', 5000, '$', 0, 0, '$5,000'],
+ ['en', +5000, '$', 0, 0, '$5,000'],
+ ['en', 5000000, '$', 0, 0, '$5,000,000'],
+ ['en', -5000000, '$', 0, 0, '-$5,000,000'],
+
+ // foreign languages
+ ['ar', 51239.56, '$', 3, 0, '51٬239٫56 $'],
+ ['be', 51239.56, '$', 3, 0, '51 239,56 $'],
+ ['de', 51239.56, '$', 3, 0, '51.239,56 $'],
+ ['he', -152551239.56, '$', 3, 0, '-152,551,239.56 $'],
+ ['hi', 152551239.56, '$', 0, 0, '$15,25,51,240'],
+ ['lt', -152551239.56, '$', 0, 0, '−152 551 240 $'],
+ ];
+
+ currencyTestData.forEach((testdata) => {
+ const [ lang, input, currency, maxFractionDigits, minFractionDigits, expected ] = testdata;
+
+ it(`should correctly format currency with (${lang}, ${input}, ${currency}, ${maxFractionDigits}, ${minFractionDigits})`, () => {
+
+ window.piwik.numbers = formats[lang];
+
+ const result = NumberFormatter.formatCurrency(input as number, currency as string, maxFractionDigits as number, minFractionDigits as number);
+
+ expect(result).toEqual(expected);
+ })
+ });
+
+ const evolutionTestData: Array> = [
+ // english formats
+ ['en', 5, 0, 0, '+5%'],
+ ['en', -5, 0, 3, '-5%'],
+ ['en', 5.299, 0, 0, '+5%'],
+ ['en', 5.299, 3, 0, '+5.299%'],
+ ['en', -50, 3, 3, '-50.000%'],
+ ['en', -50, 1, 1, '-50.0%'],
+ ['en', -50.1, 3, 3, '-50.100%'],
+ ['en', 5000, 0, 0, '+5,000%'],
+ ['en', +5000, 0, 0, '+5,000%'],
+ ['en', 5000000, 0, 0, '+5,000,000%'],
+ ['en', -5000000, 0, 0, '-5,000,000%'],
+
+ // foreign languages
+ ['ar', 51239.56, 3, 0, '+51٬239٫56٪'],
+ ['be', 51239.56, 3, 0, '+51 239,56 %'],
+ ['de', 51239.56, 3, 0, '+51.239,56 %'],
+ ['he', 152551239.56, 3, 0, '+152,551,239.56%'],
+ ['hi', 152551239.56, 0, 0, '+15,25,51,240%'],
+ ['lt', -152551239.56, 0, 0, '−152 551 240 %'],
+ ];
+
+ evolutionTestData.forEach((testdata) => {
+ const [ lang, input, maxFractionDigits, minFractionDigits, expected ] = testdata;
+
+ it(`should correctly format evolution with (${lang}, ${input}, ${maxFractionDigits}, ${minFractionDigits})`, () => {
+
+ window.piwik.numbers = formats[lang];
+
+ const result = NumberFormatter.formatEvolution(input as number, maxFractionDigits as number, minFractionDigits as number);
+
+ expect(result).toEqual(expected);
+ })
+ });
+
+});
diff --git a/plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts b/plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts
new file mode 100644
index 00000000000..9e180b0ae65
--- /dev/null
+++ b/plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts
@@ -0,0 +1,217 @@
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+import Matomo from '../Matomo/Matomo';
+
+const { $ } = window;
+
+/**
+ * Number Formatter for formatting numbers, percent and currencies values
+ *
+ * @type {object}
+ */
+class NumberFormatter {
+ defaultMinFractionDigits = 0;
+
+ defaultMaxFractionDigits = 2;
+
+ /**
+ * Formats the given numeric value with the given pattern
+ *
+ * @param value
+ * @param pattern
+ * @returns {string}
+ */
+ private format(
+ val: string|number,
+ formatPattern: string,
+ maxFractionDigits: number,
+ minFractionDigits: number,
+ ): string {
+ if (!$.isNumeric(val)) {
+ return String(val);
+ }
+
+ let value = (val as number);
+
+ let pattern = formatPattern || Matomo.numbers.patternNumber;
+
+ const patterns = pattern.split(';');
+ if (patterns.length === 1) {
+ // No explicit negative pattern was provided, construct it.
+ patterns.push(`-${patterns[0]}`);
+ }
+
+ // Ensure that the value is positive and has the right number of digits.
+ const negative = value < 0;
+ pattern = negative ? patterns[1] : patterns[0];
+
+ value = Math.abs(value);
+
+ // round value to maximal number of fraction digits
+ if (maxFractionDigits >= 0) {
+ const factionFactor = 10 ** maxFractionDigits;
+ value = Math.round(value * factionFactor) / factionFactor;
+ }
+
+ // Split the number into major and minor digits.
+ const valueParts = value.toString().split('.');
+ let majorDigits = valueParts[0];
+
+ // Account for maxFractionDigits = 0, where the number won't
+ // have a decimal point, and $valueParts[1] won't be set.
+ let minorDigits = valueParts[1] || '';
+
+ const usesGrouping = (pattern.indexOf(',') !== -1);
+
+ // if pattern has number groups, parse them.
+ if (usesGrouping) {
+ const primaryGroupMatches = pattern.match(/#+0/);
+ const primaryGroupSize = primaryGroupMatches?.[0].length || 0;
+ let secondaryGroupSize = primaryGroupMatches?.[0].length || 0;
+ const numberGroups = pattern.split(',');
+
+ // check for distinct secondary group size.
+ if (numberGroups.length > 2) {
+ secondaryGroupSize = numberGroups[1].length;
+ }
+
+ // Reverse the major digits, since they are grouped from the right.
+ const digits = majorDigits.split('').reverse();
+ // Group the major digits.
+ let groups = [];
+
+ groups.push(digits.splice(0, primaryGroupSize).reverse().join(''));
+
+ while (digits.length) {
+ groups.push(digits.splice(0, secondaryGroupSize).reverse().join(''));
+ }
+
+ // Reverse the groups and the digits inside of them.
+ groups = groups.reverse();
+ // Reconstruct the major digits.
+ majorDigits = groups.join(',');
+ }
+
+ if (minFractionDigits > 0) {
+ // Strip any trailing zeroes.
+ minorDigits = minorDigits.replace(/0+$/, '');
+ if (
+ minorDigits.length < minFractionDigits
+ && minorDigits.length < maxFractionDigits
+ ) {
+ // Now there are too few digits, re-add trailing zeroes
+ // until the desired length is reached.
+ const neededZeroes = minFractionDigits - minorDigits.length;
+ minorDigits += (new Array(neededZeroes + 1)).join('0');
+ }
+ }
+
+ // Assemble the final number and insert it into the pattern.
+ let result = minorDigits ? `${majorDigits}.${minorDigits}` : majorDigits;
+ result = pattern.replace(/#(?:[.,]#+)*0(?:[,.][0#]+)*/, result);
+
+ // Localize the number.
+ return this.replaceSymbols(result);
+ }
+
+ /**
+ * Replaces the placeholders with real symbols
+ *
+ * @param value
+ * @returns {string}
+ */
+ private replaceSymbols(value: string): string {
+ const replacements = {
+ '.': Matomo.numbers.symbolDecimal,
+ ',': Matomo.numbers.symbolGroup,
+ '+': Matomo.numbers.symbolPlus,
+ '-': Matomo.numbers.symbolMinus,
+ '%': Matomo.numbers.symbolPercent,
+ };
+
+ let newValue = '';
+ const valueParts = value.split('');
+
+ valueParts.forEach((val) => {
+ let valueReplaced = val;
+
+ Object.entries(replacements).some(([char, replacement]) => {
+ if (valueReplaced.indexOf(char) !== -1) {
+ valueReplaced = valueReplaced.replace(char, replacement);
+ return true;
+ }
+
+ return false;
+ });
+
+ newValue += valueReplaced;
+ });
+
+ return newValue;
+ }
+
+ private valOrDefault(def: number, val?: number): number {
+ if (typeof val === 'undefined') {
+ return def;
+ }
+
+ return val;
+ }
+
+ public formatNumber(
+ value: string|number,
+ maxFractionDigits?: number,
+ minFractionDigits?: number,
+ ): string {
+ return this.format(
+ value,
+ Matomo.numbers.patternNumber,
+ this.valOrDefault(this.defaultMaxFractionDigits, maxFractionDigits),
+ this.valOrDefault(this.defaultMinFractionDigits, minFractionDigits),
+ );
+ }
+
+ public formatPercent(
+ value: string|number,
+ maxFractionDigits?: number,
+ minFractionDigits?: number,
+ ): string {
+ return this.format(
+ value,
+ Matomo.numbers.patternPercent,
+ this.valOrDefault(this.defaultMaxFractionDigits, maxFractionDigits),
+ this.valOrDefault(this.defaultMinFractionDigits, minFractionDigits),
+ );
+ }
+
+ public formatCurrency(
+ value: string|number,
+ currency: string,
+ maxFractionDigits?: number,
+ minFractionDigits?: number,
+ ): string {
+ const formatted = this.format(
+ value,
+ Matomo.numbers.patternCurrency,
+ this.valOrDefault(this.defaultMaxFractionDigits, maxFractionDigits),
+ this.valOrDefault(this.defaultMinFractionDigits, minFractionDigits),
+ );
+ return formatted.replace('¤', currency);
+ }
+
+ public formatEvolution(
+ evolution: string|number,
+ maxFractionDigits?: number,
+ minFractionDigits?: number,
+ ): string {
+ const formattedEvolution = this.formatPercent(evolution, maxFractionDigits, minFractionDigits);
+ return `${evolution as number > 0 ? Matomo.numbers.symbolPlus : ''}${formattedEvolution}`;
+ }
+}
+
+export default new NumberFormatter();
diff --git a/plugins/CoreHome/vue/src/NumberFormatter/index.ts b/plugins/CoreHome/vue/src/NumberFormatter/index.ts
new file mode 100644
index 00000000000..60225558393
--- /dev/null
+++ b/plugins/CoreHome/vue/src/NumberFormatter/index.ts
@@ -0,0 +1,9 @@
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+export { default as NumberFormatter } from './NumberFormatter';
+export * from './utilities';
diff --git a/plugins/CoreHome/vue/src/NumberFormatter/utilities.ts b/plugins/CoreHome/vue/src/NumberFormatter/utilities.ts
new file mode 100644
index 00000000000..9e59d54ee45
--- /dev/null
+++ b/plugins/CoreHome/vue/src/NumberFormatter/utilities.ts
@@ -0,0 +1,33 @@
+/*!
+ * Matomo - free/libre analytics platform
+ *
+ * @link https://matomo.org
+ * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ */
+
+import NumberFormatter from './NumberFormatter';
+
+export function formatNumber(
+ val: string,
+ maxFractionDigits?: number,
+ minFractionDigits?: number,
+): string {
+ return NumberFormatter.formatNumber(val, maxFractionDigits, minFractionDigits);
+}
+
+export function formatPercent(
+ val: string,
+ maxFractionDigits?: number,
+ minFractionDigits?: number,
+): string {
+ return NumberFormatter.formatPercent(val, maxFractionDigits, minFractionDigits);
+}
+
+export function formatCurrency(
+ val: string,
+ cur: string,
+ maxFractionDigits?: number,
+ minFractionDigits?: number,
+): string {
+ return NumberFormatter.formatCurrency(val, cur, maxFractionDigits, minFractionDigits);
+}
diff --git a/plugins/CoreHome/vue/src/createVueApp.ts b/plugins/CoreHome/vue/src/createVueApp.ts
index b175254de3f..57149b2eeb9 100644
--- a/plugins/CoreHome/vue/src/createVueApp.ts
+++ b/plugins/CoreHome/vue/src/createVueApp.ts
@@ -8,6 +8,7 @@
import { createApp } from 'vue';
import { translate, translateOrDefault } from './translate';
import { externalLink, externalRawLink } from './externalLink';
+import { formatNumber, formatPercent, formatCurrency } from './NumberFormatter';
export default function createVueApp(
...args: Parameters
@@ -18,5 +19,8 @@ export default function createVueApp(
app.config.globalProperties.translateOrDefault = translateOrDefault;
app.config.globalProperties.externalLink = externalLink;
app.config.globalProperties.externalRawLink = externalRawLink;
+ app.config.globalProperties.formatNumber = formatNumber;
+ app.config.globalProperties.formatPercent = formatPercent;
+ app.config.globalProperties.formatCurrency = formatCurrency;
return app;
}
diff --git a/plugins/CoreHome/vue/src/getFormattedEvolution.ts b/plugins/CoreHome/vue/src/getFormattedEvolution.ts
index 422bd2cde43..a56704e8a04 100644
--- a/plugins/CoreHome/vue/src/getFormattedEvolution.ts
+++ b/plugins/CoreHome/vue/src/getFormattedEvolution.ts
@@ -5,7 +5,7 @@
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
-import Matomo from './Matomo/Matomo';
+import { NumberFormatter } from './NumberFormatter';
function calculateEvolution(currentValue: string|number, pastValue: string|number) {
const pastValueParsed = parseInt(pastValue as string, 10);
@@ -24,14 +24,10 @@ function calculateEvolution(currentValue: string|number, pastValue: string|numbe
return evolution;
}
-function formatEvolution(evolution: number) {
- return `${evolution > 0 ? Matomo.numbers.symbolPlus : ''}${Math.round(evolution)}}%`;
-}
-
export default function getFormattedEvolution(
currentValue: string|number,
pastValue: string|number,
): string {
const evolution = calculateEvolution(currentValue, pastValue);
- return formatEvolution(evolution);
+ return NumberFormatter.formatEvolution(evolution);
}
diff --git a/plugins/CoreHome/vue/src/index.ts b/plugins/CoreHome/vue/src/index.ts
index b531daa49af..a5eac2728da 100644
--- a/plugins/CoreHome/vue/src/index.ts
+++ b/plugins/CoreHome/vue/src/index.ts
@@ -12,6 +12,7 @@ import './Periods/Month';
import './Periods/Year';
import './Periods/Range';
import './AjaxHelper/AjaxHelper.adapter';
+import './NumberFormatter/NumberFormatter.adapter';
import './PopoverHandler/PopoverHandler';
import './zenMode';
import Matomo from './Matomo/Matomo';
@@ -34,6 +35,7 @@ export { setCookie, getCookie, deleteCookie } from './CookieHelper/CookieHelper'
export { default as MatomoUrl } from './MatomoUrl/MatomoUrl';
export { Matomo };
export * from './Periods';
+export * from './NumberFormatter';
export { default as DropdownMenu } from './DropdownMenu/DropdownMenu';
export { default as FocusAnywhereButHere } from './FocusAnywhereButHere/FocusAnywhereButHere';
export { default as FocusIf } from './FocusIf/FocusIf';
diff --git a/plugins/CoreVue/types/index.d.ts b/plugins/CoreVue/types/index.d.ts
index 91d08c33f3b..9753611aabd 100644
--- a/plugins/CoreVue/types/index.d.ts
+++ b/plugins/CoreVue/types/index.d.ts
@@ -202,12 +202,6 @@ declare global {
let widgetsHelper: WidgetsHelper;
- interface NumberFormatter {
- formatNumber(value?: number|string): string;
- formatPercent(value?: number|string): string;
- formatCurrency(value?: number|string, currency: string): string;
- }
-
interface ListingFormatter {
formatAnd(values: string[]): string;
formatOr(values: string[]): string;
@@ -257,7 +251,6 @@ declare global {
widgetsHelper: WidgetsHelper;
$: JQueryStatic & JQueryStaticResolve;
Piwik_Popover: PiwikPopoverGlobal;
- NumberFormatter: NumberFormatter;
ListingFormatter: ListingFormatter;
Piwik_Transitions: TransitionsGlobal;
SegmentedVisitorLog: SegmentedVisitorLogService;
@@ -280,5 +273,8 @@ declare module '@vue/runtime-core' {
$sanitize: Window['vueSanitize'];
externalLink: (url: string, ...values:string[]) => string;
externalRawLink: (url: string, ...values:string[]) => string;
+ formatNumber: (val: string, maxFractionDigits?: number, minFractionDigits?: number) => string;
+ formatPercent: (val: string, maxFractionDigits?: number, minFractionDigits?: number) => string;
+ formatCurrency: (val: string, cur: string, maxFractionDigits?: number, minFractionDigits?: number) => string;
}
}
From 0dc4d1966854b4bea506687698e87ccb8328d9a5 Mon Sep 17 00:00:00 2001
From: sgiehl
Date: Tue, 12 Nov 2024 13:20:25 +0100
Subject: [PATCH 2/8] Migrate getFormattedEvolution to new NumberFormatter
---
plugins/CoreHome/vue/dist/CoreHome.umd.js | 74 +++++-----
plugins/CoreHome/vue/dist/CoreHome.umd.min.js | 50 +++----
.../NumberFormatter/NumberFormatter.spec.ts | 33 ++++-
.../src/NumberFormatter/NumberFormatter.ts | 39 ++++++
.../vue/src/NumberFormatter/utilities.ts | 23 +++-
plugins/CoreHome/vue/src/createVueApp.ts | 10 +-
.../CoreHome/vue/src/getFormattedEvolution.ts | 33 -----
plugins/CoreHome/vue/src/index.ts | 1 -
plugins/CoreVue/types/index.d.ts | 2 +
plugins/MultiSites/vue/dist/MultiSites.umd.js | 126 +++++++++---------
.../MultiSites/vue/dist/MultiSites.umd.min.js | 6 +-
.../vue/src/Dashboard/Dashboard.store.ts | 7 +-
.../vue/src/Dashboard/Dashboard.vue | 4 +-
13 files changed, 234 insertions(+), 174 deletions(-)
delete mode 100644 plugins/CoreHome/vue/src/getFormattedEvolution.ts
diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js
index 7d8913286e4..c64dc978648 100644
--- a/plugins/CoreHome/vue/dist/CoreHome.umd.js
+++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js
@@ -133,7 +133,6 @@ __webpack_require__.d(__webpack_exports__, "importPluginUmd", function() { retur
__webpack_require__.d(__webpack_exports__, "useExternalPluginComponent", function() { return /* reexport */ useExternalPluginComponent; });
__webpack_require__.d(__webpack_exports__, "DirectiveUtilities", function() { return /* reexport */ directiveUtilities; });
__webpack_require__.d(__webpack_exports__, "debounce", function() { return /* reexport */ debounce; });
-__webpack_require__.d(__webpack_exports__, "getFormattedEvolution", function() { return /* reexport */ getFormattedEvolution; });
__webpack_require__.d(__webpack_exports__, "clone", function() { return /* reexport */ clone; });
__webpack_require__.d(__webpack_exports__, "VueEntryContainer", function() { return /* reexport */ VueEntryContainer; });
__webpack_require__.d(__webpack_exports__, "ActivityIndicator", function() { return /* reexport */ ActivityIndicator; });
@@ -165,6 +164,8 @@ __webpack_require__.d(__webpack_exports__, "NumberFormatter", function() { retur
__webpack_require__.d(__webpack_exports__, "formatNumber", function() { return /* reexport */ utilities_formatNumber; });
__webpack_require__.d(__webpack_exports__, "formatPercent", function() { return /* reexport */ utilities_formatPercent; });
__webpack_require__.d(__webpack_exports__, "formatCurrency", function() { return /* reexport */ utilities_formatCurrency; });
+__webpack_require__.d(__webpack_exports__, "formatEvolution", function() { return /* reexport */ utilities_formatEvolution; });
+__webpack_require__.d(__webpack_exports__, "calculateAndFormatEvolution", function() { return /* reexport */ calculateAndFormatEvolution; });
__webpack_require__.d(__webpack_exports__, "DropdownMenu", function() { return /* reexport */ DropdownMenu; });
__webpack_require__.d(__webpack_exports__, "FocusAnywhereButHere", function() { return /* reexport */ FocusAnywhereButHere; });
__webpack_require__.d(__webpack_exports__, "FocusIf", function() { return /* reexport */ FocusIf; });
@@ -2372,10 +2373,41 @@ var NumberFormatter_NumberFormatter = /*#__PURE__*/function () {
}
}, {
key: "formatEvolution",
- value: function formatEvolution(evolution, maxFractionDigits, minFractionDigits) {
+ value: function formatEvolution(evolution, maxFractionDigits, minFractionDigits, noSign) {
+ if (noSign) {
+ return this.formatPercent(Math.abs(evolution), maxFractionDigits, minFractionDigits);
+ }
+
var formattedEvolution = this.formatPercent(evolution, maxFractionDigits, minFractionDigits);
return "".concat(evolution > 0 ? Matomo_Matomo.numbers.symbolPlus : '').concat(formattedEvolution);
}
+ }, {
+ key: "calculateAndFormatEvolution",
+ value: function calculateAndFormatEvolution(currentValue, pastValue, noSign) {
+ var pastValueParsed = parseInt(pastValue, 10);
+ var currentValueParsed = parseInt(currentValue, 10) - pastValueParsed;
+ var evolution;
+
+ if (currentValueParsed === 0 || Number.isNaN(currentValueParsed)) {
+ evolution = 0;
+ } else if (pastValueParsed === 0 || Number.isNaN(pastValueParsed)) {
+ evolution = 100;
+ } else {
+ evolution = currentValueParsed / pastValueParsed * 100;
+ }
+
+ var maxFractionDigits = 3;
+
+ if (Math.abs(evolution) > 100) {
+ maxFractionDigits = 0;
+ } else if (Math.abs(evolution) > 10) {
+ maxFractionDigits = 1;
+ } else if (Math.abs(evolution) > 1) {
+ maxFractionDigits = 2;
+ }
+
+ return this.formatEvolution(evolution, maxFractionDigits, 0, noSign);
+ }
}]);
return NumberFormatter;
@@ -2651,6 +2683,12 @@ function utilities_formatPercent(val, maxFractionDigits, minFractionDigits) {
function utilities_formatCurrency(val, cur, maxFractionDigits, minFractionDigits) {
return src_NumberFormatter_NumberFormatter.formatCurrency(val, cur, maxFractionDigits, minFractionDigits);
}
+function utilities_formatEvolution(val, maxFractionDigits, minFractionDigits, noSign) {
+ return src_NumberFormatter_NumberFormatter.formatEvolution(val, maxFractionDigits, minFractionDigits, noSign);
+}
+function calculateAndFormatEvolution(valCur, valPrev, noSign) {
+ return src_NumberFormatter_NumberFormatter.calculateAndFormatEvolution(valCur, valPrev, noSign);
+}
// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/NumberFormatter/index.ts
/*!
* Matomo - free/libre analytics platform
@@ -2681,6 +2719,8 @@ function createVueApp() {
app.config.globalProperties.formatNumber = utilities_formatNumber;
app.config.globalProperties.formatPercent = utilities_formatPercent;
app.config.globalProperties.formatCurrency = utilities_formatCurrency;
+ app.config.globalProperties.formatEvolution = utilities_formatEvolution;
+ app.config.globalProperties.calculateAndFormatEvolution = calculateAndFormatEvolution;
return app;
}
// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/importPluginUmd.ts
@@ -2848,35 +2888,6 @@ function debounce(fn) {
}, delayInMs);
};
}
-// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/getFormattedEvolution.ts
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-
-function calculateEvolution(currentValue, pastValue) {
- var pastValueParsed = parseInt(pastValue, 10);
- var currentValueParsed = parseInt(currentValue, 10) - pastValueParsed;
- var evolution;
-
- if (currentValueParsed === 0 || Number.isNaN(currentValueParsed)) {
- evolution = 0;
- } else if (pastValueParsed === 0 || Number.isNaN(pastValueParsed)) {
- evolution = 100;
- } else {
- evolution = currentValueParsed / pastValueParsed * 100;
- }
-
- return evolution;
-}
-
-function getFormattedEvolution(currentValue, pastValue) {
- var evolution = calculateEvolution(currentValue, pastValue);
- return src_NumberFormatter_NumberFormatter.formatEvolution(evolution);
-}
// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/clone.ts
/*!
* Matomo - free/libre analytics platform
@@ -12463,7 +12474,6 @@ function scrollToAnchorInUrl() {
-
// 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 307c2caa27e..e4b3d05effa 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 https://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,"createVueApp",(function(){return Nt})),n.d(t,"importPluginUmd",(function(){return Mt})),n.d(t,"useExternalPluginComponent",(function(){return Lt})),n.d(t,"DirectiveUtilities",(function(){return Ft})),n.d(t,"debounce",(function(){return Ht})),n.d(t,"getFormattedEvolution",(function(){return $t})),n.d(t,"clone",(function(){return qt})),n.d(t,"VueEntryContainer",(function(){return Yt})),n.d(t,"ActivityIndicator",(function(){return ln})),n.d(t,"MatomoLoader",(function(){return on})),n.d(t,"translate",(function(){return a})),n.d(t,"translateOrDefault",(function(){return i})),n.d(t,"externalRawLink",(function(){return Et})),n.d(t,"externalLink",(function(){return Dt})),n.d(t,"Alert",(function(){return dn})),n.d(t,"AjaxHelper",(function(){return Ze})),n.d(t,"setCookie",(function(){return Ot})),n.d(t,"getCookie",(function(){return jt})),n.d(t,"deleteCookie",(function(){return wt})),n.d(t,"MatomoUrl",(function(){return De})),n.d(t,"Matomo",(function(){return ue})),n.d(t,"Periods",(function(){return m})),n.d(t,"Day",(function(){return k})),n.d(t,"Week",(function(){return P})),n.d(t,"Month",(function(){return x})),n.d(t,"Year",(function(){return _})),n.d(t,"Range",(function(){return K})),n.d(t,"format",(function(){return p})),n.d(t,"getToday",(function(){return f})),n.d(t,"parseDate",(function(){return h})),n.d(t,"todayIsInRange",(function(){return b})),n.d(t,"getWeekNumber",(function(){return v})),n.d(t,"datesAreInTheSamePeriod",(function(){return g})),n.d(t,"NumberFormatter",(function(){return pt})),n.d(t,"formatNumber",(function(){return Pt})),n.d(t,"formatPercent",(function(){return Tt})),n.d(t,"formatCurrency",(function(){return Vt})),n.d(t,"DropdownMenu",(function(){return mn})),n.d(t,"FocusAnywhereButHere",(function(){return gn})),n.d(t,"FocusIf",(function(){return On})),n.d(t,"Tooltips",(function(){return Cn})),n.d(t,"MatomoDialog",(function(){return Tn})),n.d(t,"ExpandOnClick",(function(){return _n})),n.d(t,"ExpandOnHover",(function(){return qn})),n.d(t,"ShowSensitiveData",(function(){return Gn})),n.d(t,"DropdownButton",(function(){return Kn})),n.d(t,"SelectOnFocus",(function(){return nr})),n.d(t,"CopyToClipboard",(function(){return ar})),n.d(t,"SideNav",(function(){return ir})),n.d(t,"EnrichedHeadline",(function(){return kr})),n.d(t,"ContentBlock",(function(){return Ar})),n.d(t,"Comparisons",(function(){return bo})),n.d(t,"ComparisonsStore",(function(){return po})),n.d(t,"ComparisonsStoreInstance",(function(){return fo})),n.d(t,"MenuItemsDropdown",(function(){return Vo})),n.d(t,"DatePicker",(function(){return Lo})),n.d(t,"DateRangePicker",(function(){return qo})),n.d(t,"PeriodDatePicker",(function(){return Jo})),n.d(t,"Notification",(function(){return ia})),n.d(t,"NotificationGroup",(function(){return Oa})),n.d(t,"NotificationsStore",(function(){return ga})),n.d(t,"ShowHelpLink",(function(){return Ea})),n.d(t,"SitesStore",(function(){return Ia})),n.d(t,"SiteSelector",(function(){return Za})),n.d(t,"QuickAccess",(function(){return vi})),n.d(t,"FieldArray",(function(){return Ni})),n.d(t,"MultiPairField",(function(){return Yi})),n.d(t,"PeriodSelector",(function(){return Al})),n.d(t,"ReportingMenu",(function(){return _c})),n.d(t,"ReportingMenuStore",(function(){return wc})),n.d(t,"ReportingPagesStore",(function(){return ic})),n.d(t,"ReportMetadataStore",(function(){return qc})),n.d(t,"WidgetsStore",(function(){return Tc})),n.d(t,"WidgetLoader",(function(){return Zc})),n.d(t,"WidgetContainer",(function(){return fs})),n.d(t,"WidgetByDimensionContainer",(function(){return Vs})),n.d(t,"Widget",(function(){return Ls})),n.d(t,"ReportingPage",(function(){return au})),n.d(t,"ReportExport",(function(){return Fu})),n.d(t,"Sparkline",(function(){return qu})),n.d(t,"Progressbar",(function(){return Qu})),n.d(t,"ContentIntro",(function(){return Xu})),n.d(t,"ContentTable",(function(){return Zu})),n.d(t,"AjaxForm",(function(){return ad})),n.d(t,"Passthrough",(function(){return cd})),n.d(t,"DataTableActions",(function(){return hm})),n.d(t,"VersionInfoHeaderMessage",(function(){return Pm})),n.d(t,"MobileLeftMenu",(function(){return Km})),n.d(t,"scrollToAnchorInUrl",(function(){return ap})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}n("2342");
+ */window.hasBlockedContent=!1},"8bbf":function(t,n){t.exports=e},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"createVueApp",(function(){return xt})),n.d(t,"importPluginUmd",(function(){return Ft})),n.d(t,"useExternalPluginComponent",(function(){return _t})),n.d(t,"DirectiveUtilities",(function(){return Ht})),n.d(t,"debounce",(function(){return $t})),n.d(t,"clone",(function(){return qt})),n.d(t,"VueEntryContainer",(function(){return Yt})),n.d(t,"ActivityIndicator",(function(){return ln})),n.d(t,"MatomoLoader",(function(){return on})),n.d(t,"translate",(function(){return a})),n.d(t,"translateOrDefault",(function(){return i})),n.d(t,"externalRawLink",(function(){return Et})),n.d(t,"externalLink",(function(){return Dt})),n.d(t,"Alert",(function(){return dn})),n.d(t,"AjaxHelper",(function(){return Ze})),n.d(t,"setCookie",(function(){return Ot})),n.d(t,"getCookie",(function(){return jt})),n.d(t,"deleteCookie",(function(){return wt})),n.d(t,"MatomoUrl",(function(){return De})),n.d(t,"Matomo",(function(){return ue})),n.d(t,"Periods",(function(){return m})),n.d(t,"Day",(function(){return k})),n.d(t,"Week",(function(){return P})),n.d(t,"Month",(function(){return x})),n.d(t,"Year",(function(){return F})),n.d(t,"Range",(function(){return K})),n.d(t,"format",(function(){return p})),n.d(t,"getToday",(function(){return f})),n.d(t,"parseDate",(function(){return h})),n.d(t,"todayIsInRange",(function(){return b})),n.d(t,"getWeekNumber",(function(){return v})),n.d(t,"datesAreInTheSamePeriod",(function(){return g})),n.d(t,"NumberFormatter",(function(){return pt})),n.d(t,"formatNumber",(function(){return Pt})),n.d(t,"formatPercent",(function(){return Tt})),n.d(t,"formatCurrency",(function(){return Vt})),n.d(t,"formatEvolution",(function(){return Nt})),n.d(t,"calculateAndFormatEvolution",(function(){return It})),n.d(t,"DropdownMenu",(function(){return mn})),n.d(t,"FocusAnywhereButHere",(function(){return gn})),n.d(t,"FocusIf",(function(){return On})),n.d(t,"Tooltips",(function(){return Cn})),n.d(t,"MatomoDialog",(function(){return Tn})),n.d(t,"ExpandOnClick",(function(){return Fn})),n.d(t,"ExpandOnHover",(function(){return qn})),n.d(t,"ShowSensitiveData",(function(){return Gn})),n.d(t,"DropdownButton",(function(){return Kn})),n.d(t,"SelectOnFocus",(function(){return nr})),n.d(t,"CopyToClipboard",(function(){return ar})),n.d(t,"SideNav",(function(){return ir})),n.d(t,"EnrichedHeadline",(function(){return kr})),n.d(t,"ContentBlock",(function(){return Ar})),n.d(t,"Comparisons",(function(){return bo})),n.d(t,"ComparisonsStore",(function(){return po})),n.d(t,"ComparisonsStoreInstance",(function(){return fo})),n.d(t,"MenuItemsDropdown",(function(){return Vo})),n.d(t,"DatePicker",(function(){return Lo})),n.d(t,"DateRangePicker",(function(){return qo})),n.d(t,"PeriodDatePicker",(function(){return Jo})),n.d(t,"Notification",(function(){return ia})),n.d(t,"NotificationGroup",(function(){return Oa})),n.d(t,"NotificationsStore",(function(){return ga})),n.d(t,"ShowHelpLink",(function(){return Ea})),n.d(t,"SitesStore",(function(){return Ia})),n.d(t,"SiteSelector",(function(){return Za})),n.d(t,"QuickAccess",(function(){return vi})),n.d(t,"FieldArray",(function(){return Ni})),n.d(t,"MultiPairField",(function(){return Yi})),n.d(t,"PeriodSelector",(function(){return Al})),n.d(t,"ReportingMenu",(function(){return Fc})),n.d(t,"ReportingMenuStore",(function(){return wc})),n.d(t,"ReportingPagesStore",(function(){return ic})),n.d(t,"ReportMetadataStore",(function(){return qc})),n.d(t,"WidgetsStore",(function(){return Tc})),n.d(t,"WidgetLoader",(function(){return Zc})),n.d(t,"WidgetContainer",(function(){return fs})),n.d(t,"WidgetByDimensionContainer",(function(){return Vs})),n.d(t,"Widget",(function(){return Ls})),n.d(t,"ReportingPage",(function(){return au})),n.d(t,"ReportExport",(function(){return _u})),n.d(t,"Sparkline",(function(){return qu})),n.d(t,"Progressbar",(function(){return Qu})),n.d(t,"ContentIntro",(function(){return Xu})),n.d(t,"ContentTable",(function(){return Zu})),n.d(t,"AjaxForm",(function(){return ad})),n.d(t,"Passthrough",(function(){return cd})),n.d(t,"DataTableActions",(function(){return hm})),n.d(t,"VersionInfoHeaderMessage",(function(){return Pm})),n.d(t,"MobileLeftMenu",(function(){return Km})),n.d(t,"scrollToAnchorInUrl",(function(){return ap})),"undefined"!==typeof window){var r=window.document.currentScript,o=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);o&&(n.p=o[1])}n("2342");
/*!
* Matomo - free/libre analytics platform
*
@@ -48,13 +48,13 @@ function p(e){return $.datepicker.formatDate("yy-mm-dd",e)}function f(){var e=ne
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */m.addCustomPeriod("month",x);var _=function(){function e(t){B(this,e),L(this,"dateInPeriod",void 0),this.dateInPeriod=t}return M(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 b(this.getDateRange())}}],[{key:"parse",value:function(t){return new e(h(t))}},{key:"getDisplayText",value:function(){return a("Intl_PeriodYear")}}]),e}();function F(e,t){return W(e)||q(e,t)||H(e,t)||R()}function R(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function H(e,t){if(e){if("string"===typeof e)return U(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)?U(e,t):void 0}}function U(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"day";if(/^previous/.test(t)){var r=e.getLastNRange(n,"2").startDate;return e.getLastNRange(n,t.substring(8),r)}if(/^last/.test(t))return e.getLastNRange(n,t.substring(4));var o=decodeURIComponent(t).split(",");return new e(h(o[0]),h(o[1]),n)}},{key:"getDisplayText",value:function(){return a("General_DateRangeInPeriodList")}}]),e}();m.addCustomPeriod("range",K);var Q,X=n("8bbf");function Z(e){return re(e)||ne(e)||te(e)||ee()}function ee(){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 te(e,t){if(e){if("string"===typeof e)return oe(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)?oe(e,t):void 0}}function ne(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function re(e){if(Array.isArray(e))return oe(e)}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:"day";if(/^previous/.test(t)){var r=e.getLastNRange(n,"2").startDate;return e.getLastNRange(n,t.substring(8),r)}if(/^last/.test(t))return e.getLastNRange(n,t.substring(4));var o=decodeURIComponent(t).split(",");return new e(h(o[0]),h(o[1]),n)}},{key:"getDisplayText",value:function(){return a("General_DateRangeInPeriodList")}}]),e}();m.addCustomPeriod("range",K);var Q,X=n("8bbf");function Z(e){return re(e)||ne(e)||te(e)||ee()}function ee(){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 te(e,t){if(e){if("string"===typeof e)return oe(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)?oe(e,t):void 0}}function ne(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function re(e){if(Array.isArray(e))return oe(e)}function oe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?this.stringify(e):e,r=Object.keys(t).length?this.getFinalHashParams(t,e):{},o=this.stringify(r),a="?".concat(n);o.length&&(a="".concat(a,"#?").concat(o)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,a)}},{key:"getFinalHashParams",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?e:this.parse(e),r="string"!==typeof e?t:this.parse(t);return Object.assign({period:r.period||this.parsed.value.period,date:r.date||this.parsed.value.date,segment:r.segment||this.parsed.value.segment},n)}},{key:"updateLocation",value:function(e){ue.helper.isReportingPage()?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:"parse",value:function(e){return ke.getValuesFromUrl("?".concat(e),!0)}},{key:"stringify",value:function(e){var t=Object.fromEntries(Object.entries(e).filter((function(e){var t=de(e,2),n=t[1];return""!==n&&null!==n&&void 0!==n})));return $.param(t).replace(/%5B%5D/g,"[]").replace(/%2C/g,",").replace(/\+/g,"%20")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(Se(t,e)&&(we.period!==t||we.currentDateString!==e)){we.period=t;var n=m.parse(t,e).getDateRange();we.startDateString=p(n[0]),we.endDateString=p(n[1]),we.updateDateInTitle(e,t),"range"===we.period&&(e="".concat(we.startDateString,",").concat(we.endDateString)),we.currentDateString=e}}}]),e}(),Ee=new Ce,De=Ee;function Pe(e){return Pe="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},Pe(e)}function Te(e){return xe(e)||Ie(e)||Ne(e)||Ve()}function Ve(){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 Ne(e,t){if(e){if("string"===typeof e)return Be(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)?Be(e,t):void 0}}function Ie(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function xe(e){if(Array.isArray(e))return Be(e)}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?this.stringify(e):e,r=Object.keys(t).length?this.getFinalHashParams(t,e):{},o=this.stringify(r),a="?".concat(n);o.length&&(a="".concat(a,"#?").concat(o)),window.broadcast.propagateNewPage("",void 0,void 0,void 0,a)}},{key:"getFinalHashParams",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="string"!==typeof e?e:this.parse(e),r="string"!==typeof e?t:this.parse(t);return Object.assign({period:r.period||this.parsed.value.period,date:r.date||this.parsed.value.date,segment:r.segment||this.parsed.value.segment},n)}},{key:"updateLocation",value:function(e){ue.helper.isReportingPage()?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:"parse",value:function(e){return ke.getValuesFromUrl("?".concat(e),!0)}},{key:"stringify",value:function(e){var t=Object.fromEntries(Object.entries(e).filter((function(e){var t=de(e,2),n=t[1];return""!==n&&null!==n&&void 0!==n})));return $.param(t).replace(/%5B%5D/g,"[]").replace(/%2C/g,",").replace(/\+/g,"%20")}},{key:"updatePeriodParamsFromUrl",value:function(){var e=this.getSearchParam("date"),t=this.getSearchParam("period");if(Se(t,e)&&(we.period!==t||we.currentDateString!==e)){we.period=t;var n=m.parse(t,e).getDateRange();we.startDateString=p(n[0]),we.endDateString=p(n[1]),we.updateDateInTitle(e,t),"range"===we.period&&(e="".concat(we.startDateString,",").concat(we.endDateString)),we.currentDateString=e}}}]),e}(),Ee=new Ce,De=Ee;function Pe(e){return Pe="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},Pe(e)}function Te(e){return xe(e)||Ie(e)||Ne(e)||Ve()}function Ve(){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 Ne(e,t){if(e){if("string"===typeof e)return Be(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)?Be(e,t):void 0}}function Ie(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function xe(e){if(Array.isArray(e))return Be(e)}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=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"),a[e]>1?i+="".concat(e," (").concat(a[e],"x)"):i+=e}));var l=null,c="toast";Ke(e.errorElement).length&&i.length&&(Ke(e.errorElement).show(),l=e.errorElement,c=null);var s=!document.querySelector("#login_form");if(i&&s){var u=window["require"]("piwik/UI"),d=new u.Notification;d.show(i,{placeat:l,context:"error",type:c,id:"ajaxHelper"}),d.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,ue.ajaxRequestFinished&&ue.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return Ke.ajax(o)}},{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()||ue.shouldPropagateTokenAuth?{token_auth:ue.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Object.assign(Object.assign({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=De.getSearchParam("segment"),r={idSite:ue.idSite?ue.idSite.toString():broadcast.getValueFromUrl("idSite"),period:ue.period||broadcast.getValueFromUrl("period"),segment:n},o=e;return o.token_auth&&(o.token_auth=null,delete o.token_auth),Object.keys(r).forEach((function(e){!t.useGETDefaultParameter(e)||null!==o[e]&&"undefined"!==typeof o[e]&&""!==o[e]||null!==t.postParams[e]&&"undefined"!==typeof t.postParams[e]&&""!==t.postParams[e]||!r[e]||(o[e]=r[e])})),!this.useGETDefaultParameter("date")||o.date||this.postParams.date||(o.date=ue.currentDateString),o}},{key:"getRequestHandle",value:function(){return this.requestHandle}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;n.withTokenInUrl&&r.withTokenInUrl(),n.errorElement&&r.setErrorElement(n.errorElement),n.redirectOnSuccess&&r.redirectOnSuccess(!0!==n.redirectOnSuccess?n.redirectOnSuccess:void 0),r.setFormat(n.format||"json"),Array.isArray(t)?r.setBulkRequests.apply(r,Te(t)):(Object.keys(t).forEach((function(e){if(/password/i.test(e))throw new Error("Password parameters are not allowed to be sent as GET parameter. Please send ".concat(e," as POST parameter instead."))})),r.addParams(Object.assign(Object.assign({module:"API",format:n.format||"json"},t),{},{segment:t.segment?encodeURIComponent(t.segment):void 0}),"get")),n.postParams&&r.addParams(n.postParams,"post"),n.headers&&(r.headers=Object.assign(Object.assign({},r.headers),n.headers));var o=!0;return"undefined"===typeof n.createErrorNotification||n.createErrorNotification||(r.useCallbackInCaseOfError(),r.setErrorCallback(null),o=!1),n.abortController&&(r.abortController=n.abortController),n.returnResponseObject&&(r.resolveWithHelper=!0),r.send().then((function(t){var n=t instanceof e?t.requestHandle.responseJSON:t,o="API.getBulkRequest"===r.postParams.method&&Array.isArray(n)?n:[n],a=o.filter((function(e){return"error"===e.result})).map((function(e){return e.message}));if(a.length)throw new Xe(a.filter((function(e){return e.length})).join("\n"));return t})).catch((function(e){if(o||e instanceof Xe)throw e;var t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)}))}},{key:"post",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fetch(t,Object.assign(Object.assign({},r),{},{postParams:n}))}},{key:"oneAtATime",value:function(t,n){var r=null;return function(o,a){return r&&r.abort(),r=new AbortController,e.post(Object.assign(Object.assign({},o),{},{method:t}),a,Object.assign(Object.assign({},n),{},{abortController:r})).finally((function(){r=null}))}}}]),e}();function et(e,t){return at(e)||ot(e,t)||nt(e,t)||tt()}function tt(){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 nt(e,t){if(e){if("string"===typeof e)return rt(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)?rt(e,t):void 0}}function rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=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"),a[e]>1?i+="".concat(e," (").concat(a[e],"x)"):i+=e}));var l=null,c="toast";Ke(e.errorElement).length&&i.length&&(Ke(e.errorElement).show(),l=e.errorElement,c=null);var s=!document.querySelector("#login_form");if(i&&s){var u=window["require"]("piwik/UI"),d=new u.Notification;d.show(i,{placeat:l,context:"error",type:c,id:"ajaxHelper"}),d.scrollToNotification()}}else e.callback&&e.callback(t,n,r);window.globalAjaxQueue.active-=1,ue.ajaxRequestFinished&&ue.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return Ke.ajax(o)}},{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()||ue.shouldPropagateTokenAuth?{token_auth:ue.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}},{key:"mixinDefaultPostParams",value:function(e){var t=this.getDefaultPostParams(),n=Object.assign(Object.assign({},t),e);return n}},{key:"mixinDefaultGetParams",value:function(e){var t=this,n=De.getSearchParam("segment"),r={idSite:ue.idSite?ue.idSite.toString():broadcast.getValueFromUrl("idSite"),period:ue.period||broadcast.getValueFromUrl("period"),segment:n},o=e;return o.token_auth&&(o.token_auth=null,delete o.token_auth),Object.keys(r).forEach((function(e){!t.useGETDefaultParameter(e)||null!==o[e]&&"undefined"!==typeof o[e]&&""!==o[e]||null!==t.postParams[e]&&"undefined"!==typeof t.postParams[e]&&""!==t.postParams[e]||!r[e]||(o[e]=r[e])})),!this.useGETDefaultParameter("date")||o.date||this.postParams.date||(o.date=ue.currentDateString),o}},{key:"getRequestHandle",value:function(){return this.requestHandle}}],[{key:"fetch",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new e;n.withTokenInUrl&&r.withTokenInUrl(),n.errorElement&&r.setErrorElement(n.errorElement),n.redirectOnSuccess&&r.redirectOnSuccess(!0!==n.redirectOnSuccess?n.redirectOnSuccess:void 0),r.setFormat(n.format||"json"),Array.isArray(t)?r.setBulkRequests.apply(r,Te(t)):(Object.keys(t).forEach((function(e){if(/password/i.test(e))throw new Error("Password parameters are not allowed to be sent as GET parameter. Please send ".concat(e," as POST parameter instead."))})),r.addParams(Object.assign(Object.assign({module:"API",format:n.format||"json"},t),{},{segment:t.segment?encodeURIComponent(t.segment):void 0}),"get")),n.postParams&&r.addParams(n.postParams,"post"),n.headers&&(r.headers=Object.assign(Object.assign({},r.headers),n.headers));var o=!0;return"undefined"===typeof n.createErrorNotification||n.createErrorNotification||(r.useCallbackInCaseOfError(),r.setErrorCallback(null),o=!1),n.abortController&&(r.abortController=n.abortController),n.returnResponseObject&&(r.resolveWithHelper=!0),r.send().then((function(t){var n=t instanceof e?t.requestHandle.responseJSON:t,o="API.getBulkRequest"===r.postParams.method&&Array.isArray(n)?n:[n],a=o.filter((function(e){return"error"===e.result})).map((function(e){return e.message}));if(a.length)throw new Xe(a.filter((function(e){return e.length})).join("\n"));return t})).catch((function(e){if(o||e instanceof Xe)throw e;var t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)}))}},{key:"post",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fetch(t,Object.assign(Object.assign({},r),{},{postParams:n}))}},{key:"oneAtATime",value:function(t,n){var r=null;return function(o,a){return r&&r.abort(),r=new AbortController,e.post(Object.assign(Object.assign({},o),{},{method:t}),a,Object.assign(Object.assign({},n),{},{abortController:r})).finally((function(){r=null}))}}}]),e}();function et(e,t){return at(e)||ot(e,t)||nt(e,t)||tt()}function tt(){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 nt(e,t){if(e){if("string"===typeof e)return rt(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)?rt(e,t):void 0}}function rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0){var c=Math.pow(10,n);o=Math.round(o*c)/c}var s=o.toString().split("."),u=s[0],d=s[1]||"",m=-1!==a.indexOf(",");if(m){var p=a.match(/#+0/),f=(null===p||void 0===p?void 0:p[0].length)||0,h=(null===p||void 0===p?void 0:p[0].length)||0,b=a.split(",");b.length>2&&(h=b[1].length);var v=u.split("").reverse(),g=[];g.push(v.splice(0,f).reverse().join(""));while(v.length)g.push(v.splice(0,h).reverse().join(""));g=g.reverse(),u=g.join(",")}if(r>0&&(d=d.replace(/0+$/,""),d.length0?ue.numbers.symbolPlus:"").concat(r)}}]),e}(),pt=new mt;function ft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(e,t){for(var n=0;n=0){var c=Math.pow(10,n);o=Math.round(o*c)/c}var s=o.toString().split("."),u=s[0],d=s[1]||"",m=-1!==a.indexOf(",");if(m){var p=a.match(/#+0/),f=(null===p||void 0===p?void 0:p[0].length)||0,h=(null===p||void 0===p?void 0:p[0].length)||0,b=a.split(",");b.length>2&&(h=b[1].length);var v=u.split("").reverse(),g=[];g.push(v.splice(0,f).reverse().join(""));while(v.length)g.push(v.splice(0,h).reverse().join(""));g=g.reverse(),u=g.join(",")}if(r>0&&(d=d.replace(/0+$/,""),d.length0?ue.numbers.symbolPlus:"").concat(o)}},{key:"calculateAndFormatEvolution",value:function(e,t,n){var r,o=parseInt(t,10),a=parseInt(e,10)-o;r=0===a||Number.isNaN(a)?0:0===o||Number.isNaN(o)?100:a/o*100;var i=3;return Math.abs(r)>100?i=0:Math.abs(r)>10?i=1:Math.abs(r)>1&&(i=2),this.formatEvolution(r,i,0,n)}}]),e}(),pt=new mt;function ft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ht(e,t){for(var n=0;n1?t-1:0),r=1;r1?t-1:0),r=1;rAt)try{var r=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;i.message="Loading plugin ".concat(e," on demand failed.\n(").concat(r,": ").concat(a,")"),i.name="PluginOnDemandLoadError",i.type=r,i.request=a,t(i)}finally{t=void 0,n=void 0}else setTimeout(c,Bt)}setTimeout(c,Bt)};return r=setTimeout((function(){l({type:"timeout",target:a})}),xt),a.onerror=l,a.onload=l,document.head.appendChild(a),new Promise((function(e,r){n=e,t=r}))}
+ */ue.on("Matomo.topControlsRendered",(function(){Ct()}));var Bt={},At=120,Mt=50,Lt=1e3;function Ft(e){if(Bt[e])return Bt[e];if(window[e])return Promise.resolve(window[e]);var t,n,r,o="?module=Proxy&action=getPluginUmdJs&plugin=".concat(e),a=document.createElement("script");a.charset="utf-8",a.timeout=At,a.src=o;var i=new Error,l=function(o){a.onerror=null,a.onload=null,clearTimeout(r);var l=0;function c(){if(l+=Mt,t&&n)if(window[e]&&n)try{n(window[e])}finally{t=void 0,n=void 0}else if(l>Lt)try{var r=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;i.message="Loading plugin ".concat(e," on demand failed.\n(").concat(r,": ").concat(a,")"),i.name="PluginOnDemandLoadError",i.type=r,i.request=a,t(i)}finally{t=void 0,n=void 0}else setTimeout(c,Mt)}setTimeout(c,Mt)};return r=setTimeout((function(){l({type:"timeout",target:a})}),At),a.onerror=l,a.onload=l,document.head.appendChild(a),new Promise((function(e,r){n=e,t=r}))}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function Lt(e,t){return Object(X["defineAsyncComponent"])((function(){return Mt(e).then((function(e){return e||resolve(null),e[t]}))}))}
+ */function _t(e,t){return Object(X["defineAsyncComponent"])((function(){return Ft(e).then((function(e){return e||resolve(null),e[t]}))}))}
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function _t(e,t){var n;return e instanceof HTMLElement?e:null===(n=t.instance)||void 0===n?void 0:n.$refs[e]}var Ft={getRef:_t},Rt=300;function Ht(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Rt;return function(){for(var r=this,o=arguments.length,a=new Array(o),i=0;i1&&void 0!==arguments[1]?arguments[1]:Ut;return function(){for(var r=this,o=arguments.length,a=new Array(o),i=0;i0&&(l+=r.slice(0,o)),l+=r.slice(o).replace(/./g,"*"),n.html(l),zn(i).tooltip({content:a("CoreHome_ClickToSeeFullInformation"),items:"*",track:!0}),zn(i).one("click",c),zn(i).css({cursor:"pointer"})}},Yn=window,Jn=Yn.$,Kn={mounted:function(e){var t=Jn(e);!t.attr("data-target")&&t.attr("data-activates")&&t.attr("data-target",t.attr("data-activates"));var n=t.attr("data-target");n&&Jn("#".concat(n)).length&&t.dropdown({inDuration:300,outDuration:225,constrainWidth:!1,belowOrigin:!0})}},Qn=window,Xn=Qn.$;function Zn(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,Xn(t.target).select())}function er(e){var t=document.createRange();t.selectNode(e.target);var n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),n&&n.addRange(t)}function tr(e){delete e.value.focusedElement}var nr={mounted:function(e,t){var n=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===n,t.value.elementSupportsSelect?(t.value.onFocusHandler=Zn.bind(null,t),t.value.onBlurHandler=tr.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=er,e.addEventListener("click",t.value.onClickHandler))},unmounted:function(e,t){t.value.elementSupportsSelect?(e.removeEventListener("focus",t.value.onFocusHandler),e.removeEventListener("blur",t.value.onBlurHandler)):e.removeEventListener("click",t.value.onClickHandler)}};
+function _n(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.positionInViewport");t&&ue.helper.setMarginLeftToBeInViewport(t)}function Rn(e){e.classList.remove("expanded")}function Hn(e,t){e.contains(t.target)||e.classList.remove("expanded")}function Un(e,t){27===t.which&&e.classList.remove("expanded")}var $n=document.documentElement,qn={mounted:function(e,t){t.value.onMouseEnter=_n.bind(null,e),t.value.onMouseLeave=Rn.bind(null,e),t.value.onClickOutsideElement=Hn.bind(null,e),t.value.onEscapeHandler=Un.bind(null,e),setTimeout((function(){var e=Ht.getRef(t.value.expander,t);e&&e.addEventListener("mouseenter",t.value.onMouseEnter)})),e.addEventListener("mouseleave",t.value.onMouseLeave),$n.addEventListener("keyup",t.value.onEscapeHandler),$n.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted:function(e,t){var n=Ht.getRef(t.value.expander,t);n&&n.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}},Wn=window,zn=Wn.$,Gn={mounted:function(e,t){var n=zn(e),r=t.value.sensitiveData,o=t.value.showCharacters||6,i=t.value.clickElementSelector||n,l="";function c(){n.html(r),zn(i).css({cursor:""}),zn(i).tooltip("destroy")}o>0&&(l+=r.slice(0,o)),l+=r.slice(o).replace(/./g,"*"),n.html(l),zn(i).tooltip({content:a("CoreHome_ClickToSeeFullInformation"),items:"*",track:!0}),zn(i).one("click",c),zn(i).css({cursor:"pointer"})}},Yn=window,Jn=Yn.$,Kn={mounted:function(e){var t=Jn(e);!t.attr("data-target")&&t.attr("data-activates")&&t.attr("data-target",t.attr("data-activates"));var n=t.attr("data-target");n&&Jn("#".concat(n)).length&&t.dropdown({inDuration:300,outDuration:225,constrainWidth:!1,belowOrigin:!0})}},Qn=window,Xn=Qn.$;function Zn(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,Xn(t.target).select())}function er(e){var t=document.createRange();t.selectNode(e.target);var n=window.getSelection();n&&n.rangeCount>0&&n.removeAllRanges(),n&&n.addRange(t)}function tr(e){delete e.value.focusedElement}var nr={mounted:function(e,t){var n=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===n,t.value.elementSupportsSelect?(t.value.onFocusHandler=Zn.bind(null,t),t.value.onBlurHandler=tr.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=er,e.addEventListener("click",t.value.onClickHandler))},unmounted:function(e,t){t.value.elementSupportsSelect?(e.removeEventListener("focus",t.value.onFocusHandler),e.removeEventListener("blur",t.value.onBlurHandler)):e.removeEventListener("click",t.value.onClickHandler)}};
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function rr(e){if(e){var t=document.createElement("textarea");t.value=e.innerText,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),t.focus(),document.execCommand("copy"),document.body.removeChild(t);var n=e.parentElement;if(n){var r=n.getElementsByTagName("i")[0];r&&(r.classList.remove("copyToClipboardIcon"),r.classList.add("copyToClipboardIconCheck"));var o=n.getElementsByClassName("copyToClipboardCopiedDiv")[0];o&&(o.style.display="inline-block",setTimeout((function(){o.style.display="none"}),2500))}}}function or(e,t){if(t.value.transitionOpen){var n=e.parentElement;if(n){var r=n.getElementsByTagName("i")[0];r&&(r.classList.remove("copyToClipboardIconCheck"),r.classList.add("copyToClipboardIcon"))}t.value.transitionOpen=!1}else t.value.transitionOpen=!0}var ar={mounted:function(e,t){var n=e.tagName.toLowerCase();if("pre"===n){var r=document.createElement("button");r.setAttribute("type","button"),r.className="copyToClipboardButton";var o=document.createElement("div");o.className="copyToClipboardPositionDiv";var i=document.createElement("i");i.className="copyToClipboardIcon",r.appendChild(i);var l=document.createElement("span");l.className="copyToClipboardSpan",l.innerHTML=a("General_Copy"),r.appendChild(l),o.appendChild(r);var c=document.createElement("div");c.className="copyToClipboardCopiedDiv",c.innerHTML=a("General_CopiedToClipboard"),o.appendChild(c);var s=e.parentElement;s&&(s.classList.add("copyToClipboardWrapper"),s.appendChild(o)),t.value.onClickHandler=rr.bind(null,e),r.addEventListener("click",t.value.onClickHandler),t.value.onTransitionEndHandler=or.bind(null,e,t),r.addEventListener("transitionend",t.value.onTransitionEndHandler)}},unmounted:function(e,t){e.removeEventListener("click",t.value.onClickHandler),e.removeEventListener("transitionend",t.value.onTransitionEndHandler)}},ir={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!t.value.initialized){t.value.initialized=!0;var n=Ft.getRef(t.value.activator,t);if(n){window.$(n).show();var r=n.getAttribute("data-target");window.$("#".concat(r)).sidenav({closeOnClick:!0})}}e.classList.contains("collapsible")&&window.$(e).collapsible()}))}},lr={key:0,class:"title",tabindex:"6"},cr=["href","title"],sr={class:"iconsBar"},ur=["href","title"],dr=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),mr=[dr],pr=["title"],fr=Object(X["createElementVNode"])("span",{class:"icon-info"},null,-1),hr=[fr],br={key:2,class:"ratingIcons"},vr={class:"inlineHelp"},gr=["innerHTML"],yr=["innerHTML"],Or=["href"];
+ */function rr(e){if(e){var t=document.createElement("textarea");t.value=e.innerText,t.setAttribute("readonly",""),t.style.position="absolute",t.style.left="-9999px",document.body.appendChild(t),t.select(),t.focus(),document.execCommand("copy"),document.body.removeChild(t);var n=e.parentElement;if(n){var r=n.getElementsByTagName("i")[0];r&&(r.classList.remove("copyToClipboardIcon"),r.classList.add("copyToClipboardIconCheck"));var o=n.getElementsByClassName("copyToClipboardCopiedDiv")[0];o&&(o.style.display="inline-block",setTimeout((function(){o.style.display="none"}),2500))}}}function or(e,t){if(t.value.transitionOpen){var n=e.parentElement;if(n){var r=n.getElementsByTagName("i")[0];r&&(r.classList.remove("copyToClipboardIconCheck"),r.classList.add("copyToClipboardIcon"))}t.value.transitionOpen=!1}else t.value.transitionOpen=!0}var ar={mounted:function(e,t){var n=e.tagName.toLowerCase();if("pre"===n){var r=document.createElement("button");r.setAttribute("type","button"),r.className="copyToClipboardButton";var o=document.createElement("div");o.className="copyToClipboardPositionDiv";var i=document.createElement("i");i.className="copyToClipboardIcon",r.appendChild(i);var l=document.createElement("span");l.className="copyToClipboardSpan",l.innerHTML=a("General_Copy"),r.appendChild(l),o.appendChild(r);var c=document.createElement("div");c.className="copyToClipboardCopiedDiv",c.innerHTML=a("General_CopiedToClipboard"),o.appendChild(c);var s=e.parentElement;s&&(s.classList.add("copyToClipboardWrapper"),s.appendChild(o)),t.value.onClickHandler=rr.bind(null,e),r.addEventListener("click",t.value.onClickHandler),t.value.onTransitionEndHandler=or.bind(null,e,t),r.addEventListener("transitionend",t.value.onTransitionEndHandler)}},unmounted:function(e,t){e.removeEventListener("click",t.value.onClickHandler),e.removeEventListener("transitionend",t.value.onTransitionEndHandler)}},ir={mounted:function(e,t){t.value.activator&&setTimeout((function(){if(!t.value.initialized){t.value.initialized=!0;var n=Ht.getRef(t.value.activator,t);if(n){window.$(n).show();var r=n.getAttribute("data-target");window.$("#".concat(r)).sidenav({closeOnClick:!0})}}e.classList.contains("collapsible")&&window.$(e).collapsible()}))}},lr={key:0,class:"title",tabindex:"6"},cr=["href","title"],sr={class:"iconsBar"},ur=["href","title"],dr=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),mr=[dr],pr=["title"],fr=Object(X["createElementVNode"])("span",{class:"icon-info"},null,-1),hr=[fr],br={key:2,class:"ratingIcons"},vr={class:"inlineHelp"},gr=["innerHTML"],yr=["innerHTML"],Or=["href"];
/*!
* Matomo - free/libre analytics platform
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function jr(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["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(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",lr,[Object(X["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.htmlEntities(e.actualFeatureName))},[Object(X["renderSlot"])(e.$slots,"default")],8,cr)):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",sr,[e.helpUrl&&!e.actualInlineHelp?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},mr,8,ur)):Object(X["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=function(t){return e.showInlineHelp=!e.showInlineHelp}),class:Object(X["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},hr,10,pr)):Object(X["createCommentVNode"])("",!0),e.showRateFeature?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",br,[(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(e.rateFeature),{title:e.actualFeatureName},null,8,["title"]))])):Object(X["createCommentVNode"])("",!0)],512),[[X["vShow"],e.showIcons||e.showInlineHelp]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",vr,[Object(X["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,gr),""!=e.reportGenerated?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,class:"helpDate",innerHTML:e.$sanitize(e.reportGenerated)},null,8,yr)):Object(X["createCommentVNode"])("",!0),e.helpUrl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(X["toDisplayString"])(e.translate("General_MoreDetails")),9,Or)):Object(X["createCommentVNode"])("",!0)],512),[[X["vShow"],e.showInlineHelp]])],544)}var wr=Object(X["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},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,t=this.$refs.root;if(!this.actualInlineHelp){var n,r=t.querySelector(".title .inlineHelp");if(!r&&null!==(n=t.parentElement)&&void 0!==n&&n.nextElementSibling&&(r=t.parentElement.nextElementSibling.querySelector(".reportDocumentation")),r){var o,a=null===(o=r.getAttribute("data-content"))||void 0===o?void 0:o.trim();a&&a.length&&(this.actualInlineHelp="".concat(a,"
"),setTimeout((function(){return r.remove()}),0))}}this.actualFeatureName||(this.actualFeatureName=null===(e=t.querySelector(".title"))||void 0===e?void 0:e.textContent);if(ue.period&&ue.currentDateString){var i=m.parse(ue.period,ue.currentDateString);this.reportGenerated&&i.containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:this.reportGenerated,items:"div",show:!1,hide:!1})}},methods:{htmlEntities:function(e){return ue.helper.htmlEntities(e)}},computed:{showRateFeature:function(){return"Feedback_SendFeedback"!==i("Feedback_SendFeedback")},rateFeature:function(){return this.showRateFeature?Lt("Feedback","RateFeature"):""}}});wr.render=jr;var kr=wr,Sr={class:"card-content"},Cr={key:0,class:"card-title"},Er={key:1,class:"card-title"},Dr={ref:"content"},Pr={key:0,class:"card-image hide-on-med-and-down"},Tr=["src","alt"];function Vr(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("EnrichedHeadline");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])({card:!0,"card-with-image":!!this.imageUrl}),ref:"root"},[Object(X["createElementVNode"])("div",Sr,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("h2",Cr,Object(X["toDisplayString"])(e.decode(e.contentTitle)),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(X["openBlock"])(),Object(X["createElementBlock"])("h2",Er,[Object(X["createVNode"])(i,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(X["withCtx"])((function(){return[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.decode(e.contentTitle)),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",Dr,[Object(X["renderSlot"])(e.$slots,"default")],512)]),e.imageUrl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Pr,[Object(X["createElementVNode"])("img",{src:e.imageUrl,alt:e.actualImageAltText},null,8,Tr)])):Object(X["createCommentVNode"])("",!0)],2)}var Nr=null,Ir=window,xr=Ir.$,Br=Object(X["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String,imageUrl:String,imageAltText:String},components:{EnrichedHeadline:kr},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText,actualImageAltText:this.imageAltText?this.imageAltText:this.contentTitle}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e=this,t=this.$refs.root,n=this.$refs.content;if(this.anchor&&t&&t.parentElement){var r=document.createElement("a");r.id=this.anchor,xr(t.parentElement).prepend(r)}setTimeout((function(){var t=n.querySelector(".contentHelp");t&&(e.actualHelpText=t.innerHTML,t.remove())}),0),this.actualFeature&&"true"===this.actualFeature&&(this.actualFeature=this.contentTitle),null===Nr&&(Nr=document.querySelector("#content.admin"));var o=null;if(Nr&&(o=Nr.offsetTop),o||0===o){var a=t.closest(".widgetLoader"),i=a?a.offsetTop:t.offsetTop;i-o<17&&(t.style.marginTop="0")}},methods:{decode:function(e){return ue.helper.htmlDecode(e)}}});Br.render=Vr;var Ar=Br,Mr={key:0,ref:"root",class:"matomo-comparisons"},Lr={class:"comparison-type"},_r=["title"],Fr=["href"],Rr=["title"],Hr={class:"comparison-period-label"},Ur=["onClick"],$r=["title"],qr={class:"loadingPiwik",style:{display:"none"}},Wr=["alt"];function zr(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("tooltips");return e.isComparing?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Mr,[Object(X["createElementVNode"])("h3",null,Object(X["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.segmentComparisons,(function(t,n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(X["createElementVNode"])("div",Lr,Object(X["toDisplayString"])(e.translate("General_Segment")),1),Object(X["createElementVNode"])("div",{class:"title",title:e.getTitleTooltip(t)},[Object(X["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(X["toDisplayString"])(t.title),9,Fr)],8,_r),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.periodComparisons,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(X["createElementVNode"])("span",{class:"comparison-dot",style:Object(X["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(X["createElementVNode"])("span",Hr,Object(X["toDisplayString"])(n.title)+" ("+Object(X["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,Rr)})),128)),e.segmentComparisons.length>1?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(X["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,$r)],8,Ur)):Object(X["createCommentVNode"])("",!0)])})),128)),Object(X["createElementVNode"])("div",qr,[Object(X["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Wr),Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)),[[i,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(X["createCommentVNode"])("",!0)}function Gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yr(e,t){for(var n=0;n".concat(a,""),setTimeout((function(){return r.remove()}),0))}}this.actualFeatureName||(this.actualFeatureName=null===(e=t.querySelector(".title"))||void 0===e?void 0:e.textContent);if(ue.period&&ue.currentDateString){var i=m.parse(ue.period,ue.currentDateString);this.reportGenerated&&i.containsToday()&&window.$(t.querySelector(".report-generated")).tooltip({track:!0,content:this.reportGenerated,items:"div",show:!1,hide:!1})}},methods:{htmlEntities:function(e){return ue.helper.htmlEntities(e)}},computed:{showRateFeature:function(){return"Feedback_SendFeedback"!==i("Feedback_SendFeedback")},rateFeature:function(){return this.showRateFeature?_t("Feedback","RateFeature"):""}}});wr.render=jr;var kr=wr,Sr={class:"card-content"},Cr={key:0,class:"card-title"},Er={key:1,class:"card-title"},Dr={ref:"content"},Pr={key:0,class:"card-image hide-on-med-and-down"},Tr=["src","alt"];function Vr(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("EnrichedHeadline");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])({card:!0,"card-with-image":!!this.imageUrl}),ref:"root"},[Object(X["createElementVNode"])("div",Sr,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("h2",Cr,Object(X["toDisplayString"])(e.decode(e.contentTitle)),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText)?(Object(X["openBlock"])(),Object(X["createElementBlock"])("h2",Er,[Object(X["createVNode"])(i,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"inline-help":e.actualHelpText},{default:Object(X["withCtx"])((function(){return[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.decode(e.contentTitle)),1)]})),_:1},8,["feature-name","help-url","inline-help"])])):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",Dr,[Object(X["renderSlot"])(e.$slots,"default")],512)]),e.imageUrl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Pr,[Object(X["createElementVNode"])("img",{src:e.imageUrl,alt:e.actualImageAltText},null,8,Tr)])):Object(X["createCommentVNode"])("",!0)],2)}var Nr=null,Ir=window,xr=Ir.$,Br=Object(X["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,helpText:String,anchor:String,imageUrl:String,imageAltText:String},components:{EnrichedHeadline:kr},data:function(){return{actualFeature:this.feature,actualHelpText:this.helpText,actualImageAltText:this.imageAltText?this.imageAltText:this.contentTitle}},watch:{feature:function(e){this.actualFeature=e},helpText:function(e){this.actualHelpText=e}},mounted:function(){var e=this,t=this.$refs.root,n=this.$refs.content;if(this.anchor&&t&&t.parentElement){var r=document.createElement("a");r.id=this.anchor,xr(t.parentElement).prepend(r)}setTimeout((function(){var t=n.querySelector(".contentHelp");t&&(e.actualHelpText=t.innerHTML,t.remove())}),0),this.actualFeature&&"true"===this.actualFeature&&(this.actualFeature=this.contentTitle),null===Nr&&(Nr=document.querySelector("#content.admin"));var o=null;if(Nr&&(o=Nr.offsetTop),o||0===o){var a=t.closest(".widgetLoader"),i=a?a.offsetTop:t.offsetTop;i-o<17&&(t.style.marginTop="0")}},methods:{decode:function(e){return ue.helper.htmlDecode(e)}}});Br.render=Vr;var Ar=Br,Mr={key:0,ref:"root",class:"matomo-comparisons"},Lr={class:"comparison-type"},Fr=["title"],_r=["href"],Rr=["title"],Hr={class:"comparison-period-label"},Ur=["onClick"],$r=["title"],qr={class:"loadingPiwik",style:{display:"none"}},Wr=["alt"];function zr(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("tooltips");return e.isComparing?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Mr,[Object(X["createElementVNode"])("h3",null,Object(X["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.segmentComparisons,(function(t,n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(X["createElementVNode"])("div",Lr,Object(X["toDisplayString"])(e.translate("General_Segment")),1),Object(X["createElementVNode"])("div",{class:"title",title:e.getTitleTooltip(t)},[Object(X["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(X["toDisplayString"])(t.title),9,_r)],8,Fr),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.periodComparisons,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"comparison-period",key:n.index,title:e.getComparisonTooltip(t,n)},[Object(X["createElementVNode"])("span",{class:"comparison-dot",style:Object(X["normalizeStyle"])({"background-color":e.getSeriesColor(t,n)})},null,4),Object(X["createElementVNode"])("span",Hr,Object(X["toDisplayString"])(n.title)+" ("+Object(X["toDisplayString"])(e.getComparisonPeriodType(n))+") ",1)],8,Rr)})),128)),e.segmentComparisons.length>1?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:"remove-button",onClick:function(t){return e.removeSegmentComparison(n)}},[Object(X["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,$r)],8,Ur)):Object(X["createCommentVNode"])("",!0)])})),128)),Object(X["createElementVNode"])("div",qr,[Object(X["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",alt:e.translate("General_LoadingData")},null,8,Wr),Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.translate("General_LoadingData")),1)])],512)),[[i,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(X["createCommentVNode"])("",!0)}function Gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yr(e,t){for(var n=0;n1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%so;if(0===n)return this.colors["series".concat(r)];var o=n%uo;return this.colors["series".concat(r,"-shade").concat(o)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%so);return t>0&&(n+="-shade".concat(t%uo)),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(o){t.push({index:n,params:Object.assign(Object.assign({},o.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=Zr(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={},o={},a=!1,i=!1;e.forEach((function(e){a?r[e.params.segment]=!0:a=!0})),t.forEach((function(e){i?o["".concat(e.params.period,"|").concat(e.params.date)]=!0:i=!0}));var l=[],c=[];Object.keys(o).forEach((function(e){var t=e.split("|");l.push(t[0]),c.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:l,compareDates:c},u=ue.helper.isReportingPage()?De.hashParsed.value:De.urlParsed.value;De.updateLocation(Object.assign(Object.assign(Object.assign({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=ue.ColorManager;if(!e)return[];for(var t=[],n=0;n")):e}return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r,transformTooltipContent:o}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),fo.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return a("CoreHome_PeriodRange");var n=a("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]},getTitleTooltip:function(e){return"".concat(this.htmlentities(e.title),"
")+"".concat(this.htmlentities(decodeURIComponent(e.params.segment)))},getUrlToSegment:function(e){var t=Object.assign({},De.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(De.stringify(t))},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,fo.isComparing()){var t=fo.getPeriodComparisons(),n=fo.getSegmentComparisons();Ze.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:De.getSearchParam("compareSegments"),comparePeriods:De.getSearchParam("comparePeriods"),compareDates:De.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var o=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=o}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=fo.getComparisonSeriesIndex(t.index,0),o=e.reportData.comparisons[r],i=fo.getComparisonSeriesIndex(t.index,n.index),l=e.reportData.comparisons[i],c=e.reportData.comparisons[n.index],s='',u=(l.nb_visits/o.nb_visits*100).toFixed(2);return u="".concat(u,"%"),s+=a("General_ComparisonCardTooltip1",["'".concat(l.compareSegmentPretty,"'"),l.comparePeriodPretty,u,l.nb_visits.toString(),o.nb_visits.toString()]),t.index>0&&(s+="
",s+=a("General_ComparisonCardTooltip2",[l.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),s+="
",s},htmlentities:function(e){return ue.helper.htmlEntities(e)}},mounted:function(){var e=this;ue.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged()}});ho.render=zr;var bo=ho,vo={ref:"root",class:"menuDropdown"},go=["title"],yo=["innerHTML"],Oo=Object(X["createElementVNode"])("span",{class:"icon-chevron-down reporting-menu-sub-icon"},null,-1),jo={class:"items"},wo={key:0,class:"search"},ko=["placeholder"],So=["title"],Co=["title"];function Eo(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("focus-if"),l=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",vo,[Object(X["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(X["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,yo),Oo],8,go),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",jo,[e.showSearch&&e.showItems?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",wo,[Object(X["withDirectives"])(Object(X["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,ko),[[X["vModelText"],e.searchTerm],[i,{focused:e.showItems}]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",{class:"search_ico icon-search",title:e.translate("General_Search")},null,8,So),[[X["vShow"],!e.searchTerm]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",{onClick:t[3]||(t[3]=function(t){e.searchTerm="",e.searchItems("")}),class:"reset icon-close",title:e.translate("General_Clear")},null,8,Co),[[X["vShow"],e.searchTerm]])])):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(X["renderSlot"])(e.$slots,"default")])],512),[[X["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var Do=window,Po=Do.$,To=Object(X["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:Boolean},directives:{FocusAnywhereButHere:gn,FocusIf:On},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")||(this.menuTitleChangeOnClick&&(this.actualMenuTitle=(e.target.textContent||"").replace(/[\u0000-\u2666]/g,(function(e){return"".concat(e.charCodeAt(0),";")}))),this.showItems=!1,Po(this.$slots.default()[0].el).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect",e.target))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();Po(this.$refs.root).find(".item").each((function(e,n){var r=Po(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});To.render=Eo;var Vo=To,No={ref:"root"};function Io(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",No,null,512)}var xo=1,Bo=window,Ao=Bo.$,Mo=Object(X["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(X["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 o=r.length?r:t;o.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function o(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return a(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function a(e,t,n){var r,a=e.parent(),i=a.children("td");if(a.is(":first-child")){var l=a.children("td:not(.ui-datepicker-other-month)").first();return r=o(l,t,n),r.setDate(i.index(e)-i.index(l)+1),r}var c=a.children("td:not(.ui-datepicker-other-month)").last();return r=o(c,t,n),r.setDate(r.getDate()+i.index(e)-i.index(c)),r}function i(){var e=Ao(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),o=parseInt(t.attr("data-year"),10);return[r,o]}function l(){var e=Ao(n.value),t=e.find(".ui-datepicker-calendar"),a=i(),l=t.find("td"),c=l.first(),s=o(c,a[0],a[1]);l.each((function(){r(Ao(this),s),s.setDate(s.getDate()+1)}))}function c(){if(!e.viewDate)return!1;var t;if("string"===typeof e.viewDate)try{t=h(e.viewDate)}catch(a){return!1}else t=e.viewDate;var r=Ao(n.value),o=i();return(o[0]!==t.getMonth()||o[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function s(){var e=Ao(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 u(){var t=Ao(n.value),r=e.stepMonths||xo;if(t.datepicker("option","stepMonths")===r)return!1;var o=Ao(".ui-datepicker-month",t).val(),a=Ao(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(a,o)),s(),!0}function d(){var t=Ao(n.value),r=t.find(".ui-datepicker-month")[0];r&&(r.disabled=e.disableMonthDropdown)}function m(){if(Ao(this).hasClass("ui-state-hover")){var e=Ao(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function p(){d(),l()}return Object(X["watch"])((function(){return Object.assign({},e)}),(function(e,t){var n=!1;[function(e){return e.selectedDateStart},function(e){return e.selectedDateEnd},function(e){return e.highlightedDateStart},function(e){return e.highlightedDateEnd}].forEach((function(r){if(!n){var o=r(e),a=r(t);!o&&a&&(n=!0),o&&!a&&(n=!0),o&&a&&o.getTime()!==a.getTime()&&(n=!0)}})),e.viewDate!==t.viewDate&&c()&&(n=!0),e.stepMonths!==t.stepMonths&&u(),e.disableMonthDropdown!==t.disableMonthDropdown&&d(),n&&l()})),Object(X["onMounted"])((function(){var r=Ao(n.value),a=e.options||{},f=Object.assign(Object.assign(Object.assign({},ue.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:function(){setTimeout((function(){s()}))}});r.datepicker(f),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=i(),n=Ao(this),r=o(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",m),r.on("click",(function(e){e.preventDefault();var t=Ao(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&p()})),r.on("click","td[data-month]",(function(e){var n=Ao(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),o=parseInt(n.attr("data-year"),10),a=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(o,r,a)})}));var h=u();c(),d(),h||s(),l()})),{root:n}}});Mo.render=Io;var Lo=Mo,_o={class:"dateRangePicker"},Fo={id:"calendarRangeFrom"},Ro={id:"calendarRangeTo"};function Ho(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DatePicker");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",_o,[Object(X["createElementVNode"])("div",Fo,[Object(X["createElementVNode"])("h6",null,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(X["withDirectives"])(Object(X["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),[[X["vModelText"],e.startDateText]])]),Object(X["createVNode"])(i,{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(X["createElementVNode"])("div",Ro,[Object(X["createElementVNode"])("h6",null,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(X["withDirectives"])(Object(X["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),[[X["vModelText"],e.endDateText]])]),Object(X["createVNode"])(i,{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 Uo="YYYY-MM-DD",$o=Object(X["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:Lo},data:function(){var e=null;try{this.startDate&&(e=h(this.startDate))}catch(n){}var t=null;try{this.endDate&&(t=h(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){this.startDateInvalid=!0;var t=null;try{e&&e.length===Uo.length&&(t=h(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){this.endDateInvalid=!0;var t=null;try{e&&e.length===Uo.length&&(t=h(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:this.fromPickerSelectedDates[0]?p(this.fromPickerSelectedDates[0]):null,end:this.toPickerSelectedDates[0]?p(this.toPickerSelectedDates[0]):null})}}});$o.render=Ho;var qo=$o;function Wo(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DatePicker");return Object(X["openBlock"])(),Object(X["createBlock"])(i,{"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 zo=new Date(ue.minDateYear,ue.minDateMonth-1,ue.minDateDay),Go=new Date(ue.maxDateYear,ue.maxDateMonth-1,ue.maxDateDay),Yo=Object(X["defineComponent"])({props:{period:{type:String,required:!0},date:[String,Date]},components:{DatePicker:Lo},emits:["select"],setup:function(e,t){var n=Object(X["ref"])(e.date),r=Object(X["ref"])([null,null]),o=Object(X["ref"])([null,null]);function a(t){var n=m.get(e.period).parse(t).getDateRange();return n[0]=zon[1]?n[1]:Go,n}function i(t,n){var r=tGo,i=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);o.value=r||i?[null,null]:a(t)}function l(){o.value=[null,null]}function c(e){t.emit("select",{date:e})}function s(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=a(e.date),n.value=h(e.date)}return Object(X["watch"])(e,s),s(),{selectedDates:r,highlightedDates:o,viewDate:n,onHoverNormalCell:i,onHoverLeaveNormalCells:l,onDateSelected:c}}});Yo.render=Wo;var Jo=Yo,Ko={key:0},Qo=["data-notification-instance-id"],Xo={key:1},Zo={class:"notification-body"},ea=["innerHTML"],ta={key:1};function na(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createBlock"])(X["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(X["withCtx"])((function(){return[e.deleted?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ko,[Object(X["createVNode"])(X["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(X["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",{class:Object(X["normalizeClass"])(["notification system",e.cssClasses]),style:Object(X["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(X["createCommentVNode"])("",!0),e.title?(Object(X["openBlock"])(),Object(X["createElementBlock"])("strong",Xo,Object(X["toDisplayString"])(e.title),1)):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",Zo,[e.message?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,ea)):Object(X["createCommentVNode"])("",!0),e.message?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ta,[Object(X["renderSlot"])(e.$slots,"default")]))])],14,Qo)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var ra=window,oa=ra.$,aa=Object(X["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&&oa(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(X["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(X["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Ze.post({module:"CoreHome",action:"markNotificationAsRead"},{notificationId:this.notificationId},{withTokenInUrl:!0})}}});aa.render=na;var ia=aa,la={class:"notification-group"},ca=["innerHTML"];function sa(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Notification");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",la,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.notifications,(function(t,n){return Object(X["openBlock"])(),Object(X["createBlock"])(i,{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(X["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(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,ca)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}function ua(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function da(e,t){for(var n=0;n1||this.periodComparisons.value.length>1)}},{key:"isComparingPeriods",value:function(){return this.getPeriodComparisons().length>1}},{key:"getSegmentComparisons",value:function(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}},{key:"getPeriodComparisons",value:function(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}},{key:"getSeriesColor",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=this.getComparisonSeriesIndex(t.index,e.index)%so;if(0===n)return this.colors["series".concat(r)];var o=n%uo;return this.colors["series".concat(r,"-shade").concat(o)]}},{key:"getSeriesColorName",value:function(e,t){var n="series".concat(e%so);return t>0&&(n+="-shade".concat(t%uo)),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(o){t.push({index:n,params:Object.assign(Object.assign({},o.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=Zr(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={},o={},a=!1,i=!1;e.forEach((function(e){a?r[e.params.segment]=!0:a=!0})),t.forEach((function(e){i?o["".concat(e.params.period,"|").concat(e.params.date)]=!0:i=!0}));var l=[],c=[];Object.keys(o).forEach((function(e){var t=e.split("|");l.push(t[0]),c.push(t[1])}));var s={compareSegments:Object.keys(r),comparePeriods:l,compareDates:c},u=ue.helper.isReportingPage()?De.hashParsed.value:De.urlParsed.value;De.updateLocation(Object.assign(Object.assign(Object.assign({},u),s),n))}},{key:"getAllSeriesColors",value:function(){var e=ue.ColorManager;if(!e)return[];for(var t=[],n=0;n")):e}return{isComparing:e,segmentComparisons:t,periodComparisons:n,getSeriesColor:r,transformTooltipContent:o}},methods:{comparisonHasSegment:function(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison:function(e){window.$(this.$refs.root).tooltip("destroy"),fo.removeSegmentComparison(e)},getComparisonPeriodType:function(e){var t=e.params.period;if("range"===t)return a("CoreHome_PeriodRange");var n=a("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]},getTitleTooltip:function(e){return"".concat(this.htmlentities(e.title),"
")+"".concat(this.htmlentities(decodeURIComponent(e.params.segment)))},getUrlToSegment:function(e){var t=Object.assign({},De.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,"".concat(window.location.search,"#?").concat(De.stringify(t))},onComparisonsChanged:function(){var e=this;if(this.comparisonTooltips=null,fo.isComparing()){var t=fo.getPeriodComparisons(),n=fo.getSegmentComparisons();Ze.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:De.getSearchParam("compareSegments"),comparePeriods:De.getSearchParam("comparePeriods"),compareDates:De.getSearchParam("compareDates"),format_metrics:"1"}).then((function(r){e.comparisonTooltips={},t.forEach((function(t){e.comparisonTooltips[t.index]={},n.forEach((function(n){var o=e.generateComparisonTooltip(r,t,n);e.comparisonTooltips[t.index][n.index]=o}))}))}))}},generateComparisonTooltip:function(e,t,n){if(!e.reportData.comparisons)return"";var r=fo.getComparisonSeriesIndex(t.index,0),o=e.reportData.comparisons[r],i=fo.getComparisonSeriesIndex(t.index,n.index),l=e.reportData.comparisons[i],c=e.reportData.comparisons[n.index],s='',u=(l.nb_visits/o.nb_visits*100).toFixed(2);return u="".concat(u,"%"),s+=a("General_ComparisonCardTooltip1",["'".concat(l.compareSegmentPretty,"'"),l.comparePeriodPretty,u,l.nb_visits.toString(),o.nb_visits.toString()]),t.index>0&&(s+="
",s+=a("General_ComparisonCardTooltip2",[l.nb_visits_change.toString(),c.compareSegmentPretty,c.comparePeriodPretty])),s+="
",s},htmlentities:function(e){return ue.helper.htmlEntities(e)}},mounted:function(){var e=this;ue.on("piwikComparisonsChanged",(function(){e.onComparisonsChanged()})),this.onComparisonsChanged()}});ho.render=zr;var bo=ho,vo={ref:"root",class:"menuDropdown"},go=["title"],yo=["innerHTML"],Oo=Object(X["createElementVNode"])("span",{class:"icon-chevron-down reporting-menu-sub-icon"},null,-1),jo={class:"items"},wo={key:0,class:"search"},ko=["placeholder"],So=["title"],Co=["title"];function Eo(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("focus-if"),l=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",vo,[Object(X["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=function(t){return e.showItems=!e.showItems}),title:e.tooltip},[Object(X["createElementVNode"])("span",{innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,yo),Oo],8,go),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",jo,[e.showSearch&&e.showItems?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",wo,[Object(X["withDirectives"])(Object(X["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,ko),[[X["vModelText"],e.searchTerm],[i,{focused:e.showItems}]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",{class:"search_ico icon-search",title:e.translate("General_Search")},null,8,So),[[X["vShow"],!e.searchTerm]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",{onClick:t[3]||(t[3]=function(t){e.searchTerm="",e.searchItems("")}),class:"reset icon-close",title:e.translate("General_Clear")},null,8,Co),[[X["vShow"],e.searchTerm]])])):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",{onClick:t[4]||(t[4]=function(t){return e.selectItem(t)})},[Object(X["renderSlot"])(e.$slots,"default")])],512),[[X["vShow"],e.showItems]])],512)),[[l,{blur:e.lostFocus}]])}var Do=window,Po=Do.$,To=Object(X["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:Boolean},directives:{FocusAnywhereButHere:gn,FocusIf:On},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")||(this.menuTitleChangeOnClick&&(this.actualMenuTitle=(e.target.textContent||"").replace(/[\u0000-\u2666]/g,(function(e){return"".concat(e.charCodeAt(0),";")}))),this.showItems=!1,Po(this.$slots.default()[0].el).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect",e.target))},onSearchTermKeydown:function(){var e=this;setTimeout((function(){e.searchItems(e.searchTerm)}))},searchItems:function(e){var t=e.toLowerCase();Po(this.$refs.root).find(".item").each((function(e,n){var r=Po(n);-1===r.text().toLowerCase().indexOf(t)?r.hide():r.show()}))}}});To.render=Eo;var Vo=To,No={ref:"root"};function Io(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",No,null,512)}var xo=1,Bo=window,Ao=Bo.$,Mo=Object(X["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(X["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 o=r.length?r:t;o.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),r.removeClass("ui-state-hover")}function o(e,t,n){if(e.hasClass("ui-datepicker-other-month"))return a(e,t,n);var r=parseInt(e.children("a,span").text(),10);return new Date(n,t,r)}function a(e,t,n){var r,a=e.parent(),i=a.children("td");if(a.is(":first-child")){var l=a.children("td:not(.ui-datepicker-other-month)").first();return r=o(l,t,n),r.setDate(i.index(e)-i.index(l)+1),r}var c=a.children("td:not(.ui-datepicker-other-month)").last();return r=o(c,t,n),r.setDate(r.getDate()+i.index(e)-i.index(c)),r}function i(){var e=Ao(n.value),t=e.find("td[data-month]"),r=parseInt(t.attr("data-month"),10),o=parseInt(t.attr("data-year"),10);return[r,o]}function l(){var e=Ao(n.value),t=e.find(".ui-datepicker-calendar"),a=i(),l=t.find("td"),c=l.first(),s=o(c,a[0],a[1]);l.each((function(){r(Ao(this),s),s.setDate(s.getDate()+1)}))}function c(){if(!e.viewDate)return!1;var t;if("string"===typeof e.viewDate)try{t=h(e.viewDate)}catch(a){return!1}else t=e.viewDate;var r=Ao(n.value),o=i();return(o[0]!==t.getMonth()||o[1]!==t.getFullYear())&&(r.datepicker("setDate",t),!0)}function s(){var e=Ao(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 u(){var t=Ao(n.value),r=e.stepMonths||xo;if(t.datepicker("option","stepMonths")===r)return!1;var o=Ao(".ui-datepicker-month",t).val(),a=Ao(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",r).datepicker("setDate",new Date(a,o)),s(),!0}function d(){var t=Ao(n.value),r=t.find(".ui-datepicker-month")[0];r&&(r.disabled=e.disableMonthDropdown)}function m(){if(Ao(this).hasClass("ui-state-hover")){var e=Ao(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}}function p(){d(),l()}return Object(X["watch"])((function(){return Object.assign({},e)}),(function(e,t){var n=!1;[function(e){return e.selectedDateStart},function(e){return e.selectedDateEnd},function(e){return e.highlightedDateStart},function(e){return e.highlightedDateEnd}].forEach((function(r){if(!n){var o=r(e),a=r(t);!o&&a&&(n=!0),o&&!a&&(n=!0),o&&a&&o.getTime()!==a.getTime()&&(n=!0)}})),e.viewDate!==t.viewDate&&c()&&(n=!0),e.stepMonths!==t.stepMonths&&u(),e.disableMonthDropdown!==t.disableMonthDropdown&&d(),n&&l()})),Object(X["onMounted"])((function(){var r=Ao(n.value),a=e.options||{},f=Object.assign(Object.assign(Object.assign({},ue.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:function(){setTimeout((function(){s()}))}});r.datepicker(f),r.on("mouseover","tbody td a",(function(e){e.originalEvent&&l()})),r.on("mouseenter","tbody td",(function(){var e=i(),n=Ao(this),r=o(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",m),r.on("click",(function(e){e.preventDefault();var t=Ao(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&p()})),r.on("click","td[data-month]",(function(e){var n=Ao(e.target).closest("td"),r=parseInt(n.attr("data-month"),10),o=parseInt(n.attr("data-year"),10),a=parseInt(n.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(o,r,a)})}));var h=u();c(),d(),h||s(),l()})),{root:n}}});Mo.render=Io;var Lo=Mo,Fo={class:"dateRangePicker"},_o={id:"calendarRangeFrom"},Ro={id:"calendarRangeTo"};function Ho(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DatePicker");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Fo,[Object(X["createElementVNode"])("div",_o,[Object(X["createElementVNode"])("h6",null,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(X["withDirectives"])(Object(X["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),[[X["vModelText"],e.startDateText]])]),Object(X["createVNode"])(i,{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(X["createElementVNode"])("div",Ro,[Object(X["createElementVNode"])("h6",null,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(X["withDirectives"])(Object(X["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),[[X["vModelText"],e.endDateText]])]),Object(X["createVNode"])(i,{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 Uo="YYYY-MM-DD",$o=Object(X["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:Lo},data:function(){var e=null;try{this.startDate&&(e=h(this.startDate))}catch(n){}var t=null;try{this.endDate&&(t=h(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){this.startDateInvalid=!0;var t=null;try{e&&e.length===Uo.length&&(t=h(e))}catch(n){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr:function(e){this.endDateInvalid=!0;var t=null;try{e&&e.length===Uo.length&&(t=h(e))}catch(n){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged:function(){this.$emit("rangeChange",{start:this.fromPickerSelectedDates[0]?p(this.fromPickerSelectedDates[0]):null,end:this.toPickerSelectedDates[0]?p(this.toPickerSelectedDates[0]):null})}}});$o.render=Ho;var qo=$o;function Wo(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DatePicker");return Object(X["openBlock"])(),Object(X["createBlock"])(i,{"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 zo=new Date(ue.minDateYear,ue.minDateMonth-1,ue.minDateDay),Go=new Date(ue.maxDateYear,ue.maxDateMonth-1,ue.maxDateDay),Yo=Object(X["defineComponent"])({props:{period:{type:String,required:!0},date:[String,Date]},components:{DatePicker:Lo},emits:["select"],setup:function(e,t){var n=Object(X["ref"])(e.date),r=Object(X["ref"])([null,null]),o=Object(X["ref"])([null,null]);function a(t){var n=m.get(e.period).parse(t).getDateRange();return n[0]=zon[1]?n[1]:Go,n}function i(t,n){var r=tGo,i=n.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);o.value=r||i?[null,null]:a(t)}function l(){o.value=[null,null]}function c(e){t.emit("select",{date:e})}function s(){if(!e.period||!e.date)return r.value=[null,null],void(n.value=null);r.value=a(e.date),n.value=h(e.date)}return Object(X["watch"])(e,s),s(),{selectedDates:r,highlightedDates:o,viewDate:n,onHoverNormalCell:i,onHoverLeaveNormalCells:l,onDateSelected:c}}});Yo.render=Wo;var Jo=Yo,Ko={key:0},Qo=["data-notification-instance-id"],Xo={key:1},Zo={class:"notification-body"},ea=["innerHTML"],ta={key:1};function na(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createBlock"])(X["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=function(t){return e.toastClosed()})},{default:Object(X["withCtx"])((function(){return[e.deleted?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ko,[Object(X["createVNode"])(X["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(X["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",{class:Object(X["normalizeClass"])(["notification system",e.cssClasses]),style:Object(X["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=function(t){return e.closeNotification(t)})}," × ")):Object(X["createCommentVNode"])("",!0),e.title?(Object(X["openBlock"])(),Object(X["createElementBlock"])("strong",Xo,Object(X["toDisplayString"])(e.title),1)):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",Zo,[e.message?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,ea)):Object(X["createCommentVNode"])("",!0),e.message?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ta,[Object(X["renderSlot"])(e.$slots,"default")]))])],14,Qo)]})),_:3},8,["name"])])]})),_:3},8,["name"])]))]})),_:3},8,["name"])}var ra=window,oa=ra.$,aa=Object(X["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&&oa(this.$refs.root).css(this.style)},methods:{toastClosed:function(){var e=this;Object(X["nextTick"])((function(){e.$emit("closed")}))},closeNotification:function(e){var t=this;this.canClose&&e&&e.target&&(this.deleted=!0,Object(X["nextTick"])((function(){t.$emit("closed")}))),this.markNotificationAsRead()},markNotificationAsRead:function(){this.notificationId&&Ze.post({module:"CoreHome",action:"markNotificationAsRead"},{notificationId:this.notificationId},{withTokenInUrl:!0})}}});aa.render=na;var ia=aa,la={class:"notification-group"},ca=["innerHTML"];function sa(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Notification");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",la,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.notifications,(function(t,n){return Object(X["openBlock"])(),Object(X["createBlock"])(i,{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(X["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(X["withCtx"])((function(){return[Object(X["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,ca)]})),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"])})),128))])}function ua(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function da(e,t){for(var n=0;n'),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var a=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,a);var i=(this.nextNotificationId+=1).toString();return t.call(this,Object.assign(Object.assign({},e),{},{noclear:!!e.noclear,group:a,notificationId:e.id,notificationInstanceId:i,type:e.type||"transient"})),i}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&ue.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=e.placeat?ha(e.placeat):void 0;if(!t||!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=Nt({render:function(){return Object(X["createVNode"])(ia,Object.assign(Object.assign({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){if(e){var n=ha(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,o=Nt({template:'',data:function(){return{group:t}}});o.component("NotificationGroup",r),o.mount(n[0])}}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),va=new ba,ga=va;ha((function(){return va.parseNotificationDivs()}));var ya=Object(X["defineComponent"])({props:{group:String},components:{Notification:ia},computed:{notifications:function(){var e=this;return ga.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){ga.remove(e)}}});ya.render=sa;var Oa=ya,ja=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),wa=[ja];
+ */var fa=window,ha=fa.$,ba=function(){function e(){ua(this,e),pa(this,"privateState",Object(X["reactive"])({notifications:[]})),pa(this,"nextNotificationId",0)}return ma(e,[{key:"state",get:function(){return Object(X["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=ha('[data-role="notification"]'),n=[];t.each((function(e,r){var o=ha(r),a=o.data(),i=o.html();i&&n.push(Object.assign(Object.assign({},a),{},{message:i,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",o=document.querySelector(r);o&&(o.querySelector("#modalNotificationContainer")||ha(o).prepend(''),n="".concat(r," #modalNotificationContainer"),t=this.prependNotification)}var a=e.group||(n?n.toString():"");this.initializeNotificationContainer(n,a);var i=(this.nextNotificationId+=1).toString();return t.call(this,Object.assign(Object.assign({},e),{},{noclear:!!e.noclear,group:a,notificationId:e.id,notificationInstanceId:i,type:e.type||"transient"})),i}},{key:"scrollToNotification",value:function(e){setTimeout((function(){var t=document.querySelector("[data-notification-instance-id='".concat(e,"']"));t&&ue.helper.lazyScrollTo(t,250)}))}},{key:"toast",value:function(e){this.checkMessage(e.message);var t=e.placeat?ha(e.placeat):void 0;if(!t||!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=xt({render:function(){return Object(X["createVNode"])(ia,Object.assign(Object.assign({},e),{},{notificationId:e.id,type:"toast",onClosed:function(){r.unmount()}}))}});r.mount(n)}},{key:"initializeNotificationContainer",value:function(e,t){if(e){var n=ha(e);if(!n.children(".notification-group").length){var r=window.CoreHome.NotificationGroup,o=xt({template:'',data:function(){return{group:t}}});o.component("NotificationGroup",r),o.mount(n[0])}}}},{key:"checkMessage",value:function(e){if(!e)throw new Error("No message given, cannot display notification")}}]),e}(),va=new ba,ga=va;ha((function(){return va.parseNotificationDivs()}));var ya=Object(X["defineComponent"])({props:{group:String},components:{Notification:ia},computed:{notifications:function(){var e=this;return ga.state.notifications.filter((function(t){return e.group?e.group===t.group:!t.group}))}},methods:{removeNotification:function(e){ga.remove(e)}}});ya.render=sa;var Oa=ya,ja=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),wa=[ja];
/*!
* Matomo - free/libre analytics platform
*
@@ -233,7 +227,7 @@ function Fn(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.posi
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */var Na=function(){function e(){var t=this;Da(this,e),Va(this,"state",Object(X["reactive"])({initialSites:[],isInitialized:!1})),Va(this,"stateFiltered",Object(X["reactive"])({initialSites:[],isInitialized:!1,excludedSites:[]})),Va(this,"currentRequestAbort",null),Va(this,"limitRequest",void 0),Va(this,"initialSites",Object(X["computed"])((function(){return Object(X["readonly"])(t.state.initialSites)}))),Va(this,"initialSitesFiltered",Object(X["computed"])((function(){return Object(X["readonly"])(t.stateFiltered.initialSites)})))}return Ta(e,[{key:"loadInitialSites",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.state.isInitialized&&0===n.length?Promise.resolve(Object(X["readonly"])(this.state.initialSites)):this.stateFiltered.isInitialized&&n.length===this.stateFiltered.excludedSites.length&&n.every((function(t,n){return t===e.stateFiltered.excludedSites[n]}))?Promise.resolve(Object(X["readonly"])(this.stateFiltered.initialSites)):(n.length>0&&this.searchSite("%",t,n).then((function(t){e.stateFiltered.isInitialized=!0,e.stateFiltered.excludedSites=n,null!==t&&(e.stateFiltered.initialSites=t)})),this.state.isInitialized?Promise.resolve(Object(X["readonly"])(this.state.initialSites)):this.searchSite("%",t,n).then((function(t){return e.state.isInitialized=!0,null!==t&&(e.state.initialSites=t),t})))}},{key:"loadSite",value:function(e){"all"===e?De.updateUrl(Object.assign(Object.assign({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period})):De.updateUrl(Object.assign(Object.assign({},De.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},De.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Ze.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(o){var a=o.value,i="SitesManager.getPatternMatchSites";return n&&(i="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Ze.fetch({method:i,limit:a,pattern:e,sitesToExclude:r},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites(n,r)}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Object.assign(Object.assign({},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:0})),t):[]}}]),e}(),Ia=new Na,xa=["value","name"],Ba=["title"],Aa=["textContent"],Ma={key:1,class:"placeholder"},La={class:"dropdown"},_a={class:"custom_select_search"},Fa=["placeholder"],Ra={key:0},Ha={class:"custom_select_container"},Ua=["onClick"],$a=["innerHTML","href","title"],qa={class:"custom_select_ul_list"},Wa={class:"noresult"},za={key:1};function Ga(e,t,n,r,o,a){var i,l,c,s,u=Object(X["resolveComponent"])("AllSitesLink"),d=Object(X["resolveDirective"])("focus-if"),m=Object(X["resolveDirective"])("tooltips"),p=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(X["openBlock"])(),Object(X["createElementBlock"])("input",{key:0,type:"hidden",value:null===(i=e.displayedModelValue)||void 0===i?void 0:i.id,name:e.name},null,8,xa)):Object(X["createCommentVNode"])("",!0),Object(X["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(X["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(X["createElementVNode"])("span",{class:Object(X["normalizeClass"])(["icon icon-chevron-down",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(X["createElementVNode"])("span",null,[null!==(l=e.displayedModelValue)&&void 0!==l&&l.name||!e.placeholder?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,textContent:Object(X["toDisplayString"])((null===(c=e.displayedModelValue)||void 0===c?void 0:c.name)||e.firstSiteName)},null,8,Aa)):Object(X["createCommentVNode"])("",!0),null!==(s=e.displayedModelValue)&&void 0!==s&&s.name||!e.placeholder?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",Ma,Object(X["toDisplayString"])(e.placeholder),1))])],42,Ba),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",La,[Object(X["withDirectives"])(Object(X["createElementVNode"])("div",_a,[Object(X["withDirectives"])(Object(X["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,Fa),[[X["vModelText"],e.searchTerm],[d,{focused:e.shouldFocusOnSearch}]]),Object(X["withDirectives"])(Object(X["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),[[X["vShow"],e.searchTerm]])],512),[[X["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ra,[Object(X["createVNode"])(u,{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(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",Ha,[Object(X["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.sites,(function(n,r){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{onClick:function(t){return e.switchSite(Object.assign(Object.assign({},n),{},{id:n.idsite}),t)},key:r},[Object(X["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,$a)],8,Ua)),[[X["vShow"],!(!e.showSelectedSite&&"".concat(e.activeSiteId)==="".concat(n.idsite))]])})),128))]),Object(X["withDirectives"])(Object(X["createElementVNode"])("ul",qa,[Object(X["createElementVNode"])("li",null,[Object(X["createElementVNode"])("div",Wa,Object(X["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[X["vShow"],!e.sites.length&&e.searchTerm]])],512),[[m,{content:e.tooltipContent}]]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",za,[Object(X["createVNode"])(u,{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(X["createCommentVNode"])("",!0)],512),[[X["vShow"],e.showSitesList]])],2)),[[p,{blur:e.onBlur}]])}var Ya=["innerHTML","href"];function Ja(e,t,n,r,o,a){var i=this;return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return i.onClick(e)}),class:"custom_select_all"},[Object(X["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Ya)])}var Ka=Object(X["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Ka.render=Ja;var Qa=Ka,Xa=Object(X["defineComponent"])({props:{modelValue:Object,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:a("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean,sitesToExclude:{type:Array,default:function(){return[]}}},emits:["update:modelValue","blur"],components:{AllSitesLink:Qa},directives:{FocusAnywhereButHere:gn,FocusIf:On,Tooltips:Cn},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:"".concat(ue.idSite),showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(ue.config.autocomplete_min_sites,10)}},created:function(){this.searchSite=Ht(this.searchSite),!this.modelValue&&ue.idSite&&this.$emit("update:modelValue",{id:ue.idSite,name:ue.helper.htmlDecode(ue.siteName)})},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.shouldDefaultToFirstSite&&e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=a("CoreHome_ShortcutWebsiteSelector");ue.helper.registerShortcut("w",t,(function(t){if(!t.altKey){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e.$refs.selectorLink;n&&(n.click(),n.focus())}}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?a("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){var e=Ia.initialSitesFiltered.value&&Ia.initialSitesFiltered.value.length?Ia.initialSitesFiltered.value:Ia.initialSites.value;return e&&e.length>1},firstSiteName:function(){var e=Ia.initialSitesFiltered.value&&Ia.initialSitesFiltered.value.length?Ia.initialSitesFiltered.value:Ia.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=De.stringify(Object.assign(Object.assign({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period}));return"?".concat(e)},shouldDefaultToFirstSite:function(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue:function(){return this.modelValue?this.modelValue:ue.idSite?{id:ue.idSite,name:ue.helper.htmlDecode(ue.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null},tooltipContent:function(){return function(){var e=$(this).attr("title")||"";return ue.helper.htmlEntities(e)}}},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({id:"all",name:this.$props.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.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&Ia.loadSite(e.id))},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 this.htmlEntities(e);var n=this.htmlEntities(e.substring(0,t)),r=this.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'').concat(this.searchTerm,"").concat(r)},loadInitialSites:function(){var e=this;return Ia.loadInitialSites(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Ia.searchSite(e,this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=De.stringify(Object.assign(Object.assign({},De.urlParsed.value),{},{segment:"",idSite:e})),n=De.stringify(Object.assign(Object.assign({},De.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)},htmlEntities:function(e){return ue.helper.htmlEntities(e)}}});Xa.render=Ga;var Za=Xa,ei={ref:"root",class:"quickAccessInside"},ti=["title","placeholder"],ni={class:"dropdown"},ri={class:"no-result"},oi=["onClick"],ai=["onMouseenter","onClick"],ii={class:"quickAccessMatomoSearch"},li=["onMouseenter","onClick"],ci=["textContent"],si={class:"quick-access-category helpCategory"},ui=["href"];function di(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("focus-if"),l=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ei,[Object(X["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,32),Object(X["withDirectives"])(Object(X["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,placeholder:e.translate("General_Search"),ref:"input"},null,40,ti),[[X["vModelText"],e.searchTerm],[i,{focused:e.searchActive}]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",ni,[Object(X["withDirectives"])(Object(X["createElementVNode"])("ul",null,[Object(X["createElementVNode"])("li",ri,Object(X["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[X["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menuItems,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",{key:t.title},[Object(X["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(X["toDisplayString"])(t.title),9,oi),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.items,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["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(X["createElementVNode"])("a",null,Object(X["toDisplayString"])(t.name.trim()),1)],42,ai)})),128))])})),128)),Object(X["createElementVNode"])("ul",ii,[Object(X["withDirectives"])(Object(X["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(X["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[X["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("li",{class:"no-result"},Object(X["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[X["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.sites,(function(t,n){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["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(X["createElementVNode"])("a",{textContent:Object(X["toDisplayString"])(t.name)},null,8,ci)],42,li)),[[X["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(X["createElementVNode"])("ul",null,[Object(X["createElementVNode"])("li",si,Object(X["toDisplayString"])(e.translate("General_HelpResources")),1),Object(X["createElementVNode"])("li",{class:Object(X["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(X["createElementVNode"])("a",{href:"https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(X["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,ui)],34)])],512),[[X["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}var mi=window,pi=mi.ListingFormatter;function fi(e){var t=e.getBoundingClientRect(),n=window.$(window);return t.top>=0&&t.left>=0&&t.bottom<=n.height()&&t.right<=n.width()}function hi(e){e&&e.scrollIntoView&&e.scrollIntoView()}var bi=Object(X["defineComponent"])({directives:{FocusAnywhereButHere:gn,FocusIf:On},watch:{searchActive:function(e){var t=this.$refs.root;if(t&&t.parentElement){var n=t.parentElement.classList;n.toggle("active",e),n.toggle("expanded",e)}}},mounted:function(){var e=this,t=this.$refs.root;t&&t.parentElement&&t.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),ue.helper.registerShortcut("f",a("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),hi(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=Ht(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector('.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]')},quickAccessTitle:function(){var e=[a("CoreHome_MenuEntries")];return this.hasSegmentSelector&&e.push(a("CoreHome_Segments")),this.hasSitesSelector&&e.push(a("SitesManager_Sites")),a("CoreHome_QuickAccessTitle",pi.formatAnd(e))}},emits:["itemSelected","blur"],methods:{onKeypress:function(e){var t=this,n=this.searchTerm&&this.searchActive,r=9===e.which,o=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||o&&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.input&&this.$refs.input.blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!fi(e)&&hi(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");if(e&&e.length&&e.item(this.searchIndex))return e.item(this.searchIndex)},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,o={},a=[],i=function(e){var t=Object.assign({},e);r+=1,t.menuIndex=r;var n=t.category;n in o||(a.push({title:n,items:[]}),o[n]=a.length-1);var i=o[n];a[i].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Ia.searchSite(n).then((function(e){e&&(t.sites=e)})).finally((function(){t.isLoading=!1})));var l=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 c=this.topMenuItems.filter(l),s=this.leftMenuItems.filter(l),u=this.segmentItems.filter(l);c.forEach(i),s.forEach(i),u.forEach(i),this.numMenuItems=c.length+s.length+u.length,this.menuItems=a},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){Ia.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=a("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a, nav .sidenav li > div > a").forEach((function(r){var o,a,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();(!i||null!=r.parentElement&&null!=r.parentElement.tagName&&"DIV"===r.parentElement.tagName)&&(i=null===(a=r.getAttribute("title"))||void 0===a?void 0:a.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,o=window.$(n).find("> .item"),a=(null===(r=o[0])||void 0===r?void 0:r.innerText.trim())||"";a&&-1!==a.lastIndexOf("\n")&&(a=a.slice(0,a.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,r){var o,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();i&&(t.push({name:i,category:a,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=a("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var o,a,i=null===(o=r.querySelector(".segname"))||void 0===o||null===(a=o.textContent)||void 0===a?void 0:a.trim();i&&(n.push({name:i,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});bi.render=di;var vi=bi;function gi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yi={class:"fieldArray form-group"},Oi={key:0,class:"fieldUiControl"},ji=["onClick","title"];function wi(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",yi,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.modelValue,(function(t,n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",gi({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Oi,[Object(X["createVNode"])(i,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},"model-modifiers":e.field.modelModifiers,placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n),"template-file":e.field.templateFile,component:e.field.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","title","name","template-file","component"])])):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,ji),[[X["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function ki(e){return Di(e)||Ei(e)||Ci(e)||Si()}function Si(){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 Ci(e,t){if(e){if("string"===typeof e)return Pi(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)?Pi(e,t):void 0}}function Ei(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Di(e){if(Array.isArray(e))return Pi(e)}function Pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.modelValue){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});Vi.render=wi;var Ni=Vi;function Ii(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xi={class:"multiPairField form-group"},Bi={key:1,class:"fieldUiControl fieldUiControl2"},Ai={key:2,class:"fieldUiControl fieldUiControl3"},Mi={key:3,class:"fieldUiControl fieldUiControl4"},Li=["onClick","title"];function _i(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",xi,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.modelValue,(function(t,n){var r;return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},Ii(r,"multiPairFieldTable".concat(n),!0),Ii(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,class:Object(X["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(X["createVNode"])(i,{"full-width":!0,"model-value":t[e.field1.key],options:e.field1.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field1.key,t)},"model-modifiers":e.field1.modelModifiers,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title,"template-file":e.field1.templateFile,component:e.field1.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","name","title","template-file","component"])],2)):Object(X["createCommentVNode"])("",!0),e.field2?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Bi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field2.key,t)},"model-value":t[e.field2.key],"model-modifiers":e.field2.modelModifiers,placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title,"template-file":e.field2.templateFile,component:e.field2.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),e.field3?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ai,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field3.key,t)},"model-value":t[e.field3.key],"model-modifiers":e.field3.modelModifiers,placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title,"template-file":e.field3.templateFile,component:e.field3.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),e.field4?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Mi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field4.key,t)},"model-value":t[e.field4.key],"model-modifiers":e.field4.modelModifiers,placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title,"template-file":e.field4.templateFile,component:e.field4.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Li),[[X["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}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}function Ri(e){return qi(e)||$i(e)||Ui(e)||Hi()}function Hi(){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 Ui(e,t){if(e){if("string"===typeof e)return Wi(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)?Wi(e,t):void 0}}function $i(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function qi(e){if(Array.isArray(e))return Wi(e)}function Wi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.modelValue){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}}});Gi.render=_i;var Yi=Gi,Ji=["disabled"],Ki=Object(X["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),Qi=[Ki],Xi=["title"],Zi=Object(X["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),el={id:"periodMore",class:"dropdown"},tl={class:"flex"},nl={key:0,class:"period-date"},rl={class:"period-type"},ol={id:"otherPeriods"},al=["onDblclick","title"],il=["id","checked","onChange","onDblclick"],ll={key:0,class:"compare-checkbox"},cl={id:"comparePeriodToDropdown"},sl={key:1,class:"compare-date-range"},ul={id:"comparePeriodStartDate"},dl=Object(X["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),ml={id:"comparePeriodEndDate"},pl={class:"apply-button-container"},fl=["disabled","value"],hl={key:2,id:"ajaxLoadingCalendar"},bl={class:"loadingSegment"},vl=["disabled"],gl=Object(X["createElementVNode"])("span",{class:"icon-chevron-right"},null,-1),yl=[gl];function Ol(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DateRangePicker"),l=Object(X["resolveComponent"])("PeriodDatePicker"),c=Object(X["resolveComponent"])("Field"),s=Object(X["resolveComponent"])("ActivityIndicator"),u=Object(X["resolveDirective"])("expand-on-click");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{ref:"root",class:Object(X["normalizeClass"])(["periodSelector piwikSelector",{"periodSelector-withPrevNext":e.canShowMovePeriod}])},[e.canShowMovePeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:0,class:"move-period move-period-prev",onClick:t[0]||(t[0]=function(t){return e.movePeriod(-1)}),disabled:e.isPeriodMoveDisabled(-1)},Qi,8,Ji)):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Zi,Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.currentlyViewingText),1)],8,Xi),Object(X["createElementVNode"])("div",el,[Object(X["createElementVNode"])("div",tl,[Object(X["createElementVNode"])("div",null,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[1]||(t[1]=function(t){return e.onRangeChange(t.start,t.end)}),onSubmit:t[2]||(t[2]=function(t){return e.onApplyClicked()})},null,8,["start-date","end-date"]),[[X["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",nl,[Object(X["createVNode"])(l,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[3]||(t[3]=function(t){return e.setPiwikPeriodAndDate(e.selectedPeriod,t.date)})},null,8,["period","date"])])):Object(X["createCommentVNode"])("",!0)]),Object(X["createElementVNode"])("div",rl,[Object(X["createElementVNode"])("h6",null,Object(X["toDisplayString"])(e.translate("General_Period")),1),Object(X["createElementVNode"])("div",ol,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.periodsFiltered,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("p",{key:n},[Object(X["createElementVNode"])("label",{class:Object(X["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(X["withDirectives"])(Object(X["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_".concat(n),"onUpdate:modelValue":t[4]||(t[4]=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,il),[[X["vModelRadio"],e.selectedPeriod]]),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,al)])})),128))])])]),e.isComparisonEnabled?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ll,[Object(X["createElementVNode"])("label",null,[Object(X["withDirectives"])(Object(X["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=function(t){return e.isComparing=t})},null,512),[[X["vModelCheckbox"],e.isComparing]]),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(X["createElementVNode"])("div",cl,[Object(X["createVNode"])(c,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.comparePeriodType=t}),style:Object(X["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(X["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",sl,[Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",ul,[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(c,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[7]||(t[7]=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"])])]),dl,Object(X["createElementVNode"])("div",ml,[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(c,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[8]||(t[8]=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(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",pl,[Object(X["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[9]||(t[9]=function(t){return e.onApplyClicked()}),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,fl)]),e.isLoadingNewPage?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",hl,[Object(X["createVNode"])(s,{loading:!0}),Object(X["createElementVNode"])("div",bl,Object(X["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(X["createCommentVNode"])("",!0)]),e.canShowMovePeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:1,class:"move-period move-period-next",onClick:t[10]||(t[10]=function(t){return e.movePeriod(1)}),disabled:e.isPeriodMoveDisabled(1)},yl,8,vl)):Object(X["createCommentVNode"])("",!0)],2)),[[u,{expander:"title"}]])}function jl(e,t){return El(e)||Cl(e,t)||kl(e,t)||wl()}function wl(){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 kl(e,t){if(e){if("string"===typeof e)return Sl(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)?Sl(e,t):void 0}}function Sl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr?(window.$("#alert").find("h2").text(a("General_InvalidDateRange")),ue.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return p(this.dateValue)},isErrorDisplayed:function(){return this.currentlyViewingText===a("General_Error")},isRangeSelection:function(){return"range"===this.periodValue},canShowMovePeriod:function(){return!this.isRangeSelection&&!this.isErrorDisplayed}},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(e){e!==this.periodValue&&"range"!==e&&this.setPiwikPeriodAndDate(e,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=p(t);this.setRangeStartEndFromPeriod(e,n),this.propagateNewUrlParams(n,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams:function(e,t){var n,r=this.selectedComparisonParams;ue.helper.isReportingPage()?(this.closePeriodSelector(),n=De.hashParsed.value):(this.isLoadingNewPage=!0,n=De.parsed.value);var o=Object.assign({},n);delete o.comparePeriods,delete o.comparePeriodType,delete o.compareDates,De.updateLocation(Object.assign(Object.assign({},o),{},{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)},updateComparisonValuesFromStore:function(){this.comparePeriodType="previousPeriod",this.compareStartDate="",this.compareEndDate="";var e=fo.getPeriodComparisons();if(!(e.length<2)){var t=De.parsed.value.comparePeriodType;if(Tl.includes(t)&&(this.comparePeriodType=t,"custom"===this.comparePeriodType&&"range"===e[1].params.period)){var n;try{n=m.parse(e[1].params.period,e[1].params.date)}catch(l){return}var r=n.getDateRange(),o=jl(r,2),a=o[0],i=o[1];this.compareStartDate=p(a),this.compareEndDate=p(i)}}},updateSelectedValuesFromHash:function(){var e=De.parsed.value.date,t=De.parsed.value.period;this.periodValue=t,this.selectedPeriod=t,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{m.parse(t,e)}catch(l){return}if("range"===t){var n=m.get(t).parse(e),r=n.getDateRange(),o=jl(r,2),a=o[0],i=o[1];this.dateValue=a,this.startRangeDate=p(a),this.endRangeDate=p(i)}else this.dateValue=h(e),this.setRangeStartEndFromPeriod(t,e)},setRangeStartEndFromPeriod:function(e,t){var n=m.parse(e,t).getDateRange();this.startRangeDate=p(n[0]Il?Il:n[1])},getPeriodDisplayText:function(e){return m.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{h(this.compareStartDate)}catch(e){return!1}try{h(this.compareEndDate)}catch(e){return!1}return!0},movePeriod:function(e){if(this.canMovePeriod(e)){var t=new Date;switch(null!=this.dateValue&&(t=this.dateValue),this.periodValue){case"day":t.setDate(t.getDate()+e);break;case"week":t.setDate(t.getDate()+7*e);break;case"month":t.setMonth(t.getMonth()+e);break;case"year":t.setFullYear(t.getFullYear()+e);break;default:break}this.dateValueIl&&(this.dateValue=Il),this.onApplyClicked()}},isPeriodMoveDisabled:function(e){return null===this.dateValue?this.isRangeSelection:this.isRangeSelection||!this.canMovePeriod(e)},canMovePeriod:function(e){if(null===this.dateValue)return!1;var t=-1===e?Nl:Il;return!g(this.dateValue,t,this.periodValue)}}});Bl.render=Ol;var Al=Bl,Ml={class:"reportingMenu"},Ll=["aria-label"],_l=["data-category-id"],Fl=["onClick"],Rl={class:"hidden"},Hl={key:2,role:"menu"},Ul=["href","onClick","title"],$l=["href","onClick"],ql=["onClick"],Wl=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),zl=[Wl],Gl={id:"mobile-left-menu",class:"sidenav sidenav--reporting-menu-mobile hide-on-large-only"},Yl=["data-category-id"],Jl={key:1,class:"collapsible collapsible-accordion"},Kl={class:"collapsible-header"},Ql={class:"collapsible-body"},Xl=["onClick","href"],Zl=["onClick","href"];function ec(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("MenuItemsDropdown"),l=Object(X["resolveDirective"])("side-nav");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ml,[Object(X["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down collapsible",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menu,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id,"data-category-id":t.id},[t.component?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(t.component),{key:0,onAction:function(n){return e.loadCategory(t)}},null,8,["onAction"])):Object(X["createCommentVNode"])("",!0),t.component?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"item",tabindex:"5",href:"",onClick:Object(X["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(X["createElementVNode"])("span",{class:Object(X["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:t.subcategories&&t.id===e.activeCategory?"icon-chevron-down":"icon-chevron-right"))},null,2),Object(X["createTextVNode"])(Object(X["toDisplayString"])(t.name)+" ",1),Object(X["createElementVNode"])("span",Rl,Object(X["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,Fl)),t.component?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",Hl,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{role:"menuitem",class:Object(X["normalizeClass"])({active:(n.id===e.displayedSubcategory||n.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:n.id},[n.isGroup?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(X["withCtx"])((function(){return[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(n.subcategories,(function(r){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{class:Object(X["normalizeClass"])(["item",{active:r.id===e.activeSubsubcategory&&n.id===e.displayedSubcategory&&t.id===e.displayedCategory}]),tabindex:"5",href:"#?".concat(e.makeUrl(t,r)),onClick:function(n){return e.loadSubcategory(t,r,n)},title:r.tooltip,key:r.id},Object(X["toDisplayString"])(r.name),11,Ul)})),128))]})),_:2},1032,["menu-title"])):Object(X["createCommentVNode"])("",!0),n.isGroup?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(X["toDisplayString"])(n.name),9,$l)),n.help?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:2,class:Object(X["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)}},zl,10,ql)):Object(X["createCommentVNode"])("",!0)],2)})),128))]))],10,_l)})),128))],8,Ll),Object(X["createElementVNode"])("ul",Gl,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menu,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:"no-padding",key:t.id,"data-category-id":t.id},[t.component?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(t.component),{key:0,onAction:function(n){return e.loadCategory(t)}},null,8,["onAction"])):Object(X["createCommentVNode"])("",!0),t.component?Object(X["createCommentVNode"])("",!0):Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",Jl,[Object(X["createElementVNode"])("li",null,[Object(X["createElementVNode"])("a",Kl,[Object(X["createElementVNode"])("i",{class:Object(X["normalizeClass"])(t.icon?t.icon:"icon-chevron-down")},null,2),Object(X["createTextVNode"])(Object(X["toDisplayString"])(t.name),1)]),Object(X["createElementVNode"])("div",Ql,[Object(X["createElementVNode"])("ul",null,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],{key:0},Object(X["renderList"])(n.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(X["toDisplayString"])(n.name),9,Xl)})),128)):Object(X["createCommentVNode"])("",!0),n.isGroup?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(X["toDisplayString"])(n.name),9,Zl))])})),128))])])])],512)),[[l,{activator:e.sideNavActivator}]])],8,Yl)})),128))])])}function tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nc(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.state.isInitialized&&0===n.length?Promise.resolve(Object(X["readonly"])(this.state.initialSites)):this.stateFiltered.isInitialized&&n.length===this.stateFiltered.excludedSites.length&&n.every((function(t,n){return t===e.stateFiltered.excludedSites[n]}))?Promise.resolve(Object(X["readonly"])(this.stateFiltered.initialSites)):(n.length>0&&this.searchSite("%",t,n).then((function(t){e.stateFiltered.isInitialized=!0,e.stateFiltered.excludedSites=n,null!==t&&(e.stateFiltered.initialSites=t)})),this.state.isInitialized?Promise.resolve(Object(X["readonly"])(this.state.initialSites)):this.searchSite("%",t,n).then((function(t){return e.state.isInitialized=!0,null!==t&&(e.state.initialSites=t),t})))}},{key:"loadSite",value:function(e){"all"===e?De.updateUrl(Object.assign(Object.assign({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period})):De.updateUrl(Object.assign(Object.assign({},De.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},De.hashParsed.value),{},{segment:"",idSite:e}))}},{key:"searchSite",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=Ze.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then((function(o){var a=o.value,i="SitesManager.getPatternMatchSites";return n&&(i="SitesManager.getSitesWithAdminAccess"),t.currentRequestAbort=new AbortController,Ze.fetch({method:i,limit:a,pattern:e,sitesToExclude:r},{abortController:t.currentRequestAbort})})).then((function(e){return e?t.processWebsitesList(e):null})).finally((function(){t.currentRequestAbort=null}))):this.loadInitialSites(n,r)}},{key:"processWebsitesList",value:function(e){var t=e;return t&&t.length?(t=t.map((function(e){return Object.assign(Object.assign({},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:0})),t):[]}}]),e}(),Ia=new Na,xa=["value","name"],Ba=["title"],Aa=["textContent"],Ma={key:1,class:"placeholder"},La={class:"dropdown"},Fa={class:"custom_select_search"},_a=["placeholder"],Ra={key:0},Ha={class:"custom_select_container"},Ua=["onClick"],$a=["innerHTML","href","title"],qa={class:"custom_select_ul_list"},Wa={class:"noresult"},za={key:1};function Ga(e,t,n,r,o,a){var i,l,c,s,u=Object(X["resolveComponent"])("AllSitesLink"),d=Object(X["resolveDirective"])("focus-if"),m=Object(X["resolveDirective"])("tooltips"),p=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(X["openBlock"])(),Object(X["createElementBlock"])("input",{key:0,type:"hidden",value:null===(i=e.displayedModelValue)||void 0===i?void 0:i.id,name:e.name},null,8,xa)):Object(X["createCommentVNode"])("",!0),Object(X["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(X["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(X["createElementVNode"])("span",{class:Object(X["normalizeClass"])(["icon icon-chevron-down",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(X["createElementVNode"])("span",null,[null!==(l=e.displayedModelValue)&&void 0!==l&&l.name||!e.placeholder?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,textContent:Object(X["toDisplayString"])((null===(c=e.displayedModelValue)||void 0===c?void 0:c.name)||e.firstSiteName)},null,8,Aa)):Object(X["createCommentVNode"])("",!0),null!==(s=e.displayedModelValue)&&void 0!==s&&s.name||!e.placeholder?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",Ma,Object(X["toDisplayString"])(e.placeholder),1))])],42,Ba),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",La,[Object(X["withDirectives"])(Object(X["createElementVNode"])("div",Fa,[Object(X["withDirectives"])(Object(X["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,_a),[[X["vModelText"],e.searchTerm],[d,{focused:e.shouldFocusOnSearch}]]),Object(X["withDirectives"])(Object(X["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),[[X["vShow"],e.searchTerm]])],512),[[X["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ra,[Object(X["createVNode"])(u,{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(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",Ha,[Object(X["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=function(t){return e.showSitesList=!1})},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.sites,(function(n,r){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{onClick:function(t){return e.switchSite(Object.assign(Object.assign({},n),{},{id:n.idsite}),t)},key:r},[Object(X["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,$a)],8,Ua)),[[X["vShow"],!(!e.showSelectedSite&&"".concat(e.activeSiteId)==="".concat(n.idsite))]])})),128))]),Object(X["withDirectives"])(Object(X["createElementVNode"])("ul",qa,[Object(X["createElementVNode"])("li",null,[Object(X["createElementVNode"])("div",Wa,Object(X["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[X["vShow"],!e.sites.length&&e.searchTerm]])],512),[[m,{content:e.tooltipContent}]]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",za,[Object(X["createVNode"])(u,{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(X["createCommentVNode"])("",!0)],512),[[X["vShow"],e.showSitesList]])],2)),[[p,{blur:e.onBlur}]])}var Ya=["innerHTML","href"];function Ja(e,t,n,r,o,a){var i=this;return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{onClick:t[1]||(t[1]=function(e){return i.onClick(e)}),class:"custom_select_all"},[Object(X["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(e){return e.preventDefault()}),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Ya)])}var Ka=Object(X["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick:function(e){this.$emit("click",e)}}});Ka.render=Ja;var Qa=Ka,Xa=Object(X["defineComponent"])({props:{modelValue:Object,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:a("General_MultiSitesSummary")},allSitesLocation:{type:String,default:"bottom"},placeholder:String,defaultToFirstSite:Boolean,sitesToExclude:{type:Array,default:function(){return[]}}},emits:["update:modelValue","blur"],components:{AllSitesLink:Qa},directives:{FocusAnywhereButHere:gn,FocusIf:On,Tooltips:Cn},watch:{searchTerm:function(){this.onSearchTermChanged()}},data:function(){return{searchTerm:"",activeSiteId:"".concat(ue.idSite),showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(ue.config.autocomplete_min_sites,10)}},created:function(){this.searchSite=$t(this.searchSite),!this.modelValue&&ue.idSite&&this.$emit("update:modelValue",{id:ue.idSite,name:ue.helper.htmlDecode(ue.siteName)})},mounted:function(){var e=this;window.initTopControls(),this.loadInitialSites().then((function(){e.shouldDefaultToFirstSite&&e.$emit("update:modelValue",{id:e.sites[0].idsite,name:e.sites[0].name})}));var t=a("CoreHome_ShortcutWebsiteSelector");ue.helper.registerShortcut("w",t,(function(t){if(!t.altKey){t.preventDefault?t.preventDefault():t.returnValue=!1;var n=e.$refs.selectorLink;n&&(n.click(),n.focus())}}))},computed:{shouldFocusOnSearch:function(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle:function(){var e;return this.hasMultipleSites?a("CoreHome_ChangeCurrentWebsite",(null===(e=this.modelValue)||void 0===e?void 0:e.name)||this.firstSiteName):""},hasMultipleSites:function(){var e=Ia.initialSitesFiltered.value&&Ia.initialSitesFiltered.value.length?Ia.initialSitesFiltered.value:Ia.initialSites.value;return e&&e.length>1},firstSiteName:function(){var e=Ia.initialSitesFiltered.value&&Ia.initialSitesFiltered.value.length?Ia.initialSitesFiltered.value:Ia.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites:function(){var e=De.stringify(Object.assign(Object.assign({},De.urlParsed.value),{},{module:"MultiSites",action:"index",date:De.parsed.value.date,period:De.parsed.value.period}));return"?".concat(e)},shouldDefaultToFirstSite:function(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue:function(){return this.modelValue?this.modelValue:ue.idSite?{id:ue.idSite,name:ue.helper.htmlDecode(ue.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null},tooltipContent:function(){return function(){var e=$(this).attr("title")||"";return ue.helper.htmlEntities(e)}}},methods:{onSearchTermChanged:function(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick:function(e){this.switchSite({id:"all",name:this.$props.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.id,name:e.name}),this.switchSiteOnSelect&&this.activeSiteId!==e.id&&Ia.loadSite(e.id))},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 this.htmlEntities(e);var n=this.htmlEntities(e.substring(0,t)),r=this.htmlEntities(e.substring(t+this.searchTerm.length));return"".concat(n,'').concat(this.searchTerm,"").concat(r)},loadInitialSites:function(){var e=this;return Ia.loadInitialSites(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(t){e.sites=t||[]}))},searchSite:function(e){var t=this;this.isLoading=!0,Ia.searchSite(e,this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[]).then((function(n){e===t.searchTerm&&n&&(t.sites=n)})).finally((function(){t.isLoading=!1}))},getUrlForSiteId:function(e){var t=De.stringify(Object.assign(Object.assign({},De.urlParsed.value),{},{segment:"",idSite:e})),n=De.stringify(Object.assign(Object.assign({},De.hashParsed.value),{},{segment:"",idSite:e}));return"?".concat(t,"#?").concat(n)},htmlEntities:function(e){return ue.helper.htmlEntities(e)}}});Xa.render=Ga;var Za=Xa,ei={ref:"root",class:"quickAccessInside"},ti=["title","placeholder"],ni={class:"dropdown"},ri={class:"no-result"},oi=["onClick"],ai=["onMouseenter","onClick"],ii={class:"quickAccessMatomoSearch"},li=["onMouseenter","onClick"],ci=["textContent"],si={class:"quick-access-category helpCategory"},ui=["href"];function di(e,t,n,r,o,a){var i=Object(X["resolveDirective"])("focus-if"),l=Object(X["resolveDirective"])("focus-anywhere-but-here");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ei,[Object(X["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=function(t){return e.searchActive=!0})},null,32),Object(X["withDirectives"])(Object(X["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,placeholder:e.translate("General_Search"),ref:"input"},null,40,ti),[[X["vModelText"],e.searchTerm],[i,{focused:e.searchActive}]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",ni,[Object(X["withDirectives"])(Object(X["createElementVNode"])("ul",null,[Object(X["createElementVNode"])("li",ri,Object(X["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[X["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menuItems,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",{key:t.title},[Object(X["createElementVNode"])("li",{class:"quick-access-category",onClick:function(n){e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(X["toDisplayString"])(t.title),9,oi),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.items,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["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(X["createElementVNode"])("a",null,Object(X["toDisplayString"])(t.name.trim()),1)],42,ai)})),128))])})),128)),Object(X["createElementVNode"])("ul",ii,[Object(X["withDirectives"])(Object(X["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(X["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[X["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("li",{class:"no-result"},Object(X["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[X["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.sites,(function(t,n){return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["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(X["createElementVNode"])("a",{textContent:Object(X["toDisplayString"])(t.name)},null,8,ci)],42,li)),[[X["vShow"],e.hasSitesSelector&&!e.isLoading]])})),128))]),Object(X["createElementVNode"])("ul",null,[Object(X["createElementVNode"])("li",si,Object(X["toDisplayString"])(e.translate("General_HelpResources")),1),Object(X["createElementVNode"])("li",{class:Object(X["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=function(t){return e.searchIndex="help"})},[Object(X["createElementVNode"])("a",{href:"https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s=".concat(encodeURIComponent(e.searchTerm)),target:"_blank"},Object(X["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,ui)],34)])],512),[[X["vShow"],e.searchTerm&&e.searchActive]])],512)),[[l,{blur:e.onBlur}]])}var mi=window,pi=mi.ListingFormatter;function fi(e){var t=e.getBoundingClientRect(),n=window.$(window);return t.top>=0&&t.left>=0&&t.bottom<=n.height()&&t.right<=n.width()}function hi(e){e&&e.scrollIntoView&&e.scrollIntoView()}var bi=Object(X["defineComponent"])({directives:{FocusAnywhereButHere:gn,FocusIf:On},watch:{searchActive:function(e){var t=this.$refs.root;if(t&&t.parentElement){var n=t.parentElement.classList;n.toggle("active",e),n.toggle("expanded",e)}}},mounted:function(){var e=this,t=this.$refs.root;t&&t.parentElement&&t.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),ue.helper.registerShortcut("f",a("CoreHome_ShortcutSearch"),(function(t){t.altKey||(t.preventDefault(),hi(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=$t(this.searchMenu.bind(this))},computed:{hasSitesSelector:function(){return!!document.querySelector('.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]')},quickAccessTitle:function(){var e=[a("CoreHome_MenuEntries")];return this.hasSegmentSelector&&e.push(a("CoreHome_Segments")),this.hasSitesSelector&&e.push(a("SitesManager_Sites")),a("CoreHome_QuickAccessTitle",pi.formatAnd(e))}},emits:["itemSelected","blur"],methods:{onKeypress:function(e){var t=this,n=this.searchTerm&&this.searchActive,r=9===e.which,o=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():r&&n||o&&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.input&&this.$refs.input.blur()},makeSureSelectedItemIsInViewport:function(){var e=this.getCurrentlySelectedElement();e&&!fi(e)&&hi(e)},getCurrentlySelectedElement:function(){var e=this.$refs.root.querySelectorAll("li.result");if(e&&e.length&&e.item(this.searchIndex))return e.item(this.searchIndex)},searchMenu:function(e){var t=this,n=e.toLowerCase(),r=-1,o={},a=[],i=function(e){var t=Object.assign({},e);r+=1,t.menuIndex=r;var n=t.category;n in o||(a.push({title:n,items:[]}),o[n]=a.length-1);var i=o[n];a[i].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Ia.searchSite(n).then((function(e){e&&(t.sites=e)})).finally((function(){t.isLoading=!1})));var l=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 c=this.topMenuItems.filter(l),s=this.leftMenuItems.filter(l),u=this.segmentItems.filter(l);c.forEach(i),s.forEach(i),u.forEach(i),this.numMenuItems=c.length+s.length+u.length,this.menuItems=a},resetSearchIndex:function(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite:function(e){Ia.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=a("CoreHome_Menu"),n=[];return document.querySelectorAll("nav .sidenav li > a, nav .sidenav li > div > a").forEach((function(r){var o,a,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();(!i||null!=r.parentElement&&null!=r.parentElement.tagName&&"DIV"===r.parentElement.tagName)&&(i=null===(a=r.getAttribute("title"))||void 0===a?void 0:a.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,o=window.$(n).find("> .item"),a=(null===(r=o[0])||void 0===r?void 0:r.innerText.trim())||"";a&&-1!==a.lastIndexOf("\n")&&(a=a.slice(0,a.lastIndexOf("\n")).trim()),window.$(n).find("li .item").each((function(n,r){var o,i=null===(o=r.textContent)||void 0===o?void 0:o.trim();i&&(t.push({name:i,category:a,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))}))})),t},getSegmentItems:function(){var e=this;if(!this.hasSegmentSelector)return[];var t=a("CoreHome_Segments"),n=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach((function(r){var o,a,i=null===(o=r.querySelector(".segname"))||void 0===o||null===(a=o.textContent)||void 0===a?void 0:a.trim();i&&(n.push({name:i,category:t,index:e.menuIndexCounter+=1}),r.setAttribute("quick_access","".concat(e.menuIndexCounter)))})),n}}});bi.render=di;var vi=bi;function gi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var yi={class:"fieldArray form-group"},Oi={key:0,class:"fieldUiControl"},ji=["onClick","title"];function wi(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",yi,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.modelValue,(function(t,n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",gi({},"fieldArrayTable".concat(n),!0)]),key:n},[e.field.uiControl?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Oi,[Object(X["createVNode"])(i,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(t,n)},"model-modifiers":e.field.modelModifiers,placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:"".concat(e.name,"-").concat(n),"template-file":e.field.templateFile,component:e.field.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","title","name","template-file","component"])])):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,ji),[[X["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function ki(e){return Di(e)||Ei(e)||Ci(e)||Si()}function Si(){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 Ci(e,t){if(e){if("string"===typeof e)return Pi(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)?Pi(e,t):void 0}}function Ei(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Di(e){if(Array.isArray(e))return Pi(e)}function Pi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.modelValue){var t=this.modelValue.filter((function(t,n){return n!==e}));this.$emit("update:modelValue",t)}}}});Vi.render=wi;var Ni=Vi;function Ii(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xi={class:"multiPairField form-group"},Bi={key:1,class:"fieldUiControl fieldUiControl2"},Ai={key:2,class:"fieldUiControl fieldUiControl3"},Mi={key:3,class:"fieldUiControl fieldUiControl4"},Li=["onClick","title"];function Fi(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",xi,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.modelValue,(function(t,n){var r;return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:Object(X["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",(r={},Ii(r,"multiPairFieldTable".concat(n),!0),Ii(r,"has".concat(e.fieldCount,"Fields"),!0),r)]),key:n},[e.field1?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,class:Object(X["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(X["createVNode"])(i,{"full-width":!0,"model-value":t[e.field1.key],options:e.field1.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field1.key,t)},"model-modifiers":e.field1.modelModifiers,placeholder:" ",uicontrol:e.field1.uiControl,name:"".concat(e.name,"-p1-").concat(n),title:e.field1.title,"template-file":e.field1.templateFile,component:e.field1.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","name","title","template-file","component"])],2)):Object(X["createCommentVNode"])("",!0),e.field2?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Bi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field2.key,t)},"model-value":t[e.field2.key],"model-modifiers":e.field2.modelModifiers,placeholder:" ",uicontrol:e.field2.uiControl,name:"".concat(e.name,"-p2-").concat(n),title:e.field2.title,"template-file":e.field2.templateFile,component:e.field2.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),e.field3?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ai,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field3.key,t)},"model-value":t[e.field3.key],"model-modifiers":e.field3.modelModifiers,placeholder:" ",uicontrol:e.field3.uiControl,title:e.field3.title,"template-file":e.field3.templateFile,component:e.field3.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),e.field4?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Mi,[Object(X["createVNode"])(i,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":function(t){return e.onEntryChange(n,e.field4.key,t)},"model-value":t[e.field4.key],"model-modifiers":e.field4.modelModifiers,placeholder:" ",uicontrol:e.field4.uiControl,title:e.field4.title,"template-file":e.field4.templateFile,component:e.field4.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","title","template-file","component"])])):Object(X["createCommentVNode"])("",!0),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",{onClick:function(t){return e.removeEntry(n)},class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Li),[[X["vShow"],n+1!==e.modelValue.length]])],2)})),128))])}function _i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ri(e){return qi(e)||$i(e)||Ui(e)||Hi()}function Hi(){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 Ui(e,t){if(e){if("string"===typeof e)return Wi(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)?Wi(e,t):void 0}}function $i(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function qi(e){if(Array.isArray(e))return Wi(e)}function Wi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n-1&&this.modelValue){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}}});Gi.render=Fi;var Yi=Gi,Ji=["disabled"],Ki=Object(X["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),Qi=[Ki],Xi=["title"],Zi=Object(X["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),el={id:"periodMore",class:"dropdown"},tl={class:"flex"},nl={key:0,class:"period-date"},rl={class:"period-type"},ol={id:"otherPeriods"},al=["onDblclick","title"],il=["id","checked","onChange","onDblclick"],ll={key:0,class:"compare-checkbox"},cl={id:"comparePeriodToDropdown"},sl={key:1,class:"compare-date-range"},ul={id:"comparePeriodStartDate"},dl=Object(X["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),ml={id:"comparePeriodEndDate"},pl={class:"apply-button-container"},fl=["disabled","value"],hl={key:2,id:"ajaxLoadingCalendar"},bl={class:"loadingSegment"},vl=["disabled"],gl=Object(X["createElementVNode"])("span",{class:"icon-chevron-right"},null,-1),yl=[gl];function Ol(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("DateRangePicker"),l=Object(X["resolveComponent"])("PeriodDatePicker"),c=Object(X["resolveComponent"])("Field"),s=Object(X["resolveComponent"])("ActivityIndicator"),u=Object(X["resolveDirective"])("expand-on-click");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{ref:"root",class:Object(X["normalizeClass"])(["periodSelector piwikSelector",{"periodSelector-withPrevNext":e.canShowMovePeriod}])},[e.canShowMovePeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:0,class:"move-period move-period-prev",onClick:t[0]||(t[0]=function(t){return e.movePeriod(-1)}),disabled:e.isPeriodMoveDisabled(-1)},Qi,8,Ji)):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("a",{ref:"title",id:"date",class:"title",tabindex:"-1",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Zi,Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.currentlyViewingText),1)],8,Xi),Object(X["createElementVNode"])("div",el,[Object(X["createElementVNode"])("div",tl,[Object(X["createElementVNode"])("div",null,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[1]||(t[1]=function(t){return e.onRangeChange(t.start,t.end)}),onSubmit:t[2]||(t[2]=function(t){return e.onApplyClicked()})},null,8,["start-date","end-date"]),[[X["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",nl,[Object(X["createVNode"])(l,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[3]||(t[3]=function(t){return e.setPiwikPeriodAndDate(e.selectedPeriod,t.date)})},null,8,["period","date"])])):Object(X["createCommentVNode"])("",!0)]),Object(X["createElementVNode"])("div",rl,[Object(X["createElementVNode"])("h6",null,Object(X["toDisplayString"])(e.translate("General_Period")),1),Object(X["createElementVNode"])("div",ol,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.periodsFiltered,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("p",{key:n},[Object(X["createElementVNode"])("label",{class:Object(X["normalizeClass"])({"selected-period-label":n===e.selectedPeriod}),onDblclick:function(t){return e.changeViewedPeriod(n)},title:n===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(X["withDirectives"])(Object(X["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_".concat(n),"onUpdate:modelValue":t[4]||(t[4]=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,il),[[X["vModelRadio"],e.selectedPeriod]]),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.getPeriodDisplayText(n)),1)],42,al)])})),128))])])]),e.isComparisonEnabled?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ll,[Object(X["createElementVNode"])("label",null,[Object(X["withDirectives"])(Object(X["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=function(t){return e.isComparing=t})},null,512),[[X["vModelCheckbox"],e.isComparing]]),Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(X["createElementVNode"])("div",cl,[Object(X["createVNode"])(c,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.comparePeriodType=t}),style:Object(X["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(X["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",sl,[Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",ul,[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(c,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[7]||(t[7]=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"])])]),dl,Object(X["createElementVNode"])("div",ml,[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(c,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[8]||(t[8]=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(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",pl,[Object(X["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[9]||(t[9]=function(t){return e.onApplyClicked()}),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,fl)]),e.isLoadingNewPage?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",hl,[Object(X["createVNode"])(s,{loading:!0}),Object(X["createElementVNode"])("div",bl,Object(X["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(X["createCommentVNode"])("",!0)]),e.canShowMovePeriod?(Object(X["openBlock"])(),Object(X["createElementBlock"])("button",{key:1,class:"move-period move-period-next",onClick:t[10]||(t[10]=function(t){return e.movePeriod(1)}),disabled:e.isPeriodMoveDisabled(1)},yl,8,vl)):Object(X["createCommentVNode"])("",!0)],2)),[[u,{expander:"title"}]])}function jl(e,t){return El(e)||Cl(e,t)||kl(e,t)||wl()}function wl(){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 kl(e,t){if(e){if("string"===typeof e)return Sl(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)?Sl(e,t):void 0}}function Sl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nr?(window.$("#alert").find("h2").text(a("General_InvalidDateRange")),ue.helper.modalConfirm("#alert",{}),null):"".concat(e,",").concat(t)}return p(this.dateValue)},isErrorDisplayed:function(){return this.currentlyViewingText===a("General_Error")},isRangeSelection:function(){return"range"===this.periodValue},canShowMovePeriod:function(){return!this.isRangeSelection&&!this.isErrorDisplayed}},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(e){e!==this.periodValue&&"range"!==e&&this.setPiwikPeriodAndDate(e,this.dateValue)},setPiwikPeriodAndDate:function(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;var n=p(t);this.setRangeStartEndFromPeriod(e,n),this.propagateNewUrlParams(n,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams:function(e,t){var n,r=this.selectedComparisonParams;ue.helper.isReportingPage()?(this.closePeriodSelector(),n=De.hashParsed.value):(this.isLoadingNewPage=!0,n=De.parsed.value);var o=Object.assign({},n);delete o.comparePeriods,delete o.comparePeriodType,delete o.compareDates,De.updateLocation(Object.assign(Object.assign({},o),{},{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)},updateComparisonValuesFromStore:function(){this.comparePeriodType="previousPeriod",this.compareStartDate="",this.compareEndDate="";var e=fo.getPeriodComparisons();if(!(e.length<2)){var t=De.parsed.value.comparePeriodType;if(Tl.includes(t)&&(this.comparePeriodType=t,"custom"===this.comparePeriodType&&"range"===e[1].params.period)){var n;try{n=m.parse(e[1].params.period,e[1].params.date)}catch(l){return}var r=n.getDateRange(),o=jl(r,2),a=o[0],i=o[1];this.compareStartDate=p(a),this.compareEndDate=p(i)}}},updateSelectedValuesFromHash:function(){var e=De.parsed.value.date,t=De.parsed.value.period;this.periodValue=t,this.selectedPeriod=t,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{m.parse(t,e)}catch(l){return}if("range"===t){var n=m.get(t).parse(e),r=n.getDateRange(),o=jl(r,2),a=o[0],i=o[1];this.dateValue=a,this.startRangeDate=p(a),this.endRangeDate=p(i)}else this.dateValue=h(e),this.setRangeStartEndFromPeriod(t,e)},setRangeStartEndFromPeriod:function(e,t){var n=m.parse(e,t).getDateRange();this.startRangeDate=p(n[0]Il?Il:n[1])},getPeriodDisplayText:function(e){return m.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{h(this.compareStartDate)}catch(e){return!1}try{h(this.compareEndDate)}catch(e){return!1}return!0},movePeriod:function(e){if(this.canMovePeriod(e)){var t=new Date;switch(null!=this.dateValue&&(t=this.dateValue),this.periodValue){case"day":t.setDate(t.getDate()+e);break;case"week":t.setDate(t.getDate()+7*e);break;case"month":t.setMonth(t.getMonth()+e);break;case"year":t.setFullYear(t.getFullYear()+e);break;default:break}this.dateValueIl&&(this.dateValue=Il),this.onApplyClicked()}},isPeriodMoveDisabled:function(e){return null===this.dateValue?this.isRangeSelection:this.isRangeSelection||!this.canMovePeriod(e)},canMovePeriod:function(e){if(null===this.dateValue)return!1;var t=-1===e?Nl:Il;return!g(this.dateValue,t,this.periodValue)}}});Bl.render=Ol;var Al=Bl,Ml={class:"reportingMenu"},Ll=["aria-label"],Fl=["data-category-id"],_l=["onClick"],Rl={class:"hidden"},Hl={key:2,role:"menu"},Ul=["href","onClick","title"],$l=["href","onClick"],ql=["onClick"],Wl=Object(X["createElementVNode"])("span",{class:"icon-help"},null,-1),zl=[Wl],Gl={id:"mobile-left-menu",class:"sidenav sidenav--reporting-menu-mobile hide-on-large-only"},Yl=["data-category-id"],Jl={key:1,class:"collapsible collapsible-accordion"},Kl={class:"collapsible-header"},Ql={class:"collapsible-body"},Xl=["onClick","href"],Zl=["onClick","href"];function ec(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("MenuItemsDropdown"),l=Object(X["resolveDirective"])("side-nav");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Ml,[Object(X["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down collapsible",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menu,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:Object(X["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id,"data-category-id":t.id},[t.component?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(t.component),{key:0,onAction:function(n){return e.loadCategory(t)}},null,8,["onAction"])):Object(X["createCommentVNode"])("",!0),t.component?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"item",tabindex:"5",href:"",onClick:Object(X["withModifiers"])((function(n){return e.loadCategory(t)}),["prevent"])},[Object(X["createElementVNode"])("span",{class:Object(X["normalizeClass"])("menu-icon ".concat(t.icon?t.icon:t.subcategories&&t.id===e.activeCategory?"icon-chevron-down":"icon-chevron-right"))},null,2),Object(X["createTextVNode"])(Object(X["toDisplayString"])(t.name)+" ",1),Object(X["createElementVNode"])("span",Rl,Object(X["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,_l)),t.component?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",Hl,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{role:"menuitem",class:Object(X["normalizeClass"])({active:(n.id===e.displayedSubcategory||n.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:n.id},[n.isGroup?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:0,"show-search":!0,"menu-title":e.htmlEntities(n.name)},{default:Object(X["withCtx"])((function(){return[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(n.subcategories,(function(r){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{class:Object(X["normalizeClass"])(["item",{active:r.id===e.activeSubsubcategory&&n.id===e.displayedSubcategory&&t.id===e.displayedCategory}]),tabindex:"5",href:"#?".concat(e.makeUrl(t,r)),onClick:function(n){return e.loadSubcategory(t,r,n)},title:r.tooltip,key:r.id},Object(X["toDisplayString"])(r.name),11,Ul)})),128))]})),_:2},1032,["menu-title"])):Object(X["createCommentVNode"])("",!0),n.isGroup?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,href:"#?".concat(e.makeUrl(t,n)),class:"item",onClick:function(r){return e.loadSubcategory(t,n,r)}},Object(X["toDisplayString"])(n.name),9,$l)),n.help?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:2,class:Object(X["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)}},zl,10,ql)):Object(X["createCommentVNode"])("",!0)],2)})),128))]))],10,Fl)})),128))],8,Ll),Object(X["createElementVNode"])("ul",Gl,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.menu,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{class:"no-padding",key:t.id,"data-category-id":t.id},[t.component?(Object(X["openBlock"])(),Object(X["createBlock"])(Object(X["resolveDynamicComponent"])(t.component),{key:0,onAction:function(n){return e.loadCategory(t)}},null,8,["onAction"])):Object(X["createCommentVNode"])("",!0),t.component?Object(X["createCommentVNode"])("",!0):Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",Jl,[Object(X["createElementVNode"])("li",null,[Object(X["createElementVNode"])("a",Kl,[Object(X["createElementVNode"])("i",{class:Object(X["normalizeClass"])(t.icon?t.icon:"icon-chevron-down")},null,2),Object(X["createTextVNode"])(Object(X["toDisplayString"])(t.name),1)]),Object(X["createElementVNode"])("div",Ql,[Object(X["createElementVNode"])("ul",null,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{key:n.id},[n.isGroup?(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],{key:0},Object(X["renderList"])(n.subcategories,(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n)),key:n.id},Object(X["toDisplayString"])(n.name),9,Xl)})),128)):Object(X["createCommentVNode"])("",!0),n.isGroup?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,onClick:function(r){return e.loadSubcategory(t,n)},href:"#?".concat(e.makeUrl(t,n))},Object(X["toDisplayString"])(n.name),9,Zl))])})),128))])])])],512)),[[l,{activator:e.sideNavActivator}]])],8,Yl)})),128))])])}function tc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nc(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var t=e.widget.split("."),n=Vc(t,2),r=n[0],o=n[1];e.component=Lt(r,o)}})),e},activeCategory:function(){return wc.activeCategory.value},activeSubcategory:function(){return wc.activeSubcategory.value},activeSubsubcategory:function(){return wc.activeSubsubcategory.value},displayedCategory:function(){return De.parsed.value.category},displayedSubcategory:function(){return De.parsed.value.subcategory}},created:function(){var e=this;wc.fetchMenuItems().then((function(t){if(!De.parsed.value.subcategory){var n=t[0],r=n.subcategories[0];wc.enterSubcategory(n,r),e.propagateUrlChange(n,r)}})),Object(X["watch"])((function(){return De.parsed.value}),(function(e){var t=wc.findSubcategory(e.category,e.subcategory);wc.enterSubcategory(t.category,t.subcategory,t.subsubcategory)})),ue.on("matomoPageChange",(function(){e.initialLoad||window.globalAjaxQueue.abort(),e.helpShownCategory=null,e.showSubcategoryHelpOnLoad&&(e.showHelp(e.showSubcategoryHelpOnLoad.category,e.showSubcategoryHelpOnLoad.subcategory),e.showSubcategoryHelpOnLoad=null),window.$("#loadingError,#loadingRateLimitError").hide(),e.initialLoad=!1})),ue.on("updateReportingMenu",(function(){wc.reloadMenuItems().then((function(){var e=De.parsed.value.category,t=De.parsed.value.subcategory;if(e&&t){var n=wc.findSubcategory(e,t);n.category&&wc.enterSubcategory(n.category,n.subcategory,n.subsubcategory)}})),Tc.reloadAvailableWidgets()}))},methods:{propagateUrlChange:function(e,t){var n=De.parsed.value;n.category===e.id&&n.subcategory===t.id?this.loadSubcategory(e,t):De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory:function(e){ga.remove(Mc);var t=wc.toggleCategory(e),n=e.subcategories,r=n&&1===n.length||e.widget&&n&&n.length;if(t&&r){this.helpShownCategory=null;var o=e.subcategories[0];this.propagateUrlChange(e,o)}},loadSubcategory:function(e,t,n){n&&(n.shiftKey||n.ctrlKey||n.metaKey)||(ga.remove(Mc),t&&t.id===De.parsed.value.subcategory&&e.id===De.parsed.value.category&&(this.helpShownCategory=null,setTimeout((function(){ue.postEvent("loadPage",e.id,t.id)}))))},makeUrl:function(e,t){var n=De.parsed.value,r=n.idSite,o=n.period,a=n.date,i=n.segment,l=n.comparePeriods,c=n.compareDates,s=n.compareSegments;return De.stringify({idSite:r,period:o,date:a,segment:i,comparePeriods:l,compareDates:c,compareSegments:s,category:e.id,subcategory:t.id})},htmlEntities:function(e){return ue.helper.htmlEntities(e)},showHelp:function(e,t,n){var r=De.parsed.value,o=r.category,i=r.subcategory;if((o!==e.id||i!==t.id)&&n)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return ga.remove(Mc),void(this.helpShownCategory=null);var l=a("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),c="".concat(l,"
");ga.show({context:"info",id:Mc,type:"help",noclear:!0,class:"help-notification",message:c+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});Lc.render=ec;var _c=Lc;function Fc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rc(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0){var t=e.widget.split("."),n=Vc(t,2),r=n[0],o=n[1];e.component=_t(r,o)}})),e},activeCategory:function(){return wc.activeCategory.value},activeSubcategory:function(){return wc.activeSubcategory.value},activeSubsubcategory:function(){return wc.activeSubsubcategory.value},displayedCategory:function(){return De.parsed.value.category},displayedSubcategory:function(){return De.parsed.value.subcategory}},created:function(){var e=this;wc.fetchMenuItems().then((function(t){if(!De.parsed.value.subcategory){var n=t[0],r=n.subcategories[0];wc.enterSubcategory(n,r),e.propagateUrlChange(n,r)}})),Object(X["watch"])((function(){return De.parsed.value}),(function(e){var t=wc.findSubcategory(e.category,e.subcategory);wc.enterSubcategory(t.category,t.subcategory,t.subsubcategory)})),ue.on("matomoPageChange",(function(){e.initialLoad||window.globalAjaxQueue.abort(),e.helpShownCategory=null,e.showSubcategoryHelpOnLoad&&(e.showHelp(e.showSubcategoryHelpOnLoad.category,e.showSubcategoryHelpOnLoad.subcategory),e.showSubcategoryHelpOnLoad=null),window.$("#loadingError,#loadingRateLimitError").hide(),e.initialLoad=!1})),ue.on("updateReportingMenu",(function(){wc.reloadMenuItems().then((function(){var e=De.parsed.value.category,t=De.parsed.value.subcategory;if(e&&t){var n=wc.findSubcategory(e,t);n.category&&wc.enterSubcategory(n.category,n.subcategory,n.subsubcategory)}})),Tc.reloadAvailableWidgets()}))},methods:{propagateUrlChange:function(e,t){var n=De.parsed.value;n.category===e.id&&n.subcategory===t.id?this.loadSubcategory(e,t):De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory:function(e){ga.remove(Mc);var t=wc.toggleCategory(e),n=e.subcategories,r=n&&1===n.length||e.widget&&n&&n.length;if(t&&r){this.helpShownCategory=null;var o=e.subcategories[0];this.propagateUrlChange(e,o)}},loadSubcategory:function(e,t,n){n&&(n.shiftKey||n.ctrlKey||n.metaKey)||(ga.remove(Mc),t&&t.id===De.parsed.value.subcategory&&e.id===De.parsed.value.category&&(this.helpShownCategory=null,setTimeout((function(){ue.postEvent("loadPage",e.id,t.id)}))))},makeUrl:function(e,t){var n=De.parsed.value,r=n.idSite,o=n.period,a=n.date,i=n.segment,l=n.comparePeriods,c=n.compareDates,s=n.compareSegments;return De.stringify({idSite:r,period:o,date:a,segment:i,comparePeriods:l,compareDates:c,compareSegments:s,category:e.id,subcategory:t.id})},htmlEntities:function(e){return ue.helper.htmlEntities(e)},showHelp:function(e,t,n){var r=De.parsed.value,o=r.category,i=r.subcategory;if((o!==e.id||i!==t.id)&&n)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return ga.remove(Mc),void(this.helpShownCategory=null);var l=a("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),c="".concat(l,"
");ga.show({context:"info",id:Mc,type:"help",noclear:!0,class:"help-notification",message:c+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});Lc.render=ec;var Fc=Lc;function _c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rc(e,t){for(var n=0;n .card-content .card-title");i.length||(i=a.find("> h2")),i.length&&i.html(ue.helper.htmlEntities(n.widgetName))}ue.helper.compileVueEntryComponents(a),ga.parseNotificationDivs(),setTimeout((function(){ue.postEvent("widget:loaded",{parameters:e,element:a})}))}})).catch((function(e){t===n.changeCounter&&(n.lastWidgetAbortController=null,n.cleanupLastWidgetContent(),n.loading=!1,"abort"!==e.xhrStatus&&(429===e.status&&(n.loadingFailedRateLimit=!0),n.loadingFailed=!0))}))}}});Xc.render=Qc;var Zc=Xc,es={class:"widget-container"};function ts(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Widget");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",es,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.actualContainer,(function(e,t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:t},[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(i,{widget:e,"prevent-recursion":!0},null,8,["widget"])])])})),128))])}function ns(e){return as(e)||os(e)||cs(e)||rs()}function rs(){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 os(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function as(e){if(Array.isArray(e))return ss(e)}function is(e,t){return ds(e)||us(e,t)||cs(e,t)||ls()}function ls(){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 cs(e,t){if(e){if("string"===typeof e)return ss(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)?ss(e,t):void 0}}function ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n"))}return{tooltipContent:e}},created:function(){var e=this,t=this.actualWidget;if(t&&t.middlewareParameters){var n=t.middlewareParameters;Ze.fetch(n).then((function(t){e.showWidget=!!t}))}else this.showWidget=!0},computed:{allWidgets:function(){return Tc.widgets.value},actualWidget:function(){var e=this,t=this.widget;if(t){var n=Object.assign({},t);if(t&&t.isReport&&!t.documentation){var r=qc.findReport(t.module,t.action);r&&r.documentation&&(n.documentation=r.documentation)}return t}if(this.containerid){var o=As(this.allWidgets,this.containerid);if(o){var a=Object.assign({},o);if(this.widgetized){a.isFirstInPage=!0,a.parameters=Object.assign(Object.assign({},a.parameters),{},{widget:"1"});var i=Dc(a);i&&(a.widgets=i.map((function(t){return Object.assign(Object.assign({},t),{},{parameters:Object.assign(Object.assign({},t.parameters),{},{widget:"1",containerId:e.containerid})})})))}return a}}return null}}});Ms.render=Bs;var Ls=Ms,_s={class:"reporting-page"},Fs={key:1,class:"col s12 l6 leftWidgetColumn"},Rs={key:2,class:"col s12 l6 rightWidgetColumn"};function Hs(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("ActivityIndicator"),l=Object(X["resolveComponent"])("Widget");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",_s,[Object(X["createVNode"])(i,{loading:e.loading},null,8,["loading"]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",null,Object(X["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[X["vShow"],e.hasNoPage]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.widgets,(function(e){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createBlock"])(l,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Fs,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.left,(function(e){return Object(X["openBlock"])(),Object(X["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(X["createCommentVNode"])("",!0),e.group?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Rs,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.right,(function(e){return Object(X["openBlock"])(),Object(X["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(X["createCommentVNode"])("",!0)])})),128))])}function Us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $s(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n .card-content .card-title");i.length||(i=a.find("> h2")),i.length&&i.html(ue.helper.htmlEntities(n.widgetName))}ue.helper.compileVueEntryComponents(a),ga.parseNotificationDivs(),setTimeout((function(){ue.postEvent("widget:loaded",{parameters:e,element:a})}))}})).catch((function(e){t===n.changeCounter&&(n.lastWidgetAbortController=null,n.cleanupLastWidgetContent(),n.loading=!1,"abort"!==e.xhrStatus&&(429===e.status&&(n.loadingFailedRateLimit=!0),n.loadingFailed=!0))}))}}});Xc.render=Qc;var Zc=Xc,es={class:"widget-container"};function ts(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Widget");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",es,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.actualContainer,(function(e,t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:t},[Object(X["createElementVNode"])("div",null,[Object(X["createVNode"])(i,{widget:e,"prevent-recursion":!0},null,8,["widget"])])])})),128))])}function ns(e){return as(e)||os(e)||cs(e)||rs()}function rs(){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 os(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function as(e){if(Array.isArray(e))return ss(e)}function is(e,t){return ds(e)||us(e,t)||cs(e,t)||ls()}function ls(){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 cs(e,t){if(e){if("string"===typeof e)return ss(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)?ss(e,t):void 0}}function ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n"))}return{tooltipContent:e}},created:function(){var e=this,t=this.actualWidget;if(t&&t.middlewareParameters){var n=t.middlewareParameters;Ze.fetch(n).then((function(t){e.showWidget=!!t}))}else this.showWidget=!0},computed:{allWidgets:function(){return Tc.widgets.value},actualWidget:function(){var e=this,t=this.widget;if(t){var n=Object.assign({},t);if(t&&t.isReport&&!t.documentation){var r=qc.findReport(t.module,t.action);r&&r.documentation&&(n.documentation=r.documentation)}return t}if(this.containerid){var o=As(this.allWidgets,this.containerid);if(o){var a=Object.assign({},o);if(this.widgetized){a.isFirstInPage=!0,a.parameters=Object.assign(Object.assign({},a.parameters),{},{widget:"1"});var i=Dc(a);i&&(a.widgets=i.map((function(t){return Object.assign(Object.assign({},t),{},{parameters:Object.assign(Object.assign({},t.parameters),{},{widget:"1",containerId:e.containerid})})})))}return a}}return null}}});Ms.render=Bs;var Ls=Ms,Fs={class:"reporting-page"},_s={key:1,class:"col s12 l6 leftWidgetColumn"},Rs={key:2,class:"col s12 l6 rightWidgetColumn"};function Hs(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("ActivityIndicator"),l=Object(X["resolveComponent"])("Widget");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Fs,[Object(X["createVNode"])(i,{loading:e.loading},null,8,["loading"]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",null,Object(X["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[X["vShow"],e.hasNoPage]]),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.widgets,(function(e){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(X["createCommentVNode"])("",!0):(Object(X["openBlock"])(),Object(X["createBlock"])(l,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",_s,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.left,(function(e){return Object(X["openBlock"])(),Object(X["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(X["createCommentVNode"])("",!0),e.group?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",Rs,[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.right,(function(e){return Object(X["openBlock"])(),Object(X["createBlock"])(l,{widget:e,key:e.uniqueId},null,8,["widget"])})),128))])):Object(X["createCommentVNode"])("",!0)])})),128))])}function Us(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $s(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n'),"");ue.visitorLogEnabled||(n=a("CoreHome_PeriodHasOnlyRawDataNoVisitsLog")),ga.show({id:"onlyRawData",animate:!1,context:"info",message:n,type:"transient"})}function ru(){ga.remove("onlyRawData")}var ou=Object(X["defineComponent"])({components:{ActivityIndicator:ln,Widget:Ls},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;tu.resetPage(),this.loading=!0,this.renderInitialPage(),Object(X["watch"])((function(){return De.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(ru(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory,t.period,t.date,t.segment))})),ue.on("loadPage",(function(t,n){var r=De.parsed.value;e.renderPage(t,n,r.period,r.date,r.segment)}))},computed:{widgets:function(){return tu.widgets.value}},methods:{renderPage:function(e,t,n,r,o){var i=this;if(!e||!t)return tu.resetPage(),void(this.loading=!1);try{m.parse(n,r)}catch(c){return ga.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),tu.resetPage(),void(this.loading=!1)}ga.remove("invalidDate"),ue.postEvent("matomoPageChange",{}),ga.clearTransientNotifications(),m.parse(n,r).containsToday()&&this.showOnlyRawDataMessageIfRequired(e,t,n,r,o);var l={category:e,subcategory:t};if(ue.postEvent("ReportingPage.loadPage",l),l.promise)return this.loading=!0,void Promise.resolve(l.promise).finally((function(){i.loading=!1}));tu.fetchPage(e,t).then((function(){var t=!tu.page.value;if(t){var n=ic.findPageInCategory(e);if(n&&n.subcategory)return void De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{subcategory:n.subcategory.id}))}i.hasNoPage=t,i.loading=!1}))},renderInitialPage:function(){var e=De.parsed.value;this.renderPage(e.category,e.subcategory,e.period,e.date,e.segment)},showOnlyRawDataMessageIfRequired:function(e,t,n,r,o){var a=this;if(this.hasRawData&&this.hasNoVisits&&nu(),o)ru();else{var i=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],l=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"];if(-1===i.indexOf(t)&&-1===l.indexOf(e)&&-1===t.toLowerCase().indexOf("manage")){var c=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()0?(a.hasNoVisits=!1,void ru()):(a.hasNoVisits=!0,a.hasRawData?void nu():Ze.fetch({method:"Live.getMostRecentVisitsDateTime",date:r,period:n}).then((function(e){if(!e||""===e.value)return a.hasRawData=!1,void ru();a.hasRawData=!0,nu()})))}))}else ru()}}}});ou.render=Hs;var au=ou,iu={class:"report-export-popover row",id:"reportExport"},lu={class:"col l6"},cu={name:"format"},su={name:"option_flat"},uu={name:"option_expanded"},du={name:"option_format_metrics"},mu={class:"col l6"},pu={name:"filter_type"},fu={class:"filter_limit"},hu={name:"filter_limit_all"},bu={key:0,name:"filter_limit"},vu={key:1,name:"filter_limit"},gu={class:"col l12"},yu=["value"],Ou=Object(X["createTextVNode"])("\n "),ju=[Ou],wu=["innerHTML"],ku={class:"col l12"},Su=["href","title"],Cu=["innerHTML"];function Eu(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field"),l=Object(X["resolveDirective"])("select-on-focus");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",iu,[Object(X["createElementVNode"])("div",lu,[Object(X["createElementVNode"])("div",cu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",su,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[X["vShow"],e.hasSubtables]])])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",uu,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[X["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",du,[Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(X["createElementVNode"])("div",mu,[Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",pu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(X["createElementVNode"])("div",fu,[Object(X["withDirectives"])(Object(X["createElementVNode"])("div",hu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[X["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",bu,[Object(X["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(X["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",vu,[Object(X["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(X["createCommentVNode"])("",!0)])]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",gu,[Object(X["withDirectives"])(Object(X["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},ju,8,yu),[[l,{}]]),Object(X["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,wu)],512),[[X["vShow"],e.showUrl]]),Object(X["createElementVNode"])("div",ku,[Object(X["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(X["toDisplayString"])(e.translate("General_Export")),9,Su),Object(X["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(X["withDirectives"])(Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[X["vShow"],!e.showUrl]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[X["vShow"],e.showUrl]])])]),e.additionalContent?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,class:"col l12 report-export-popover-footer",innerHTML:e.$sanitize(e.additionalContent)},null,8,Cu)):Object(X["createCommentVNode"])("",!0)])}function Du(e,t){return Iu(e)||Nu(e,t)||Tu(e,t)||Pu()}function Pu(){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 Tu(e,t){if(e){if("string"===typeof e)return Vu(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)?Vu(e,t):void 0}}function Vu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.reportFormat,n=this.apiMethod,r=this.reportType,o=this.dataTable;if(t){var a={},i="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams?a=JSON.parse(this.requestParams):this.requestParams&&"object"===xu(this.requestParams)&&(a=this.requestParams);var l=o.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,m=l.idSite,p=o.param,f=p.date,h=p.period;"RSS"===t&&(f="last10"),"undefined"!==typeof o.param.dateUsedInGraph&&(f=o.param.dateUsedInGraph);var b=ue.config.datatable_export_range_as_day.toLowerCase();-1!==b.indexOf(t.toLowerCase())&&"range"===o.param.period&&(h="day"),"range"===o.param.period&&"graphEvolution"===o.param.viewDataTable&&(h="day");var v={module:"API",format:t,idSite:m,period:h,date:f};if("processed"===r){v.method="API.getProcessedReport";var g=n.split("."),y=Du(g,2);v.apiModule=y[0],v.apiAction=y[1]}else v.method=n;if(o.param.compareDates&&o.param.compareDates.length&&(v.compareDates=o.param.compareDates,v.compare="1"),o.param.comparePeriods&&o.param.comparePeriods.length&&(v.comparePeriods=o.param.comparePeriods,v.compare="1"),o.param.compareSegments&&o.param.compareSegments.length&&(v.compareSegments=o.param.compareSegments,v.compare="1"),"undefined"!==typeof o.param.filter_pattern&&(v.filter_pattern=o.param.filter_pattern),"undefined"!==typeof o.param.filter_pattern_recursive&&(v.filter_pattern_recursive=o.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=Du(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),v[n]=o})),this.optionFlat&&(v.flat=1,"undefined"!==typeof o.param.include_aggregate_rows&&"1"===o.param.include_aggregate_rows&&(v.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(v.expanded=1),this.optionFormatMetrics&&(v.format_metrics=1),o.param.pivotBy&&(v.pivotBy=o.param.pivotBy,v.pivotByColumnLimit=20,o.props.pivot_by_column&&(v.pivotByColumn=o.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(v.translateColumnNames=1,v.language=ue.language),"undefined"!==typeof c&&(v.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(v.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(v.idDimension=d),s){var O=s.split(",");if(O.length>1)v.label=O;else{var j=Du(O,1);v.label=j[0]}}v.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(v.token_auth=ue.token_auth,v.force_api_session=1),v.filter_limit=i;var w=window.location.href.split("?")[0];return"".concat(w,"?").concat(De.stringify(v))}}}});Au.render=Eu;var Mu=Au,Lu=window,_u=Lu.$,Fu={mounted:function(e,t){e.addEventListener("click",(function(){var n=De.hashParsed.value.popover,r=_u(e).closest("[data-report]").data("uiControlObject"),o=window.Piwik_Popover.showLoading("Export"),i=t.value.reportFormats,l=r.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,s={initialReportType:"default",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"yes":"no",initialOptionFlat:c,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:c||r.numberOfSubtables>0,availableReportFormats:{default:i,processed:{XML:i.XML,JSON:i.JSON}},availableReportTypes:{default:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},u=Nt({template:'\n ',data:function(){return{bind:s}}});u.component("popover",Mu);var d=document.createElement("div");u.mount(d);var m=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(a("General_Export")," ").concat(ue.helper.htmlEntities(m))),window.Piwik_Popover.setContent(d),window.Piwik_Popover.onClose((function(){u.unmount(),""!==n&&setTimeout((function(){De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),_u(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}},Ru=["src","width","height"];
+ */function Xs(e){return!!(e.isContainer&&e.layout&&"ByDimension"===e.layout||"bydimension"===e.viewDataTable)||(!!e.isWide||e.viewDataTable&&("tableAllColumns"===e.viewDataTable||"sparklines"===e.viewDataTable||"graphEvolution"===e.viewDataTable))}function Zs(e){if(e&&e[0]){var t=zs(e),n=e[0];return n.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:Zs(n.left||[]),right:Zs(n.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}var eu=function(){function e(){var t=this;Us(this,e),Ws(this,"privateState",Object(X["reactive"])({})),Ws(this,"state",Object(X["computed"])((function(){return Object(X["readonly"])(t.privateState)}))),Ws(this,"page",Object(X["computed"])((function(){return t.state.value.page}))),Ws(this,"widgets",Object(X["computed"])((function(){var e=t.page.value;if(!e)return[];var n=[],r={},o=function(e){return e.isReport&&r["".concat(e.module,".").concat(e.action)]},a=function(e){if(!e.isReport)return[];var t=qc.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach((function(e){o(e)||(a(e).forEach((function(e){r["".concat(e.module,".").concat(e.action)]=!0})),n.push(e))})),n=pc(n),1===n.length)return Zs(n);for(var i=[],l=0;l'),"");ue.visitorLogEnabled||(n=a("CoreHome_PeriodHasOnlyRawDataNoVisitsLog")),ga.show({id:"onlyRawData",animate:!1,context:"info",message:n,type:"transient"})}function ru(){ga.remove("onlyRawData")}var ou=Object(X["defineComponent"])({components:{ActivityIndicator:ln,Widget:Ls},data:function(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created:function(){var e=this;tu.resetPage(),this.loading=!0,this.renderInitialPage(),Object(X["watch"])((function(){return De.parsed.value}),(function(t,n){t.category===n.category&&t.subcategory===n.subcategory&&t.period===n.period&&t.date===n.date&&t.segment===n.segment&&JSON.stringify(t.compareDates)===JSON.stringify(n.compareDates)&&JSON.stringify(t.comparePeriods)===JSON.stringify(n.comparePeriods)&&JSON.stringify(t.compareSegments)===JSON.stringify(n.compareSegments)&&JSON.stringify(t.columns||"")===JSON.stringify(n.columns||"")||(t.date===n.date&&t.period===n.period||(ru(),e.dateLastChecked=null,e.hasRawData=!1,e.hasNoVisits=!1),e.renderPage(t.category,t.subcategory,t.period,t.date,t.segment))})),ue.on("loadPage",(function(t,n){var r=De.parsed.value;e.renderPage(t,n,r.period,r.date,r.segment)}))},computed:{widgets:function(){return tu.widgets.value}},methods:{renderPage:function(e,t,n,r,o){var i=this;if(!e||!t)return tu.resetPage(),void(this.loading=!1);try{m.parse(n,r)}catch(c){return ga.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),tu.resetPage(),void(this.loading=!1)}ga.remove("invalidDate"),ue.postEvent("matomoPageChange",{}),ga.clearTransientNotifications(),m.parse(n,r).containsToday()&&this.showOnlyRawDataMessageIfRequired(e,t,n,r,o);var l={category:e,subcategory:t};if(ue.postEvent("ReportingPage.loadPage",l),l.promise)return this.loading=!0,void Promise.resolve(l.promise).finally((function(){i.loading=!1}));tu.fetchPage(e,t).then((function(){var t=!tu.page.value;if(t){var n=ic.findPageInCategory(e);if(n&&n.subcategory)return void De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{subcategory:n.subcategory.id}))}i.hasNoPage=t,i.loading=!1}))},renderInitialPage:function(){var e=De.parsed.value;this.renderPage(e.category,e.subcategory,e.period,e.date,e.segment)},showOnlyRawDataMessageIfRequired:function(e,t,n,r,o){var a=this;if(this.hasRawData&&this.hasNoVisits&&nu(),o)ru();else{var i=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],l=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"];if(-1===i.indexOf(t)&&-1===l.indexOf(e)&&-1===t.toLowerCase().indexOf("manage")){var c=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()0?(a.hasNoVisits=!1,void ru()):(a.hasNoVisits=!0,a.hasRawData?void nu():Ze.fetch({method:"Live.getMostRecentVisitsDateTime",date:r,period:n}).then((function(e){if(!e||""===e.value)return a.hasRawData=!1,void ru();a.hasRawData=!0,nu()})))}))}else ru()}}}});ou.render=Hs;var au=ou,iu={class:"report-export-popover row",id:"reportExport"},lu={class:"col l6"},cu={name:"format"},su={name:"option_flat"},uu={name:"option_expanded"},du={name:"option_format_metrics"},mu={class:"col l6"},pu={name:"filter_type"},fu={class:"filter_limit"},hu={name:"filter_limit_all"},bu={key:0,name:"filter_limit"},vu={key:1,name:"filter_limit"},gu={class:"col l12"},yu=["value"],Ou=Object(X["createTextVNode"])("\n "),ju=[Ou],wu=["innerHTML"],ku={class:"col l12"},Su=["href","title"],Cu=["innerHTML"];function Eu(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Field"),l=Object(X["resolveDirective"])("select-on-focus");return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",iu,[Object(X["createElementVNode"])("div",lu,[Object(X["createElementVNode"])("div",cu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reportFormat=t}),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",su,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlat,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.optionFlat=t})},null,8,["title","modelValue"]),[[X["vShow"],e.hasSubtables]])])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",uu,[Object(X["withDirectives"])(Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpanded,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.optionExpanded=t})},null,8,["title","modelValue"]),[[X["vShow"],e.hasSubtables&&!e.optionFlat]])])]),Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",du,[Object(X["createVNode"])(i,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.optionFormatMetrics=t})},null,8,["title","modelValue"])])])]),Object(X["createElementVNode"])("div",mu,[Object(X["createElementVNode"])("div",null,[Object(X["createElementVNode"])("div",pu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.reportType=t}),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(X["createElementVNode"])("div",fu,[Object(X["withDirectives"])(Object(X["createElementVNode"])("div",hu,[Object(X["createVNode"])(i,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.reportLimitAll=t}),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[X["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",bu,[Object(X["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.reportLimit=t}),"full-width":!0},null,8,["modelValue"])])):Object(X["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",vu,[Object(X["createVNode"])(i,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.reportLimit=t}),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(X["createCommentVNode"])("",!0)])]),Object(X["withDirectives"])(Object(X["createElementVNode"])("div",gu,[Object(X["withDirectives"])(Object(X["createElementVNode"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},ju,8,yu),[[l,{}]]),Object(X["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,wu)],512),[[X["vShow"],e.showUrl]]),Object(X["createElementVNode"])("div",ku,[Object(X["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(X["toDisplayString"])(e.translate("General_Export")),9,Su),Object(X["createElementVNode"])("a",{href:"javascript:",onClick:t[8]||(t[8]=function(t){return e.showUrl=!e.showUrl}),class:"toggle-export-url"},[Object(X["withDirectives"])(Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[X["vShow"],!e.showUrl]]),Object(X["withDirectives"])(Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[X["vShow"],e.showUrl]])])]),e.additionalContent?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{key:0,class:"col l12 report-export-popover-footer",innerHTML:e.$sanitize(e.additionalContent)},null,8,Cu)):Object(X["createCommentVNode"])("",!0)])}function Du(e,t){return Iu(e)||Nu(e,t)||Tu(e,t)||Pu()}function Pu(){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 Tu(e,t){if(e){if("string"===typeof e)return Vu(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)?Vu(e,t):void 0}}function Vu(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{filterLimitTooltip:function(){var e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return"".concat(e," (").concat(t,")")},exportLink:function(){return this.getExportLink(!0)},exportLinkWithoutToken:function(){return this.getExportLink(!1)}},methods:{getExportLink:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.reportFormat,n=this.apiMethod,r=this.reportType,o=this.dataTable;if(t){var a={},i="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams?a=JSON.parse(this.requestParams):this.requestParams&&"object"===xu(this.requestParams)&&(a=this.requestParams);var l=o.param,c=l.segment,s=l.label,u=l.idGoal,d=l.idDimension,m=l.idSite,p=o.param,f=p.date,h=p.period;"RSS"===t&&(f="last10"),"undefined"!==typeof o.param.dateUsedInGraph&&(f=o.param.dateUsedInGraph);var b=ue.config.datatable_export_range_as_day.toLowerCase();-1!==b.indexOf(t.toLowerCase())&&"range"===o.param.period&&(h="day"),"range"===o.param.period&&"graphEvolution"===o.param.viewDataTable&&(h="day");var v={module:"API",format:t,idSite:m,period:h,date:f};if("processed"===r){v.method="API.getProcessedReport";var g=n.split("."),y=Du(g,2);v.apiModule=y[0],v.apiAction=y[1]}else v.method=n;if(o.param.compareDates&&o.param.compareDates.length&&(v.compareDates=o.param.compareDates,v.compare="1"),o.param.comparePeriods&&o.param.comparePeriods.length&&(v.comparePeriods=o.param.comparePeriods,v.compare="1"),o.param.compareSegments&&o.param.compareSegments.length&&(v.compareSegments=o.param.compareSegments,v.compare="1"),"undefined"!==typeof o.param.filter_pattern&&(v.filter_pattern=o.param.filter_pattern),"undefined"!==typeof o.param.filter_pattern_recursive&&(v.filter_pattern_recursive=o.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach((function(e){var t=Du(e,2),n=t[0],r=t[1],o=r;!0===o?o=1:!1===o&&(o=0),v[n]=o})),this.optionFlat&&(v.flat=1,"undefined"!==typeof o.param.include_aggregate_rows&&"1"===o.param.include_aggregate_rows&&(v.include_aggregate_rows=1)),!this.optionFlat&&this.optionExpanded&&(v.expanded=1),this.optionFormatMetrics&&(v.format_metrics=1),o.param.pivotBy&&(v.pivotBy=o.param.pivotBy,v.pivotByColumnLimit=20,o.props.pivot_by_column&&(v.pivotByColumn=o.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(v.translateColumnNames=1,v.language=ue.language),"undefined"!==typeof c&&(v.segment=decodeURIComponent(c)),"undefined"!==typeof u&&"-1"!==u&&(v.idGoal=u),"undefined"!==typeof d&&"-1"!==d&&(v.idDimension=d),s){var O=s.split(",");if(O.length>1)v.label=O;else{var j=Du(O,1);v.label=j[0]}}v.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(v.token_auth=ue.token_auth,v.force_api_session=1),v.filter_limit=i;var w=window.location.href.split("?")[0];return"".concat(w,"?").concat(De.stringify(v))}}}});Au.render=Eu;var Mu=Au,Lu=window,Fu=Lu.$,_u={mounted:function(e,t){e.addEventListener("click",(function(){var n=De.hashParsed.value.popover,r=Fu(e).closest("[data-report]").data("uiControlObject"),o=window.Piwik_Popover.showLoading("Export"),i=t.value.reportFormats,l=r.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));var c=!0===r.param.flat||1===r.param.flat||"1"===r.param.flat,s={initialReportType:"default",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"yes":"no",initialOptionFlat:c,initialOptionExpanded:!0,initialOptionFormatMetrics:!1,hasSubtables:c||r.numberOfSubtables>0,availableReportFormats:{default:i,processed:{XML:i.XML,JSON:i.JSON}},availableReportTypes:{default:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:r,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},u=xt({template:'\n ',data:function(){return{bind:s}}});u.component("popover",Mu);var d=document.createElement("div");u.mount(d);var m=t.value.reportTitle;window.Piwik_Popover.setTitle("".concat(a("General_Export")," ").concat(ue.helper.htmlEntities(m))),window.Piwik_Popover.setContent(d),window.Piwik_Popover.onClose((function(){u.unmount(),""!==n&&setTimeout((function(){De.updateHash(Object.assign(Object.assign({},De.hashParsed.value),{},{popover:n})),t.value.onClose&&t.value.onClose()}),100)})),setTimeout((function(){o.dialog(),Fu(".exportFullUrl, .btn",o).tooltip({track:!0,show:!1,hide:!1})}),100)}))}},Ru=["src","width","height"];
/*!
* Matomo - free/libre analytics platform
*
@@ -293,7 +287,7 @@ function Fn(e){e.classList.add("expanded");var t=e.querySelector(".dropdown.posi
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */function td(e,t,n,r,o,a){return Object(X["openBlock"])(),Object(X["createElementBlock"])("div",ed,[Object(X["renderSlot"])(e.$slots,"default",{formData:e.formData,submitApiMethod:e.submitApiMethod,sendJsonPayload:e.sendJsonPayload,noErrorNotification:e.noErrorNotification,noSuccessNotification:e.noSuccessNotification,submitForm:e.submitForm,isSubmitting:e.isSubmitting,successfulPostResponse:e.successfulPostResponse,errorPostResponse:e.errorPostResponse})],512)}var nd=window,rd=nd.$,od=Object(X["defineComponent"])({props:{formData:{type:Object,required:!0},submitApiMethod:{type:String,required:!0},sendJsonPayload:Boolean,noErrorNotification:Boolean,noSuccessNotification:Boolean},data:function(){return{isSubmitting:!1,successfulPostResponse:null,errorPostResponse:null}},emits:["update:modelValue"],mounted:function(){var e=this;rd(this.$refs.root).on("click","input[type=submit]",(function(){e.submitForm()}))},methods:{submitForm:function(){var e=this;this.successfulPostResponse=null,this.errorPostResponse=null;var t=this.formData;this.sendJsonPayload&&(t={data:JSON.stringify(this.formData)}),this.isSubmitting=!0,Ze.post({module:"API",method:this.submitApiMethod},t,{createErrorNotification:!this.noErrorNotification}).then((function(t){if(e.successfulPostResponse=t,!e.noSuccessNotification){var n=ga.show({message:a("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});ga.scrollToNotification(n)}})).catch((function(t){e.errorPostResponse=t.message})).finally((function(){e.isSubmitting=!1}))}}});od.render=td;var ad=od;function id(e,t,n,r,o,a){return Object(X["renderSlot"])(e.$slots,"default")}var ld=Object(X["defineComponent"])({});ld.render=id;var cd=ld,sd={key:0},ud=["data-target"],dd=Object(X["createElementVNode"])("span",{class:"icon-configure"},null,-1),md=[dd],pd=["data-target"],fd=["title"],hd=["title","src"],bd=["id"],vd=["data-footer-icon-id"],gd=["title"],yd=["title","src"],Od={key:2},jd=Object(X["createElementVNode"])("li",{class:"divider"},null,-1),wd=Object(X["createElementVNode"])("li",{class:"divider"},null,-1),kd=["title"],Sd=Object(X["createElementVNode"])("span",{class:"icon-export"},null,-1),Cd=[Sd],Ed=["title"],Dd=Object(X["createElementVNode"])("span",{class:"icon-image"},null,-1),Pd=[Dd],Td=["title"],Vd=Object(X["createElementVNode"])("span",{class:"icon-annotation"},null,-1),Nd=[Vd],Id=["title"],xd=Object(X["createElementVNode"])("span",{class:"icon-search",draggable:"false"},null,-1),Bd=["title"],Ad=["id","title"],Md=["title"],Ld=["title","src"],_d=["id"],Fd={key:0},Rd=["innerHTML"],Hd={key:1},Ud=["innerHTML"],$d={key:2},qd=["innerHTML"],Wd={key:3},zd=["innerHTML"],Gd={key:4},Yd=["innerHTML"],Jd={key:5},Kd=["innerHTML"],Qd=["title","data-target"],Xd=Object(X["createElementVNode"])("span",{class:"icon-calendar"},null,-1),Zd={class:"periodName"},em=["id"],tm=["data-period"];function nm(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Passthrough"),l=Object(X["resolveDirective"])("dropdown-button"),c=Object(X["resolveDirective"])("report-export");return e.showFooter&&e.showFooterIcons?(Object(X["openBlock"])(),Object(X["createElementBlock"])("div",sd,[e.hasConfigItems&&(e.isAnyConfigureIconHighlighted||e.isTableView)?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:Object(X["normalizeClass"])(["dropdown-button dropdownConfigureIcon dataTableAction",{highlighted:e.isAnyConfigureIconHighlighted}]),href:"",onClick:t[0]||(t[0]=Object(X["withModifiers"])((function(){}),["prevent"])),"data-target":"dropdownConfigure".concat(e.randomIdForDropdown),style:{"margin-right":"3.5px"}},md,10,ud)),[[l]]):Object(X["createCommentVNode"])("",!0),e.hasFooterIconsToShow?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"dropdown-button dataTableAction activateVisualizationSelection",href:"","data-target":"dropdownVisualizations".concat(e.randomIdForDropdown),style:{"margin-right":"3.5px"},onClick:t[1]||(t[1]=Object(X["withModifiers"])((function(){}),["prevent"]))},[/^icon-/.test(e.activeFooterIcon||"")?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,title:e.translate("CoreHome_ChangeVisualization"),class:Object(X["normalizeClass"])(e.activeFooterIcon)},null,10,fd)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("img",{key:1,title:e.translate("CoreHome_ChangeVisualization"),width:"16",height:"16",src:e.activeFooterIcon},null,8,hd))],8,pd)),[[l]]):Object(X["createCommentVNode"])("",!0),e.showFooterIcons?(Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",{key:2,id:"dropdownVisualizations".concat(e.randomIdForDropdown),class:"dropdown-content dataTableFooterIcons"},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.footerIcons,(function(t,n){return Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:n},{default:Object(X["withCtx"])((function(){return[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(t.buttons.filter((function(e){return!!e.icon})),(function(n){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{key:n.id},[Object(X["createElementVNode"])("a",{class:Object(X["normalizeClass"])("".concat(t.class," tableIcon\n ").concat(-1!==e.activeFooterIconIds.indexOf(n.id)?"activeIcon":"")),"data-footer-icon-id":n.id},[/^icon-/.test(n.icon||"")?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,title:n.title,class:Object(X["normalizeClass"])(n.icon),style:{"margin-right":"5.5px"}},null,10,gd)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("img",{key:1,width:"16",height:"16",title:n.title,src:n.icon,style:{"margin-right":"5.5px"}},null,8,yd)),n.title?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",Od,Object(X["toDisplayString"])(n.title),1)):Object(X["createCommentVNode"])("",!0)],10,vd)])})),128)),jd]})),_:2},1024)})),128)),wd],8,bd)):Object(X["createCommentVNode"])("",!0),e.showExport?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:3,class:"dataTableAction activateExportSelection",title:e.translate("General_ExportThisReport"),href:"",style:{"margin-right":"3.5px"},onClick:t[2]||(t[2]=Object(X["withModifiers"])((function(){}),["prevent"]))},Cd,8,kd)),[[c,{reportTitle:e.reportTitle,requestParams:e.requestParams,apiMethod:e.apiMethodToRequestDataTable,reportFormats:e.reportFormats,maxFilterLimit:e.maxFilterLimit}]]):Object(X["createCommentVNode"])("",!0),e.showExportAsImageIcon?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:4,class:"dataTableAction tableIcon",href:"",id:"dataTableFooterExportAsImageIcon",onClick:t[3]||(t[3]=Object(X["withModifiers"])((function(t){return e.showExportImage(t)}),["prevent"])),title:e.translate("General_ExportAsImage"),style:{"margin-right":"3.5px"}},Pd,8,Ed)):Object(X["createCommentVNode"])("",!0),e.showAnnotations?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:5,class:"dataTableAction annotationView",href:"",title:e.translate("Annotations_Annotations"),onClick:t[4]||(t[4]=Object(X["withModifiers"])((function(){}),["prevent"])),style:{"margin-right":"3.5px"}},Nd,8,Td)):Object(X["createCommentVNode"])("",!0),e.showSearch?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:6,class:"dropdown-button dataTableAction searchAction",href:"",title:e.translate("General_Search"),style:{"margin-right":"3.5px"},draggable:"false",onClick:t[5]||(t[5]=Object(X["withModifiers"])((function(){}),["prevent"]))},[xd,Object(X["createElementVNode"])("span",{class:"icon-close",draggable:"false",title:e.translate("CoreHome_CloseSearch")},null,8,Bd),Object(X["createElementVNode"])("input",{id:"widgetSearch_".concat(e.reportId),title:e.translate("CoreHome_DataTableHowToSearch"),type:"text",class:"dataTableSearchInput"},null,8,Ad)],8,Id)):Object(X["createCommentVNode"])("",!0),(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.dataTableActions,(function(e){return Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:e.id,class:Object(X["normalizeClass"])("dataTableAction ".concat(e.id)),href:"",onClick:t[6]||(t[6]=Object(X["withModifiers"])((function(){}),["prevent"])),title:e.title,style:{"margin-right":"3.5px"}},[/^icon-/.test(e.icon||"")?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,class:Object(X["normalizeClass"])(e.icon)},null,2)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("img",{key:1,width:"16",height:"16",title:e.title,src:e.icon},null,8,Ld))],10,Md)})),128)),Object(X["createElementVNode"])("ul",{id:"dropdownConfigure".concat(e.randomIdForDropdown),class:"dropdown-content tableConfiguration"},[e.showFlattenTable?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Fd,[Object(X["createElementVNode"])("div",{class:"configItem dataTableFlatten",innerHTML:e.$sanitize(e.flattenItemText)},null,8,Rd)])):Object(X["createCommentVNode"])("",!0),e.showDimensionsConfigItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Hd,[Object(X["createElementVNode"])("div",{class:"configItem dataTableShowDimensions",innerHTML:e.$sanitize(e.showDimensionsText)},null,8,Ud)])):Object(X["createCommentVNode"])("",!0),e.showFlatConfigItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",$d,[Object(X["createElementVNode"])("div",{class:"configItem dataTableIncludeAggregateRows",innerHTML:e.$sanitize(e.includeAggregateRowsText)},null,8,qd)])):Object(X["createCommentVNode"])("",!0),e.showTotalsConfigItem?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Wd,[Object(X["createElementVNode"])("div",{class:"configItem dataTableShowTotalsRow",innerHTML:e.$sanitize(e.keepTotalsRowText)},null,8,zd)])):Object(X["createCommentVNode"])("",!0),e.showExcludeLowPopulation?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Gd,[Object(X["createElementVNode"])("div",{class:"configItem dataTableExcludeLowPopulation",innerHTML:e.$sanitize(e.excludeLowPopText)},null,8,Yd)])):Object(X["createCommentVNode"])("",!0),e.showPivotBySubtable?(Object(X["openBlock"])(),Object(X["createElementBlock"])("li",Jd,[Object(X["createElementVNode"])("div",{class:"configItem dataTablePivotBySubtable",innerHTML:e.$sanitize(e.pivotByText)},null,8,Kd)])):Object(X["createCommentVNode"])("",!0)],8,_d),e.showPeriods?Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:7,class:"dropdown-button dataTableAction activatePeriodsSelection",href:"",onClick:t[7]||(t[7]=Object(X["withModifiers"])((function(){}),["prevent"])),title:e.translate("CoreHome_ChangePeriod"),"data-target":"dropdownPeriods".concat(e.randomIdForDropdown)},[Object(X["createElementVNode"])("div",null,[Xd,Object(X["createElementVNode"])("span",Zd,Object(X["toDisplayString"])(e.translations[e.clientSideParameters.period]||e.clientSideParameters.period),1)])],8,Qd)),[[l]]):Object(X["createCommentVNode"])("",!0),e.showPeriods?(Object(X["openBlock"])(),Object(X["createElementBlock"])("ul",{key:8,id:"dropdownPeriods".concat(e.randomIdForDropdown),class:"dropdown-content dataTablePeriods"},[(Object(X["openBlock"])(!0),Object(X["createElementBlock"])(X["Fragment"],null,Object(X["renderList"])(e.selectablePeriods,(function(t){return Object(X["openBlock"])(),Object(X["createElementBlock"])("li",{key:t},[Object(X["createElementVNode"])("a",{"data-period":t,class:Object(X["normalizeClass"])("tableIcon ".concat(e.clientSideParameters.period===t?"activeIcon":""))},[Object(X["createElementVNode"])("span",null,Object(X["toDisplayString"])(e.translations[t]||t),1)],10,tm)])})),128))],8,em)):Object(X["createCommentVNode"])("",!0)])):Object(X["createCommentVNode"])("",!0)}function rm(e){return lm(e)||im(e)||am(e)||om()}function om(){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 am(e,t){if(e){if("string"===typeof e)return cm(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)?cm(e,t):void 0}}function im(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function lm(e){if(Array.isArray(e))return cm(e)}function cm(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n'];n&&r.push(n);var o=a.apply(void 0,[e].concat(r));return t&&(o+=" (".concat(a("CoreHome_Default"),")")),o+="",o}return a(e)}function mm(e,t,n){return e?dm(t,!0):dm(n)}function pm(e){return!!e&&"0"!==e}var fm=Object(X["defineComponent"])({props:{showPeriods:Boolean,showFooter:Boolean,showFooterIcons:Boolean,showSearch:Boolean,showFlattenTable:Boolean,footerIcons:{type:Array,required:!0},viewDataTable:{type:String,required:!0},reportTitle:String,requestParams:{type:Object,required:!0},apiMethodToRequestDataTable:{type:String,required:!0},maxFilterLimit:{type:Number,required:!0},showExport:Boolean,showExportAsImageIcon:Boolean,showAnnotations:Boolean,reportId:{type:String,required:!0},dataTableActions:{type:Array,required:!0},clientSideParameters:{type:Object,required:!0},hasMultipleDimensions:Boolean,isDataTableEmpty:Boolean,showTotalsRow:Boolean,showExcludeLowPopulation:Boolean,showPivotBySubtable:Boolean,selectablePeriods:Array,translations:{type:Object,required:!0},pivotDimensionName:String},components:{Passthrough:cd},directives:{DropdownButton:Kn,ReportExport:Fu},methods:{showExportImage:function(e){um(e.target).closest(".dataTable").find("div.jqplot-target").trigger("piwikExportAsImage")}},computed:{randomIdForDropdown:function(){return Math.floor(999999*Math.random())},allFooterIcons:function(){return this.footerIcons.reduce((function(e,t){return e.push.apply(e,rm(t.buttons)),e}),[])},activeFooterIcons:function(){var e=this,t=this.clientSideParameters,n=[this.viewDataTable];return 0===t.abandonedCarts||"0"===t.abandonedCarts?n.push("ecommerceOrder"):1!==t.abandonedCarts&&"1"!==t.abandonedCarts||n.push("ecommerceAbandonedCart"),n.map((function(t){return e.allFooterIcons.find((function(e){return e.id===t}))})).filter((function(e){return!!e}))},activeFooterIcon:function(){var e;return null===(e=this.activeFooterIcons[0])||void 0===e?void 0:e.icon},activeFooterIconIds:function(){return this.activeFooterIcons.map((function(e){return e.id}))},numIcons:function(){return this.allFooterIcons.length},hasFooterIconsToShow:function(){return!!this.activeFooterIcons.length&&this.numIcons>1},reportFormats:function(){var e={CSV:"CSV",TSV:"TSV (Excel)",XML:"XML",JSON:"Json",HTML:"HTML",RSS:"RSS"};return e},showDimensionsConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)&&this.hasMultipleDimensions},showFlatConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)},showTotalsConfigItem:function(){return!this.isDataTableEmpty&&this.showTotalsRow},hasConfigItems:function(){return this.showFlattenTable||this.showDimensionsConfigItem||this.showFlatConfigItem||this.showTotalsConfigItem||this.showExcludeLowPopulation||this.showPivotBySubtable},flattenItemText:function(){var e=this.clientSideParameters;return mm(pm(e.flat),"CoreHome_UnFlattenDataTable","CoreHome_FlattenDataTable")},keepTotalsRowText:function(){var e=this.clientSideParameters;return mm(pm(e.keep_totals_row),"CoreHome_RemoveTotalsRowDataTable","CoreHome_AddTotalsRowDataTable")},includeAggregateRowsText:function(){var e=this.clientSideParameters;return mm(pm(e.include_aggregate_rows),"CoreHome_DataTableExcludeAggregateRows","CoreHome_DataTableIncludeAggregateRows")},showDimensionsText:function(){var e=this.clientSideParameters;return mm(pm(e.show_dimensions),"CoreHome_DataTableCombineDimensions","CoreHome_DataTableShowDimensions")},pivotByText:function(){var e=this.clientSideParameters;return pm(e.pivotBy)?dm("CoreHome_UndoPivotBySubtable",!0):dm("CoreHome_PivotBySubtable",!1,this.pivotDimensionName)},excludeLowPopText:function(){var e=this.clientSideParameters;return mm(pm(e.enable_filter_excludelowpop),"CoreHome_IncludeRowsWithLowPopulation","CoreHome_ExcludeRowsWithLowPopulation")},isAnyConfigureIconHighlighted:function(){var e=this.clientSideParameters;return pm(e.flat)||pm(e.keep_totals_row)||pm(e.include_aggregate_rows)||pm(e.show_dimensions)||pm(e.pivotBy)||pm(e.enable_filter_excludelowpop)},isTableView:function(){return"table"===this.viewDataTable||"tableAllColumns"===this.viewDataTable||"tableGoals"===this.viewDataTable}}});fm.render=nm;var hm=fm,bm={key:0,class:"title",style:{cursor:"pointer"},ref:"expander"},vm=Object(X["createElementVNode"])("span",{class:"icon-warning"},null,-1),gm={key:1,class:"title",href:"?module=CoreUpdater&action=newVersionAvailable",style:{cursor:"pointer"},ref:"expander"},ym=Object(X["createElementVNode"])("span",{class:"icon-warning"},null,-1),Om=["innerHTML"],jm=["href"],wm={id:"updateCheckLinkContainer"},km={class:"dropdown positionInViewport"},Sm=["innerHTML"],Cm=["innerHTML"];function Em(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Passthrough"),l=Object(X["resolveDirective"])("expand-on-hover");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{id:"header_message",class:Object(X["normalizeClass"])(["piwikSelector",{header_info:!e.latestVersionAvailable||e.lastUpdateCheckFailed,update_available:e.latestVersionAvailable}])},[e.latestVersionAvailable&&!e.isPiwikDemo?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:0},{default:Object(X["withCtx"])((function(){return[e.isMultiServerEnvironment?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",bm,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),vm],512)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",gm,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),ym],512))]})),_:1})):e.isSuperUser&&(e.isAdminArea||e.lastUpdateCheckFailed)?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:1},{default:Object(X["withCtx"])((function(){return[e.isInternetEnabled?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:"title",innerHTML:e.$sanitize(e.updateCheck)},null,8,Om)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"title",href:e.externalRawLink("https://matomo.org/changelog/"),target:"_blank",rel:"noreferrer noopener"},[Object(X["createElementVNode"])("span",wm,Object(X["toDisplayString"])(e.translate("CoreHome_SeeAvailableVersions")),1)],8,jm))]})),_:1})):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",km,[e.latestVersionAvailable&&e.isSuperUser?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.updateNowText)},null,8,Sm)):e.latestVersionAvailable&&!e.isPiwikDemo&&e.hasSomeViewAccess&&!e.isAnonymous?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.updateAvailableText)},null,8,Cm)):Object(X["createCommentVNode"])("",!0),Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.translate("General_YouAreCurrentlyUsing",e.piwikVersion)),1)])],2)),[[l,{expander:"expander"}]])}var Dm=Object(X["defineComponent"])({props:{isMultiServerEnvironment:Boolean,lastUpdateCheckFailed:Boolean,latestVersionAvailable:String,isPiwikDemo:Boolean,isSuperUser:Boolean,isAdminArea:Boolean,isInternetEnabled:Boolean,updateCheck:String,isAnonymous:Boolean,hasSomeViewAccess:Boolean,contactEmail:String,piwikVersion:String},components:{Passthrough:cd},directives:{ExpandOnHover:qn},computed:{updateNowText:function(){var e="";if(this.isMultiServerEnvironment){var t=Et("https://builds.matomo.org/matomo-".concat(this.latestVersionAvailable,".zip"));e=a("CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment",'builds.matomo.org'))}else e=a("General_PiwikXIsAvailablePleaseUpdateNow",this.latestVersionAvailable||"",'
',"",Dt("https://matomo.org/changelog/"),"");return"".concat(e,"
")},updateAvailableText:function(){var e=a("General_NewUpdatePiwikX",this.latestVersionAvailable||""),t=Dt("https://matomo.org/")+"Matomo",n=Dt("https://matomo.org/changelog/"),r=a("General_PiwikXIsAvailablePleaseNotifyPiwikAdmin","".concat(t," ").concat(n).concat(this.latestVersionAvailable,""),''),"");return"".concat(r,"
")}}});Dm.render=Em;var Pm=Dm;function Tm(e,t){return Bm(e)||xm(e,t)||Nm(e,t)||Vm()}function Vm(){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 Nm(e,t){if(e){if("string"===typeof e)return Im(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)?Im(e,t):void 0}}function Im(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n'];n&&r.push(n);var o=a.apply(void 0,[e].concat(r));return t&&(o+=" (".concat(a("CoreHome_Default"),")")),o+="",o}return a(e)}function mm(e,t,n){return e?dm(t,!0):dm(n)}function pm(e){return!!e&&"0"!==e}var fm=Object(X["defineComponent"])({props:{showPeriods:Boolean,showFooter:Boolean,showFooterIcons:Boolean,showSearch:Boolean,showFlattenTable:Boolean,footerIcons:{type:Array,required:!0},viewDataTable:{type:String,required:!0},reportTitle:String,requestParams:{type:Object,required:!0},apiMethodToRequestDataTable:{type:String,required:!0},maxFilterLimit:{type:Number,required:!0},showExport:Boolean,showExportAsImageIcon:Boolean,showAnnotations:Boolean,reportId:{type:String,required:!0},dataTableActions:{type:Array,required:!0},clientSideParameters:{type:Object,required:!0},hasMultipleDimensions:Boolean,isDataTableEmpty:Boolean,showTotalsRow:Boolean,showExcludeLowPopulation:Boolean,showPivotBySubtable:Boolean,selectablePeriods:Array,translations:{type:Object,required:!0},pivotDimensionName:String},components:{Passthrough:cd},directives:{DropdownButton:Kn,ReportExport:_u},methods:{showExportImage:function(e){um(e.target).closest(".dataTable").find("div.jqplot-target").trigger("piwikExportAsImage")}},computed:{randomIdForDropdown:function(){return Math.floor(999999*Math.random())},allFooterIcons:function(){return this.footerIcons.reduce((function(e,t){return e.push.apply(e,rm(t.buttons)),e}),[])},activeFooterIcons:function(){var e=this,t=this.clientSideParameters,n=[this.viewDataTable];return 0===t.abandonedCarts||"0"===t.abandonedCarts?n.push("ecommerceOrder"):1!==t.abandonedCarts&&"1"!==t.abandonedCarts||n.push("ecommerceAbandonedCart"),n.map((function(t){return e.allFooterIcons.find((function(e){return e.id===t}))})).filter((function(e){return!!e}))},activeFooterIcon:function(){var e;return null===(e=this.activeFooterIcons[0])||void 0===e?void 0:e.icon},activeFooterIconIds:function(){return this.activeFooterIcons.map((function(e){return e.id}))},numIcons:function(){return this.allFooterIcons.length},hasFooterIconsToShow:function(){return!!this.activeFooterIcons.length&&this.numIcons>1},reportFormats:function(){var e={CSV:"CSV",TSV:"TSV (Excel)",XML:"XML",JSON:"Json",HTML:"HTML",RSS:"RSS"};return e},showDimensionsConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)&&this.hasMultipleDimensions},showFlatConfigItem:function(){return this.showFlattenTable&&"1"==="".concat(this.clientSideParameters.flat)},showTotalsConfigItem:function(){return!this.isDataTableEmpty&&this.showTotalsRow},hasConfigItems:function(){return this.showFlattenTable||this.showDimensionsConfigItem||this.showFlatConfigItem||this.showTotalsConfigItem||this.showExcludeLowPopulation||this.showPivotBySubtable},flattenItemText:function(){var e=this.clientSideParameters;return mm(pm(e.flat),"CoreHome_UnFlattenDataTable","CoreHome_FlattenDataTable")},keepTotalsRowText:function(){var e=this.clientSideParameters;return mm(pm(e.keep_totals_row),"CoreHome_RemoveTotalsRowDataTable","CoreHome_AddTotalsRowDataTable")},includeAggregateRowsText:function(){var e=this.clientSideParameters;return mm(pm(e.include_aggregate_rows),"CoreHome_DataTableExcludeAggregateRows","CoreHome_DataTableIncludeAggregateRows")},showDimensionsText:function(){var e=this.clientSideParameters;return mm(pm(e.show_dimensions),"CoreHome_DataTableCombineDimensions","CoreHome_DataTableShowDimensions")},pivotByText:function(){var e=this.clientSideParameters;return pm(e.pivotBy)?dm("CoreHome_UndoPivotBySubtable",!0):dm("CoreHome_PivotBySubtable",!1,this.pivotDimensionName)},excludeLowPopText:function(){var e=this.clientSideParameters;return mm(pm(e.enable_filter_excludelowpop),"CoreHome_IncludeRowsWithLowPopulation","CoreHome_ExcludeRowsWithLowPopulation")},isAnyConfigureIconHighlighted:function(){var e=this.clientSideParameters;return pm(e.flat)||pm(e.keep_totals_row)||pm(e.include_aggregate_rows)||pm(e.show_dimensions)||pm(e.pivotBy)||pm(e.enable_filter_excludelowpop)},isTableView:function(){return"table"===this.viewDataTable||"tableAllColumns"===this.viewDataTable||"tableGoals"===this.viewDataTable}}});fm.render=nm;var hm=fm,bm={key:0,class:"title",style:{cursor:"pointer"},ref:"expander"},vm=Object(X["createElementVNode"])("span",{class:"icon-warning"},null,-1),gm={key:1,class:"title",href:"?module=CoreUpdater&action=newVersionAvailable",style:{cursor:"pointer"},ref:"expander"},ym=Object(X["createElementVNode"])("span",{class:"icon-warning"},null,-1),Om=["innerHTML"],jm=["href"],wm={id:"updateCheckLinkContainer"},km={class:"dropdown positionInViewport"},Sm=["innerHTML"],Cm=["innerHTML"];function Em(e,t,n,r,o,a){var i=Object(X["resolveComponent"])("Passthrough"),l=Object(X["resolveDirective"])("expand-on-hover");return Object(X["withDirectives"])((Object(X["openBlock"])(),Object(X["createElementBlock"])("div",{id:"header_message",class:Object(X["normalizeClass"])(["piwikSelector",{header_info:!e.latestVersionAvailable||e.lastUpdateCheckFailed,update_available:e.latestVersionAvailable}])},[e.latestVersionAvailable&&!e.isPiwikDemo?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:0},{default:Object(X["withCtx"])((function(){return[e.isMultiServerEnvironment?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",bm,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),vm],512)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",gm,[Object(X["createTextVNode"])(Object(X["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),ym],512))]})),_:1})):e.isSuperUser&&(e.isAdminArea||e.lastUpdateCheckFailed)?(Object(X["openBlock"])(),Object(X["createBlock"])(i,{key:1},{default:Object(X["withCtx"])((function(){return[e.isInternetEnabled?(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:0,class:"title",innerHTML:e.$sanitize(e.updateCheck)},null,8,Om)):(Object(X["openBlock"])(),Object(X["createElementBlock"])("a",{key:1,class:"title",href:e.externalRawLink("https://matomo.org/changelog/"),target:"_blank",rel:"noreferrer noopener"},[Object(X["createElementVNode"])("span",wm,Object(X["toDisplayString"])(e.translate("CoreHome_SeeAvailableVersions")),1)],8,jm))]})),_:1})):Object(X["createCommentVNode"])("",!0),Object(X["createElementVNode"])("div",km,[e.latestVersionAvailable&&e.isSuperUser?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.updateNowText)},null,8,Sm)):e.latestVersionAvailable&&!e.isPiwikDemo&&e.hasSomeViewAccess&&!e.isAnonymous?(Object(X["openBlock"])(),Object(X["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.updateAvailableText)},null,8,Cm)):Object(X["createCommentVNode"])("",!0),Object(X["createTextVNode"])(" "+Object(X["toDisplayString"])(e.translate("General_YouAreCurrentlyUsing",e.piwikVersion)),1)])],2)),[[l,{expander:"expander"}]])}var Dm=Object(X["defineComponent"])({props:{isMultiServerEnvironment:Boolean,lastUpdateCheckFailed:Boolean,latestVersionAvailable:String,isPiwikDemo:Boolean,isSuperUser:Boolean,isAdminArea:Boolean,isInternetEnabled:Boolean,updateCheck:String,isAnonymous:Boolean,hasSomeViewAccess:Boolean,contactEmail:String,piwikVersion:String},components:{Passthrough:cd},directives:{ExpandOnHover:qn},computed:{updateNowText:function(){var e="";if(this.isMultiServerEnvironment){var t=Et("https://builds.matomo.org/matomo-".concat(this.latestVersionAvailable,".zip"));e=a("CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment",'builds.matomo.org'))}else e=a("General_PiwikXIsAvailablePleaseUpdateNow",this.latestVersionAvailable||"",'
',"",Dt("https://matomo.org/changelog/"),"");return"".concat(e,"
")},updateAvailableText:function(){var e=a("General_NewUpdatePiwikX",this.latestVersionAvailable||""),t=Dt("https://matomo.org/")+"Matomo",n=Dt("https://matomo.org/changelog/"),r=a("General_PiwikXIsAvailablePleaseNotifyPiwikAdmin","".concat(t," ").concat(n).concat(this.latestVersionAvailable,""),''),"");return"".concat(r,"
")}}});Dm.render=Em;var Pm=Dm;function Tm(e,t){return Bm(e)||xm(e,t)||Nm(e,t)||Vm()}function Vm(){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 Nm(e,t){if(e){if("string"===typeof e)return Im(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)?Im(e,t):void 0}}function Im(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n {
['en', 5, 0, 0, '5'],
['en', -5, 0, 3, '-5'],
['en', 5.299, 0, 0, '5'],
- ['en', 5.299, 3, 0, '5.299'],
+ ['en', 5.2992, 3, 0, '5.299'],
+ ['en', 5.6666666666667, 1, 0, '5.7'],
+ ['en', 5.07, 1, 0, '5.1'],
['en', -50, 3, 3, '-50.000'],
['en', 5000, 0, 0, '5,000'],
['en', 5000000, 0, 0, '5,000,000'],
@@ -120,7 +122,7 @@ describe('CoreHome/NumberFormatter', () => {
['en', 5, 0, 0, '5%'],
['en', -5, 0, 3, '-5%'],
['en', 5.299, 0, 0, '5%'],
- ['en', 5.299, 3, 0, '5.299%'],
+ ['en', 5.2992, 3, 0, '5.299%'],
['en', -50, 3, 3, '-50.000%'],
['en', -50, 1, 1, '-50.0%'],
['en', -50.1, 3, 3, '-50.100%'],
@@ -156,7 +158,7 @@ describe('CoreHome/NumberFormatter', () => {
['en', 5, '$', 0, 0, '$5'],
['en', -5, '$', 0, 3, '-$5'],
['en', 5.299, '$', 0, 0, '$5'],
- ['en', 5.299, '$', 3, 0, '$5.299'],
+ ['en', 5.2992, '$', 3, 0, '$5.299'],
['en', -50, '$', 3, 3, '-$50.000'],
['en', -50, '$', 1, 1, '-$50.0'],
['en', -50.1, '$', 3, 3, '-$50.100'],
@@ -223,4 +225,29 @@ describe('CoreHome/NumberFormatter', () => {
})
});
+ const calculateAndFormatEvolutionTestData: Array> = [
+ // we test only english, as other formats are already covered by formatEvolution tests
+ ['en', 2, 1, false, '+100%'],
+ ['en', 25, 100, false, '-75%'],
+ ['en', 1, 3, false, '-66.7%'],
+ ['en', 1, 3, true, '66.7%'],
+ ['en', 10001, 9883, false, '+1.19%'],
+ ['en', 100001, 100000, false, '+0.001%'],
+ ['en', 100001, 100000, true, '0.001%'],
+ ['en', 10000001, 10000000, false, '+0%'],
+ ];
+
+ calculateAndFormatEvolutionTestData.forEach((testdata) => {
+ const [ lang, input1, input2, noSign, expected ] = testdata;
+
+ it(`should correctly format evolution with (${lang}, ${input1}, ${input2}, ${noSign})`, () => {
+
+ window.piwik.numbers = formats[lang];
+
+ const result = NumberFormatter.calculateAndFormatEvolution(input1 as number, input2 as number, noSign);
+
+ expect(result).toEqual(expected);
+ })
+ });
+
});
diff --git a/plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts b/plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts
index 9e180b0ae65..c08689abbeb 100644
--- a/plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts
+++ b/plugins/CoreHome/vue/src/NumberFormatter/NumberFormatter.ts
@@ -208,10 +208,49 @@ class NumberFormatter {
evolution: string|number,
maxFractionDigits?: number,
minFractionDigits?: number,
+ noSign?: boolean,
): string {
+ if (noSign) {
+ return this.formatPercent(
+ Math.abs(evolution as number),
+ maxFractionDigits,
+ minFractionDigits,
+ );
+ }
const formattedEvolution = this.formatPercent(evolution, maxFractionDigits, minFractionDigits);
return `${evolution as number > 0 ? Matomo.numbers.symbolPlus : ''}${formattedEvolution}`;
}
+
+ public calculateAndFormatEvolution(
+ currentValue: string|number,
+ pastValue: string|number,
+ noSign?: boolean,
+ ) {
+ const pastValueParsed = parseInt(pastValue as string, 10);
+ const currentValueParsed = parseInt(currentValue as string, 10) - pastValueParsed;
+
+ let evolution: number;
+
+ if (currentValueParsed === 0 || Number.isNaN(currentValueParsed)) {
+ evolution = 0;
+ } else if (pastValueParsed === 0 || Number.isNaN(pastValueParsed)) {
+ evolution = 100;
+ } else {
+ evolution = (currentValueParsed / pastValueParsed) * 100;
+ }
+
+ let maxFractionDigits = 3;
+
+ if (Math.abs(evolution) > 100) {
+ maxFractionDigits = 0;
+ } else if (Math.abs(evolution) > 10) {
+ maxFractionDigits = 1;
+ } else if (Math.abs(evolution) > 1) {
+ maxFractionDigits = 2;
+ }
+
+ return this.formatEvolution(evolution, maxFractionDigits, 0, noSign);
+ }
}
export default new NumberFormatter();
diff --git a/plugins/CoreHome/vue/src/NumberFormatter/utilities.ts b/plugins/CoreHome/vue/src/NumberFormatter/utilities.ts
index 9e59d54ee45..83ff5a3e732 100644
--- a/plugins/CoreHome/vue/src/NumberFormatter/utilities.ts
+++ b/plugins/CoreHome/vue/src/NumberFormatter/utilities.ts
@@ -8,7 +8,7 @@
import NumberFormatter from './NumberFormatter';
export function formatNumber(
- val: string,
+ val: string|number,
maxFractionDigits?: number,
minFractionDigits?: number,
): string {
@@ -16,7 +16,7 @@ export function formatNumber(
}
export function formatPercent(
- val: string,
+ val: string|number,
maxFractionDigits?: number,
minFractionDigits?: number,
): string {
@@ -24,10 +24,27 @@ export function formatPercent(
}
export function formatCurrency(
- val: string,
+ val: string|number,
cur: string,
maxFractionDigits?: number,
minFractionDigits?: number,
): string {
return NumberFormatter.formatCurrency(val, cur, maxFractionDigits, minFractionDigits);
}
+
+export function formatEvolution(
+ val: string|number,
+ maxFractionDigits?: number,
+ minFractionDigits?: number,
+ noSign?: boolean,
+): string {
+ return NumberFormatter.formatEvolution(val, maxFractionDigits, minFractionDigits, noSign);
+}
+
+export function calculateAndFormatEvolution(
+ valCur: string|number,
+ valPrev: string|number,
+ noSign?: boolean,
+): string {
+ return NumberFormatter.calculateAndFormatEvolution(valCur, valPrev, noSign);
+}
diff --git a/plugins/CoreHome/vue/src/createVueApp.ts b/plugins/CoreHome/vue/src/createVueApp.ts
index 57149b2eeb9..33c6b1353b9 100644
--- a/plugins/CoreHome/vue/src/createVueApp.ts
+++ b/plugins/CoreHome/vue/src/createVueApp.ts
@@ -8,7 +8,13 @@
import { createApp } from 'vue';
import { translate, translateOrDefault } from './translate';
import { externalLink, externalRawLink } from './externalLink';
-import { formatNumber, formatPercent, formatCurrency } from './NumberFormatter';
+import {
+ formatNumber,
+ formatPercent,
+ formatCurrency,
+ formatEvolution,
+ calculateAndFormatEvolution,
+} from './NumberFormatter';
export default function createVueApp(
...args: Parameters
@@ -22,5 +28,7 @@ export default function createVueApp(
app.config.globalProperties.formatNumber = formatNumber;
app.config.globalProperties.formatPercent = formatPercent;
app.config.globalProperties.formatCurrency = formatCurrency;
+ app.config.globalProperties.formatEvolution = formatEvolution;
+ app.config.globalProperties.calculateAndFormatEvolution = calculateAndFormatEvolution;
return app;
}
diff --git a/plugins/CoreHome/vue/src/getFormattedEvolution.ts b/plugins/CoreHome/vue/src/getFormattedEvolution.ts
deleted file mode 100644
index a56704e8a04..00000000000
--- a/plugins/CoreHome/vue/src/getFormattedEvolution.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*!
- * Matomo - free/libre analytics platform
- *
- * @link https://matomo.org
- * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-
-import { NumberFormatter } from './NumberFormatter';
-
-function calculateEvolution(currentValue: string|number, pastValue: string|number) {
- const pastValueParsed = parseInt(pastValue as string, 10);
- const currentValueParsed = parseInt(currentValue as string, 10) - pastValueParsed;
-
- let evolution: number;
-
- if (currentValueParsed === 0 || Number.isNaN(currentValueParsed)) {
- evolution = 0;
- } else if (pastValueParsed === 0 || Number.isNaN(pastValueParsed)) {
- evolution = 100;
- } else {
- evolution = (currentValueParsed / pastValueParsed) * 100;
- }
-
- return evolution;
-}
-
-export default function getFormattedEvolution(
- currentValue: string|number,
- pastValue: string|number,
-): string {
- const evolution = calculateEvolution(currentValue, pastValue);
- return NumberFormatter.formatEvolution(evolution);
-}
diff --git a/plugins/CoreHome/vue/src/index.ts b/plugins/CoreHome/vue/src/index.ts
index a5eac2728da..8dac3de91ae 100644
--- a/plugins/CoreHome/vue/src/index.ts
+++ b/plugins/CoreHome/vue/src/index.ts
@@ -22,7 +22,6 @@ export { default as importPluginUmd } from './importPluginUmd';
export { default as useExternalPluginComponent } from './useExternalPluginComponent';
export { default as DirectiveUtilities } from './directiveUtilities';
export { default as debounce } from './debounce';
-export { default as getFormattedEvolution } from './getFormattedEvolution';
export { default as clone } from './clone';
export { default as VueEntryContainer } from './VueEntryContainer/VueEntryContainer.vue';
export { default as ActivityIndicator } from './ActivityIndicator/ActivityIndicator.vue';
diff --git a/plugins/CoreVue/types/index.d.ts b/plugins/CoreVue/types/index.d.ts
index 9753611aabd..6db619e6124 100644
--- a/plugins/CoreVue/types/index.d.ts
+++ b/plugins/CoreVue/types/index.d.ts
@@ -276,5 +276,7 @@ declare module '@vue/runtime-core' {
formatNumber: (val: string, maxFractionDigits?: number, minFractionDigits?: number) => string;
formatPercent: (val: string, maxFractionDigits?: number, minFractionDigits?: number) => string;
formatCurrency: (val: string, cur: string, maxFractionDigits?: number, minFractionDigits?: number) => string;
+ formatEvolution: (val: string, cur: string, maxFractionDigits?: number, minFractionDigits?: number, noSign?: boolean) => string;
+ calculateAndFormatEvolution: (valCur: string, valPast: string, noSign?: boolean) => string;
}
}
diff --git a/plugins/MultiSites/vue/dist/MultiSites.umd.js b/plugins/MultiSites/vue/dist/MultiSites.umd.js
index be71683a7d9..32e4dd1c352 100644
--- a/plugins/MultiSites/vue/dist/MultiSites.umd.js
+++ b/plugins/MultiSites/vue/dist/MultiSites.umd.js
@@ -1483,8 +1483,6 @@ function Dashboard_store_defineProperty(obj, key, value) { if (key in obj) { Obj
*/
-var _window = window,
- NumberFormatter = _window.NumberFormatter;
var Dashboard_store_DashboardStore = /*#__PURE__*/function () {
function DashboardStore() {
@@ -1570,7 +1568,7 @@ var Dashboard_store_DashboardStore = /*#__PURE__*/function () {
var allSites = report.sites;
allSites.forEach(function (site) {
if (site.ratio !== 1 && site.ratio !== '1') {
- var percent = NumberFormatter.formatPercent(Math.round(parseInt(site.ratio, 10) * 100));
+ var percent = external_CoreHome_["NumberFormatter"].formatPercent(Math.round(parseInt(site.ratio, 10) * 100));
var metricName = null;
var previousTotal = '0';
var currentTotal = '0';
@@ -1578,35 +1576,35 @@ var Dashboard_store_DashboardStore = /*#__PURE__*/function () {
var previousTotalAdjusted = '0';
if (_this2.state.value.sortColumn === 'nb_visits' || _this2.state.value.sortColumn === 'visits_evolution') {
- previousTotal = NumberFormatter.formatNumber(site.previous_nb_visits);
- currentTotal = NumberFormatter.formatNumber(site.nb_visits);
- evolution = NumberFormatter.formatPercent(site.visits_evolution);
+ previousTotal = external_CoreHome_["NumberFormatter"].formatNumber(site.previous_nb_visits);
+ currentTotal = external_CoreHome_["NumberFormatter"].formatNumber(site.nb_visits);
+ evolution = external_CoreHome_["NumberFormatter"].formatPercent(site.visits_evolution);
metricName = Object(external_CoreHome_["translate"])('General_ColumnNbVisits');
- previousTotalAdjusted = NumberFormatter.formatNumber(Math.round(parseInt(site.previous_nb_visits, 10) * parseInt(site.ratio, 10)));
+ previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatNumber(Math.round(parseInt(site.previous_nb_visits, 10) * parseInt(site.ratio, 10)));
}
if (_this2.state.value.sortColumn === 'pageviews_evolution') {
previousTotal = "".concat(site.previous_Actions_nb_pageviews);
currentTotal = "".concat(site.nb_pageviews);
- evolution = NumberFormatter.formatPercent(site.pageviews_evolution);
+ evolution = external_CoreHome_["NumberFormatter"].formatPercent(site.pageviews_evolution);
metricName = Object(external_CoreHome_["translate"])('General_ColumnPageviews');
- previousTotalAdjusted = NumberFormatter.formatNumber(Math.round(parseInt(site.previous_Actions_nb_pageviews, 10) * parseInt(site.ratio, 10)));
+ previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatNumber(Math.round(parseInt(site.previous_Actions_nb_pageviews, 10) * parseInt(site.ratio, 10)));
}
if (_this2.state.value.sortColumn === 'hits_evolution') {
previousTotal = "".concat(site.previous_Actions_hits);
currentTotal = "".concat(site.hits);
- evolution = NumberFormatter.formatPercent(site.hits_evolution);
+ evolution = external_CoreHome_["NumberFormatter"].formatPercent(site.hits_evolution);
metricName = Object(external_CoreHome_["translate"])('General_ColumnHits');
- previousTotalAdjusted = NumberFormatter.formatNumber(Math.round(parseInt(site.previous_Actions_hits, 10) * parseInt(site.ratio, 10)));
+ previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatNumber(Math.round(parseInt(site.previous_Actions_hits, 10) * parseInt(site.ratio, 10)));
}
if (_this2.state.value.sortColumn === 'revenue_evolution') {
- previousTotal = NumberFormatter.formatCurrency(site.previous_Goal_revenue, site.currencySymbol);
- currentTotal = NumberFormatter.formatCurrency(site.revenue, site.currencySymbol);
- evolution = NumberFormatter.formatPercent(site.revenue_evolution);
+ previousTotal = external_CoreHome_["NumberFormatter"].formatCurrency(site.previous_Goal_revenue, site.currencySymbol);
+ currentTotal = external_CoreHome_["NumberFormatter"].formatCurrency(site.revenue, site.currencySymbol);
+ evolution = external_CoreHome_["NumberFormatter"].formatPercent(site.revenue_evolution);
metricName = Object(external_CoreHome_["translate"])('General_ColumnRevenue');
- previousTotalAdjusted = NumberFormatter.formatCurrency(Math.round(parseInt(site.previous_Goal_revenue, 10) * parseInt(site.ratio, 10)), site.currencySymbol);
+ previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatCurrency(Math.round(parseInt(site.previous_Goal_revenue, 10) * parseInt(site.ratio, 10)), site.currencySymbol);
}
if (metricName) {
@@ -1753,88 +1751,88 @@ var Dashboard_store_DashboardStore = /*#__PURE__*/function () {
}();
/* harmony default export */ var Dashboard_store = (new Dashboard_store_DashboardStore());
-// 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/MultiSites/vue/src/Dashboard/Dashboard.vue?vue&type=template&id=58e42cc2
+// 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/MultiSites/vue/src/Dashboard/Dashboard.vue?vue&type=template&id=8fff7c04
-var Dashboardvue_type_template_id_58e42cc2_hoisted_1 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_1 = {
ref: "root"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_2 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_2 = {
class: "card-title"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_3 = ["innerHTML", "title"];
-var Dashboardvue_type_template_id_58e42cc2_hoisted_4 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_3 = ["innerHTML", "title"];
+var Dashboardvue_type_template_id_8fff7c04_hoisted_4 = {
id: "mt",
class: "dataTable card-table",
cellspacing: "0"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_5 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_5 = {
class: "heading"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_6 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_6 = {
class: "heading"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_7 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_7 = {
class: "heading"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_8 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_8 = {
class: "heading"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_9 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_9 = {
class: "heading"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_10 = ["colspan"];
-var Dashboardvue_type_template_id_58e42cc2_hoisted_11 = ["value"];
-var Dashboardvue_type_template_id_58e42cc2_hoisted_12 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_10 = ["colspan"];
+var Dashboardvue_type_template_id_8fff7c04_hoisted_11 = ["value"];
+var Dashboardvue_type_template_id_8fff7c04_hoisted_12 = {
value: "visits_evolution"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_13 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_13 = {
value: "pageviews_evolution"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_14 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_14 = {
value: "hits_evolution"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_15 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_15 = {
key: 0,
value: "revenue_evolution"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_16 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_16 = {
key: 0
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_17 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_17 = {
colspan: "7",
class: "allWebsitesLoading"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_18 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_18 = {
key: 1
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_19 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_19 = {
key: 0
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_20 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_20 = {
colspan: "7"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_21 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_21 = {
class: "notification system notification-error"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_22 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+var Dashboardvue_type_template_id_8fff7c04_hoisted_22 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
-var Dashboardvue_type_template_id_58e42cc2_hoisted_23 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
+var Dashboardvue_type_template_id_8fff7c04_hoisted_23 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1);
-var Dashboardvue_type_template_id_58e42cc2_hoisted_24 = ["href"];
+var Dashboardvue_type_template_id_8fff7c04_hoisted_24 = ["href"];
-var Dashboardvue_type_template_id_58e42cc2_hoisted_25 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" – ");
+var Dashboardvue_type_template_id_8fff7c04_hoisted_25 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" – ");
-var Dashboardvue_type_template_id_58e42cc2_hoisted_26 = ["href"];
-var Dashboardvue_type_template_id_58e42cc2_hoisted_27 = ["href"];
+var Dashboardvue_type_template_id_8fff7c04_hoisted_26 = ["href"];
+var Dashboardvue_type_template_id_8fff7c04_hoisted_27 = ["href"];
-var Dashboardvue_type_template_id_58e42cc2_hoisted_28 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(". ");
+var Dashboardvue_type_template_id_8fff7c04_hoisted_28 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(". ");
-var Dashboardvue_type_template_id_58e42cc2_hoisted_29 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_29 = {
colspan: "8",
class: "paging"
};
-var Dashboardvue_type_template_id_58e42cc2_hoisted_30 = {
+var Dashboardvue_type_template_id_8fff7c04_hoisted_30 = {
class: "row"
};
var _hoisted_31 = {
@@ -1886,7 +1884,7 @@ var _hoisted_43 = {
};
var _hoisted_44 = ["placeholder"];
var _hoisted_45 = ["title"];
-function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $setup, $data, $options) {
+function Dashboardvue_type_template_id_8fff7c04_render(_ctx, _cache, $props, $setup, $data, $options) {
var _this = this;
var _component_EnrichedHeadline = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("EnrichedHeadline");
@@ -1895,7 +1893,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
var _component_MultisitesSite = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MultisitesSite");
- return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Dashboardvue_type_template_id_58e42cc2_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", Dashboardvue_type_template_id_58e42cc2_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Dashboardvue_type_template_id_8fff7c04_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", Dashboardvue_type_template_id_8fff7c04_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_EnrichedHeadline, {
"help-url": _ctx.externalRawLink('https://matomo.org/faq/new-to-piwik/all-websites-dashboard/'),
"feature-name": _ctx.translate('General_AllWebsitesDashboard')
}, {
@@ -1904,10 +1902,10 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
class: "smallTitle",
innerHTML: _ctx.$sanitize(_this.smallTitleContent),
title: _ctx.smallTitleTooltip
- }, null, 8, Dashboardvue_type_template_id_58e42cc2_hoisted_3)];
+ }, null, 8, Dashboardvue_type_template_id_8fff7c04_hoisted_3)];
}),
_: 1
- }, 8, ["help-url", "feature-name"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", Dashboardvue_type_template_id_58e42cc2_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
+ }, 8, ["help-url", "feature-name"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", Dashboardvue_type_template_id_8fff7c04_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
id: "names",
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["label", {
columnSorted: 'label' === _ctx.sortColumn
@@ -1915,7 +1913,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
onClick: _cache[0] || (_cache[0] = function ($event) {
return _ctx.sortBy('label');
})
- }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_58e42cc2_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Website')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_8fff7c04_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Website')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["arrow", {
multisites_asc: !_ctx.reverse && 'label' === _ctx.sortColumn,
multisites_desc: _ctx.reverse && 'label' === _ctx.sortColumn
@@ -1939,7 +1937,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
style: {
"margin-right": "3.5px"
}
- }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_58e42cc2_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnNbVisits')), 1)], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
+ }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_8fff7c04_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnNbVisits')), 1)], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
id: "pageviews",
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["multisites-column", {
columnSorted: 'nb_pageviews' === _ctx.sortColumn
@@ -1955,7 +1953,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
style: {
"margin-right": "3.5px"
}
- }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_58e42cc2_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnPageviews')), 1)], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
+ }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_8fff7c04_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnPageviews')), 1)], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
id: "hits",
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["multisites-column", {
columnSorted: 'hits' === _ctx.sortColumn
@@ -1971,7 +1969,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
style: {
"margin-right": "3.5px"
}
- }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_58e42cc2_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnHits')), 1)], 2), _ctx.displayRevenueColumn ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("th", {
+ }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_8fff7c04_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnHits')), 1)], 2), _ctx.displayRevenueColumn ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("th", {
key: 0,
id: "revenue",
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["multisites-column", {
@@ -1988,7 +1986,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
style: {
"margin-right": "3.5px"
}
- }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_58e42cc2_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnRevenue')), 1)], 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
+ }, null, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", Dashboardvue_type_template_id_8fff7c04_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnRevenue')), 1)], 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
id: "evolution",
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({
columnSorted: _ctx.evolutionSelector === _ctx.sortColumn
@@ -2019,22 +2017,22 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
_ctx.sortBy(_ctx.evolutionSelector);
})
- }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", Dashboardvue_type_template_id_58e42cc2_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnNbVisits')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", Dashboardvue_type_template_id_58e42cc2_hoisted_13, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnPageviews')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", Dashboardvue_type_template_id_58e42cc2_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnHits')), 1), _ctx.displayRevenueColumn ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("option", Dashboardvue_type_template_id_58e42cc2_hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnRevenue')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 40, Dashboardvue_type_template_id_58e42cc2_hoisted_11)], 10, Dashboardvue_type_template_id_58e42cc2_hoisted_10)])]), _ctx.isLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tbody", Dashboardvue_type_template_id_58e42cc2_hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", Dashboardvue_type_template_id_58e42cc2_hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, {
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", Dashboardvue_type_template_id_8fff7c04_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnNbVisits')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", Dashboardvue_type_template_id_8fff7c04_hoisted_13, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnPageviews')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", Dashboardvue_type_template_id_8fff7c04_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnHits')), 1), _ctx.displayRevenueColumn ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("option", Dashboardvue_type_template_id_8fff7c04_hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnRevenue')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 40, Dashboardvue_type_template_id_8fff7c04_hoisted_11)], 10, Dashboardvue_type_template_id_8fff7c04_hoisted_10)])]), _ctx.isLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tbody", Dashboardvue_type_template_id_8fff7c04_hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", Dashboardvue_type_template_id_8fff7c04_hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ActivityIndicator, {
"loading-message": _ctx.loadingMessage,
loading: _ctx.isLoading
- }, null, 8, ["loading-message", "loading"])])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tbody", Dashboardvue_type_template_id_58e42cc2_hoisted_18, [_ctx.errorLoadingSites ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", Dashboardvue_type_template_id_58e42cc2_hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", Dashboardvue_type_template_id_58e42cc2_hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Dashboardvue_type_template_id_58e42cc2_hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRequest', '', '')) + " ", 1), Dashboardvue_type_template_id_58e42cc2_hoisted_22, Dashboardvue_type_template_id_58e42cc2_hoisted_23, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_NeedMoreHelp')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ }, null, 8, ["loading-message", "loading"])])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tbody", Dashboardvue_type_template_id_8fff7c04_hoisted_18, [_ctx.errorLoadingSites ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", Dashboardvue_type_template_id_8fff7c04_hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", Dashboardvue_type_template_id_8fff7c04_hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Dashboardvue_type_template_id_8fff7c04_hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRequest', '', '')) + " ", 1), Dashboardvue_type_template_id_8fff7c04_hoisted_22, Dashboardvue_type_template_id_8fff7c04_hoisted_23, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_NeedMoreHelp')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
rel: "noreferrer noopener",
target: "_blank",
href: _ctx.externalRawLink('https://matomo.org/faq/troubleshooting/faq_19489/')
- }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Faq')), 9, Dashboardvue_type_template_id_58e42cc2_hoisted_24), Dashboardvue_type_template_id_58e42cc2_hoisted_25, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Faq')), 9, Dashboardvue_type_template_id_8fff7c04_hoisted_24), Dashboardvue_type_template_id_8fff7c04_hoisted_25, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
rel: "noreferrer noopener",
target: "_blank",
href: _ctx.externalRawLink('https://forum.matomo.org/')
- }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Feedback_CommunityHelp')), 9, Dashboardvue_type_template_id_58e42cc2_hoisted_26), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, " – ", 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.areAdsForProfessionalServicesEnabled]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Feedback_CommunityHelp')), 9, Dashboardvue_type_template_id_8fff7c04_hoisted_26), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, " – ", 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.areAdsForProfessionalServicesEnabled]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
rel: "noreferrer noopener",
target: "_blank",
href: _ctx.professionalHelpUrl
- }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Feedback_ProfessionalHelp')), 9, Dashboardvue_type_template_id_58e42cc2_hoisted_27), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.areAdsForProfessionalServicesEnabled]]), Dashboardvue_type_template_id_58e42cc2_hoisted_28])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), (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.sites, function (website) {
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Feedback_ProfessionalHelp')), 9, Dashboardvue_type_template_id_8fff7c04_hoisted_27), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.areAdsForProfessionalServicesEnabled]]), Dashboardvue_type_template_id_8fff7c04_hoisted_28])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), (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.sites, function (website) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_MultisitesSite, {
key: website.idsite,
website: website,
@@ -2044,7 +2042,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
metric: _ctx.sortColumn,
"display-revenue-column": _ctx.displayRevenueColumn
}, null, 8, ["website", "evolution-metric", "date-sparkline", "show-sparklines", "metric", "display-revenue-column"]);
- }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tfoot", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", Dashboardvue_type_template_id_58e42cc2_hoisted_29, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Dashboardvue_type_template_id_58e42cc2_hoisted_30, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_31, [_ctx.hasSuperUserAccess ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", {
+ }), 128))])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tfoot", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", Dashboardvue_type_template_id_8fff7c04_hoisted_29, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Dashboardvue_type_template_id_8fff7c04_hoisted_30, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_31, [_ctx.hasSuperUserAccess ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", {
key: 0,
href: _ctx.addSiteUrl
}, [_hoisted_33, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('SitesManager_AddSite')), 1)], 8, _hoisted_32)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_34, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
@@ -2076,7 +2074,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
title: _ctx.translate('General_ClickToSearch')
}, null, 8, _hoisted_45)])])])])])])], 512);
}
-// CONCATENATED MODULE: ./plugins/MultiSites/vue/src/Dashboard/Dashboard.vue?vue&type=template&id=58e42cc2
+// CONCATENATED MODULE: ./plugins/MultiSites/vue/src/Dashboard/Dashboard.vue?vue&type=template&id=8fff7c04
// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./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/MultiSites/vue/src/Dashboard/Dashboard.vue?vue&type=script&lang=ts
@@ -2158,7 +2156,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
},
smallTitleTooltip: function smallTitleTooltip() {
var state = Dashboard_store.state.value;
- return Object(external_CoreHome_["translate"])('General_EvolutionSummaryGeneric', Object(external_CoreHome_["translate"])('General_NVisits', "".concat(state.totalVisits)), this.date, "".concat(state.lastVisits), state.lastVisitsDate, Object(external_CoreHome_["getFormattedEvolution"])(state.totalVisits, state.lastVisits));
+ return Object(external_CoreHome_["translate"])('General_EvolutionSummaryGeneric', Object(external_CoreHome_["translate"])('General_NVisits', "".concat(state.totalVisits)), this.date, "".concat(state.lastVisits), state.lastVisitsDate, Object(external_CoreHome_["calculateAndFormatEvolution"])(state.totalVisits, state.lastVisits));
},
loadingMessage: function loadingMessage() {
return Dashboard_store.state.value.loadingMessage;
@@ -2201,7 +2199,7 @@ function Dashboardvue_type_template_id_58e42cc2_render(_ctx, _cache, $props, $se
-Dashboardvue_type_script_lang_ts.render = Dashboardvue_type_template_id_58e42cc2_render
+Dashboardvue_type_script_lang_ts.render = Dashboardvue_type_template_id_8fff7c04_render
/* harmony default export */ var Dashboard = (Dashboardvue_type_script_lang_ts);
// CONCATENATED MODULE: ./plugins/MultiSites/vue/src/index.ts
diff --git a/plugins/MultiSites/vue/dist/MultiSites.umd.min.js b/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
index 29e25a7e8b4..fe7133712fa 100644
--- a/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
+++ b/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
@@ -1,16 +1,16 @@
-(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["MultiSites"]=t(require("CoreHome"),require("vue")):e["MultiSites"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/MultiSites/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"AllWebsitesDashboard",(function(){return De})),n.d(t,"MultisitesSite",(function(){return bt})),n.d(t,"DashboadStore",(function(){return St})),n.d(t,"Dashboard",(function(){return hn})),"undefined"!==typeof window){var r=window.document.currentScript,a=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}var o=n("8bbf"),i={class:"dashboardHeader"},s={class:"card-title"},l={class:"dashboardControls"},c={class:"siteSearch"},u=["placeholder"],d=["title"],p=["href"];function b(e,t,n,r,a,b){var v=Object(o["resolveComponent"])("EnrichedHeadline"),m=Object(o["resolveComponent"])("KPICardContainer"),h=Object(o["resolveComponent"])("SitesTable");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",i,[Object(o["createElementVNode"])("h1",s,[Object(o["createVNode"])(v,{"feature-name":e.translate("MultiSites_AllWebsitesDashboardTitle")},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("MultiSites_AllWebsitesDashboardTitle")),1)]})),_:1},8,["feature-name"])])]),Object(o["createVNode"])(m,{"is-loading":e.isLoadingKPIs,"model-value":e.kpis},null,8,["is-loading","model-value"]),Object(o["createElementVNode"])("div",l,[Object(o["createElementVNode"])("div",c,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",onKeydown:t[0]||(t[0]=Object(o["withKeys"])((function(t){return e.searchSite(e.searchTerm)}),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),placeholder:e.translate("Actions_SubmenuSitesearch")},null,40,u),[[o["vModelText"],e.searchTerm]]),Object(o["createElementVNode"])("span",{class:"icon-search",onClick:t[2]||(t[2]=function(t){return e.searchSite(e.searchTerm)}),title:e.translate("General_ClickToSearch")},null,8,d)]),!e.isWidgetized&&e.isUserAllowedToAddSite?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,class:"btn",href:e.addSiteUrl},Object(o["toDisplayString"])(e.translate("SitesManager_AddSite")),9,p)):Object(o["createCommentVNode"])("",!0)]),Object(o["createVNode"])(h,{"display-revenue":e.displayRevenue,"display-sparklines":e.displaySparklines},null,8,["display-revenue","display-sparklines"])],64)}var v=n("19dc");function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelAutoRefresh()),this.fetchAbort=new AbortController,this.privateState.errorLoading=!1,this.privateState.isLoadingKPIs=!t,this.privateState.isLoadingSites=!0;var n={method:"MultiSites.mockDashboardData",filter_limit:this.pageSize,filter_offset:this.currentPagingOffset.value,filter_sort_column:this.privateState.sortColumn,filter_sort_order:this.privateState.sortOrder,showColumns:["hits_evolution","hits_evolution_trend","label","hits","nb_pageviews","nb_visits","pageviews_evolution","pageviews_evolution_trend","revenue","revenue_evolution","revenue_evolution_trend","visits_evolution","visits_evolution_trend"].join(",")};return this.searchTerm&&(n.pattern=this.searchTerm),v["AjaxHelper"].fetch(n,{abortController:this.fetchAbort}).then((function(n){t||e.updateDashboardKPIs(n),e.updateDashboardSites(n)})).catch((function(){e.privateState.dashboardSites=[],e.privateState.errorLoading=!0})).finally((function(){e.privateState.isLoadingKPIs=!1,e.privateState.isLoadingSites=!1,e.fetchAbort=null,e.startAutoRefresh()}))}},{key:"startAutoRefresh",value:function(){var e=this;if(this.cancelAutoRefresh(),!(this.autoRefreshInterval<=0)){var t;try{t=v["Periods"].parse(v["Matomo"].period,v["Matomo"].currentDateString)}catch(n){}t&&t.containsToday()&&(this.autoRefreshTimeout=setTimeout((function(){e.autoRefreshTimeout=null,e.refreshData()}),1e3*this.autoRefreshInterval))}}},{key:"updateDashboardKPIs",value:function(e){this.privateState.dashboardKPIs={evolutionPeriod:v["Matomo"].period,hits:e.totals.hits,hitsEvolution:e.totals.hits_evolution,hitsTrend:e.totals.hits_evolution_trend,pageviews:e.totals.nb_pageviews,pageviewsEvolution:e.totals.pageviews_evolution,pageviewsTrend:e.totals.pageviews_evolution_trend,revenue:e.totals.revenue,revenueEvolution:e.totals.revenue_evolution,revenueTrend:e.totals.revenue_evolution_trend,visits:e.totals.nb_visits,visitsEvolution:e.totals.visits_evolution,visitsTrend:e.totals.visits_evolution_trend}}},{key:"updateDashboardSites",value:function(e){this.privateState.dashboardSites=e.sites,this.privateState.numSites=e.numSites,this.privateState.sparklineDate=e.sparklineDate}}]),e}(),k=new S,y={class:"kpiCardContainer"},_={key:0,class:"kpiCard kpiCardLoading"},C=Object(o["createElementVNode"])("div",{class:"kpiCardTitle"}," ",-1),E={class:"kpiCardValue"},V=Object(o["createElementVNode"])("div",{class:"kpiCardEvolution"},[Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ")],-1),N={key:0,class:"kpiCardBadge"};function w(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("KPICard");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",y,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",_,[C,Object(o["createElementVNode"])("div",E,[Object(o["createVNode"])(s)]),V,e.hasKpiBadge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",N," ")):Object(o["createCommentVNode"])("",!0)])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:1},Object(o["renderList"])(e.kpis,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:"kpi-card-".concat(n)},[n>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,class:Object(o["normalizeClass"])({kpiCardDivider:!0,kpiCardDividerBadge:e.hasKpiBadge})}," ",2)):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(l,{"model-value":t},null,8,["model-value"])],64)})),128))])}var T={class:"kpiCard"},B={class:"kpiCardTitle"},P={class:"kpiCardValue"},M={class:"kpiCardEvolution"},D={key:1,class:"kpiCardEvolution"},x=Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ",-1),L=[x],G=["innerHTML"];function R(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",T,[Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardIcon ".concat(e.kpi.icon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.kpi.title)),1)]),Object(o["createElementVNode"])("div",P,Object(o["toDisplayString"])(e.kpi.value),1),Object(o["createElementVNode"])("div",M,[""!==e.kpi.evolutionValue?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionTrend ".concat(e.evolutionTrendClass))},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionIcon ".concat(e.evolutionTrendIcon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.kpi.evolutionValue),1)],2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.evolutionTrendFrom)),1)],64)):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",D,L))]),e.kpi.badge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.kpi.badge),class:"kpiCardBadge"},null,8,G)):Object(o["createCommentVNode"])("",!0)])}var A=Object(o["defineComponent"])({props:{modelValue:{type:Object,required:!0}},computed:{evolutionTrendFrom:function(){switch(this.kpi.evolutionPeriod){case"day":return"MultiSites_EvolutionFromPreviousDay";case"week":return"MultiSites_EvolutionFromPreviousWeek";case"month":return"MultiSites_EvolutionFromPreviousMonth";case"year":return"MultiSites_EvolutionFromPreviousYear";default:return"MultiSites_EvolutionFromPreviousPeriod"}},evolutionTrendClass:function(){return 1===this.kpi.evolutionTrend?"kpiTrendPositive":-1===this.kpi.evolutionTrend?"kpiTrendNegative":"kpiTrendNeutral"},evolutionTrendIcon:function(){return 1===this.kpi.evolutionTrend?"icon-chevron-up":-1===this.kpi.evolutionTrend?"icon-chevron-down":"icon-circle"},kpi:function(){return this.modelValue}}});A.render=R;var I=A,z=Object(o["defineComponent"])({components:{MatomoLoader:v["MatomoLoader"],KPICard:I},props:{isLoading:Boolean,modelValue:{type:Array,required:!0}},computed:{hasKpiBadge:function(){return this.kpis.some((function(e){return!!e.badge}))},kpis:function(){return this.modelValue}}});z.render=w;var U=z,H={class:"sitesTableContainer"},F={class:"card-table dataTable sitesTable"},q={class:"sitesTableEvolutionSelector"},K=["value"],W={value:"hits_evolution"},$={value:"visits_evolution"},J={value:"pageviews_evolution"},Y={key:0,value:"revenue_evolution"},Q={key:0},X={class:"sitesTableLoading",colspan:"7"},Z={key:1},ee={colspan:"7"},te={class:"notification system notification-error"},ne=Object(o["createElementVNode"])("br",null,null,-1),re=Object(o["createElementVNode"])("br",null,null,-1),ae=["href"],oe=Object(o["createTextVNode"])(" – "),ie=["href"],se=["href"],le=Object(o["createTextVNode"])(". "),ce={key:0,class:"sitesTablePagination"},ue={class:"dataTablePages"};function de(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("SitesTableSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",H,[Object(o["createElementVNode"])("table",F,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{onClick:t[0]||(t[0]=function(t){return e.sortBy("label")}),class:"label"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Website"))+" ",1),"label"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},["nb_visits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)]),Object(o["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},["nb_pageviews"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)]),Object(o["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},["hits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)]),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},["revenue"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)})},[e.sortColumn===e.evolutionSelector?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1)]),Object(o["createElementVNode"])("th",q,[Object(o["createElementVNode"])("select",{class:"browser-default",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){return e.changeEvolutionSelector(t.target.value)})},[Object(o["createElementVNode"])("option",W,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),Object(o["createElementVNode"])("option",$,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",J,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Y,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,K)])])]),Object(o["createElementVNode"])("tbody",null,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Q,[Object(o["createElementVNode"])("td",X,[Object(o["createVNode"])(s)])])):e.errorLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Z,[Object(o["createElementVNode"])("td",ee,[Object(o["createElementVNode"])("div",te,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),ne,re,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,ae),oe,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,ie),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.errorShowProfessionalHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/support-plans/")},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,se),[[o["vShow"],e.errorShowProfessionalHelp]]),le])])])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:2},Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"display-revenue":e.displayRevenue,"evolution-metric":e.evolutionMetric,key:"site-".concat(t.idsite),"model-value":t,"sparkline-date":e.sparklineDate,"sparkline-metric":e.sparklineMetric},null,8,["display-revenue","evolution-metric","model-value","sparkline-date","sparkline-metric"])})),128))])])]),!e.isLoading||e.paginationUpperBound>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ce,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.navigatePreviousPage()})}," « "+Object(o["toDisplayString"])(e.translate("General_Previous")),513),[[o["vShow"],0!==e.paginationCurrentPage]]),Object(o["createElementVNode"])("span",ue,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTableNext",onClick:t[8]||(t[8]=function(t){return e.navigateNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" » ",513),[[o["vShow"],e.paginationCurrentPage0&&void 0!==arguments[0]&&arguments[0];this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelAutoRefresh()),this.fetchAbort=new AbortController,this.privateState.errorLoading=!1,this.privateState.isLoadingKPIs=!t,this.privateState.isLoadingSites=!0;var n={method:"MultiSites.mockDashboardData",filter_limit:this.pageSize,filter_offset:this.currentPagingOffset.value,filter_sort_column:this.privateState.sortColumn,filter_sort_order:this.privateState.sortOrder,showColumns:["hits_evolution","hits_evolution_trend","label","hits","nb_pageviews","nb_visits","pageviews_evolution","pageviews_evolution_trend","revenue","revenue_evolution","revenue_evolution_trend","visits_evolution","visits_evolution_trend"].join(",")};return this.searchTerm&&(n.pattern=this.searchTerm),m["AjaxHelper"].fetch(n,{abortController:this.fetchAbort}).then((function(n){t||e.updateDashboardKPIs(n),e.updateDashboardSites(n)})).catch((function(){e.privateState.dashboardSites=[],e.privateState.errorLoading=!0})).finally((function(){e.privateState.isLoadingKPIs=!1,e.privateState.isLoadingSites=!1,e.fetchAbort=null,e.startAutoRefresh()}))}},{key:"startAutoRefresh",value:function(){var e=this;if(this.cancelAutoRefresh(),!(this.autoRefreshInterval<=0)){var t;try{t=m["Periods"].parse(m["Matomo"].period,m["Matomo"].currentDateString)}catch(n){}t&&t.containsToday()&&(this.autoRefreshTimeout=setTimeout((function(){e.autoRefreshTimeout=null,e.refreshData()}),1e3*this.autoRefreshInterval))}}},{key:"updateDashboardKPIs",value:function(e){this.privateState.dashboardKPIs={evolutionPeriod:m["Matomo"].period,hits:e.totals.hits,hitsEvolution:e.totals.hits_evolution,hitsTrend:e.totals.hits_evolution_trend,pageviews:e.totals.nb_pageviews,pageviewsEvolution:e.totals.pageviews_evolution,pageviewsTrend:e.totals.pageviews_evolution_trend,revenue:e.totals.revenue,revenueEvolution:e.totals.revenue_evolution,revenueTrend:e.totals.revenue_evolution_trend,visits:e.totals.nb_visits,visitsEvolution:e.totals.visits_evolution,visitsTrend:e.totals.visits_evolution_trend}}},{key:"updateDashboardSites",value:function(e){this.privateState.dashboardSites=e.sites,this.privateState.numSites=e.numSites,this.privateState.sparklineDate=e.sparklineDate}}]),e}(),k=new S,y={class:"kpiCardContainer"},_={key:0,class:"kpiCard kpiCardLoading"},C=Object(o["createElementVNode"])("div",{class:"kpiCardTitle"}," ",-1),E={class:"kpiCardValue"},N=Object(o["createElementVNode"])("div",{class:"kpiCardEvolution"},[Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ")],-1),V={key:0,class:"kpiCardBadge"};function w(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("KPICard");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",y,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",_,[C,Object(o["createElementVNode"])("div",E,[Object(o["createVNode"])(s)]),N,e.hasKpiBadge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",V," ")):Object(o["createCommentVNode"])("",!0)])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:1},Object(o["renderList"])(e.kpis,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:"kpi-card-".concat(n)},[n>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,class:Object(o["normalizeClass"])({kpiCardDivider:!0,kpiCardDividerBadge:e.hasKpiBadge})}," ",2)):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(l,{"model-value":t},null,8,["model-value"])],64)})),128))])}var T={class:"kpiCard"},B={class:"kpiCardTitle"},P={class:"kpiCardValue"},M={class:"kpiCardEvolution"},D={key:1,class:"kpiCardEvolution"},x=Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ",-1),L=[x],G=["innerHTML"];function A(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",T,[Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardIcon ".concat(e.kpi.icon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.kpi.title)),1)]),Object(o["createElementVNode"])("div",P,Object(o["toDisplayString"])(e.kpi.value),1),Object(o["createElementVNode"])("div",M,[""!==e.kpi.evolutionValue?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionTrend ".concat(e.evolutionTrendClass))},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionIcon ".concat(e.evolutionTrendIcon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.kpi.evolutionValue),1)],2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.evolutionTrendFrom)),1)],64)):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",D,L))]),e.kpi.badge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.kpi.badge),class:"kpiCardBadge"},null,8,G)):Object(o["createCommentVNode"])("",!0)])}var R=Object(o["defineComponent"])({props:{modelValue:{type:Object,required:!0}},computed:{evolutionTrendFrom:function(){switch(this.kpi.evolutionPeriod){case"day":return"MultiSites_EvolutionFromPreviousDay";case"week":return"MultiSites_EvolutionFromPreviousWeek";case"month":return"MultiSites_EvolutionFromPreviousMonth";case"year":return"MultiSites_EvolutionFromPreviousYear";default:return"MultiSites_EvolutionFromPreviousPeriod"}},evolutionTrendClass:function(){return 1===this.kpi.evolutionTrend?"kpiTrendPositive":-1===this.kpi.evolutionTrend?"kpiTrendNegative":"kpiTrendNeutral"},evolutionTrendIcon:function(){return 1===this.kpi.evolutionTrend?"icon-chevron-up":-1===this.kpi.evolutionTrend?"icon-chevron-down":"icon-circle"},kpi:function(){return this.modelValue}}});R.render=A;var I=R,z=Object(o["defineComponent"])({components:{MatomoLoader:m["MatomoLoader"],KPICard:I},props:{isLoading:Boolean,modelValue:{type:Array,required:!0}},computed:{hasKpiBadge:function(){return this.kpis.some((function(e){return!!e.badge}))},kpis:function(){return this.modelValue}}});z.render=w;var F=z,U={class:"sitesTableContainer"},H={class:"card-table dataTable sitesTable"},q={class:"sitesTableEvolutionSelector"},K=["value"],W={value:"hits_evolution"},$={value:"visits_evolution"},J={value:"pageviews_evolution"},Y={key:0,value:"revenue_evolution"},Q={key:0},X={class:"sitesTableLoading",colspan:"7"},Z={key:1},ee={colspan:"7"},te={class:"notification system notification-error"},ne=Object(o["createElementVNode"])("br",null,null,-1),re=Object(o["createElementVNode"])("br",null,null,-1),ae=["href"],oe=Object(o["createTextVNode"])(" – "),ie=["href"],se=["href"],le=Object(o["createTextVNode"])(". "),ce={key:0,class:"sitesTablePagination"},ue={class:"dataTablePages"};function de(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("SitesTableSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("table",H,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{onClick:t[0]||(t[0]=function(t){return e.sortBy("label")}),class:"label"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Website"))+" ",1),"label"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},["nb_visits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)]),Object(o["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},["nb_pageviews"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)]),Object(o["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},["hits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)]),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},["revenue"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)})},[e.sortColumn===e.evolutionSelector?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1)]),Object(o["createElementVNode"])("th",q,[Object(o["createElementVNode"])("select",{class:"browser-default",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){return e.changeEvolutionSelector(t.target.value)})},[Object(o["createElementVNode"])("option",W,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),Object(o["createElementVNode"])("option",$,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",J,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Y,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,K)])])]),Object(o["createElementVNode"])("tbody",null,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Q,[Object(o["createElementVNode"])("td",X,[Object(o["createVNode"])(s)])])):e.errorLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Z,[Object(o["createElementVNode"])("td",ee,[Object(o["createElementVNode"])("div",te,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),ne,re,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,ae),oe,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,ie),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.errorShowProfessionalHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/support-plans/")},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,se),[[o["vShow"],e.errorShowProfessionalHelp]]),le])])])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:2},Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"display-revenue":e.displayRevenue,"evolution-metric":e.evolutionMetric,key:"site-".concat(t.idsite),"model-value":t,"sparkline-date":e.sparklineDate,"sparkline-metric":e.sparklineMetric},null,8,["display-revenue","evolution-metric","model-value","sparkline-date","sparkline-metric"])})),128))])])]),!e.isLoading||e.paginationUpperBound>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ce,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.navigatePreviousPage()})}," « "+Object(o["toDisplayString"])(e.translate("General_Previous")),513),[[o["vShow"],0!==e.paginationCurrentPage]]),Object(o["createElementVNode"])("span",ue,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTableNext",onClick:t[8]||(t[8]=function(t){return e.navigateNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" » ",513),[[o["vShow"],e.paginationCurrentPagen&&(e=n),e})))}return ht(e,[{key:"cancelRefereshInterval",value:function(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)}},{key:"updateWebsitesList",value:function(e){var t=this;if(e){var n=e.sites;n.forEach((function(e){if(1!==e.ratio&&"1"!==e.ratio){var n=ft.formatPercent(Math.round(100*parseInt(e.ratio,10))),r=null,a="0",o="0",i="0",s="0";if("nb_visits"!==t.state.value.sortColumn&&"visits_evolution"!==t.state.value.sortColumn||(a=ft.formatNumber(e.previous_nb_visits),o=ft.formatNumber(e.nb_visits),i=ft.formatPercent(e.visits_evolution),r=Object(v["translate"])("General_ColumnNbVisits"),s=ft.formatNumber(Math.round(parseInt(e.previous_nb_visits,10)*parseInt(e.ratio,10)))),"pageviews_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_Actions_nb_pageviews),o="".concat(e.nb_pageviews),i=ft.formatPercent(e.pageviews_evolution),r=Object(v["translate"])("General_ColumnPageviews"),s=ft.formatNumber(Math.round(parseInt(e.previous_Actions_nb_pageviews,10)*parseInt(e.ratio,10)))),"hits_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_Actions_hits),o="".concat(e.hits),i=ft.formatPercent(e.hits_evolution),r=Object(v["translate"])("General_ColumnHits"),s=ft.formatNumber(Math.round(parseInt(e.previous_Actions_hits,10)*parseInt(e.ratio,10)))),"revenue_evolution"===t.state.value.sortColumn&&(a=ft.formatCurrency(e.previous_Goal_revenue,e.currencySymbol),o=ft.formatCurrency(e.revenue,e.currencySymbol),i=ft.formatPercent(e.revenue_evolution),r=Object(v["translate"])("General_ColumnRevenue"),s=ft.formatCurrency(Math.round(parseInt(e.previous_Goal_revenue,10)*parseInt(e.ratio,10)),e.currencySymbol)),r)switch(e.tooltip="".concat(Object(v["translate"])("MultiSites_EvolutionComparisonIncomplete",[n]),"\n"),e.tooltip+="".concat(Object(v["translate"])("MultiSites_EvolutionComparisonProportional",[n,"".concat(s),r,"".concat(a)]),"\n"),e.periodName){case"day":e.tooltip+=Object(v["translate"])("MultiSites_EvolutionComparisonDay",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"week":e.tooltip+=Object(v["translate"])("MultiSites_EvolutionComparisonWeek",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"month":e.tooltip+=Object(v["translate"])("MultiSites_EvolutionComparisonMonth",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"year":e.tooltip+=Object(v["translate"])("MultiSites_EvolutionComparisonYear",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;default:break}}})),this.privateState.totalVisits=e.totals.nb_visits,this.privateState.totalPageviews=e.totals.nb_pageviews,this.privateState.totalHits=e.totals.hits,this.privateState.totalActions=e.totals.nb_actions,this.privateState.totalRevenue=e.totals.revenue,this.privateState.lastVisits=e.totals.nb_visits_lastdate,this.privateState.sites=n,this.privateState.numberOfSites=e.numSites,this.privateState.lastVisitsDate=e.lastDate}else this.onError()}},{key:"sortBy",value:function(e){this.state.value.sortColumn===e&&(this.privateState.reverse=!this.state.value.reverse),this.privateState.sortColumn=e,this.fetchAllSites()}},{key:"previousPage",value:function(){this.privateState.currentPage=this.state.value.currentPage-1,this.fetchAllSites()}},{key:"nextPage",value:function(){this.privateState.currentPage=this.state.value.currentPage+1,this.fetchAllSites()}},{key:"searchSite",value:function(e){this.privateState.searchTerm=e,this.privateState.currentPage=0,this.fetchAllSites()}},{key:"fetchAllSites",value:function(){var e=this;this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelRefereshInterval()),this.privateState.isLoading=!0,this.privateState.errorLoadingSites=!1;var t={method:"MultiSites.getAllWithGroups",hideMetricsDoc:"1",filter_sort_order:"asc",filter_limit:this.state.value.pageSize,filter_offset:this.currentPagingOffset.value,showColumns:["label","nb_visits","nb_pageviews","hits","visits_evolution","visits_evolution_trend","pageviews_evolution","pageviews_evolution_trend","hits_evolution","hits_evolution_trend","revenue_evolution","revenue_evolution_trend","nb_actions","revenue"].join(",")};return this.privateState.searchTerm&&(t.pattern=this.privateState.searchTerm),this.privateState.sortColumn&&(t.filter_sort_column=this.privateState.sortColumn),this.privateState.reverse&&(t.filter_sort_order="desc"),this.fetchAbort=new AbortController,v["AjaxHelper"].fetch(t,{abortController:this.fetchAbort}).then((function(t){e.updateWebsitesList(t)})).catch((function(){e.onError()})).finally((function(){e.privateState.isLoading=!1,e.fetchAbort=null,e.state.value.refreshInterval&&e.state.value.refreshInterval>0&&(e.cancelRefereshInterval(),e.refreshTimeout=setTimeout((function(){e.refreshTimeout=null,e.fetchAllSites()}),1e3*e.state.value.refreshInterval))}))}},{key:"onError",value:function(){this.privateState.errorLoadingSites=!0,this.privateState.sites=[]}},{key:"setRefreshInterval",value:function(e){this.privateState.refreshInterval=e}},{key:"setPageSize",value:function(e){this.privateState.pageSize=e}}]),e}(),St=new gt,kt={ref:"root"},yt={class:"card-title"},_t=["innerHTML","title"],Ct={id:"mt",class:"dataTable card-table",cellspacing:"0"},Et={class:"heading"},Vt={class:"heading"},Nt={class:"heading"},wt={class:"heading"},Tt={class:"heading"},Bt=["colspan"],Pt=["value"],Mt={value:"visits_evolution"},Dt={value:"pageviews_evolution"},xt={value:"hits_evolution"},Lt={key:0,value:"revenue_evolution"},Gt={key:0},Rt={colspan:"7",class:"allWebsitesLoading"},At={key:1},It={key:0},zt={colspan:"7"},Ut={class:"notification system notification-error"},Ht=Object(o["createElementVNode"])("br",null,null,-1),Ft=Object(o["createElementVNode"])("br",null,null,-1),qt=["href"],Kt=Object(o["createTextVNode"])(" – "),Wt=["href"],$t=["href"],Jt=Object(o["createTextVNode"])(". "),Yt={colspan:"8",class:"paging"},Qt={class:"row"},Xt={class:"col s3 add_new_site"},Zt=["href"],en=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),tn={class:"col s6"},nn={style:{cursor:"pointer"}},rn={class:"dataTablePages"},an={id:"counter"},on={style:{cursor:"pointer"},class:"pointer"},sn=Object(o["createElementVNode"])("div",{class:"col s3"}," ",-1),ln={row_id:"last"},cn={colspan:"8",class:"site_search"},un={class:"row"},dn={class:"input-field col s12"},pn=["placeholder"],bn=["title"];function vn(e,t,n,r,a,i){var s=this,l=Object(o["resolveComponent"])("EnrichedHeadline"),c=Object(o["resolveComponent"])("ActivityIndicator"),u=Object(o["resolveComponent"])("MultisitesSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",kt,[Object(o["createElementVNode"])("h2",yt,[Object(o["createVNode"])(l,{"help-url":e.externalRawLink("https://matomo.org/faq/new-to-piwik/all-websites-dashboard/"),"feature-name":e.translate("General_AllWebsitesDashboard")},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_AllWebsitesDashboard"))+" ",1),Object(o["createElementVNode"])("span",{class:"smallTitle",innerHTML:e.$sanitize(s.smallTitleContent),title:e.smallTitleTooltip},null,8,_t)]})),_:1},8,["help-url","feature-name"])]),Object(o["createElementVNode"])("table",Ct,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{id:"names",class:Object(o["normalizeClass"])(["label",{columnSorted:"label"===e.sortColumn}]),onClick:t[0]||(t[0]=function(t){return e.sortBy("label")})},[Object(o["createElementVNode"])("span",Et,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"label"===e.sortColumn,multisites_desc:e.reverse&&"label"===e.sortColumn}]),style:{"margin-left":"3.5px"}},null,2)],2),Object(o["createElementVNode"])("th",{id:"visits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_visits"===e.sortColumn}]),onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_visits"===e.sortColumn,multisites_desc:e.reverse&&"nb_visits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Vt,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)],2),Object(o["createElementVNode"])("th",{id:"pageviews",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_pageviews"===e.sortColumn}]),onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_pageviews"===e.sortColumn,multisites_desc:e.reverse&&"nb_pageviews"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Nt,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)],2),Object(o["createElementVNode"])("th",{id:"hits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"hits"===e.sortColumn}]),onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"hits"===e.sortColumn,multisites_desc:e.reverse&&"hits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",wt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)],2),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,id:"revenue",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"revenue"===e.sortColumn}]),onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"revenue"===e.sortColumn,multisites_desc:e.reverse&&"revenue"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Tt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)],2)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{id:"evolution",class:Object(o["normalizeClass"])({columnSorted:e.evolutionSelector===e.sortColumn}),colspan:e.showSparklines?2:1},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&e.evolutionSelector===e.sortColumn,multisites_desc:e.reverse&&e.evolutionSelector===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",{class:"evolution",onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)}),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1),Object(o["createElementVNode"])("select",{class:"selector browser-default",id:"evolution_selector",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){e.evolutionSelector=t.target.value,e.sortBy(e.evolutionSelector)})},[Object(o["createElementVNode"])("option",Mt,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",Dt,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),Object(o["createElementVNode"])("option",xt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Lt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,Pt)],10,Bt)])]),e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",Gt,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",Rt,[Object(o["createVNode"])(c,{"loading-message":e.loadingMessage,loading:e.isLoading},null,8,["loading-message","loading"])])])])):Object(o["createCommentVNode"])("",!0),e.isLoading?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",At,[e.errorLoadingSites?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",It,[Object(o["createElementVNode"])("td",zt,[Object(o["createElementVNode"])("div",Ut,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),Ht,Ft,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,qt),Kt,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,Wt),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.professionalHelpUrl},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,$t),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Jt])])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(u,{key:t.idsite,website:t,"evolution-metric":e.evolutionSelector,"date-sparkline":e.dateSparkline,"show-sparklines":e.showSparklines,metric:e.sortColumn,"display-revenue-column":e.displayRevenueColumn},null,8,["website","evolution-metric","date-sparkline","show-sparklines","metric","display-revenue-column"])})),128))])),Object(o["createElementVNode"])("tfoot",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",Yt,[Object(o["createElementVNode"])("div",Qt,[Object(o["createElementVNode"])("div",Xt,[e.hasSuperUserAccess?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,href:e.addSiteUrl},[en,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("SitesManager_AddSite")),1)],8,Zt)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",tn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"prev",class:"previous dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.previousPage()})},[Object(o["createElementVNode"])("span",nn,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],512),[[o["vShow"],!(0===e.currentPage)]]),Object(o["createElementVNode"])("span",rn,[Object(o["createElementVNode"])("span",an,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"next",class:"next dataTableNext",onClick:t[8]||(t[8]=function(t){return e.nextPage()})},[Object(o["createElementVNode"])("span",on,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],512),[[o["vShow"],!(e.currentPage>=e.numberOfPages)]])]),sn])])]),Object(o["createElementVNode"])("tr",ln,[Object(o["createElementVNode"])("td",cn,[Object(o["createElementVNode"])("div",un,[Object(o["createElementVNode"])("div",dn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",onKeydown:t[9]||(t[9]=Object(o["withKeys"])((function(t){return e.searchSite(e.searchTerm)}),["enter"])),"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.searchTerm=t}),placeholder:e.translate("Actions_SubmenuSitesearch")},null,40,pn),[[o["vModelText"],e.searchTerm]]),Object(o["createElementVNode"])("span",{class:"icon-search search_ico",onClick:t[11]||(t[11]=function(t){return e.searchSite(e.searchTerm)}),title:e.translate("General_ClickToSearch")},null,8,bn)])])])])])])],512)}var mn=Object(o["defineComponent"])({props:{displayRevenueColumn:Boolean,showSparklines:Boolean,dateSparkline:String,pageSize:Number,autoRefreshTodayReport:Number},components:{EnrichedHeadline:v["EnrichedHeadline"],ActivityIndicator:v["ActivityIndicator"],MultisitesSite:bt},data:function(){return{evolutionSelector:"visits_evolution",searchTerm:""}},created:function(){this.pageSize&&St.setPageSize(this.pageSize),this.refresh(this.autoRefreshTodayReport)},methods:{refresh:function(e){St.setRefreshInterval(e),St.fetchAllSites()},sortBy:function(e){St.sortBy(e)},previousPage:function(){St.previousPage()},nextPage:function(){St.nextPage()},searchSite:function(){St.searchSite(this.searchTerm)}},computed:{hasSuperUserAccess:function(){return v["Matomo"].hasSuperUserAccess},date:function(){return v["MatomoUrl"].urlParsed.value.date},idSite:function(){return v["MatomoUrl"].urlParsed.value.idSite},url:function(){return v["Matomo"].piwik_url},period:function(){return v["Matomo"].period},areAdsForProfessionalServicesEnabled:function(){return v["Matomo"].config&&v["Matomo"].config.are_ads_enabled},sortColumn:function(){return St.state.value.sortColumn},reverse:function(){return St.state.value.reverse},smallTitleContent:function(){var e=St.state.value;return Object(v["translate"])("General_TotalVisitsPageviewsActionsRevenue","".concat(e.totalVisits,""),"".concat(e.totalPageviews,""),"".concat(e.totalActions,""),"".concat(e.totalRevenue,""))},smallTitleTooltip:function(){var e=St.state.value;return Object(v["translate"])("General_EvolutionSummaryGeneric",Object(v["translate"])("General_NVisits","".concat(e.totalVisits)),this.date,"".concat(e.lastVisits),e.lastVisitsDate,Object(v["getFormattedEvolution"])(e.totalVisits,e.lastVisits))},loadingMessage:function(){return St.state.value.loadingMessage},isLoading:function(){return St.state.value.isLoading},errorLoadingSites:function(){return St.state.value.errorLoadingSites},sites:function(){return St.state.value.sites},numberOfPages:function(){return St.numberOfPages.value},currentPage:function(){return St.state.value.currentPage},paginationLowerBound:function(){return St.paginationLowerBound.value},paginationUpperBound:function(){return St.paginationUpperBound.value},numberOfFilteredSites:function(){return St.numberOfFilteredSites.value},professionalHelpUrl:function(){return Object(v["externalRawLink"])("https://matomo.org/support-plans/")},addSiteUrl:function(){return"index.php?module=SitesManager&action=index&showaddsite=1&period=".concat(this.period,"&")+"date=".concat(this.date,"&idSite=").concat(this.idSite)}}});mn.render=vn;var hn=mn;
+ */var jt=function(){function e(){var t=this;mt(this,e),Ot(this,"privateState",Object(o["reactive"])({sites:[],isLoading:!1,pageSize:25,currentPage:0,totalVisits:"?",totalPageviews:"?",totalHits:"?",totalActions:"?",totalRevenue:"?",searchTerm:"",lastVisits:"?",lastVisitsDate:"?",numberOfSites:0,loadingMessage:Object(m["translate"])("MultiSites_LoadingWebsites"),reverse:!0,sortColumn:"nb_visits",refreshInterval:0,errorLoadingSites:!1})),Ot(this,"refreshTimeout",null),Ot(this,"fetchAbort",null),Ot(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),Ot(this,"numberOfFilteredSites",Object(o["computed"])((function(){return t.state.value.numberOfSites}))),Ot(this,"numberOfPages",Object(o["computed"])((function(){return Math.ceil(t.numberOfFilteredSites.value/t.state.value.pageSize-1)}))),Ot(this,"currentPagingOffset",Object(o["computed"])((function(){return Math.ceil(t.state.value.currentPage*t.state.value.pageSize)}))),Ot(this,"paginationLowerBound",Object(o["computed"])((function(){return t.currentPagingOffset.value+1}))),Ot(this,"paginationUpperBound",Object(o["computed"])((function(){var e=t.currentPagingOffset.value+t.state.value.pageSize,n=t.numberOfFilteredSites.value;return e>n&&(e=n),e})))}return ht(e,[{key:"cancelRefereshInterval",value:function(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)}},{key:"updateWebsitesList",value:function(e){var t=this;if(e){var n=e.sites;n.forEach((function(e){if(1!==e.ratio&&"1"!==e.ratio){var n=m["NumberFormatter"].formatPercent(Math.round(100*parseInt(e.ratio,10))),r=null,a="0",o="0",i="0",s="0";if("nb_visits"!==t.state.value.sortColumn&&"visits_evolution"!==t.state.value.sortColumn||(a=m["NumberFormatter"].formatNumber(e.previous_nb_visits),o=m["NumberFormatter"].formatNumber(e.nb_visits),i=m["NumberFormatter"].formatPercent(e.visits_evolution),r=Object(m["translate"])("General_ColumnNbVisits"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_nb_visits,10)*parseInt(e.ratio,10)))),"pageviews_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_Actions_nb_pageviews),o="".concat(e.nb_pageviews),i=m["NumberFormatter"].formatPercent(e.pageviews_evolution),r=Object(m["translate"])("General_ColumnPageviews"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_Actions_nb_pageviews,10)*parseInt(e.ratio,10)))),"hits_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_Actions_hits),o="".concat(e.hits),i=m["NumberFormatter"].formatPercent(e.hits_evolution),r=Object(m["translate"])("General_ColumnHits"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_Actions_hits,10)*parseInt(e.ratio,10)))),"revenue_evolution"===t.state.value.sortColumn&&(a=m["NumberFormatter"].formatCurrency(e.previous_Goal_revenue,e.currencySymbol),o=m["NumberFormatter"].formatCurrency(e.revenue,e.currencySymbol),i=m["NumberFormatter"].formatPercent(e.revenue_evolution),r=Object(m["translate"])("General_ColumnRevenue"),s=m["NumberFormatter"].formatCurrency(Math.round(parseInt(e.previous_Goal_revenue,10)*parseInt(e.ratio,10)),e.currencySymbol)),r)switch(e.tooltip="".concat(Object(m["translate"])("MultiSites_EvolutionComparisonIncomplete",[n]),"\n"),e.tooltip+="".concat(Object(m["translate"])("MultiSites_EvolutionComparisonProportional",[n,"".concat(s),r,"".concat(a)]),"\n"),e.periodName){case"day":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonDay",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"week":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonWeek",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"month":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonMonth",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"year":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonYear",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;default:break}}})),this.privateState.totalVisits=e.totals.nb_visits,this.privateState.totalPageviews=e.totals.nb_pageviews,this.privateState.totalHits=e.totals.hits,this.privateState.totalActions=e.totals.nb_actions,this.privateState.totalRevenue=e.totals.revenue,this.privateState.lastVisits=e.totals.nb_visits_lastdate,this.privateState.sites=n,this.privateState.numberOfSites=e.numSites,this.privateState.lastVisitsDate=e.lastDate}else this.onError()}},{key:"sortBy",value:function(e){this.state.value.sortColumn===e&&(this.privateState.reverse=!this.state.value.reverse),this.privateState.sortColumn=e,this.fetchAllSites()}},{key:"previousPage",value:function(){this.privateState.currentPage=this.state.value.currentPage-1,this.fetchAllSites()}},{key:"nextPage",value:function(){this.privateState.currentPage=this.state.value.currentPage+1,this.fetchAllSites()}},{key:"searchSite",value:function(e){this.privateState.searchTerm=e,this.privateState.currentPage=0,this.fetchAllSites()}},{key:"fetchAllSites",value:function(){var e=this;this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelRefereshInterval()),this.privateState.isLoading=!0,this.privateState.errorLoadingSites=!1;var t={method:"MultiSites.getAllWithGroups",hideMetricsDoc:"1",filter_sort_order:"asc",filter_limit:this.state.value.pageSize,filter_offset:this.currentPagingOffset.value,showColumns:["label","nb_visits","nb_pageviews","hits","visits_evolution","visits_evolution_trend","pageviews_evolution","pageviews_evolution_trend","hits_evolution","hits_evolution_trend","revenue_evolution","revenue_evolution_trend","nb_actions","revenue"].join(",")};return this.privateState.searchTerm&&(t.pattern=this.privateState.searchTerm),this.privateState.sortColumn&&(t.filter_sort_column=this.privateState.sortColumn),this.privateState.reverse&&(t.filter_sort_order="desc"),this.fetchAbort=new AbortController,m["AjaxHelper"].fetch(t,{abortController:this.fetchAbort}).then((function(t){e.updateWebsitesList(t)})).catch((function(){e.onError()})).finally((function(){e.privateState.isLoading=!1,e.fetchAbort=null,e.state.value.refreshInterval&&e.state.value.refreshInterval>0&&(e.cancelRefereshInterval(),e.refreshTimeout=setTimeout((function(){e.refreshTimeout=null,e.fetchAllSites()}),1e3*e.state.value.refreshInterval))}))}},{key:"onError",value:function(){this.privateState.errorLoadingSites=!0,this.privateState.sites=[]}},{key:"setRefreshInterval",value:function(e){this.privateState.refreshInterval=e}},{key:"setPageSize",value:function(e){this.privateState.pageSize=e}}]),e}(),ft=new jt,gt={ref:"root"},St={class:"card-title"},kt=["innerHTML","title"],yt={id:"mt",class:"dataTable card-table",cellspacing:"0"},_t={class:"heading"},Ct={class:"heading"},Et={class:"heading"},Nt={class:"heading"},Vt={class:"heading"},wt=["colspan"],Tt=["value"],Bt={value:"visits_evolution"},Pt={value:"pageviews_evolution"},Mt={value:"hits_evolution"},Dt={key:0,value:"revenue_evolution"},xt={key:0},Lt={colspan:"7",class:"allWebsitesLoading"},Gt={key:1},At={key:0},Rt={colspan:"7"},It={class:"notification system notification-error"},zt=Object(o["createElementVNode"])("br",null,null,-1),Ft=Object(o["createElementVNode"])("br",null,null,-1),Ut=["href"],Ht=Object(o["createTextVNode"])(" – "),qt=["href"],Kt=["href"],Wt=Object(o["createTextVNode"])(". "),$t={colspan:"8",class:"paging"},Jt={class:"row"},Yt={class:"col s3 add_new_site"},Qt=["href"],Xt=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),Zt={class:"col s6"},en={style:{cursor:"pointer"}},tn={class:"dataTablePages"},nn={id:"counter"},rn={style:{cursor:"pointer"},class:"pointer"},an=Object(o["createElementVNode"])("div",{class:"col s3"}," ",-1),on={row_id:"last"},sn={colspan:"8",class:"site_search"},ln={class:"row"},cn={class:"input-field col s12"},un=["placeholder"],dn=["title"];function bn(e,t,n,r,a,i){var s=this,l=Object(o["resolveComponent"])("EnrichedHeadline"),c=Object(o["resolveComponent"])("ActivityIndicator"),u=Object(o["resolveComponent"])("MultisitesSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",gt,[Object(o["createElementVNode"])("h2",St,[Object(o["createVNode"])(l,{"help-url":e.externalRawLink("https://matomo.org/faq/new-to-piwik/all-websites-dashboard/"),"feature-name":e.translate("General_AllWebsitesDashboard")},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_AllWebsitesDashboard"))+" ",1),Object(o["createElementVNode"])("span",{class:"smallTitle",innerHTML:e.$sanitize(s.smallTitleContent),title:e.smallTitleTooltip},null,8,kt)]})),_:1},8,["help-url","feature-name"])]),Object(o["createElementVNode"])("table",yt,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{id:"names",class:Object(o["normalizeClass"])(["label",{columnSorted:"label"===e.sortColumn}]),onClick:t[0]||(t[0]=function(t){return e.sortBy("label")})},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"label"===e.sortColumn,multisites_desc:e.reverse&&"label"===e.sortColumn}]),style:{"margin-left":"3.5px"}},null,2)],2),Object(o["createElementVNode"])("th",{id:"visits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_visits"===e.sortColumn}]),onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_visits"===e.sortColumn,multisites_desc:e.reverse&&"nb_visits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Ct,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)],2),Object(o["createElementVNode"])("th",{id:"pageviews",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_pageviews"===e.sortColumn}]),onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_pageviews"===e.sortColumn,multisites_desc:e.reverse&&"nb_pageviews"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Et,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)],2),Object(o["createElementVNode"])("th",{id:"hits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"hits"===e.sortColumn}]),onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"hits"===e.sortColumn,multisites_desc:e.reverse&&"hits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Nt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)],2),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,id:"revenue",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"revenue"===e.sortColumn}]),onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"revenue"===e.sortColumn,multisites_desc:e.reverse&&"revenue"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Vt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)],2)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{id:"evolution",class:Object(o["normalizeClass"])({columnSorted:e.evolutionSelector===e.sortColumn}),colspan:e.showSparklines?2:1},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&e.evolutionSelector===e.sortColumn,multisites_desc:e.reverse&&e.evolutionSelector===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",{class:"evolution",onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)}),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1),Object(o["createElementVNode"])("select",{class:"selector browser-default",id:"evolution_selector",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){e.evolutionSelector=t.target.value,e.sortBy(e.evolutionSelector)})},[Object(o["createElementVNode"])("option",Bt,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",Pt,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),Object(o["createElementVNode"])("option",Mt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Dt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,Tt)],10,wt)])]),e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",xt,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",Lt,[Object(o["createVNode"])(c,{"loading-message":e.loadingMessage,loading:e.isLoading},null,8,["loading-message","loading"])])])])):Object(o["createCommentVNode"])("",!0),e.isLoading?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",Gt,[e.errorLoadingSites?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",At,[Object(o["createElementVNode"])("td",Rt,[Object(o["createElementVNode"])("div",It,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),zt,Ft,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,Ut),Ht,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,qt),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.professionalHelpUrl},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,Kt),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Wt])])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(u,{key:t.idsite,website:t,"evolution-metric":e.evolutionSelector,"date-sparkline":e.dateSparkline,"show-sparklines":e.showSparklines,metric:e.sortColumn,"display-revenue-column":e.displayRevenueColumn},null,8,["website","evolution-metric","date-sparkline","show-sparklines","metric","display-revenue-column"])})),128))])),Object(o["createElementVNode"])("tfoot",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",$t,[Object(o["createElementVNode"])("div",Jt,[Object(o["createElementVNode"])("div",Yt,[e.hasSuperUserAccess?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,href:e.addSiteUrl},[Xt,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("SitesManager_AddSite")),1)],8,Qt)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",Zt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"prev",class:"previous dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.previousPage()})},[Object(o["createElementVNode"])("span",en,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],512),[[o["vShow"],!(0===e.currentPage)]]),Object(o["createElementVNode"])("span",tn,[Object(o["createElementVNode"])("span",nn,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"next",class:"next dataTableNext",onClick:t[8]||(t[8]=function(t){return e.nextPage()})},[Object(o["createElementVNode"])("span",rn,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],512),[[o["vShow"],!(e.currentPage>=e.numberOfPages)]])]),an])])]),Object(o["createElementVNode"])("tr",on,[Object(o["createElementVNode"])("td",sn,[Object(o["createElementVNode"])("div",ln,[Object(o["createElementVNode"])("div",cn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",onKeydown:t[9]||(t[9]=Object(o["withKeys"])((function(t){return e.searchSite(e.searchTerm)}),["enter"])),"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.searchTerm=t}),placeholder:e.translate("Actions_SubmenuSitesearch")},null,40,un),[[o["vModelText"],e.searchTerm]]),Object(o["createElementVNode"])("span",{class:"icon-search search_ico",onClick:t[11]||(t[11]=function(t){return e.searchSite(e.searchTerm)}),title:e.translate("General_ClickToSearch")},null,8,dn)])])])])])])],512)}var pn=Object(o["defineComponent"])({props:{displayRevenueColumn:Boolean,showSparklines:Boolean,dateSparkline:String,pageSize:Number,autoRefreshTodayReport:Number},components:{EnrichedHeadline:m["EnrichedHeadline"],ActivityIndicator:m["ActivityIndicator"],MultisitesSite:pt},data:function(){return{evolutionSelector:"visits_evolution",searchTerm:""}},created:function(){this.pageSize&&ft.setPageSize(this.pageSize),this.refresh(this.autoRefreshTodayReport)},methods:{refresh:function(e){ft.setRefreshInterval(e),ft.fetchAllSites()},sortBy:function(e){ft.sortBy(e)},previousPage:function(){ft.previousPage()},nextPage:function(){ft.nextPage()},searchSite:function(){ft.searchSite(this.searchTerm)}},computed:{hasSuperUserAccess:function(){return m["Matomo"].hasSuperUserAccess},date:function(){return m["MatomoUrl"].urlParsed.value.date},idSite:function(){return m["MatomoUrl"].urlParsed.value.idSite},url:function(){return m["Matomo"].piwik_url},period:function(){return m["Matomo"].period},areAdsForProfessionalServicesEnabled:function(){return m["Matomo"].config&&m["Matomo"].config.are_ads_enabled},sortColumn:function(){return ft.state.value.sortColumn},reverse:function(){return ft.state.value.reverse},smallTitleContent:function(){var e=ft.state.value;return Object(m["translate"])("General_TotalVisitsPageviewsActionsRevenue","".concat(e.totalVisits,""),"".concat(e.totalPageviews,""),"".concat(e.totalActions,""),"".concat(e.totalRevenue,""))},smallTitleTooltip:function(){var e=ft.state.value;return Object(m["translate"])("General_EvolutionSummaryGeneric",Object(m["translate"])("General_NVisits","".concat(e.totalVisits)),this.date,"".concat(e.lastVisits),e.lastVisitsDate,Object(m["calculateAndFormatEvolution"])(e.totalVisits,e.lastVisits))},loadingMessage:function(){return ft.state.value.loadingMessage},isLoading:function(){return ft.state.value.isLoading},errorLoadingSites:function(){return ft.state.value.errorLoadingSites},sites:function(){return ft.state.value.sites},numberOfPages:function(){return ft.numberOfPages.value},currentPage:function(){return ft.state.value.currentPage},paginationLowerBound:function(){return ft.paginationLowerBound.value},paginationUpperBound:function(){return ft.paginationUpperBound.value},numberOfFilteredSites:function(){return ft.numberOfFilteredSites.value},professionalHelpUrl:function(){return Object(m["externalRawLink"])("https://matomo.org/support-plans/")},addSiteUrl:function(){return"index.php?module=SitesManager&action=index&showaddsite=1&period=".concat(this.period,"&")+"date=".concat(this.date,"&idSite=").concat(this.idSite)}}});pn.render=bn;var mn=pn;
/*!
* Matomo - free/libre analytics platform
*
diff --git a/plugins/MultiSites/vue/src/Dashboard/Dashboard.store.ts b/plugins/MultiSites/vue/src/Dashboard/Dashboard.store.ts
index 1c75704e3b6..3c34fd24561 100644
--- a/plugins/MultiSites/vue/src/Dashboard/Dashboard.store.ts
+++ b/plugins/MultiSites/vue/src/Dashboard/Dashboard.store.ts
@@ -14,6 +14,7 @@ import {
AjaxHelper,
translate,
Site,
+ NumberFormatter,
} from 'CoreHome';
interface SiteWithMetrics extends Site {
@@ -75,8 +76,6 @@ interface GetAllWithGroupsResponse {
totals: SiteTotals;
}
-const { NumberFormatter } = window;
-
class DashboardStore {
private privateState = reactive({
sites: [],
@@ -157,7 +156,7 @@ class DashboardStore {
if (this.state.value.sortColumn === 'nb_visits'
|| this.state.value.sortColumn === 'visits_evolution'
) {
- previousTotal = NumberFormatter.formatNumber(site.previous_nb_visits);
+ previousTotal = NumberFormatter.formatNumber(site.previous_nb_visits! as string);
currentTotal = NumberFormatter.formatNumber(site.nb_visits);
evolution = NumberFormatter.formatPercent(site.visits_evolution);
metricName = translate('General_ColumnNbVisits');
@@ -191,7 +190,7 @@ class DashboardStore {
if (this.state.value.sortColumn === 'revenue_evolution') {
previousTotal = NumberFormatter.formatCurrency(
- site.previous_Goal_revenue,
+ site.previous_Goal_revenue! as string,
site.currencySymbol,
);
currentTotal = NumberFormatter.formatCurrency(site.revenue, site.currencySymbol);
diff --git a/plugins/MultiSites/vue/src/Dashboard/Dashboard.vue b/plugins/MultiSites/vue/src/Dashboard/Dashboard.vue
index c69846c8a01..9bb1dc70cc8 100644
--- a/plugins/MultiSites/vue/src/Dashboard/Dashboard.vue
+++ b/plugins/MultiSites/vue/src/Dashboard/Dashboard.vue
@@ -288,7 +288,7 @@ import {
EnrichedHeadline,
ActivityIndicator,
MatomoUrl,
- getFormattedEvolution,
+ calculateAndFormatEvolution,
externalRawLink,
} from 'CoreHome';
import MultisitesSite from '../MultisitesSite/MultisitesSite.vue';
@@ -385,7 +385,7 @@ export default defineComponent({
this.date,
`${state.lastVisits}`,
state.lastVisitsDate,
- getFormattedEvolution(state.totalVisits, state.lastVisits),
+ calculateAndFormatEvolution(state.totalVisits, state.lastVisits),
);
},
loadingMessage() {
From 817385337014947b8335e367c915815450a31914 Mon Sep 17 00:00:00 2001
From: sgiehl
Date: Tue, 12 Nov 2024 13:35:19 +0100
Subject: [PATCH 3/8] Adjust MultiSites API to use better metric names for
previous period data and add them to totals
---
plugins/MultiSites/API.php | 144 +++++---------
plugins/MultiSites/Dashboard.php | 26 ++-
plugins/MultiSites/config/ui-test.php | 2 +-
...test___MultiSites.getAllWithGroups_day.xml | 185 +++++++++---------
...tered__MultiSites.getAllWithGroups_day.xml | 161 +++++++--------
...ffset__MultiSites.getAllWithGroups_day.xml | 65 +++---
...tered__MultiSites.getAllWithGroups_day.xml | 65 +++---
...ttern__MultiSites.getAllWithGroups_day.xml | 65 +++---
...tered__MultiSites.getAllWithGroups_day.xml | 65 +++---
...mited__MultiSites.getAllWithGroups_day.xml | 65 +++---
...tered__MultiSites.getAllWithGroups_day.xml | 65 +++---
plugins/MultiSites/vue/dist/MultiSites.umd.js | 12 +-
.../MultiSites/vue/dist/MultiSites.umd.min.js | 4 +-
.../vue/src/Dashboard/Dashboard.store.ts | 18 +-
14 files changed, 479 insertions(+), 463 deletions(-)
diff --git a/plugins/MultiSites/API.php b/plugins/MultiSites/API.php
index c225f8fb8b5..91b9eb94602 100644
--- a/plugins/MultiSites/API.php
+++ b/plugins/MultiSites/API.php
@@ -16,13 +16,10 @@
use Piwik\Container\StaticContainer;
use Piwik\DataTable;
use Piwik\DataTable\Row;
-use Piwik\NumberFormatter;
use Piwik\Period;
use Piwik\Period\Range;
use Piwik\Piwik;
-use Piwik\Plugins\FeatureFlags\FeatureFlagManager;
use Piwik\Plugins\Goals\Archiver;
-use Piwik\Plugins\MultiSites\FeatureFlags\ImprovedAllWebsitesDashboard;
use Piwik\Plugins\SitesManager\API as APISitesManager;
use Piwik\Scheduler\Scheduler;
use Piwik\SettingsPiwik;
@@ -296,6 +293,10 @@ private function buildDataTable($idSites, $period, $date, $segment, $_restrictSi
$dataTable = $archive->getDataTableFromNumericAndMergeChildren($fieldsToGet);
$this->populateLabel($dataTable);
+
+ // replace record names with user friendly metric names
+ $dataTable->filter('ReplaceColumnNames', array($columnNameRewrites));
+
$totalMetrics = $this->preformatApiMetricsForTotalsCalculation($apiMetrics);
$this->setMetricsTotalsMetadata($dataTable, $totalMetrics);
@@ -313,10 +314,11 @@ private function buildDataTable($idSites, $period, $date, $segment, $_restrictSi
$pastArchive = Archive::build($idSites, $period, $strLastDate, $segment, $_restrictSitesToLogin);
$pastData = $pastArchive->getDataTableFromNumericAndMergeChildren($fieldsToGet);
-
+ $pastData->filter('ReplaceColumnNames', array($columnNameRewrites));
$this->populateLabel($pastData); // labels are needed to calculate evolution
$this->calculateEvolutionPercentages($dataTable, $pastData, $apiMetrics);
$this->setPastTotalVisitsMetadata($dataTable, $pastData);
+ $this->setPreviousMetricsTotalsMetadata($dataTable, $pastData, $totalMetrics);
if ($dataTable instanceof DataTable) {
// needed for MultiSites\Dashboard
@@ -350,9 +352,6 @@ private function buildDataTable($idSites, $period, $date, $segment, $_restrictSi
$dataTable->queueFilter('ColumnDelete', array('label'));
}
- // replace record names with user friendly metric names
- $dataTable->queueFilter('ReplaceColumnNames', array($columnNameRewrites));
-
// filter rows without visits
// note: if only one website is queried and there are no visits, we can not remove the row otherwise
// ResponseBuilder throws 'Call to a member function getColumns() on a non-object'
@@ -389,87 +388,6 @@ function ($value) {
return $dataTable;
}
- /**
- * Temporary/partially mocked data for the all websites dashboard.
- *
- * @internal
- *
- * @param int $idSite
- * @param string $period
- * @param string $date
- * @param string|false $segment
- * @param string $pattern
- * @return array
- * @throws Exception
- */
- public function mockDashboardData(
- int $idSite,
- string $period,
- string $date,
- int $filter_limit,
- $segment = false,
- string $pattern = ''
- ): array {
- $featureFlagManager = StaticContainer::get(FeatureFlagManager::class);
-
- if (!$featureFlagManager->isFeatureActive(ImprovedAllWebsitesDashboard::class)) {
- throw new Exception('THIS API SHOULD NOT BE USED');
- }
-
- Piwik::checkUserHasSomeViewAccess();
-
- if (Period::isMultiplePeriod($date, $period)) {
- throw new Exception('Multiple periods are not supported');
- }
-
- $numberFormatter = NumberFormatter::getInstance();
-
- $response = [
- 'totals' => [
- 'hits_evolution' => $numberFormatter->formatPercent(2.8, 2, 2),
- 'hits_evolution_trend' => 1,
- 'hits' => $numberFormatter->formatNumber(582303),
- 'nb_pageviews' => $numberFormatter->formatNumber(26027),
- 'nb_visits' => $numberFormatter->formatNumber(10118),
- 'pageviews_evolution' => $numberFormatter->formatPercent(0.3, 2, 2),
- 'pageviews_evolution_trend' => -1,
- 'visits_evolution' => $numberFormatter->formatPercent(2.4, 2, 2),
- 'visits_evolution_trend' => 1,
- 'revenue' => $numberFormatter->formatNumber(85958.30, 2, 2),
- 'revenue_evolution' => $numberFormatter->formatPercent(0.0, 2, 2),
- 'revenue_evolution_trend' => 0,
- ],
- ];
-
- $segment = $segment ?: false;
- $request = $_GET + $_POST;
- $dashboard = new Dashboard($period, $date, $segment);
-
- if ('' !== $pattern) {
- $dashboard->search(strtolower($pattern));
- }
-
- $sites = $dashboard->getSites($request, $filter_limit);
-
- $response['numSites'] = $dashboard->getNumSites();
- $response['sites'] = $sites;
-
- if ('range' === $period) {
- $response['sparklineDate'] = $date;
- } else {
- Piwik::checkUserHasViewAccess($idSite);
-
- $response['sparklineDate'] = Range::getRelativeToEndDate(
- $period,
- 'last30',
- $date,
- new Site($idSite)
- );
- }
-
- return $response;
- }
-
/**
* Performs a binary filter of two
* DataTables in order to correctly calculate evolution metrics.
@@ -502,7 +420,7 @@ private function calculateEvolutionPercentages($currentData, $pastData, $apiMetr
$extraProcessedMetrics = is_array($extraProcessedMetrics) ? $extraProcessedMetrics : [];
$extraProcessedMetrics[] = new $evolutionMetricClass(
- $metricSettings[self::METRIC_RECORD_NAME_KEY],
+ $metricSettings[self::METRIC_COL_NAME_KEY],
$pastData,
$metricSettings[self::METRIC_EVOLUTION_COL_NAME_KEY],
$quotientPrecision = 1,
@@ -585,7 +503,7 @@ private function preformatApiMetricsForTotalsCalculation($apiMetrics)
$metrics = array();
foreach ($apiMetrics as $label => $metricsInfo) {
$totalMetadataName = self::getTotalMetadataName($label);
- $metrics[$totalMetadataName] = $metricsInfo[self::METRIC_RECORD_NAME_KEY];
+ $metrics[$totalMetadataName] = $metricsInfo[self::METRIC_COL_NAME_KEY];
}
return $metrics;
@@ -625,6 +543,52 @@ private function setMetricsTotalsMetadata($dataTable, $apiMetrics)
}
}
+ /**
+ * Sets the previous total visits, actions & revenue for a DataTable returned by
+ * $this->buildDataTable.
+ *
+ * @param DataTable $dataTable
+ * @param array $apiMetrics Metrics info.
+ * @return array Array of three values: total visits, total actions, total revenue
+ */
+ private function setPreviousMetricsTotalsMetadata($dataTable, $pastData, $apiMetrics)
+ {
+ if ($dataTable instanceof DataTable\Map) {
+ $currentDataTables = $pastData->getDataTables();
+ $pastDataTables = $pastData->getDataTables();
+ $currentLabels = array_keys($currentDataTables);
+ $pastLabels = array_keys($pastDataTables);
+
+ foreach ($currentLabels as $index => $label) {
+ $this->setPreviousMetricsTotalsMetadata(
+ $currentDataTables[$label],
+ $pastDataTables[$pastLabels[$index]],
+ $apiMetrics
+ );
+ }
+ } else {
+ $totals = array();
+ foreach ($apiMetrics as $label => $recordName) {
+ $label = 'previous_' . $label;
+
+ $totals[$label] = 0;
+ }
+
+ $rows = $pastData->getRows();
+
+ $rows = $this->filterRowsForTotalsCalculation($rows);
+
+ foreach ($rows as $row) {
+ foreach ($apiMetrics as $totalMetadataName => $recordName) {
+ $totalMetadataName = 'previous_' . $totalMetadataName;
+ $totals[$totalMetadataName] += $row->getColumn($recordName);
+ }
+ }
+
+ $dataTable->setMetadataValues($totals);
+ }
+ }
+
/**
* Sets the number of total visits in the pastTable on the dataTable as metadata.
*
diff --git a/plugins/MultiSites/Dashboard.php b/plugins/MultiSites/Dashboard.php
index 10448696180..705e951a925 100644
--- a/plugins/MultiSites/Dashboard.php
+++ b/plugins/MultiSites/Dashboard.php
@@ -35,7 +35,10 @@ class Dashboard
* Array of metrics that will be displayed and will be number formatted
* @var array
*/
- private $displayedMetricColumns = ['nb_visits', 'nb_pageviews', 'hits', 'nb_actions', 'revenue'];
+ private $displayedMetricColumns = [
+ 'nb_visits', 'nb_pageviews', 'hits', 'nb_actions', 'revenue',
+ 'previous_nb_visits', 'previous_nb_pageviews', 'previous_hits', 'previous_nb_actions', 'previous_revenue',
+ ];
/**
* @param string $period
@@ -111,12 +114,17 @@ public function getSites($request, $limit)
public function getTotals()
{
$totals = [
- 'nb_pageviews' => $this->sitesByGroup->getMetadata('total_nb_pageviews'),
- 'nb_visits' => $this->sitesByGroup->getMetadata('total_nb_visits'),
- 'hits' => $this->sitesByGroup->getMetadata('total_hits'),
- 'nb_actions' => $this->sitesByGroup->getMetadata('total_nb_actions'),
- 'revenue' => $this->sitesByGroup->getMetadata('total_revenue'),
- 'nb_visits_lastdate' => $this->sitesByGroup->getMetadata('total_nb_visits_lastdate') ? : 0,
+ 'nb_pageviews' => $this->sitesByGroup->getMetadata('total_nb_pageviews'),
+ 'nb_visits' => $this->sitesByGroup->getMetadata('total_nb_visits'),
+ 'hits' => $this->sitesByGroup->getMetadata('total_hits'),
+ 'nb_actions' => $this->sitesByGroup->getMetadata('total_nb_actions'),
+ 'revenue' => $this->sitesByGroup->getMetadata('total_revenue'),
+ 'previous_nb_pageviews' => $this->sitesByGroup->getMetadata('previous_total_nb_pageviews'),
+ 'previous_nb_visits' => $this->sitesByGroup->getMetadata('previous_total_nb_visits'),
+ 'previous_hits' => $this->sitesByGroup->getMetadata('previous_total_hits'),
+ 'previous_nb_actions' => $this->sitesByGroup->getMetadata('previous_total_nb_actions'),
+ 'previous_revenue' => $this->sitesByGroup->getMetadata('previous_total_revenue'),
+ 'nb_visits_lastdate' => $this->sitesByGroup->getMetadata('total_nb_visits_lastdate') ? : 0,
];
$this->formatMetrics($totals);
return $totals;
@@ -124,6 +132,10 @@ public function getTotals()
private function formatMetrics(&$metrics)
{
+ if (\Piwik\Request::fromRequest()->getStringParameter('format_metrics', '0') === '0') {
+ return; // do not format metrics if requires unformatted
+ }
+
$formatter = NumberFormatter::getInstance();
foreach ($metrics as $metricName => &$value) {
if (in_array($metricName, $this->displayedMetricColumns)) {
diff --git a/plugins/MultiSites/config/ui-test.php b/plugins/MultiSites/config/ui-test.php
index 6bdc96e8b6e..daadcb3a0bb 100644
--- a/plugins/MultiSites/config/ui-test.php
+++ b/plugins/MultiSites/config/ui-test.php
@@ -6,7 +6,7 @@
return [
'observers.global' => DI::add([
[
- 'API.MultiSites.mockDashboardData',
+ 'API.MultiSites.getAllWithGroups',
DI::value(function (&$parameters) {
if (StaticContainer::get('test.vars.forceMultiSitesDashboardFailure')) {
throw new Exception('Forced API error');
diff --git a/plugins/MultiSites/tests/System/expected/test___MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test___MultiSites.getAllWithGroups_day.xml
index 3da1029181e..38417dc11ba 100644
--- a/plugins/MultiSites/tests/System/expected/test___MultiSites.getAllWithGroups_day.xml
+++ b/plugins/MultiSites/tests/System/expected/test___MultiSites.getAllWithGroups_day.xml
@@ -7,6 +7,11 @@
12
12
5,082
+ 0
+ 0
+ 0
+ 0
+ 0
0
2013-01-22
@@ -44,12 +49,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -86,12 +91,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -128,12 +133,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -170,12 +175,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -212,12 +217,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -254,12 +259,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -296,12 +301,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -338,12 +343,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -380,12 +385,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -422,12 +427,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -464,12 +469,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -506,12 +511,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -548,12 +553,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -590,12 +595,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -632,12 +637,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
diff --git a/plugins/MultiSites/tests/System/expected/test__filtered__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test__filtered__MultiSites.getAllWithGroups_day.xml
index 2e280c6d727..94dd4a1da12 100644
--- a/plugins/MultiSites/tests/System/expected/test__filtered__MultiSites.getAllWithGroups_day.xml
+++ b/plugins/MultiSites/tests/System/expected/test__filtered__MultiSites.getAllWithGroups_day.xml
@@ -7,6 +7,11 @@
10
10
2,541
+ 0
+ 0
+ 0
+ 0
+ 0
0
2013-01-22
@@ -44,12 +49,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -86,12 +91,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -128,12 +133,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -170,12 +175,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -212,12 +217,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -254,12 +259,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -296,12 +301,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -338,12 +343,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -380,12 +385,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -422,12 +427,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -464,12 +469,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -506,12 +511,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -548,12 +553,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
diff --git a/plugins/MultiSites/tests/System/expected/test_limitedWithOffset__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_limitedWithOffset__MultiSites.getAllWithGroups_day.xml
index 15742481d93..0746c489b9f 100644
--- a/plugins/MultiSites/tests/System/expected/test_limitedWithOffset__MultiSites.getAllWithGroups_day.xml
+++ b/plugins/MultiSites/tests/System/expected/test_limitedWithOffset__MultiSites.getAllWithGroups_day.xml
@@ -7,6 +7,11 @@
12
12
5,082
+ 0
+ 0
+ 0
+ 0
+ 0
0
2013-01-22
@@ -44,12 +49,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -86,12 +91,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -128,12 +133,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -170,12 +175,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -212,12 +217,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
diff --git a/plugins/MultiSites/tests/System/expected/test_limitedWithOffset_filtered__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_limitedWithOffset_filtered__MultiSites.getAllWithGroups_day.xml
index e2c3a4498d5..717cac9e6ee 100644
--- a/plugins/MultiSites/tests/System/expected/test_limitedWithOffset_filtered__MultiSites.getAllWithGroups_day.xml
+++ b/plugins/MultiSites/tests/System/expected/test_limitedWithOffset_filtered__MultiSites.getAllWithGroups_day.xml
@@ -7,6 +7,11 @@
10
10
2,541
+ 0
+ 0
+ 0
+ 0
+ 0
0
2013-01-22
@@ -44,12 +49,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -86,12 +91,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -128,12 +133,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -170,12 +175,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -212,12 +217,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
diff --git a/plugins/MultiSites/tests/System/expected/test_limitedWithPattern__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_limitedWithPattern__MultiSites.getAllWithGroups_day.xml
index 07568f5f01d..e10c87f4fae 100644
--- a/plugins/MultiSites/tests/System/expected/test_limitedWithPattern__MultiSites.getAllWithGroups_day.xml
+++ b/plugins/MultiSites/tests/System/expected/test_limitedWithPattern__MultiSites.getAllWithGroups_day.xml
@@ -7,6 +7,11 @@
12
12
5,082
+ 0
+ 0
+ 0
+ 0
+ 0
0
2013-01-22
@@ -44,12 +49,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -86,12 +91,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -128,12 +133,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -170,12 +175,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -212,12 +217,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
diff --git a/plugins/MultiSites/tests/System/expected/test_limitedWithPattern_filtered__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_limitedWithPattern_filtered__MultiSites.getAllWithGroups_day.xml
index e5e25e4774a..ebd7f848a7c 100644
--- a/plugins/MultiSites/tests/System/expected/test_limitedWithPattern_filtered__MultiSites.getAllWithGroups_day.xml
+++ b/plugins/MultiSites/tests/System/expected/test_limitedWithPattern_filtered__MultiSites.getAllWithGroups_day.xml
@@ -7,6 +7,11 @@
10
10
2,541
+ 0
+ 0
+ 0
+ 0
+ 0
0
2013-01-22
@@ -44,12 +49,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -86,12 +91,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -128,12 +133,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -170,12 +175,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -212,12 +217,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
diff --git a/plugins/MultiSites/tests/System/expected/test_limited__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_limited__MultiSites.getAllWithGroups_day.xml
index 3051d6ae8d7..1338fe044bb 100644
--- a/plugins/MultiSites/tests/System/expected/test_limited__MultiSites.getAllWithGroups_day.xml
+++ b/plugins/MultiSites/tests/System/expected/test_limited__MultiSites.getAllWithGroups_day.xml
@@ -7,6 +7,11 @@
12
12
5,082
+ 0
+ 0
+ 0
+ 0
+ 0
0
2013-01-22
@@ -44,12 +49,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -86,12 +91,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -128,12 +133,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -170,12 +175,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -212,12 +217,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
diff --git a/plugins/MultiSites/tests/System/expected/test_limited_filtered__MultiSites.getAllWithGroups_day.xml b/plugins/MultiSites/tests/System/expected/test_limited_filtered__MultiSites.getAllWithGroups_day.xml
index 5bc32a3efbb..bfdeddbe204 100644
--- a/plugins/MultiSites/tests/System/expected/test_limited_filtered__MultiSites.getAllWithGroups_day.xml
+++ b/plugins/MultiSites/tests/System/expected/test_limited_filtered__MultiSites.getAllWithGroups_day.xml
@@ -7,6 +7,11 @@
10
10
2,541
+ 0
+ 0
+ 0
+ 0
+ 0
0
2013-01-22
@@ -44,12 +49,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -86,12 +91,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -128,12 +133,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -170,12 +175,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
@@ -212,12 +217,12 @@
day
Tue, Jan 22
0
- 0
- 0
- 0
- 0
- 0
- 0
+ 0
+ 0
+ 0
+ 0
+ 0
+ 0
http://piwik.net
diff --git a/plugins/MultiSites/vue/dist/MultiSites.umd.js b/plugins/MultiSites/vue/dist/MultiSites.umd.js
index 32e4dd1c352..9d51e4b4b78 100644
--- a/plugins/MultiSites/vue/dist/MultiSites.umd.js
+++ b/plugins/MultiSites/vue/dist/MultiSites.umd.js
@@ -1584,27 +1584,27 @@ var Dashboard_store_DashboardStore = /*#__PURE__*/function () {
}
if (_this2.state.value.sortColumn === 'pageviews_evolution') {
- previousTotal = "".concat(site.previous_Actions_nb_pageviews);
+ previousTotal = "".concat(site.previous_nb_pageviews);
currentTotal = "".concat(site.nb_pageviews);
evolution = external_CoreHome_["NumberFormatter"].formatPercent(site.pageviews_evolution);
metricName = Object(external_CoreHome_["translate"])('General_ColumnPageviews');
- previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatNumber(Math.round(parseInt(site.previous_Actions_nb_pageviews, 10) * parseInt(site.ratio, 10)));
+ previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatNumber(Math.round(parseInt(site.previous_nb_pageviews, 10) * parseInt(site.ratio, 10)));
}
if (_this2.state.value.sortColumn === 'hits_evolution') {
- previousTotal = "".concat(site.previous_Actions_hits);
+ previousTotal = "".concat(site.previous_hits);
currentTotal = "".concat(site.hits);
evolution = external_CoreHome_["NumberFormatter"].formatPercent(site.hits_evolution);
metricName = Object(external_CoreHome_["translate"])('General_ColumnHits');
- previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatNumber(Math.round(parseInt(site.previous_Actions_hits, 10) * parseInt(site.ratio, 10)));
+ previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatNumber(Math.round(parseInt(site.previous_hits, 10) * parseInt(site.ratio, 10)));
}
if (_this2.state.value.sortColumn === 'revenue_evolution') {
- previousTotal = external_CoreHome_["NumberFormatter"].formatCurrency(site.previous_Goal_revenue, site.currencySymbol);
+ previousTotal = external_CoreHome_["NumberFormatter"].formatCurrency(site.previous_revenue, site.currencySymbol);
currentTotal = external_CoreHome_["NumberFormatter"].formatCurrency(site.revenue, site.currencySymbol);
evolution = external_CoreHome_["NumberFormatter"].formatPercent(site.revenue_evolution);
metricName = Object(external_CoreHome_["translate"])('General_ColumnRevenue');
- previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatCurrency(Math.round(parseInt(site.previous_Goal_revenue, 10) * parseInt(site.ratio, 10)), site.currencySymbol);
+ previousTotalAdjusted = external_CoreHome_["NumberFormatter"].formatCurrency(Math.round(parseInt(site.previous_revenue, 10) * parseInt(site.ratio, 10)), site.currencySymbol);
}
if (metricName) {
diff --git a/plugins/MultiSites/vue/dist/MultiSites.umd.min.js b/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
index fe7133712fa..69ffc17422f 100644
--- a/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
+++ b/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
@@ -4,13 +4,13 @@
*
* @link https://matomo.org
* @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */var f="desc",g="nb_visits",S=function(){function e(){var t=this;v(this,e),j(this,"fetchAbort",null),j(this,"privateState",Object(o["reactive"])({dashboardKPIs:{evolutionPeriod:"day",hits:"?",hitsEvolution:"",hitsTrend:0,pageviews:"?",pageviewsEvolution:"",pageviewsTrend:0,revenue:"?",revenueEvolution:"",revenueTrend:0,visits:"?",visitsEvolution:"",visitsTrend:0},dashboardSites:[],errorLoading:!1,isLoadingKPIs:!1,isLoadingSites:!1,numSites:0,paginationCurrentPage:0,sparklineDate:"",sortColumn:g,sortOrder:f})),j(this,"autoRefreshInterval",0),j(this,"autoRefreshTimeout",null),j(this,"pageSize",25),j(this,"searchTerm",""),j(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),j(this,"numberOfPages",Object(o["computed"])((function(){return Math.ceil(t.state.value.numSites/t.pageSize-1)}))),j(this,"currentPagingOffset",Object(o["computed"])((function(){return Math.ceil(t.state.value.paginationCurrentPage*t.pageSize)}))),j(this,"paginationLowerBound",Object(o["computed"])((function(){return 0===t.state.value.numSites?0:1+t.currentPagingOffset.value}))),j(this,"paginationUpperBound",Object(o["computed"])((function(){if(0===t.state.value.numSites)return 0;var e=t.pageSize+t.currentPagingOffset.value,n=t.state.value.numSites;return e0&&void 0!==arguments[0]&&arguments[0];this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelAutoRefresh()),this.fetchAbort=new AbortController,this.privateState.errorLoading=!1,this.privateState.isLoadingKPIs=!t,this.privateState.isLoadingSites=!0;var n={method:"MultiSites.mockDashboardData",filter_limit:this.pageSize,filter_offset:this.currentPagingOffset.value,filter_sort_column:this.privateState.sortColumn,filter_sort_order:this.privateState.sortOrder,showColumns:["hits_evolution","hits_evolution_trend","label","hits","nb_pageviews","nb_visits","pageviews_evolution","pageviews_evolution_trend","revenue","revenue_evolution","revenue_evolution_trend","visits_evolution","visits_evolution_trend"].join(",")};return this.searchTerm&&(n.pattern=this.searchTerm),m["AjaxHelper"].fetch(n,{abortController:this.fetchAbort}).then((function(n){t||e.updateDashboardKPIs(n),e.updateDashboardSites(n)})).catch((function(){e.privateState.dashboardSites=[],e.privateState.errorLoading=!0})).finally((function(){e.privateState.isLoadingKPIs=!1,e.privateState.isLoadingSites=!1,e.fetchAbort=null,e.startAutoRefresh()}))}},{key:"startAutoRefresh",value:function(){var e=this;if(this.cancelAutoRefresh(),!(this.autoRefreshInterval<=0)){var t;try{t=m["Periods"].parse(m["Matomo"].period,m["Matomo"].currentDateString)}catch(n){}t&&t.containsToday()&&(this.autoRefreshTimeout=setTimeout((function(){e.autoRefreshTimeout=null,e.refreshData()}),1e3*this.autoRefreshInterval))}}},{key:"updateDashboardKPIs",value:function(e){this.privateState.dashboardKPIs={evolutionPeriod:m["Matomo"].period,hits:e.totals.hits,hitsEvolution:e.totals.hits_evolution,hitsTrend:e.totals.hits_evolution_trend,pageviews:e.totals.nb_pageviews,pageviewsEvolution:e.totals.pageviews_evolution,pageviewsTrend:e.totals.pageviews_evolution_trend,revenue:e.totals.revenue,revenueEvolution:e.totals.revenue_evolution,revenueTrend:e.totals.revenue_evolution_trend,visits:e.totals.nb_visits,visitsEvolution:e.totals.visits_evolution,visitsTrend:e.totals.visits_evolution_trend}}},{key:"updateDashboardSites",value:function(e){this.privateState.dashboardSites=e.sites,this.privateState.numSites=e.numSites,this.privateState.sparklineDate=e.sparklineDate}}]),e}(),k=new S,y={class:"kpiCardContainer"},_={key:0,class:"kpiCard kpiCardLoading"},C=Object(o["createElementVNode"])("div",{class:"kpiCardTitle"}," ",-1),E={class:"kpiCardValue"},N=Object(o["createElementVNode"])("div",{class:"kpiCardEvolution"},[Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ")],-1),V={key:0,class:"kpiCardBadge"};function w(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("KPICard");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",y,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",_,[C,Object(o["createElementVNode"])("div",E,[Object(o["createVNode"])(s)]),N,e.hasKpiBadge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",V," ")):Object(o["createCommentVNode"])("",!0)])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:1},Object(o["renderList"])(e.kpis,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:"kpi-card-".concat(n)},[n>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,class:Object(o["normalizeClass"])({kpiCardDivider:!0,kpiCardDividerBadge:e.hasKpiBadge})}," ",2)):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(l,{"model-value":t},null,8,["model-value"])],64)})),128))])}var T={class:"kpiCard"},B={class:"kpiCardTitle"},P={class:"kpiCardValue"},M={class:"kpiCardEvolution"},D={key:1,class:"kpiCardEvolution"},x=Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ",-1),L=[x],G=["innerHTML"];function A(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",T,[Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardIcon ".concat(e.kpi.icon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.kpi.title)),1)]),Object(o["createElementVNode"])("div",P,Object(o["toDisplayString"])(e.kpi.value),1),Object(o["createElementVNode"])("div",M,[""!==e.kpi.evolutionValue?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionTrend ".concat(e.evolutionTrendClass))},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionIcon ".concat(e.evolutionTrendIcon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.kpi.evolutionValue),1)],2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.evolutionTrendFrom)),1)],64)):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",D,L))]),e.kpi.badge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.kpi.badge),class:"kpiCardBadge"},null,8,G)):Object(o["createCommentVNode"])("",!0)])}var R=Object(o["defineComponent"])({props:{modelValue:{type:Object,required:!0}},computed:{evolutionTrendFrom:function(){switch(this.kpi.evolutionPeriod){case"day":return"MultiSites_EvolutionFromPreviousDay";case"week":return"MultiSites_EvolutionFromPreviousWeek";case"month":return"MultiSites_EvolutionFromPreviousMonth";case"year":return"MultiSites_EvolutionFromPreviousYear";default:return"MultiSites_EvolutionFromPreviousPeriod"}},evolutionTrendClass:function(){return 1===this.kpi.evolutionTrend?"kpiTrendPositive":-1===this.kpi.evolutionTrend?"kpiTrendNegative":"kpiTrendNeutral"},evolutionTrendIcon:function(){return 1===this.kpi.evolutionTrend?"icon-chevron-up":-1===this.kpi.evolutionTrend?"icon-chevron-down":"icon-circle"},kpi:function(){return this.modelValue}}});R.render=A;var I=R,z=Object(o["defineComponent"])({components:{MatomoLoader:m["MatomoLoader"],KPICard:I},props:{isLoading:Boolean,modelValue:{type:Array,required:!0}},computed:{hasKpiBadge:function(){return this.kpis.some((function(e){return!!e.badge}))},kpis:function(){return this.modelValue}}});z.render=w;var F=z,U={class:"sitesTableContainer"},H={class:"card-table dataTable sitesTable"},q={class:"sitesTableEvolutionSelector"},K=["value"],W={value:"hits_evolution"},$={value:"visits_evolution"},J={value:"pageviews_evolution"},Y={key:0,value:"revenue_evolution"},Q={key:0},X={class:"sitesTableLoading",colspan:"7"},Z={key:1},ee={colspan:"7"},te={class:"notification system notification-error"},ne=Object(o["createElementVNode"])("br",null,null,-1),re=Object(o["createElementVNode"])("br",null,null,-1),ae=["href"],oe=Object(o["createTextVNode"])(" – "),ie=["href"],se=["href"],le=Object(o["createTextVNode"])(". "),ce={key:0,class:"sitesTablePagination"},ue={class:"dataTablePages"};function de(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("SitesTableSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("table",H,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{onClick:t[0]||(t[0]=function(t){return e.sortBy("label")}),class:"label"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Website"))+" ",1),"label"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},["nb_visits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)]),Object(o["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},["nb_pageviews"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)]),Object(o["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},["hits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)]),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},["revenue"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)})},[e.sortColumn===e.evolutionSelector?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1)]),Object(o["createElementVNode"])("th",q,[Object(o["createElementVNode"])("select",{class:"browser-default",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){return e.changeEvolutionSelector(t.target.value)})},[Object(o["createElementVNode"])("option",W,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),Object(o["createElementVNode"])("option",$,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",J,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Y,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,K)])])]),Object(o["createElementVNode"])("tbody",null,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Q,[Object(o["createElementVNode"])("td",X,[Object(o["createVNode"])(s)])])):e.errorLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Z,[Object(o["createElementVNode"])("td",ee,[Object(o["createElementVNode"])("div",te,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),ne,re,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,ae),oe,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,ie),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.errorShowProfessionalHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/support-plans/")},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,se),[[o["vShow"],e.errorShowProfessionalHelp]]),le])])])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:2},Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"display-revenue":e.displayRevenue,"evolution-metric":e.evolutionMetric,key:"site-".concat(t.idsite),"model-value":t,"sparkline-date":e.sparklineDate,"sparkline-metric":e.sparklineMetric},null,8,["display-revenue","evolution-metric","model-value","sparkline-date","sparkline-metric"])})),128))])])]),!e.isLoading||e.paginationUpperBound>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ce,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.navigatePreviousPage()})}," « "+Object(o["toDisplayString"])(e.translate("General_Previous")),513),[[o["vShow"],0!==e.paginationCurrentPage]]),Object(o["createElementVNode"])("span",ue,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTableNext",onClick:t[8]||(t[8]=function(t){return e.navigateNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" » ",513),[[o["vShow"],e.paginationCurrentPage0&&void 0!==arguments[0]&&arguments[0];this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelAutoRefresh()),this.fetchAbort=new AbortController,this.privateState.errorLoading=!1,this.privateState.isLoadingKPIs=!t,this.privateState.isLoadingSites=!0;var n={method:"MultiSites.mockDashboardData",filter_limit:this.pageSize,filter_offset:this.currentPagingOffset.value,filter_sort_column:this.privateState.sortColumn,filter_sort_order:this.privateState.sortOrder,showColumns:["hits_evolution","hits_evolution_trend","label","hits","nb_pageviews","nb_visits","pageviews_evolution","pageviews_evolution_trend","revenue","revenue_evolution","revenue_evolution_trend","visits_evolution","visits_evolution_trend"].join(",")};return this.searchTerm&&(n.pattern=this.searchTerm),m["AjaxHelper"].fetch(n,{abortController:this.fetchAbort}).then((function(n){t||e.updateDashboardKPIs(n),e.updateDashboardSites(n)})).catch((function(){e.privateState.dashboardSites=[],e.privateState.errorLoading=!0})).finally((function(){e.privateState.isLoadingKPIs=!1,e.privateState.isLoadingSites=!1,e.fetchAbort=null,e.startAutoRefresh()}))}},{key:"startAutoRefresh",value:function(){var e=this;if(this.cancelAutoRefresh(),!(this.autoRefreshInterval<=0)){var t;try{t=m["Periods"].parse(m["Matomo"].period,m["Matomo"].currentDateString)}catch(n){}t&&t.containsToday()&&(this.autoRefreshTimeout=setTimeout((function(){e.autoRefreshTimeout=null,e.refreshData()}),1e3*this.autoRefreshInterval))}}},{key:"updateDashboardKPIs",value:function(e){this.privateState.dashboardKPIs={evolutionPeriod:m["Matomo"].period,hits:e.totals.hits,hitsEvolution:e.totals.hits_evolution,hitsTrend:e.totals.hits_evolution_trend,pageviews:e.totals.nb_pageviews,pageviewsEvolution:e.totals.pageviews_evolution,pageviewsTrend:e.totals.pageviews_evolution_trend,revenue:e.totals.revenue,revenueEvolution:e.totals.revenue_evolution,revenueTrend:e.totals.revenue_evolution_trend,visits:e.totals.nb_visits,visitsEvolution:e.totals.visits_evolution,visitsTrend:e.totals.visits_evolution_trend}}},{key:"updateDashboardSites",value:function(e){this.privateState.dashboardSites=e.sites,this.privateState.numSites=e.numSites,this.privateState.sparklineDate=e.sparklineDate}}]),e}(),k=new S,y={class:"kpiCardContainer"},_={key:0,class:"kpiCard kpiCardLoading"},C=Object(o["createElementVNode"])("div",{class:"kpiCardTitle"}," ",-1),E={class:"kpiCardValue"},N=Object(o["createElementVNode"])("div",{class:"kpiCardEvolution"},[Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ")],-1),V={key:0,class:"kpiCardBadge"};function w(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("KPICard");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",y,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",_,[C,Object(o["createElementVNode"])("div",E,[Object(o["createVNode"])(s)]),N,e.hasKpiBadge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",V," ")):Object(o["createCommentVNode"])("",!0)])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:1},Object(o["renderList"])(e.kpis,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:"kpi-card-".concat(n)},[n>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,class:Object(o["normalizeClass"])({kpiCardDivider:!0,kpiCardDividerBadge:e.hasKpiBadge})}," ",2)):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(l,{"model-value":t},null,8,["model-value"])],64)})),128))])}var T={class:"kpiCard"},B={class:"kpiCardTitle"},P={class:"kpiCardValue"},M={class:"kpiCardEvolution"},D={key:1,class:"kpiCardEvolution"},x=Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ",-1),L=[x],G=["innerHTML"];function R(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",T,[Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardIcon ".concat(e.kpi.icon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.kpi.title)),1)]),Object(o["createElementVNode"])("div",P,Object(o["toDisplayString"])(e.kpi.value),1),Object(o["createElementVNode"])("div",M,[""!==e.kpi.evolutionValue?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionTrend ".concat(e.evolutionTrendClass))},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionIcon ".concat(e.evolutionTrendIcon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.kpi.evolutionValue),1)],2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.evolutionTrendFrom)),1)],64)):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",D,L))]),e.kpi.badge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.kpi.badge),class:"kpiCardBadge"},null,8,G)):Object(o["createCommentVNode"])("",!0)])}var A=Object(o["defineComponent"])({props:{modelValue:{type:Object,required:!0}},computed:{evolutionTrendFrom:function(){switch(this.kpi.evolutionPeriod){case"day":return"MultiSites_EvolutionFromPreviousDay";case"week":return"MultiSites_EvolutionFromPreviousWeek";case"month":return"MultiSites_EvolutionFromPreviousMonth";case"year":return"MultiSites_EvolutionFromPreviousYear";default:return"MultiSites_EvolutionFromPreviousPeriod"}},evolutionTrendClass:function(){return 1===this.kpi.evolutionTrend?"kpiTrendPositive":-1===this.kpi.evolutionTrend?"kpiTrendNegative":"kpiTrendNeutral"},evolutionTrendIcon:function(){return 1===this.kpi.evolutionTrend?"icon-chevron-up":-1===this.kpi.evolutionTrend?"icon-chevron-down":"icon-circle"},kpi:function(){return this.modelValue}}});A.render=R;var I=A,z=Object(o["defineComponent"])({components:{MatomoLoader:m["MatomoLoader"],KPICard:I},props:{isLoading:Boolean,modelValue:{type:Array,required:!0}},computed:{hasKpiBadge:function(){return this.kpis.some((function(e){return!!e.badge}))},kpis:function(){return this.modelValue}}});z.render=w;var F=z,U={class:"sitesTableContainer"},H={class:"card-table dataTable sitesTable"},q={class:"sitesTableEvolutionSelector"},K=["value"],W={value:"hits_evolution"},$={value:"visits_evolution"},J={value:"pageviews_evolution"},Y={key:0,value:"revenue_evolution"},Q={key:0},X={class:"sitesTableLoading",colspan:"7"},Z={key:1},ee={colspan:"7"},te={class:"notification system notification-error"},ne=Object(o["createElementVNode"])("br",null,null,-1),re=Object(o["createElementVNode"])("br",null,null,-1),ae=["href"],oe=Object(o["createTextVNode"])(" – "),ie=["href"],se=["href"],le=Object(o["createTextVNode"])(". "),ce={key:0,class:"sitesTablePagination"},ue={class:"dataTablePages"};function de(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("SitesTableSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("table",H,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{onClick:t[0]||(t[0]=function(t){return e.sortBy("label")}),class:"label"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Website"))+" ",1),"label"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},["nb_visits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)]),Object(o["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},["nb_pageviews"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)]),Object(o["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},["hits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)]),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},["revenue"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)})},[e.sortColumn===e.evolutionSelector?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1)]),Object(o["createElementVNode"])("th",q,[Object(o["createElementVNode"])("select",{class:"browser-default",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){return e.changeEvolutionSelector(t.target.value)})},[Object(o["createElementVNode"])("option",W,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),Object(o["createElementVNode"])("option",$,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",J,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Y,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,K)])])]),Object(o["createElementVNode"])("tbody",null,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Q,[Object(o["createElementVNode"])("td",X,[Object(o["createVNode"])(s)])])):e.errorLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Z,[Object(o["createElementVNode"])("td",ee,[Object(o["createElementVNode"])("div",te,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),ne,re,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,ae),oe,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,ie),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.errorShowProfessionalHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/support-plans/")},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,se),[[o["vShow"],e.errorShowProfessionalHelp]]),le])])])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:2},Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"display-revenue":e.displayRevenue,"evolution-metric":e.evolutionMetric,key:"site-".concat(t.idsite),"model-value":t,"sparkline-date":e.sparklineDate,"sparkline-metric":e.sparklineMetric},null,8,["display-revenue","evolution-metric","model-value","sparkline-date","sparkline-metric"])})),128))])])]),!e.isLoading||e.paginationUpperBound>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ce,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.navigatePreviousPage()})}," « "+Object(o["toDisplayString"])(e.translate("General_Previous")),513),[[o["vShow"],0!==e.paginationCurrentPage]]),Object(o["createElementVNode"])("span",ue,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTableNext",onClick:t[8]||(t[8]=function(t){return e.navigateNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" » ",513),[[o["vShow"],e.paginationCurrentPagen&&(e=n),e})))}return ht(e,[{key:"cancelRefereshInterval",value:function(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)}},{key:"updateWebsitesList",value:function(e){var t=this;if(e){var n=e.sites;n.forEach((function(e){if(1!==e.ratio&&"1"!==e.ratio){var n=m["NumberFormatter"].formatPercent(Math.round(100*parseInt(e.ratio,10))),r=null,a="0",o="0",i="0",s="0";if("nb_visits"!==t.state.value.sortColumn&&"visits_evolution"!==t.state.value.sortColumn||(a=m["NumberFormatter"].formatNumber(e.previous_nb_visits),o=m["NumberFormatter"].formatNumber(e.nb_visits),i=m["NumberFormatter"].formatPercent(e.visits_evolution),r=Object(m["translate"])("General_ColumnNbVisits"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_nb_visits,10)*parseInt(e.ratio,10)))),"pageviews_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_Actions_nb_pageviews),o="".concat(e.nb_pageviews),i=m["NumberFormatter"].formatPercent(e.pageviews_evolution),r=Object(m["translate"])("General_ColumnPageviews"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_Actions_nb_pageviews,10)*parseInt(e.ratio,10)))),"hits_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_Actions_hits),o="".concat(e.hits),i=m["NumberFormatter"].formatPercent(e.hits_evolution),r=Object(m["translate"])("General_ColumnHits"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_Actions_hits,10)*parseInt(e.ratio,10)))),"revenue_evolution"===t.state.value.sortColumn&&(a=m["NumberFormatter"].formatCurrency(e.previous_Goal_revenue,e.currencySymbol),o=m["NumberFormatter"].formatCurrency(e.revenue,e.currencySymbol),i=m["NumberFormatter"].formatPercent(e.revenue_evolution),r=Object(m["translate"])("General_ColumnRevenue"),s=m["NumberFormatter"].formatCurrency(Math.round(parseInt(e.previous_Goal_revenue,10)*parseInt(e.ratio,10)),e.currencySymbol)),r)switch(e.tooltip="".concat(Object(m["translate"])("MultiSites_EvolutionComparisonIncomplete",[n]),"\n"),e.tooltip+="".concat(Object(m["translate"])("MultiSites_EvolutionComparisonProportional",[n,"".concat(s),r,"".concat(a)]),"\n"),e.periodName){case"day":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonDay",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"week":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonWeek",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"month":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonMonth",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"year":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonYear",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;default:break}}})),this.privateState.totalVisits=e.totals.nb_visits,this.privateState.totalPageviews=e.totals.nb_pageviews,this.privateState.totalHits=e.totals.hits,this.privateState.totalActions=e.totals.nb_actions,this.privateState.totalRevenue=e.totals.revenue,this.privateState.lastVisits=e.totals.nb_visits_lastdate,this.privateState.sites=n,this.privateState.numberOfSites=e.numSites,this.privateState.lastVisitsDate=e.lastDate}else this.onError()}},{key:"sortBy",value:function(e){this.state.value.sortColumn===e&&(this.privateState.reverse=!this.state.value.reverse),this.privateState.sortColumn=e,this.fetchAllSites()}},{key:"previousPage",value:function(){this.privateState.currentPage=this.state.value.currentPage-1,this.fetchAllSites()}},{key:"nextPage",value:function(){this.privateState.currentPage=this.state.value.currentPage+1,this.fetchAllSites()}},{key:"searchSite",value:function(e){this.privateState.searchTerm=e,this.privateState.currentPage=0,this.fetchAllSites()}},{key:"fetchAllSites",value:function(){var e=this;this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelRefereshInterval()),this.privateState.isLoading=!0,this.privateState.errorLoadingSites=!1;var t={method:"MultiSites.getAllWithGroups",hideMetricsDoc:"1",filter_sort_order:"asc",filter_limit:this.state.value.pageSize,filter_offset:this.currentPagingOffset.value,showColumns:["label","nb_visits","nb_pageviews","hits","visits_evolution","visits_evolution_trend","pageviews_evolution","pageviews_evolution_trend","hits_evolution","hits_evolution_trend","revenue_evolution","revenue_evolution_trend","nb_actions","revenue"].join(",")};return this.privateState.searchTerm&&(t.pattern=this.privateState.searchTerm),this.privateState.sortColumn&&(t.filter_sort_column=this.privateState.sortColumn),this.privateState.reverse&&(t.filter_sort_order="desc"),this.fetchAbort=new AbortController,m["AjaxHelper"].fetch(t,{abortController:this.fetchAbort}).then((function(t){e.updateWebsitesList(t)})).catch((function(){e.onError()})).finally((function(){e.privateState.isLoading=!1,e.fetchAbort=null,e.state.value.refreshInterval&&e.state.value.refreshInterval>0&&(e.cancelRefereshInterval(),e.refreshTimeout=setTimeout((function(){e.refreshTimeout=null,e.fetchAllSites()}),1e3*e.state.value.refreshInterval))}))}},{key:"onError",value:function(){this.privateState.errorLoadingSites=!0,this.privateState.sites=[]}},{key:"setRefreshInterval",value:function(e){this.privateState.refreshInterval=e}},{key:"setPageSize",value:function(e){this.privateState.pageSize=e}}]),e}(),ft=new jt,gt={ref:"root"},St={class:"card-title"},kt=["innerHTML","title"],yt={id:"mt",class:"dataTable card-table",cellspacing:"0"},_t={class:"heading"},Ct={class:"heading"},Et={class:"heading"},Nt={class:"heading"},Vt={class:"heading"},wt=["colspan"],Tt=["value"],Bt={value:"visits_evolution"},Pt={value:"pageviews_evolution"},Mt={value:"hits_evolution"},Dt={key:0,value:"revenue_evolution"},xt={key:0},Lt={colspan:"7",class:"allWebsitesLoading"},Gt={key:1},At={key:0},Rt={colspan:"7"},It={class:"notification system notification-error"},zt=Object(o["createElementVNode"])("br",null,null,-1),Ft=Object(o["createElementVNode"])("br",null,null,-1),Ut=["href"],Ht=Object(o["createTextVNode"])(" – "),qt=["href"],Kt=["href"],Wt=Object(o["createTextVNode"])(". "),$t={colspan:"8",class:"paging"},Jt={class:"row"},Yt={class:"col s3 add_new_site"},Qt=["href"],Xt=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),Zt={class:"col s6"},en={style:{cursor:"pointer"}},tn={class:"dataTablePages"},nn={id:"counter"},rn={style:{cursor:"pointer"},class:"pointer"},an=Object(o["createElementVNode"])("div",{class:"col s3"}," ",-1),on={row_id:"last"},sn={colspan:"8",class:"site_search"},ln={class:"row"},cn={class:"input-field col s12"},un=["placeholder"],dn=["title"];function bn(e,t,n,r,a,i){var s=this,l=Object(o["resolveComponent"])("EnrichedHeadline"),c=Object(o["resolveComponent"])("ActivityIndicator"),u=Object(o["resolveComponent"])("MultisitesSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",gt,[Object(o["createElementVNode"])("h2",St,[Object(o["createVNode"])(l,{"help-url":e.externalRawLink("https://matomo.org/faq/new-to-piwik/all-websites-dashboard/"),"feature-name":e.translate("General_AllWebsitesDashboard")},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_AllWebsitesDashboard"))+" ",1),Object(o["createElementVNode"])("span",{class:"smallTitle",innerHTML:e.$sanitize(s.smallTitleContent),title:e.smallTitleTooltip},null,8,kt)]})),_:1},8,["help-url","feature-name"])]),Object(o["createElementVNode"])("table",yt,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{id:"names",class:Object(o["normalizeClass"])(["label",{columnSorted:"label"===e.sortColumn}]),onClick:t[0]||(t[0]=function(t){return e.sortBy("label")})},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"label"===e.sortColumn,multisites_desc:e.reverse&&"label"===e.sortColumn}]),style:{"margin-left":"3.5px"}},null,2)],2),Object(o["createElementVNode"])("th",{id:"visits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_visits"===e.sortColumn}]),onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_visits"===e.sortColumn,multisites_desc:e.reverse&&"nb_visits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Ct,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)],2),Object(o["createElementVNode"])("th",{id:"pageviews",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_pageviews"===e.sortColumn}]),onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_pageviews"===e.sortColumn,multisites_desc:e.reverse&&"nb_pageviews"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Et,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)],2),Object(o["createElementVNode"])("th",{id:"hits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"hits"===e.sortColumn}]),onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"hits"===e.sortColumn,multisites_desc:e.reverse&&"hits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Nt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)],2),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,id:"revenue",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"revenue"===e.sortColumn}]),onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"revenue"===e.sortColumn,multisites_desc:e.reverse&&"revenue"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Vt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)],2)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{id:"evolution",class:Object(o["normalizeClass"])({columnSorted:e.evolutionSelector===e.sortColumn}),colspan:e.showSparklines?2:1},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&e.evolutionSelector===e.sortColumn,multisites_desc:e.reverse&&e.evolutionSelector===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",{class:"evolution",onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)}),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1),Object(o["createElementVNode"])("select",{class:"selector browser-default",id:"evolution_selector",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){e.evolutionSelector=t.target.value,e.sortBy(e.evolutionSelector)})},[Object(o["createElementVNode"])("option",Bt,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",Pt,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),Object(o["createElementVNode"])("option",Mt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Dt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,Tt)],10,wt)])]),e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",xt,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",Lt,[Object(o["createVNode"])(c,{"loading-message":e.loadingMessage,loading:e.isLoading},null,8,["loading-message","loading"])])])])):Object(o["createCommentVNode"])("",!0),e.isLoading?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",Gt,[e.errorLoadingSites?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",At,[Object(o["createElementVNode"])("td",Rt,[Object(o["createElementVNode"])("div",It,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),zt,Ft,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,Ut),Ht,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,qt),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.professionalHelpUrl},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,Kt),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Wt])])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(u,{key:t.idsite,website:t,"evolution-metric":e.evolutionSelector,"date-sparkline":e.dateSparkline,"show-sparklines":e.showSparklines,metric:e.sortColumn,"display-revenue-column":e.displayRevenueColumn},null,8,["website","evolution-metric","date-sparkline","show-sparklines","metric","display-revenue-column"])})),128))])),Object(o["createElementVNode"])("tfoot",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",$t,[Object(o["createElementVNode"])("div",Jt,[Object(o["createElementVNode"])("div",Yt,[e.hasSuperUserAccess?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,href:e.addSiteUrl},[Xt,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("SitesManager_AddSite")),1)],8,Qt)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",Zt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"prev",class:"previous dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.previousPage()})},[Object(o["createElementVNode"])("span",en,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],512),[[o["vShow"],!(0===e.currentPage)]]),Object(o["createElementVNode"])("span",tn,[Object(o["createElementVNode"])("span",nn,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"next",class:"next dataTableNext",onClick:t[8]||(t[8]=function(t){return e.nextPage()})},[Object(o["createElementVNode"])("span",rn,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],512),[[o["vShow"],!(e.currentPage>=e.numberOfPages)]])]),an])])]),Object(o["createElementVNode"])("tr",on,[Object(o["createElementVNode"])("td",sn,[Object(o["createElementVNode"])("div",ln,[Object(o["createElementVNode"])("div",cn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",onKeydown:t[9]||(t[9]=Object(o["withKeys"])((function(t){return e.searchSite(e.searchTerm)}),["enter"])),"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.searchTerm=t}),placeholder:e.translate("Actions_SubmenuSitesearch")},null,40,un),[[o["vModelText"],e.searchTerm]]),Object(o["createElementVNode"])("span",{class:"icon-search search_ico",onClick:t[11]||(t[11]=function(t){return e.searchSite(e.searchTerm)}),title:e.translate("General_ClickToSearch")},null,8,dn)])])])])])])],512)}var pn=Object(o["defineComponent"])({props:{displayRevenueColumn:Boolean,showSparklines:Boolean,dateSparkline:String,pageSize:Number,autoRefreshTodayReport:Number},components:{EnrichedHeadline:m["EnrichedHeadline"],ActivityIndicator:m["ActivityIndicator"],MultisitesSite:pt},data:function(){return{evolutionSelector:"visits_evolution",searchTerm:""}},created:function(){this.pageSize&&ft.setPageSize(this.pageSize),this.refresh(this.autoRefreshTodayReport)},methods:{refresh:function(e){ft.setRefreshInterval(e),ft.fetchAllSites()},sortBy:function(e){ft.sortBy(e)},previousPage:function(){ft.previousPage()},nextPage:function(){ft.nextPage()},searchSite:function(){ft.searchSite(this.searchTerm)}},computed:{hasSuperUserAccess:function(){return m["Matomo"].hasSuperUserAccess},date:function(){return m["MatomoUrl"].urlParsed.value.date},idSite:function(){return m["MatomoUrl"].urlParsed.value.idSite},url:function(){return m["Matomo"].piwik_url},period:function(){return m["Matomo"].period},areAdsForProfessionalServicesEnabled:function(){return m["Matomo"].config&&m["Matomo"].config.are_ads_enabled},sortColumn:function(){return ft.state.value.sortColumn},reverse:function(){return ft.state.value.reverse},smallTitleContent:function(){var e=ft.state.value;return Object(m["translate"])("General_TotalVisitsPageviewsActionsRevenue","".concat(e.totalVisits,""),"".concat(e.totalPageviews,""),"".concat(e.totalActions,""),"".concat(e.totalRevenue,""))},smallTitleTooltip:function(){var e=ft.state.value;return Object(m["translate"])("General_EvolutionSummaryGeneric",Object(m["translate"])("General_NVisits","".concat(e.totalVisits)),this.date,"".concat(e.lastVisits),e.lastVisitsDate,Object(m["calculateAndFormatEvolution"])(e.totalVisits,e.lastVisits))},loadingMessage:function(){return ft.state.value.loadingMessage},isLoading:function(){return ft.state.value.isLoading},errorLoadingSites:function(){return ft.state.value.errorLoadingSites},sites:function(){return ft.state.value.sites},numberOfPages:function(){return ft.numberOfPages.value},currentPage:function(){return ft.state.value.currentPage},paginationLowerBound:function(){return ft.paginationLowerBound.value},paginationUpperBound:function(){return ft.paginationUpperBound.value},numberOfFilteredSites:function(){return ft.numberOfFilteredSites.value},professionalHelpUrl:function(){return Object(m["externalRawLink"])("https://matomo.org/support-plans/")},addSiteUrl:function(){return"index.php?module=SitesManager&action=index&showaddsite=1&period=".concat(this.period,"&")+"date=".concat(this.date,"&idSite=").concat(this.idSite)}}});pn.render=bn;var mn=pn;
+ */var jt=function(){function e(){var t=this;mt(this,e),Ot(this,"privateState",Object(o["reactive"])({sites:[],isLoading:!1,pageSize:25,currentPage:0,totalVisits:"?",totalPageviews:"?",totalHits:"?",totalActions:"?",totalRevenue:"?",searchTerm:"",lastVisits:"?",lastVisitsDate:"?",numberOfSites:0,loadingMessage:Object(m["translate"])("MultiSites_LoadingWebsites"),reverse:!0,sortColumn:"nb_visits",refreshInterval:0,errorLoadingSites:!1})),Ot(this,"refreshTimeout",null),Ot(this,"fetchAbort",null),Ot(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),Ot(this,"numberOfFilteredSites",Object(o["computed"])((function(){return t.state.value.numberOfSites}))),Ot(this,"numberOfPages",Object(o["computed"])((function(){return Math.ceil(t.numberOfFilteredSites.value/t.state.value.pageSize-1)}))),Ot(this,"currentPagingOffset",Object(o["computed"])((function(){return Math.ceil(t.state.value.currentPage*t.state.value.pageSize)}))),Ot(this,"paginationLowerBound",Object(o["computed"])((function(){return t.currentPagingOffset.value+1}))),Ot(this,"paginationUpperBound",Object(o["computed"])((function(){var e=t.currentPagingOffset.value+t.state.value.pageSize,n=t.numberOfFilteredSites.value;return e>n&&(e=n),e})))}return ht(e,[{key:"cancelRefereshInterval",value:function(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)}},{key:"updateWebsitesList",value:function(e){var t=this;if(e){var n=e.sites;n.forEach((function(e){if(1!==e.ratio&&"1"!==e.ratio){var n=m["NumberFormatter"].formatPercent(Math.round(100*parseInt(e.ratio,10))),r=null,a="0",o="0",i="0",s="0";if("nb_visits"!==t.state.value.sortColumn&&"visits_evolution"!==t.state.value.sortColumn||(a=m["NumberFormatter"].formatNumber(e.previous_nb_visits),o=m["NumberFormatter"].formatNumber(e.nb_visits),i=m["NumberFormatter"].formatPercent(e.visits_evolution),r=Object(m["translate"])("General_ColumnNbVisits"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_nb_visits,10)*parseInt(e.ratio,10)))),"pageviews_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_nb_pageviews),o="".concat(e.nb_pageviews),i=m["NumberFormatter"].formatPercent(e.pageviews_evolution),r=Object(m["translate"])("General_ColumnPageviews"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_nb_pageviews,10)*parseInt(e.ratio,10)))),"hits_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_hits),o="".concat(e.hits),i=m["NumberFormatter"].formatPercent(e.hits_evolution),r=Object(m["translate"])("General_ColumnHits"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_hits,10)*parseInt(e.ratio,10)))),"revenue_evolution"===t.state.value.sortColumn&&(a=m["NumberFormatter"].formatCurrency(e.previous_revenue,e.currencySymbol),o=m["NumberFormatter"].formatCurrency(e.revenue,e.currencySymbol),i=m["NumberFormatter"].formatPercent(e.revenue_evolution),r=Object(m["translate"])("General_ColumnRevenue"),s=m["NumberFormatter"].formatCurrency(Math.round(parseInt(e.previous_revenue,10)*parseInt(e.ratio,10)),e.currencySymbol)),r)switch(e.tooltip="".concat(Object(m["translate"])("MultiSites_EvolutionComparisonIncomplete",[n]),"\n"),e.tooltip+="".concat(Object(m["translate"])("MultiSites_EvolutionComparisonProportional",[n,"".concat(s),r,"".concat(a)]),"\n"),e.periodName){case"day":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonDay",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"week":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonWeek",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"month":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonMonth",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"year":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonYear",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;default:break}}})),this.privateState.totalVisits=e.totals.nb_visits,this.privateState.totalPageviews=e.totals.nb_pageviews,this.privateState.totalHits=e.totals.hits,this.privateState.totalActions=e.totals.nb_actions,this.privateState.totalRevenue=e.totals.revenue,this.privateState.lastVisits=e.totals.nb_visits_lastdate,this.privateState.sites=n,this.privateState.numberOfSites=e.numSites,this.privateState.lastVisitsDate=e.lastDate}else this.onError()}},{key:"sortBy",value:function(e){this.state.value.sortColumn===e&&(this.privateState.reverse=!this.state.value.reverse),this.privateState.sortColumn=e,this.fetchAllSites()}},{key:"previousPage",value:function(){this.privateState.currentPage=this.state.value.currentPage-1,this.fetchAllSites()}},{key:"nextPage",value:function(){this.privateState.currentPage=this.state.value.currentPage+1,this.fetchAllSites()}},{key:"searchSite",value:function(e){this.privateState.searchTerm=e,this.privateState.currentPage=0,this.fetchAllSites()}},{key:"fetchAllSites",value:function(){var e=this;this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelRefereshInterval()),this.privateState.isLoading=!0,this.privateState.errorLoadingSites=!1;var t={method:"MultiSites.getAllWithGroups",hideMetricsDoc:"1",filter_sort_order:"asc",filter_limit:this.state.value.pageSize,filter_offset:this.currentPagingOffset.value,showColumns:["label","nb_visits","nb_pageviews","hits","visits_evolution","visits_evolution_trend","pageviews_evolution","pageviews_evolution_trend","hits_evolution","hits_evolution_trend","revenue_evolution","revenue_evolution_trend","nb_actions","revenue"].join(",")};return this.privateState.searchTerm&&(t.pattern=this.privateState.searchTerm),this.privateState.sortColumn&&(t.filter_sort_column=this.privateState.sortColumn),this.privateState.reverse&&(t.filter_sort_order="desc"),this.fetchAbort=new AbortController,m["AjaxHelper"].fetch(t,{abortController:this.fetchAbort}).then((function(t){e.updateWebsitesList(t)})).catch((function(){e.onError()})).finally((function(){e.privateState.isLoading=!1,e.fetchAbort=null,e.state.value.refreshInterval&&e.state.value.refreshInterval>0&&(e.cancelRefereshInterval(),e.refreshTimeout=setTimeout((function(){e.refreshTimeout=null,e.fetchAllSites()}),1e3*e.state.value.refreshInterval))}))}},{key:"onError",value:function(){this.privateState.errorLoadingSites=!0,this.privateState.sites=[]}},{key:"setRefreshInterval",value:function(e){this.privateState.refreshInterval=e}},{key:"setPageSize",value:function(e){this.privateState.pageSize=e}}]),e}(),ft=new jt,gt={ref:"root"},St={class:"card-title"},kt=["innerHTML","title"],yt={id:"mt",class:"dataTable card-table",cellspacing:"0"},_t={class:"heading"},Ct={class:"heading"},Et={class:"heading"},Nt={class:"heading"},Vt={class:"heading"},wt=["colspan"],Tt=["value"],Bt={value:"visits_evolution"},Pt={value:"pageviews_evolution"},Mt={value:"hits_evolution"},Dt={key:0,value:"revenue_evolution"},xt={key:0},Lt={colspan:"7",class:"allWebsitesLoading"},Gt={key:1},Rt={key:0},At={colspan:"7"},It={class:"notification system notification-error"},zt=Object(o["createElementVNode"])("br",null,null,-1),Ft=Object(o["createElementVNode"])("br",null,null,-1),Ut=["href"],Ht=Object(o["createTextVNode"])(" – "),qt=["href"],Kt=["href"],Wt=Object(o["createTextVNode"])(". "),$t={colspan:"8",class:"paging"},Jt={class:"row"},Yt={class:"col s3 add_new_site"},Qt=["href"],Xt=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),Zt={class:"col s6"},en={style:{cursor:"pointer"}},tn={class:"dataTablePages"},nn={id:"counter"},rn={style:{cursor:"pointer"},class:"pointer"},an=Object(o["createElementVNode"])("div",{class:"col s3"}," ",-1),on={row_id:"last"},sn={colspan:"8",class:"site_search"},ln={class:"row"},cn={class:"input-field col s12"},un=["placeholder"],dn=["title"];function bn(e,t,n,r,a,i){var s=this,l=Object(o["resolveComponent"])("EnrichedHeadline"),c=Object(o["resolveComponent"])("ActivityIndicator"),u=Object(o["resolveComponent"])("MultisitesSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",gt,[Object(o["createElementVNode"])("h2",St,[Object(o["createVNode"])(l,{"help-url":e.externalRawLink("https://matomo.org/faq/new-to-piwik/all-websites-dashboard/"),"feature-name":e.translate("General_AllWebsitesDashboard")},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_AllWebsitesDashboard"))+" ",1),Object(o["createElementVNode"])("span",{class:"smallTitle",innerHTML:e.$sanitize(s.smallTitleContent),title:e.smallTitleTooltip},null,8,kt)]})),_:1},8,["help-url","feature-name"])]),Object(o["createElementVNode"])("table",yt,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{id:"names",class:Object(o["normalizeClass"])(["label",{columnSorted:"label"===e.sortColumn}]),onClick:t[0]||(t[0]=function(t){return e.sortBy("label")})},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"label"===e.sortColumn,multisites_desc:e.reverse&&"label"===e.sortColumn}]),style:{"margin-left":"3.5px"}},null,2)],2),Object(o["createElementVNode"])("th",{id:"visits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_visits"===e.sortColumn}]),onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_visits"===e.sortColumn,multisites_desc:e.reverse&&"nb_visits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Ct,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)],2),Object(o["createElementVNode"])("th",{id:"pageviews",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_pageviews"===e.sortColumn}]),onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_pageviews"===e.sortColumn,multisites_desc:e.reverse&&"nb_pageviews"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Et,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)],2),Object(o["createElementVNode"])("th",{id:"hits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"hits"===e.sortColumn}]),onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"hits"===e.sortColumn,multisites_desc:e.reverse&&"hits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Nt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)],2),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,id:"revenue",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"revenue"===e.sortColumn}]),onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"revenue"===e.sortColumn,multisites_desc:e.reverse&&"revenue"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Vt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)],2)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{id:"evolution",class:Object(o["normalizeClass"])({columnSorted:e.evolutionSelector===e.sortColumn}),colspan:e.showSparklines?2:1},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&e.evolutionSelector===e.sortColumn,multisites_desc:e.reverse&&e.evolutionSelector===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",{class:"evolution",onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)}),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1),Object(o["createElementVNode"])("select",{class:"selector browser-default",id:"evolution_selector",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){e.evolutionSelector=t.target.value,e.sortBy(e.evolutionSelector)})},[Object(o["createElementVNode"])("option",Bt,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",Pt,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),Object(o["createElementVNode"])("option",Mt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Dt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,Tt)],10,wt)])]),e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",xt,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",Lt,[Object(o["createVNode"])(c,{"loading-message":e.loadingMessage,loading:e.isLoading},null,8,["loading-message","loading"])])])])):Object(o["createCommentVNode"])("",!0),e.isLoading?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",Gt,[e.errorLoadingSites?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Rt,[Object(o["createElementVNode"])("td",At,[Object(o["createElementVNode"])("div",It,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),zt,Ft,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,Ut),Ht,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,qt),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.professionalHelpUrl},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,Kt),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Wt])])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(u,{key:t.idsite,website:t,"evolution-metric":e.evolutionSelector,"date-sparkline":e.dateSparkline,"show-sparklines":e.showSparklines,metric:e.sortColumn,"display-revenue-column":e.displayRevenueColumn},null,8,["website","evolution-metric","date-sparkline","show-sparklines","metric","display-revenue-column"])})),128))])),Object(o["createElementVNode"])("tfoot",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",$t,[Object(o["createElementVNode"])("div",Jt,[Object(o["createElementVNode"])("div",Yt,[e.hasSuperUserAccess?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,href:e.addSiteUrl},[Xt,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("SitesManager_AddSite")),1)],8,Qt)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",Zt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"prev",class:"previous dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.previousPage()})},[Object(o["createElementVNode"])("span",en,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],512),[[o["vShow"],!(0===e.currentPage)]]),Object(o["createElementVNode"])("span",tn,[Object(o["createElementVNode"])("span",nn,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"next",class:"next dataTableNext",onClick:t[8]||(t[8]=function(t){return e.nextPage()})},[Object(o["createElementVNode"])("span",rn,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],512),[[o["vShow"],!(e.currentPage>=e.numberOfPages)]])]),an])])]),Object(o["createElementVNode"])("tr",on,[Object(o["createElementVNode"])("td",sn,[Object(o["createElementVNode"])("div",ln,[Object(o["createElementVNode"])("div",cn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",onKeydown:t[9]||(t[9]=Object(o["withKeys"])((function(t){return e.searchSite(e.searchTerm)}),["enter"])),"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.searchTerm=t}),placeholder:e.translate("Actions_SubmenuSitesearch")},null,40,un),[[o["vModelText"],e.searchTerm]]),Object(o["createElementVNode"])("span",{class:"icon-search search_ico",onClick:t[11]||(t[11]=function(t){return e.searchSite(e.searchTerm)}),title:e.translate("General_ClickToSearch")},null,8,dn)])])])])])])],512)}var pn=Object(o["defineComponent"])({props:{displayRevenueColumn:Boolean,showSparklines:Boolean,dateSparkline:String,pageSize:Number,autoRefreshTodayReport:Number},components:{EnrichedHeadline:m["EnrichedHeadline"],ActivityIndicator:m["ActivityIndicator"],MultisitesSite:pt},data:function(){return{evolutionSelector:"visits_evolution",searchTerm:""}},created:function(){this.pageSize&&ft.setPageSize(this.pageSize),this.refresh(this.autoRefreshTodayReport)},methods:{refresh:function(e){ft.setRefreshInterval(e),ft.fetchAllSites()},sortBy:function(e){ft.sortBy(e)},previousPage:function(){ft.previousPage()},nextPage:function(){ft.nextPage()},searchSite:function(){ft.searchSite(this.searchTerm)}},computed:{hasSuperUserAccess:function(){return m["Matomo"].hasSuperUserAccess},date:function(){return m["MatomoUrl"].urlParsed.value.date},idSite:function(){return m["MatomoUrl"].urlParsed.value.idSite},url:function(){return m["Matomo"].piwik_url},period:function(){return m["Matomo"].period},areAdsForProfessionalServicesEnabled:function(){return m["Matomo"].config&&m["Matomo"].config.are_ads_enabled},sortColumn:function(){return ft.state.value.sortColumn},reverse:function(){return ft.state.value.reverse},smallTitleContent:function(){var e=ft.state.value;return Object(m["translate"])("General_TotalVisitsPageviewsActionsRevenue","".concat(e.totalVisits,""),"".concat(e.totalPageviews,""),"".concat(e.totalActions,""),"".concat(e.totalRevenue,""))},smallTitleTooltip:function(){var e=ft.state.value;return Object(m["translate"])("General_EvolutionSummaryGeneric",Object(m["translate"])("General_NVisits","".concat(e.totalVisits)),this.date,"".concat(e.lastVisits),e.lastVisitsDate,Object(m["calculateAndFormatEvolution"])(e.totalVisits,e.lastVisits))},loadingMessage:function(){return ft.state.value.loadingMessage},isLoading:function(){return ft.state.value.isLoading},errorLoadingSites:function(){return ft.state.value.errorLoadingSites},sites:function(){return ft.state.value.sites},numberOfPages:function(){return ft.numberOfPages.value},currentPage:function(){return ft.state.value.currentPage},paginationLowerBound:function(){return ft.paginationLowerBound.value},paginationUpperBound:function(){return ft.paginationUpperBound.value},numberOfFilteredSites:function(){return ft.numberOfFilteredSites.value},professionalHelpUrl:function(){return Object(m["externalRawLink"])("https://matomo.org/support-plans/")},addSiteUrl:function(){return"index.php?module=SitesManager&action=index&showaddsite=1&period=".concat(this.period,"&")+"date=".concat(this.date,"&idSite=").concat(this.idSite)}}});pn.render=bn;var mn=pn;
/*!
* Matomo - free/libre analytics platform
*
diff --git a/plugins/MultiSites/vue/src/Dashboard/Dashboard.store.ts b/plugins/MultiSites/vue/src/Dashboard/Dashboard.store.ts
index 3c34fd24561..a120201a90d 100644
--- a/plugins/MultiSites/vue/src/Dashboard/Dashboard.store.ts
+++ b/plugins/MultiSites/vue/src/Dashboard/Dashboard.store.ts
@@ -30,9 +30,9 @@ interface SiteWithMetrics extends Site {
visits_evolution: string;
ratio?: number|string;
previous_nb_visits?: string|number;
- previous_Actions_nb_pageviews?: string|number;
- previous_Actions_hits?: string|number;
- previous_Goal_revenue?: string|number;
+ previous_nb_pageviews?: string|number;
+ previous_hits?: string|number;
+ previous_revenue?: string|number;
currencySymbol: string;
periodName: string;
previousRange: string;
@@ -167,37 +167,37 @@ class DashboardStore {
}
if (this.state.value.sortColumn === 'pageviews_evolution') {
- previousTotal = `${site.previous_Actions_nb_pageviews}`;
+ previousTotal = `${site.previous_nb_pageviews}`;
currentTotal = `${site.nb_pageviews}`;
evolution = NumberFormatter.formatPercent(site.pageviews_evolution);
metricName = translate('General_ColumnPageviews');
previousTotalAdjusted = NumberFormatter.formatNumber(
- Math.round(parseInt(site.previous_Actions_nb_pageviews as string, 10)
+ Math.round(parseInt(site.previous_nb_pageviews as string, 10)
* parseInt(site.ratio as string, 10)),
);
}
if (this.state.value.sortColumn === 'hits_evolution') {
- previousTotal = `${site.previous_Actions_hits}`;
+ previousTotal = `${site.previous_hits}`;
currentTotal = `${site.hits}`;
evolution = NumberFormatter.formatPercent(site.hits_evolution);
metricName = translate('General_ColumnHits');
previousTotalAdjusted = NumberFormatter.formatNumber(
- Math.round(parseInt(site.previous_Actions_hits as string, 10)
+ Math.round(parseInt(site.previous_hits as string, 10)
* parseInt(site.ratio as string, 10)),
);
}
if (this.state.value.sortColumn === 'revenue_evolution') {
previousTotal = NumberFormatter.formatCurrency(
- site.previous_Goal_revenue! as string,
+ site.previous_revenue! as string,
site.currencySymbol,
);
currentTotal = NumberFormatter.formatCurrency(site.revenue, site.currencySymbol);
evolution = NumberFormatter.formatPercent(site.revenue_evolution);
metricName = translate('General_ColumnRevenue');
previousTotalAdjusted = NumberFormatter.formatCurrency(
- Math.round(parseInt(site.previous_Goal_revenue as string, 10)
+ Math.round(parseInt(site.previous_revenue as string, 10)
* parseInt(site.ratio as string, 10)),
site.currencySymbol,
);
From 90ce1e9b9bf53042468ee8c18b492b3c8f0a8cb5 Mon Sep 17 00:00:00 2001
From: sgiehl
Date: Tue, 12 Nov 2024 13:39:53 +0100
Subject: [PATCH 4/8] Use unformatted API data in new all websites dashboard
---
plugins/MultiSites/vue/dist/MultiSites.umd.js | 137 +++++++++---------
.../MultiSites/vue/dist/MultiSites.umd.min.js | 6 +-
.../AllWebsitesDashboard.store.ts | 70 ++++++---
.../src/AllWebsitesDashboard/SitesTable.vue | 5 +-
.../AllWebsitesDashboard/SitesTableSite.vue | 41 ++++--
plugins/MultiSites/vue/src/types.ts | 20 +--
6 files changed, 160 insertions(+), 119 deletions(-)
diff --git a/plugins/MultiSites/vue/dist/MultiSites.umd.js b/plugins/MultiSites/vue/dist/MultiSites.umd.js
index 9d51e4b4b78..c45286f3723 100644
--- a/plugins/MultiSites/vue/dist/MultiSites.umd.js
+++ b/plugins/MultiSites/vue/dist/MultiSites.umd.js
@@ -255,7 +255,6 @@ var AllWebsitesDashboard_store_DashboardStore = /*#__PURE__*/function () {
isLoadingSites: false,
numSites: 0,
paginationCurrentPage: 0,
- sparklineDate: '',
sortColumn: DEFAULT_SORT_COLUMN,
sortOrder: DEFAULT_SORT_ORDER
}));
@@ -389,11 +388,12 @@ var AllWebsitesDashboard_store_DashboardStore = /*#__PURE__*/function () {
this.privateState.isLoadingKPIs = !onlySites;
this.privateState.isLoadingSites = true;
var params = {
- method: 'MultiSites.mockDashboardData',
+ method: 'MultiSites.getAllWithGroups',
filter_limit: this.pageSize,
filter_offset: this.currentPagingOffset.value,
filter_sort_column: this.privateState.sortColumn,
filter_sort_order: this.privateState.sortOrder,
+ format_metrics: 0,
showColumns: ['hits_evolution', 'hits_evolution_trend', 'label', 'hits', 'nb_pageviews', 'nb_visits', 'pageviews_evolution', 'pageviews_evolution_trend', 'revenue', 'revenue_evolution', 'revenue_evolution_trend', 'visits_evolution', 'visits_evolution_trend'].join(',')
};
@@ -453,18 +453,18 @@ var AllWebsitesDashboard_store_DashboardStore = /*#__PURE__*/function () {
value: function updateDashboardKPIs(response) {
this.privateState.dashboardKPIs = {
evolutionPeriod: external_CoreHome_["Matomo"].period,
- hits: response.totals.hits,
- hitsEvolution: response.totals.hits_evolution,
- hitsTrend: response.totals.hits_evolution_trend,
- pageviews: response.totals.nb_pageviews,
- pageviewsEvolution: response.totals.pageviews_evolution,
- pageviewsTrend: response.totals.pageviews_evolution_trend,
- revenue: response.totals.revenue,
- revenueEvolution: response.totals.revenue_evolution,
- revenueTrend: response.totals.revenue_evolution_trend,
- visits: response.totals.nb_visits,
- visitsEvolution: response.totals.visits_evolution,
- visitsTrend: response.totals.visits_evolution_trend
+ hits: external_CoreHome_["NumberFormatter"].formatNumber(response.totals.hits),
+ hitsEvolution: external_CoreHome_["NumberFormatter"].calculateAndFormatEvolution(response.totals.hits, response.totals.previous_hits, true),
+ hitsTrend: Math.sign(response.totals.hits - response.totals.previous_hits),
+ pageviews: external_CoreHome_["NumberFormatter"].formatNumber(response.totals.nb_pageviews),
+ pageviewsEvolution: external_CoreHome_["NumberFormatter"].calculateAndFormatEvolution(response.totals.nb_pageviews, response.totals.previous_nb_pageviews, true),
+ pageviewsTrend: Math.sign(response.totals.nb_pageviews - response.totals.previous_nb_pageviews),
+ revenue: external_CoreHome_["NumberFormatter"].formatCurrency(response.totals.revenue, ''),
+ revenueEvolution: external_CoreHome_["NumberFormatter"].calculateAndFormatEvolution(response.totals.revenue, response.totals.previous_revenue, true),
+ revenueTrend: Math.sign(response.totals.revenue - response.totals.previous_revenue),
+ visits: external_CoreHome_["NumberFormatter"].formatNumber(response.totals.nb_visits),
+ visitsEvolution: external_CoreHome_["NumberFormatter"].calculateAndFormatEvolution(response.totals.nb_visits, response.totals.previous_nb_visits, true),
+ visitsTrend: Math.sign(response.totals.nb_visits - response.totals.previous_nb_visits)
};
}
}, {
@@ -472,7 +472,6 @@ var AllWebsitesDashboard_store_DashboardStore = /*#__PURE__*/function () {
value: function updateDashboardSites(response) {
this.privateState.dashboardSites = response.sites;
this.privateState.numSites = response.numSites;
- this.privateState.sparklineDate = response.sparklineDate;
}
}]);
@@ -673,28 +672,28 @@ KPICardvue_type_script_lang_ts.render = KPICardvue_type_template_id_3c2758fa_ren
KPICardContainervue_type_script_lang_ts.render = KPICardContainervue_type_template_id_87c62b90_render
/* harmony default export */ var KPICardContainer = (KPICardContainervue_type_script_lang_ts);
-// 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/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue?vue&type=template&id=345ec591
+// 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/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue?vue&type=template&id=198e6bf1
-var SitesTablevue_type_template_id_345ec591_hoisted_1 = {
+var SitesTablevue_type_template_id_198e6bf1_hoisted_1 = {
class: "sitesTableContainer"
};
-var SitesTablevue_type_template_id_345ec591_hoisted_2 = {
+var SitesTablevue_type_template_id_198e6bf1_hoisted_2 = {
class: "card-table dataTable sitesTable"
};
-var SitesTablevue_type_template_id_345ec591_hoisted_3 = {
+var SitesTablevue_type_template_id_198e6bf1_hoisted_3 = {
class: "sitesTableEvolutionSelector"
};
-var SitesTablevue_type_template_id_345ec591_hoisted_4 = ["value"];
-var SitesTablevue_type_template_id_345ec591_hoisted_5 = {
+var SitesTablevue_type_template_id_198e6bf1_hoisted_4 = ["value"];
+var SitesTablevue_type_template_id_198e6bf1_hoisted_5 = {
value: "hits_evolution"
};
-var SitesTablevue_type_template_id_345ec591_hoisted_6 = {
+var SitesTablevue_type_template_id_198e6bf1_hoisted_6 = {
value: "visits_evolution"
};
-var SitesTablevue_type_template_id_345ec591_hoisted_7 = {
+var SitesTablevue_type_template_id_198e6bf1_hoisted_7 = {
value: "pageviews_evolution"
};
-var SitesTablevue_type_template_id_345ec591_hoisted_8 = {
+var SitesTablevue_type_template_id_198e6bf1_hoisted_8 = {
key: 0,
value: "revenue_evolution"
};
@@ -735,12 +734,12 @@ var _hoisted_21 = {
var _hoisted_22 = {
class: "dataTablePages"
};
-function SitesTablevue_type_template_id_345ec591_render(_ctx, _cache, $props, $setup, $data, $options) {
+function SitesTablevue_type_template_id_198e6bf1_render(_ctx, _cache, $props, $setup, $data, $options) {
var _component_MatomoLoader = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("MatomoLoader");
var _component_SitesTableSite = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SitesTableSite");
- return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), 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_["createElementVNode"])("div", SitesTablevue_type_template_id_345ec591_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", SitesTablevue_type_template_id_345ec591_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), 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_["createElementVNode"])("div", SitesTablevue_type_template_id_198e6bf1_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", SitesTablevue_type_template_id_198e6bf1_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", {
onClick: _cache[0] || (_cache[0] = function ($event) {
return _ctx.sortBy('label');
}),
@@ -784,13 +783,13 @@ function SitesTablevue_type_template_id_345ec591_render(_ctx, _cache, $props, $s
}, [_ctx.sortColumn === _ctx.evolutionSelector ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", {
key: 0,
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(_ctx.sortColumnClass)
- }, null, 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('MultiSites_Evolution')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", SitesTablevue_type_template_id_345ec591_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("select", {
+ }, null, 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('MultiSites_Evolution')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", SitesTablevue_type_template_id_198e6bf1_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("select", {
class: "browser-default",
value: _ctx.evolutionSelector,
onChange: _cache[6] || (_cache[6] = function ($event) {
return _ctx.changeEvolutionSelector($event.target.value);
})
- }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", SitesTablevue_type_template_id_345ec591_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnHits')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", SitesTablevue_type_template_id_345ec591_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnNbVisits')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", SitesTablevue_type_template_id_345ec591_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnPageviews')), 1), _ctx.displayRevenue ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("option", SitesTablevue_type_template_id_345ec591_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnRevenue')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 40, SitesTablevue_type_template_id_345ec591_hoisted_4)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tbody", null, [_ctx.isLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_MatomoLoader)])])) : _ctx.errorLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", _hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRequest', '', '')) + " ", 1), _hoisted_14, _hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_NeedMoreHelp')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", SitesTablevue_type_template_id_198e6bf1_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnHits')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", SitesTablevue_type_template_id_198e6bf1_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnNbVisits')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("option", SitesTablevue_type_template_id_198e6bf1_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnPageviews')), 1), _ctx.displayRevenue ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("option", SitesTablevue_type_template_id_198e6bf1_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ColumnRevenue')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 40, SitesTablevue_type_template_id_198e6bf1_hoisted_4)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tbody", null, [_ctx.isLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_MatomoLoader)])])) : _ctx.errorLoading ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", _hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_ErrorRequest', '', '')) + " ", 1), _hoisted_14, _hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_NeedMoreHelp')) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
rel: "noreferrer noopener",
target: "_blank",
href: _ctx.externalRawLink('https://matomo.org/faq/troubleshooting/faq_19489/')
@@ -810,9 +809,9 @@ function SitesTablevue_type_template_id_345ec591_render(_ctx, _cache, $props, $s
"evolution-metric": _ctx.evolutionMetric,
key: "site-".concat(site.idsite),
"model-value": site,
- "sparkline-date": _ctx.sparklineDate,
+ "display-sparkline": _ctx.displaySparklines,
"sparkline-metric": _ctx.sparklineMetric
- }, null, 8, ["display-revenue", "evolution-metric", "model-value", "sparkline-date", "sparkline-metric"]);
+ }, null, 8, ["display-revenue", "evolution-metric", "model-value", "display-sparkline", "sparkline-metric"]);
}), 128))])])]), !_ctx.isLoading || _ctx.paginationUpperBound > 0 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
class: "dataTablePrevious",
onClick: _cache[7] || (_cache[7] = function ($event) {
@@ -825,76 +824,76 @@ function SitesTablevue_type_template_id_345ec591_render(_ctx, _cache, $props, $s
})
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Next')) + " » ", 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.paginationCurrentPage < _ctx.paginationMaxPage]])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 64);
}
-// CONCATENATED MODULE: ./plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue?vue&type=template&id=345ec591
+// CONCATENATED MODULE: ./plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue?vue&type=template&id=198e6bf1
-// 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/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue?vue&type=template&id=234c7c03
+// 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/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue?vue&type=template&id=00161366
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_1 = {
+var SitesTableSitevue_type_template_id_00161366_hoisted_1 = {
class: "label"
};
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_2 = ["href", "title"];
+var SitesTableSitevue_type_template_id_00161366_hoisted_2 = ["href", "title"];
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
+var SitesTableSitevue_type_template_id_00161366_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
class: "icon icon-outlink"
}, null, -1);
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_4 = [SitesTableSitevue_type_template_id_234c7c03_hoisted_3];
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_5 = ["href"];
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_6 = {
+var SitesTableSitevue_type_template_id_00161366_hoisted_4 = [SitesTableSitevue_type_template_id_00161366_hoisted_3];
+var SitesTableSitevue_type_template_id_00161366_hoisted_5 = ["href"];
+var SitesTableSitevue_type_template_id_00161366_hoisted_6 = {
key: 1,
class: "value"
};
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_7 = {
+var SitesTableSitevue_type_template_id_00161366_hoisted_7 = {
class: "value"
};
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_8 = {
+var SitesTableSitevue_type_template_id_00161366_hoisted_8 = {
class: "value"
};
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_9 = {
+var SitesTableSitevue_type_template_id_00161366_hoisted_9 = {
class: "value"
};
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_10 = {
+var SitesTableSitevue_type_template_id_00161366_hoisted_10 = {
key: 0
};
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_11 = {
+var SitesTableSitevue_type_template_id_00161366_hoisted_11 = {
class: "value"
};
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_12 = ["colspan"];
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_13 = ["src"];
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_14 = {
+var SitesTableSitevue_type_template_id_00161366_hoisted_12 = ["colspan"];
+var SitesTableSitevue_type_template_id_00161366_hoisted_13 = ["src"];
+var SitesTableSitevue_type_template_id_00161366_hoisted_14 = {
key: 1,
class: "sitesTableSparkline"
};
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_15 = ["href", "title"];
-var SitesTableSitevue_type_template_id_234c7c03_hoisted_16 = ["src"];
-function SitesTableSitevue_type_template_id_234c7c03_render(_ctx, _cache, $props, $setup, $data, $options) {
+var SitesTableSitevue_type_template_id_00161366_hoisted_15 = ["href", "title"];
+var SitesTableSitevue_type_template_id_00161366_hoisted_16 = ["src"];
+function SitesTableSitevue_type_template_id_00161366_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"])("tr", {
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({
sitesTableGroup: !!_ctx.site.isGroup,
sitesTableGroupSite: !_ctx.site.isGroup && !!_ctx.site.group,
sitesTableSite: !_ctx.site.isGroup && !_ctx.site.group
})
- }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", SitesTableSitevue_type_template_id_234c7c03_hoisted_1, [!_ctx.site.isGroup ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], {
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", SitesTableSitevue_type_template_id_00161366_hoisted_1, [!_ctx.site.isGroup ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], {
key: 0
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
rel: "noreferrer noopener",
target: "_blank",
href: _ctx.site.main_url,
title: _ctx.translate('General_GoTo', _ctx.site.main_url)
- }, SitesTableSitevue_type_template_id_234c7c03_hoisted_4, 8, SitesTableSitevue_type_template_id_234c7c03_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ }, SitesTableSitevue_type_template_id_00161366_hoisted_4, 8, SitesTableSitevue_type_template_id_00161366_hoisted_2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
title: "View reports",
class: "value",
href: _ctx.dashboardUrl
- }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.siteLabel), 9, SitesTableSitevue_type_template_id_234c7c03_hoisted_5)], 64)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SitesTableSitevue_type_template_id_234c7c03_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.siteLabel), 1))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SitesTableSitevue_type_template_id_234c7c03_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.site.nb_visits), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SitesTableSitevue_type_template_id_234c7c03_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.site.nb_pageviews), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SitesTableSitevue_type_template_id_234c7c03_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.site.hits), 1)]), _ctx.displayRevenue ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("td", SitesTableSitevue_type_template_id_234c7c03_hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SitesTableSitevue_type_template_id_234c7c03_hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.site.revenue), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", {
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.siteLabel), 9, SitesTableSitevue_type_template_id_00161366_hoisted_5)], 64)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", SitesTableSitevue_type_template_id_00161366_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.siteLabel), 1))]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SitesTableSitevue_type_template_id_00161366_hoisted_7, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formatNumber(_ctx.site.nb_visits)), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SitesTableSitevue_type_template_id_00161366_hoisted_8, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formatNumber(_ctx.site.nb_pageviews)), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SitesTableSitevue_type_template_id_00161366_hoisted_9, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formatNumber(_ctx.site.hits)), 1)]), _ctx.displayRevenue ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("td", SitesTableSitevue_type_template_id_00161366_hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", SitesTableSitevue_type_template_id_00161366_hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formatCurrency(_ctx.site.revenue, _ctx.site.currencySymbol)), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", {
colspan: _ctx.displaySparkline ? 1 : 2
}, [!_ctx.site.isGroup && !!_ctx.site[_ctx.evolutionMetric] ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], {
key: 0
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", {
src: _ctx.evolutionIconSrc,
alt: ""
- }, null, 8, SitesTableSitevue_type_template_id_234c7c03_hoisted_13), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
+ }, null, 8, SitesTableSitevue_type_template_id_00161366_hoisted_13), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(_ctx.evolutionTrendClass)
- }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.site[_ctx.evolutionMetric]), 3)], 64)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 8, SitesTableSitevue_type_template_id_234c7c03_hoisted_12), _ctx.displaySparkline ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("td", SitesTableSitevue_type_template_id_234c7c03_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.calculateAndFormatEvolution(_ctx.site[_ctx.sparklineMetric], _ctx.site["previous_".concat(_ctx.sparklineMetric)], true)), 3)], 64)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 8, SitesTableSitevue_type_template_id_00161366_hoisted_12), _ctx.displaySparkline ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("td", SitesTableSitevue_type_template_id_00161366_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
rel: "noreferrer noopener",
target: "_blank",
href: _ctx.dashboardUrl,
@@ -904,9 +903,9 @@ function SitesTableSitevue_type_template_id_234c7c03_render(_ctx, _cache, $props
width: "100",
height: "25",
src: _ctx.evolutionSparklineSrc
- }, null, 8, SitesTableSitevue_type_template_id_234c7c03_hoisted_16)], 8, SitesTableSitevue_type_template_id_234c7c03_hoisted_15)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2);
+ }, null, 8, SitesTableSitevue_type_template_id_00161366_hoisted_16)], 8, SitesTableSitevue_type_template_id_00161366_hoisted_15)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2);
}
-// CONCATENATED MODULE: ./plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue?vue&type=template&id=234c7c03
+// CONCATENATED MODULE: ./plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue?vue&type=template&id=00161366
// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./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/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue?vue&type=script&lang=ts
@@ -925,8 +924,8 @@ function SitesTableSitevue_type_template_id_234c7c03_render(_ctx, _cache, $props
type: Object,
required: true
},
- sparklineDate: String,
- sparklineMetric: String
+ sparklineMetric: String,
+ displaySparkline: Boolean
},
computed: {
dashboardUrl: function dashboardUrl() {
@@ -939,9 +938,6 @@ function SitesTableSitevue_type_template_id_234c7c03_render(_ctx, _cache, $props
});
return "?".concat(dashboardParams).concat(this.tokenParam);
},
- displaySparkline: function displaySparkline() {
- return !this.site.isGroup && this.sparklineDate && this.sparklineMetric;
- },
evolutionIconSrc: function evolutionIconSrc() {
if (this.evolutionTrend === 1) {
return 'plugins/MultiSites/images/arrow_up.png';
@@ -954,10 +950,20 @@ function SitesTableSitevue_type_template_id_234c7c03_render(_ctx, _cache, $props
return 'plugins/MultiSites/images/stop.png';
},
evolutionSparklineSrc: function evolutionSparklineSrc() {
+ var sparklineDate = external_CoreHome_["Matomo"].currentDateString;
+
+ if (external_CoreHome_["Matomo"].period !== 'range') {
+ var _Range$getLastNRange = external_CoreHome_["Range"].getLastNRange(external_CoreHome_["Matomo"].period, '30', external_CoreHome_["Matomo"].currentDateString),
+ startDate = _Range$getLastNRange.startDate,
+ endDate = _Range$getLastNRange.endDate;
+
+ sparklineDate = "".concat(Object(external_CoreHome_["format"])(startDate), ",").concat(Object(external_CoreHome_["format"])(endDate));
+ }
+
var sparklineParams = external_CoreHome_["MatomoUrl"].stringify({
module: 'MultiSites',
action: 'getEvolutionGraph',
- date: this.sparklineDate,
+ date: sparklineDate,
period: external_CoreHome_["Matomo"].period,
idSite: this.site.idsite,
columns: this.sparklineMetric,
@@ -1000,7 +1006,7 @@ function SitesTableSitevue_type_template_id_234c7c03_render(_ctx, _cache, $props
-SitesTableSitevue_type_script_lang_ts.render = SitesTableSitevue_type_template_id_234c7c03_render
+SitesTableSitevue_type_script_lang_ts.render = SitesTableSitevue_type_template_id_00161366_render
/* harmony default export */ var SitesTableSite = (SitesTableSitevue_type_script_lang_ts);
// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./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/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue?vue&type=script&lang=ts
@@ -1089,9 +1095,6 @@ SitesTableSitevue_type_script_lang_ts.render = SitesTableSitevue_type_template_i
default:
return '';
}
- },
- sparklineDate: function sparklineDate() {
- return this.displaySparklines ? AllWebsitesDashboard_store.state.value.sparklineDate : null;
}
},
methods: {
@@ -1116,7 +1119,7 @@ SitesTableSitevue_type_script_lang_ts.render = SitesTableSitevue_type_template_i
-SitesTablevue_type_script_lang_ts.render = SitesTablevue_type_template_id_345ec591_render
+SitesTablevue_type_script_lang_ts.render = SitesTablevue_type_template_id_198e6bf1_render
/* harmony default export */ var SitesTable = (SitesTablevue_type_script_lang_ts);
// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./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/MultiSites/vue/src/AllWebsitesDashboard/AllWebsitesDashboard.vue?vue&type=script&lang=ts
diff --git a/plugins/MultiSites/vue/dist/MultiSites.umd.min.js b/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
index 69ffc17422f..d81c82d651c 100644
--- a/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
+++ b/plugins/MultiSites/vue/dist/MultiSites.umd.min.js
@@ -1,16 +1,16 @@
-(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["MultiSites"]=t(require("CoreHome"),require("vue")):e["MultiSites"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/MultiSites/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"AllWebsitesDashboard",(function(){return De})),n.d(t,"MultisitesSite",(function(){return pt})),n.d(t,"DashboadStore",(function(){return ft})),n.d(t,"Dashboard",(function(){return mn})),"undefined"!==typeof window){var r=window.document.currentScript,a=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);a&&(n.p=a[1])}var o=n("8bbf"),i={class:"dashboardHeader"},s={class:"card-title"},l={class:"dashboardControls"},c={class:"siteSearch"},u=["placeholder"],d=["title"],b=["href"];function p(e,t,n,r,a,p){var m=Object(o["resolveComponent"])("EnrichedHeadline"),v=Object(o["resolveComponent"])("KPICardContainer"),h=Object(o["resolveComponent"])("SitesTable");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",i,[Object(o["createElementVNode"])("h1",s,[Object(o["createVNode"])(m,{"feature-name":e.translate("MultiSites_AllWebsitesDashboardTitle")},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("MultiSites_AllWebsitesDashboardTitle")),1)]})),_:1},8,["feature-name"])])]),Object(o["createVNode"])(v,{"is-loading":e.isLoadingKPIs,"model-value":e.kpis},null,8,["is-loading","model-value"]),Object(o["createElementVNode"])("div",l,[Object(o["createElementVNode"])("div",c,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",onKeydown:t[0]||(t[0]=Object(o["withKeys"])((function(t){return e.searchSite(e.searchTerm)}),["enter"])),"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),placeholder:e.translate("Actions_SubmenuSitesearch")},null,40,u),[[o["vModelText"],e.searchTerm]]),Object(o["createElementVNode"])("span",{class:"icon-search",onClick:t[2]||(t[2]=function(t){return e.searchSite(e.searchTerm)}),title:e.translate("General_ClickToSearch")},null,8,d)]),!e.isWidgetized&&e.isUserAllowedToAddSite?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,class:"btn",href:e.addSiteUrl},Object(o["toDisplayString"])(e.translate("SitesManager_AddSite")),9,b)):Object(o["createCommentVNode"])("",!0)]),Object(o["createVNode"])(h,{"display-revenue":e.displayRevenue,"display-sparklines":e.displaySparklines},null,8,["display-revenue","display-sparklines"])],64)}var m=n("19dc");function v(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var n=0;n0&&void 0!==arguments[0]&&arguments[0];this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelAutoRefresh()),this.fetchAbort=new AbortController,this.privateState.errorLoading=!1,this.privateState.isLoadingKPIs=!t,this.privateState.isLoadingSites=!0;var n={method:"MultiSites.mockDashboardData",filter_limit:this.pageSize,filter_offset:this.currentPagingOffset.value,filter_sort_column:this.privateState.sortColumn,filter_sort_order:this.privateState.sortOrder,showColumns:["hits_evolution","hits_evolution_trend","label","hits","nb_pageviews","nb_visits","pageviews_evolution","pageviews_evolution_trend","revenue","revenue_evolution","revenue_evolution_trend","visits_evolution","visits_evolution_trend"].join(",")};return this.searchTerm&&(n.pattern=this.searchTerm),m["AjaxHelper"].fetch(n,{abortController:this.fetchAbort}).then((function(n){t||e.updateDashboardKPIs(n),e.updateDashboardSites(n)})).catch((function(){e.privateState.dashboardSites=[],e.privateState.errorLoading=!0})).finally((function(){e.privateState.isLoadingKPIs=!1,e.privateState.isLoadingSites=!1,e.fetchAbort=null,e.startAutoRefresh()}))}},{key:"startAutoRefresh",value:function(){var e=this;if(this.cancelAutoRefresh(),!(this.autoRefreshInterval<=0)){var t;try{t=m["Periods"].parse(m["Matomo"].period,m["Matomo"].currentDateString)}catch(n){}t&&t.containsToday()&&(this.autoRefreshTimeout=setTimeout((function(){e.autoRefreshTimeout=null,e.refreshData()}),1e3*this.autoRefreshInterval))}}},{key:"updateDashboardKPIs",value:function(e){this.privateState.dashboardKPIs={evolutionPeriod:m["Matomo"].period,hits:e.totals.hits,hitsEvolution:e.totals.hits_evolution,hitsTrend:e.totals.hits_evolution_trend,pageviews:e.totals.nb_pageviews,pageviewsEvolution:e.totals.pageviews_evolution,pageviewsTrend:e.totals.pageviews_evolution_trend,revenue:e.totals.revenue,revenueEvolution:e.totals.revenue_evolution,revenueTrend:e.totals.revenue_evolution_trend,visits:e.totals.nb_visits,visitsEvolution:e.totals.visits_evolution,visitsTrend:e.totals.visits_evolution_trend}}},{key:"updateDashboardSites",value:function(e){this.privateState.dashboardSites=e.sites,this.privateState.numSites=e.numSites,this.privateState.sparklineDate=e.sparklineDate}}]),e}(),k=new S,y={class:"kpiCardContainer"},_={key:0,class:"kpiCard kpiCardLoading"},C=Object(o["createElementVNode"])("div",{class:"kpiCardTitle"}," ",-1),E={class:"kpiCardValue"},N=Object(o["createElementVNode"])("div",{class:"kpiCardEvolution"},[Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ")],-1),V={key:0,class:"kpiCardBadge"};function w(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("KPICard");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",y,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",_,[C,Object(o["createElementVNode"])("div",E,[Object(o["createVNode"])(s)]),N,e.hasKpiBadge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",V," ")):Object(o["createCommentVNode"])("",!0)])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:1},Object(o["renderList"])(e.kpis,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:"kpi-card-".concat(n)},[n>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,class:Object(o["normalizeClass"])({kpiCardDivider:!0,kpiCardDividerBadge:e.hasKpiBadge})}," ",2)):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(l,{"model-value":t},null,8,["model-value"])],64)})),128))])}var T={class:"kpiCard"},B={class:"kpiCardTitle"},P={class:"kpiCardValue"},M={class:"kpiCardEvolution"},D={key:1,class:"kpiCardEvolution"},x=Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ",-1),L=[x],G=["innerHTML"];function R(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",T,[Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardIcon ".concat(e.kpi.icon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.kpi.title)),1)]),Object(o["createElementVNode"])("div",P,Object(o["toDisplayString"])(e.kpi.value),1),Object(o["createElementVNode"])("div",M,[""!==e.kpi.evolutionValue?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionTrend ".concat(e.evolutionTrendClass))},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionIcon ".concat(e.evolutionTrendIcon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.kpi.evolutionValue),1)],2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.evolutionTrendFrom)),1)],64)):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",D,L))]),e.kpi.badge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.kpi.badge),class:"kpiCardBadge"},null,8,G)):Object(o["createCommentVNode"])("",!0)])}var A=Object(o["defineComponent"])({props:{modelValue:{type:Object,required:!0}},computed:{evolutionTrendFrom:function(){switch(this.kpi.evolutionPeriod){case"day":return"MultiSites_EvolutionFromPreviousDay";case"week":return"MultiSites_EvolutionFromPreviousWeek";case"month":return"MultiSites_EvolutionFromPreviousMonth";case"year":return"MultiSites_EvolutionFromPreviousYear";default:return"MultiSites_EvolutionFromPreviousPeriod"}},evolutionTrendClass:function(){return 1===this.kpi.evolutionTrend?"kpiTrendPositive":-1===this.kpi.evolutionTrend?"kpiTrendNegative":"kpiTrendNeutral"},evolutionTrendIcon:function(){return 1===this.kpi.evolutionTrend?"icon-chevron-up":-1===this.kpi.evolutionTrend?"icon-chevron-down":"icon-circle"},kpi:function(){return this.modelValue}}});A.render=R;var I=A,z=Object(o["defineComponent"])({components:{MatomoLoader:m["MatomoLoader"],KPICard:I},props:{isLoading:Boolean,modelValue:{type:Array,required:!0}},computed:{hasKpiBadge:function(){return this.kpis.some((function(e){return!!e.badge}))},kpis:function(){return this.modelValue}}});z.render=w;var F=z,U={class:"sitesTableContainer"},H={class:"card-table dataTable sitesTable"},q={class:"sitesTableEvolutionSelector"},K=["value"],W={value:"hits_evolution"},$={value:"visits_evolution"},J={value:"pageviews_evolution"},Y={key:0,value:"revenue_evolution"},Q={key:0},X={class:"sitesTableLoading",colspan:"7"},Z={key:1},ee={colspan:"7"},te={class:"notification system notification-error"},ne=Object(o["createElementVNode"])("br",null,null,-1),re=Object(o["createElementVNode"])("br",null,null,-1),ae=["href"],oe=Object(o["createTextVNode"])(" – "),ie=["href"],se=["href"],le=Object(o["createTextVNode"])(". "),ce={key:0,class:"sitesTablePagination"},ue={class:"dataTablePages"};function de(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("SitesTableSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("table",H,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{onClick:t[0]||(t[0]=function(t){return e.sortBy("label")}),class:"label"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Website"))+" ",1),"label"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},["nb_visits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)]),Object(o["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},["nb_pageviews"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)]),Object(o["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},["hits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)]),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},["revenue"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)})},[e.sortColumn===e.evolutionSelector?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1)]),Object(o["createElementVNode"])("th",q,[Object(o["createElementVNode"])("select",{class:"browser-default",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){return e.changeEvolutionSelector(t.target.value)})},[Object(o["createElementVNode"])("option",W,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),Object(o["createElementVNode"])("option",$,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",J,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Y,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,K)])])]),Object(o["createElementVNode"])("tbody",null,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Q,[Object(o["createElementVNode"])("td",X,[Object(o["createVNode"])(s)])])):e.errorLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Z,[Object(o["createElementVNode"])("td",ee,[Object(o["createElementVNode"])("div",te,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),ne,re,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,ae),oe,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,ie),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.errorShowProfessionalHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/support-plans/")},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,se),[[o["vShow"],e.errorShowProfessionalHelp]]),le])])])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:2},Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"display-revenue":e.displayRevenue,"evolution-metric":e.evolutionMetric,key:"site-".concat(t.idsite),"model-value":t,"sparkline-date":e.sparklineDate,"sparkline-metric":e.sparklineMetric},null,8,["display-revenue","evolution-metric","model-value","sparkline-date","sparkline-metric"])})),128))])])]),!e.isLoading||e.paginationUpperBound>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ce,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.navigatePreviousPage()})}," « "+Object(o["toDisplayString"])(e.translate("General_Previous")),513),[[o["vShow"],0!==e.paginationCurrentPage]]),Object(o["createElementVNode"])("span",ue,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTableNext",onClick:t[8]||(t[8]=function(t){return e.navigateNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" » ",513),[[o["vShow"],e.paginationCurrentPage0&&void 0!==arguments[0]&&arguments[0];this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelAutoRefresh()),this.fetchAbort=new AbortController,this.privateState.errorLoading=!1,this.privateState.isLoadingKPIs=!t,this.privateState.isLoadingSites=!0;var n={method:"MultiSites.getAllWithGroups",filter_limit:this.pageSize,filter_offset:this.currentPagingOffset.value,filter_sort_column:this.privateState.sortColumn,filter_sort_order:this.privateState.sortOrder,format_metrics:0,showColumns:["hits_evolution","hits_evolution_trend","label","hits","nb_pageviews","nb_visits","pageviews_evolution","pageviews_evolution_trend","revenue","revenue_evolution","revenue_evolution_trend","visits_evolution","visits_evolution_trend"].join(",")};return this.searchTerm&&(n.pattern=this.searchTerm),p["AjaxHelper"].fetch(n,{abortController:this.fetchAbort}).then((function(n){t||e.updateDashboardKPIs(n),e.updateDashboardSites(n)})).catch((function(){e.privateState.dashboardSites=[],e.privateState.errorLoading=!0})).finally((function(){e.privateState.isLoadingKPIs=!1,e.privateState.isLoadingSites=!1,e.fetchAbort=null,e.startAutoRefresh()}))}},{key:"startAutoRefresh",value:function(){var e=this;if(this.cancelAutoRefresh(),!(this.autoRefreshInterval<=0)){var t;try{t=p["Periods"].parse(p["Matomo"].period,p["Matomo"].currentDateString)}catch(n){}t&&t.containsToday()&&(this.autoRefreshTimeout=setTimeout((function(){e.autoRefreshTimeout=null,e.refreshData()}),1e3*this.autoRefreshInterval))}}},{key:"updateDashboardKPIs",value:function(e){this.privateState.dashboardKPIs={evolutionPeriod:p["Matomo"].period,hits:p["NumberFormatter"].formatNumber(e.totals.hits),hitsEvolution:p["NumberFormatter"].calculateAndFormatEvolution(e.totals.hits,e.totals.previous_hits,!0),hitsTrend:Math.sign(e.totals.hits-e.totals.previous_hits),pageviews:p["NumberFormatter"].formatNumber(e.totals.nb_pageviews),pageviewsEvolution:p["NumberFormatter"].calculateAndFormatEvolution(e.totals.nb_pageviews,e.totals.previous_nb_pageviews,!0),pageviewsTrend:Math.sign(e.totals.nb_pageviews-e.totals.previous_nb_pageviews),revenue:p["NumberFormatter"].formatCurrency(e.totals.revenue,""),revenueEvolution:p["NumberFormatter"].calculateAndFormatEvolution(e.totals.revenue,e.totals.previous_revenue,!0),revenueTrend:Math.sign(e.totals.revenue-e.totals.previous_revenue),visits:p["NumberFormatter"].formatNumber(e.totals.nb_visits),visitsEvolution:p["NumberFormatter"].calculateAndFormatEvolution(e.totals.nb_visits,e.totals.previous_nb_visits,!0),visitsTrend:Math.sign(e.totals.nb_visits-e.totals.previous_nb_visits)}}},{key:"updateDashboardSites",value:function(e){this.privateState.dashboardSites=e.sites,this.privateState.numSites=e.numSites}}]),e}(),k=new S,y={class:"kpiCardContainer"},_={key:0,class:"kpiCard kpiCardLoading"},N=Object(o["createElementVNode"])("div",{class:"kpiCardTitle"}," ",-1),C={class:"kpiCardValue"},E=Object(o["createElementVNode"])("div",{class:"kpiCardEvolution"},[Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ")],-1),V={key:0,class:"kpiCardBadge"};function w(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("KPICard");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",y,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",_,[N,Object(o["createElementVNode"])("div",C,[Object(o["createVNode"])(s)]),E,e.hasKpiBadge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",V," ")):Object(o["createCommentVNode"])("",!0)])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:1},Object(o["renderList"])(e.kpis,(function(t,n){return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:"kpi-card-".concat(n)},[n>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,class:Object(o["normalizeClass"])({kpiCardDivider:!0,kpiCardDividerBadge:e.hasKpiBadge})}," ",2)):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(l,{"model-value":t},null,8,["model-value"])],64)})),128))])}var T={class:"kpiCard"},B={class:"kpiCardTitle"},P={class:"kpiCardValue"},M={class:"kpiCardEvolution"},D={key:1,class:"kpiCardEvolution"},x=Object(o["createElementVNode"])("span",{class:"kpiCardEvolutionTrend"}," ",-1),L=[x],A=["innerHTML"];function R(e,t,n,r,a,i){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",T,[Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardIcon ".concat(e.kpi.icon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.kpi.title)),1)]),Object(o["createElementVNode"])("div",P,Object(o["toDisplayString"])(e.kpi.value),1),Object(o["createElementVNode"])("div",M,[""!==e.kpi.evolutionValue?(Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],{key:0},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionTrend ".concat(e.evolutionTrendClass))},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])("kpiCardEvolutionIcon ".concat(e.evolutionTrendIcon))},null,2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.kpi.evolutionValue),1)],2),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate(e.evolutionTrendFrom)),1)],64)):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",D,L))]),e.kpi.badge?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.kpi.badge),class:"kpiCardBadge"},null,8,A)):Object(o["createCommentVNode"])("",!0)])}var G=Object(o["defineComponent"])({props:{modelValue:{type:Object,required:!0}},computed:{evolutionTrendFrom:function(){switch(this.kpi.evolutionPeriod){case"day":return"MultiSites_EvolutionFromPreviousDay";case"week":return"MultiSites_EvolutionFromPreviousWeek";case"month":return"MultiSites_EvolutionFromPreviousMonth";case"year":return"MultiSites_EvolutionFromPreviousYear";default:return"MultiSites_EvolutionFromPreviousPeriod"}},evolutionTrendClass:function(){return 1===this.kpi.evolutionTrend?"kpiTrendPositive":-1===this.kpi.evolutionTrend?"kpiTrendNegative":"kpiTrendNeutral"},evolutionTrendIcon:function(){return 1===this.kpi.evolutionTrend?"icon-chevron-up":-1===this.kpi.evolutionTrend?"icon-chevron-down":"icon-circle"},kpi:function(){return this.modelValue}}});G.render=R;var F=G,I=Object(o["defineComponent"])({components:{MatomoLoader:p["MatomoLoader"],KPICard:F},props:{isLoading:Boolean,modelValue:{type:Array,required:!0}},computed:{hasKpiBadge:function(){return this.kpis.some((function(e){return!!e.badge}))},kpis:function(){return this.modelValue}}});I.render=w;var z=I,U={class:"sitesTableContainer"},H={class:"card-table dataTable sitesTable"},q={class:"sitesTableEvolutionSelector"},K=["value"],W={value:"hits_evolution"},$={value:"visits_evolution"},J={value:"pageviews_evolution"},Y={key:0,value:"revenue_evolution"},Q={key:0},X={class:"sitesTableLoading",colspan:"7"},Z={key:1},ee={colspan:"7"},te={class:"notification system notification-error"},ne=Object(o["createElementVNode"])("br",null,null,-1),re=Object(o["createElementVNode"])("br",null,null,-1),ae=["href"],oe=Object(o["createTextVNode"])(" – "),ie=["href"],se=["href"],le=Object(o["createTextVNode"])(". "),ce={key:0,class:"sitesTablePagination"},ue={class:"dataTablePages"};function de(e,t,n,r,a,i){var s=Object(o["resolveComponent"])("MatomoLoader"),l=Object(o["resolveComponent"])("SitesTableSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])(o["Fragment"],null,[Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("table",H,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{onClick:t[0]||(t[0]=function(t){return e.sortBy("label")}),class:"label"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Website"))+" ",1),"label"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("th",{onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},["nb_visits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)]),Object(o["createElementVNode"])("th",{onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},["nb_pageviews"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)]),Object(o["createElementVNode"])("th",{onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},["hits"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)]),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},["revenue"===e.sortColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)})},[e.sortColumn===e.evolutionSelector?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:Object(o["normalizeClass"])(e.sortColumnClass)},null,2)):Object(o["createCommentVNode"])("",!0),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1)]),Object(o["createElementVNode"])("th",q,[Object(o["createElementVNode"])("select",{class:"browser-default",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){return e.changeEvolutionSelector(t.target.value)})},[Object(o["createElementVNode"])("option",W,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),Object(o["createElementVNode"])("option",$,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",J,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),e.displayRevenue?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Y,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,K)])])]),Object(o["createElementVNode"])("tbody",null,[e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Q,[Object(o["createElementVNode"])("td",X,[Object(o["createVNode"])(s)])])):e.errorLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Z,[Object(o["createElementVNode"])("td",ee,[Object(o["createElementVNode"])("div",te,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),ne,re,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,ae),oe,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,ie),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.errorShowProfessionalHelp]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/support-plans/")},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,se),[[o["vShow"],e.errorShowProfessionalHelp]]),le])])])):(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],{key:2},Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(l,{"display-revenue":e.displayRevenue,"evolution-metric":e.evolutionMetric,key:"site-".concat(t.idsite),"model-value":t,"display-sparkline":e.displaySparklines,"sparkline-metric":e.sparklineMetric},null,8,["display-revenue","evolution-metric","model-value","display-sparkline","sparkline-metric"])})),128))])])]),!e.isLoading||e.paginationUpperBound>0?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ce,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.navigatePreviousPage()})}," « "+Object(o["toDisplayString"])(e.translate("General_Previous")),513),[[o["vShow"],0!==e.paginationCurrentPage]]),Object(o["createElementVNode"])("span",ue,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{class:"dataTableNext",onClick:t[8]||(t[8]=function(t){return e.navigateNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" » ",513),[[o["vShow"],e.paginationCurrentPagen&&(e=n),e})))}return ht(e,[{key:"cancelRefereshInterval",value:function(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)}},{key:"updateWebsitesList",value:function(e){var t=this;if(e){var n=e.sites;n.forEach((function(e){if(1!==e.ratio&&"1"!==e.ratio){var n=m["NumberFormatter"].formatPercent(Math.round(100*parseInt(e.ratio,10))),r=null,a="0",o="0",i="0",s="0";if("nb_visits"!==t.state.value.sortColumn&&"visits_evolution"!==t.state.value.sortColumn||(a=m["NumberFormatter"].formatNumber(e.previous_nb_visits),o=m["NumberFormatter"].formatNumber(e.nb_visits),i=m["NumberFormatter"].formatPercent(e.visits_evolution),r=Object(m["translate"])("General_ColumnNbVisits"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_nb_visits,10)*parseInt(e.ratio,10)))),"pageviews_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_nb_pageviews),o="".concat(e.nb_pageviews),i=m["NumberFormatter"].formatPercent(e.pageviews_evolution),r=Object(m["translate"])("General_ColumnPageviews"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_nb_pageviews,10)*parseInt(e.ratio,10)))),"hits_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_hits),o="".concat(e.hits),i=m["NumberFormatter"].formatPercent(e.hits_evolution),r=Object(m["translate"])("General_ColumnHits"),s=m["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_hits,10)*parseInt(e.ratio,10)))),"revenue_evolution"===t.state.value.sortColumn&&(a=m["NumberFormatter"].formatCurrency(e.previous_revenue,e.currencySymbol),o=m["NumberFormatter"].formatCurrency(e.revenue,e.currencySymbol),i=m["NumberFormatter"].formatPercent(e.revenue_evolution),r=Object(m["translate"])("General_ColumnRevenue"),s=m["NumberFormatter"].formatCurrency(Math.round(parseInt(e.previous_revenue,10)*parseInt(e.ratio,10)),e.currencySymbol)),r)switch(e.tooltip="".concat(Object(m["translate"])("MultiSites_EvolutionComparisonIncomplete",[n]),"\n"),e.tooltip+="".concat(Object(m["translate"])("MultiSites_EvolutionComparisonProportional",[n,"".concat(s),r,"".concat(a)]),"\n"),e.periodName){case"day":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonDay",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"week":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonWeek",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"month":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonMonth",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"year":e.tooltip+=Object(m["translate"])("MultiSites_EvolutionComparisonYear",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;default:break}}})),this.privateState.totalVisits=e.totals.nb_visits,this.privateState.totalPageviews=e.totals.nb_pageviews,this.privateState.totalHits=e.totals.hits,this.privateState.totalActions=e.totals.nb_actions,this.privateState.totalRevenue=e.totals.revenue,this.privateState.lastVisits=e.totals.nb_visits_lastdate,this.privateState.sites=n,this.privateState.numberOfSites=e.numSites,this.privateState.lastVisitsDate=e.lastDate}else this.onError()}},{key:"sortBy",value:function(e){this.state.value.sortColumn===e&&(this.privateState.reverse=!this.state.value.reverse),this.privateState.sortColumn=e,this.fetchAllSites()}},{key:"previousPage",value:function(){this.privateState.currentPage=this.state.value.currentPage-1,this.fetchAllSites()}},{key:"nextPage",value:function(){this.privateState.currentPage=this.state.value.currentPage+1,this.fetchAllSites()}},{key:"searchSite",value:function(e){this.privateState.searchTerm=e,this.privateState.currentPage=0,this.fetchAllSites()}},{key:"fetchAllSites",value:function(){var e=this;this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelRefereshInterval()),this.privateState.isLoading=!0,this.privateState.errorLoadingSites=!1;var t={method:"MultiSites.getAllWithGroups",hideMetricsDoc:"1",filter_sort_order:"asc",filter_limit:this.state.value.pageSize,filter_offset:this.currentPagingOffset.value,showColumns:["label","nb_visits","nb_pageviews","hits","visits_evolution","visits_evolution_trend","pageviews_evolution","pageviews_evolution_trend","hits_evolution","hits_evolution_trend","revenue_evolution","revenue_evolution_trend","nb_actions","revenue"].join(",")};return this.privateState.searchTerm&&(t.pattern=this.privateState.searchTerm),this.privateState.sortColumn&&(t.filter_sort_column=this.privateState.sortColumn),this.privateState.reverse&&(t.filter_sort_order="desc"),this.fetchAbort=new AbortController,m["AjaxHelper"].fetch(t,{abortController:this.fetchAbort}).then((function(t){e.updateWebsitesList(t)})).catch((function(){e.onError()})).finally((function(){e.privateState.isLoading=!1,e.fetchAbort=null,e.state.value.refreshInterval&&e.state.value.refreshInterval>0&&(e.cancelRefereshInterval(),e.refreshTimeout=setTimeout((function(){e.refreshTimeout=null,e.fetchAllSites()}),1e3*e.state.value.refreshInterval))}))}},{key:"onError",value:function(){this.privateState.errorLoadingSites=!0,this.privateState.sites=[]}},{key:"setRefreshInterval",value:function(e){this.privateState.refreshInterval=e}},{key:"setPageSize",value:function(e){this.privateState.pageSize=e}}]),e}(),ft=new jt,gt={ref:"root"},St={class:"card-title"},kt=["innerHTML","title"],yt={id:"mt",class:"dataTable card-table",cellspacing:"0"},_t={class:"heading"},Ct={class:"heading"},Et={class:"heading"},Nt={class:"heading"},Vt={class:"heading"},wt=["colspan"],Tt=["value"],Bt={value:"visits_evolution"},Pt={value:"pageviews_evolution"},Mt={value:"hits_evolution"},Dt={key:0,value:"revenue_evolution"},xt={key:0},Lt={colspan:"7",class:"allWebsitesLoading"},Gt={key:1},Rt={key:0},At={colspan:"7"},It={class:"notification system notification-error"},zt=Object(o["createElementVNode"])("br",null,null,-1),Ft=Object(o["createElementVNode"])("br",null,null,-1),Ut=["href"],Ht=Object(o["createTextVNode"])(" – "),qt=["href"],Kt=["href"],Wt=Object(o["createTextVNode"])(". "),$t={colspan:"8",class:"paging"},Jt={class:"row"},Yt={class:"col s3 add_new_site"},Qt=["href"],Xt=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),Zt={class:"col s6"},en={style:{cursor:"pointer"}},tn={class:"dataTablePages"},nn={id:"counter"},rn={style:{cursor:"pointer"},class:"pointer"},an=Object(o["createElementVNode"])("div",{class:"col s3"}," ",-1),on={row_id:"last"},sn={colspan:"8",class:"site_search"},ln={class:"row"},cn={class:"input-field col s12"},un=["placeholder"],dn=["title"];function bn(e,t,n,r,a,i){var s=this,l=Object(o["resolveComponent"])("EnrichedHeadline"),c=Object(o["resolveComponent"])("ActivityIndicator"),u=Object(o["resolveComponent"])("MultisitesSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",gt,[Object(o["createElementVNode"])("h2",St,[Object(o["createVNode"])(l,{"help-url":e.externalRawLink("https://matomo.org/faq/new-to-piwik/all-websites-dashboard/"),"feature-name":e.translate("General_AllWebsitesDashboard")},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_AllWebsitesDashboard"))+" ",1),Object(o["createElementVNode"])("span",{class:"smallTitle",innerHTML:e.$sanitize(s.smallTitleContent),title:e.smallTitleTooltip},null,8,kt)]})),_:1},8,["help-url","feature-name"])]),Object(o["createElementVNode"])("table",yt,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{id:"names",class:Object(o["normalizeClass"])(["label",{columnSorted:"label"===e.sortColumn}]),onClick:t[0]||(t[0]=function(t){return e.sortBy("label")})},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"label"===e.sortColumn,multisites_desc:e.reverse&&"label"===e.sortColumn}]),style:{"margin-left":"3.5px"}},null,2)],2),Object(o["createElementVNode"])("th",{id:"visits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_visits"===e.sortColumn}]),onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_visits"===e.sortColumn,multisites_desc:e.reverse&&"nb_visits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Ct,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)],2),Object(o["createElementVNode"])("th",{id:"pageviews",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_pageviews"===e.sortColumn}]),onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_pageviews"===e.sortColumn,multisites_desc:e.reverse&&"nb_pageviews"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Et,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)],2),Object(o["createElementVNode"])("th",{id:"hits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"hits"===e.sortColumn}]),onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"hits"===e.sortColumn,multisites_desc:e.reverse&&"hits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Nt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)],2),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,id:"revenue",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"revenue"===e.sortColumn}]),onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"revenue"===e.sortColumn,multisites_desc:e.reverse&&"revenue"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Vt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)],2)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{id:"evolution",class:Object(o["normalizeClass"])({columnSorted:e.evolutionSelector===e.sortColumn}),colspan:e.showSparklines?2:1},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&e.evolutionSelector===e.sortColumn,multisites_desc:e.reverse&&e.evolutionSelector===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",{class:"evolution",onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)}),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1),Object(o["createElementVNode"])("select",{class:"selector browser-default",id:"evolution_selector",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){e.evolutionSelector=t.target.value,e.sortBy(e.evolutionSelector)})},[Object(o["createElementVNode"])("option",Bt,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",Pt,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),Object(o["createElementVNode"])("option",Mt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Dt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,Tt)],10,wt)])]),e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",xt,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",Lt,[Object(o["createVNode"])(c,{"loading-message":e.loadingMessage,loading:e.isLoading},null,8,["loading-message","loading"])])])])):Object(o["createCommentVNode"])("",!0),e.isLoading?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",Gt,[e.errorLoadingSites?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Rt,[Object(o["createElementVNode"])("td",At,[Object(o["createElementVNode"])("div",It,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),zt,Ft,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,Ut),Ht,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,qt),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.professionalHelpUrl},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,Kt),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Wt])])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(u,{key:t.idsite,website:t,"evolution-metric":e.evolutionSelector,"date-sparkline":e.dateSparkline,"show-sparklines":e.showSparklines,metric:e.sortColumn,"display-revenue-column":e.displayRevenueColumn},null,8,["website","evolution-metric","date-sparkline","show-sparklines","metric","display-revenue-column"])})),128))])),Object(o["createElementVNode"])("tfoot",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",$t,[Object(o["createElementVNode"])("div",Jt,[Object(o["createElementVNode"])("div",Yt,[e.hasSuperUserAccess?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,href:e.addSiteUrl},[Xt,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("SitesManager_AddSite")),1)],8,Qt)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",Zt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"prev",class:"previous dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.previousPage()})},[Object(o["createElementVNode"])("span",en,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],512),[[o["vShow"],!(0===e.currentPage)]]),Object(o["createElementVNode"])("span",tn,[Object(o["createElementVNode"])("span",nn,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"next",class:"next dataTableNext",onClick:t[8]||(t[8]=function(t){return e.nextPage()})},[Object(o["createElementVNode"])("span",rn,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],512),[[o["vShow"],!(e.currentPage>=e.numberOfPages)]])]),an])])]),Object(o["createElementVNode"])("tr",on,[Object(o["createElementVNode"])("td",sn,[Object(o["createElementVNode"])("div",ln,[Object(o["createElementVNode"])("div",cn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",onKeydown:t[9]||(t[9]=Object(o["withKeys"])((function(t){return e.searchSite(e.searchTerm)}),["enter"])),"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.searchTerm=t}),placeholder:e.translate("Actions_SubmenuSitesearch")},null,40,un),[[o["vModelText"],e.searchTerm]]),Object(o["createElementVNode"])("span",{class:"icon-search search_ico",onClick:t[11]||(t[11]=function(t){return e.searchSite(e.searchTerm)}),title:e.translate("General_ClickToSearch")},null,8,dn)])])])])])])],512)}var pn=Object(o["defineComponent"])({props:{displayRevenueColumn:Boolean,showSparklines:Boolean,dateSparkline:String,pageSize:Number,autoRefreshTodayReport:Number},components:{EnrichedHeadline:m["EnrichedHeadline"],ActivityIndicator:m["ActivityIndicator"],MultisitesSite:pt},data:function(){return{evolutionSelector:"visits_evolution",searchTerm:""}},created:function(){this.pageSize&&ft.setPageSize(this.pageSize),this.refresh(this.autoRefreshTodayReport)},methods:{refresh:function(e){ft.setRefreshInterval(e),ft.fetchAllSites()},sortBy:function(e){ft.sortBy(e)},previousPage:function(){ft.previousPage()},nextPage:function(){ft.nextPage()},searchSite:function(){ft.searchSite(this.searchTerm)}},computed:{hasSuperUserAccess:function(){return m["Matomo"].hasSuperUserAccess},date:function(){return m["MatomoUrl"].urlParsed.value.date},idSite:function(){return m["MatomoUrl"].urlParsed.value.idSite},url:function(){return m["Matomo"].piwik_url},period:function(){return m["Matomo"].period},areAdsForProfessionalServicesEnabled:function(){return m["Matomo"].config&&m["Matomo"].config.are_ads_enabled},sortColumn:function(){return ft.state.value.sortColumn},reverse:function(){return ft.state.value.reverse},smallTitleContent:function(){var e=ft.state.value;return Object(m["translate"])("General_TotalVisitsPageviewsActionsRevenue","".concat(e.totalVisits,""),"".concat(e.totalPageviews,""),"".concat(e.totalActions,""),"".concat(e.totalRevenue,""))},smallTitleTooltip:function(){var e=ft.state.value;return Object(m["translate"])("General_EvolutionSummaryGeneric",Object(m["translate"])("General_NVisits","".concat(e.totalVisits)),this.date,"".concat(e.lastVisits),e.lastVisitsDate,Object(m["calculateAndFormatEvolution"])(e.totalVisits,e.lastVisits))},loadingMessage:function(){return ft.state.value.loadingMessage},isLoading:function(){return ft.state.value.isLoading},errorLoadingSites:function(){return ft.state.value.errorLoadingSites},sites:function(){return ft.state.value.sites},numberOfPages:function(){return ft.numberOfPages.value},currentPage:function(){return ft.state.value.currentPage},paginationLowerBound:function(){return ft.paginationLowerBound.value},paginationUpperBound:function(){return ft.paginationUpperBound.value},numberOfFilteredSites:function(){return ft.numberOfFilteredSites.value},professionalHelpUrl:function(){return Object(m["externalRawLink"])("https://matomo.org/support-plans/")},addSiteUrl:function(){return"index.php?module=SitesManager&action=index&showaddsite=1&period=".concat(this.period,"&")+"date=".concat(this.date,"&idSite=").concat(this.idSite)}}});pn.render=bn;var mn=pn;
+ */var ft=function(){function e(){var t=this;pt(this,e),Ot(this,"privateState",Object(o["reactive"])({sites:[],isLoading:!1,pageSize:25,currentPage:0,totalVisits:"?",totalPageviews:"?",totalHits:"?",totalActions:"?",totalRevenue:"?",searchTerm:"",lastVisits:"?",lastVisitsDate:"?",numberOfSites:0,loadingMessage:Object(p["translate"])("MultiSites_LoadingWebsites"),reverse:!0,sortColumn:"nb_visits",refreshInterval:0,errorLoadingSites:!1})),Ot(this,"refreshTimeout",null),Ot(this,"fetchAbort",null),Ot(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),Ot(this,"numberOfFilteredSites",Object(o["computed"])((function(){return t.state.value.numberOfSites}))),Ot(this,"numberOfPages",Object(o["computed"])((function(){return Math.ceil(t.numberOfFilteredSites.value/t.state.value.pageSize-1)}))),Ot(this,"currentPagingOffset",Object(o["computed"])((function(){return Math.ceil(t.state.value.currentPage*t.state.value.pageSize)}))),Ot(this,"paginationLowerBound",Object(o["computed"])((function(){return t.currentPagingOffset.value+1}))),Ot(this,"paginationUpperBound",Object(o["computed"])((function(){var e=t.currentPagingOffset.value+t.state.value.pageSize,n=t.numberOfFilteredSites.value;return e>n&&(e=n),e})))}return ht(e,[{key:"cancelRefereshInterval",value:function(){this.refreshTimeout&&(clearTimeout(this.refreshTimeout),this.refreshTimeout=null)}},{key:"updateWebsitesList",value:function(e){var t=this;if(e){var n=e.sites;n.forEach((function(e){if(1!==e.ratio&&"1"!==e.ratio){var n=p["NumberFormatter"].formatPercent(Math.round(100*parseInt(e.ratio,10))),r=null,a="0",o="0",i="0",s="0";if("nb_visits"!==t.state.value.sortColumn&&"visits_evolution"!==t.state.value.sortColumn||(a=p["NumberFormatter"].formatNumber(e.previous_nb_visits),o=p["NumberFormatter"].formatNumber(e.nb_visits),i=p["NumberFormatter"].formatPercent(e.visits_evolution),r=Object(p["translate"])("General_ColumnNbVisits"),s=p["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_nb_visits,10)*parseInt(e.ratio,10)))),"pageviews_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_nb_pageviews),o="".concat(e.nb_pageviews),i=p["NumberFormatter"].formatPercent(e.pageviews_evolution),r=Object(p["translate"])("General_ColumnPageviews"),s=p["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_nb_pageviews,10)*parseInt(e.ratio,10)))),"hits_evolution"===t.state.value.sortColumn&&(a="".concat(e.previous_hits),o="".concat(e.hits),i=p["NumberFormatter"].formatPercent(e.hits_evolution),r=Object(p["translate"])("General_ColumnHits"),s=p["NumberFormatter"].formatNumber(Math.round(parseInt(e.previous_hits,10)*parseInt(e.ratio,10)))),"revenue_evolution"===t.state.value.sortColumn&&(a=p["NumberFormatter"].formatCurrency(e.previous_revenue,e.currencySymbol),o=p["NumberFormatter"].formatCurrency(e.revenue,e.currencySymbol),i=p["NumberFormatter"].formatPercent(e.revenue_evolution),r=Object(p["translate"])("General_ColumnRevenue"),s=p["NumberFormatter"].formatCurrency(Math.round(parseInt(e.previous_revenue,10)*parseInt(e.ratio,10)),e.currencySymbol)),r)switch(e.tooltip="".concat(Object(p["translate"])("MultiSites_EvolutionComparisonIncomplete",[n]),"\n"),e.tooltip+="".concat(Object(p["translate"])("MultiSites_EvolutionComparisonProportional",[n,"".concat(s),r,"".concat(a)]),"\n"),e.periodName){case"day":e.tooltip+=Object(p["translate"])("MultiSites_EvolutionComparisonDay",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"week":e.tooltip+=Object(p["translate"])("MultiSites_EvolutionComparisonWeek",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"month":e.tooltip+=Object(p["translate"])("MultiSites_EvolutionComparisonMonth",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;case"year":e.tooltip+=Object(p["translate"])("MultiSites_EvolutionComparisonYear",["".concat(o),r,"".concat(s),e.previousRange,"".concat(i)]);break;default:break}}})),this.privateState.totalVisits=e.totals.nb_visits,this.privateState.totalPageviews=e.totals.nb_pageviews,this.privateState.totalHits=e.totals.hits,this.privateState.totalActions=e.totals.nb_actions,this.privateState.totalRevenue=e.totals.revenue,this.privateState.lastVisits=e.totals.nb_visits_lastdate,this.privateState.sites=n,this.privateState.numberOfSites=e.numSites,this.privateState.lastVisitsDate=e.lastDate}else this.onError()}},{key:"sortBy",value:function(e){this.state.value.sortColumn===e&&(this.privateState.reverse=!this.state.value.reverse),this.privateState.sortColumn=e,this.fetchAllSites()}},{key:"previousPage",value:function(){this.privateState.currentPage=this.state.value.currentPage-1,this.fetchAllSites()}},{key:"nextPage",value:function(){this.privateState.currentPage=this.state.value.currentPage+1,this.fetchAllSites()}},{key:"searchSite",value:function(e){this.privateState.searchTerm=e,this.privateState.currentPage=0,this.fetchAllSites()}},{key:"fetchAllSites",value:function(){var e=this;this.fetchAbort&&(this.fetchAbort.abort(),this.fetchAbort=null,this.cancelRefereshInterval()),this.privateState.isLoading=!0,this.privateState.errorLoadingSites=!1;var t={method:"MultiSites.getAllWithGroups",hideMetricsDoc:"1",filter_sort_order:"asc",filter_limit:this.state.value.pageSize,filter_offset:this.currentPagingOffset.value,showColumns:["label","nb_visits","nb_pageviews","hits","visits_evolution","visits_evolution_trend","pageviews_evolution","pageviews_evolution_trend","hits_evolution","hits_evolution_trend","revenue_evolution","revenue_evolution_trend","nb_actions","revenue"].join(",")};return this.privateState.searchTerm&&(t.pattern=this.privateState.searchTerm),this.privateState.sortColumn&&(t.filter_sort_column=this.privateState.sortColumn),this.privateState.reverse&&(t.filter_sort_order="desc"),this.fetchAbort=new AbortController,p["AjaxHelper"].fetch(t,{abortController:this.fetchAbort}).then((function(t){e.updateWebsitesList(t)})).catch((function(){e.onError()})).finally((function(){e.privateState.isLoading=!1,e.fetchAbort=null,e.state.value.refreshInterval&&e.state.value.refreshInterval>0&&(e.cancelRefereshInterval(),e.refreshTimeout=setTimeout((function(){e.refreshTimeout=null,e.fetchAllSites()}),1e3*e.state.value.refreshInterval))}))}},{key:"onError",value:function(){this.privateState.errorLoadingSites=!0,this.privateState.sites=[]}},{key:"setRefreshInterval",value:function(e){this.privateState.refreshInterval=e}},{key:"setPageSize",value:function(e){this.privateState.pageSize=e}}]),e}(),jt=new ft,gt={ref:"root"},St={class:"card-title"},kt=["innerHTML","title"],yt={id:"mt",class:"dataTable card-table",cellspacing:"0"},_t={class:"heading"},Nt={class:"heading"},Ct={class:"heading"},Et={class:"heading"},Vt={class:"heading"},wt=["colspan"],Tt=["value"],Bt={value:"visits_evolution"},Pt={value:"pageviews_evolution"},Mt={value:"hits_evolution"},Dt={key:0,value:"revenue_evolution"},xt={key:0},Lt={colspan:"7",class:"allWebsitesLoading"},At={key:1},Rt={key:0},Gt={colspan:"7"},Ft={class:"notification system notification-error"},It=Object(o["createElementVNode"])("br",null,null,-1),zt=Object(o["createElementVNode"])("br",null,null,-1),Ut=["href"],Ht=Object(o["createTextVNode"])(" – "),qt=["href"],Kt=["href"],Wt=Object(o["createTextVNode"])(". "),$t={colspan:"8",class:"paging"},Jt={class:"row"},Yt={class:"col s3 add_new_site"},Qt=["href"],Xt=Object(o["createElementVNode"])("span",{class:"icon-add"},null,-1),Zt={class:"col s6"},en={style:{cursor:"pointer"}},tn={class:"dataTablePages"},nn={id:"counter"},rn={style:{cursor:"pointer"},class:"pointer"},an=Object(o["createElementVNode"])("div",{class:"col s3"}," ",-1),on={row_id:"last"},sn={colspan:"8",class:"site_search"},ln={class:"row"},cn={class:"input-field col s12"},un=["placeholder"],dn=["title"];function bn(e,t,n,r,a,i){var s=this,l=Object(o["resolveComponent"])("EnrichedHeadline"),c=Object(o["resolveComponent"])("ActivityIndicator"),u=Object(o["resolveComponent"])("MultisitesSite");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",gt,[Object(o["createElementVNode"])("h2",St,[Object(o["createVNode"])(l,{"help-url":e.externalRawLink("https://matomo.org/faq/new-to-piwik/all-websites-dashboard/"),"feature-name":e.translate("General_AllWebsitesDashboard")},{default:Object(o["withCtx"])((function(){return[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_AllWebsitesDashboard"))+" ",1),Object(o["createElementVNode"])("span",{class:"smallTitle",innerHTML:e.$sanitize(s.smallTitleContent),title:e.smallTitleTooltip},null,8,kt)]})),_:1},8,["help-url","feature-name"])]),Object(o["createElementVNode"])("table",yt,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",{id:"names",class:Object(o["normalizeClass"])(["label",{columnSorted:"label"===e.sortColumn}]),onClick:t[0]||(t[0]=function(t){return e.sortBy("label")})},[Object(o["createElementVNode"])("span",_t,Object(o["toDisplayString"])(e.translate("General_Website")),1),Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"label"===e.sortColumn,multisites_desc:e.reverse&&"label"===e.sortColumn}]),style:{"margin-left":"3.5px"}},null,2)],2),Object(o["createElementVNode"])("th",{id:"visits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_visits"===e.sortColumn}]),onClick:t[1]||(t[1]=function(t){return e.sortBy("nb_visits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_visits"===e.sortColumn,multisites_desc:e.reverse&&"nb_visits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Nt,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1)],2),Object(o["createElementVNode"])("th",{id:"pageviews",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"nb_pageviews"===e.sortColumn}]),onClick:t[2]||(t[2]=function(t){return e.sortBy("nb_pageviews")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"nb_pageviews"===e.sortColumn,multisites_desc:e.reverse&&"nb_pageviews"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Ct,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1)],2),Object(o["createElementVNode"])("th",{id:"hits",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"hits"===e.sortColumn}]),onClick:t[3]||(t[3]=function(t){return e.sortBy("hits")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"hits"===e.sortColumn,multisites_desc:e.reverse&&"hits"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Et,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1)],2),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:0,id:"revenue",class:Object(o["normalizeClass"])(["multisites-column",{columnSorted:"revenue"===e.sortColumn}]),onClick:t[4]||(t[4]=function(t){return e.sortBy("revenue")})},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&"revenue"===e.sortColumn,multisites_desc:e.reverse&&"revenue"===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",Vt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)],2)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",{id:"evolution",class:Object(o["normalizeClass"])({columnSorted:e.evolutionSelector===e.sortColumn}),colspan:e.showSparklines?2:1},[Object(o["createElementVNode"])("span",{class:Object(o["normalizeClass"])(["arrow",{multisites_asc:!e.reverse&&e.evolutionSelector===e.sortColumn,multisites_desc:e.reverse&&e.evolutionSelector===e.sortColumn}]),style:{"margin-right":"3.5px"}},null,2),Object(o["createElementVNode"])("span",{class:"evolution",onClick:t[5]||(t[5]=function(t){return e.sortBy(e.evolutionSelector)}),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("MultiSites_Evolution")),1),Object(o["createElementVNode"])("select",{class:"selector browser-default",id:"evolution_selector",value:e.evolutionSelector,onChange:t[6]||(t[6]=function(t){e.evolutionSelector=t.target.value,e.sortBy(e.evolutionSelector)})},[Object(o["createElementVNode"])("option",Bt,Object(o["toDisplayString"])(e.translate("General_ColumnNbVisits")),1),Object(o["createElementVNode"])("option",Pt,Object(o["toDisplayString"])(e.translate("General_ColumnPageviews")),1),Object(o["createElementVNode"])("option",Mt,Object(o["toDisplayString"])(e.translate("General_ColumnHits")),1),e.displayRevenueColumn?(Object(o["openBlock"])(),Object(o["createElementBlock"])("option",Dt,Object(o["toDisplayString"])(e.translate("General_ColumnRevenue")),1)):Object(o["createCommentVNode"])("",!0)],40,Tt)],10,wt)])]),e.isLoading?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",xt,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",Lt,[Object(o["createVNode"])(c,{"loading-message":e.loadingMessage,loading:e.isLoading},null,8,["loading-message","loading"])])])])):Object(o["createCommentVNode"])("",!0),e.isLoading?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("tbody",At,[e.errorLoadingSites?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Rt,[Object(o["createElementVNode"])("td",Gt,[Object(o["createElementVNode"])("div",Ft,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),It,zt,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("General_NeedMoreHelp"))+" ",1),Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(o["toDisplayString"])(e.translate("General_Faq")),9,Ut),Ht,Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://forum.matomo.org/")},Object(o["toDisplayString"])(e.translate("Feedback_CommunityHelp")),9,qt),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",null," – ",512),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{rel:"noreferrer noopener",target:"_blank",href:e.professionalHelpUrl},Object(o["toDisplayString"])(e.translate("Feedback_ProfessionalHelp")),9,Kt),[[o["vShow"],e.areAdsForProfessionalServicesEnabled]]),Wt])])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.sites,(function(t){return Object(o["openBlock"])(),Object(o["createBlock"])(u,{key:t.idsite,website:t,"evolution-metric":e.evolutionSelector,"date-sparkline":e.dateSparkline,"show-sparklines":e.showSparklines,metric:e.sortColumn,"display-revenue-column":e.displayRevenueColumn},null,8,["website","evolution-metric","date-sparkline","show-sparklines","metric","display-revenue-column"])})),128))])),Object(o["createElementVNode"])("tfoot",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("td",$t,[Object(o["createElementVNode"])("div",Jt,[Object(o["createElementVNode"])("div",Yt,[e.hasSuperUserAccess?(Object(o["openBlock"])(),Object(o["createElementBlock"])("a",{key:0,href:e.addSiteUrl},[Xt,Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("SitesManager_AddSite")),1)],8,Qt)):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",Zt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"prev",class:"previous dataTablePrevious",onClick:t[7]||(t[7]=function(t){return e.previousPage()})},[Object(o["createElementVNode"])("span",en,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],512),[[o["vShow"],!(0===e.currentPage)]]),Object(o["createElementVNode"])("span",tn,[Object(o["createElementVNode"])("span",nn,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.numberOfFilteredSites)),1)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("span",{id:"next",class:"next dataTableNext",onClick:t[8]||(t[8]=function(t){return e.nextPage()})},[Object(o["createElementVNode"])("span",rn,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],512),[[o["vShow"],!(e.currentPage>=e.numberOfPages)]])]),an])])]),Object(o["createElementVNode"])("tr",on,[Object(o["createElementVNode"])("td",sn,[Object(o["createElementVNode"])("div",ln,[Object(o["createElementVNode"])("div",cn,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"text",onKeydown:t[9]||(t[9]=Object(o["withKeys"])((function(t){return e.searchSite(e.searchTerm)}),["enter"])),"onUpdate:modelValue":t[10]||(t[10]=function(t){return e.searchTerm=t}),placeholder:e.translate("Actions_SubmenuSitesearch")},null,40,un),[[o["vModelText"],e.searchTerm]]),Object(o["createElementVNode"])("span",{class:"icon-search search_ico",onClick:t[11]||(t[11]=function(t){return e.searchSite(e.searchTerm)}),title:e.translate("General_ClickToSearch")},null,8,dn)])])])])])])],512)}var mn=Object(o["defineComponent"])({props:{displayRevenueColumn:Boolean,showSparklines:Boolean,dateSparkline:String,pageSize:Number,autoRefreshTodayReport:Number},components:{EnrichedHeadline:p["EnrichedHeadline"],ActivityIndicator:p["ActivityIndicator"],MultisitesSite:mt},data:function(){return{evolutionSelector:"visits_evolution",searchTerm:""}},created:function(){this.pageSize&&jt.setPageSize(this.pageSize),this.refresh(this.autoRefreshTodayReport)},methods:{refresh:function(e){jt.setRefreshInterval(e),jt.fetchAllSites()},sortBy:function(e){jt.sortBy(e)},previousPage:function(){jt.previousPage()},nextPage:function(){jt.nextPage()},searchSite:function(){jt.searchSite(this.searchTerm)}},computed:{hasSuperUserAccess:function(){return p["Matomo"].hasSuperUserAccess},date:function(){return p["MatomoUrl"].urlParsed.value.date},idSite:function(){return p["MatomoUrl"].urlParsed.value.idSite},url:function(){return p["Matomo"].piwik_url},period:function(){return p["Matomo"].period},areAdsForProfessionalServicesEnabled:function(){return p["Matomo"].config&&p["Matomo"].config.are_ads_enabled},sortColumn:function(){return jt.state.value.sortColumn},reverse:function(){return jt.state.value.reverse},smallTitleContent:function(){var e=jt.state.value;return Object(p["translate"])("General_TotalVisitsPageviewsActionsRevenue","".concat(e.totalVisits,""),"".concat(e.totalPageviews,""),"".concat(e.totalActions,""),"".concat(e.totalRevenue,""))},smallTitleTooltip:function(){var e=jt.state.value;return Object(p["translate"])("General_EvolutionSummaryGeneric",Object(p["translate"])("General_NVisits","".concat(e.totalVisits)),this.date,"".concat(e.lastVisits),e.lastVisitsDate,Object(p["calculateAndFormatEvolution"])(e.totalVisits,e.lastVisits))},loadingMessage:function(){return jt.state.value.loadingMessage},isLoading:function(){return jt.state.value.isLoading},errorLoadingSites:function(){return jt.state.value.errorLoadingSites},sites:function(){return jt.state.value.sites},numberOfPages:function(){return jt.numberOfPages.value},currentPage:function(){return jt.state.value.currentPage},paginationLowerBound:function(){return jt.paginationLowerBound.value},paginationUpperBound:function(){return jt.paginationUpperBound.value},numberOfFilteredSites:function(){return jt.numberOfFilteredSites.value},professionalHelpUrl:function(){return Object(p["externalRawLink"])("https://matomo.org/support-plans/")},addSiteUrl:function(){return"index.php?module=SitesManager&action=index&showaddsite=1&period=".concat(this.period,"&")+"date=".concat(this.date,"&idSite=").concat(this.idSite)}}});mn.render=bn;var pn=mn;
/*!
* Matomo - free/libre analytics platform
*
diff --git a/plugins/MultiSites/vue/src/AllWebsitesDashboard/AllWebsitesDashboard.store.ts b/plugins/MultiSites/vue/src/AllWebsitesDashboard/AllWebsitesDashboard.store.ts
index 2ea7dcd935b..94e8af371ba 100644
--- a/plugins/MultiSites/vue/src/AllWebsitesDashboard/AllWebsitesDashboard.store.ts
+++ b/plugins/MultiSites/vue/src/AllWebsitesDashboard/AllWebsitesDashboard.store.ts
@@ -6,7 +6,12 @@
*/
import { computed, reactive, readonly } from 'vue';
-import { AjaxHelper, Matomo, Periods } from 'CoreHome';
+import {
+ AjaxHelper,
+ Matomo,
+ Periods,
+ NumberFormatter,
+} from 'CoreHome';
import {
DashboardMetrics,
@@ -39,16 +44,14 @@ interface DashboardStoreState {
isLoadingSites: boolean;
numSites: number;
paginationCurrentPage: number;
- sparklineDate: string;
sortColumn: string;
sortOrder: DashboardSortOrder;
}
-interface GetDashboardMockDataResponse {
+interface GetAllWithGroupsDataResponse {
sites: DashboardSiteData[];
totals: DashboardMetrics;
numSites: number;
- sparklineDate: string;
}
const DEFAULT_SORT_ORDER = 'desc';
@@ -79,7 +82,6 @@ class DashboardStore {
isLoadingSites: false,
numSites: 0,
paginationCurrentPage: 0,
- sparklineDate: '',
sortColumn: DEFAULT_SORT_COLUMN,
sortOrder: DEFAULT_SORT_ORDER,
});
@@ -204,11 +206,12 @@ class DashboardStore {
this.privateState.isLoadingSites = true;
const params: QueryParameters = {
- method: 'MultiSites.mockDashboardData',
+ method: 'MultiSites.getAllWithGroups',
filter_limit: this.pageSize,
filter_offset: this.currentPagingOffset.value,
filter_sort_column: this.privateState.sortColumn,
filter_sort_order: this.privateState.sortOrder,
+ format_metrics: 0,
showColumns: [
'hits_evolution',
'hits_evolution_trend',
@@ -230,7 +233,7 @@ class DashboardStore {
params.pattern = this.searchTerm;
}
- return AjaxHelper.fetch(
+ return AjaxHelper.fetch(
params,
{ abortController: this.fetchAbort },
).then((response) => {
@@ -279,28 +282,51 @@ class DashboardStore {
}, this.autoRefreshInterval * 1000);
}
- private updateDashboardKPIs(response: GetDashboardMockDataResponse) {
+ private updateDashboardKPIs(response: GetAllWithGroupsDataResponse) {
this.privateState.dashboardKPIs = {
evolutionPeriod: Matomo.period as string,
- hits: response.totals.hits,
- hitsEvolution: response.totals.hits_evolution,
- hitsTrend: response.totals.hits_evolution_trend,
- pageviews: response.totals.nb_pageviews,
- pageviewsEvolution: response.totals.pageviews_evolution,
- pageviewsTrend: response.totals.pageviews_evolution_trend,
- revenue: response.totals.revenue,
- revenueEvolution: response.totals.revenue_evolution,
- revenueTrend: response.totals.revenue_evolution_trend,
- visits: response.totals.nb_visits,
- visitsEvolution: response.totals.visits_evolution,
- visitsTrend: response.totals.visits_evolution_trend,
+ hits: NumberFormatter.formatNumber(response.totals.hits),
+ hitsEvolution: NumberFormatter.calculateAndFormatEvolution(
+ response.totals.hits,
+ response.totals.previous_hits,
+ true,
+ ),
+ hitsTrend: Math.sign(
+ response.totals.hits - response.totals.previous_hits,
+ ) as EvolutionTrend,
+ pageviews: NumberFormatter.formatNumber(response.totals.nb_pageviews),
+ pageviewsEvolution: NumberFormatter.calculateAndFormatEvolution(
+ response.totals.nb_pageviews,
+ response.totals.previous_nb_pageviews,
+ true,
+ ),
+ pageviewsTrend: Math.sign(
+ response.totals.nb_pageviews - response.totals.previous_nb_pageviews,
+ ) as EvolutionTrend,
+ revenue: NumberFormatter.formatCurrency(response.totals.revenue, ''),
+ revenueEvolution: NumberFormatter.calculateAndFormatEvolution(
+ response.totals.revenue,
+ response.totals.previous_revenue,
+ true,
+ ),
+ revenueTrend: Math.sign(
+ response.totals.revenue - response.totals.previous_revenue,
+ ) as EvolutionTrend,
+ visits: NumberFormatter.formatNumber(response.totals.nb_visits),
+ visitsEvolution: NumberFormatter.calculateAndFormatEvolution(
+ response.totals.nb_visits,
+ response.totals.previous_nb_visits,
+ true,
+ ),
+ visitsTrend: Math.sign(
+ response.totals.nb_visits - response.totals.previous_nb_visits,
+ ) as EvolutionTrend,
};
}
- private updateDashboardSites(response: GetDashboardMockDataResponse) {
+ private updateDashboardSites(response: GetAllWithGroupsDataResponse) {
this.privateState.dashboardSites = response.sites;
this.privateState.numSites = response.numSites;
- this.privateState.sparklineDate = response.sparklineDate;
}
}
diff --git a/plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue b/plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue
index 98faa355492..54fbaa64afd 100644
--- a/plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue
+++ b/plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTable.vue
@@ -131,7 +131,7 @@
:evolution-metric="evolutionMetric"
:key="`site-${site.idsite}`"
:model-value="site"
- :sparkline-date="sparklineDate"
+ :display-sparkline="displaySparklines"
:sparkline-metric="sparklineMetric"
/>
@@ -257,9 +257,6 @@ export default defineComponent({
return '';
}
},
- sparklineDate(): string|null {
- return this.displaySparklines ? DashboardStore.state.value.sparklineDate : null;
- },
},
methods: {
changeEvolutionSelector(metric: string) {
diff --git a/plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue b/plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue
index 0a808b513d3..c44d9fabbc4 100644
--- a/plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue
+++ b/plugins/MultiSites/vue/src/AllWebsitesDashboard/SitesTableSite.vue
@@ -33,15 +33,20 @@
- {{ site.nb_visits }} |
- {{ site.nb_pageviews }} |
- {{ site.hits }} |
- {{ site.revenue }} |
+ {{ formatNumber(site.nb_visits) }} |
+ {{ formatNumber(site.nb_pageviews) }} |
+ {{ formatNumber(site.hits) }} |
+
+ {{ formatCurrency(site.revenue, site.currencySymbol) }}
+ |
- {{ site[evolutionMetric] }}
+
+ {{ calculateAndFormatEvolution(
+ site[sparklineMetric], site[`previous_${sparklineMetric}`], true) }}
+
|
@@ -67,7 +72,12 @@