Ubuntu

­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ (function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["CoreHome"]=t(require("vue")):e["CoreHome"]=t(e["Vue"])})("undefined"!==typeof self?self:this,(function(e){return function(e){var t={};function o(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=e,o.c=t,o.d=function(e,t,i){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="plugins/CoreHome/vue/dist/",o(o.s="fae3")}({2342:function(e,t,o){"use strict"; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */window.hasBlockedContent=!1},"8bbf":function(t,o){t.exports=e},fae3:function(e,t,o){"use strict";if(o.r(t),o.d(t,"createVueApp",(function(){return me})),o.d(t,"importPluginUmd",(function(){return fe})),o.d(t,"useExternalPluginComponent",(function(){return ve})),o.d(t,"DirectiveUtilities",(function(){return je})),o.d(t,"debounce",(function(){return we})),o.d(t,"clone",(function(){return Se})),o.d(t,"VueEntryContainer",(function(){return De})),o.d(t,"ActivityIndicator",(function(){return _e})),o.d(t,"MatomoLoader",(function(){return Le})),o.d(t,"translate",(function(){return a})),o.d(t,"translateOrDefault",(function(){return r})),o.d(t,"externalRawLink",(function(){return ae})),o.d(t,"externalLink",(function(){return re})),o.d(t,"Alert",(function(){return $e})),o.d(t,"AjaxHelper",(function(){return K})),o.d(t,"setCookie",(function(){return U})),o.d(t,"getCookie",(function(){return q})),o.d(t,"deleteCookie",(function(){return W})),o.d(t,"MatomoUrl",(function(){return H})),o.d(t,"Matomo",(function(){return M})),o.d(t,"Periods",(function(){return c})),o.d(t,"Day",(function(){return f})),o.d(t,"Week",(function(){return O})),o.d(t,"Month",(function(){return y})),o.d(t,"Year",(function(){return S})),o.d(t,"Range",(function(){return C})),o.d(t,"format",(function(){return d})),o.d(t,"getToday",(function(){return u})),o.d(t,"parseDate",(function(){return m})),o.d(t,"todayIsInRange",(function(){return p})),o.d(t,"getWeekNumber",(function(){return h})),o.d(t,"datesAreInTheSamePeriod",(function(){return g})),o.d(t,"NumberFormatter",(function(){return ee})),o.d(t,"formatNumber",(function(){return se})),o.d(t,"formatPercent",(function(){return le})),o.d(t,"formatCurrency",(function(){return ce})),o.d(t,"formatEvolution",(function(){return de})),o.d(t,"calculateAndFormatEvolution",(function(){return ue})),o.d(t,"DropdownMenu",(function(){return Ue})),o.d(t,"FocusAnywhereButHere",(function(){return Je})),o.d(t,"FocusIf",(function(){return Qe})),o.d(t,"Tooltips",(function(){return tt})),o.d(t,"MatomoDialog",(function(){return at})),o.d(t,"ExpandOnClick",(function(){return ht})),o.d(t,"ExpandOnHover",(function(){return jt})),o.d(t,"ShowSensitiveData",(function(){return wt})),o.d(t,"DropdownButton",(function(){return kt})),o.d(t,"SelectOnFocus",(function(){return Tt})),o.d(t,"CopyToClipboard",(function(){return xt})),o.d(t,"SideNav",(function(){return Bt})),o.d(t,"EnrichedHeadline",(function(){return Kt})),o.d(t,"ContentBlock",(function(){return so})),o.d(t,"Comparisons",(function(){return To})),o.d(t,"ComparisonsStore",(function(){return Eo})),o.d(t,"ComparisonsStoreInstance",(function(){return Do})),o.d(t,"MenuItemsDropdown",(function(){return $o})),o.d(t,"DatePicker",(function(){return Yo})),o.d(t,"DateRangePicker",(function(){return ti})),o.d(t,"PeriodDatePicker",(function(){return ri})),o.d(t,"Notification",(function(){return bi})),o.d(t,"NotificationGroup",(function(){return Ei})),o.d(t,"NotificationsStore",(function(){return ki})),o.d(t,"ShowHelpLink",(function(){return xi})),o.d(t,"SitesStore",(function(){return Ii})),o.d(t,"SiteSelector",(function(){return on})),o.d(t,"QuickAccess",(function(){return jn})),o.d(t,"FieldArray",(function(){return Dn})),o.d(t,"MultiPairField",(function(){return Fn})),o.d(t,"PeriodSelector",(function(){return fa})),o.d(t,"ReportingMenu",(function(){return Za})),o.d(t,"ReportingMenuStore",(function(){return za})),o.d(t,"ReportingPagesStore",(function(){return _a})),o.d(t,"ReportMetadataStore",(function(){return or})),o.d(t,"WidgetsStore",(function(){return Ka})),o.d(t,"WidgetLoader",(function(){return hr})),o.d(t,"WidgetContainer",(function(){return Or})),o.d(t,"WidgetByDimensionContainer",(function(){return Tr})),o.d(t,"Widget",(function(){return Fr})),o.d(t,"ReportingPage",(function(){return Jr})),o.d(t,"ReportExport",(function(){return ks})),o.d(t,"Sparkline",(function(){return Ps})),o.d(t,"Progressbar",(function(){return Ms})),o.d(t,"ContentIntro",(function(){return Is})),o.d(t,"ContentTable",(function(){return Fs})),o.d(t,"AjaxForm",(function(){return Hs})),o.d(t,"Passthrough",(function(){return qs})),o.d(t,"DataTableActions",(function(){return ql})),o.d(t,"VersionInfoHeaderMessage",(function(){return ic})),o.d(t,"MobileLeftMenu",(function(){return mc})),o.d(t,"scrollToAnchorInUrl",(function(){return jc})),o.d(t,"SearchFiltersPersistenceStore",(function(){return mr})),o.d(t,"AutoClearPassword",(function(){return Sc})),o.d(t,"PasswordStrength",(function(){return Dc})),o.d(t,"EntityDuplicatorModal",(function(){return Gc})),o.d(t,"EntityDuplicatorAction",(function(){return Qc})),o.d(t,"EntityDuplicatorStore",(function(){return td})),o.d(t,"BaseDuplicatorAdapter",(function(){return Zc})),"undefined"!==typeof window){var i=window.document.currentScript,n=i&&i.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(o.p=n[1])}o("2342"); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ function a(e,...t){if(!e)return"";let o=t;return 1===t.length&&t[0]&&Array.isArray(t[0])&&([o]=t),window._pk_translate(e,o)}function r(e,...t){return e&&window.piwik_translations[e]?a(e,...t):e}function s(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class l{constructor(){s(this,"periods",{}),s(this,"periodOrder",[])}addCustomPeriod(e,t){if(this.periods[e])throw new Error(`The "${e}" period already exists! It cannot be overridden.`);this.periods[e]=t,this.periodOrder.push(e)}getAllLabels(){return Array().concat(this.periodOrder)}get(e){const t=this.periods[e];if(!t)throw new Error("Invalid period label: "+e);return t}parse(e,t){return this.get(e).parse(t)}isRecognizedPeriod(e){return!!this.periods[e]}}var c=new l; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function d(e){return $.datepicker.formatDate("yy-mm-dd",e)}function u(){const 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 m(e){if(e instanceof Date)return e;const t=decodeURIComponent(e).trim();if(""===t)throw new Error("Invalid date, empty string.");if("today"===t||"now"===t)return u();if("yesterday"===t||"yesterdaySameTime"===t){const e=u();return e.setDate(e.getDate()-1),e}if(t.match(/last[ -]?week/i)){const e=u();return e.setDate(e.getDate()-7),e}if(t.match(/last[ -]?month/i)){const e=u();return e.setDate(1),e.setMonth(e.getMonth()-1),e}if(t.match(/last[ -]?year/i)){const e=u();return e.setFullYear(e.getFullYear()-1),e}return $.datepicker.parseDate("yy-mm-dd",t)}function p(e){return 2===e.length&&(u()>=e[0]&&u()<=e[1])}function h(e){const t=new Date(e.valueOf()),o=(e.getDay()+6)%7;t.setDate(t.getDate()-o+3);const i=t.valueOf();if(t.setMonth(0,1),4!==t.getDay()){const e=(4-t.getDay()+7)%7;t.setMonth(0,1+e)}return 1+Math.ceil((i-t.valueOf())/6048e5)}function g(e,t,o){const i=e.getFullYear(),n=e.getMonth(),a=e.getDate(),r=h(e),s=t.getFullYear(),l=t.getMonth(),c=t.getDate(),d=h(t);switch(o){case"day":return i===s&&n===l&&a===c;case"week":return i===s&&r===d;case"month":return i===s&&n===l;case"year":return i===s;default:return!1}}function b(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class f{constructor(e){b(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new f(m(e))}static getDisplayText(){return a("Intl_PeriodDay")}getPrettyString(){return d(this.dateInPeriod)}getDateRange(){return[new Date(this.dateInPeriod.getTime()),new Date(this.dateInPeriod.getTime())]}containsToday(){return p(this.getDateRange())}}function v(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */c.addCustomPeriod("day",f);class O{constructor(e){v(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new O(m(e))}static getDisplayText(){return a("Intl_PeriodWeek")}getPrettyString(){const e=this.getDateRange(),t=d(e[0]),o=d(e[1]);return a("General_DateRangeFromTo",[t,o])}getDateRange(){const e=(this.dateInPeriod.getDay()+6)%7,t=new Date(this.dateInPeriod.getTime());t.setDate(this.dateInPeriod.getDate()-e);const o=new Date(t.getTime());return o.setDate(t.getDate()+6),[t,o]}containsToday(){return p(this.getDateRange())}}function j(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */c.addCustomPeriod("week",O);class y{constructor(e){j(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new y(m(e))}static getDisplayText(){return a("Intl_PeriodMonth")}getPrettyString(){const e=a("Intl_Month_Long_StandAlone_"+(this.dateInPeriod.getMonth()+1));return`${e} ${this.dateInPeriod.getFullYear()}`}getDateRange(){const e=new Date(this.dateInPeriod.getTime());e.setDate(1);const t=new Date(this.dateInPeriod.getTime());return t.setDate(1),t.setMonth(t.getMonth()+1),t.setDate(0),[e,t]}containsToday(){return p(this.getDateRange())}}function w(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */c.addCustomPeriod("month",y);class S{constructor(e){w(this,"dateInPeriod",void 0),this.dateInPeriod=e}static parse(e){return new S(m(e))}static getDisplayText(){return a("Intl_PeriodYear")}getPrettyString(){return this.dateInPeriod.getFullYear().toString()}getDateRange(){const e=new Date(this.dateInPeriod.getTime());e.setMonth(0),e.setDate(1);const t=new Date(this.dateInPeriod.getTime());return t.setMonth(12),t.setDate(0),[e,t]}containsToday(){return p(this.getDateRange())}}function k(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */c.addCustomPeriod("year",S);class C{constructor(e,t,o){k(this,"startDate",void 0),k(this,"endDate",void 0),k(this,"childPeriodType",void 0),this.startDate=e,this.endDate=t,this.childPeriodType=o}static getLastNRange(e,t,o){const i=Math.max(parseInt(t.toString(),10)-1,0);if(Number.isNaN(i))throw new Error("Invalid range strAmount");let n=o?m(o):u(),a=new Date(n.getTime());if("day"===e)a.setDate(a.getDate()-i);else if("week"===e)a.setDate(a.getDate()-7*i);else if("month"===e)a.setDate(1),a.setMonth(a.getMonth()-i);else{if("year"!==e)throw new Error(`Unknown period type '${e}'.`);a.setFullYear(a.getFullYear()-i)}if("day"!==e){const t=c.periods[e].parse(a),o=c.periods[e].parse(n);[a]=t.getDateRange(),[,n]=o.getDateRange()}const r=new Date(1991,7,6);if(a.getTime()-r.getTime()<0)switch(e){case"year":a=new Date(1992,0,1);break;case"month":a=new Date(1991,8,1);break;case"week":a=new Date(1991,8,12);break;case"day":default:a=r;break}return new C(a,n,e)}static getLastNRangeChild(e,t,o){const i=t?m(t):u();let n=new Date(i.getTime()),a=new Date(i.getTime());if("day"===e)n.setDate(n.getDate()-o),a.setDate(a.getDate()-o);else if("week"===e)n.setDate(n.getDate()-7*o),a.setDate(a.getDate()-7*o);else if("month"===e)n.setDate(1),n.setMonth(n.getMonth()-o),a.setDate(1),a.setMonth(a.getMonth()-o);else{if("year"!==e)throw new Error(`Unknown period type '${e}'.`);n.setFullYear(n.getFullYear()-o),a.setFullYear(a.getFullYear()-o)}if("day"!==e){const t=c.periods[e].parse(n),o=c.periods[e].parse(a);[n]=t.getDateRange(),[,a]=o.getDateRange()}const r=new Date(1991,7,6);if(n.getTime()-r.getTime()<0)switch(e){case"year":n=new Date(1992,0,1);break;case"month":n=new Date(1991,8,1);break;case"week":n=new Date(1991,8,12);break;case"day":default:n=r;break}return new C(n,a,e)}static parse(e,t="day"){if(/^previous/.test(e)){const o=C.getLastNRange(t,"2").startDate;return C.getLastNRange(t,e.substring(8),o)}if(/^last/.test(e))return C.getLastNRange(t,e.substring(4));const o=decodeURIComponent(e).split(",");return new C(m(o[0]),m(o[1]),t)}static getDisplayText(){return a("General_DateRangeInPeriodList")}getPrettyString(){const e=d(this.startDate),t=d(this.endDate);return a("General_DateRangeFromTo",[e,t])}getDateRange(){return[this.startDate,this.endDate]}containsToday(){return p(this.getDateRange())}getDayCount(){return Math.ceil((this.endDate.getTime()-this.startDate.getTime())/864e5)+1}}c.addCustomPeriod("range",C);var E=o("8bbf"); /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{piwik:D,broadcast:P,piwikHelper:T}=window;function V(){const{CoreHome:e}=window;return null===e||void 0===e?void 0:e.ReportingMenuStore}function N(){const{CoreHome:e}=window;return null===e||void 0===e?void 0:e.ComparisonStoreInstance}function x(e){var t;if("string"!==typeof e)return;const o=e.trim(),i=N();if(i){const t=i.getSegmentComparisons();if(!o&&t.length)return t[0].title;const n=t.find(t=>t.params.segment===e);if(n)return n.title}if(!o)return a("SegmentEditor_DefaultAllVisits");const n=document.querySelector(".segmentEditorPanel .segmentationTitle"),r=null===n||void 0===n||null===(t=n.textContent)||void 0===t?void 0:t.trim();return r||a("SegmentEditor_CustomSegment")}D.helper=T,D.broadcast=P,D.updateTitle=async function(e,t,o,i,n){let r="",s="",l="";""!==t&&""!==e&&(l=c.parse(t,e).getPrettyString());const d=a("CoreHome_WebAnalyticsReports")+" - Matomo",u=V();if(u&&o&&i){var m,p,h,g;let e=u.findSubcategory(o,i);e.category||(await u.fetchMenuItems(),e=u.findSubcategory(o,i)),r=null!==(m=null===(p=e)||void 0===p||null===(p=p.category)||void 0===p?void 0:p.name)&&void 0!==m?m:"",s=null!==(h=null===(g=e)||void 0===g||null===(g=g.subcategory)||void 0===g?void 0:g.name)&&void 0!==h?h:"",r===s&&(s=""),r=T.htmlEntities(r),s=T.htmlEntities(s);const t=r?`${r} ${s?"> "+s:""}`:"",a=x(n),c=a?T.htmlEntities(a):"";document.title=[D.siteName,l,t,c,d].filter(Boolean).join(" - ")}},D.hasUserCapability=function(e){return Array.isArray(D.userCapabilities)&&-1!==D.userCapabilities.indexOf(e)},D.on=function(e,t){function o(e){t(...e.detail)}t.wrapper=o,window.addEventListener(e,o)},D.off=function(e,t){t.wrapper&&window.removeEventListener(e,t.wrapper)},D.postEvent=function(e,...t){const o=new CustomEvent(e,{detail:t});window.dispatchEvent(o)};const B=D;var M=B; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function I(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{piwik:F,broadcast:L}=window;function A(e,t){try{return c.parse(e,t),!0}catch(o){return!1}}class _{constructor(){I(this,"url",Object(E["ref"])(null)),I(this,"urlQuery",Object(E["computed"])(()=>this.url.value?this.url.value.search.replace(/^\?/,""):"")),I(this,"hashQuery",Object(E["computed"])(()=>this.url.value?this.url.value.hash.replace(/^[#/?]+/,""):"")),I(this,"urlParsed",Object(E["computed"])(()=>Object(E["readonly"])(this.parse(this.urlQuery.value)))),I(this,"hashParsed",Object(E["computed"])(()=>Object(E["readonly"])(this.parse(this.hashQuery.value)))),I(this,"parsed",Object(E["computed"])(()=>Object(E["readonly"])(Object.assign(Object.assign({},this.urlParsed.value),this.hashParsed.value)))),this.url.value=new URL(window.location.href),window.addEventListener("hashchange",e=>{this.url.value=new URL(e.newURL),this.updatePeriodParamsFromUrl(),this.updatePageTitle()}),this.updatePeriodParamsFromUrl(),this.updatePageTitle()}updateHashToUrl(e){const t="#"+e;window.location.hash===t?window.dispatchEvent(new HashChangeEvent("hashchange",{newURL:window.location.href,oldURL:window.location.href})):window.location.hash=t}updateHash(e){const t=this.getFinalHashParams(e),o=this.stringify(t);this.updateHashToUrl("?"+o)}updateUrl(e,t={}){const o="string"!==typeof e?this.stringify(e):e,i=Object.keys(t).length?this.getFinalHashParams(t,e):{},n=this.stringify(i);let a="?"+o;n.length&&(a=`${a}#?${n}`),window.broadcast.propagateNewPage("",void 0,void 0,void 0,a)}getFinalHashParams(e,t={}){const o="string"!==typeof e?e:this.parse(e),i="string"!==typeof e?t:this.parse(t);return Object.assign({period:i.period||this.parsed.value.period,date:i.date||this.parsed.value.date,segment:i.segment||this.parsed.value.segment},o)}updateLocation(e){M.helper.isReportingPage()?this.updateHash(e):this.updateUrl(e)}getSearchParam(e){const t=window.location.href.split("#"),o=new RegExp(e+"(\\[]|=)");if(t&&t[1]&&o.test(decodeURIComponent(t[1]))){const t=window.broadcast.getValueFromHash(e,window.location.href);if(t||"date"!==e&&"period"!==e&&"idSite"!==e)return t}return window.broadcast.getValueFromUrl(e,window.location.search)}parse(e){return L.getValuesFromUrl("?"+e,!0)}stringify(e){const t=Object.fromEntries(Object.entries(e).filter(([,e])=>""!==e&&null!==e&&void 0!==e));return $.param(t).replace(/%5B%5D/g,"[]").replace(/%2C/g,",").replace(/\+/g,"%20")}getMenuPathSuffix(){const e=this.getSearchParam("category"),t=this.getSearchParam("subcategory");return{category:decodeURIComponent(e),subcategory:decodeURIComponent(t)}}getDateAndPeriodFromUrl(){return{date:this.getSearchParam("date")||"",period:this.getSearchParam("period")||""}}updatePageTitle(){const{period:e,date:t}=this.getDateAndPeriodFromUrl(),{category:o,subcategory:i}=this.getMenuPathSuffix(),n=this.getSearchParam("segment")||"";F.updateTitle(t,e,o,i,n)}updatePeriodParamsFromUrl(){const{period:e,date:t}=this.getDateAndPeriodFromUrl();let o=t;if(!A(e,o))return;if(F.period===e&&F.currentDateString===o)return;F.period=e;const i=c.parse(e,o).getDateRange();F.startDateString=d(i[0]),F.endDateString=d(i[1]),"range"===F.period&&(o=`${F.startDateString},${F.endDateString}`),F.currentDateString=o}}const R=new _;var H=R;function U(e,t,o){const i=new Date;o||(o=432e4),i.setTime(i.getTime()+o),document.cookie=`${e}=${t}; expires=${i.toUTCString()}; path=/`}function q(e){const t="; "+document.cookie,o=t.split(`; ${e}=`);if(2==o.length){const e=o.pop().split(";").shift();if("undefined"!==typeof e)return e}return null}function W(e){const t=new Date;t.setTime(t.getTime()+-864e5),document.cookie=`${e}=; expires=${t.toUTCString()}; path=/`}function z(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */F.updatePeriodParamsFromUrl=R.updatePeriodParamsFromUrl.bind(R);const{$:G}=window;function Y(e,t){"abort"!==t&&e&&0!==e.status&&("undefined"!==typeof Piwik_Popover?Piwik_Popover.isOpen()&&e&&500===e.status?G(document.body).html(piwikHelper.escape(e.responseText)):G("#loadingError").show():console.log("Request failed: "+e.responseText))}window.globalAjaxQueue=[],window.globalAjaxQueue.active=0,window.globalAjaxQueue.clean=function(){for(let e=this.length;e>=0;e-=1)this[e]&&4!==this[e].readyState||this.splice(e,1)},window.globalAjaxQueue.push=function(...e){return this.active+=e.length,this.clean(),Array.prototype.push.call(this,...e)},window.globalAjaxQueue.abort=function(){this.forEach(e=>e&&e.abort&&e.abort()),this.splice(0,this.length),this.active=0};class J extends Error{}class K{static fetch(e,t={}){const o=new K;t.withTokenInUrl&&o.withTokenInUrl(),t.errorElement&&o.setErrorElement(t.errorElement),t.redirectOnSuccess&&o.redirectOnSuccess(!0!==t.redirectOnSuccess?t.redirectOnSuccess:void 0),o.setFormat(t.format||"json"),Array.isArray(e)?o.setBulkRequests(...e):(Object.keys(e).forEach(e=>{if(/password/i.test(e))throw new Error(`Password parameters are not allowed to be sent as GET parameter. Please send ${e} as POST parameter instead.`)}),o.addParams(Object.assign(Object.assign({module:"API",format:t.format||"json"},e),{},{segment:e.segment?encodeURIComponent(e.segment):void 0}),"get")),t.postParams&&o.addParams(t.postParams,"post"),t.headers&&(o.headers=Object.assign(Object.assign({},o.headers),t.headers));let i=!0;return"undefined"===typeof t.createErrorNotification||t.createErrorNotification||(o.useCallbackInCaseOfError(),o.setErrorCallback(null),i=!1),t.abortController&&(o.abortController=t.abortController),t.returnResponseObject&&(o.resolveWithHelper=!0),!1===t.abortable&&(o.abortable=!1),o.send().then(e=>{const t=e instanceof K?e.requestHandle.responseJSON:e,i="API.getBulkRequest"===o.postParams.method&&Array.isArray(t)?t:[t],n=i.filter(e=>"error"===e.result).map(e=>e.message);if(n.length)throw new J(n.filter(e=>e.length).join("\n"));return e}).catch(e=>{if(i||e instanceof J)throw e;let t="Something went wrong";throw 504===e.status&&(t="Request was possibly aborted"),429===e.status&&(t="Rate Limit was exceed"),new Error(t)})}static post(e,t={},o={}){return K.fetch(e,Object.assign(Object.assign({},o),{},{postParams:t}))}static oneAtATime(e,t){let o=null;return(i,n)=>(o&&o.abort(),o=new AbortController,K.post(Object.assign(Object.assign({},i),{},{method:e}),n,Object.assign(Object.assign({},t),{},{abortController:o})).finally(()=>{o=null}))}constructor(){z(this,"format","json"),z(this,"timeout",null),z(this,"callback",null),z(this,"useRegularCallbackInCaseOfError",!1),z(this,"errorCallback",void 0),z(this,"withToken",!1),z(this,"completeCallback",void 0),z(this,"getParams",{}),z(this,"getUrl","?"),z(this,"postParams",{}),z(this,"loadingElement",null),z(this,"errorElement","#ajaxError"),z(this,"headers",{"X-Requested-With":"XMLHttpRequest"}),z(this,"requestHandle",null),z(this,"abortController",null),z(this,"abortable",!0),z(this,"defaultParams",["idSite","period","date","segment"]),z(this,"resolveWithHelper",!1),this.errorCallback=Y}addParams(e,t){const o="string"===typeof e?window.broadcast.getValuesFromUrl(e):e,i=["compareSegments","comparePeriods","compareDates"];Object.keys(o).forEach(e=>{let n=o[e];(-1===i.indexOf(e)||n)&&("boolean"===typeof n&&(n=n?1:0),"get"===t.toLowerCase()?this.getParams[e]=n:"post"===t.toLowerCase()&&(this.postParams[e]=n))})}withTokenInUrl(){this.withToken=!0}setUrl(e){this.addParams(broadcast.getValuesFromUrl(e),"GET")}setBulkRequests(...e){const t=e.map(e=>"string"===typeof e?e:G.param(e));this.addParams({module:"API",method:"API.getBulkRequest",urls:t,format:"json"},"post")}setTimeout(e){this.timeout=e}setCallback(e){this.callback=e}useCallbackInCaseOfError(){this.useRegularCallbackInCaseOfError=!0}redirectOnSuccess(e){this.setCallback(()=>{piwikHelper.redirect(e)})}setErrorCallback(e){this.errorCallback=e}setCompleteCallback(e){this.completeCallback=e}setFormat(e){this.format=e}setLoadingElement(e){this.loadingElement=e||"#ajaxLoadingDiv"}setErrorElement(e){e&&(this.errorElement=e)}useGETDefaultParameter(e){if(e&&this.defaultParams)for(let t=0;t{this.requestHandle&&this.requestHandle.abort()});const e=new Promise((e,t)=>{this.requestHandle.then(t=>{this.resolveWithHelper?e(this):e(t)}).fail(e=>{if(429===e.status)return console.log(`Warning: the '${G.param(this.getParams)}' request was rate limited!`),void t(e);if("abort"===e.statusText||0===e.status)return;const o=!document.querySelector("#login_form"),i="1"===e.getResponseHeader("X-Matomo-Session-Timed-Out");if(i&&o)return U("matomo_session_timed_out","1",6e4),void M.helper.refreshAfter(0);console.log(`Warning: the ${G.param(this.getParams)} request failed!`),t(e)})});return e}abort(){this.requestHandle&&"function"===typeof this.requestHandle.abort&&(this.requestHandle.abort(),this.requestHandle=null)}buildAjaxCall(){const e=this,t=this.mixinDefaultGetParams(this.getParams);let o=this.getUrl;"?"!==o[o.length-1]&&(o+="&"),t.segment&&(o=`${o}segment=${t.segment}&`,delete t.segment),t.date&&(o=`${o}date=${decodeURIComponent(t.date.toString())}&`,delete t.date),o+=G.param(t);const i={type:"POST",async:!0,url:o,dataType:this.format||"json",complete:this.completeCallback,headers:this.headers?this.headers:void 0,error:function(...t){e.abortable&&(window.globalAjaxQueue.active-=1),e.errorCallback&&e.errorCallback.apply(this,t)},success:(t,o,i)=>{this.loadingElement&&G(this.loadingElement).hide();const n="API.getBulkRequest"===this.postParams.method&&Array.isArray(t)?t:[t],a=n.filter(e=>"error"===e.result).map(e=>e.message).filter(e=>e.length).reduce((e,t)=>(e[t]=(e[t]||0)+1,e),{});if(a&&Object.keys(a).length&&!this.useRegularCallbackInCaseOfError){let e="";Object.keys(a).forEach(t=>{e.length&&(e+="
"),a[t]>1?e+=`${t} (${a[t]}x)`:e+=t});let t=null,o="toast";G(this.errorElement).length&&e.length&&(G(this.errorElement).show(),t=this.errorElement,o=null);const i=!document.querySelector("#login_form");if(e&&i){const i=window["require"]("piwik/UI"),n=new i.Notification;n.show(e,{placeat:t,context:"error",type:o,id:"ajaxHelper"}),n.scrollToNotification()}}else this.callback&&this.callback(t,o,i);e.abortable&&(window.globalAjaxQueue.active-=1),M.ajaxRequestFinished&&M.ajaxRequestFinished()},data:this.mixinDefaultPostParams(this.postParams),timeout:null!==this.timeout?this.timeout:void 0};return G.ajax(i)}isRequestToApiMethod(){return this.getParams&&"API"===this.getParams.module&&this.getParams.method||this.postParams&&"API"===this.postParams.module&&this.postParams.method}isWidgetizedRequest(){return"Widgetize"===broadcast.getValueFromUrl("module")}getDefaultPostParams(){return this.withToken||this.isRequestToApiMethod()||M.shouldPropagateTokenAuth?{token_auth:M.token_auth,force_api_session:broadcast.isWidgetizeRequestWithoutSession()?0:1}:{}}mixinDefaultPostParams(e){const t=this.getDefaultPostParams(),o=Object.assign(Object.assign({},t),e);return o}mixinDefaultGetParams(e){const t=H.getSearchParam("segment"),o={idSite:M.idSite?M.idSite.toString():broadcast.getValueFromUrl("idSite"),period:M.period||broadcast.getValueFromUrl("period"),segment:t},i=e;return i.token_auth&&(i.token_auth=null,delete i.token_auth),Object.keys(o).forEach(e=>{!this.useGETDefaultParameter(e)||null!==i[e]&&"undefined"!==typeof i[e]&&""!==i[e]||null!==this.postParams[e]&&"undefined"!==typeof this.postParams[e]&&""!==this.postParams[e]||!o[e]||(i[e]=o[e])}),!this.useGETDefaultParameter("date")||i.date||this.postParams.date||(i.date=M.currentDateString),i}getRequestHandle(){return this.requestHandle}}function Q(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */window.ajaxHelper=K;const{$:X}=window;class Z{constructor(){Q(this,"defaultMinFractionDigits",0),Q(this,"defaultMaxFractionDigits",2)}format(e,t,o,i){if(!X.isNumeric(e))return String(e);let n=e,a=t||M.numbers.patternNumber;const r=a.split(";");1===r.length&&r.push("-"+r[0]);const s=n<0;if(a=s?r[1]:r[0],n=Math.abs(n),o>=0){const e=10**o;n=Math.round(n*e)/e}const l=n.toString().split(".");let c=l[0],d=l[1]||"";const u=-1!==a.indexOf(",");if(u){const e=a.match(/#+0/),t=(null===e||void 0===e?void 0:e[0].length)||0;let o=(null===e||void 0===e?void 0:e[0].length)||0;const i=a.split(",");i.length>2&&(o=i[1].length);const n=c.split("").reverse();let r=[];r.push(n.splice(0,t).reverse().join(""));while(n.length)r.push(n.splice(0,o).reverse().join(""));r=r.reverse(),c=r.join(",")}if(i>0&&(d=d.replace(/0+$/,""),d.length{let i=e;Object.entries(t).some(([e,t])=>-1!==i.indexOf(e)&&(i=i.replace(e,t),!0)),o+=i}),o}valOrDefault(e,t){return"undefined"===typeof e?t:e}getMaxFractionDigitsForCompactFormat(e){return 1===e?1:0}determineCorrectCompactPattern(e,t){let o=0,i=0,n="";if(Math.round(t)<1e3)return["0",1];for(o=1e3;o<=1e19;o*=10){const r=o+"One",s=o+"Other";if(1===Math.round(t/o)&&""!==(null===e||void 0===e?void 0:e[r])?(i=o,n=r):Math.round(t/o)>=1&&""!==(null===e||void 0===e?void 0:e[s])&&(i=o,n=s),null!==e&&void 0!==e&&e[n]){var a;const i=(null===e||void 0===e||null===(a=e[n].match(/0/g))||void 0===a?void 0:a.length)||1;if(Math.round(t*10**i/(10*o))<10**i)break}}return[(null===e||void 0===e?void 0:e[n])||"0",i]}formatCompact(e,t,o){var i;const n=(null===(i=e.match(/0/g))||void 0===i?void 0:i.length)||0;let a=t;n>1&&(a/=10**(n-1));const r=this.getMaxFractionDigitsForCompactFormat(n),s=10**r,l=Math.round(o/a*s)/s,c=this.formatNumber(l,r,0);return e.replace(/(0+)/,c).replace(/('\.')/,".")}parseFormattedNumber(e){const t=e.indexOf(M.numbers.symbolMinus)>-1||e.startsWith("-"),o=e.split(M.numbers.symbolDecimal);return o.forEach((e,t)=>{o[t]=e.replace(/[^0-9]/g,"")}),(t?-1:1)*parseFloat(o.join("."))}formatNumber(e,t,o){return this.format(e,M.numbers.patternNumber,this.valOrDefault(t,this.defaultMaxFractionDigits),this.valOrDefault(o,this.defaultMinFractionDigits))}formatPercent(e,t,o){return this.format(e,M.numbers.patternPercent,this.valOrDefault(t,this.defaultMaxFractionDigits),this.valOrDefault(o,this.defaultMinFractionDigits))}formatCurrency(e,t,o,i){const n=this.format(e,M.numbers.patternCurrency,this.valOrDefault(o,this.defaultMaxFractionDigits),this.valOrDefault(i,this.defaultMinFractionDigits));return n.replace("¤",t)}formatNumberCompact(e){const t=e,[o,i]=this.determineCorrectCompactPattern(M.numbers.patternsCompactNumber||[],t);return Math.round(t)<1e3||"0"===o?this.formatNumber(t,this.getMaxFractionDigitsForCompactFormat(Math.round(t)),0):this.formatCompact(o,i,t)}formatCurrencyCompact(e,t){const o=e,[i,n]=this.determineCorrectCompactPattern(M.numbers.patternsCompactCurrency||[],o);return Math.round(o)<1e3||"0"===i?this.formatCurrency(o,t,this.getMaxFractionDigitsForCompactFormat(Math.round(o)),0):this.formatCompact(i,n,o).replace("¤",t)}formatEvolution(e,t,o,i){if(i)return this.formatPercent(Math.abs(e),t,o);const n=this.formatPercent(e,t,o);return`${e>0?M.numbers.symbolPlus:""}${n}`}calculateAndFormatEvolution(e,t,o){const i=parseInt(t,10),n=parseInt(e,10)-i;let a;a=0===n||Number.isNaN(n)?0:0===i||Number.isNaN(i)?100:n/i*100;let r=3;return Math.abs(a)>100?r=0:Math.abs(a)>10?r=1:Math.abs(a)>1&&(r=2),this.formatEvolution(a,r,0,o)}}var ee=new Z;window.NumberFormatter=ee; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ const{$:te}=window;class oe{constructor(){this.setup()}setup(){Object(E["watch"])(()=>H.parsed.value.popover,()=>this.onPopoverParamChanged()),H.parsed.value.popover&&this.onPopoverParamChangedInitial()}onPopoverParamChangedInitial(){te(()=>{setTimeout(()=>{this.openOrClose()})})}onPopoverParamChanged(){te(()=>{this.openOrClose()})}openOrClose(){this.close();const e=H.parsed.value.popover;e?this.open(e):window.broadcast.resetPopoverStack()}close(){window.Piwik_Popover.close()}open(e){let t=decodeURIComponent(e);t=t.replace(/\$/g,"%"),t=decodeURIComponent(t);const o=t.split(":"),i=o[0];o.shift();const n=o.join(":");"undefined"===typeof window.broadcast.popoverHandlers[i]||window.broadcast.isLoginPage()||window.broadcast.popoverHandlers[i](n)}}new oe; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{$:ie}=window;function ne(){let e=!!parseInt(q("zenMode"),10);const t=ie(".top_controls .icon-arrowup");function o(){e?(ie("body").addClass("zenMode"),t.addClass("icon-arrowdown").removeClass("icon-arrowup"),t.prop("title",a("CoreHome_ExitZenMode"))):(ie("body").removeClass("zenMode"),t.removeClass("icon-arrowdown").addClass("icon-arrowup"),t.prop("title",a("CoreHome_EnterZenMode")))}M.helper.registerShortcut("z",a("CoreHome_ShortcutZenMode"),t=>{t.altKey||(e=!e,U("zenMode",e?"1":"0"),o())}),t.click(()=>{window.Mousetrap.trigger("z")}),o()} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ function ae(e,...t){const o=t;return window._pk_externalRawLink?window._pk_externalRawLink(e,o):e}function re(e,...t){if(!e)return"";const o=t.length>0&&t[0]?t[0]:null,i=t.length>1&&t[1]?t[1]:null,n=t.length>2&&t[2]?t[2]:null,a=ae(e,o,i,n);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 se(e,t,o){return ee.formatNumber(e,t,o)}function le(e,t,o){return ee.formatPercent(e,t,o)}function ce(e,t,o,i){return ee.formatCurrency(e,t,o,i)}function de(e,t,o,i){return ee.formatEvolution(e,t,o,i)}function ue(e,t,o){return ee.calculateAndFormatEvolution(e,t,o)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function me(...e){const t=Object(E["createApp"])(...e);return t.config.globalProperties.$sanitize=window.vueSanitize,t.config.globalProperties.translate=a,t.config.globalProperties.translateOrDefault=r,t.config.globalProperties.externalLink=re,t.config.globalProperties.externalRawLink=ae,t.config.globalProperties.formatNumber=se,t.config.globalProperties.formatPercent=le,t.config.globalProperties.formatCurrency=ce,t.config.globalProperties.formatEvolution=de,t.config.globalProperties.calculateAndFormatEvolution=ue,t} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */M.on("Matomo.topControlsRendered",()=>{ne()});const pe={},he=120,ge=50,be=1e3;function fe(e){if(pe[e])return pe[e];if(window[e])return Promise.resolve(window[e]);const t="?module=Proxy&action=getPluginUmdJs&plugin="+e;let o,i;const n=document.createElement("script");let a;n.charset="utf-8",n.timeout=he,n.src=t;const r=new Error,s=t=>{n.onerror=null,n.onload=null,clearTimeout(a);let s=0;function l(){if(s+=ge,o&&i)if(window[e]&&i)try{i(window[e])}finally{o=void 0,i=void 0}else if(s>be)try{const n=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;r.message=`Loading plugin ${e} on demand failed.\n(${n}: ${a})`,r.name="PluginOnDemandLoadError",r.type=n,r.request=a,o(r)}finally{o=void 0,i=void 0}else setTimeout(l,ge)}setTimeout(l,ge)};return a=setTimeout(()=>{s({type:"timeout",target:n})},he),n.onerror=s,n.onload=s,document.head.appendChild(n),new Promise((e,t)=>{i=e,o=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 ve(e,t){return Object(E["defineAsyncComponent"])(()=>fe(e).then(e=>(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 Oe(e,t){var o;return e instanceof HTMLElement?e:null===(o=t.instance)||void 0===o?void 0:o.$refs[e]}var je={getRef:Oe};const ye=300;function we(e,t=ye){let o;return function(...i){o&&clearTimeout(o),o=setTimeout(()=>{e.call(this,...i)},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 Se(e){return"undefined"===typeof e?e:JSON.parse(JSON.stringify(e))}const ke={ref:"root"};function Ce(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ke,[e.componentWrapper?(Object(E["openBlock"])(),Object(E["createBlock"])(Object(E["resolveDynamicComponent"])(e.componentWrapper),{key:0})):Object(E["createCommentVNode"])("",!0)],512)}var Ee=Object(E["defineComponent"])({props:{html:String},mounted(){M.helper.compileVueEntryComponents(this.$refs.root)},beforeUnmount(){M.helper.destroyVueComponent(this.$refs.root)},computed:{componentWrapper(){return this.html?Object(E["markRaw"])({template:this.html}):null}}});Ee.render=Ce;var De=Ee;const Pe={class:"loadingPiwik"};function Te(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("MatomoLoader");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Pe,[Object(E["createVNode"])(r),Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.loadingMessage),1)],512)),[[E["vShow"],e.loading]])}const Ve={class:"matomo-loader"},Ne=Object(E["createElementVNode"])("span",null,null,-1),xe=Object(E["createElementVNode"])("span",null,null,-1),Be=Object(E["createElementVNode"])("span",null,null,-1),Me=[Ne,xe,Be];function Ie(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("span",Ve,Me)}var Fe=Object(E["defineComponent"])({});Fe.render=Ie;var Le=Fe,Ae=Object(E["defineComponent"])({components:{MatomoLoader:Le},props:{loading:{type:Boolean,required:!0,default:!1},loadingMessage:{type:String,required:!1,default:a("General_LoadingData")}}});Ae.render=Te;var _e=Ae;function Re(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])(["alert",{["alert-"+e.severity]:!0}])},[Object(E["renderSlot"])(e.$slots,"default")],2)}var He=Object(E["defineComponent"])({props:{severity:{type:String,required:!0}}});He.render=Re;var $e=He,Ue={mounted(e,t){let o={};$(e).addClass("matomo-dropdown-menu");const i=!!$(e).parent().closest(".dropdown-content").length;var n;i&&(o={hover:!0},$(e).addClass("submenu"),$((null===(n=t.value)||void 0===n?void 0:n.activates)||$(e).data("target")).addClass("submenu-dropdown-content"),$(e).parents(".dropdown-content").addClass("submenu-container"));$(e).dropdown(o)},updated(e){Object(E["nextTick"])(()=>{$(e).addClass("matomo-dropdown-menu")})}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ function qe(e,t,o){const i=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,i||e.contains(o.target)||t.value&&t.value.blur()}function We(e,t){t.value.hasScrolled=!0}function ze(e,t){t.value.isMouseDown=!0,t.value.hasScrolled=!1}function Ge(e,t,o){27===o.which&&setTimeout(()=>{t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.blur&&t.value.blur()},0)}const Ye=document.documentElement;var Je={mounted(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onEscapeHandler=Ge.bind(null,e,t),t.value.onMouseDown=ze.bind(null,e,t),t.value.onClickOutsideElement=qe.bind(null,e,t),t.value.onScroll=We.bind(null,e,t),Ye.addEventListener("keyup",t.value.onEscapeHandler),Ye.addEventListener("mousedown",t.value.onMouseDown),Ye.addEventListener("mouseup",t.value.onClickOutsideElement),Ye.addEventListener("scroll",t.value.onScroll)},unmounted(e,t){Ye.removeEventListener("keyup",t.value.onEscapeHandler),Ye.removeEventListener("mousedown",t.value.onMouseDown),Ye.removeEventListener("mouseup",t.value.onClickOutsideElement),Ye.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 Ke(e,t){var o,i;null===(o=t.value)||void 0===o||!o.focused||null!==(i=t.oldValue)&&void 0!==i&&i.focused||setTimeout(()=>{e.focus(),t.value.afterFocus&&t.value.afterFocus()},5)}var Qe={mounted(e,t){Ke(e,t)},updated(e,t){Ke(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 */const{$:Xe}=window;function Ze(){const e=Xe(this).attr("title")||"";return window.vueSanitize(e.replace(/\n/g,"
"))}function et(e,t){var o,i,n,a,r,s;Xe(e).tooltip({track:!0,content:(null===(o=t.value)||void 0===o?void 0:o.content)||Ze,show:"undefined"!==typeof(null===(i=t.value)||void 0===i?void 0:i.show)?null===(n=t.value)||void 0===n?void 0:n.show:{delay:(null===(a=t.value)||void 0===a?void 0:a.delay)||700,duration:(null===(r=t.value)||void 0===r?void 0:r.duration)||200},hide:!1,tooltipClass:null===(s=t.value)||void 0===s?void 0:s.tooltipClass})}var tt={mounted(e,t){setTimeout(()=>et(e,t))},updated(e,t){setTimeout(()=>et(e,t))},beforeUnmount(e){try{window.$(e).tooltip("destroy")}catch(t){}}};const ot={ref:"root"};function it(e,t,o,i,n,a){return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ot,[Object(E["renderSlot"])(e.$slots,"default")],512)),[[E["vShow"],e.modelValue]])}var nt=Object(E["defineComponent"])({props:{modelValue:{type:Boolean,required:!0},options:{type:Object,required:!1,default:()=>({})}},emits:["yes","no","closeEnd","close","validation","update:modelValue"],activated(){this.$emit("update:modelValue",!1)},watch:{modelValue(e,t){if(e){const e=this.$refs.root.firstElementChild;M.helper.modalConfirm(e,{yes:()=>{this.$emit("yes")},no:()=>{this.$emit("no")},validation:()=>{this.$emit("validation")}},Object.assign({onCloseEnd:()=>{this.$refs.root.appendChild(e),this.$emit("update:modelValue",!1),this.$emit("closeEnd")}},this.options))}else!1===e&&!0===t&&($(".modal.open").modal("close"),this.$emit("close"))}}});nt.render=it;var at=nt; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function rt(e,t,o){var i;e.classList.add("expanded"),null!==(i=t.value)&&void 0!==i&&i.onExpand&&t.value.onExpand(o);const n=e.querySelector(".dropdown.positionInViewport");n&&M.helper.setMarginLeftToBeInViewport(n)}function st(e,t,o){var i;e.classList.contains("expanded")&&(e.classList.remove("expanded"),null!==(i=t.value)&&void 0!==i&&i.onClosed&&t.value.onClosed(o))}function lt(e,t,o){e.classList.contains("expanded")?st(e,t,o):rt(e,t,o)}function ct(e,t,o){const i=t.value.isMouseDown&&t.value.hasScrolled;t.value.isMouseDown=!1,t.value.hasScrolled=!1,i||e.contains(o.target)||st(e,t,o)}function dt(e){e.value.hasScrolled=!0}function ut(e){e.value.isMouseDown=!0,e.value.hasScrolled=!1}function mt(e,t,o){"Escape"===o.key&&(t.value.isMouseDown=!1,t.value.hasScrolled=!1,st(e,t,o))}const pt=document.documentElement;var ht={mounted(e,t){t.value.isMouseDown=!1,t.value.hasScrolled=!1,t.value.onClickOnExpander=lt.bind(null,e,t),t.value.onEscapeHandler=mt.bind(null,e,t),t.value.onMouseDown=ut.bind(null,t),t.value.onClickOutsideElement=ct.bind(null,e,t),t.value.onScroll=dt.bind(null,t),setTimeout(()=>{const e=je.getRef(t.value.expander,t);e&&e.addEventListener("click",t.value.onClickOnExpander)}),pt.addEventListener("keyup",t.value.onEscapeHandler),pt.addEventListener("mousedown",t.value.onMouseDown),pt.addEventListener("mouseup",t.value.onClickOutsideElement),pt.addEventListener("scroll",t.value.onScroll)},unmounted(e,t){const o=je.getRef(t.value.expander,t);o&&pt.removeEventListener("click",t.value.onClickOnExpander),pt.removeEventListener("keyup",t.value.onEscapeHandler),pt.removeEventListener("mousedown",t.value.onMouseDown),pt.removeEventListener("mouseup",t.value.onClickOutsideElement),pt.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 gt(e){e.classList.add("expanded");const t=e.querySelector(".dropdown.positionInViewport");t&&M.helper.setMarginLeftToBeInViewport(t)}function bt(e){e.classList.remove("expanded")}function ft(e,t){e.contains(t.target)||e.classList.remove("expanded")}function vt(e,t){27===t.which&&e.classList.remove("expanded")}const Ot=document.documentElement;var jt={mounted(e,t){t.value.onMouseEnter=gt.bind(null,e),t.value.onMouseLeave=bt.bind(null,e),t.value.onClickOutsideElement=ft.bind(null,e),t.value.onEscapeHandler=vt.bind(null,e),setTimeout(()=>{const e=je.getRef(t.value.expander,t);e&&e.addEventListener("mouseenter",t.value.onMouseEnter)}),e.addEventListener("mouseleave",t.value.onMouseLeave),Ot.addEventListener("keyup",t.value.onEscapeHandler),Ot.addEventListener("mouseup",t.value.onClickOutsideElement)},unmounted(e,t){const o=je.getRef(t.value.expander,t);o&&o.removeEventListener("mouseenter",t.value.onMouseEnter),e.removeEventListener("mouseleave",t.value.onMouseLeave),document.removeEventListener("keyup",t.value.onEscapeHandler),document.removeEventListener("mouseup",t.value.onClickOutsideElement)}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{$:yt}=window;var wt={mounted(e,t){const o=yt(e),{sensitiveData:i}=t.value,n=t.value.showCharacters||6,r=t.value.clickElementSelector||o;let s="";function l(){o.html(i),yt(r).css({cursor:""}),yt(r).tooltip("destroy")}n>0&&(s+=i.slice(0,n)),s+=i.slice(n).replace(/./g,"*"),o.html(s),yt(r).tooltip({content:a("CoreHome_ClickToSeeFullInformation"),items:"*",track:!0}),yt(r).one("click",l),yt(r).css({cursor:"pointer"})}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{$:St}=window;var kt={mounted(e){const t=St(e);!t.attr("data-target")&&t.attr("data-activates")&&t.attr("data-target",t.attr("data-activates"));const o=t.attr("data-target");o&&St("#"+o).length&&t.dropdown({inDuration:300,outDuration:225,constrainWidth:!1,belowOrigin:!0})}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{$:Ct}=window;function Et(e,t){e.value.focusedElement!==t.target&&(e.value.focusedElement=t.target,Ct(t.target).select())}function Dt(e){const t=document.createRange();t.selectNode(e.target);const o=window.getSelection();o&&o.rangeCount>0&&o.removeAllRanges(),o&&o.addRange(t)}function Pt(e){delete e.value.focusedElement}var Tt={mounted(e,t){const o=e.tagName.toLowerCase();t.value.elementSupportsSelect="textarea"===o,t.value.elementSupportsSelect?(t.value.onFocusHandler=Et.bind(null,t),t.value.onBlurHandler=Pt.bind(null,t),e.addEventListener("focus",t.value.onFocusHandler),e.addEventListener("blur",t.value.onBlurHandler)):(t.value.onClickHandler=Dt,e.addEventListener("click",t.value.onClickHandler))},unmounted(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 Vt(e){if(e){const 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);const o=e.parentElement;if(o){const e=o.getElementsByTagName("i")[0];e&&(e.classList.remove("copyToClipboardIcon"),e.classList.add("copyToClipboardIconCheck"));const t=o.getElementsByClassName("copyToClipboardCopiedDiv")[0];t&&(t.style.display="inline-block",setTimeout(()=>{t.style.display="none"},2500))}}}function Nt(e,t){if(t.value.transitionOpen){const o=e.parentElement;if(o){const e=o.getElementsByTagName("i")[0];e&&(e.classList.remove("copyToClipboardIconCheck"),e.classList.add("copyToClipboardIcon"))}t.value.transitionOpen=!1}else t.value.transitionOpen=!0}var xt={mounted(e,t){const o=e.tagName.toLowerCase();if("pre"===o){const o=document.createElement("button");o.setAttribute("type","button"),o.className="copyToClipboardButton";const i=document.createElement("div");i.className="copyToClipboardPositionDiv";const n=document.createElement("i");n.className="copyToClipboardIcon",o.appendChild(n);const r=document.createElement("span");r.className="copyToClipboardSpan",r.innerHTML=a("General_Copy"),o.appendChild(r),i.appendChild(o);const s=document.createElement("div");s.className="copyToClipboardCopiedDiv",s.innerHTML=a("General_CopiedToClipboard"),i.appendChild(s);const l=e.parentElement;l&&(l.classList.add("copyToClipboardWrapper"),l.appendChild(i)),t.value.onClickHandler=Vt.bind(null,e),o.addEventListener("click",t.value.onClickHandler),t.value.onTransitionEndHandler=Nt.bind(null,e,t),o.addEventListener("transitionend",t.value.onTransitionEndHandler)}},unmounted(e,t){e.removeEventListener("click",t.value.onClickHandler),e.removeEventListener("transitionend",t.value.onTransitionEndHandler)}},Bt={mounted(e,t){t.value.activator&&setTimeout(()=>{if(!t.value.initialized){t.value.initialized=!0;const e=je.getRef(t.value.activator,t);if(e){window.$(e).show();const t=e.getAttribute("data-target");window.$("#"+t).sidenav({closeOnClick:!0})}}e.classList.contains("collapsible")&&window.$(e).collapsible()})}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const Mt={key:0,class:"title",tabindex:"6"},It=["href","title"],Ft={class:"iconsBar"},Lt=["href","title"],At=Object(E["createElementVNode"])("span",{class:"icon-help"},null,-1),_t=[At],Rt=["title"],Ht=Object(E["createElementVNode"])("span",{class:"icon-info"},null,-1),$t=[Ht],Ut={key:2,class:"ratingIcons"},qt={class:"inlineHelp"},Wt=["innerHTML"],zt=["innerHTML"],Gt=["href"];function Yt(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:"enrichedHeadline",onMouseenter:t[1]||(t[1]=t=>e.showIcons=!0),onMouseleave:t[2]||(t[2]=t=>e.showIcons=!1),ref:"root"},[e.editUrl?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Mt,[Object(E["renderSlot"])(e.$slots,"default")])),e.editUrl?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,class:"title",href:e.editUrl,title:e.translate("CoreHome_ClickToEditX",e.htmlEntities(e.actualFeatureName))},[Object(E["renderSlot"])(e.$slots,"default")],8,It)):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])(Object(E["createElementVNode"])("span",Ft,[e.helpUrl&&!e.actualInlineHelp?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",class:"helpIcon",href:e.helpUrl,title:e.translate("CoreHome_ExternalHelp")},_t,8,Lt)):Object(E["createCommentVNode"])("",!0),e.actualInlineHelp?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,onClick:t[0]||(t[0]=t=>e.showInlineHelp=!e.showInlineHelp),class:Object(E["normalizeClass"])(["helpIcon",{active:e.showInlineHelp}]),title:e.translate(e.reportGenerated?"General_HelpReport":"General_Help")},$t,10,Rt)):Object(E["createCommentVNode"])("",!0),e.showRateFeature?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ut,[(Object(E["openBlock"])(),Object(E["createBlock"])(Object(E["resolveDynamicComponent"])(e.rateFeature),{title:e.actualFeatureName},null,8,["title"]))])):Object(E["createCommentVNode"])("",!0)],512),[[E["vShow"],e.showIcons||e.showInlineHelp]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",qt,[Object(E["createElementVNode"])("div",{innerHTML:e.$sanitize(e.actualInlineHelp)},null,8,Wt),""!=e.reportGenerated?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,class:"helpDate",innerHTML:e.$sanitize(e.reportGenerated)},null,8,zt)):Object(E["createCommentVNode"])("",!0),e.helpUrl?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,rel:"noreferrer noopener",target:"_blank",class:"readMore",href:e.helpUrl},Object(E["toDisplayString"])(e.translate("General_MoreDetails")),9,Gt)):Object(E["createCommentVNode"])("",!0)],512),[[E["vShow"],e.showInlineHelp]])],544)}var Jt=Object(E["defineComponent"])({props:{helpUrl:{type:String,default:""},editUrl:{type:String,default:""},reportGenerated:String,featureName:String,inlineHelp:String},data(){return{showIcons:!1,showInlineHelp:!1,actualFeatureName:this.featureName,actualInlineHelp:this.inlineHelp}},watch:{inlineHelp(e){this.actualInlineHelp=e},featureName(e){this.actualFeatureName=e}},mounted(){const e=this.$refs.root;if(!this.actualInlineHelp){var t;let i=e.querySelector(".title .inlineHelp");if(!i&&null!==(t=e.parentElement)&&void 0!==t&&t.nextElementSibling&&(i=e.parentElement.nextElementSibling.querySelector(".reportDocumentation")),i){var o;const e=null===(o=i.getAttribute("data-content"))||void 0===o?void 0:o.trim();e&&e.length&&(this.actualInlineHelp=`

${e}

`,setTimeout(()=>i.remove(),0))}}var i;this.actualFeatureName||(this.actualFeatureName=null===(i=e.querySelector(".title"))||void 0===i?void 0:i.textContent);if(M.period&&M.currentDateString){const t=c.parse(M.period,M.currentDateString);this.reportGenerated&&t.containsToday()&&window.$(e.querySelector(".report-generated")).tooltip({track:!0,content:this.reportGenerated,items:"div",show:!1,hide:!1})}},methods:{htmlEntities(e){return M.helper.htmlEntities(e)}},computed:{showRateFeature(){return"Feedback_SendFeedback"!==r("Feedback_SendFeedback")},rateFeature(){return this.showRateFeature?ve("Feedback","RateFeature"):""}}});Jt.render=Yt;var Kt=Jt;const Qt={class:"card-content"},Xt={key:0,class:"card-title"},Zt={key:1,class:"card-title"},eo={ref:"content"},to={key:0,class:"card-image hide-on-med-and-down"},oo=["src","alt"];function io(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("EnrichedHeadline");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])({card:!0,"card-with-image":!!this.imageUrl}),ref:"root"},[Object(E["createElementVNode"])("div",Qt,[!e.contentTitle||e.actualFeature||e.helpUrl||e.actualHelpText||e.editUrl?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("h2",Xt,Object(E["toDisplayString"])(e.decode(e.contentTitle)),1)),e.contentTitle&&(e.actualFeature||e.helpUrl||e.actualHelpText||e.editUrl)?(Object(E["openBlock"])(),Object(E["createElementBlock"])("h2",Zt,[Object(E["createVNode"])(r,{"feature-name":e.actualFeature,"help-url":e.helpUrl,"edit-url":e.editUrl,"inline-help":e.actualHelpText},{default:Object(E["withCtx"])(()=>[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.decode(e.contentTitle)),1)]),_:1},8,["feature-name","help-url","edit-url","inline-help"])])):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",eo,[Object(E["renderSlot"])(e.$slots,"default")],512)]),e.imageUrl?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",to,[Object(E["createElementVNode"])("img",{src:e.imageUrl,alt:e.actualImageAltText},null,8,oo)])):Object(E["createCommentVNode"])("",!0)],2)}let no=null;const{$:ao}=window;var ro=Object(E["defineComponent"])({props:{contentTitle:String,feature:String,helpUrl:String,editUrl:String,helpText:String,anchor:String,imageUrl:String,imageAltText:String},components:{EnrichedHeadline:Kt},data(){return{actualFeature:this.feature,actualHelpText:this.helpText,actualImageAltText:this.imageAltText?this.imageAltText:this.contentTitle}},watch:{feature(e){this.actualFeature=e},helpText(e){this.actualHelpText=e}},mounted(){const e=this.$refs.root,t=this.$refs.content;if(this.anchor&&e&&e.parentElement){const t=document.createElement("a");t.id=this.anchor,ao(e.parentElement).prepend(t)}setTimeout(()=>{const e=t.querySelector(".contentHelp");e&&(this.actualHelpText=e.innerHTML,e.remove())},0),this.actualFeature&&"true"===this.actualFeature&&(this.actualFeature=this.contentTitle),null===no&&(no=document.querySelector("#content.admin"));let o=null;if(no&&(o=no.offsetTop),o||0===o){const t=e.closest(".widgetLoader"),i=t?t.offsetTop:e.offsetTop;i-o<17&&(e.style.marginTop="0")}},methods:{decode(e){return M.helper.htmlDecode(e)}}});ro.render=io;var so=ro;const lo={key:0,ref:"root",class:"matomo-comparisons"},co={class:"comparison-type"},uo=["title"],mo=["href"],po=["title"],ho={class:"comparison-period-label"},go=["onClick"],bo=["title"],fo={class:"loadingPiwik",style:{display:"none"}};function vo(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("MatomoLoader"),s=Object(E["resolveDirective"])("tooltips");return e.isComparing?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",lo,[Object(E["createElementVNode"])("h3",null,Object(E["toDisplayString"])(e.translate("General_Comparisons")),1),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.segmentComparisons,(t,o)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:"comparison card",key:t.index},[Object(E["createElementVNode"])("div",co,Object(E["toDisplayString"])(e.translate("General_Segment")),1),Object(E["createElementVNode"])("div",{class:"title",title:e.getTitleTooltip(t)},[Object(E["createElementVNode"])("a",{target:"_blank",href:e.getUrlToSegment(t.params.segment)},Object(E["toDisplayString"])(t.title),9,mo)],8,uo),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.periodComparisons,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:"comparison-period",key:o.index,title:e.getComparisonTooltip(t,o)},[Object(E["createElementVNode"])("span",{class:"comparison-dot",style:Object(E["normalizeStyle"])({"background-color":e.getSeriesColor(t,o)})},null,4),Object(E["createElementVNode"])("span",ho,Object(E["toDisplayString"])(o.title)+" ("+Object(E["toDisplayString"])(e.getComparisonPeriodType(o))+") ",1)],8,po))),128)),e.segmentComparisons.length>1?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:0,class:"remove-button",onClick:t=>e.removeSegmentComparison(o)},[Object(E["createElementVNode"])("span",{class:"icon icon-close",title:e.translate("General_ClickToRemoveComp")},null,8,bo)],8,go)):Object(E["createCommentVNode"])("",!0)]))),128)),Object(E["createElementVNode"])("div",fo,[Object(E["createVNode"])(r),Object(E["createTextVNode"])(" "+Object(E["toDisplayString"])(e.translate("General_LoadingData")),1)])])),[[s,{duration:200,delay:200,content:e.transformTooltipContent}]]):Object(E["createCommentVNode"])("",!0)}function Oo(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class jo{get state(){return Object(E["readonly"])(this.segmentState)}constructor(){Oo(this,"segmentState",Object(E["reactive"])({availableSegments:[]})),M.on("piwikSegmentationInited",()=>this.setSegmentState())}setSegmentState(){try{const e=$(".segmentEditorPanel").data("uiControlObject");this.segmentState.availableSegments=e.impl.availableSegments||[]}catch(e){}}}var yo=new jo;function wo(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const So=8,ko=3;function Co(e){return e?Array.isArray(e)?e:[e]:[]}class Eo{constructor(){wo(this,"privateState",Object(E["reactive"])({comparisonsDisabledFor:[]})),wo(this,"state",Object(E["readonly"])(this.privateState)),wo(this,"colors",{}),wo(this,"segmentComparisons",Object(E["computed"])(()=>this.parseSegmentComparisons())),wo(this,"periodComparisons",Object(E["computed"])(()=>this.parsePeriodComparisons())),wo(this,"isEnabled",Object(E["computed"])(()=>this.checkEnabledForCurrentPage())),"complete"===document.readyState||"interactive"===document.readyState?this.loadComparisonsDisabledFor():document.addEventListener("DOMContentLoaded",()=>{this.loadComparisonsDisabledFor()}),$(()=>{this.colors=this.getAllSeriesColors()}),Object(E["watch"])(()=>this.getComparisons(),()=>M.postEvent("piwikComparisonsChanged"),{deep:!0})}getComparisons(){return this.getSegmentComparisons().concat(this.getPeriodComparisons())}isComparing(){return this.isComparisonEnabled()&&(this.segmentComparisons.value.length>1||this.periodComparisons.value.length>1)}isComparingPeriods(){return this.getPeriodComparisons().length>1}getSegmentComparisons(){return this.isComparisonEnabled()?this.segmentComparisons.value:[]}getPeriodComparisons(){return this.isComparisonEnabled()?this.periodComparisons.value:[]}getSeriesColor(e,t,o=0){const i=this.getComparisonSeriesIndex(t.index,e.index)%So;if(0===o)return this.colors["series"+i];const n=o%ko;return this.colors[`series${i}-shade${n}`]}getSeriesColorName(e,t){let o="series"+e%So;return t>0&&(o+="-shade"+t%ko),o}isComparisonEnabled(){return this.isEnabled.value}getIndividualComparisonRowIndices(e){const t=this.getSegmentComparisons().length,o=e%t,i=Math.floor(e/t);return{segmentIndex:o,periodIndex:i}}getComparisonSeriesIndex(e,t){const o=this.getSegmentComparisons().length;return e*o+t}getAllComparisonSeries(){const e=[];let t=0;return this.getPeriodComparisons().forEach(o=>{this.getSegmentComparisons().forEach(i=>{e.push({index:t,params:Object.assign(Object.assign({},i.params),o.params),color:this.colors["series"+t]}),t+=1})}),e}removeSegmentComparison(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");const t=[...this.segmentComparisons.value];t.splice(e,1);const o={};0===e&&(o.segment=t[0].params.segment),this.updateQueryParamsFromComparisons(t,this.periodComparisons.value,o)}removeSegmentComparisonByDefinition(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");let t=null;this.getSegmentComparisons().forEach((o,i)=>{o&&o.params&&o.params.segment===e&&(t=i)}),null!==t&&this.removeSegmentComparison(t)}addSegmentComparison(e){if(!this.isComparisonEnabled())throw new Error("Comparison disabled.");const t=this.segmentComparisons.value.concat([{params:e,index:-1,title:""}]);this.updateQueryParamsFromComparisons(t,this.periodComparisons.value)}updateQueryParamsFromComparisons(e,t,o={}){const i={},n={};let a=!1,r=!1;e.forEach(e=>{a?i[e.params.segment]=!0:a=!0}),t.forEach(e=>{r?n[`${e.params.period}|${e.params.date}`]=!0:r=!0});const s=[],l=[];Object.keys(n).forEach(e=>{const t=e.split("|");s.push(t[0]),l.push(t[1])});const c={compareSegments:Object.keys(i),comparePeriods:s,compareDates:l},d=M.helper.isReportingPage()?H.hashParsed.value:H.urlParsed.value;H.updateLocation(Object.assign(Object.assign(Object.assign({},d),c),o))}getAllSeriesColors(){const{ColorManager:e}=M;if(!e)return[];const t=[];for(let o=0;o{this.privateState.comparisonsDisabledFor=e})}parseSegmentComparisons(){const{availableSegments:e}=yo.state,t=[...Co(H.parsed.value.compareSegments)];t.unshift(H.parsed.value.segment||"");const o=[];return t.forEach((t,i)=>{let n;e.forEach(e=>{e.definition!==t&&e.definition!==decodeURIComponent(t)&&decodeURIComponent(e.definition)!==t||(n=e)});let r=n?n.name:a("General_Unknown");""===t.trim()&&(r=a("SegmentEditor_DefaultAllVisits")),o.push({params:{segment:t},title:M.helper.htmlDecode(r),index:i})}),o}parsePeriodComparisons(){const e=[...Co(H.parsed.value.comparePeriods)],t=[...Co(H.parsed.value.compareDates)];e.unshift(H.parsed.value.period),t.unshift(H.parsed.value.date);const o=[];for(let n=0;nDo.isComparing()&&!window.broadcast.isNoDataPage()),t=Object(E["computed"])(()=>Do.getSegmentComparisons()),o=Object(E["computed"])(()=>Do.getPeriodComparisons()),i=Do.getSeriesColor.bind(Do);function n(){const e=window.$(this).attr("title");return e?window.vueSanitize(e.replace(/\n/g,"
")):e}return{isComparing:e,segmentComparisons:t,periodComparisons:o,getSeriesColor:i,transformTooltipContent:n}},methods:{comparisonHasSegment(e){return"undefined"!==typeof e.params.segment},removeSegmentComparison(e){window.$(this.$refs.root).tooltip("destroy"),Do.removeSegmentComparison(e)},getComparisonPeriodType(e){const{period:t}=e.params;if("range"===t)return a("CoreHome_PeriodRange");const o=a(`Intl_Period${t.substring(0,1).toUpperCase()}${t.substring(1)}`);return o.substring(0,1).toUpperCase()+o.substring(1)},getComparisonTooltip(e,t){if(this.comparisonTooltips&&Object.keys(this.comparisonTooltips).length)return(this.comparisonTooltips[t.index]||{})[e.index]},getTitleTooltip(e){return this.htmlentities(e.title)+"
"+this.htmlentities(decodeURIComponent(e.params.segment))},getUrlToSegment(e){const t=Object.assign({},H.hashParsed.value);return delete t.comparePeriods,delete t.compareDates,delete t.compareSegments,t.segment=e,`${window.location.search}#?${H.stringify(t)}`},onComparisonsChanged(){if(this.comparisonTooltips=null,!Do.isComparing())return;const e=Do.getPeriodComparisons(),t=Do.getSegmentComparisons();K.fetch({method:"API.getProcessedReport",apiModule:"VisitsSummary",apiAction:"get",compare:"1",compareSegments:H.getSearchParam("compareSegments"),comparePeriods:H.getSearchParam("comparePeriods"),compareDates:H.getSearchParam("compareDates"),format_metrics:"1"}).then(o=>{this.comparisonTooltips={},e.forEach(e=>{this.comparisonTooltips[e.index]={},t.forEach(t=>{const i=this.generateComparisonTooltip(o,e,t);this.comparisonTooltips[e.index][t.index]=i})})})},generateComparisonTooltip(e,t,o){if(!e.reportData.comparisons)return"";const i=Do.getComparisonSeriesIndex(t.index,0),n=e.reportData.comparisons[i],r=Do.getComparisonSeriesIndex(t.index,o.index),s=e.reportData.comparisons[r],l=e.reportData.comparisons[o.index];let c='
',d=(s.nb_visits/n.nb_visits*100).toFixed(2);return d+="%",c+=a("General_ComparisonCardTooltip1",[`'${this.htmlentities(s.compareSegmentPretty)}'`,s.comparePeriodPretty,d,s.nb_visits.toString(),n.nb_visits.toString()]),t.index>0&&(c+="

",c+=a("General_ComparisonCardTooltip2",[s.nb_visits_change.toString(),this.htmlentities(l.compareSegmentPretty),l.comparePeriodPretty])),c+="
",c},htmlentities(e){return M.helper.htmlEntities(e)}},mounted(){M.on("piwikComparisonsChanged",()=>{this.onComparisonsChanged()}),this.onComparisonsChanged()}});Po.render=vo;var To=Po;const Vo={ref:"root",class:"menuDropdown"},No=["title"],xo=["innerHTML"],Bo=Object(E["createElementVNode"])("span",{class:"icon-chevron-down reporting-menu-sub-icon"},null,-1),Mo={class:"items"},Io={key:0,class:"search"},Fo=["placeholder"],Lo=["title"],Ao=["title"];function _o(e,t,o,i,n,a){const r=Object(E["resolveDirective"])("focus-if"),s=Object(E["resolveDirective"])("focus-anywhere-but-here");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Vo,[Object(E["createElementVNode"])("span",{class:"title",onClick:t[0]||(t[0]=t=>e.showItems=!e.showItems),title:e.tooltip},[Object(E["createElementVNode"])("span",{class:"title-label",innerHTML:e.$sanitize(this.actualMenuTitle)},null,8,xo),Bo],8,No),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",Mo,[e.showSearch&&e.showItems?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Io,[Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=t=>e.searchTerm=t),onKeydown:t[2]||(t[2]=t=>e.onSearchTermKeydown(t)),placeholder:e.translate("General_Search")},null,40,Fo),[[E["vModelText"],e.searchTerm],[r,{focused:e.showItems}]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",{class:"search_ico icon-search",title:e.translate("General_Search")},null,8,Lo),[[E["vShow"],!e.searchTerm]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",{onClick:t[3]||(t[3]=t=>{e.searchTerm="",e.searchItems("")}),class:"reset icon-close",title:e.translate("General_Clear")},null,8,Ao),[[E["vShow"],e.searchTerm]])])):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",{onClick:t[4]||(t[4]=t=>e.selectItem(t))},[Object(E["renderSlot"])(e.$slots,"default")])],512),[[E["vShow"],e.showItems]])])),[[s,{blur:e.lostFocus}]])}const{$:Ro}=window;var Ho=Object(E["defineComponent"])({props:{menuTitle:String,tooltip:String,showSearch:Boolean,menuTitleChangeOnClick:Boolean},directives:{FocusAnywhereButHere:Je,FocusIf:Qe},emits:["afterSelect"],watch:{menuTitle(){this.actualMenuTitle=this.menuTitle}},data(){return{showItems:!1,searchTerm:"",actualMenuTitle:this.menuTitle}},methods:{lostFocus(){this.showItems=!1},selectItem(e){const t=e.target.classList;!t.contains("item")||t.contains("disabled")||t.contains("separator")||(this.menuTitleChangeOnClick&&(this.actualMenuTitle=(e.target.textContent||"").replace(/[\u0000-\u2666]/g,e=>`&#${e.charCodeAt(0)};`)),this.showItems=!1,Ro(this.$slots.default()[0].el).find(".item").removeClass("active"),t.add("active"),this.$emit("afterSelect",e.target))},onSearchTermKeydown(){setTimeout(()=>{this.searchItems(this.searchTerm)})},searchItems(e){const t=e.toLowerCase();Ro(this.$refs.root).find(".item").each((e,o)=>{const i=Ro(o);-1===i.text().toLowerCase().indexOf(t)?i.hide():i.show()})}}});Ho.render=_o;var $o=Ho;const Uo={ref:"root"};function qo(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Uo,null,512)}const Wo=1,{$:zo}=window;var Go=Object(E["defineComponent"])({props:{selectedDateStart:Date,selectedDateEnd:Date,highlightedDateStart:Date,highlightedDateEnd:Date,viewDate:[String,Date],stepMonths:Number,disableMonthDropdown:Boolean,options:Object},emits:["cellHover","cellHoverLeave","dateSelect"],setup(e,t){const o=Object(E["ref"])(null);function i(t,o){const i=t.children("a");if(e.selectedDateStart&&e.selectedDateEnd&&o>=e.selectedDateStart&&o<=e.selectedDateEnd?t.addClass("ui-datepicker-current-period"):t.removeClass("ui-datepicker-current-period"),e.highlightedDateStart&&e.highlightedDateEnd&&o>=e.highlightedDateStart&&o<=e.highlightedDateEnd){const e=i.length?i:t;e.addClass("ui-state-hover")}else t.removeClass("ui-state-hover"),i.removeClass("ui-state-hover")}function n(e,t,o){if(e.hasClass("ui-datepicker-other-month"))return a(e,t,o);const i=parseInt(e.children("a,span").text(),10);return new Date(o,t,i)}function a(e,t,o){let i;const a=e.parent(),r=a.children("td");if(a.is(":first-child")){const s=a.children("td:not(.ui-datepicker-other-month)").first();return i=n(s,t,o),i.setDate(r.index(e)-r.index(s)+1),i}const s=a.children("td:not(.ui-datepicker-other-month)").last();return i=n(s,t,o),i.setDate(i.getDate()+r.index(e)-r.index(s)),i}function r(){const e=zo(o.value),t=e.find("td[data-month]"),i=parseInt(t.attr("data-month"),10),n=parseInt(t.attr("data-year"),10);return[i,n]}function s(){const e=zo(o.value),t=e.find(".ui-datepicker-calendar"),a=r(),s=t.find("td"),l=s.first(),c=n(l,a[0],a[1]);s.each((function(){i(zo(this),c),c.setDate(c.getDate()+1)}))}function l(){if(!e.viewDate)return!1;let t;if("string"===typeof e.viewDate)try{t=m(e.viewDate)}catch(a){return!1}else t=e.viewDate;const i=zo(o.value),n=r();return(n[0]!==t.getMonth()||n[1]!==t.getFullYear())&&(i.datepicker("setDate",t),!0)}function c(){const e=zo(o.value);e.find("td[data-event]").off("click"),e.find(".ui-state-active").removeClass("ui-state-active"),e.find(".ui-datepicker-current-day").removeClass("ui-datepicker-current-day"),e.find(".ui-datepicker-prev,.ui-datepicker-next").attr("href","")}function d(){const t=zo(o.value),i=e.stepMonths||Wo;if(t.datepicker("option","stepMonths")===i)return!1;const n=zo(".ui-datepicker-month",t).val(),a=zo(".ui-datepicker-year",t).val();return t.datepicker("option","stepMonths",i).datepicker("setDate",new Date(a,n)),c(),!0}function u(){const t=zo(o.value),i=t.find(".ui-datepicker-month")[0];i&&(i.disabled=e.disableMonthDropdown)}function p(){if(!zo(this).hasClass("ui-state-hover"))return;const e=zo(this).parent(),t=e.parent();e.is(":first-child")?t.find("a").first().click():t.find("a").last().click()}function h(){u(),s()}return Object(E["watch"])(()=>Object.assign({},e),(e,t)=>{let o=!1;[e=>e.selectedDateStart,e=>e.selectedDateEnd,e=>e.highlightedDateStart,e=>e.highlightedDateEnd].forEach(i=>{if(o)return;const n=i(e),a=i(t);!n&&a&&(o=!0),n&&!a&&(o=!0),n&&a&&n.getTime()!==a.getTime()&&(o=!0)}),e.viewDate!==t.viewDate&&l()&&(o=!0),e.stepMonths!==t.stepMonths&&d(),e.disableMonthDropdown!==t.disableMonthDropdown&&u(),o&&s()}),Object(E["onMounted"])(()=>{const i=zo(o.value),a=e.options||{},m=Object.assign(Object.assign(Object.assign({},M.getBaseDatePickerOptions()),a),{},{onChangeMonthYear:()=>{setTimeout(()=>{c()})}});i.datepicker(m),i.on("mouseover","tbody td a",e=>{e.originalEvent&&s()}),i.on("mouseenter","tbody td",(function(){const e=r(),o=zo(this),i=n(o,e[0],e[1]);t.emit("cellHover",{date:i,$cell:o})})),i.on("mouseout","tbody td a",()=>{s()}),i.on("mouseleave","table",()=>t.emit("cellHoverLeave")).on("mouseenter","thead",()=>t.emit("cellHoverLeave")),i.on("click","tbody td.ui-datepicker-other-month",p),i.on("click",e=>{e.preventDefault();const t=zo(e.target).closest("a");(t.is(".ui-datepicker-next")||t.is(".ui-datepicker-prev"))&&h()}),i.on("click","td[data-month]",e=>{const o=zo(e.target).closest("td"),i=parseInt(o.attr("data-month"),10),n=parseInt(o.attr("data-year"),10),a=parseInt(o.children("a,span").text(),10);t.emit("dateSelect",{date:new Date(n,i,a)})});const g=d();l(),u(),g||c(),s()}),{root:o}}});Go.render=qo;var Yo=Go;const Jo={class:"dateRangePicker"},Ko={id:"calendarRangeFrom"},Qo={id:"calendarRangeTo"};function Xo(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("DatePicker");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Jo,[Object(E["createElementVNode"])("div",Ko,[Object(E["createElementVNode"])("h6",null,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_DateRangeFrom"))+" ",1),Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"text",id:"inputCalendarFrom",name:"inputCalendarFrom",class:"browser-default","onUpdate:modelValue":t[0]||(t[0]=t=>e.startDateText=t),onKeydown:t[1]||(t[1]=t=>e.onRangeInputChanged("from",t)),onKeyup:t[2]||(t[2]=t=>e.handleEnterPress(t))},null,544),[[E["vModelText"],e.startDateText]])]),Object(E["createVNode"])(r,{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]=t=>e.setStartRangeDate(t.date)),onCellHover:t[4]||(t[4]=t=>e.fromPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)),onCellHoverLeave:t[5]||(t[5]=t=>e.fromPickerHighlightedDates=[null,null])},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])]),Object(E["createElementVNode"])("div",Qo,[Object(E["createElementVNode"])("h6",null,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_DateRangeTo"))+" ",1),Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"text",id:"inputCalendarTo",name:"inputCalendarTo",class:"browser-default","onUpdate:modelValue":t[6]||(t[6]=t=>e.endDateText=t),onKeydown:t[7]||(t[7]=t=>e.onRangeInputChanged("to",t)),onKeyup:t[8]||(t[8]=t=>e.handleEnterPress(t))},null,544),[[E["vModelText"],e.endDateText]])]),Object(E["createVNode"])(r,{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]=t=>e.setEndRangeDate(t.date)),onCellHover:t[10]||(t[10]=t=>e.toPickerHighlightedDates=e.getNewHighlightedDates(t.date,t.$cell)),onCellHoverLeave:t[11]||(t[11]=t=>e.toPickerHighlightedDates=[null,null])},null,8,["view-date","selected-date-start","selected-date-end","highlighted-date-start","highlighted-date-end"])])])}const Zo="YYYY-MM-DD";var ei=Object(E["defineComponent"])({props:{startDate:String,endDate:String},components:{DatePicker:Yo},data(){let e=null;try{this.startDate&&(e=m(this.startDate))}catch(o){}let t=null;try{this.endDate&&(t=m(this.endDate))}catch(o){}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(){this.startDateText=this.startDate,this.setStartRangeDateFromStr(this.startDate)},endDate(){this.endDateText=this.endDate,this.setEndRangeDateFromStr(this.endDate)}},mounted(){this.rangeChanged()},methods:{setStartRangeDate(e){this.fromPickerSelectedDates=[e,e],this.rangeChanged()},setEndRangeDate(e){this.toPickerSelectedDates=[e,e],this.rangeChanged()},onRangeInputChanged(e,t){setTimeout(()=>{"from"===e?this.setStartRangeDateFromStr(t.target.value):this.setEndRangeDateFromStr(t.target.value)})},getNewHighlightedDates(e,t){return t.hasClass("ui-datepicker-unselectable")?null:[e,e]},handleEnterPress(e){13===e.keyCode&&this.$emit("submit",{start:this.startDate,end:this.endDate})},setStartRangeDateFromStr(e){this.startDateInvalid=!0;let t=null;try{e&&e.length===Zo.length&&(t=m(e))}catch(o){}t&&(this.fromPickerSelectedDates=[t,t],this.startDateInvalid=!1,this.rangeChanged())},setEndRangeDateFromStr(e){this.endDateInvalid=!0;let t=null;try{e&&e.length===Zo.length&&(t=m(e))}catch(o){}t&&(this.toPickerSelectedDates=[t,t],this.endDateInvalid=!1,this.rangeChanged())},rangeChanged(){this.$emit("rangeChange",{start:this.fromPickerSelectedDates[0]?d(this.fromPickerSelectedDates[0]):null,end:this.toPickerSelectedDates[0]?d(this.toPickerSelectedDates[0]):null})}}});ei.render=Xo;var ti=ei;function oi(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("DatePicker");return Object(E["openBlock"])(),Object(E["createBlock"])(r,{"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]=t=>e.onHoverNormalCell(t.date,t.$cell)),onCellHoverLeave:t[1]||(t[1]=t=>e.onHoverLeaveNormalCells()),onDateSelect:t[2]||(t[2]=t=>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"])}const ii=new Date(M.minDateYear,M.minDateMonth-1,M.minDateDay),ni=new Date(M.maxDateYear,M.maxDateMonth-1,M.maxDateDay);var ai=Object(E["defineComponent"])({props:{period:{type:String,required:!0},date:[String,Date]},components:{DatePicker:Yo},emits:["select"],setup(e,t){const o=Object(E["ref"])(e.date),i=Object(E["ref"])([null,null]),n=Object(E["ref"])([null,null]);function a(t){const o=c.get(e.period).parse(t).getDateRange();return o[0]=iio[1]?o[1]:ni,o}function r(t,o){const i=tni,r=o.hasClass("ui-datepicker-other-month")&&("month"===e.period||"day"===e.period);n.value=i||r?[null,null]:a(t)}function s(){n.value=[null,null]}function l(e){t.emit("select",{date:e})}function d(){if(!e.period||!e.date)return i.value=[null,null],void(o.value=null);i.value=a(e.date),o.value=m(e.date)}return Object(E["watch"])(e,d),d(),{selectedDates:i,highlightedDates:n,viewDate:o,onHoverNormalCell:r,onHoverLeaveNormalCells:s,onDateSelected:l}}});ai.render=oi;var ri=ai;const si={key:0},li=["data-notification-instance-id"],ci={key:1},di={class:"notification-body"},ui=["innerHTML"],mi={key:1};function pi(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createBlock"])(E["Transition"],{name:"toast"===e.type?"slow-fade-out":void 0,onAfterLeave:t[1]||(t[1]=t=>e.toastClosed())},{default:Object(E["withCtx"])(()=>[e.deleted?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",si,[Object(E["createVNode"])(E["Transition"],{name:"toast"===e.type?"toast-slide-up":void 0,appear:""},{default:Object(E["withCtx"])(()=>[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(E["Transition"],{name:e.animate?"fade-in":void 0,appear:""},{default:Object(E["withCtx"])(()=>[Object(E["createElementVNode"])("div",{class:Object(E["normalizeClass"])(["notification system",e.cssClasses]),style:Object(E["normalizeStyle"])(e.style),ref:"root","data-notification-instance-id":e.notificationInstanceId},[e.canClose?(Object(E["openBlock"])(),Object(E["createElementBlock"])("button",{key:0,type:"button",class:"close","data-dismiss":"alert",onClick:t[0]||(t[0]=t=>e.closeNotification(t))}," × ")):Object(E["createCommentVNode"])("",!0),e.title?(Object(E["openBlock"])(),Object(E["createElementBlock"])("strong",ci,Object(E["toDisplayString"])(e.title),1)):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",di,[e.message?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,innerHTML:e.$sanitize(e.message)},null,8,ui)):Object(E["createCommentVNode"])("",!0),e.message?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",mi,[Object(E["renderSlot"])(e.$slots,"default")]))])],14,li)]),_:3},8,["name"])])]),_:3},8,["name"])]))]),_:3},8,["name"])}const{$:hi}=window;var gi=Object(E["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(){const e={};return this.context&&(e["notification-"+this.context]=!0),this.cssClass&&(e[this.cssClass]=!0),e},canClose(){return"persistent"===this.type||!this.noclear}},emits:["closed"],data(){return{deleted:!1}},mounted(){const e=()=>{setTimeout(()=>{this.deleted=!0},this.toastLength)};"toast"===this.type&&e(),this.style&&hi(this.$refs.root).css(this.style)},methods:{toastClosed(){Object(E["nextTick"])(()=>{this.$emit("closed")})},closeNotification(e){this.canClose&&e&&e.target&&(this.deleted=!0,Object(E["nextTick"])(()=>{this.$emit("closed")})),this.markNotificationAsRead()},markNotificationAsRead(){this.notificationId&&K.post({module:"CoreHome",action:"markNotificationAsRead"},{notificationId:this.notificationId},{withTokenInUrl:!0})}}});gi.render=pi;var bi=gi;const fi={class:"notification-group"},vi=["innerHTML"];function Oi(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Notification");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",fi,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.notifications,(t,o)=>(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:t.id||"no-id-"+o,"notification-id":t.id,title:t.title,context:t.context,type:t.type,noclear:t.noclear,"toast-length":t.toastLength,style:Object(E["normalizeStyle"])(t.style),animate:t.animate,message:t.message,"notification-instance-id":t.notificationInstanceId,"css-class":t.class,onClosed:o=>e.removeNotification(t.id)},{default:Object(E["withCtx"])(()=>[Object(E["createElementVNode"])("div",{innerHTML:e.$sanitize(t.message)},null,8,vi)]),_:2},1032,["notification-id","title","context","type","noclear","toast-length","style","animate","message","notification-instance-id","css-class","onClosed"]))),128))])}function ji(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{$:yi}=window;class wi{constructor(){ji(this,"privateState",Object(E["reactive"])({notifications:[]})),ji(this,"nextNotificationId",0)}get state(){return Object(E["readonly"])(this.privateState)}appendNotification(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.push(e)}prependNotification(e){this.checkMessage(e.message),e.id&&this.remove(e.id),this.privateState.notifications.unshift(e)}remove(e){this.privateState.notifications=this.privateState.notifications.filter(t=>t.id!==e)}parseNotificationDivs(){const e=yi('[data-role="notification"]'),t=[];e.each((o,i)=>{const n=yi(i),a=n.data(),r=n.html();r&&t.push(Object.assign(Object.assign({},a),{},{message:r,animate:!1})),e.remove()}),t.forEach(e=>this.show(e))}clearTransientNotifications(){this.privateState.notifications=this.privateState.notifications.filter(e=>"transient"!==e.type)}show(e){this.checkMessage(e.message);let t=e.prepend?this.prependNotification:this.appendNotification,o="#notificationContainer";if(e.placeat)o=e.placeat;else{const e=".modal.open .modal-content",i=document.querySelector(e);i&&(i.querySelector("#modalNotificationContainer")||yi(i).prepend('
'),o=e+" #modalNotificationContainer",t=this.prependNotification)}const i=e.group||(o?o.toString():"");this.initializeNotificationContainer(o,i);const n=(this.nextNotificationId+=1).toString();return t.call(this,Object.assign(Object.assign({},e),{},{noclear:!!e.noclear,group:i,notificationId:e.id,notificationInstanceId:n,type:e.type||"transient"})),n}scrollToNotification(e){setTimeout(()=>{const t=document.querySelector(`[data-notification-instance-id='${e}']`);t&&M.helper.lazyScrollTo(t,250)})}toast(e){this.checkMessage(e.message);const t=e.placeat?yi(e.placeat):void 0;if(!t||!t.length)throw new Error("A valid selector is required for the placeat option when using Notification.toast().");const o=document.createElement("div");o.style.position="absolute",o.style.top=t.offset().top+"px",o.style.left=t.offset().left+"px",o.style.zIndex="1000",document.body.appendChild(o);const i=me({render:()=>Object(E["createVNode"])(bi,Object.assign(Object.assign({},e),{},{notificationId:e.id,type:"toast",onClosed:()=>{i.unmount()}}))});i.mount(o)}initializeNotificationContainer(e,t){if(!e)return;const o=yi(e);if(o.children(".notification-group").length)return;const i=window.CoreHome.NotificationGroup,n=me({template:'',data:()=>({group:t})});n.component("NotificationGroup",i),n.mount(o[0])}checkMessage(e){if(!e)throw new Error("No message given, cannot display notification")}}const Si=new wi;var ki=Si;yi(()=>Si.parseNotificationDivs());var Ci=Object(E["defineComponent"])({props:{group:String},components:{Notification:bi},computed:{notifications(){return ki.state.notifications.filter(e=>this.group?this.group===e.group:!e.group)}},methods:{removeNotification(e){ki.remove(e)}}});Ci.render=Oi;var Ei=Ci; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const Di=Object(E["createElementVNode"])("span",{class:"icon-help"},null,-1),Pi=[Di];function Ti(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{class:"item-help-icon",tabindex:"5",href:"javascript:",onClick:t[0]||(t[0]=(...t)=>e.showHelp&&e.showHelp(...t))},Pi)}const Vi="reportingMenu-help";var Ni=Object(E["defineComponent"])({props:{message:{type:String,required:!0},name:{type:String,required:!0}},data(){return{currentName:""}},methods:{showHelp(){if(""!==this.currentName)return ki.remove(Vi),void(this.currentName="");ki.show({context:"info",id:Vi,type:"help",noclear:!0,class:"help-notification",message:this.message,placeat:"#notificationContainer",prepend:!0}),""!==this.name&&(this.currentName=this.name)}}});Ni.render=Ti;var xi=Ni;function Bi(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class Mi{constructor(){Bi(this,"state",Object(E["reactive"])({initialSites:[],isInitialized:!1})),Bi(this,"stateFiltered",Object(E["reactive"])({initialSites:[],isInitialized:!1,excludedSites:[],onlySitesWithAdminAccess:!1,onlySitesWithAtLeastWriteAccess:!1,siteTypesToExclude:[]})),Bi(this,"currentRequestAbort",null),Bi(this,"limitRequest",void 0),Bi(this,"initialSites",Object(E["computed"])(()=>Object(E["readonly"])(this.state.initialSites))),Bi(this,"initialSitesFiltered",Object(E["computed"])(()=>Object(E["readonly"])(this.stateFiltered.initialSites)))}isFiltered(e=!1,t=[],o=!1,i=[]){return t.length>0||e||o||i.length>0}matchesCurrentFilteredState(e=!1,t=[],o=!1,i=[]){return!this.stateFiltered.isInitialized&&!this.isFiltered(e,t,o,i)||this.stateFiltered.isInitialized&&t.length===this.stateFiltered.excludedSites.length&&t.every((e,t)=>e===this.stateFiltered.excludedSites[t])&&e===this.stateFiltered.onlySitesWithAdminAccess&&o===this.stateFiltered.onlySitesWithAtLeastWriteAccess&&i.length===this.stateFiltered.siteTypesToExclude.length&&i.every((e,t)=>e===this.stateFiltered.siteTypesToExclude[t])}loadInitialSites(e=!1,t=[],o=!1,i=[]){return this.state.isInitialized&&!this.isFiltered(e,t,o,i)?Promise.resolve(Object(E["readonly"])(this.state.initialSites)):this.stateFiltered.isInitialized&&this.matchesCurrentFilteredState(e,t,o,i)?Promise.resolve(Object(E["readonly"])(this.stateFiltered.initialSites)):this.isFiltered(e,t,o,i)?this.searchSite("%",e,t,o,i).then(n=>(this.stateFiltered.isInitialized=!0,this.stateFiltered.excludedSites=t,this.stateFiltered.onlySitesWithAdminAccess=e,this.stateFiltered.onlySitesWithAtLeastWriteAccess=o,this.stateFiltered.siteTypesToExclude=i,null!==n&&(this.stateFiltered.initialSites=n),n)):this.state.isInitialized?Promise.resolve(Object(E["readonly"])(this.state.initialSites)):this.searchSite("%",e,t,o,i).then(e=>(this.state.isInitialized=!0,null!==e&&(this.state.initialSites=e),e))}loadSite(e){"all"===e?H.updateUrl(Object.assign(Object.assign({},H.urlParsed.value),{},{module:"MultiSites",action:"index",date:H.parsed.value.date,period:H.parsed.value.period})):H.updateUrl(Object.assign(Object.assign({},H.urlParsed.value),{},{segment:"",idSite:e}),Object.assign(Object.assign({},H.hashParsed.value),{},{segment:"",idSite:e}))}searchSite(e,t=!1,o=[],i=!1,n=[]){return e?(this.currentRequestAbort&&this.currentRequestAbort.abort(),this.limitRequest||(this.limitRequest=K.fetch({method:"SitesManager.getNumWebsitesToDisplayPerPage"})),this.limitRequest.then(a=>{const r=a.value;let s="view";return t?s="admin":i&&(s="write"),this.currentRequestAbort=new AbortController,K.fetch({method:"SitesManager.getSitesWithMinimumAccess",permission:s,limit:r,pattern:e,sitesToExclude:o,siteTypesToExclude:n},{abortController:this.currentRequestAbort,abortable:!1})}).then(e=>e?this.processWebsitesList(e):null).finally(()=>{this.currentRequestAbort=null})):this.loadInitialSites(t,o,i,n)}processWebsitesList(e){let t=e;return t&&t.length?(t=t.map(e=>Object.assign(Object.assign({},e),{},{name:e.group?`[${e.group}] ${e.name}`:e.name})),t.sort((e,t)=>e.name.toLowerCase()t.name.toLowerCase()?1:0),t):[]}}var Ii=new Mi;const Fi=["value","name"],Li=["title"],Ai=["textContent"],_i={key:1,class:"placeholder"},Ri={class:"dropdown"},Hi={class:"custom_select_search"},$i=["placeholder"],Ui={key:0},qi={class:"custom_select_container"},Wi=["onClick"],zi=["innerHTML","href","title"],Gi={class:"custom_select_ul_list"},Yi={class:"noresult"},Ji={key:1};function Ki(e,t,o,i,n,a){var r,s,l,c;const d=Object(E["resolveComponent"])("AllSitesLink"),u=Object(E["resolveDirective"])("tooltips"),m=Object(E["resolveDirective"])("focus-if"),p=Object(E["resolveDirective"])("focus-anywhere-but-here");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])(["siteSelector piwikSelector borderedControl",{expanded:e.showSitesList,disabled:!e.hasMultipleSites}])},[e.name?(Object(E["openBlock"])(),Object(E["createElementBlock"])("input",{key:0,type:"hidden",value:null===(r=e.displayedModelValue)||void 0===r?void 0:r.id,name:e.name},null,8,Fi)):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{ref:"selectorLink",onClick:t[0]||(t[0]=(...t)=>e.onClickSelector&&e.onClickSelector(...t)),onKeydown:t[1]||(t[1]=t=>e.onPressEnter(t)),href:"javascript:void(0)",class:Object(E["normalizeClass"])([{loading:e.isLoading},"title"]),tabindex:"4",title:e.selectorLinkTitle},[Object(E["createElementVNode"])("span",{class:Object(E["normalizeClass"])(["icon icon-chevron-down",{iconHidden:e.isLoading,collapsed:!e.showSitesList}])},null,2),Object(E["createElementVNode"])("span",null,[null!==(s=e.displayedModelValue)&&void 0!==s&&s.name||!e.placeholder?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,textContent:Object(E["toDisplayString"])((null===(l=e.displayedModelValue)||void 0===l?void 0:l.name)||e.firstSiteName)},null,8,Ai)):Object(E["createCommentVNode"])("",!0),null!==(c=e.displayedModelValue)&&void 0!==c&&c.name||!e.placeholder?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",_i,Object(E["toDisplayString"])(e.placeholder),1))])],42,Li)),[[u]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",Ri,[Object(E["withDirectives"])(Object(E["createElementVNode"])("div",Hi,[Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"text",onClick:t[2]||(t[2]=t=>{e.searchTerm="",e.loadInitialSites()}),"onUpdate:modelValue":t[3]||(t[3]=t=>e.searchTerm=t),tabindex:"4",class:"websiteSearch inp browser-default",placeholder:e.translate("General_Search")},null,8,$i),[[E["vModelText"],e.searchTerm],[m,{focused:e.shouldFocusOnSearch}]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("img",{title:"Clear",onClick:t[4]||(t[4]=t=>{e.searchTerm="",e.loadInitialSites()}),class:"reset",src:"plugins/CoreHome/images/reset_search.png"},null,512),[[E["vShow"],e.searchTerm]])],512),[[E["vShow"],e.autocompleteMinSites<=e.sites.length||e.searchTerm]]),"top"===e.allSitesLocation&&e.showAllSitesItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ui,[Object(E["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[5]||(t[5]=t=>e.onAllSitesClick(t))},null,8,["href","all-sites-text"])])):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",qi,[Object(E["createElementVNode"])("ul",{class:"custom_select_ul_list",onClick:t[7]||(t[7]=t=>e.showSitesList=!1)},[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.sites,(o,i)=>Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{onClick:t=>e.switchSite(Object.assign(Object.assign({},o),{},{id:o.idsite}),t),key:i},[Object(E["createElementVNode"])("a",{onClick:t[6]||(t[6]=e=>e.preventDefault()),innerHTML:e.$sanitize(e.getMatchedSiteName(o.name)),tabindex:"4",href:e.getUrlForSiteId(o.idsite),title:o.name},null,8,zi)],8,Wi)),[[E["vShow"],!(!e.showSelectedSite&&""+e.activeSiteId===""+o.idsite)]])),128))]),Object(E["withDirectives"])(Object(E["createElementVNode"])("ul",Gi,[Object(E["createElementVNode"])("li",null,[Object(E["createElementVNode"])("div",Yi,Object(E["toDisplayString"])(e.translate("SitesManager_NotFound")+" "+e.searchTerm),1)])],512),[[E["vShow"],!e.sites.length&&e.searchTerm]])])),[[u,{content:e.tooltipContent}]]),"bottom"===e.allSitesLocation&&e.showAllSitesItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ji,[Object(E["createVNode"])(d,{href:e.urlAllSites,"all-sites-text":e.allSitesText,onClick:t[8]||(t[8]=t=>e.onAllSitesClick(t))},null,8,["href","all-sites-text"])])):Object(E["createCommentVNode"])("",!0)],512),[[E["vShow"],e.showSitesList]])],2)),[[p,{blur:e.onBlur}]])}const Qi=["innerHTML","href"];function Xi(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{onClick:t[1]||(t[1]=e=>this.onClick(e)),class:"custom_select_all"},[Object(E["createElementVNode"])("a",{onClick:t[0]||(t[0]=e=>e.preventDefault()),innerHTML:e.$sanitize(e.allSitesText),tabindex:"4",href:e.href},null,8,Qi)])}var Zi=Object(E["defineComponent"])({props:{href:String,allSitesText:String},emits:["click"],methods:{onClick(e){this.$emit("click",e)}}});Zi.render=Xi;var en=Zi,tn=Object(E["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:()=>[]},onlySitesWithAtLeastWriteAccess:{type:Boolean,default:!1},siteTypesToExclude:{type:Array,default:()=>[]}},emits:["update:modelValue","blur"],components:{AllSitesLink:en},directives:{FocusAnywhereButHere:Je,FocusIf:Qe,Tooltips:tt},watch:{searchTerm(){this.onSearchTermChanged()}},data(){return{searchTerm:"",activeSiteId:""+M.idSite,showSitesList:!1,isLoading:!1,sites:[],autocompleteMinSites:parseInt(M.config.autocomplete_min_sites,10)}},created(){this.searchSite=we(this.searchSite),!this.modelValue&&M.idSite&&this.$emit("update:modelValue",{id:M.idSite,name:M.helper.htmlDecode(M.siteName)})},mounted(){window.initTopControls(),this.loadInitialSites().then(()=>{this.shouldDefaultToFirstSite&&this.$emit("update:modelValue",{id:this.sites[0].idsite,name:this.sites[0].name})});const e=a("CoreHome_ShortcutWebsiteSelector");M.helper.registerShortcut("w",e,e=>{if(e.altKey)return;e.preventDefault?e.preventDefault():e.returnValue=!1;const t=this.$refs.selectorLink;t&&(t.click(),t.focus())})},computed:{shouldFocusOnSearch(){return this.showSitesList&&this.autocompleteMinSites<=this.sites.length||this.searchTerm},selectorLinkTitle(){return this.hasMultipleSites&&this.displayedModelValue?a("CoreHome_ChangeCurrentWebsite",this.htmlEntities(this.displayedModelValue.name)):""},hasMultipleSites(){const e=Ii.matchesCurrentFilteredState(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[],this.onlySitesWithAtLeastWriteAccess,this.siteTypesToExclude?this.siteTypesToExclude:[])&&Ii.initialSitesFiltered.value&&Ii.initialSitesFiltered.value.length?Ii.initialSitesFiltered.value:Ii.initialSites.value;return e&&e.length>1},firstSiteName(){const e=Ii.initialSitesFiltered.value&&Ii.initialSitesFiltered.value.length?Ii.initialSitesFiltered.value:Ii.initialSites.value;return e&&e.length>0?e[0].name:""},urlAllSites(){const e=H.stringify(Object.assign(Object.assign({},H.urlParsed.value),{},{module:"MultiSites",action:"index",date:H.parsed.value.date,period:H.parsed.value.period}));return"?"+e},shouldDefaultToFirstSite(){var e;return!(null!==(e=this.modelValue)&&void 0!==e&&e.id)&&(!this.hasMultipleSites||this.defaultToFirstSite)&&this.sites[0]},displayedModelValue(){return this.modelValue?this.modelValue:M.idSite?{id:M.idSite,name:M.helper.htmlDecode(M.siteName)}:this.shouldDefaultToFirstSite?{id:this.sites[0].idsite,name:this.sites[0].name}:null},tooltipContent(){return function(){const e=$(this).attr("title")||"";return M.helper.htmlEntities(e)}}},methods:{onSearchTermChanged(){this.searchTerm?(this.isLoading=!0,this.searchSite(this.searchTerm)):(this.isLoading=!1,this.loadInitialSites())},onAllSitesClick(e){this.switchSite({id:"all",name:this.$props.allSitesText},e),this.showSitesList=!1},switchSite(e,t){const o=-1!==navigator.userAgent.indexOf("Mac OS X")?t.metaKey:t.ctrlKey;t&&o&&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&&Ii.loadSite(e.id))},onBlur(){this.showSitesList=!1,this.$emit("blur")},onClickSelector(){this.hasMultipleSites&&(this.showSitesList=!this.showSitesList,this.isLoading||this.searchTerm||this.loadInitialSites())},onPressEnter(e){"Enter"===e.key&&(e.preventDefault(),this.showSitesList=!this.showSitesList,this.showSitesList&&!this.isLoading&&this.loadInitialSites())},getMatchedSiteName(e){const t=e.toUpperCase().indexOf(this.searchTerm.toUpperCase());if(-1===t||this.isLoading)return this.htmlEntities(e);const o=this.htmlEntities(e.substring(0,t)),i=this.htmlEntities(e.substring(t+this.searchTerm.length));return`${o}${this.searchTerm}${i}`},loadInitialSites(){return Ii.loadInitialSites(this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[],this.onlySitesWithAtLeastWriteAccess,this.siteTypesToExclude?this.siteTypesToExclude:[]).then(e=>{this.sites=e||[]})},searchSite(e){this.isLoading=!0,Ii.searchSite(e,this.onlySitesWithAdminAccess,this.sitesToExclude?this.sitesToExclude:[],this.onlySitesWithAtLeastWriteAccess,this.siteTypesToExclude?this.siteTypesToExclude:[]).then(t=>{e===this.searchTerm&&t&&(this.sites=t)}).finally(()=>{this.isLoading=!1})},getUrlForSiteId(e){const t=H.stringify(Object.assign(Object.assign({},H.urlParsed.value),{},{segment:"",idSite:e})),o=H.stringify(Object.assign(Object.assign({},H.hashParsed.value),{},{segment:"",idSite:e}));return`?${t}#?${o}`},htmlEntities(e){return M.helper.htmlEntities(e)}}});tn.render=Ki;var on=tn;const nn={ref:"root",class:"quickAccessInside"},an=["title","placeholder"],rn={class:"dropdown"},sn={class:"no-result"},ln=["onClick"],cn=["onMouseenter","onClick"],dn={class:"quickAccessMatomoSearch"},un=["onMouseenter","onClick"],mn=["textContent"],pn={class:"quick-access-category helpCategory"},hn=["href"];function gn(e,t,o,i,n,a){const r=Object(E["resolveDirective"])("focus-if"),s=Object(E["resolveDirective"])("tooltips"),l=Object(E["resolveDirective"])("focus-anywhere-but-here");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",nn,[Object(E["createElementVNode"])("span",{class:"icon-search",onMouseenter:t[0]||(t[0]=t=>e.searchActive=!0)},null,32),Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{class:"s",onKeydown:t[1]||(t[1]=t=>e.onKeypress(t)),onFocus:t[2]||(t[2]=t=>e.searchActive=!0),"onUpdate:modelValue":t[3]||(t[3]=t=>e.searchTerm=t),type:"text",tabindex:"2",title:e.quickAccessTitle,placeholder:e.translate("General_Search"),ref:"input"},null,40,an),[[E["vModelText"],e.searchTerm],[r,{focused:e.searchActive}],[s]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",rn,[Object(E["withDirectives"])(Object(E["createElementVNode"])("ul",null,[Object(E["createElementVNode"])("li",sn,Object(E["toDisplayString"])(e.translate("General_SearchNoResults")),1)],512),[[E["vShow"],!(e.numMenuItems>0||e.sites.length)]]),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.menuItems,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",{key:t.title},[Object(E["createElementVNode"])("li",{class:"quick-access-category",onClick:o=>{e.searchTerm=t.title,e.searchMenu(e.searchTerm)}},Object(E["toDisplayString"])(t.title),9,ln),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.items,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:Object(E["normalizeClass"])(["result",{selected:t.menuIndex===e.searchIndex}]),onMouseenter:o=>e.searchIndex=t.menuIndex,onClick:o=>e.selectMenuItem(t.index),key:t.index},[Object(E["createElementVNode"])("a",null,Object(E["toDisplayString"])(t.name.trim()),1)],42,cn))),128))]))),128)),Object(E["createElementVNode"])("ul",dn,[Object(E["withDirectives"])(Object(E["createElementVNode"])("li",{class:"quick-access-category websiteCategory"},Object(E["toDisplayString"])(e.translate("SitesManager_Sites")),513),[[E["vShow"],e.hasSitesSelector&&e.sites.length||e.isLoading]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("li",{class:"no-result"},Object(E["toDisplayString"])(e.translate("MultiSites_LoadingWebsites")),513),[[E["vShow"],e.hasSitesSelector&&e.isLoading]]),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.sites,(t,o)=>Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:Object(E["normalizeClass"])(["result",{selected:e.numMenuItems+o===e.searchIndex}]),onMouseenter:t=>e.searchIndex=e.numMenuItems+o,onClick:o=>e.selectSite(t.idsite),key:t.idsite},[Object(E["createElementVNode"])("a",{textContent:Object(E["toDisplayString"])(t.name)},null,8,mn)],42,un)),[[E["vShow"],e.hasSitesSelector&&!e.isLoading]])),128))]),Object(E["createElementVNode"])("ul",null,[Object(E["createElementVNode"])("li",pn,Object(E["toDisplayString"])(e.translate("General_HelpResources")),1),Object(E["createElementVNode"])("li",{class:Object(E["normalizeClass"])([{selected:"help"===e.searchIndex},"quick-access-help"]),onMouseenter:t[4]||(t[4]=t=>e.searchIndex="help")},[Object(E["createElementVNode"])("a",{href:"https://matomo.org?mtm_campaign=App_Help&mtm_source=Matomo_App&mtm_keyword=QuickSearch&s="+encodeURIComponent(e.searchTerm),target:"_blank"},Object(E["toDisplayString"])(e.translate("CoreHome_SearchOnMatomo",e.searchTerm)),9,hn)],34)])],512),[[E["vShow"],e.searchTerm&&e.searchActive]])])),[[l,{blur:e.onBlur}]])}const{ListingFormatter:bn}=window;function fn(e){const t=e.getBoundingClientRect(),o=window.$(window);return t.top>=0&&t.left>=0&&t.bottom<=o.height()&&t.right<=o.width()}function vn(e){e&&e.scrollIntoView&&e.scrollIntoView()}var On=Object(E["defineComponent"])({directives:{FocusAnywhereButHere:Je,FocusIf:Qe,Tooltips:tt},watch:{searchActive(e){const t=this.$refs.root;if(!t||!t.parentElement)return;const o=t.parentElement.classList;o.toggle("active",e),o.toggle("expanded",e)}},mounted(){const e=this.$refs.root;e&&e.parentElement&&e.parentElement.classList.add("quick-access","piwikSelector"),"undefined"!==typeof window.initTopControls&&window.initTopControls&&window.initTopControls(),M.helper.registerShortcut("f",a("CoreHome_ShortcutSearch"),e=>{e.altKey||(e.preventDefault(),vn(this.$refs.root),this.activateSearch())})},data(){const 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(){this.searchMenu=we(this.searchMenu.bind(this))},computed:{hasSitesSelector(){return!!document.querySelector('.top_controls .siteSelector,.top_controls [vue-entry="CoreHome.SiteSelector"]')},quickAccessTitle(){const e=[a("CoreHome_MenuEntries")];return this.hasSegmentSelector&&e.push(a("CoreHome_Segments")),this.hasSitesSelector&&e.push(a("SitesManager_Sites")),a("CoreHome_QuickAccessTitle",bn.formatAnd(e))}},emits:["itemSelected","blur"],methods:{onKeypress(e){const t=this.searchTerm&&this.searchActive,o=9===e.which,i=27===e.which;38===e.which?(this.highlightPreviousItem(),e.preventDefault()):40===e.which?(this.highlightNextItem(),e.preventDefault()):13===e.which?this.clickQuickAccessMenuItem():o&&t||i&&t?this.deactivateSearch():setTimeout(()=>{this.searchActive=!0,this.searchMenu(this.searchTerm)})},highlightPreviousItem(){this.searchIndex-1<0?this.searchIndex=0:this.searchIndex-=1,this.makeSureSelectedItemIsInViewport()},highlightNextItem(){const e=this.$refs.root.querySelectorAll("li.result").length;e<=this.searchIndex+1?this.searchIndex=e-1:this.searchIndex+=1,this.makeSureSelectedItemIsInViewport()},clickQuickAccessMenuItem(){const e=this.getCurrentlySelectedElement();e&&setTimeout(()=>{e.click(),this.$emit("itemSelected",e)},20)},deactivateSearch(){this.searchTerm="",this.searchActive=!1,this.$refs.input&&this.$refs.input.blur()},makeSureSelectedItemIsInViewport(){const e=this.getCurrentlySelectedElement();e&&!fn(e)&&vn(e)},getCurrentlySelectedElement(){const e=this.$refs.root.querySelectorAll("li.result");if(e&&e.length&&e.item(this.searchIndex))return e.item(this.searchIndex)},searchMenu(e){const t=e.toLowerCase();let o=-1;const i={},n=[],a=e=>{const t=Object.assign({},e);o+=1,t.menuIndex=o;const{category:a}=t;a in i||(n.push({title:a,items:[]}),i[a]=n.length-1);const r=i[a];n[r].items.push(t)};this.resetSearchIndex(),this.hasSitesSelector&&(this.isLoading=!0,Ii.searchSite(t).then(e=>{e&&(this.sites=e)}).finally(()=>{this.isLoading=!1}));const r=e=>-1!==e.name.toLowerCase().indexOf(t)||-1!==e.category.toLowerCase().indexOf(t);null===this.topMenuItems&&(this.topMenuItems=this.getTopMenuItems()),null===this.leftMenuItems&&(this.leftMenuItems=this.getLeftMenuItems()),null===this.segmentItems&&(this.segmentItems=this.getSegmentItems());const s=this.topMenuItems.filter(r),l=this.leftMenuItems.filter(r),c=this.segmentItems.filter(r);s.forEach(a),l.forEach(a),c.forEach(a),this.numMenuItems=s.length+l.length+c.length,this.menuItems=n},resetSearchIndex(){this.searchIndex=0,this.makeSureSelectedItemIsInViewport()},selectSite(e){Ii.loadSite(e)},selectMenuItem(e){const t=document.querySelector(`[quick_access='${e}']`);if(t){this.deactivateSearch();const e=t.getAttribute("href");if(e&&e.length>10&&t&&t.click)try{t.click()}catch(o){window.$(t).click()}else window.$(t).click()}},onBlur(){this.searchActive=!1,this.$emit("blur")},activateSearch(){this.searchActive=!0},getTopMenuItems(){const e=a("CoreHome_Menu"),t=[];return document.querySelectorAll("nav .sidenav li > a, nav .sidenav li > div > a").forEach(o=>{var i;let n=null===(i=o.textContent)||void 0===i?void 0:i.trim();var a;(!n||null!=o.parentElement&&null!=o.parentElement.tagName&&"DIV"===o.parentElement.tagName)&&(n=null===(a=o.getAttribute("title"))||void 0===a?void 0:a.trim());n&&(t.push({name:n,index:this.menuIndexCounter+=1,category:e}),o.setAttribute("quick_access",""+this.menuIndexCounter))}),t},getLeftMenuItems(){const e=[];return document.querySelectorAll("#secondNavBar .menuTab").forEach(t=>{var o;const i=window.$(t).find("> .item");let n=(null===(o=i[0])||void 0===o?void 0:o.innerText.trim())||"";n&&-1!==n.lastIndexOf("\n")&&(n=n.slice(0,n.lastIndexOf("\n")).trim()),window.$(t).find("li .item").each((t,o)=>{var i;const a=null===(i=o.textContent)||void 0===i?void 0:i.trim();a&&(e.push({name:a,category:n,index:this.menuIndexCounter+=1}),o.setAttribute("quick_access",""+this.menuIndexCounter))})}),e},getSegmentItems(){if(!this.hasSegmentSelector)return[];const e=a("CoreHome_Segments"),t=[];return document.querySelectorAll(".segmentList [data-idsegment]").forEach(o=>{var i;const n=null===(i=o.querySelector(".segname"))||void 0===i||null===(i=i.textContent)||void 0===i?void 0:i.trim();n&&(t.push({name:n,category:e,index:this.menuIndexCounter+=1}),o.setAttribute("quick_access",""+this.menuIndexCounter))}),t}}});On.render=gn;var jn=On;const yn={class:"fieldArray form-group"},wn={key:0,class:"fieldUiControl"},Sn=["onClick","title"];function kn(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Field");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",yn,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.modelValue,(t,o)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])(["fieldArrayTable multiple valign-wrapper",{["fieldArrayTable"+o]:!0}]),key:o},[e.field.uiControl?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",wn,[Object(E["createVNode"])(r,{"full-width":!0,"model-value":t,options:e.field.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(t,o),"model-modifiers":e.field.modelModifiers,placeholder:" ",uicontrol:e.field.uiControl,title:e.field.title,name:`${e.name}-${o}`,id:`${e.id}-${o}`,"template-file":e.field.templateFile,component:e.field.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","title","name","id","template-file","component"])])):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])(Object(E["createElementVNode"])("span",{onClick:t=>e.removeEntry(o),class:"icon-minus valign",title:e.translate("General_Remove")},null,8,Sn),[[E["vShow"],o+1!==e.modelValue.length]])],2))),128))])}const Cn=ve("CorePluginsAdmin","Field");var En=Object(E["defineComponent"])({props:{modelValue:Array,name:String,id:String,field:Object,rows:String},components:{Field:Cn},emits:["update:modelValue"],watch:{modelValue(e){this.checkEmptyModelValue(e)}},mounted(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue(e){e&&e.length&&""===e.slice(-1)[0]||this.rows&&!((this.modelValue||[]).length-1&&this.modelValue){const t=this.modelValue.filter((t,o)=>o!==e);this.$emit("update:modelValue",t)}}}});En.render=kn;var Dn=En;const Pn={class:"multiPairField form-group"},Tn={key:1,class:"fieldUiControl fieldUiControl2"},Vn={key:2,class:"fieldUiControl fieldUiControl3"},Nn={key:3,class:"fieldUiControl fieldUiControl4"},xn=["onClick","title"];function Bn(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Field");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Pn,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.modelValue,(t,o)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])(["multiPairFieldTable multiple valign-wrapper",{["multiPairFieldTable"+o]:!0,[`has${e.fieldCount}Fields`]:!0}]),key:o},[e.field1?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,class:Object(E["normalizeClass"])(["fieldUiControl fieldUiControl1",{hasMultiFields:e.field1.type&&e.field2.type}])},[Object(E["createVNode"])(r,{"full-width":!0,"model-value":t[e.field1.key],options:e.field1.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(o,e.field1.key,t),"model-modifiers":e.field1.modelModifiers,placeholder:" ",uicontrol:e.field1.uiControl,name:`${e.name}-p1-${o}`,id:`${e.id}-p1-${o}`,title:e.field1.title,"template-file":e.field1.templateFile,component:e.field1.component},null,8,["model-value","options","onUpdate:modelValue","model-modifiers","uicontrol","name","id","title","template-file","component"])],2)):Object(E["createCommentVNode"])("",!0),e.field2?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Tn,[Object(E["createVNode"])(r,{"full-width":!0,options:e.field2.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(o,e.field2.key,t),"model-value":t[e.field2.key],"model-modifiers":e.field2.modelModifiers,placeholder:" ",uicontrol:e.field2.uiControl,name:`${e.name}-p2-${o}`,id:`${e.id}-p2-${o}`,title:e.field2.title,"template-file":e.field2.templateFile,component:e.field2.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","id","title","template-file","component"])])):Object(E["createCommentVNode"])("",!0),e.field3?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Vn,[Object(E["createVNode"])(r,{"full-width":!0,options:e.field3.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(o,e.field3.key,t),"model-value":t[e.field3.key],"model-modifiers":e.field3.modelModifiers,placeholder:" ",uicontrol:e.field3.uiControl,name:`${e.name}-p3-${o}`,id:`${e.id}-p3-${o}`,title:e.field3.title,"template-file":e.field3.templateFile,component:e.field3.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","id","title","template-file","component"])])):Object(E["createCommentVNode"])("",!0),e.field4?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Nn,[Object(E["createVNode"])(r,{"full-width":!0,options:e.field4.availableValues,"onUpdate:modelValue":t=>e.onEntryChange(o,e.field4.key,t),"model-value":t[e.field4.key],"model-modifiers":e.field4.modelModifiers,placeholder:" ",uicontrol:e.field4.uiControl,name:`${e.name}-p4-${o}`,id:`${e.id}-p4-${o}`,title:e.field4.title,"template-file":e.field4.templateFile,component:e.field4.component},null,8,["options","onUpdate:modelValue","model-value","model-modifiers","uicontrol","name","id","title","template-file","component"])])):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])(Object(E["createElementVNode"])("span",{onClick:t=>e.removeEntry(o),class:"icon-minus valign",title:e.translate("General_Remove")},null,8,xn),[[E["vShow"],o+1!==e.modelValue.length]])],2))),128))])}const Mn=ve("CorePluginsAdmin","Field");var In=Object(E["defineComponent"])({props:{modelValue:Array,name:String,id:String,field1:Object,field2:Object,field3:Object,field4:Object,rows:Number},components:{Field:Mn},computed:{fieldCount(){return this.field1&&this.field2&&this.field3&&this.field4?4:this.field1&&this.field2&&this.field3?3:this.field1&&this.field2?2:this.field1?1:0}},emits:["update:modelValue"],watch:{modelValue(e){this.checkEmptyModelValue(e)}},mounted(){this.checkEmptyModelValue(this.modelValue)},methods:{checkEmptyModelValue(e){e&&e.length&&!this.isEmptyValue(e.slice(-1)[0])||this.rows&&!(this.modelValue.length-1&&this.modelValue){const t=this.modelValue.filter((t,o)=>o!==e);this.$emit("update:modelValue",t)}},isEmptyValue(e){const{fieldCount:t}=this;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(){const 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}}});In.render=Bn;var Fn=In;const Ln=["disabled"],An=Object(E["createElementVNode"])("span",{class:"icon-chevron-left"},null,-1),_n=[An],Rn=["title"],Hn=Object(E["createElementVNode"])("span",{class:"icon icon-calendar"},null,-1),$n={id:"periodMore",class:"dropdown"},Un={class:"flex"},qn={key:0,class:"period-date"},Wn={class:"period-type"},zn={id:"otherPeriods"},Gn=["onDblclick","title"],Yn=["id","checked","onChange","onDblclick"],Jn={key:0,class:"compare-checkbox"},Kn={id:"comparePeriodToDropdown"},Qn={key:1,class:"compare-date-range"},Xn={id:"comparePeriodStartDate"},Zn=Object(E["createElementVNode"])("span",{class:"compare-dates-separator"},null,-1),ea={id:"comparePeriodEndDate"},ta={class:"apply-button-container"},oa=["disabled","value"],ia={key:2,id:"ajaxLoadingCalendar"},na={class:"loadingSegment"},aa=["disabled"],ra=Object(E["createElementVNode"])("span",{class:"icon-chevron-right"},null,-1),sa=[ra];function la(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("DateRangePicker"),s=Object(E["resolveComponent"])("PeriodDatePicker"),l=Object(E["resolveComponent"])("Field"),c=Object(E["resolveComponent"])("ActivityIndicator"),d=Object(E["resolveDirective"])("tooltips"),u=Object(E["resolveDirective"])("expand-on-click");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{ref:"root",class:Object(E["normalizeClass"])(["periodSelector piwikSelector",{"periodSelector-withPrevNext":e.canShowMovePeriod}])},[e.canShowMovePeriod?(Object(E["openBlock"])(),Object(E["createElementBlock"])("button",{key:0,class:"move-period move-period-prev",onClick:t[0]||(t[0]=t=>e.movePeriod(-1)),disabled:e.isPeriodMoveDisabled(-1)},_n,8,Ln)):Object(E["createCommentVNode"])("",!0),Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("button",{ref:"title",id:"date",class:"title",tabindex:"4",title:e.translate("General_ChooseDate",e.currentlyViewingText)},[Hn,Object(E["createTextVNode"])(" "+Object(E["toDisplayString"])(e.currentlyViewingText),1)],8,Rn)),[[d]]),Object(E["createElementVNode"])("div",$n,[Object(E["createElementVNode"])("div",Un,[Object(E["createElementVNode"])("div",null,[Object(E["withDirectives"])(Object(E["createVNode"])(r,{class:"period-range","start-date":e.startRangeDate,"end-date":e.endRangeDate,onRangeChange:t[1]||(t[1]=t=>e.onRangeChange(t.start,t.end)),onSubmit:t[2]||(t[2]=t=>e.onApplyClicked())},null,8,["start-date","end-date"]),[[E["vShow"],"range"===e.selectedPeriod]]),"range"!==e.selectedPeriod?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",qn,[Object(E["createVNode"])(s,{id:"datepicker",period:e.selectedPeriod,date:e.periodValue===e.selectedPeriod?e.dateValue:null,onSelect:t[3]||(t[3]=t=>e.setPiwikPeriodAndDate(e.selectedPeriod,t.date))},null,8,["period","date"])])):Object(E["createCommentVNode"])("",!0)]),Object(E["createElementVNode"])("div",Wn,[Object(E["createElementVNode"])("h6",null,Object(E["toDisplayString"])(e.translate("General_Period")),1),Object(E["createElementVNode"])("div",zn,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.periodsFiltered,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("p",{key:o},[Object(E["createElementVNode"])("label",{class:Object(E["normalizeClass"])({"selected-period-label":o===e.selectedPeriod}),onDblclick:t=>e.changeViewedPeriod(o),title:o===e.periodValue?"":e.translate("General_DoubleClickToChangePeriod")},[Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{type:"radio",name:"period",id:"period_id_"+o,"onUpdate:modelValue":t[4]||(t[4]=t=>e.selectedPeriod=t),checked:e.selectedPeriod===o,onChange:t=>e.selectedPeriod=o,onDblclick:t=>e.changeViewedPeriod(o)},null,40,Yn),[[E["vModelRadio"],e.selectedPeriod]]),Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.getPeriodDisplayText(o)),1)],42,Gn)]))),128))])])]),e.isComparisonEnabled?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Jn,[Object(E["createElementVNode"])("label",null,[Object(E["withDirectives"])(Object(E["createElementVNode"])("input",{id:"comparePeriodTo",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=t=>e.isComparing=t)},null,512),[[E["vModelCheckbox"],e.isComparing]]),Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.translate("General_CompareTo")),1)]),Object(E["createElementVNode"])("div",Kn,[Object(E["createVNode"])(l,{modelValue:e.comparePeriodType,"onUpdate:modelValue":t[6]||(t[6]=t=>e.comparePeriodType=t),style:Object(E["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(E["createCommentVNode"])("",!0),e.isComparing&&"custom"===e.comparePeriodType?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Qn,[Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",Xn,[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(l,{modelValue:e.compareStartDate,"onUpdate:modelValue":t[7]||(t[7]=t=>e.compareStartDate=t),name:"comparePeriodStartDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_StartDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])]),Zn,Object(E["createElementVNode"])("div",ea,[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(l,{modelValue:e.compareEndDate,"onUpdate:modelValue":t[8]||(t[8]=t=>e.compareEndDate=t),name:"comparePeriodEndDate",uicontrol:"text","full-width":!0,title:e.translate("CoreHome_EndDate"),placeholder:"YYYY-MM-DD"},null,8,["modelValue","title"])])])])])):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",ta,[Object(E["createElementVNode"])("input",{type:"submit",id:"calendarApply",class:"btn",onClick:t[9]||(t[9]=t=>e.onApplyClicked()),disabled:!e.isApplyEnabled(),value:e.translate("General_Apply")},null,8,oa)]),e.isLoadingNewPage?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ia,[Object(E["createVNode"])(c,{loading:!0}),Object(E["createElementVNode"])("div",na,Object(E["toDisplayString"])(e.translate("SegmentEditor_LoadingSegmentedDataMayTakeSomeTime")),1)])):Object(E["createCommentVNode"])("",!0)]),e.canShowMovePeriod?(Object(E["openBlock"])(),Object(E["createElementBlock"])("button",{key:1,class:"move-period move-period-next",onClick:t[10]||(t[10]=t=>e.movePeriod(1)),disabled:e.isPeriodMoveDisabled(1)},sa,8,aa)):Object(E["createCommentVNode"])("",!0)],2)),[[u,{expander:"title",onExpand:e.onExpand,onClosed:e.onClosed}]])}const ca=ve("CorePluginsAdmin","Field"),da=M.helper.htmlDecode(" "),ua=["custom","previousPeriod","previousYear"],ma=[{key:"custom",value:a("General_Custom")},{key:"previousPeriod",value:a("General_PreviousPeriod").replace(/\s+/,da)},{key:"previousYear",value:a("General_PreviousYear").replace(/\s+/,da)}],pa=new Date(M.minDateYear,M.minDateMonth-1,M.minDateDay),ha=new Date(M.maxDateYear,M.maxDateMonth-1,M.maxDateDay);function ga(e){return"[object Date]"===Object.prototype.toString.call(e)&&!Number.isNaN(e.getTime())}var ba=Object(E["defineComponent"])({props:{periods:Array},components:{DateRangePicker:ti,PeriodDatePicker:ri,Field:ca,ActivityIndicator:_e},directives:{ExpandOnClick:ht,Tooltips:tt},data(){const e=H.parsed.value.period;return{comparePeriodDropdownOptions:ma,periodValue:e,dateValue:null,selectedPeriod:e,startRangeDate:null,endRangeDate:null,isRangeValid:null,isLoadingNewPage:!1,isComparing:null,comparePeriodType:"previousPeriod",compareStartDate:"",compareEndDate:""}},mounted(){M.on("hidePeriodSelector",()=>{window.$(this.$refs.root).parent("#periodString").hide()}),M.on("matomoPageChange",()=>{window.$(this.$refs.root).parent("#periodString").show()}),this.isComparing=Do.isComparingPeriods(),Object(E["watch"])(()=>Do.isComparingPeriods(),e=>{this.isComparing=e}),this.updateSelectedValuesFromHash(),Object(E["watch"])(()=>H.parsed.value,this.updateSelectedValuesFromHash),this.updateComparisonValuesFromStore(),Object(E["watch"])(()=>Do.getPeriodComparisons(),this.updateComparisonValuesFromStore),window.initTopControls(),this.handleZIndexPositionRelativeCompareDropdownIssue()},computed:{currentlyViewingText(){let e;if("range"===this.periodValue){if(!this.startRangeDate||!this.endRangeDate)return a("General_Error");e=`${this.startRangeDate},${this.endRangeDate}`}else{if(!this.dateValue)return a("General_Error");e=d(this.dateValue)}try{return c.parse(this.periodValue,e).getPrettyString()}catch(t){return a("General_Error")}},isComparisonEnabled(){return Do.isComparisonEnabled()},periodsFiltered(){return(this.periods||[]).filter(e=>c.isRecognizedPeriod(e))},selectedComparisonParams(){if(!this.isComparing)return{};if("custom"===this.comparePeriodType)return{comparePeriods:["range"],comparePeriodType:"custom",compareDates:[`${this.compareStartDate},${this.compareEndDate}`]};if("previousPeriod"===this.comparePeriodType)return{comparePeriods:[this.selectedPeriod],comparePeriodType:"previousPeriod",compareDates:[this.previousPeriodDateToSelectedPeriod]};if("previousYear"===this.comparePeriodType){const e="range"===this.selectedPeriod?`${this.startRangeDate},${this.endRangeDate}`:d(this.dateValue),t=c.parse(this.selectedPeriod,e).getDateRange();return t[0].setFullYear(t[0].getFullYear()-1),t[1].setFullYear(t[1].getFullYear()-1),"range"===this.selectedPeriod?{comparePeriods:["range"],comparePeriodType:"previousYear",compareDates:[`${d(t[0])},${d(t[1])}`]}:{comparePeriods:[this.selectedPeriod],comparePeriodType:"previousYear",compareDates:[d(t[0])]}}return console.warn("Unknown compare period type: "+this.comparePeriodType),{}},previousPeriodDateToSelectedPeriod(){if("range"===this.selectedPeriod){const e=m(this.startRangeDate),t=m(this.endRangeDate),o=C.getLastNRange("day",2,e).startDate,i=Math.floor((t.valueOf()-e.valueOf())/864e5),n=C.getLastNRange("day",1+i,o);return`${d(n.startDate)},${d(n.endDate)}`}const e=C.getLastNRange(this.selectedPeriod,2,this.dateValue).startDate;return d(e)},selectedDateString(){if("range"===this.selectedPeriod){const e=this.startRangeDate,t=this.endRangeDate,o=m(e),i=m(t);return!ga(o)||!ga(i)||o>i?(window.$("#alert").find("h2").text(a("General_InvalidDateRange")),M.helper.modalConfirm("#alert",{}),null):`${e},${t}`}return d(this.dateValue)},isErrorDisplayed(){return this.currentlyViewingText===a("General_Error")},isRangeSelection(){return"range"===this.periodValue},canShowMovePeriod(){return!this.isRangeSelection&&!this.isErrorDisplayed}},methods:{onExpand(e){const t=0===e.detail;t&&window.$(this.$refs.root).find(".ui-datepicker-month").focus()},onClosed(e){const t=0===e.detail;t&&window.$(this.$refs.title).focus()},handleZIndexPositionRelativeCompareDropdownIssue(){const e=window.$(this.$refs.root);e.on("focus","#comparePeriodToDropdown .select-dropdown",()=>{e.addClass("compare-dropdown-open")}).on("blur","#comparePeriodToDropdown .select-dropdown",()=>{e.removeClass("compare-dropdown-open")})},changeViewedPeriod(e){e!==this.periodValue&&"range"!==e&&this.setPiwikPeriodAndDate(e,this.dateValue)},setPiwikPeriodAndDate(e,t){this.periodValue=e,this.selectedPeriod=e,this.dateValue=t;const o=d(t);this.setRangeStartEndFromPeriod(e,o),this.propagateNewUrlParams(o,this.selectedPeriod),window.initTopControls()},propagateNewUrlParams(e,t){const o=this.selectedComparisonParams;let i;M.helper.isReportingPage()?(this.closePeriodSelector(),i=H.hashParsed.value):(this.isLoadingNewPage=!0,i=H.parsed.value);const n=Object.assign({},i);delete n.comparePeriods,delete n.comparePeriodType,delete n.compareDates,H.updateLocation(Object.assign(Object.assign({},n),{},{date:e,period:t},o))},onApplyClicked(){if("range"===this.selectedPeriod){const e=this.selectedDateString;if(!e)return;return this.periodValue="range",void this.propagateNewUrlParams(e,"range")}this.setPiwikPeriodAndDate(this.selectedPeriod,this.dateValue)},updateComparisonValuesFromStore(){this.comparePeriodType="previousPeriod",this.compareStartDate="",this.compareEndDate="";const e=Do.getPeriodComparisons();if(e.length<2)return;const t=H.parsed.value.comparePeriodType;if(!ua.includes(t))return;if(this.comparePeriodType=t,"custom"!==this.comparePeriodType||"range"!==e[1].params.period)return;let o;try{o=c.parse(e[1].params.period,e[1].params.date)}catch(a){return}const[i,n]=o.getDateRange();this.compareStartDate=d(i),this.compareEndDate=d(n)},updateSelectedValuesFromHash(){const e=H.parsed.value.date,t=H.parsed.value.period;this.periodValue=t,this.selectedPeriod=t,this.dateValue=null,this.startRangeDate=null,this.endRangeDate=null;try{c.parse(t,e)}catch(o){return}if("range"===t){const o=c.get(t).parse(e),[i,n]=o.getDateRange();this.dateValue=i,this.startRangeDate=d(i),this.endRangeDate=d(n)}else this.dateValue=m(e),this.setRangeStartEndFromPeriod(t,e)},setRangeStartEndFromPeriod(e,t){const o=c.parse(e,t).getDateRange();this.startRangeDate=d(o[0]ha?ha:o[1])},getPeriodDisplayText(e){return c.get(e).getDisplayText()},onRangeChange(e,t){e&&t?(this.isRangeValid=!0,this.startRangeDate=e,this.endRangeDate=t):this.isRangeValid=!1},isApplyEnabled(){return!("range"===this.selectedPeriod&&!this.isRangeValid)&&!(this.isComparing&&"custom"===this.comparePeriodType&&!this.isCompareRangeValid())},closePeriodSelector(){this.$refs.root.classList.remove("expanded")},isCompareRangeValid(){try{m(this.compareStartDate)}catch(e){return!1}try{m(this.compareEndDate)}catch(e){return!1}return!0},movePeriod(e){if(!this.canMovePeriod(e))return;let 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.dateValueha&&(this.dateValue=ha),this.onApplyClicked()},isPeriodMoveDisabled(e){return null===this.dateValue?this.isRangeSelection:this.isRangeSelection||!this.canMovePeriod(e)},canMovePeriod(e){if(null===this.dateValue)return!1;const t=-1===e?pa:ha;return!g(this.dateValue,t,this.periodValue)}}});ba.render=la;var fa=ba;const va={class:"reportingMenu"},Oa=["aria-label"],ja=["data-category-id"],ya=["onClick"],wa={class:"hidden"},Sa={key:2,role:"menu"},ka=["href","onClick","title"],Ca=["href","onClick"],Ea=["onClick"],Da=Object(E["createElementVNode"])("span",{class:"icon-help"},null,-1),Pa=[Da],Ta={id:"mobile-left-menu",class:"sidenav sidenav--reporting-menu-mobile hide-on-large-only"},Va=["data-category-id"],Na={key:1,class:"collapsible collapsible-accordion"},xa={class:"collapsible-header"},Ba={class:"collapsible-body"},Ma=["onClick","href"],Ia=["onClick","href"];function Fa(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("MenuItemsDropdown"),s=Object(E["resolveDirective"])("side-nav");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",va,[Object(E["createElementVNode"])("ul",{class:"navbar hide-on-med-and-down collapsible",role:"menu","aria-label":e.translate("CoreHome_MainNavigation")},[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.menu,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:Object(E["normalizeClass"])(["menuTab",{active:t.id===e.activeCategory}]),role:"menuitem",key:t.id,"data-category-id":t.id},[t.component?(Object(E["openBlock"])(),Object(E["createBlock"])(Object(E["resolveDynamicComponent"])(t.component),{key:0,onAction:o=>e.loadCategory(t)},null,40,["onAction"])):Object(E["createCommentVNode"])("",!0),t.component?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,class:"item",tabindex:"5",href:"",onClick:Object(E["withModifiers"])(o=>e.loadCategory(t),["prevent"])},[Object(E["createElementVNode"])("span",{class:Object(E["normalizeClass"])("menu-icon "+(t.icon?t.icon:t.subcategories&&t.id===e.activeCategory?"icon-chevron-down":"icon-chevron-right"))},null,2),Object(E["createTextVNode"])(Object(E["toDisplayString"])(t.name)+" ",1),Object(E["createElementVNode"])("span",wa,Object(E["toDisplayString"])(e.translate("CoreHome_Menu")),1)],8,ya)),t.component?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",Sa,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.subcategories,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{role:"menuitem",class:Object(E["normalizeClass"])({active:(o.id===e.displayedSubcategory||o.isGroup&&e.activeSubsubcategory===e.displayedSubcategory)&&t.id===e.displayedCategory}),key:o.id},[o.isGroup?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:0,"show-search":!0,"menu-title":e.htmlEntities(o.name)},{default:Object(E["withCtx"])(()=>[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(o.subcategories,i=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{class:Object(E["normalizeClass"])(["item",{active:i.id===e.activeSubsubcategory&&o.id===e.displayedSubcategory&&t.id===e.displayedCategory}]),tabindex:"5",href:"#?"+e.makeUrl(t,i),onClick:o=>e.loadSubcategory(t,i,o),title:i.tooltip,key:i.id},Object(E["toDisplayString"])(i.name),11,ka))),128))]),_:2},1032,["menu-title"])):Object(E["createCommentVNode"])("",!0),o.isGroup?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,href:"#?"+e.makeUrl(t,o),class:"item",onClick:i=>e.loadSubcategory(t,o,i),tabindex:"5"},Object(E["toDisplayString"])(o.name),9,Ca)),o.help?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:2,class:Object(E["normalizeClass"])(["item-help-icon",{active:e.helpShownCategory&&e.helpShownCategory.subcategory===o.id&&e.helpShownCategory.category===t.id&&o.help}]),tabindex:"5",href:"javascript:",onClick:i=>e.showHelp(t,o,i)},Pa,10,Ea)):Object(E["createCommentVNode"])("",!0)],2))),128))]))],10,ja))),128))],8,Oa),Object(E["createElementVNode"])("ul",Ta,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.menu,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:"no-padding",key:t.id,"data-category-id":t.id},[t.component?(Object(E["openBlock"])(),Object(E["createBlock"])(Object(E["resolveDynamicComponent"])(t.component),{key:0,onAction:o=>e.loadCategory(t)},null,40,["onAction"])):Object(E["createCommentVNode"])("",!0),t.component?Object(E["createCommentVNode"])("",!0):Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",Na,[Object(E["createElementVNode"])("li",null,[Object(E["createElementVNode"])("a",xa,[Object(E["createElementVNode"])("i",{class:Object(E["normalizeClass"])(t.icon?t.icon:"icon-chevron-down")},null,2),Object(E["createTextVNode"])(Object(E["toDisplayString"])(t.name),1)]),Object(E["createElementVNode"])("div",Ba,[Object(E["createElementVNode"])("ul",null,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.subcategories,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:o.id},[o.isGroup?(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],{key:0},Object(E["renderList"])(o.subcategories,o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{onClick:i=>e.loadSubcategory(t,o),href:"#?"+e.makeUrl(t,o),key:o.id},Object(E["toDisplayString"])(o.name),9,Ma))),128)):Object(E["createCommentVNode"])("",!0),o.isGroup?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,onClick:i=>e.loadSubcategory(t,o),href:"#?"+e.makeUrl(t,o)},Object(E["toDisplayString"])(o.name),9,Ia))]))),128))])])])])),[[s,{activator:e.sideNavActivator}]])],8,Va))),128))])])}function La(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class Aa{constructor(){La(this,"privateState",Object(E["reactive"])({pages:[]})),La(this,"state",Object(E["computed"])(()=>Object(E["readonly"])(this.privateState))),La(this,"fetchAllPagesPromise",void 0),La(this,"pages",Object(E["computed"])(()=>this.state.value.pages))}findPageInCategory(e){return this.pages.value.find(t=>t&&t.category&&t.category.id===e&&t.subcategory&&t.subcategory.id)}findPage(e,t){return this.pages.value.find(o=>o&&o.category&&o.subcategory&&o.category.id===e&&""+o.subcategory.id===t)}reloadAllPages(){return delete this.fetchAllPagesPromise,this.getAllPages()}getAllPages(){return this.fetchAllPagesPromise||(this.fetchAllPagesPromise=K.fetch({method:"API.getReportPagesMetadata",filter_limit:"-1"}).then(e=>(this.privateState.pages=e,this.pages.value))),this.fetchAllPagesPromise.then(()=>this.pages.value)}}var _a=new Aa; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function Ra(e){const t=[...e||[]];return t.sort((e,t)=>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 Ha(e){const 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 $a(e){const t=e;return t.subcategories?t.subcategories:[]}function Ua(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function qa(e){const t=parseFloat(e);return!Number.isNaN(t)&&Number.isFinite(t)}class Wa{constructor(){Ua(this,"privateState",Object(E["reactive"])({activeSubcategoryId:null,activeSubsubcategoryId:null})),Ua(this,"state",Object(E["computed"])(()=>Object(E["readonly"])(this.privateState))),Ua(this,"activeCategory",Object(E["computed"])(()=>"undefined"!==typeof this.state.value.activeCategoryId?this.state.value.activeCategoryId:H.parsed.value.category)),Ua(this,"activeSubcategory",Object(E["computed"])(()=>this.state.value.activeSubcategoryId||H.parsed.value.subcategory)),Ua(this,"activeSubsubcategory",Object(E["computed"])(()=>{const e=this.state.value.activeSubsubcategoryId;if(e)return e;const t=this.findSubcategory(this.activeCategory.value,this.activeSubcategory.value);return t.subsubcategory&&t.subsubcategory.id===this.activeSubcategory.value?t.subsubcategory.id:null})),Ua(this,"menu",Object(E["computed"])(()=>this.buildMenuFromPages()))}fetchMenuItems(){return _a.getAllPages().then(()=>this.menu.value)}reloadMenuItems(){return _a.reloadAllPages().then(()=>this.menu.value)}findSubcategory(e,t){let o=void 0,i=void 0,n=void 0;return this.menu.value.forEach(a=>{a.id===e&&(Ha(a)||[]).forEach(e=>{e.id===t&&(o=a,i=e),e.isGroup&&($a(e)||[]).forEach(r=>{r.id===t&&(o=a,i=e,n=r)})})}),{category:o,subcategory:i,subsubcategory:n}}buildMenuFromPages(){const e=[],t=H.parsed.value.category,o=H.parsed.value.subcategory,i=_a.pages.value,n={};return i.forEach(r=>{const s=Object.assign({},r.category),l=s.id,c=l===t;if(n[l])return;n[l]=!0,s.subcategories=[];let d=null;const u=i.filter(e=>e.category.id===l);u.forEach(e=>{const t=Object.assign({},e.subcategory),i=t.id===o&&c;if(e.widgets&&e.widgets[0]&&qa(e.subcategory.id)){d||(d=Object.assign({},t),d.name=a("CoreHome_ChooseX",[s.name]),d.isGroup=!0,d.subcategories=[],d.order=10),i&&(d.name=t.name);const e=t.id;return t.tooltip=`${t.name} (id = ${e})`,void d.subcategories.push(t)}s.subcategories.push(t)}),d&&d.subcategories&&d.subcategories.length<=5?d.subcategories.forEach(e=>s.subcategories.push(e)):d&&s.subcategories.push(d),s.subcategories=Ra(Ha(s)),e.push(s)}),Ra(e)}toggleCategory(e){return this.privateState.activeSubcategoryId=null,this.privateState.activeSubsubcategoryId=null,this.activeCategory.value===e.id?(this.privateState.activeCategoryId=null,!1):(this.privateState.activeCategoryId=e.id,!0)}enterSubcategory(e,t,o){e&&t&&(this.privateState.activeCategoryId=e.id,this.privateState.activeSubcategoryId=t.id,o&&(this.privateState.activeSubsubcategoryId=o.id))}}var za=new Wa;function Ga(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function Ya(e){const t=e;return t.widgets?t.widgets:[]}class Ja{constructor(){Ga(this,"privateState",Object(E["reactive"])({isFetchedFirstTime:!1,categorizedWidgets:{}})),Ga(this,"state",Object(E["computed"])(()=>(this.privateState.isFetchedFirstTime||this.fetchAvailableWidgets(),Object(E["readonly"])(this.privateState)))),Ga(this,"widgets",Object(E["computed"])(()=>this.state.value.categorizedWidgets))}fetchAvailableWidgets(){return H.parsed.value.idSite?(this.privateState.isFetchedFirstTime=!0,new Promise((e,t)=>{try{window.widgetsHelper.getAvailableWidgets(t=>{const o=t;this.privateState.categorizedWidgets=o,e(this.widgets.value)})}catch(o){t(o)}})):Promise.resolve(this.widgets.value)}reloadAvailableWidgets(){window.widgetsHelper.clearAvailableWidgets();const e=this.fetchAvailableWidgets();return e.then(()=>{M.postEvent("WidgetsStore.reloaded")}),e}}var Ka=new Ja;const Qa="reportingmenu-help";var Xa=Object(E["defineComponent"])({components:{MenuItemsDropdown:$o},directives:{SideNav:Bt},props:{},data(){return{showSubcategoryHelpOnLoad:null,initialLoad:!0,helpShownCategory:null}},computed:{sideNavActivator(){return document.querySelector("nav .activateLeftMenu")},menu(){const e=za.menu.value;return e.forEach(e=>{if(e.widget&&e.widget.indexOf(".")>0){const[t,o]=e.widget.split(".");e.component=ve(t,o)}}),e},activeCategory(){return za.activeCategory.value},activeSubcategory(){return za.activeSubcategory.value},activeSubsubcategory(){return za.activeSubsubcategory.value},displayedCategory(){return H.parsed.value.category},displayedSubcategory(){return H.parsed.value.subcategory}},created(){za.fetchMenuItems().then(e=>{if(!H.parsed.value.subcategory){const t=e[0],o=t.subcategories[0];za.enterSubcategory(t,o),this.propagateUrlChange(t,o)}}),Object(E["watch"])(()=>H.parsed.value,e=>{const t=za.findSubcategory(e.category,e.subcategory);za.enterSubcategory(t.category,t.subcategory,t.subsubcategory)}),M.on("matomoPageChange",()=>{this.initialLoad||window.globalAjaxQueue.abort(),this.helpShownCategory=null,this.showSubcategoryHelpOnLoad&&(this.showHelp(this.showSubcategoryHelpOnLoad.category,this.showSubcategoryHelpOnLoad.subcategory),this.showSubcategoryHelpOnLoad=null),window.$("#loadingError,#loadingRateLimitError").hide(),this.initialLoad=!1}),M.on("updateReportingMenu",()=>{za.reloadMenuItems().then(()=>{const e=H.parsed.value.category,t=H.parsed.value.subcategory;if(e&&t){const o=za.findSubcategory(e,t);o.category&&za.enterSubcategory(o.category,o.subcategory,o.subsubcategory)}}),Ka.reloadAvailableWidgets()})},methods:{propagateUrlChange(e,t){const o=H.parsed.value;o.category===e.id&&o.subcategory===t.id?this.loadSubcategory(e,t):H.updateHash(Object.assign(Object.assign({},H.hashParsed.value),{},{category:e.id,subcategory:t.id}))},loadCategory(e){ki.remove(Qa);const t=za.toggleCategory(e),{subcategories:o}=e,i=o&&1===o.length||e.widget&&o&&o.length;if(t&&i){this.helpShownCategory=null;const t=e.subcategories[0];this.propagateUrlChange(e,t)}},loadSubcategory(e,t,o){o&&(o.shiftKey||o.ctrlKey||o.metaKey)||(ki.remove(Qa),t&&t.id===H.parsed.value.subcategory&&e.id===H.parsed.value.category&&(this.helpShownCategory=null,setTimeout(()=>{M.postEvent("loadPage",e.id,t.id)})))},makeUrl(e,t){const{idSite:o,period:i,date:n,segment:a,comparePeriods:r,compareDates:s,compareSegments:l}=H.parsed.value;return H.stringify({idSite:o,period:i,date:n,segment:a,comparePeriods:r,compareDates:s,compareSegments:l,category:e.id,subcategory:t.id})},htmlEntities(e){return M.helper.htmlEntities(e)},showHelp(e,t,o){const i=H.parsed.value,n=i.category,r=i.subcategory;if((n!==e.id||r!==t.id)&&o)return this.showSubcategoryHelpOnLoad={category:e,subcategory:t},void H.updateHash(Object.assign(Object.assign({},H.hashParsed.value),{},{category:e.id,subcategory:t.id}));if(this.helpShownCategory&&e.id===this.helpShownCategory.category&&t.id===this.helpShownCategory.subcategory)return ki.remove(Qa),void(this.helpShownCategory=null);const s=a("CoreHome_ReportingCategoryHelpPrefix",e.name,t.name),l=`${s}
`;ki.show({context:"info",id:Qa,type:"help",noclear:!0,class:"help-notification",message:l+t.help,placeat:"#notificationContainer",prepend:!0}),this.helpShownCategory={category:e.id,subcategory:t.id}}}});Xa.render=Fa;var Za=Xa;function er(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class tr{constructor(){er(this,"privateState",Object(E["reactive"])({reports:[]})),er(this,"state",Object(E["readonly"])(this.privateState)),er(this,"reports",Object(E["computed"])(()=>this.state.reports)),er(this,"reportsPromise",void 0)}findReport(e,t){return this.reports.value.find(o=>o.module===e&&o.action===t)}fetchReportMetadata(){return this.reportsPromise||(this.reportsPromise=K.fetch({method:"API.getReportMetadata",filter_limit:"-1",idSite:M.idSite||H.parsed.value.idSite}).then(e=>(this.privateState.reports=e,e))),this.reportsPromise.then(()=>this.reports.value)}}var or=new tr;const ir={class:"widgetLoader"},nr={key:0},ar={key:1,class:"notification system notification-error"},rr=["href"],sr={key:2,class:"notification system notification-error"},lr={class:"theWidgetContent",ref:"widgetContent"};function cr(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("ActivityIndicator");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ir,[Object(E["createVNode"])(r,{"loading-message":e.finalLoadingMessage,loading:e.loading},null,8,["loading-message","loading"]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",null,[e.widgetName?(Object(E["openBlock"])(),Object(E["createElementBlock"])("h2",nr,Object(E["toDisplayString"])(e.widgetName),1)):Object(E["createCommentVNode"])("",!0),e.loadingFailedRateLimit?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",sr,Object(E["toDisplayString"])(e.translate("General_ErrorRateLimit")),1)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ar,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_ErrorRequest","",""))+" ",1),e.hasErrorFaqLink?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:0,rel:"noreferrer noopener",target:"_blank",href:e.externalRawLink("https://matomo.org/faq/troubleshooting/faq_19489/")},Object(E["toDisplayString"])(e.translate("General_ErrorRequestFaqLink")),9,rr)):Object(E["createCommentVNode"])("",!0)]))],512),[[E["vShow"],e.loadingFailed]]),Object(E["createElementVNode"])("div",lr,null,512)])}function dr(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class ur{constructor(){dr(this,"privateState",Object(E["reactive"])({module:"",action:"",category:"",subcategory:"",idSite:"",widgetSearchFilters:{}})),dr(this,"state",Object(E["computed"])(()=>Object(E["readonly"])(this.privateState))),M.on("matomoPageChange",()=>{this.isCurrentPage()||this.resetSearchFilters(),this.updateCurrentRoutingFromUrl()})}resetSearchFilters(){this.privateState.widgetSearchFilters={}}getSearchFilters(e){return this.state.value.widgetSearchFilters[e]||{}}setSearchFilters(e,t){e&&(this.privateState.widgetSearchFilters[e]=t)}updateCurrentRoutingFromUrl(){const e=H.parsed.value;this.privateState.module=e.module,this.privateState.action=e.action,this.privateState.category=e.category,this.privateState.subcategory=e.subcategory,this.privateState.idSite=e.idSite}isCurrentPage(){const e=H.parsed.value;return this.state.value.module===e.module&&this.state.value.action===e.action&&this.state.value.category===e.category&&this.state.value.subcategory===e.subcategory&&this.state.value.idSite===e.idSite}}var mr=new ur,pr=Object(E["defineComponent"])({props:{widgetParams:Object,widgetName:String,loadingMessage:String},components:{ActivityIndicator:_e},data(){return{loading:!1,loadingFailed:!1,loadingFailedRateLimit:!1,changeCounter:0,lastWidgetAbortController:null}},watch:{widgetParams(e){e&&this.loadWidgetUrl(e,this.changeCounter+=1)}},computed:{finalLoadingMessage(){return this.loadingMessage?this.loadingMessage:this.widgetName?a("General_LoadingPopover",this.widgetName):a("General_LoadingData")},hasErrorFaqLink(){const e=M.config.enable_general_settings_admin,t=M.config.enable_plugins_admin;return M.hasSuperUserAccess&&(e||t)}},mounted(){this.widgetParams&&this.loadWidgetUrl(this.widgetParams,this.changeCounter+=1)},beforeUnmount(){this.cleanupLastWidgetContent()},methods:{abortHttpRequestIfNeeded(){this.lastWidgetAbortController&&(this.lastWidgetAbortController.abort(),this.lastWidgetAbortController=null)},cleanupLastWidgetContent(){const e=this.$refs.widgetContent;M.helper.destroyVueComponent(e),e&&(e.innerHTML="")},getWidgetUrl(e){const t=H.parsed.value;let o=Object.assign({},e||{});const i=Object.keys(Object.assign(Object.assign({},H.hashParsed.value),{},{idSite:"",period:"",date:"",segment:"",widget:""}));return i.forEach(e=>{"category"!==e&&"subcategory"!==e&&(e in o||(o[e]=t[e]))}),Do.isComparisonEnabled()&&(o=Object.assign(Object.assign({},o),{},{comparePeriods:t.comparePeriods,compareDates:t.compareDates,compareSegments:t.compareSegments})),e&&"showtitle"in e||(o.showtitle="1"),M.shouldPropagateTokenAuth&&t.token_auth&&(M.broadcast.isWidgetizeRequestWithoutSession()||(o.force_api_session="1"),o.token_auth=t.token_auth),o.random=Math.floor(1e4*Math.random()),o},loadWidgetUrl(e,t){this.loading=!0,this.abortHttpRequestIfNeeded(),this.cleanupLastWidgetContent(),this.lastWidgetAbortController=new AbortController;let o={};e.uniqueId&&(o=mr.getSearchFilters(e.uniqueId)),K.fetch(this.getWidgetUrl(Object.assign(e,o)),{format:"html",abortController:this.lastWidgetAbortController}).then(o=>{if(t!==this.changeCounter||"string"!==typeof o)return;this.lastWidgetAbortController=null,this.loading=!1,this.loadingFailed=!1;const i=this.$refs.widgetContent;window.$(i).html(o);const n=window.$(i).children();if(this.widgetName){let e=n.find("> .card-content .card-title");e.length||(e=n.find("> h2")),e.length&&e.html(M.helper.htmlEntities(this.widgetName))}M.helper.compileVueEntryComponents(n),ki.parseNotificationDivs(),setTimeout(()=>{M.postEvent("widget:loaded",{parameters:e,element:n})})}).catch(e=>{t===this.changeCounter&&(this.lastWidgetAbortController=null,this.cleanupLastWidgetContent(),this.loading=!1,"abort"!==e.xhrStatus&&(429===e.status&&(this.loadingFailedRateLimit=!0),this.loadingFailed=!0))})}}});pr.render=cr;var hr=pr;const gr={class:"widget-container"};function br(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Widget");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",gr,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.actualContainer,(e,t)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:t},[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(r,{widget:e,"prevent-recursion":!0},null,8,["widget"])])]))),128))])}const fr=ve("CoreHome","Widget");var vr=Object(E["defineComponent"])({props:{container:{type:Array,required:!0}},components:{Widget:fr},computed:{actualContainer(){var e,t,o;const i=this.container;if(null===i||void 0===i||null===(e=i[0])||void 0===e||!e.parameters)return i;const[n]=i,a="1"===(null===(t=n.parameters)||void 0===t?void 0:t.widget)||1===(null===(o=n.parameters)||void 0===o?void 0:o.widget),r=a&&"graphEvolution"===n.viewDataTable,s=r?Object.assign(Object.assign({},n),{},{parameters:Object.assign(Object.assign({},n.parameters),{},{showtitle:"0"})}):n;return[s,...i.slice(1)]}}});vr.render=br;var Or=vr;const jr={class:"reportsByDimensionView"},yr={class:"entityList"},wr={class:"listCircle"},Sr=["onClick"],kr={class:"dimension"},Cr={class:"reportContainer"},Er=Object(E["createElementVNode"])("div",{class:"clear"},null,-1);function Dr(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("WidgetLoader");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",jr,[Object(E["createElementVNode"])("div",yr,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.widgetsByCategory,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:"dimensionCategory",key:t.name},[Object(E["createTextVNode"])(Object(E["toDisplayString"])(t.name)+" ",1),Object(E["createElementVNode"])("ul",wr,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.widgets,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:Object(E["normalizeClass"])(["reportDimension",{activeDimension:e.selectedWidget.uniqueId===t.uniqueId}]),key:t.uniqueId,onClick:o=>e.selectWidget(t)},[Object(E["createElementVNode"])("span",kr,Object(E["toDisplayString"])(t.name),1)],10,Sr))),128))])]))),128))]),Object(E["createElementVNode"])("div",Cr,[e.selectedWidget.parameters?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:0,"widget-params":e.selectedWidget.parameters,class:"dimensionReport"},null,8,["widget-params"])):Object(E["createCommentVNode"])("",!0)]),Er])}var Pr=Object(E["defineComponent"])({props:{widgets:Array},components:{WidgetLoader:hr},data(){return{selectedWidget:null}},created(){[this.selectedWidget]=this.widgetsSorted},computed:{widgetsSorted(){return Ra(this.widgets)},widgetsByCategory(){const e={};return this.widgetsSorted.forEach(t=>{var o;const i=null===(o=t.subcategory)||void 0===o?void 0:o.name;i&&(e[i]||(e[i]={name:i,order:t.order,widgets:[]}),e[i].widgets.push(t))}),Ra(Object.values(e))}},methods:{selectWidget(e){this.selectedWidget=Object.assign({},e)}}});Pr.render=Dr;var Tr=Pr;const Vr=["id"],Nr={key:1},xr={key:2};function Br(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("WidgetLoader"),s=Object(E["resolveComponent"])("WidgetContainer"),l=Object(E["resolveComponent"])("WidgetByDimensionContainer"),c=Object(E["resolveDirective"])("tooltips");return e.actualWidget&&e.showWidget?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,class:Object(E["normalizeClass"])(["matomo-widget",{isFirstWidgetInPage:e.actualWidget.isFirstInPage}]),id:e.actualWidget.uniqueId},[!e.actualWidget.isContainer&&e.actualWidget.parameters?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:0,"widget-params":e.actualWidget.parameters,"widget-name":e.actualWidget.name},null,8,["widget-params","widget-name"])):Object(E["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"!==e.actualWidget.layout&&!this.preventRecursion?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Nr,[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(s,{container:e.actualWidget.widgets},null,8,["container"])])])):Object(E["createCommentVNode"])("",!0),e.actualWidget.isContainer&&"ByDimension"===e.actualWidget.layout?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",xr,[Object(E["createElementVNode"])("div",null,[Object(E["createVNode"])(l,{widgets:e.actualWidget.widgets},null,8,["widgets"])])])):Object(E["createCommentVNode"])("",!0)],10,Vr)),[[c,{content:e.tooltipContent}]]):Object(E["createCommentVNode"])("",!0)}function Mr(e,t){let o=void 0;return Object.values(e||{}).some(e=>(o=e.find(e=>{var o;return e&&e.isContainer&&(null===(o=e.parameters)||void 0===o?void 0:o.containerId)===t}),o)),o}var Ir=Object(E["defineComponent"])({props:{widget:Object,widgetized:Boolean,containerid:String,preventRecursion:Boolean},components:{WidgetLoader:hr,WidgetContainer:Or,WidgetByDimensionContainer:Tr},directives:{Tooltips:tt},data(){return{showWidget:!1}},setup(){function e(){const e=window.$(this);if(e.hasClass("matomo-form-field"))return"";const t=window.$(this).attr("title")||"";return window.vueSanitize(t.replace(/\n/g,"
"))}return{tooltipContent:e}},created(){const{actualWidget:e}=this;if(e&&e.middlewareParameters){const t=e.middlewareParameters;K.fetch(t).then(e=>{this.showWidget=!!e})}else this.showWidget=!0},computed:{allWidgets(){return Ka.widgets.value},actualWidget(){const e=this.widget;if(e){const t=Object.assign({},e);if(e&&e.isReport&&!e.documentation){const o=or.findReport(e.module,e.action);o&&o.documentation&&(t.documentation=o.documentation)}return e.uniqueId&&(t.parameters=Object.assign(Object.assign({},t.parameters),{},{uniqueId:e.uniqueId})),t}if(this.containerid){const e=Mr(this.allWidgets,this.containerid);if(e){const t=Object.assign({},e);if(this.widgetized){t.isFirstInPage=!0,t.parameters=Object.assign(Object.assign({},t.parameters),{},{widget:"1"});const e=Ya(t);e&&(t.widgets=e.map(e=>Object.assign(Object.assign({},e),{},{parameters:Object.assign(Object.assign({},e.parameters),{},{widget:"1",containerId:this.containerid})})))}return t}}return null}}});Ir.render=Br;var Fr=Ir;const Lr={class:"reporting-page"},Ar={key:1,class:"col s12 l6 leftWidgetColumn"},_r={key:2,class:"col s12 l6 rightWidgetColumn"};function Rr(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("ActivityIndicator"),s=Object(E["resolveComponent"])("Widget");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Lr,[Object(E["createVNode"])(r,{loading:e.loading},null,8,["loading"]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",null,Object(E["toDisplayString"])(e.translate("CoreHome_NoSuchPage")),513),[[E["vShow"],e.hasNoPage]]),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.widgets,e=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:"row",key:e.uniqueId},[e.group?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createBlock"])(s,{key:0,class:"col s12 fullWidgetColumn",widget:e},null,8,["widget"])),e.group?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ar,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.left,e=>(Object(E["openBlock"])(),Object(E["createBlock"])(s,{widget:e,key:e.uniqueId},null,8,["widget"]))),128))])):Object(E["createCommentVNode"])("",!0),e.group?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",_r,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.right,e=>(Object(E["openBlock"])(),Object(E["createBlock"])(s,{widget:e,key:e.uniqueId},null,8,["widget"]))),128))])):Object(E["createCommentVNode"])("",!0)]))),128))])}function Hr(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function $r(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 Ur(e){if(e&&e[0]){const t=[...e],o=e[0];return o.group?t[0]=Object.assign(Object.assign({},t[0]),{},{left:Ur(o.left||[]),right:Ur(o.right||[])}):t[0]=Object.assign(Object.assign({},t[0]),{},{isFirstInPage:!0}),t}return e}class qr{constructor(){Hr(this,"privateState",Object(E["reactive"])({})),Hr(this,"state",Object(E["computed"])(()=>Object(E["readonly"])(this.privateState))),Hr(this,"page",Object(E["computed"])(()=>this.state.value.page)),Hr(this,"widgets",Object(E["computed"])(()=>{const e=this.page.value;if(!e)return[];let t=[];const o={},i=e=>e.isReport&&o[`${e.module}.${e.action}`],n=e=>{if(!e.isReport)return[];const t=or.findReport(e.module,e.action);return t&&t.relatedReports?t.relatedReports:[]};if((e.widgets||[]).forEach(e=>{i(e)||(n(e).forEach(e=>{o[`${e.module}.${e.action}`]=!0}),t.push(e))}),t=Ra(t),1===t.length)return Ur(t);const a=[];for(let s=0;s(this.privateState.page=_a.findPage(e,t),this.page.value))}resetPage(){this.privateState.page=void 0}}var Wr=new qr;function zr(){const e="category=General_Visitors&subcategory=Live_VisitorLog",t=window.broadcast.buildReportingUrl(e);let o=a("CoreHome_PeriodHasOnlyRawData",`
`,"");M.visitorLogEnabled||(o=a("CoreHome_PeriodHasOnlyRawDataNoVisitsLog")),ki.show({id:"onlyRawData",animate:!1,context:"info",message:o,type:"transient"})}function Gr(){ki.remove("onlyRawData")}var Yr=Object(E["defineComponent"])({components:{ActivityIndicator:_e,Widget:Fr},data(){return{loading:!1,hasRawData:!1,hasNoVisits:!1,dateLastChecked:null,hasNoPage:!1}},created(){Wr.resetPage(),this.loading=!0,this.renderInitialPage(),Object(E["watch"])(()=>H.parsed.value,(e,t)=>{e.category===t.category&&e.subcategory===t.subcategory&&e.period===t.period&&e.date===t.date&&e.segment===t.segment&&JSON.stringify(e.compareDates)===JSON.stringify(t.compareDates)&&JSON.stringify(e.comparePeriods)===JSON.stringify(t.comparePeriods)&&JSON.stringify(e.compareSegments)===JSON.stringify(t.compareSegments)&&JSON.stringify(e.columns||"")===JSON.stringify(t.columns||"")||(e.date===t.date&&e.period===t.period||(Gr(),this.dateLastChecked=null,this.hasRawData=!1,this.hasNoVisits=!1),this.renderPage(e.category,e.subcategory,e.period,e.date,e.segment))}),M.on("loadPage",(e,t)=>{const o=H.parsed.value;this.renderPage(e,t,o.period,o.date,o.segment)})},computed:{widgets(){return Wr.widgets.value}},methods:{renderPage(e,t,o,i,n){if(!e||!t)return Wr.resetPage(),void(this.loading=!1);try{c.parse(o,i)}catch(s){return ki.show({id:"invalidDate",animate:!1,context:"error",message:a("CoreHome_DateInvalid"),type:"transient"}),Wr.resetPage(),void(this.loading=!1)}ki.remove("invalidDate"),M.postEvent("matomoPageChange",{}),ki.clearTransientNotifications(),c.parse(o,i).containsToday()&&this.showOnlyRawDataMessageIfRequired(e,t,o,i,n);const r={category:e,subcategory:t};if(M.postEvent("ReportingPage.loadPage",r),r.promise)return this.loading=!0,void Promise.resolve(r.promise).finally(()=>{this.loading=!1});Wr.fetchPage(e,t).then(()=>{const t=!Wr.page.value;if(t){const t=_a.findPageInCategory(e);if(t&&t.subcategory)return void H.updateHash(Object.assign(Object.assign({},H.hashParsed.value),{},{subcategory:t.subcategory.id}))}this.hasNoPage=t,this.loading=!1})},renderInitialPage(){const e=H.parsed.value;this.renderPage(e.category,e.subcategory,e.period,e.date,e.segment)},showOnlyRawDataMessageIfRequired(e,t,o,i,n){if(this.hasRawData&&this.hasNoVisits&&zr(),n)return void Gr();const a=["Live_VisitorLog","General_RealTime","UserCountryMap_RealTimeMap","MediaAnalytics_TypeAudienceLog","MediaAnalytics_TypeRealTime","FormAnalytics_TypeRealTime","Goals_AddNewGoal"],r=["HeatmapSessionRecording_Heatmaps","HeatmapSessionRecording_SessionRecordings","Marketplace_Marketplace"];if(-1!==a.indexOf(t)||-1!==r.indexOf(e)||-1!==t.toLowerCase().indexOf("manage"))return void Gr();const s=6e4;this.dateLastChecked&&(new Date).valueOf()-this.dateLastChecked.valueOf()(this.dateLastChecked=new Date,e.value>0?(this.hasNoVisits=!1,void Gr()):(this.hasNoVisits=!0,this.hasRawData?void zr():K.fetch({method:"Live.getMostRecentVisitsDateTime",date:i,period:o}).then(e=>{if(!e||""===e.value)return this.hasRawData=!1,void Gr();this.hasRawData=!0,zr()}))))}}});Yr.render=Rr;var Jr=Yr;const Kr={class:"report-export-popover row",id:"reportExport"},Qr={class:"col l6"},Xr={name:"format"},Zr={name:"option_flat"},es={name:"option_show_dimensions"},ts={name:"option_expanded"},os={name:"option_format_metrics"},is={class:"col l6"},ns={name:"filter_type"},as={class:"filter_limit"},rs={name:"filter_limit_all"},ss={key:0,name:"filter_limit"},ls={key:1,name:"filter_limit"},cs={class:"col l12"},ds=["value"],us=["innerHTML"],ms={class:"col l12"},ps=["href","title"],hs=["innerHTML"];function gs(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Field"),s=Object(E["resolveDirective"])("select-on-focus");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Kr,[Object(E["createElementVNode"])("div",Qr,[Object(E["createElementVNode"])("div",Xr,[Object(E["createVNode"])(r,{uicontrol:"radio",name:"format",title:e.translate("CoreHome_ExportFormat"),modelValue:e.reportFormat,"onUpdate:modelValue":t[0]||(t[0]=t=>e.reportFormat=t),"full-width":!0,options:e.availableReportFormats[e.reportType]},null,8,["title","modelValue","options"])]),Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",Zr,[Object(E["withDirectives"])(Object(E["createVNode"])(r,{uicontrol:"checkbox",name:"option_flat",title:e.translate("CoreHome_FlattenReport"),modelValue:e.optionFlatModel,"onUpdate:modelValue":t[1]||(t[1]=t=>e.optionFlatModel=t)},null,8,["title","modelValue"]),[[E["vShow"],e.canExportFlat]])])]),Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",es,[Object(E["withDirectives"])(Object(E["createVNode"])(r,{uicontrol:"checkbox",name:"option_show_dimensions",title:e.translate("CoreHome_IncludeDimensionsSeparately"),modelValue:e.optionShowDimensions,"onUpdate:modelValue":t[2]||(t[2]=t=>e.optionShowDimensions=t)},null,8,["title","modelValue"]),[[E["vShow"],e.canExportFlat&&e.hasMultipleDimensions&&e.optionFlatModel]])])]),Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",ts,[Object(E["withDirectives"])(Object(E["createVNode"])(r,{uicontrol:"checkbox",name:"option_expanded",title:e.translate("CoreHome_ExpandSubtables"),modelValue:e.optionExpandedModel,"onUpdate:modelValue":t[3]||(t[3]=t=>e.optionExpandedModel=t)},null,8,["title","modelValue"]),[[E["vShow"],e.hasSubtables&&!e.isCsvOrTsv]])])]),Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",os,[Object(E["createVNode"])(r,{uicontrol:"checkbox",name:"option_format_metrics",title:e.translate("CoreHome_FormatMetrics"),modelValue:e.optionFormatMetrics,"onUpdate:modelValue":t[4]||(t[4]=t=>e.optionFormatMetrics=t)},null,8,["title","modelValue"])])])]),Object(E["createElementVNode"])("div",is,[Object(E["createElementVNode"])("div",null,[Object(E["createElementVNode"])("div",ns,[Object(E["createVNode"])(r,{uicontrol:"radio",name:"filter_type",title:e.translate("CoreHome_ReportType"),modelValue:e.reportType,"onUpdate:modelValue":t[5]||(t[5]=t=>e.reportType=t),"full-width":!0,options:e.availableReportTypes},null,8,["title","modelValue","options"])])]),Object(E["createElementVNode"])("div",as,[Object(E["withDirectives"])(Object(E["createElementVNode"])("div",rs,[Object(E["createVNode"])(r,{uicontrol:"radio",name:"filter_limit_all",title:e.translate("CoreHome_RowLimit"),modelValue:e.reportLimitAll,"onUpdate:modelValue":t[6]||(t[6]=t=>e.reportLimitAll=t),"full-width":!0,options:e.limitAllOptions},null,8,["title","modelValue","options"])],512),[[E["vShow"],!e.maxFilterLimit||e.maxFilterLimit<=0]]),"no"===e.reportLimitAll&&e.maxFilterLimit<=0?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ss,[Object(E["createVNode"])(r,{uicontrol:"number",name:"filter_limit",min:1,modelValue:e.reportLimit,"onUpdate:modelValue":t[7]||(t[7]=t=>e.reportLimit=t),"full-width":!0},null,8,["modelValue"])])):Object(E["createCommentVNode"])("",!0),"no"===e.reportLimitAll&&e.maxFilterLimit>0?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",ls,[Object(E["createVNode"])(r,{uicontrol:"number",name:"filter_limit",min:1,max:e.maxFilterLimit,modelValue:e.reportLimit,"onUpdate:modelValue":t[8]||(t[8]=t=>e.reportLimit=t),value:e.reportLimit,"full-width":!0,title:e.filterLimitTooltip},null,8,["max","modelValue","value","title"])])):Object(E["createCommentVNode"])("",!0)])]),Object(E["withDirectives"])(Object(E["createElementVNode"])("div",cs,[Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("textarea",{readonly:"",class:"exportFullUrl",value:e.exportLinkWithoutToken},[Object(E["createTextVNode"])("\n ")],8,ds)),[[s,{}]]),Object(E["createElementVNode"])("div",{class:"tooltip",innerHTML:e.$sanitize(e.translate("CoreHome_ExportTooltipWithLink","","","ENTER_YOUR_TOKEN_AUTH_HERE"))},null,8,us)],512),[[E["vShow"],e.showUrl]]),Object(E["createElementVNode"])("div",ms,[Object(E["createElementVNode"])("a",{class:"btn",href:e.exportLink,target:"_new",title:e.translate("CoreHome_ExportTooltip")},Object(E["toDisplayString"])(e.translate("General_Export")),9,ps),Object(E["createElementVNode"])("a",{href:"javascript:",onClick:t[9]||(t[9]=t=>e.showUrl=!e.showUrl),class:"toggle-export-url"},[Object(E["withDirectives"])(Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.translate("CoreHome_ShowExportUrl")),513),[[E["vShow"],!e.showUrl]]),Object(E["withDirectives"])(Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.translate("CoreHome_HideExportUrl")),513),[[E["vShow"],e.showUrl]])])]),e.additionalContent?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,class:"col l12 report-export-popover-footer",innerHTML:e.$sanitize(e.additionalContent)},null,8,hs)):Object(E["createCommentVNode"])("",!0)])} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const bs=["CSV","TSV"];function fs(e){return bs.includes(e)}function vs(e,t,o){return e?fs(o)?{hasUserPreference:!1,preferredMode:null}:{hasUserPreference:!0,preferredMode:"flat"}:t?{hasUserPreference:!0,preferredMode:"expanded"}:{hasUserPreference:!0,preferredMode:null}}function Os(e,t,o,i){const{hasUserPreference:n,preferredMode:a}=i;return e?fs(o)?t?{optionFlat:!n||"flat"===a,optionExpanded:!1}:{optionFlat:!1,optionExpanded:!1}:n?"flat"===a?t?{optionFlat:!0,optionExpanded:!1}:{optionFlat:!1,optionExpanded:!0}:"expanded"===a?{optionFlat:!1,optionExpanded:!0}:{optionFlat:!1,optionExpanded:!1}:{optionFlat:!1,optionExpanded:!0}:{optionFlat:!1,optionExpanded:!1}}const js=ve("CorePluginsAdmin","Field");var ys=Object(E["defineComponent"])({components:{Field:js},directives:{SelectOnFocus:Tt},props:{hasSubtables:Boolean,canExportFlat:{type:Boolean,default:!1},availableReportTypes:Object,availableReportFormats:{type:Object,required:!0},maxFilterLimit:Number,limitAllOptions:Object,dataTable:{type:Object,required:!0},requestParams:[Object,String],apiMethod:{type:String,required:!0},initialReportType:{type:String,default:"default"},initialReportLimit:{type:[String,Number],default:100},initialReportLimitAll:{type:String,default:"yes"},initialOptionFlat:{type:Boolean,default:!1},initialOptionShowDimensions:{type:Boolean,default:!1},initialOptionExpanded:{type:Boolean,default:!0},initialOptionFormatMetrics:{type:Boolean,default:!1},initialReportFormat:{type:String,default:"TSV"}},mounted(){const e={content:this.additionalContent,dataTable:this.dataTable};M.postEvent("ReportExportPopover.additionalContent",e),this.additionalContent=e.content},data(){return{showUrl:!1,reportFormat:this.initialReportFormat,optionShowDimensions:this.initialOptionShowDimensions,subtablePreference:vs(this.initialOptionFlat,this.initialOptionExpanded,this.initialReportFormat),optionFormatMetrics:this.initialOptionFormatMetrics,reportType:this.initialReportType,reportLimitAll:this.initialReportLimitAll,reportLimit:"string"===typeof this.initialReportLimit?parseInt(this.initialReportLimit,10):this.initialReportLimit,additionalContent:""}},watch:{reportType(e){this.availableReportFormats[e][this.reportFormat]||(this.reportFormat="JSON")},reportLimit(e,t){this.maxFilterLimit&&this.maxFilterLimit>0&&e>this.maxFilterLimit&&(this.reportLimit=t)}},computed:{hasMultipleDimensions(){var e,t;return"function"===typeof(null===(e=this.dataTable)||void 0===e?void 0:e.getReportMetadata)&&Object.keys((null===(t=this.dataTable)||void 0===t?void 0:t.getReportMetadata().dimensions)||{}).length>1},filterLimitTooltip(){const e=a("CoreHome_RowLimit"),t=this.maxFilterLimit?a("General_ComputedMetricMax",this.maxFilterLimit.toString()):"";return`${e} (${t})`},isCsvOrTsv(){return fs(this.reportFormat)},effectiveSubtableOptions(){return Os(this.hasSubtables,this.canExportFlat,this.reportFormat,this.subtablePreference)},optionFlatModel:{get(){return this.effectiveSubtableOptions.optionFlat},set(e){this.hasSubtables&&this.canExportFlat&&(e?this.subtablePreference={hasUserPreference:!0,preferredMode:"flat"}:this.optionExpandedModel||(this.subtablePreference={hasUserPreference:!0,preferredMode:null}))}},optionExpandedModel:{get(){return this.effectiveSubtableOptions.optionExpanded},set(e){this.hasSubtables&&!fs(this.reportFormat)&&(e?this.subtablePreference={hasUserPreference:!0,preferredMode:"expanded"}:this.optionFlatModel||(this.subtablePreference={hasUserPreference:!0,preferredMode:null}))}},exportLink(){return this.getExportLink(!0)},exportLinkWithoutToken(){return this.getExportLink(!1)}},methods:{getExportLink(e=!0){const{reportFormat:t,apiMethod:o,reportType:i}=this,n=this.dataTable;if(!t)return;let a={};const r="yes"===this.reportLimitAll?-1:this.reportLimit;this.requestParams&&"string"===typeof this.requestParams?a=JSON.parse(this.requestParams):this.requestParams&&"object"===typeof this.requestParams&&(a=this.requestParams);const{segment:s,label:l,idGoal:c,idDimension:d,idSite:u}=n.param;let{date:m,period:p}=n.param;"RSS"===t&&(m="last10"),"undefined"!==typeof n.param.dateUsedInGraph&&(m=n.param.dateUsedInGraph);const h=M.config.datatable_export_range_as_day.toLowerCase();-1!==h.indexOf(t.toLowerCase())&&"range"===n.param.period&&(p="day"),"range"===n.param.period&&"graphEvolution"===n.param.viewDataTable&&(p="day");const g={module:"API",format:t,idSite:u,period:p,date:m};"processed"===i?(g.method="API.getProcessedReport",[g.apiModule,g.apiAction]=o.split(".")):g.method=o,n.param.compareDates&&n.param.compareDates.length&&(g.compareDates=n.param.compareDates,g.compare="1"),n.param.comparePeriods&&n.param.comparePeriods.length&&(g.comparePeriods=n.param.comparePeriods,g.compare="1"),n.param.compareSegments&&n.param.compareSegments.length&&(g.compareSegments=n.param.compareSegments,g.compare="1"),"undefined"!==typeof n.param.filter_pattern&&(g.filter_pattern=n.param.filter_pattern),"undefined"!==typeof n.param.filter_pattern_recursive&&(g.filter_pattern_recursive=n.param.filter_pattern_recursive),window.$.isPlainObject(a)&&Object.entries(a).forEach(([e,t])=>{let o=t;!0===o?o=1:!1===o&&(o=0),g[e]=o});const{optionFlat:b,optionExpanded:f}=this.effectiveSubtableOptions;if(b&&(g.flat=1,this.optionShowDimensions&&(g.show_dimensions=1),"undefined"!==typeof n.param.include_aggregate_rows&&"1"===n.param.include_aggregate_rows&&(g.include_aggregate_rows=1)),this.hasSubtables&&!b&&f&&(g.expanded=1),this.optionFormatMetrics&&(g.format_metrics=1),n.param.pivotBy&&(g.pivotBy=n.param.pivotBy,g.pivotByColumnLimit=20,n.props.pivot_by_column&&(g.pivotByColumn=n.props.pivot_by_column)),"CSV"!==t&&"TSV"!==t&&"RSS"!==t||(g.translateColumnNames=1,g.language=M.language),"undefined"!==typeof s&&(g.segment=decodeURIComponent(s)),"undefined"!==typeof c&&"-1"!==c&&(g.idGoal=c),"undefined"!==typeof d&&"-1"!==d&&(g.idDimension=d),l){const e=l.split(",");e.length>1?g.label=e:[g.label]=e}g.showMetadata=0,g.token_auth="ENTER_YOUR_TOKEN_AUTH_HERE",!0===e&&(g.token_auth=M.token_auth,g.force_api_session=1),g.filter_limit=r;const v=window.location.href.split("?")[0];return`${v}?${H.stringify(g)}`}}});ys.render=gs;var ws=ys; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{$:Ss}=window;var ks={mounted(e,t){e.addEventListener("click",()=>{var o;const i=H.hashParsed.value.popover,n=Ss(e).closest("[data-report]").data("uiControlObject"),r=window.Piwik_Popover.showLoading("Export"),s=t.value.reportFormats;let l=n.param.filter_limit;t.value.maxFilterLimit>0&&(l=Math.min(l,t.value.maxFilterLimit));const c=!0===n.param.flat||1===n.param.flat||"1"===n.param.flat,d=!0===n.param.show_dimensions||1===n.param.show_dimensions||"1"===n.param.show_dimensions,u=c||n.numberOfSubtables>0,m=(null!==(o=t.value.canExportFlat)&&void 0!==o?o:u)&&u,p=m,h=!1,g={initialReportType:"default",initialReportFormat:"TSV",initialReportLimit:l>0?l:100,initialReportLimitAll:-1===l?"yes":"no",initialOptionFlat:p,initialOptionShowDimensions:d,initialOptionExpanded:h,initialOptionFormatMetrics:!1,hasSubtables:u,canExportFlat:m,availableReportFormats:{default:s,processed:{JSON:s.JSON,XML:s.XML}},availableReportTypes:{default:a("CoreHome_StandardReport"),processed:a("CoreHome_ReportWithMetadata")},limitAllOptions:{yes:a("General_All"),no:a("CoreHome_CustomLimit")},maxFilterLimit:t.value.maxFilterLimit,dataTable:n,requestParams:t.value.requestParams,apiMethod:t.value.apiMethod},b=me({template:'\n ',data(){return{bind:g}}});b.component("popover",ws);const f=document.createElement("div");b.mount(f);const{reportTitle:v}=t.value;window.Piwik_Popover.setTitle(`${a("General_Export")} ${M.helper.htmlEntities(v)}`),window.Piwik_Popover.setContent(f),window.Piwik_Popover.onClose(()=>{b.unmount(),""!==i&&setTimeout(()=>{H.updateHash(Object.assign(Object.assign({},H.hashParsed.value),{},{popover:i})),t.value.onClose&&t.value.onClose()},100)}),setTimeout(()=>{r.dialog(),Ss(".exportFullUrl, .btn",r).tooltip({track:!0,show:!1,hide:!1})},100)})}};const Cs=["src","width","height"];function Es(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("img",{class:"sparklineImg",loading:"lazy",alt:"",src:e.sparklineUrl,width:e.width,height:e.height},null,8,Cs)}var Ds=Object(E["defineComponent"])({props:{seriesIndices:Array,params:[Object,String],width:Number,height:Number},data(){return{isWidget:!1}},mounted(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl(){const{seriesIndices:e,params:t}=this,o=M.getSparklineColors();e&&(o.lineColor=o.lineColor.filter((t,o)=>-1!==e.indexOf(o)));const i=JSON.stringify(o),n={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:i,random:Date.now(),date:this.defaultDate,segment:H.parsed.value.segment},a="object"===typeof t?t:H.parse(t.substring(t.indexOf("?")+1)),r=new K,s=r.mixinDefaultGetParams(Object.assign(Object.assign({},n),a)),l=H.parsed.value.token_auth;return l&&l.length&&M.shouldPropagateTokenAuth&&(s.token_auth=l),"?"+H.stringify(s)},defaultDate(){if("range"===M.period)return`${M.startDateString},${M.endDateString}`;const e=C.getLastNRange(M.period,30,M.currentDateString).getDateRange(),t=new Date(M.minDateYear,M.minDateMonth-1,M.minDateDay);e[0]100?100:this.progress<0?0:this.progress}}});Bs.render=xs;var Ms=Bs,Is={mounted(e){e.classList.add("piwik-content-intro")},updated(e){Object(E["nextTick"])(()=>{e.classList.add("piwik-content-intro")})}},Fs={mounted(e,t){var o;null!==t&&void 0!==t&&null!==(o=t.value)&&void 0!==o&&o.off||e.classList.add("card","card-table","entityTable")},updated(e,t){var o;null!==t&&void 0!==t&&null!==(o=t.value)&&void 0!==o&&o.off||Object(E["nextTick"])(()=>{e.classList.add("card","card-table","entityTable")})}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const Ls={ref:"root"};function As(e,t,o,i,n,a){return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ls,[Object(E["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)}const{$:_s}=window;var Rs=Object(E["defineComponent"])({props:{formData:{type:Object,required:!0},submitApiMethod:{type:String,required:!0},sendJsonPayload:Boolean,noErrorNotification:Boolean,noSuccessNotification:Boolean},data(){return{isSubmitting:!1,successfulPostResponse:null,errorPostResponse:null}},emits:["update:modelValue"],mounted(){_s(this.$refs.root).on("click","input[type=submit]",()=>{this.submitForm()})},methods:{submitForm(){this.successfulPostResponse=null,this.errorPostResponse=null;let e=this.formData;this.sendJsonPayload&&(e={data:JSON.stringify(this.formData)}),this.isSubmitting=!0,K.post({module:"API",method:this.submitApiMethod},e,{createErrorNotification:!this.noErrorNotification}).then(e=>{if(this.successfulPostResponse=e,!this.noSuccessNotification){const e=ki.show({message:a("General_YourChangesHaveBeenSaved"),context:"success",type:"toast",id:"ajaxHelper"});ki.scrollToNotification(e)}}).catch(e=>{this.errorPostResponse=e.message}).finally(()=>{this.isSubmitting=!1})}}});Rs.render=As;var Hs=Rs;function $s(e,t,o,i,n,a){return Object(E["renderSlot"])(e.$slots,"default")}var Us=Object(E["defineComponent"])({});Us.render=$s;var qs=Us;const Ws={key:0},zs=["data-target","title"],Gs=Object(E["createElementVNode"])("span",{class:"icon-configure"},null,-1),Ys={class:"visually-hidden"},Js=["data-target"],Ks=["title"],Qs=["title","src"],Xs=["id"],Zs=["data-footer-icon-id"],el=["title"],tl=["title","src"],ol={key:2},il=Object(E["createElementVNode"])("li",{class:"divider"},null,-1),nl=Object(E["createElementVNode"])("li",{class:"divider"},null,-1),al=["title"],rl=Object(E["createElementVNode"])("span",{class:"icon-export"},null,-1),sl={class:"visually-hidden"},ll=["title"],cl=Object(E["createElementVNode"])("span",{class:"icon-image"},null,-1),dl=[cl],ul=["title"],ml=Object(E["createElementVNode"])("span",{class:"icon-annotation"},null,-1),pl=[ml],hl=["title"],gl=Object(E["createElementVNode"])("span",{class:"icon-search",draggable:"false"},null,-1),bl=["title"],fl=["id","title"],vl=["title"],Ol=["title","src"],jl=["id"],yl={key:0},wl=["innerHTML"],Sl={key:1},kl=["innerHTML"],Cl={key:2},El=["innerHTML"],Dl={key:3},Pl=["innerHTML"],Tl={key:4},Vl=["innerHTML"],Nl={key:5},xl=["innerHTML"],Bl=["title","data-target"],Ml=Object(E["createElementVNode"])("span",{class:"icon-calendar"},null,-1),Il={class:"periodName"},Fl=["id"],Ll=["data-period"];function Al(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Passthrough"),s=Object(E["resolveDirective"])("dropdown-button"),l=Object(E["resolveDirective"])("report-export");return e.showFooter&&e.showFooterIcons?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Ws,[e.hasConfigItems&&(e.isAnyConfigureIconHighlighted||e.isTableView)?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:0,class:Object(E["normalizeClass"])(["dropdown-button dropdownConfigureIcon dataTableAction",{highlighted:e.isAnyConfigureIconHighlighted}]),href:"",onClick:t[0]||(t[0]=Object(E["withModifiers"])(()=>{},["prevent"])),"data-target":"dropdownConfigure"+e.randomIdForDropdown,title:e.translate("CoreHome_ReportConfigure"),style:{"margin-right":"3.5px"}},[Gs,Object(E["createElementVNode"])("span",Ys,Object(E["toDisplayString"])(e.translate("CoreHome_ReportConfiguration")),1)],10,zs)),[[s]]):Object(E["createCommentVNode"])("",!0),e.hasFooterIconsToShow?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,class:"dropdown-button dataTableAction activateVisualizationSelection",href:"","data-target":"dropdownVisualizations"+e.randomIdForDropdown,style:{"margin-right":"3.5px"},onClick:t[1]||(t[1]=Object(E["withModifiers"])(()=>{},["prevent"]))},[/^icon-/.test(e.activeFooterIcon||"")?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,title:e.translate("CoreHome_ChangeVisualization"),class:Object(E["normalizeClass"])(e.activeFooterIcon)},null,10,Ks)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("img",{key:1,title:e.translate("CoreHome_ChangeVisualization"),width:"16",height:"16",src:e.activeFooterIcon},null,8,Qs))],8,Js)),[[s]]):Object(E["createCommentVNode"])("",!0),e.showFooterIcons?(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",{key:2,id:"dropdownVisualizations"+e.randomIdForDropdown,class:"dropdown-content dataTableFooterIcons"},[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.footerIcons,(t,o)=>(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:o},{default:Object(E["withCtx"])(()=>[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(t.buttons.filter(e=>!!e.icon),o=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:o.id},[Object(E["createElementVNode"])("a",{class:Object(E["normalizeClass"])(`${t.class} tableIcon\n ${-1!==e.activeFooterIconIds.indexOf(o.id)?"activeIcon":""}`),"data-footer-icon-id":o.id},[/^icon-/.test(o.icon||"")?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,title:o.title,class:Object(E["normalizeClass"])(o.icon),style:{"margin-right":"5.5px"}},null,10,el)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("img",{key:1,width:"16",height:"16",title:o.title,src:o.icon,style:{"margin-right":"5.5px"}},null,8,tl)),o.title?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",ol,Object(E["toDisplayString"])(o.title),1)):Object(E["createCommentVNode"])("",!0)],10,Zs)]))),128)),il]),_:2},1024))),128)),nl],8,Xs)):Object(E["createCommentVNode"])("",!0),e.showExport?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:3,class:"dataTableAction activateExportSelection",title:e.translate("General_ExportThisReport"),href:"",style:{"margin-right":"3.5px"},onClick:t[2]||(t[2]=Object(E["withModifiers"])(()=>{},["prevent"]))},[rl,Object(E["createElementVNode"])("span",sl,Object(E["toDisplayString"])(e.translate("General_ExportThisReport")),1)],8,al)),[[l,{reportTitle:e.reportTitle,requestParams:e.requestParams,apiMethod:e.apiMethodToRequestDataTable,reportFormats:e.reportFormats,maxFilterLimit:e.maxFilterLimit}]]):Object(E["createCommentVNode"])("",!0),e.showExportAsImageIcon?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:4,class:"dataTableAction tableIcon",href:"",id:"dataTableFooterExportAsImageIcon",onClick:t[3]||(t[3]=Object(E["withModifiers"])(t=>e.showExportImage(t),["prevent"])),title:e.translate("General_ExportAsImage"),style:{"margin-right":"3.5px"}},dl,8,ll)):Object(E["createCommentVNode"])("",!0),e.showAnnotations?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:5,class:"dataTableAction annotationView",href:"",title:e.translate("Annotations_Annotations"),onClick:t[4]||(t[4]=Object(E["withModifiers"])(()=>{},["prevent"])),style:{"margin-right":"3.5px"}},pl,8,ul)):Object(E["createCommentVNode"])("",!0),e.showSearch?(Object(E["openBlock"])(),Object(E["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(E["withModifiers"])(()=>{},["prevent"]))},[gl,Object(E["createElementVNode"])("span",{class:"icon-close",draggable:"false",title:e.translate("CoreHome_CloseSearch")},null,8,bl),Object(E["createElementVNode"])("input",{id:`widgetSearch_${e.reportId}_${e.placement}`,title:e.translate("CoreHome_DataTableHowToSearch"),type:"text",class:"dataTableSearchInput"},null,8,fl)],8,hl)):Object(E["createCommentVNode"])("",!0),(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.dataTableActions,e=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:e.id,class:Object(E["normalizeClass"])("dataTableAction "+e.id),href:"",onClick:t[6]||(t[6]=Object(E["withModifiers"])(()=>{},["prevent"])),title:e.title,style:{"margin-right":"3.5px"}},[/^icon-/.test(e.icon||"")?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,class:Object(E["normalizeClass"])(e.icon)},null,2)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("img",{key:1,width:"16",height:"16",title:e.title,src:e.icon},null,8,Ol))],10,vl))),128)),Object(E["createElementVNode"])("ul",{id:"dropdownConfigure"+e.randomIdForDropdown,class:"dropdown-content tableConfiguration"},[e.showFlattenTable?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",yl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableFlatten",innerHTML:e.$sanitize(e.flattenItemText)},null,8,wl)])):Object(E["createCommentVNode"])("",!0),e.showDimensionsConfigItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Sl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableShowDimensions",innerHTML:e.$sanitize(e.showDimensionsText)},null,8,kl)])):Object(E["createCommentVNode"])("",!0),e.showFlatConfigItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Cl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableIncludeAggregateRows",innerHTML:e.$sanitize(e.includeAggregateRowsText)},null,8,El)])):Object(E["createCommentVNode"])("",!0),e.showTotalsConfigItem?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Dl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableShowTotalsRow",innerHTML:e.$sanitize(e.keepTotalsRowText)},null,8,Pl)])):Object(E["createCommentVNode"])("",!0),e.showExcludeLowPopulation?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Tl,[Object(E["createElementVNode"])("div",{class:"configItem dataTableExcludeLowPopulation",innerHTML:e.$sanitize(e.excludeLowPopText)},null,8,Vl)])):Object(E["createCommentVNode"])("",!0),e.showPivotBySubtable?(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",Nl,[Object(E["createElementVNode"])("div",{class:"configItem dataTablePivotBySubtable",innerHTML:e.$sanitize(e.pivotByText)},null,8,xl)])):Object(E["createCommentVNode"])("",!0)],8,jl),e.showPeriods?Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:7,class:"dropdown-button dataTableAction activatePeriodsSelection",href:"",onClick:t[7]||(t[7]=Object(E["withModifiers"])(()=>{},["prevent"])),title:e.translate("CoreHome_ChangePeriod"),"data-target":"dropdownPeriods"+e.randomIdForDropdown},[Object(E["createElementVNode"])("div",null,[Ml,Object(E["createElementVNode"])("span",Il,Object(E["toDisplayString"])(e.translations[e.clientSideParameters.period]||e.clientSideParameters.period),1)])],8,Bl)),[[s]]):Object(E["createCommentVNode"])("",!0),e.showPeriods?(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",{key:8,id:"dropdownPeriods"+e.randomIdForDropdown,class:"dropdown-content dataTablePeriods"},[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.selectablePeriods,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:t},[Object(E["createElementVNode"])("a",{"data-period":t,class:Object(E["normalizeClass"])("tableIcon "+(e.clientSideParameters.period===t?"activeIcon":""))},[Object(E["createElementVNode"])("span",null,Object(E["toDisplayString"])(e.translations[t]||t),1)],10,Ll)]))),128))],8,Fl)):Object(E["createCommentVNode"])("",!0)])):Object(E["createCommentVNode"])("",!0)}const{$:_l}=window;function Rl(e,t,o){if(/(%(.\$)?s+)/g.test(a(e))){const i=['
'];o&&i.push(o);let n=a(e,...i);return t&&(n+=` (${a("CoreHome_Default")})`),n+="",n}return a(e)}function Hl(e,t,o){return e?Rl(t,!0):Rl(o)}function $l(e){return!!e&&"0"!==e}var Ul=Object(E["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,placement:{type:String,default:"footer"}},components:{Passthrough:qs},directives:{DropdownButton:kt,ReportExport:ks},methods:{showExportImage(e){_l(e.target).closest(".dataTable").find("div.jqplot-target").trigger("piwikExportAsImage")}},computed:{randomIdForDropdown(){return Math.floor(999999*Math.random())},allFooterIcons(){return this.footerIcons.reduce((e,t)=>(e.push(...t.buttons),e),[])},activeFooterIcons(){const e=this.clientSideParameters,t=[this.viewDataTable];return 0===e.abandonedCarts||"0"===e.abandonedCarts?t.push("ecommerceOrder"):1!==e.abandonedCarts&&"1"!==e.abandonedCarts||t.push("ecommerceAbandonedCart"),t.map(e=>this.allFooterIcons.find(t=>t.id===e)).filter(e=>!!e)},activeFooterIcon(){var e;return null===(e=this.activeFooterIcons[0])||void 0===e?void 0:e.icon},activeFooterIconIds(){return this.activeFooterIcons.map(e=>e.id)},numIcons(){return this.allFooterIcons.length},hasFooterIconsToShow(){return!!this.activeFooterIcons.length&&this.numIcons>1},reportFormats(){const e={TSV:"TSV (Excel)",HTML:"HTML",JSON:"JSON",XML:"XML",CSV:"CSV",RSS:"RSS"};return e},showDimensionsConfigItem(){return this.showFlattenTable&&""+this.clientSideParameters.flat==="1"&&this.hasMultipleDimensions},showFlatConfigItem(){return this.showFlattenTable&&""+this.clientSideParameters.flat==="1"},showTotalsConfigItem(){return!this.isDataTableEmpty&&this.showTotalsRow},hasConfigItems(){return this.showFlattenTable||this.showDimensionsConfigItem||this.showFlatConfigItem||this.showTotalsConfigItem||this.showExcludeLowPopulation||this.showPivotBySubtable},flattenItemText(){const e=this.clientSideParameters;return Hl($l(e.flat),"CoreHome_UnFlattenDataTable","CoreHome_FlattenDataTable")},keepTotalsRowText(){const e=this.clientSideParameters;return Hl($l(e.keep_totals_row),"CoreHome_RemoveTotalsRowDataTable","CoreHome_AddTotalsRowDataTable")},includeAggregateRowsText(){const e=this.clientSideParameters;return Hl($l(e.include_aggregate_rows),"CoreHome_DataTableExcludeAggregateRows","CoreHome_DataTableIncludeAggregateRows")},showDimensionsText(){const e=this.clientSideParameters;return Hl($l(e.show_dimensions),"CoreHome_DataTableCombineDimensions","CoreHome_DataTableShowDimensions")},pivotByText(){const e=this.clientSideParameters;return $l(e.pivotBy)?Rl("CoreHome_UndoPivotBySubtable",!0):Rl("CoreHome_PivotBySubtable",!1,this.pivotDimensionName)},excludeLowPopText(){const e=this.clientSideParameters;return Hl($l(e.enable_filter_excludelowpop),"CoreHome_IncludeRowsWithLowPopulation","CoreHome_ExcludeRowsWithLowPopulation")},isAnyConfigureIconHighlighted(){const e=this.clientSideParameters;return $l(e.flat)||$l(e.keep_totals_row)||$l(e.include_aggregate_rows)||$l(e.show_dimensions)||$l(e.pivotBy)||$l(e.enable_filter_excludelowpop)},isTableView(){return"table"===this.viewDataTable||"tableAllColumns"===this.viewDataTable||"tableGoals"===this.viewDataTable}}});Ul.render=Al;var ql=Ul;const Wl={key:0,class:"title",style:{cursor:"pointer"},ref:"expander"},zl=Object(E["createElementVNode"])("span",{class:"icon-warning"},null,-1),Gl={key:1,class:"title",href:"?module=CoreUpdater&action=newVersionAvailable",style:{cursor:"pointer"},ref:"expander"},Yl=Object(E["createElementVNode"])("span",{class:"icon-warning"},null,-1),Jl=["innerHTML"],Kl=["href"],Ql={id:"updateCheckLinkContainer"},Xl={class:"dropdown positionInViewport"},Zl=["innerHTML"],ec=["innerHTML"];function tc(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("Passthrough"),s=Object(E["resolveDirective"])("expand-on-hover");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{id:"header_message",class:Object(E["normalizeClass"])(["piwikSelector",{header_info:!e.latestVersionAvailable||e.lastUpdateCheckFailed,update_available:e.latestVersionAvailable}])},[e.latestVersionAvailable?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:0},{default:Object(E["withCtx"])(()=>[e.isMultiServerEnvironment?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",Wl,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),zl],512)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",Gl,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translate("General_NewUpdatePiwikX",e.latestVersionAvailable))+" ",1),Yl],512))]),_:1})):e.isSuperUser&&(e.isAdminArea||e.lastUpdateCheckFailed)?(Object(E["openBlock"])(),Object(E["createBlock"])(r,{key:1},{default:Object(E["withCtx"])(()=>[e.isInternetEnabled?(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:0,class:"title",innerHTML:e.$sanitize(e.updateCheck)},null,8,Jl)):(Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{key:1,class:"title",href:e.externalRawLink("https://matomo.org/changelog/"),target:"_blank",rel:"noreferrer noopener"},[Object(E["createElementVNode"])("span",Ql,Object(E["toDisplayString"])(e.translate("CoreHome_SeeAvailableVersions")),1)],8,Kl))]),_:1})):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("div",Xl,[e.latestVersionAvailable&&e.isSuperUser?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.updateNowText)},null,8,Zl)):e.latestVersionAvailable&&e.hasSomeViewAccess&&!e.isAnonymous?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.updateAvailableText)},null,8,ec)):Object(E["createCommentVNode"])("",!0),Object(E["createTextVNode"])(" "+Object(E["toDisplayString"])(e.translate("General_YouAreCurrentlyUsing",e.piwikVersion)),1)])],2)),[[s,{expander:"expander"}]])}var oc=Object(E["defineComponent"])({props:{isMultiServerEnvironment:Boolean,lastUpdateCheckFailed:Boolean,latestVersionAvailable:String,isSuperUser:Boolean,isAdminArea:Boolean,isInternetEnabled:Boolean,updateCheck:String,isAnonymous:Boolean,hasSomeViewAccess:Boolean,contactEmail:String,piwikVersion:String},components:{Passthrough:qs},directives:{ExpandOnHover:jt},computed:{updateNowText(){let e="";if(this.isMultiServerEnvironment){const t=ae(`https://builds.matomo.org/matomo-${this.latestVersionAvailable}.zip`);e=a("CoreHome_OneClickUpdateNotPossibleAsMultiServerEnvironment",`builds.matomo.org`)}else e=a("General_PiwikXIsAvailablePleaseUpdateNow",this.latestVersionAvailable||"",'
',"",re("https://matomo.org/changelog/"),"");return e+"
"},updateAvailableText(){const e=a("General_NewUpdatePiwikX",this.latestVersionAvailable||""),t=re("https://matomo.org/")+"Matomo",o=re("https://matomo.org/changelog/"),i=a("General_PiwikXIsAvailablePleaseNotifyPiwikAdmin",`${t} ${o}${this.latestVersionAvailable}`,``,"");return i+"
"}}});oc.render=tc;var ic=oc;const nc={id:"mobile-left-menu",class:"sidenav hide-on-large-only"},ac={class:"collapsible collapsible-accordion"},rc={class:"collapsible-header"},sc={class:"collapsible-body"},lc=["title","href"];function cc(e,t,o,i,n,a){const r=Object(E["resolveDirective"])("side-nav");return Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",nc,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.menuWithSubmenuItems,(t,o)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{class:"no-padding",key:o},[Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",ac,[Object(E["createElementVNode"])("li",null,[Object(E["createElementVNode"])("a",rc,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.translateOrDefault(o)),1),Object(E["createElementVNode"])("i",{class:Object(E["normalizeClass"])(t._icon||"icon-chevron-down")},null,2)]),Object(E["createElementVNode"])("div",sc,[Object(E["createElementVNode"])("ul",null,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(Object.entries(t).filter(([e])=>"_"!==e[0]),([t,o])=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:t},[Object(E["createElementVNode"])("a",{title:o._tooltip?e.translateIfNecessary(o._tooltip):"",target:"_self",href:e.getMenuUrl(o._url)},Object(E["toDisplayString"])(e.translateIfNecessary(t)),9,lc)]))),128))])])])])),[[r,{activator:e.activateLeftMenu}]])]))),128))])}const{$:dc}=window;var uc=Object(E["defineComponent"])({props:{menu:{type:Object,required:!0}},directives:{SideNav:Bt},methods:{getMenuUrl(e){return"?"+H.stringify(Object.assign(Object.assign({},H.urlParsed.value),e))},translateIfNecessary(e){return e.includes("_")?a(e):e}},computed:{menuWithSubmenuItems(){const e=this.menu||{};return Object.fromEntries(Object.entries(e).filter(([,e])=>{const t=Object.entries(e).filter(([e])=>"_"!==e[0]);return Object.keys(t).length}))},activateLeftMenu(){return dc("nav .activateLeftMenu")[0]}}});uc.render=cc;var mc=uc; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const{$:pc}=window;function hc(e){pc.scrollTo(e,20)}function gc(e){e&&e.preventDefault()}function bc(e,t){var o,i;if(!e)return;if(-1!==e.indexOf("&"))return;let n=null;try{n=pc("#"+e)}catch(a){return}if(null!==(o=n)&&void 0!==o&&o.length)return hc(n),void gc(t);n=pc(`a[name=${e}]`),null!==(i=n)&&void 0!==i&&i.length&&(hc(n),gc(t))}function fc(e,t){return(!e||!e.origin||-1!==t.indexOf(e.origin))&&((!e||!e.pathname||-1!==t.indexOf(e.pathname))&&(!e||!e.search||-1!==t.indexOf(e.search)))}function vc(){if("#/"===window.location.hash.slice(0,2)){const e=window.location.hash.slice(2);bc(e,null)}}function Oc(){Object(E["watch"])(()=>H.url.value,(e,t)=>{if(!e)return;const o=e.href.indexOf("#/");if(-1===o)return;if(t&&!fc(t,e.href))return;const i=e.href.slice(o+2);bc(i,null)})}function jc(){Object(E["nextTick"])(vc)} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */function yc(e){const t=[];if("INPUT"===e.tagName&&"password"===e.type)t.push(e);else{const o=e.querySelectorAll('input[type="password"]');o.forEach(e=>t.push(e))}return t}function wc(e,t){let o,i=e.value;const n=()=>{e.value="",e.dispatchEvent(new Event("input"))},a=()=>{o&&clearTimeout(o),o=setTimeout(n,1e3*t)},r=()=>a(),s=()=>a();e.addEventListener("input",r),e.addEventListener("change",s),e.dataset.autoClearEnabled="true";const l=setInterval(()=>{e.value!==i&&(i=e.value,a())},300);e.onUmounted={cleanup(){clearTimeout(o),clearInterval(l),e.removeEventListener("input",r),e.removeEventListener("change",s),delete e.dataset.autoClearEnabled}}}Oc(),pc(vc);var Sc={mounted(e,t){const o=t.value&&t.value.delay||600,i=yc(e);i.forEach(e=>wc(e,o))},unmounted(e){const t=yc(e);t.forEach(e=>{e.onUmounted&&"function"===typeof e.onUmounted.cleanup&&(e.onUmounted.cleanup(),delete e.onUmounted)})}};const kc={key:0,class:"password-strength row"};function Cc(e,t,o,i,n,a){return e.rules.length?(Object(E["openBlock"])(),Object(E["createElementBlock"])("ul",kc,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.rules,t=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:t.ruleText,class:Object(E["normalizeClass"])("col s12 xl6 rule rule-"+e.ruleStatus(t))},[Object(E["createElementVNode"])("span",{class:Object(E["normalizeClass"])({icon:!0,"icon-ok":"valid"===e.ruleStatus(t),"icon-close":"invalid"===e.ruleStatus(t),"icon-circle":"undefined"===e.ruleStatus(t)})},null,2),Object(E["createTextVNode"])(" "+Object(E["toDisplayString"])(t.ruleText),1)],2))),128))])):Object(E["createCommentVNode"])("",!0)}var Ec=Object(E["defineComponent"])({props:{validationRules:{type:Array,required:!0},password:{type:String,default:""},externalInputSelector:{type:String,default:""}},data(){return{pwd:"",rules:[]}},emits:["check:isValid"],watch:{pwdValue:{immediate:!0,handler(e){const t=[];this.rules.forEach(o=>{if(e.length||"undefined"===typeof o.passed)try{const i=new RegExp(o.validationRegex.replace(/^\/|\/$/g,""));i.test(e)?(o.passed=!0,t.push(!0)):o.passed=!1}catch(i){console.log("Invalid password validation pattern:",i)}else delete o.passed}),this.rules.length>0&&t.length===this.rules.length&&this.$emit("check:isValid",!0)}}},computed:{pwdValue(){var e;return null!==(e=this.externalInputSelector)&&void 0!==e&&e.length?this.pwd:this.password}},mounted(){var e;if(this.rules=this.validationRules.length?this.validationRules.map(e=>Object.assign({},e)):[],null!==(e=this.externalInputSelector)&&void 0!==e&&e.length){const e=document.querySelector(this.externalInputSelector);e&&(e.addEventListener("input",this.handleExternalInput),this.pwd=e.value)}},unmounted(){var e;if(null!==(e=this.externalInputSelector)&&void 0!==e&&e.length){const e=document.querySelector(this.externalInputSelector);e&&e.removeEventListener("input",this.handleExternalInput)}},methods:{ruleStatus(e){return"undefined"===typeof e.passed?"undefined":e.passed?"valid":"invalid"},handleExternalInput(e){const t=e.target;this.pwd=t.value}}});Ec.render=Cc;var Dc=Ec; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */const Pc={class:"main-duplicator-modal-content"},Tc={class:"modal-header"},Vc=Object(E["createElementVNode"])("span",{class:"btn-close modal-close"},[Object(E["createElementVNode"])("i",{class:"icon-close"})],-1),Nc={key:0,class:"modal-sub-header"},xc={class:"loading-message"},Bc={key:0,class:"modal-sub-header"},Mc=["innerHTML"],Ic={class:"modal-content"},Fc={class:"modal-inputs"},Lc={class:"modal-sub-footer"},Ac=["innerHTML"],_c=["innerHTML"],Rc={class:"modal-footer"},Hc=["disabled"];function $c(e,t,o,i,n,a){const r=Object(E["resolveComponent"])("MatomoLoader"),s=Object(E["resolveComponent"])("Field"),l=Object(E["resolveDirective"])("form");return Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{class:Object(E["normalizeClass"])({modal:!0,"entity-duplicator-modal":!0,"slot-configured":e.$slots.default}),ref:"root"},[Object(E["withDirectives"])(Object(E["createElementVNode"])("div",Pc,[Object(E["createElementVNode"])("div",Tc,[Vc,Object(E["createElementVNode"])("h2",null,Object(E["toDisplayString"])(e.getModalTitle),1)]),e.isLoading?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Nc,[Object(E["createVNode"])(r),Object(E["createElementVNode"])("span",xc,Object(E["toDisplayString"])(e.translate("General_Loading")),1)])):(Object(E["openBlock"])(),Object(E["createElementBlock"])(E["Fragment"],{key:1},[e.hideSiteSelector?Object(E["createCommentVNode"])("",!0):(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Bc,[Object(E["createElementVNode"])("p",null,[Object(E["createTextVNode"])(Object(E["toDisplayString"])(e.getDuplicateDescription)+" ",1),e.descriptionLearnMoreLink?(Object(E["openBlock"])(),Object(E["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.getLearnMoreLink)},null,8,Mc)):Object(E["createCommentVNode"])("",!0)]),Object(E["createVNode"])(s,{uicontrol:"site",name:"siteSelector",title:e.translate("CoreHome_ChooseWebsite"),modelValue:e.destinationSite,"onUpdate:modelValue":t[0]||(t[0]=t=>e.destinationSite=t),"ui-control-attributes":{onlySitesWithAtLeastWriteAccess:!0,siteTypesToExclude:["rollup"]}},null,8,["title","modelValue"])])),Object(E["createElementVNode"])("div",Ic,[Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("div",Fc,[Object(E["renderSlot"])(e.$slots,"default")])),[[l]])]),Object(E["createElementVNode"])("div",Lc,[e.duplicationErrors.length>0?(Object(E["openBlock"])(),Object(E["createElementBlock"])("div",{key:0,class:Object(E["normalizeClass"])({alert:!0,"alert-danger":!0,"error-list":e.duplicationErrors.length>1})},[Object(E["createElementVNode"])("ul",null,[(Object(E["openBlock"])(!0),Object(E["createElementBlock"])(E["Fragment"],null,Object(E["renderList"])(e.duplicationErrors,(t,o)=>(Object(E["openBlock"])(),Object(E["createElementBlock"])("li",{key:o,innerHTML:e.$sanitize(t)},null,8,Ac))),128))])],2)):Object(E["createCommentVNode"])("",!0),Object(E["createElementVNode"])("p",{class:"note-text",innerHTML:e.$sanitize(e.getNoteText)},null,8,_c)]),Object(E["createElementVNode"])("div",Rc,[Object(E["withDirectives"])(Object(E["createVNode"])(r,null,null,512),[[E["vShow"],e.hasBeenSubmitted]]),Object(E["createElementVNode"])("button",{class:"btn",disabled:!e.getIsValid||e.hasBeenSubmitted,onClick:t[1]||(t[1]=t=>e.submitRequest())},Object(E["toDisplayString"])(e.translate("General_Copy")),9,Hc)])],64))],512),[[E["vShow"],e.isModalVisible]])],2)}const Uc=ve("CorePluginsAdmin","Field"),qc=ve("CorePluginsAdmin","Form"),{$:Wc}=window;var zc=Object(E["defineComponent"])({directives:{Form:qc},components:{Field:Uc,MatomoLoader:Le},props:{modalStore:{type:Object,required:!0},hideSiteSelector:{type:Boolean,default:!1},descriptionLearnMoreLink:{type:String,default:""}},data(){return{isLoading:!0,isValidated:!1,duplicationErrors:[],destinationSite:null,hasBeenSubmitted:!1}},watch:{isModalVisible(e){if(!e)return;let t;this.modalStore.adapter.beforeShowModal&&(t=this.modalStore.adapter.beforeShowModal()),t&&"undefined"!==typeof t||(t=new Promise(e=>e())),this.showModal(),t.then(()=>{this.isLoading=!1})},destinationSite(){this.isValidated=!1}},methods:{closeModal(){const e=this.$refs.root,t=Wc(e);t.modal("close")},resetModal(){this.modalStore.hideModal(),this.destinationSite=null,this.isLoading=!0,this.isValidated=!1,this.duplicationErrors=[],this.hasBeenSubmitted=!1},showModal(){const e=this.$refs.root,t=Wc(e);t.modal({dismissible:!0,onCloseEnd:()=>{this.resetModal()}}).modal("open")},submitRequest(){this.hasBeenSubmitted=!0,this.getValidationResultPromise().then(e=>{var t;if(!e.isValid&&e.errorMessages.length>0)return this.isValidated=!0,this.hasBeenSubmitted=!1,void(this.duplicationErrors=e.errorMessages);const o=this.modalStore.adapter.prepareApiParams(this.modalStore.getFormValues(null===(t=this.destinationSite)||void 0===t?void 0:t.id));this.modalStore.adapter.submitRequest(o).then(e=>{e&&e.success?(this.modalStore.adapter.onSuccess&&this.modalStore.adapter.onSuccess(e),this.closeModal()):this.setErrorMessages(e)}).catch(e=>{this.setErrorMessages(),this.modalStore.adapter.onFailure&&this.modalStore.adapter.onFailure(e),console.log("Unexpected server error during request.",e)}).finally(()=>{this.hasBeenSubmitted=!1})})},getValidationResultPromise(){var e;this.duplicationErrors=[];const t=this.modalStore.adapter.validateFormFields(this.modalStore.getFormValues(null===(e=this.destinationSite)||void 0===e?void 0:e.id));return"isValid"in t?new Promise(e=>e(t)):t},setErrorMessages(e=null){let t=(null===e||void 0===e?void 0:e.message)||"";t&&0!==t.length||(t=a("General_ErrorRequest","","")),this.duplicationErrors=[],this.duplicationErrors.push(t)}},mounted(){Object(E["watch"])(()=>this.modalStore.state.entityFormData,()=>{this.isValidated=!1},{deep:!0})},computed:{isModalVisible(){var e;return null!==(e=this.modalStore.state.isModalVisible)&&void 0!==e&&e},getModalTitle(){return a("CoreHome_CopyX",this.modalStore.getEntityTypeTranslation)},getNoteText(){const e=a("CoreHome_CopyModalNote","","",this.modalStore.getEntityTypeTranslation);return""+e},getDuplicateDescription(){return a("CoreHome_CopyXDescription",this.modalStore.getEntityTypeTranslation)},getLearnMoreLink(){if(!this.descriptionLearnMoreLink)return"";const e=re(this.descriptionLearnMoreLink);return a("CoreHome_LearnMoreFullStop",e,"")},getIsValid(){return!this.isValidated||Array.isArray(this.duplicationErrors)&&0===this.duplicationErrors.length}}});zc.render=$c;var Gc=zc;const Yc=["title","aria-disabled"];function Jc(e,t,o,i,n,a){const r=Object(E["resolveDirective"])("tooltips");return Object(E["withDirectives"])((Object(E["openBlock"])(),Object(E["createElementBlock"])("a",{class:Object(E["normalizeClass"])([{"entity-duplicator-action":!0,"table-action":!0,"icon-content-copy":!0,"is-disabled":!e.isActionEnabled},e.extraClasses]),title:e.getActionTooltip,"aria-disabled":!e.isActionEnabled,onClick:t[0]||(t[0]=t=>!e.isActionEnabled||e.handleClick())},null,10,Yc)),[[r],[E["vShow"],e.isActionVisible]])}var Kc=Object(E["defineComponent"])({props:{actionFormData:{type:Object,required:!0},modalStore:{type:Object,required:!0},isActionVisible:{type:Boolean,required:!0},isActionEnabled:{type:Boolean,default:!1},tooltipTextOverride:{type:String,default:""},tooltipTextOverrideDisabled:{type:String,default:""},extraClasses:{type:[String,Array,Object],default:""}},directives:{Tooltips:tt},methods:{handleClick(){this.modalStore.showModal(this.actionFormData)}},computed:{getActionTooltip(){return this.isActionEnabled&&this.tooltipTextOverride.length?r(this.tooltipTextOverride):!this.isActionEnabled&&this.tooltipTextOverrideDisabled.length?r(this.tooltipTextOverrideDisabled):a("CoreHome_CopyX",this.modalStore.getEntityTypeTranslation)}}});Kc.render=Jc;var Qc=Kc;function Xc(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class Zc{constructor(e){Xc(this,"module",void 0),Xc(this,"method",void 0),Xc(this,"format",void 0),Xc(this,"requiredFields",void 0),this.module=e.module||"API",this.method=e.method,this.format=e.format||"json",this.requiredFields=e.requiredFields||["idSite","idDestinationSites"]}async validateFormFields(e){const t=[];return this.requiredFields.forEach(o=>{o in e&&e[o]||t.push(a("General_Required",o))}),new Promise(e=>e({errorMessages:t,isValid:0===t.length}))}prepareApiParams(e){return Object.assign({idSite:M.idSite||H.parsed.value.idSite,idDestinationSites:[e.idDestinationSite]},e)}async submitRequest(e){this.module=e.module||this.module,this.method=e.method||this.method,this.format=e.format||this.format;const t=e;if(!this.method||this.method.length<1)throw new Error("The POST method cannot be empty!");const o=new K;return o.useCallbackInCaseOfError(),o.setErrorCallback(null),o.removeDefaultParameter("date"),o.removeDefaultParameter("period"),o.removeDefaultParameter("segment"),o.addParams({module:this.module,method:this.method,format:this.format},"GET"),o.addParams(t,"POST"),o.setFormat(this.format),o.send()}onSuccess(e){let t=new Promise(e=>e());this.onSuccessCallback&&(t=this.onSuccessCallback(e)),t.then(()=>{setTimeout(()=>{const t=ki.show({message:e.message,context:e.success?"success":"error",type:"toast",id:"entityDuplicationResult"});ki.scrollToNotification(t)})})}}function ed(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */class td{constructor(e,t,o){ed(this,"state",Object(E["reactive"])({isModalVisible:!1,commonFormData:{},entityFormData:{},entityTypeTranslation:""})),ed(this,"adapter",void 0),this.state.entityTypeTranslation=e,this.adapter="validateFormFields"in t?t:new Zc(t),this.state.commonFormData=null!==o&&void 0!==o?o:{}}static buildStoreInstance(e,t,o){return Object(E["reactive"])(new td(e,t,o))}showModal(e){this.resetFormData(),Object.entries(null!==e&&void 0!==e?e:{}).forEach(([e,t])=>{this.state.entityFormData[e]=t}),this.state.isModalVisible=!0}hideModal(){this.state.isModalVisible=!1,this.resetFormData()}resetFormData(){Object.keys(this.state.entityFormData).forEach(e=>{delete this.state.entityFormData[e]})}getFormValues(e){const t=Array.isArray(e)?e:[];return e&&!Array.isArray(e)&&t.push(e),Object.assign(Object.assign({idSite:M.idSite||H.parsed.value.idSite,idDestinationSites:t},this.state.commonFormData),this.state.entityFormData)}get getEntityTypeTranslation(){let e="CoreHome_ReportLowercase";return this.state.entityTypeTranslation&&(e=this.state.entityTypeTranslation),r(e)}} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */}})})); //# sourceMappingURL=CoreHome.umd.min.js.map