diff options
17 files changed, 1326 insertions, 279 deletions
diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.js b/plugins/CoreHome/vue/dist/CoreHome.umd.js index 8dcae0bb73..c9d3dc26e6 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.js @@ -11551,34 +11551,37 @@ Sparklinevue_type_script_lang_ts.render = Sparklinevue_type_template_id_693cd955 directiveName: 'piwikSparkline', restrict: 'E' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Progressbar/Progressbar.vue?vue&type=template&id=086b2ffe +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Progressbar/Progressbar.vue?vue&type=template&id=0048ddd7 -var Progressbarvue_type_template_id_086b2ffe_hoisted_1 = { +var Progressbarvue_type_template_id_0048ddd7_hoisted_1 = { class: "progressbar" }; -var Progressbarvue_type_template_id_086b2ffe_hoisted_2 = { +var Progressbarvue_type_template_id_0048ddd7_hoisted_2 = { class: "progress" }; -var Progressbarvue_type_template_id_086b2ffe_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { - src: "plugins/Morpheus/images/loading-blue.gif" +var Progressbarvue_type_template_id_0048ddd7_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", { + src: "plugins/Morpheus/images/loading-blue.gif", + style: { + "margin-right": "3.5px" + } }, null, -1); -var Progressbarvue_type_template_id_086b2ffe_hoisted_4 = ["innerHTML"]; -function Progressbarvue_type_template_id_086b2ffe_render(_ctx, _cache, $props, $setup, $data, $options) { - return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Progressbarvue_type_template_id_086b2ffe_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Progressbarvue_type_template_id_086b2ffe_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { +var Progressbarvue_type_template_id_0048ddd7_hoisted_4 = ["innerHTML"]; +function Progressbarvue_type_template_id_0048ddd7_render(_ctx, _cache, $props, $setup, $data, $options) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", Progressbarvue_type_template_id_0048ddd7_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", Progressbarvue_type_template_id_0048ddd7_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: "determinate", style: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeStyle"])([{ "width": "0" }, { width: "".concat(_ctx.actualProgress, "%") }]) - }, null, 4)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Progressbarvue_type_template_id_086b2ffe_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + }, null, 4)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [Progressbarvue_type_template_id_0048ddd7_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "label", innerHTML: _ctx.$sanitize(_ctx.label) - }, null, 8, Progressbarvue_type_template_id_086b2ffe_hoisted_4)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !!_ctx.label]])]); + }, null, 8, Progressbarvue_type_template_id_0048ddd7_hoisted_4)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !!_ctx.label]])]); } -// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Progressbar/Progressbar.vue?vue&type=template&id=086b2ffe +// CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Progressbar/Progressbar.vue?vue&type=template&id=0048ddd7 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CoreHome/vue/src/Progressbar/Progressbar.vue?vue&type=script&lang=ts @@ -11610,7 +11613,7 @@ function Progressbarvue_type_template_id_086b2ffe_render(_ctx, _cache, $props, $ -Progressbarvue_type_script_lang_ts.render = Progressbarvue_type_template_id_086b2ffe_render +Progressbarvue_type_script_lang_ts.render = Progressbarvue_type_template_id_0048ddd7_render /* harmony default export */ var Progressbar = (Progressbarvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CoreHome/vue/src/Progressbar/Progressbar.adapter.ts diff --git a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js index 7764c289ce..d40ac67e69 100644 --- a/plugins/CoreHome/vue/dist/CoreHome.umd.min.js +++ b/plugins/CoreHome/vue/dist/CoreHome.umd.min.js @@ -510,7 +510,7 @@ window.angular.module("piwikApp.service").factory("reportMetadataModel",(functio * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -function Xs(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",reportFormats:"@",apiMethod:"@",maxFilterLimit:"@"},link:function(t,n){var r={instance:null,value:{reportTitle:t.reportTitle,requestParams:t.requestParams,reportFormats:"string"===typeof t.reportFormats?JSON.parse(t.reportFormats):t.reportFormats,apiMethod:t.apiMethod,maxFilterLimit:parseInt(t.maxFilterLimit,10),onClose:function(){e((function(){window.angular.element(document).injector().get("$rootScope").$apply()}),10)}},oldValue:null,modifiers:{},dir:{}};Ks.mounted(n[0],r)}}}Xs.$inject=["$timeout"],window.angular.module("piwikApp").directive("piwikReportExport",Xs);var Zs=["src"];function eu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("img",{src:e.sparklineUrl},null,8,Zs)}var tu=Object(a["defineComponent"])({props:{seriesIndices:Array,params:Object},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=S.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),i={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate},a=new Xe,o=a.mixinDefaultGetParams(Object.assign(Object.assign({},i),t)),l=Ce.parsed.value.token_auth;return l&&l.length&&S.shouldPropagateTokenAuth&&(o.token_auth=l),"?".concat(Ce.stringify(o))},defaultDate:function(){if("range"===S.period)return"".concat(S.startDateString,",").concat(S.endDateString);var e=_.getLastNRange(S.period,30,S.currentDateString).getDateRange(),t=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay);e[0]<t&&(e[0]=t);var n=E(e[0]),r=E(e[1]);return"".concat(n,",").concat(r)}}});tu.render=eu;var nu=tu,ru=(jt({component:nu,scope:{seriesIndices:{angularJsBind:"<"},params:{angularJsBind:"<"}},directiveName:"piwikSparkline",restrict:"E"}),{class:"progressbar"}),iu={class:"progress"},au=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),ou=["innerHTML"]; +function Xs(e){return{restrict:"A",scope:{reportTitle:"@",requestParams:"@",reportFormats:"@",apiMethod:"@",maxFilterLimit:"@"},link:function(t,n){var r={instance:null,value:{reportTitle:t.reportTitle,requestParams:t.requestParams,reportFormats:"string"===typeof t.reportFormats?JSON.parse(t.reportFormats):t.reportFormats,apiMethod:t.apiMethod,maxFilterLimit:parseInt(t.maxFilterLimit,10),onClose:function(){e((function(){window.angular.element(document).injector().get("$rootScope").$apply()}),10)}},oldValue:null,modifiers:{},dir:{}};Ks.mounted(n[0],r)}}}Xs.$inject=["$timeout"],window.angular.module("piwikApp").directive("piwikReportExport",Xs);var Zs=["src"];function eu(e,t,n,r,i,o){return Object(a["openBlock"])(),Object(a["createElementBlock"])("img",{src:e.sparklineUrl},null,8,Zs)}var tu=Object(a["defineComponent"])({props:{seriesIndices:Array,params:Object},data:function(){return{isWidget:!1}},mounted:function(){this.isWidget=!!this.$el.closest("[widgetId]")},computed:{sparklineUrl:function(){var e=this.seriesIndices,t=this.params,n=S.getSparklineColors();e&&(n.lineColor=n.lineColor.filter((function(t,n){return-1!==e.indexOf(n)})));var r=JSON.stringify(n),i={forceView:"1",viewDataTable:"sparkline",widget:this.isWidget?"1":"0",showtitle:"1",colors:r,random:Date.now(),date:this.defaultDate},a=new Xe,o=a.mixinDefaultGetParams(Object.assign(Object.assign({},i),t)),l=Ce.parsed.value.token_auth;return l&&l.length&&S.shouldPropagateTokenAuth&&(o.token_auth=l),"?".concat(Ce.stringify(o))},defaultDate:function(){if("range"===S.period)return"".concat(S.startDateString,",").concat(S.endDateString);var e=_.getLastNRange(S.period,30,S.currentDateString).getDateRange(),t=new Date(S.minDateYear,S.minDateMonth-1,S.minDateDay);e[0]<t&&(e[0]=t);var n=E(e[0]),r=E(e[1]);return"".concat(n,",").concat(r)}}});tu.render=eu;var nu=tu,ru=(jt({component:nu,scope:{seriesIndices:{angularJsBind:"<"},params:{angularJsBind:"<"}},directiveName:"piwikSparkline",restrict:"E"}),{class:"progressbar"}),iu={class:"progress"},au=Object(a["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif",style:{"margin-right":"3.5px"}},null,-1),ou=["innerHTML"]; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CoreHome/vue/src/Progressbar/Progressbar.vue b/plugins/CoreHome/vue/src/Progressbar/Progressbar.vue index 25dfc97b94..985c44dc92 100644 --- a/plugins/CoreHome/vue/src/Progressbar/Progressbar.vue +++ b/plugins/CoreHome/vue/src/Progressbar/Progressbar.vue @@ -14,7 +14,7 @@ /> </div> <span v-show="!!label"> - <img src="plugins/Morpheus/images/loading-blue.gif" /> + <img src="plugins/Morpheus/images/loading-blue.gif" style="margin-right: 3.5px" /> <span class="label" v-html="$sanitize(label)" /> </span> </div> diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js index e492932d9c..37744fc046 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.js @@ -150,7 +150,7 @@ var external_CoreHome_ = __webpack_require__("19dc"); // EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=template&id=06a43882 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=template&id=b3ece69c var _hoisted_1 = { class: "form-group row matomo-form-field" @@ -193,11 +193,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) { }]) }, [_ctx.showFormHelp ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: "form-description" - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formField.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.formField.description]]), _ctx.formField.inlineHelp ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_4, [_ctx.inlineHelpComponent ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDynamicComponent"])(_ctx.inlineHelpComponent), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeProps"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.formField.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.formField.description]]), _ctx.formField.inlineHelp || _ctx.hasInlineHelpSlot ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_4, [_ctx.inlineHelpComponent ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDynamicComponent"])(_ctx.inlineHelpComponent), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeProps"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["mergeProps"])({ key: 0 - }, _ctx.inlineHelpBind)), null, 16)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Default')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.defaultValuePrettyTruncated), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showDefaultValue]])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showField]]); + }, _ctx.inlineHelpBind)), null, 16)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "inline-help")], 512)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Default')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.defaultValuePrettyTruncated), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showDefaultValue]])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showField]]); } -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=template&id=06a43882 +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue?vue&type=template&id=b3ece69c // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/FormField/FieldCheckbox.vue?vue&type=template&id=3ee04378 @@ -1939,7 +1939,7 @@ var CONTROL_TO_AVAILABLE_OPTION_PROCESSOR = { return {}; }, showFormHelp: function showFormHelp() { - return this.formField.description || this.formField.inlineHelp || this.showDefaultValue; + return this.formField.description || this.formField.inlineHelp || this.showDefaultValue || this.hasInlineHelpSlot; }, showDefaultValue: function showDefaultValue() { return this.defaultValuePretty && this.formField.uiControl !== 'checkbox' && this.formField.uiControl !== 'radio'; @@ -2040,6 +2040,16 @@ var CONTROL_TO_AVAILABLE_OPTION_PROCESSOR = { }, defaultValuePrettyTruncated: function defaultValuePrettyTruncated() { return this.defaultValuePretty.substring(0, 50); + }, + hasInlineHelpSlot: function hasInlineHelpSlot() { + var _inlineHelpSlot$, _inlineHelpSlot$$chil; + + if (!this.$slots['inline-help']) { + return false; + } + + var inlineHelpSlot = this.$slots['inline-help'](); + return !!(inlineHelpSlot !== null && inlineHelpSlot !== void 0 && (_inlineHelpSlot$ = inlineHelpSlot[0]) !== null && _inlineHelpSlot$ !== void 0 && (_inlineHelpSlot$$chil = _inlineHelpSlot$.children) !== null && _inlineHelpSlot$$chil !== void 0 && _inlineHelpSlot$$chil.length); } }, methods: { @@ -2183,9 +2193,9 @@ function conditionFn(scope, condition) { }, true); } })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=template&id=731fa155 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=template&id=91065bf4 -function Fieldvue_type_template_id_731fa155_render(_ctx, _cache, $props, $setup, $data, $options) { +function Fieldvue_type_template_id_91065bf4_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_FormField = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("FormField"); return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_FormField, { @@ -2194,9 +2204,14 @@ function Fieldvue_type_template_id_731fa155_render(_ctx, _cache, $props, $setup, "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) { return _ctx.onChange($event); }) - }, null, 8, ["form-field", "model-value"]); + }, { + "inline-help": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderSlot"])(_ctx.$slots, "inline-help")]; + }), + _: 3 + }, 8, ["form-field", "model-value"]); } -// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=template&id=731fa155 +// CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=template&id=91065bf4 // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/CorePluginsAdmin/vue/src/Field/Field.vue?vue&type=script&lang=ts @@ -2308,7 +2323,7 @@ var UI_CONTROLS_TO_TYPE = { -Fieldvue_type_script_lang_ts.render = Fieldvue_type_template_id_731fa155_render +Fieldvue_type_script_lang_ts.render = Fieldvue_type_template_id_91065bf4_render /* harmony default export */ var Field = (Fieldvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/CorePluginsAdmin/vue/src/Field/Field.adapter.ts diff --git a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js index 3d8b0e2cb3..69bc5fab2f 100644 --- a/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js +++ b/plugins/CorePluginsAdmin/vue/dist/CorePluginsAdmin.umd.min.js @@ -1,28 +1,28 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CorePluginsAdmin"]=t(require("CoreHome"),require("vue")):e["CorePluginsAdmin"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CorePluginsAdmin/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"FormField",(function(){return qt})),n.d(t,"Field",(function(){return Qt})),n.d(t,"PluginSettings",(function(){return Tn})),n.d(t,"PluginFilter",(function(){return no})),n.d(t,"PluginManagement",(function(){return Hn})),n.d(t,"PluginUpload",(function(){return Kn})),n.d(t,"SaveButton",(function(){return uo})),n.d(t,"Form",(function(){return mo})),n.d(t,"GroupedSettings",(function(){return wn})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var i=n("19dc"),l=n("8bbf"),a={class:"form-group row matomo-form-field"},u={key:0,class:"col s12"},c={key:0,class:"form-help"},s={key:0,class:"inline-help",ref:"inlineHelp"},d=Object(l["createElementVNode"])("br",null,null,-1);function m(e,t,n,o,r,i){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",a,[e.formField.introduction?(Object(l["openBlock"])(),Object(l["createElementBlock"])("h3",u,Object(l["toDisplayString"])(e.formField.introduction),1)):Object(l["createCommentVNode"])("",!0),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{"input-field":"checkbox"!==e.formField.uiControl&&"radio"!==e.formField.uiControl,"file-field":"file"===e.formField.uiControl,m6:!e.formField.fullWidth}])},[(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.childComponent),Object(l["mergeProps"])(Object.assign(Object.assign({formField:e.formField},e.formField),{},{modelValue:e.processedModelValue,availableOptions:e.availableOptions},e.extraChildComponentParams),{"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})}),null,16))],2),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{m6:!e.formField.fullWidth}])},[e.showFormHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",c,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",{class:"form-description"},Object(l["toDisplayString"])(e.formField.description),513),[[l["vShow"],e.formField.description]]),e.formField.inlineHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",s,[e.inlineHelpComponent?(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.inlineHelpComponent),Object(l["normalizeProps"])(Object(l["mergeProps"])({key:0},e.inlineHelpBind)),null,16)):Object(l["createCommentVNode"])("",!0)],512)):Object(l["createCommentVNode"])("",!0),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[d,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Default"))+": ",1),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.defaultValuePrettyTruncated),1)],512),[[l["vShow"],e.showDefaultValue]])])):Object(l["createCommentVNode"])("",!0)],2)],512)),[[l["vShow"],e.showField]])}var f={class:"checkbox"},p=["checked","id","name"],b=["innerHTML"];function v(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",f,[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes,{value:1,checked:!!e.modelValue,type:"checkbox",id:e.name,name:e.name}),null,16,p),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.title)},null,8,b)])])}var h=Object(l["defineComponent"])({props:{modelValue:[Boolean,Number],uiControlAttributes:Object,name:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.modelValue!==e.target.checked&&this.$emit("update:modelValue",e.target.checked)}}});h.render=v;var g=h,O=["value","checked","onChange","id","name"];function y(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n,class:"checkbox"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:t.key,checked:!!e.checkboxStates[n],onChange:function(t){return e.onChange(n)}},e.uiControlAttributes,{type:"checkbox",id:"".concat(e.name).concat(t.key),name:t.name}),null,16,O),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(t.description),513),[[l["vShow"],t.description]])])])})),128))])}function j(e){return S(e)||C(e)||w(e)||V()}function V(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e,t){if(e){if("string"===typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function C(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function S(e){if(Array.isArray(e))return k(e)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function A(e,t){return(e||[]).map((function(e){return t&&-1!==t.indexOf(e.key)}))}var F=Object(l["defineComponent"])({props:{modelValue:Array,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,type:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{checkboxStates:function(){return A(this.availableOptions,this.modelValue)}},mounted:function(){window.Materialize.updateTextFields()},methods:{onChange:function(e){var t=j(this.checkboxStates);t[e]=!t[e];var n=this.availableOptions||{},o=[];Object.values(n).forEach((function(e,n){t[n]&&o.push(e.key)})),this.$emit("update:modelValue",o)}}});F.render=y;var B=F,E={class:"expandableSelector"},x=Object(l["createElementVNode"])("svg",{class:"caret",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},[Object(l["createElementVNode"])("path",{d:"M7 10l5 5 5-5z"}),Object(l["createElementVNode"])("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),N=["value"],T={class:"expandableList z-depth-2"},$={class:"searchContainer"},M={class:"collection firstLevel"},P=["onClick"],J={class:"collection secondLevel"},H=["onClick"],D={class:"primary-content"},L=["title"];function I(e,t,n,o,r,i){var a=Object(l["resolveDirective"])("focus-if"),u=Object(l["resolveDirective"])("focus-anywhere-but-here");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",E,[Object(l["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(t){return e.showSelect=!e.showSelect}),class:"select-wrapper"},[x,Object(l["createElementVNode"])("input",{type:"text",class:"select-dropdown",readonly:"readonly",value:e.modelValueText},null,8,N)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",T,[Object(l["createElementVNode"])("div",$,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"text",placeholder:"Search","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),class:"expandableSearch browser-default"},null,512),[[l["vModelText"],e.searchTerm],[a,e.showSelect]])]),Object(l["createElementVNode"])("ul",M,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"collection-item",key:n},[Object(l["createElementVNode"])("h4",{class:"expandableListCategory",onClick:function(n){return e.onCategoryClicked(t)}},[Object(l["createTextVNode"])(Object(l["toDisplayString"])(t.group)+" ",1),Object(l["createElementVNode"])("span",{class:Object(l["normalizeClass"])(["secondary-content",{"icon-arrow-right":e.showCategory!==t.group,"icon-arrow-bottom":e.showCategory===t.group}])},null,2)],8,P),Object(l["withDirectives"])(Object(l["createElementVNode"])("ul",J,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})),(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"expandableListItem collection-item valign-wrapper",key:t.key,onClick:function(n){return e.onValueClicked(t)}},[Object(l["createElementVNode"])("span",D,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{title:t.tooltip,class:"secondary-content icon-help"},null,8,L),[[l["vShow"],t.tooltip]])],8,H)})),128))],512),[[l["vShow"],e.showCategory===t.group||e.searchTerm]])],512)),[[l["vShow"],t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})).length]])})),128))])],512),[[l["vShow"],e.showSelect]])],512)),[[u,{blur:e.onBlur}]])}function z(e){var t=[];if(!e)return t;var n={};return Object.values(e).forEach((function(e){var t=e,o=t.group||"";o in n&&n[o]||(n[o]={values:[],group:o});var r={key:t.key,value:t.value};"tooltip"in t&&t.tooltip&&(r.tooltip=t.tooltip),n[o].values.push(r)})),Object.values(n).forEach((function(e){e.values.length&&t.push(e)})),t}var U=Object(l["defineComponent"])({props:{modelValue:[Number,String],availableOptions:Array,title:String},directives:{FocusAnywhereButHere:i["FocusAnywhereButHere"],FocusIf:i["FocusIf"]},inheritAttrs:!1,emits:["update:modelValue"],data:function(){return{showSelect:!1,searchTerm:"",showCategory:""}},computed:{modelValueText:function(){if(this.title)return this.title;var e,t=this.modelValue,n=this.availableOptions||[];return n.some((function(n){return e=n.values.find((function(e){return e.key===t})),e})),e?e.value?"".concat(e.value):"":t?"".concat(t):""}},methods:{onBlur:function(){this.showSelect=!1},onCategoryClicked:function(e){this.showCategory===e.group?this.showCategory="":this.showCategory=e.group},onValueClicked:function(e){this.$emit("update:modelValue",e.key),this.showSelect=!1}}});U.render=I;var K=U,_=["for","innerHTML"];function q(e,t,n,o,r,i){var a=Object(l["resolveComponent"])("FieldArray");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,_),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onValueUpdate(t)}),field:e.uiControlAttributes.field},null,8,["name","model-value","field"])])}var R=Object(l["defineComponent"])({components:{FieldArray:i["FieldArray"]},props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onValueUpdate:function(e){this.$emit("update:modelValue",e)}}});R.render=q;var G=R,W={class:"btn"},Z=["for","innerHTML"],Y=["name","id"],Q={class:"file-path-wrapper"},X=["value"];function ee(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("div",W,[Object(l["createElementVNode"])("span",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Z),Object(l["createElementVNode"])("input",{ref:"fileInput",name:e.name,type:"file",id:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,Y)]),Object(l["createElementVNode"])("div",Q,[Object(l["createElementVNode"])("input",{class:"file-path validate",value:e.filePath,type:"text"},null,8,X)])])}var te=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:[String,File]},inheritAttrs:!1,emits:["update:modelValue"],watch:{modelValue:function(e){if(!e||""===e){var t=this.$refs.fileInput;t.value=""}}},methods:{onChange:function(e){var t=e.target.files;if(t){var n=t.item(0);this.$emit("update:modelValue",n)}}},computed:{filePath:function(){if(this.modelValue instanceof File)return this.$refs.fileInput.value}}});te.render=ee;var ne=te,oe=["type","name","value"];function re(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("input",{type:e.uiControl,name:e.name,value:e.modelValue,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,oe)])}var ie=Object(l["defineComponent"])({props:{modelValue:null,uiControl:String,name:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});ie.render=re;var le=ie,ae={class:"fieldMultiTuple"},ue=["for","innerHTML"];function ce(e,t,n,o,r,i){var a=Object(l["resolveComponent"])("MultiPairField");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ae,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ue),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":e.onUpdateValue,field1:e.uiControlAttributes.field1,field2:e.uiControlAttributes.field2,field3:e.uiControlAttributes.field3,field4:e.uiControlAttributes.field4},null,8,["name","model-value","onUpdate:modelValue","field1","field2","field3","field4"])])}var se=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,components:{MultiPairField:i["MultiPairField"]},emits:["update:modelValue"],methods:{onUpdateValue:function(e){this.$emit("update:modelValue",e)}}});se.render=ce;var de=se,me=["type","id","name","value"],fe=["for","innerHTML"];function pe(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:(e.modelValue||"").toString(),onKeydown:t[0]||(t[0]=function(t){return e.onChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),null,16,me),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,fe)],64)}var be=Object(l["defineComponent"])({props:{uiControl:String,name:String,title:String,modelValue:[Number,String],uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onChange=Object(i["debounce"])(this.onChange.bind(this),50)},methods:{onChange:function(e){var t=parseFloat(e.target.value);this.$emit("update:modelValue",t)}},mounted:function(){window.Materialize.updateTextFields()},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}}});be.render=pe;var ve=be,he=["value","id","name","disabled","checked"];function ge(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions||[],(function(n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n.key,class:"radio"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:n.key,onChange:t[0]||(t[0]=function(t){return e.onChange(t)}),type:"radio",id:"".concat(e.name).concat(n.key),name:e.name,disabled:n.disabled||e.disabled},e.uiControlAttributes,{checked:e.modelValue===n.key||"".concat(e.modelValue)===n.key}),null,16,he),Object(l["createElementVNode"])("span",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(n.value)+" ",1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(n.description),513),[[l["vShow"],n.description]])])])])})),128))])}var Oe=Object(l["defineComponent"])({props:{title:String,availableOptions:Array,name:String,disabled:Boolean,uiControlAttributes:Object,modelValue:[String,Number]},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});Oe.render=ge;var ye=Oe;function je(e,t){return ke(e)||Se(e,t)||we(e,t)||Ve()}function Ve(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(e,t){if(e){if("string"===typeof e)return Ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Se(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(i.push(o.value),t&&i.length===t)break}catch(u){a=!0,r=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw r}}return i}}function ke(e){if(Array.isArray(e))return e}var Ae={key:0,class:"matomo-field-select"},Fe=["multiple","name"],Be=["label"],Ee=["value","selected","disabled"],xe=["for","innerHTML"],Ne={key:1,class:"matomo-field-select"},Te=["multiple","name"],$e=["value","selected","disabled"],Me=["for","innerHTML"];function Pe(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[e.groupedOptions?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Ae,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({ref:"select",class:"grouped",multiple:e.multiple,name:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.groupedOptions,(function(t){var n=je(t,2),o=n[0],r=n[1];return Object(l["openBlock"])(),Object(l["createElementBlock"])("optgroup",{key:o,label:o},[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(r,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(l["toDisplayString"])(t.value),9,Ee)})),128))],8,Be)})),128))],16,Fe),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.title},null,8,xe)])):Object(l["createCommentVNode"])("",!0),!e.groupedOptions&&e.options?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Ne,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({class:"ungrouped",ref:"select",multiple:e.multiple,name:e.name,onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.options,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(l["toDisplayString"])(t.value),9,$e)})),128))],16,Te),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.title},null,8,Me)])):Object(l["createCommentVNode"])("",!0)],64)}function Je(e){return Le(e)||De(e)||Ue(e)||He()}function He(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function De(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Le(e){if(Array.isArray(e))return Ke(e)}function Ie(e,t){return qe(e)||_e(e,t)||Ue(e,t)||ze()}function ze(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ue(e,t){if(e){if("string"===typeof e)return Ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ke(e,t):void 0}}function Ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function _e(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(i.push(o.value),t&&i.length===t)break}catch(u){a=!0,r=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw r}}return i}}function qe(e){if(Array.isArray(e))return e}function Re(e){return Re="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function Ge(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4?arguments[4]:void 0;if(e){var i=window.$(e);if(Array.from(e.options).forEach((function(e){e.selected=r?!!t&&-1!==t.indexOf(e.value.replace(/^string:/,"")):"string:".concat(t)===e.value})),i.formSelect(o),n){var l=i.closest(".select-wrapper").find("input");l.attr("placeholder",n)}}}function We(e){return!Array.isArray(e)&&"object"===Re(e)&&Object.values(e).some((function(e){return"object"===Re(e)}))}function Ze(e,t){return e.some((function(e){return e.key===t}))}function Ye(e,t,n){if(!e)return[];var o=!0,r=e;We(r)||(r={"":e},o=!1);var i=[];return Object.entries(r).forEach((function(e){var n=Ie(e,2),r=n[0],l=n[1];Object.entries(l).forEach((function(e){var n=Ie(e,2),l=n[0],a=n[1];if(a&&"object"===Re(a)&&"undefined"!==typeof a.key)i.push(a);else{var u=l;"integer"===t&&"string"===typeof l&&(u=parseInt(l,10)),i.push({group:o?r:void 0,key:u,value:a})}}))})),null!==n&&void 0!==n&&n.placeholder&&!Ze(i,"")?[{key:"",value:""}].concat(i):i}function Qe(e){return"string"===typeof e?e.replace(/^string:/,""):e}var Xe=Object(l["defineComponent"])({props:{modelValue:null,multiple:Boolean,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,uiControlOptions:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{options:function(){var e=this.availableOptions;return!e||Ze(e,"")||"undefined"!==typeof this.modelValue&&null!==this.modelValue&&""!==this.modelValue?e:[{key:"",value:this.modelValue,group:this.hasGroups?"":void 0}].concat(Je(e))},hasGroups:function(){var e=this.availableOptions;return e&&e[0]&&"undefined"!==typeof e[0].group},groupedOptions:function(){var e=this.options;if(!this.hasGroups||!e)return null;var t={};e.forEach((function(e){var n=e.group;t[n]=t[n]||[],t[n].push(e)}));var n=Object.entries(t);return n.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),n}},methods:{onChange:function(e){var t,n=this,o=e.target;this.multiple?(t=Array.from(o.options).filter((function(e){return e.selected})).map((function(e){return e.value})),t=t.map((function(e){return Qe(e)}))):(t=o.value,t=Qe(t)),this.$emit("update:modelValue",t),Object(l["nextTick"])((function(){n.modelValue!==t&&n.onModelValueChange(n.modelValue)}))},onModelValueChange:function(e){var t=this;window.$(this.$refs.select).val(e),setTimeout((function(){var n;Ge(t.$refs.select,e,null===(n=t.uiControlAttributes)||void 0===n?void 0:n.placeholder,t.uiControlOptions,t.multiple)}))}},watch:{modelValue:function(e){this.onModelValueChange(e)},"uiControlAttributes.disabled":{handler:function(e,t){var n=this;setTimeout((function(){var o;e!==t&&Ge(n.$refs.select,n.modelValue,null===(o=n.uiControlAttributes)||void 0===o?void 0:o.placeholder,n.uiControlOptions,n.multiple)}))}},availableOptions:function(e,t){var n=this;e!==t&&setTimeout((function(){var e;Ge(n.$refs.select,n.modelValue,null===(e=n.uiControlAttributes)||void 0===e?void 0:e.placeholder,n.uiControlOptions,n.multiple)}))}},mounted:function(){var e=this;setTimeout((function(){var t;Ge(e.$refs.select,e.modelValue,null===(t=e.uiControlAttributes)||void 0===t?void 0:t.placeholder,e.uiControlOptions,e.multiple)}))}});Xe.render=Pe;var et=Xe,tt=["for","innerHTML"],nt={class:"sites_autocomplete"};function ot(e,t,n,o,r,i){var a=Object(l["resolveComponent"])("SiteSelector");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,class:"siteSelectorLabel",innerHTML:e.$sanitize(e.title)},null,8,tt),Object(l["createElementVNode"])("div",nt,[Object(l["createVNode"])(a,Object(l["mergeProps"])({"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),id:e.name,"show-all-sites-item":e.uiControlAttributes.showAllSitesItem||!1,"switch-site-on-select":!1,"show-selected-site":!0,"only-sites-with-admin-access":e.uiControlAttributes.onlySitesWithAdminAccess||!1},e.uiControlAttributes),null,16,["model-value","id","show-all-sites-item","only-sites-with-admin-access"])])])}var rt=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{SiteSelector:i["SiteSelector"]},emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});rt.render=ot;var it=rt,lt=["type","id","name","value"],at=["for","innerHTML"];function ut(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)})},e.uiControlAttributes),null,16,lt),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,at)],64)}var ct=Object(l["defineComponent"])({props:{title:String,name:String,uiControlAttributes:Object,modelValue:[String,Number],uiControl:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{modelValueText:function(){return"undefined"===typeof this.modelValue||null===this.modelValue?"":this.modelValue.toString()}},created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},mounted:function(){setTimeout((function(){window.Materialize.updateTextFields()}))},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},methods:{onKeydown:function(e){var t=e.target.value;this.modelValue!==t&&this.$emit("update:modelValue",t)}}});ct.render=ut;var st=ct,dt=["for","innerHTML"],mt=["type","name","value"];function ft(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,dt),Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,name:e.name,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),value:e.concattedValues},e.uiControlAttributes),null,16,mt)])}var pt=Object(l["defineComponent"])({props:{name:String,title:String,uiControl:String,modelValue:Array,uiControlAttributes:Object},inheritAttrs:!1,computed:{concattedValues:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(", ")}},emits:["update:modelValue"],created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(",").map((function(e){return e.trim()}));t.join(", ")!==this.concattedValues&&this.$emit("update:modelValue",t)}}});pt.render=ft;var bt=pt,vt=["name","id","value"],ht=["for","innerHTML"];function gt(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({name:e.name},e.uiControlAttributes,{id:e.name,value:e.modelValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea",ref:"textarea"}),null,16,vt),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ht)],64)}var Ot=Object(l["defineComponent"])({props:{name:String,uiControlAttributes:Object,modelValue:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){this.$emit("update:modelValue",e.target.value)}},watch:{modelValue:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});Ot.render=gt;var yt=Ot,jt=["for","innerHTML"],Vt=["name","value"];function wt(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,jt),Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({ref:"textarea",name:e.name},e.uiControlAttributes,{value:e.concattedValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea"}),null,16,Vt)])}var Ct="\n",St=Object(l["defineComponent"])({props:{name:String,title:String,uiControlAttributes:Object,modelValue:[Array,String]},inheritAttrs:!1,emits:["update:modelValue"],computed:{concattedValue:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(Ct)}},created:function(){this.onKeydown=Object(i["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(Ct);t.join(Ct)!==this.concattedValue&&this.$emit("update:modelValue",t)}},watch:{modelValue:function(e,t){var n=this;e!==t&&setTimeout((function(){n.$refs.textarea&&window.Materialize.textareaAutoResize(n.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){e.$refs.textarea&&window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});St.render=wt;var kt=St;function At(e){return At="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(e)}function Ft(e,t){return Tt(e)||Nt(e,t)||Et(e,t)||Bt()}function Bt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Et(e,t){if(e){if("string"===typeof e)return xt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xt(e,t):void 0}}function xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Nt(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(i.push(o.value),t&&i.length===t)break}catch(u){a=!0,r=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw r}}return i}}function Tt(e){if(Array.isArray(e))return e} +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue")):"function"===typeof define&&define.amd?define(["CoreHome"],t):"object"===typeof exports?exports["CorePluginsAdmin"]=t(require("CoreHome"),require("vue")):e["CorePluginsAdmin"]=t(e["CoreHome"],e["Vue"])})("undefined"!==typeof self?self:this,(function(e,t){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/CorePluginsAdmin/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"FormField",(function(){return qt})),n.d(t,"Field",(function(){return Qt})),n.d(t,"PluginSettings",(function(){return Tn})),n.d(t,"PluginFilter",(function(){return no})),n.d(t,"PluginManagement",(function(){return Hn})),n.d(t,"PluginUpload",(function(){return Kn})),n.d(t,"SaveButton",(function(){return uo})),n.d(t,"Form",(function(){return mo})),n.d(t,"GroupedSettings",(function(){return wn})),"undefined"!==typeof window){var o=window.document.currentScript,i=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("19dc"),l=n("8bbf"),a={class:"form-group row matomo-form-field"},u={key:0,class:"col s12"},c={key:0,class:"form-help"},s={key:0,class:"inline-help",ref:"inlineHelp"},d=Object(l["createElementVNode"])("br",null,null,-1);function m(e,t,n,o,i,r){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",a,[e.formField.introduction?(Object(l["openBlock"])(),Object(l["createElementBlock"])("h3",u,Object(l["toDisplayString"])(e.formField.introduction),1)):Object(l["createCommentVNode"])("",!0),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{"input-field":"checkbox"!==e.formField.uiControl&&"radio"!==e.formField.uiControl,"file-field":"file"===e.formField.uiControl,m6:!e.formField.fullWidth}])},[(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.childComponent),Object(l["mergeProps"])(Object.assign(Object.assign({formField:e.formField},e.formField),{},{modelValue:e.processedModelValue,availableOptions:e.availableOptions},e.extraChildComponentParams),{"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})}),null,16))],2),Object(l["createElementVNode"])("div",{class:Object(l["normalizeClass"])(["col s12",{m6:!e.formField.fullWidth}])},[e.showFormHelp?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",c,[Object(l["withDirectives"])(Object(l["createElementVNode"])("div",{class:"form-description"},Object(l["toDisplayString"])(e.formField.description),513),[[l["vShow"],e.formField.description]]),e.formField.inlineHelp||e.hasInlineHelpSlot?(Object(l["openBlock"])(),Object(l["createElementBlock"])("span",s,[e.inlineHelpComponent?(Object(l["openBlock"])(),Object(l["createBlock"])(Object(l["resolveDynamicComponent"])(e.inlineHelpComponent),Object(l["normalizeProps"])(Object(l["mergeProps"])({key:0},e.inlineHelpBind)),null,16)):Object(l["createCommentVNode"])("",!0),Object(l["renderSlot"])(e.$slots,"inline-help")],512)):Object(l["createCommentVNode"])("",!0),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",null,[d,Object(l["createTextVNode"])(" "+Object(l["toDisplayString"])(e.translate("General_Default"))+": ",1),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(e.defaultValuePrettyTruncated),1)],512),[[l["vShow"],e.showDefaultValue]])])):Object(l["createCommentVNode"])("",!0)],2)],512)),[[l["vShow"],e.showField]])}var f={class:"checkbox"},p=["checked","id","name"],b=["innerHTML"];function v(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",f,[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes,{value:1,checked:!!e.modelValue,type:"checkbox",id:e.name,name:e.name}),null,16,p),Object(l["createElementVNode"])("span",{innerHTML:e.$sanitize(e.title)},null,8,b)])])}var h=Object(l["defineComponent"])({props:{modelValue:[Boolean,Number],uiControlAttributes:Object,name:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.modelValue!==e.target.checked&&this.$emit("update:modelValue",e.target.checked)}}});h.render=v;var g=h,O=["value","checked","onChange","id","name"];function j(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n,class:"checkbox"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:t.key,checked:!!e.checkboxStates[n],onChange:function(t){return e.onChange(n)}},e.uiControlAttributes,{type:"checkbox",id:"".concat(e.name).concat(t.key),name:t.name}),null,16,O),Object(l["createElementVNode"])("span",null,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(t.description),513),[[l["vShow"],t.description]])])])})),128))])}function y(e){return S(e)||C(e)||w(e)||V()}function V(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e,t){if(e){if("string"===typeof e)return k(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function C(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function S(e){if(Array.isArray(e))return k(e)}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function A(e,t){return(e||[]).map((function(e){return t&&-1!==t.indexOf(e.key)}))}var F=Object(l["defineComponent"])({props:{modelValue:Array,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,type:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{checkboxStates:function(){return A(this.availableOptions,this.modelValue)}},mounted:function(){window.Materialize.updateTextFields()},methods:{onChange:function(e){var t=y(this.checkboxStates);t[e]=!t[e];var n=this.availableOptions||{},o=[];Object.values(n).forEach((function(e,n){t[n]&&o.push(e.key)})),this.$emit("update:modelValue",o)}}});F.render=j;var B=F,E={class:"expandableSelector"},x=Object(l["createElementVNode"])("svg",{class:"caret",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg"},[Object(l["createElementVNode"])("path",{d:"M7 10l5 5 5-5z"}),Object(l["createElementVNode"])("path",{d:"M0 0h24v24H0z",fill:"none"})],-1),N=["value"],T={class:"expandableList z-depth-2"},$={class:"searchContainer"},M={class:"collection firstLevel"},P=["onClick"],J={class:"collection secondLevel"},H=["onClick"],D={class:"primary-content"},I=["title"];function L(e,t,n,o,i,r){var a=Object(l["resolveDirective"])("focus-if"),u=Object(l["resolveDirective"])("focus-anywhere-but-here");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",E,[Object(l["createElementVNode"])("div",{onClick:t[0]||(t[0]=function(t){return e.showSelect=!e.showSelect}),class:"select-wrapper"},[x,Object(l["createElementVNode"])("input",{type:"text",class:"select-dropdown",readonly:"readonly",value:e.modelValueText},null,8,N)]),Object(l["withDirectives"])(Object(l["createElementVNode"])("div",T,[Object(l["createElementVNode"])("div",$,[Object(l["withDirectives"])(Object(l["createElementVNode"])("input",{type:"text",placeholder:"Search","onUpdate:modelValue":t[1]||(t[1]=function(t){return e.searchTerm=t}),class:"expandableSearch browser-default"},null,512),[[l["vModelText"],e.searchTerm],[a,e.showSelect]])]),Object(l["createElementVNode"])("ul",M,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions,(function(t,n){return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"collection-item",key:n},[Object(l["createElementVNode"])("h4",{class:"expandableListCategory",onClick:function(n){return e.onCategoryClicked(t)}},[Object(l["createTextVNode"])(Object(l["toDisplayString"])(t.group)+" ",1),Object(l["createElementVNode"])("span",{class:Object(l["normalizeClass"])(["secondary-content",{"icon-arrow-right":e.showCategory!==t.group,"icon-arrow-bottom":e.showCategory===t.group}])},null,2)],8,P),Object(l["withDirectives"])(Object(l["createElementVNode"])("ul",J,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})),(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("li",{class:"expandableListItem collection-item valign-wrapper",key:t.key,onClick:function(n){return e.onValueClicked(t)}},[Object(l["createElementVNode"])("span",D,Object(l["toDisplayString"])(t.value),1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{title:t.tooltip,class:"secondary-content icon-help"},null,8,I),[[l["vShow"],t.tooltip]])],8,H)})),128))],512),[[l["vShow"],e.showCategory===t.group||e.searchTerm]])],512)),[[l["vShow"],t.values.filter((function(t){return-1!==t.value.toLowerCase().indexOf(e.searchTerm.toLowerCase())})).length]])})),128))])],512),[[l["vShow"],e.showSelect]])],512)),[[u,{blur:e.onBlur}]])}function z(e){var t=[];if(!e)return t;var n={};return Object.values(e).forEach((function(e){var t=e,o=t.group||"";o in n&&n[o]||(n[o]={values:[],group:o});var i={key:t.key,value:t.value};"tooltip"in t&&t.tooltip&&(i.tooltip=t.tooltip),n[o].values.push(i)})),Object.values(n).forEach((function(e){e.values.length&&t.push(e)})),t}var U=Object(l["defineComponent"])({props:{modelValue:[Number,String],availableOptions:Array,title:String},directives:{FocusAnywhereButHere:r["FocusAnywhereButHere"],FocusIf:r["FocusIf"]},inheritAttrs:!1,emits:["update:modelValue"],data:function(){return{showSelect:!1,searchTerm:"",showCategory:""}},computed:{modelValueText:function(){if(this.title)return this.title;var e,t=this.modelValue,n=this.availableOptions||[];return n.some((function(n){return e=n.values.find((function(e){return e.key===t})),e})),e?e.value?"".concat(e.value):"":t?"".concat(t):""}},methods:{onBlur:function(){this.showSelect=!1},onCategoryClicked:function(e){this.showCategory===e.group?this.showCategory="":this.showCategory=e.group},onValueClicked:function(e){this.$emit("update:modelValue",e.key),this.showSelect=!1}}});U.render=L;var K=U,_=["for","innerHTML"];function q(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("FieldArray");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,_),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onValueUpdate(t)}),field:e.uiControlAttributes.field},null,8,["name","model-value","field"])])}var R=Object(l["defineComponent"])({components:{FieldArray:r["FieldArray"]},props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],methods:{onValueUpdate:function(e){this.$emit("update:modelValue",e)}}});R.render=q;var G=R,W={class:"btn"},Z=["for","innerHTML"],Y=["name","id"],Q={class:"file-path-wrapper"},X=["value"];function ee(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("div",W,[Object(l["createElementVNode"])("span",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,Z),Object(l["createElementVNode"])("input",{ref:"fileInput",name:e.name,type:"file",id:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,Y)]),Object(l["createElementVNode"])("div",Q,[Object(l["createElementVNode"])("input",{class:"file-path validate",value:e.filePath,type:"text"},null,8,X)])])}var te=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:[String,File]},inheritAttrs:!1,emits:["update:modelValue"],watch:{modelValue:function(e){if(!e||""===e){var t=this.$refs.fileInput;t.value=""}}},methods:{onChange:function(e){var t=e.target.files;if(t){var n=t.item(0);this.$emit("update:modelValue",n)}}},computed:{filePath:function(){if(this.modelValue instanceof File)return this.$refs.fileInput.value}}});te.render=ee;var ne=te,oe=["type","name","value"];function ie(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("input",{type:e.uiControl,name:e.name,value:e.modelValue,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},null,40,oe)])}var re=Object(l["defineComponent"])({props:{modelValue:null,uiControl:String,name:String},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});re.render=ie;var le=re,ae={class:"fieldMultiTuple"},ue=["for","innerHTML"];function ce(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("MultiPairField");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ae,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ue),Object(l["createVNode"])(a,{name:e.name,"model-value":e.modelValue,"onUpdate:modelValue":e.onUpdateValue,field1:e.uiControlAttributes.field1,field2:e.uiControlAttributes.field2,field3:e.uiControlAttributes.field3,field4:e.uiControlAttributes.field4},null,8,["name","model-value","onUpdate:modelValue","field1","field2","field3","field4"])])}var se=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:null,uiControlAttributes:Object},inheritAttrs:!1,components:{MultiPairField:r["MultiPairField"]},emits:["update:modelValue"],methods:{onUpdateValue:function(e){this.$emit("update:modelValue",e)}}});se.render=ce;var de=se,me=["type","id","name","value"],fe=["for","innerHTML"];function pe(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:(e.modelValue||"").toString(),onKeydown:t[0]||(t[0]=function(t){return e.onChange(t)}),onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),null,16,me),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,fe)],64)}var be=Object(l["defineComponent"])({props:{uiControl:String,name:String,title:String,modelValue:[Number,String],uiControlAttributes:Object},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onChange=Object(r["debounce"])(this.onChange.bind(this),50)},methods:{onChange:function(e){var t=parseFloat(e.target.value);this.$emit("update:modelValue",t)}},mounted:function(){window.Materialize.updateTextFields()},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}}});be.render=pe;var ve=be,he=["value","id","name","disabled","checked"];function ge(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["withDirectives"])(Object(l["createElementVNode"])("label",{class:"fieldRadioTitle"},Object(l["toDisplayString"])(e.title),513),[[l["vShow"],e.title]]),(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.availableOptions||[],(function(n){return Object(l["openBlock"])(),Object(l["createElementBlock"])("p",{key:n.key,class:"radio"},[Object(l["createElementVNode"])("label",null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({value:n.key,onChange:t[0]||(t[0]=function(t){return e.onChange(t)}),type:"radio",id:"".concat(e.name).concat(n.key),name:e.name,disabled:n.disabled||e.disabled},e.uiControlAttributes,{checked:e.modelValue===n.key||"".concat(e.modelValue)===n.key}),null,16,he),Object(l["createElementVNode"])("span",null,[Object(l["createTextVNode"])(Object(l["toDisplayString"])(n.value)+" ",1),Object(l["withDirectives"])(Object(l["createElementVNode"])("span",{class:"form-description"},Object(l["toDisplayString"])(n.description),513),[[l["vShow"],n.description]])])])])})),128))])}var Oe=Object(l["defineComponent"])({props:{title:String,availableOptions:Array,name:String,disabled:Boolean,uiControlAttributes:Object,modelValue:[String,Number]},inheritAttrs:!1,emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e.target.value)}}});Oe.render=ge;var je=Oe;function ye(e,t){return ke(e)||Se(e,t)||we(e,t)||Ve()}function Ve(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function we(e,t){if(e){if("string"===typeof e)return Ce(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ce(e,t):void 0}}function Ce(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Se(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function ke(e){if(Array.isArray(e))return e}var Ae={key:0,class:"matomo-field-select"},Fe=["multiple","name"],Be=["label"],Ee=["value","selected","disabled"],xe=["for","innerHTML"],Ne={key:1,class:"matomo-field-select"},Te=["multiple","name"],$e=["value","selected","disabled"],Me=["for","innerHTML"];function Pe(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[e.groupedOptions?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Ae,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({ref:"select",class:"grouped",multiple:e.multiple,name:e.name,onChange:t[0]||(t[0]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.groupedOptions,(function(t){var n=ye(t,2),o=n[0],i=n[1];return Object(l["openBlock"])(),Object(l["createElementBlock"])("optgroup",{key:o,label:o},[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(i,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(l["toDisplayString"])(t.value),9,Ee)})),128))],8,Be)})),128))],16,Fe),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.title},null,8,xe)])):Object(l["createCommentVNode"])("",!0),!e.groupedOptions&&e.options?(Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Ne,[Object(l["createElementVNode"])("select",Object(l["mergeProps"])({class:"ungrouped",ref:"select",multiple:e.multiple,name:e.name,onChange:t[1]||(t[1]=function(t){return e.onChange(t)})},e.uiControlAttributes),[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.options,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("option",{key:t.key,value:"string:".concat(t.key),selected:e.multiple?e.modelValue&&-1!==e.modelValue.indexOf(t.key):e.modelValue===t.key,disabled:t.disabled},Object(l["toDisplayString"])(t.value),9,$e)})),128))],16,Te),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.title},null,8,Me)])):Object(l["createCommentVNode"])("",!0)],64)}function Je(e){return Ie(e)||De(e)||Ue(e)||He()}function He(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function De(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ie(e){if(Array.isArray(e))return Ke(e)}function Le(e,t){return qe(e)||_e(e,t)||Ue(e,t)||ze()}function ze(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ue(e,t){if(e){if("string"===typeof e)return Ke(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ke(e,t):void 0}}function Ke(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function _e(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function qe(e){if(Array.isArray(e))return e}function Re(e){return Re="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Re(e)}function Ge(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0;if(e){var r=window.$(e);if(Array.from(e.options).forEach((function(e){e.selected=i?!!t&&-1!==t.indexOf(e.value.replace(/^string:/,"")):"string:".concat(t)===e.value})),r.formSelect(o),n){var l=r.closest(".select-wrapper").find("input");l.attr("placeholder",n)}}}function We(e){return!Array.isArray(e)&&"object"===Re(e)&&Object.values(e).some((function(e){return"object"===Re(e)}))}function Ze(e,t){return e.some((function(e){return e.key===t}))}function Ye(e,t,n){if(!e)return[];var o=!0,i=e;We(i)||(i={"":e},o=!1);var r=[];return Object.entries(i).forEach((function(e){var n=Le(e,2),i=n[0],l=n[1];Object.entries(l).forEach((function(e){var n=Le(e,2),l=n[0],a=n[1];if(a&&"object"===Re(a)&&"undefined"!==typeof a.key)r.push(a);else{var u=l;"integer"===t&&"string"===typeof l&&(u=parseInt(l,10)),r.push({group:o?i:void 0,key:u,value:a})}}))})),null!==n&&void 0!==n&&n.placeholder&&!Ze(r,"")?[{key:"",value:""}].concat(r):r}function Qe(e){return"string"===typeof e?e.replace(/^string:/,""):e}var Xe=Object(l["defineComponent"])({props:{modelValue:null,multiple:Boolean,name:String,title:String,availableOptions:Array,uiControlAttributes:Object,uiControlOptions:Object},inheritAttrs:!1,emits:["update:modelValue"],computed:{options:function(){var e=this.availableOptions;return!e||Ze(e,"")||"undefined"!==typeof this.modelValue&&null!==this.modelValue&&""!==this.modelValue?e:[{key:"",value:this.modelValue,group:this.hasGroups?"":void 0}].concat(Je(e))},hasGroups:function(){var e=this.availableOptions;return e&&e[0]&&"undefined"!==typeof e[0].group},groupedOptions:function(){var e=this.options;if(!this.hasGroups||!e)return null;var t={};e.forEach((function(e){var n=e.group;t[n]=t[n]||[],t[n].push(e)}));var n=Object.entries(t);return n.sort((function(e,t){return e[0]<t[0]?-1:e[0]>t[0]?1:0})),n}},methods:{onChange:function(e){var t,n=this,o=e.target;this.multiple?(t=Array.from(o.options).filter((function(e){return e.selected})).map((function(e){return e.value})),t=t.map((function(e){return Qe(e)}))):(t=o.value,t=Qe(t)),this.$emit("update:modelValue",t),Object(l["nextTick"])((function(){n.modelValue!==t&&n.onModelValueChange(n.modelValue)}))},onModelValueChange:function(e){var t=this;window.$(this.$refs.select).val(e),setTimeout((function(){var n;Ge(t.$refs.select,e,null===(n=t.uiControlAttributes)||void 0===n?void 0:n.placeholder,t.uiControlOptions,t.multiple)}))}},watch:{modelValue:function(e){this.onModelValueChange(e)},"uiControlAttributes.disabled":{handler:function(e,t){var n=this;setTimeout((function(){var o;e!==t&&Ge(n.$refs.select,n.modelValue,null===(o=n.uiControlAttributes)||void 0===o?void 0:o.placeholder,n.uiControlOptions,n.multiple)}))}},availableOptions:function(e,t){var n=this;e!==t&&setTimeout((function(){var e;Ge(n.$refs.select,n.modelValue,null===(e=n.uiControlAttributes)||void 0===e?void 0:e.placeholder,n.uiControlOptions,n.multiple)}))}},mounted:function(){var e=this;setTimeout((function(){var t;Ge(e.$refs.select,e.modelValue,null===(t=e.uiControlAttributes)||void 0===t?void 0:t.placeholder,e.uiControlOptions,e.multiple)}))}});Xe.render=Pe;var et=Xe,tt=["for","innerHTML"],nt={class:"sites_autocomplete"};function ot(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("SiteSelector");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,class:"siteSelectorLabel",innerHTML:e.$sanitize(e.title)},null,8,tt),Object(l["createElementVNode"])("div",nt,[Object(l["createVNode"])(a,Object(l["mergeProps"])({"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)}),id:e.name,"show-all-sites-item":e.uiControlAttributes.showAllSitesItem||!1,"switch-site-on-select":!1,"show-selected-site":!0,"only-sites-with-admin-access":e.uiControlAttributes.onlySitesWithAdminAccess||!1},e.uiControlAttributes),null,16,["model-value","id","show-all-sites-item","only-sites-with-admin-access"])])])}var it=Object(l["defineComponent"])({props:{name:String,title:String,modelValue:Object,uiControlAttributes:Object},inheritAttrs:!1,components:{SiteSelector:r["SiteSelector"]},emits:["update:modelValue"],methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});it.render=ot;var rt=it,lt=["type","id","name","value"],at=["for","innerHTML"];function ut(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,id:e.name,name:e.name,value:e.modelValueText,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)})},e.uiControlAttributes),null,16,lt),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,at)],64)}var ct=Object(l["defineComponent"])({props:{title:String,name:String,uiControlAttributes:Object,modelValue:[String,Number],uiControl:String},inheritAttrs:!1,emits:["update:modelValue"],computed:{modelValueText:function(){return"undefined"===typeof this.modelValue||null===this.modelValue?"":this.modelValue.toString()}},created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},mounted:function(){setTimeout((function(){window.Materialize.updateTextFields()}))},watch:{modelValue:function(){setTimeout((function(){window.Materialize.updateTextFields()}))}},methods:{onKeydown:function(e){var t=e.target.value;this.modelValue!==t&&this.$emit("update:modelValue",t)}}});ct.render=ut;var st=ct,dt=["for","innerHTML"],mt=["type","name","value"];function ft(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,dt),Object(l["createElementVNode"])("input",Object(l["mergeProps"])({class:"control_".concat(e.uiControl),type:e.uiControl,name:e.name,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),value:e.concattedValues},e.uiControlAttributes),null,16,mt)])}var pt=Object(l["defineComponent"])({props:{name:String,title:String,uiControl:String,modelValue:Array,uiControlAttributes:Object},inheritAttrs:!1,computed:{concattedValues:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(", ")}},emits:["update:modelValue"],created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(",").map((function(e){return e.trim()}));t.join(", ")!==this.concattedValues&&this.$emit("update:modelValue",t)}}});pt.render=ft;var bt=pt,vt=["name","id","value"],ht=["for","innerHTML"];function gt(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])(l["Fragment"],null,[Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({name:e.name},e.uiControlAttributes,{id:e.name,value:e.modelValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea",ref:"textarea"}),null,16,vt),Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,ht)],64)}var Ot=Object(l["defineComponent"])({props:{name:String,uiControlAttributes:Object,modelValue:String,title:String},inheritAttrs:!1,emits:["update:modelValue"],created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){this.$emit("update:modelValue",e.target.value)}},watch:{modelValue:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});Ot.render=gt;var jt=Ot,yt=["for","innerHTML"],Vt=["name","value"];function wt(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createElementVNode"])("label",{for:e.name,innerHTML:e.$sanitize(e.title)},null,8,yt),Object(l["createElementVNode"])("textarea",Object(l["mergeProps"])({ref:"textarea",name:e.name},e.uiControlAttributes,{value:e.concattedValue,onKeydown:t[0]||(t[0]=function(t){return e.onKeydown(t)}),onChange:t[1]||(t[1]=function(t){return e.onKeydown(t)}),class:"materialize-textarea"}),null,16,Vt)])}var Ct="\n",St=Object(l["defineComponent"])({props:{name:String,title:String,uiControlAttributes:Object,modelValue:[Array,String]},inheritAttrs:!1,emits:["update:modelValue"],computed:{concattedValue:function(){return"string"===typeof this.modelValue?this.modelValue:(this.modelValue||[]).join(Ct)}},created:function(){this.onKeydown=Object(r["debounce"])(this.onKeydown.bind(this),50)},methods:{onKeydown:function(e){var t=e.target.value.split(Ct);t.join(Ct)!==this.concattedValue&&this.$emit("update:modelValue",t)}},watch:{modelValue:function(e,t){var n=this;e!==t&&setTimeout((function(){n.$refs.textarea&&window.Materialize.textareaAutoResize(n.$refs.textarea),window.Materialize.updateTextFields()}))}},mounted:function(){var e=this;setTimeout((function(){e.$refs.textarea&&window.Materialize.textareaAutoResize(e.$refs.textarea),window.Materialize.updateTextFields()}))}});St.render=wt;var kt=St;function At(e){return At="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},At(e)}function Ft(e,t){return Tt(e)||Nt(e,t)||Et(e,t)||Bt()}function Bt(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Et(e,t){if(e){if("string"===typeof e)return xt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xt(e,t):void 0}}function xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Nt(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function Tt(e){if(Array.isArray(e))return e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function $t(e,t){if(!e)return[];var n=[];return Object.entries(e).forEach((function(e){var o=Ft(e,2),r=o[0],i=o[1];if(i&&"object"===At(i)&&"undefined"!==typeof i.key)n.push(i);else{var l=r;"integer"===t&&"string"===typeof r&&(l=parseInt(l,10)),n.push({key:l,value:i})}})),n}var Mt={ref:"root"};function Pt(e,t,n,o,r,i){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Mt,null,512)}function Jt(e){if("undefined"!==typeof e)return JSON.parse(JSON.stringify(e))}var Ht=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:null,required:!0},templateFile:{type:String,required:!0}},emits:["update:modelValue"],inheritAttrs:!1,setup:function(e,t){var n=Object(l["ref"])(null),o=window.$("<div ng-include=\"'".concat(e.templateFile,"?cb=").concat(i["Matomo"].cacheBuster,"'\"></div>")),r=i["Matomo"].helper.getAngularDependency("$timeout"),a=i["Matomo"].helper.getAngularDependency("$rootScope"),u=a.$new();return u.formField=Object.assign(Object.assign({},Jt(e.formField)),{},{value:Jt(e.modelValue)}),u.$watch("formField.value",(function(n,o){n!==o&&JSON.stringify(n)!==JSON.stringify(e.modelValue)&&t.emit("update:modelValue",Jt(n))})),Object(l["watch"])((function(){return e.modelValue}),(function(e){JSON.stringify(e)!==JSON.stringify(u.formField.value)&&r((function(){u.formField.value=e}))})),Object(l["watch"])((function(){return e.formField}),(function(e){r((function(){var t=u.formField.value;u.formField=Object.assign(Object.assign({},Jt(e)),{},{value:t})}))}),{deep:!0}),Object(l["onMounted"])((function(){window.$(n.value).append(o),i["Matomo"].helper.compileAngularComponents(o,{scope:u,params:{formField:Object.assign(Object.assign({},Jt(e.formField)),{},{value:e.modelValue})}})})),{root:n}}});Ht.render=Pt;var Dt=Ht;function Lt(e){return Lt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lt(e)}var It=["password","url","search","email"],zt=["textarea","checkbox","text"],Ut={checkbox:"FieldCheckbox","expandable-select":"FieldExpandableSelect","field-array":"FieldFieldArray",file:"FieldFile",hidden:"FieldHidden",multiselect:"FieldSelect",multituple:"FieldMultituple",number:"FieldNumber",radio:"FieldRadio",select:"FieldSelect",site:"FieldSite",text:"FieldText",textarea:"FieldTextarea"},Kt={FieldSelect:Ye,FieldCheckboxArray:$t,FieldRadio:$t,FieldExpandableSelect:z},_t=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:Object,required:!0}},emits:["update:modelValue"],components:{FieldCheckbox:g,FieldCheckboxArray:B,FieldExpandableSelect:K,FieldFieldArray:G,FieldFile:ne,FieldHidden:le,FieldMultituple:de,FieldNumber:ve,FieldRadio:ye,FieldSelect:et,FieldSite:it,FieldText:st,FieldTextArray:bt,FieldTextarea:yt,FieldTextareaArray:kt},setup:function(e){var t=Object(l["ref"])(null),n=function(e){var n;e&&t.value&&"function"!==typeof e.render&&(n="string"===typeof e?0===e.indexOf("#")?window.$(e):window.vueSanitize(e):e,window.$(t.value).html("").append(n))};return Object(l["watch"])((function(){return e.formField.inlineHelp}),n),Object(l["onMounted"])((function(){n(e.formField.inlineHelp)})),{inlineHelp:t}},computed:{inlineHelpComponent:function(){var e=this.formField,t=e.inlineHelp;if(t&&"function"===typeof t.render)return e.inlineHelp},inlineHelpBind:function(){return this.inlineHelpComponent?this.formField.inlineHelpBind:void 0},childComponent:function(){var e=this.formField;if(e.component){var t=e.component;if(e.component.plugin){var n=e.component,o=n.plugin,r=n.name;if(!o||!r)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");t=Object(i["useExternalPluginComponent"])(o,r)}return Object(l["markRaw"])(t)}if(e.templateFile)return Object(l["markRaw"])(Dt);var a=e.uiControl,u=Ut[a];return-1!==It.indexOf(a)&&(u="FieldText"),"array"===this.formField.type&&-1!==zt.indexOf(a)&&(u="".concat(u,"Array")),u},extraChildComponentParams:function(){return"multiselect"===this.formField.uiControl?{multiple:!0}:{}},showFormHelp:function(){return this.formField.description||this.formField.inlineHelp||this.showDefaultValue},showDefaultValue:function(){return this.defaultValuePretty&&"checkbox"!==this.formField.uiControl&&"radio"!==this.formField.uiControl},showField:function(){return!(this.formField&&this.formField.condition&&this.formField.condition instanceof Function)||this.formField.condition()},processedModelValue:function(){var e=this.formField;if("boolean"===e.type){var t=this.modelValue&&this.modelValue>0&&"0"!==this.modelValue;if("checkbox"===e.uiControl)return t;if("radio"===e.uiControl)return t?"1":"0"}return this.modelValue},defaultValue:function(){var e=this.formField.defaultValue;return Array.isArray(e)?e.join(","):e},availableOptions:function(){var e=this.childComponent;if("string"!==typeof e)return null;var t=this.formField;return t.availableValues&&Kt[e]?Kt[e](t.availableValues,t.type,t.uiControlAttributes):null},defaultValuePretty:function(){var e=this.formField,t=e.defaultValue,n=this.availableOptions;if("string"===typeof t&&t){var o=null;try{o=JSON.parse(t)}catch(i){}if(null!==o&&"object"===Lt(o))return""}if(!Array.isArray(n))return Array.isArray(t)?"":t?"".concat(t):"";var r=[];return Array.isArray(t)||(t=[t]),(n||[]).forEach((function(e){"undefined"!==typeof e.value&&-1!==t.indexOf(e.key)&&r.push(e.value)})),r.join(", ")},defaultValuePrettyTruncated:function(){return this.defaultValuePretty.substring(0,50)}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});_t.render=m;var qt=_t; + */function $t(e,t){if(!e)return[];var n=[];return Object.entries(e).forEach((function(e){var o=Ft(e,2),i=o[0],r=o[1];if(r&&"object"===At(r)&&"undefined"!==typeof r.key)n.push(r);else{var l=i;"integer"===t&&"string"===typeof i&&(l=parseInt(l,10)),n.push({key:l,value:r})}})),n}var Mt={ref:"root"};function Pt(e,t,n,o,i,r){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",Mt,null,512)}function Jt(e){if("undefined"!==typeof e)return JSON.parse(JSON.stringify(e))}var Ht=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:null,required:!0},templateFile:{type:String,required:!0}},emits:["update:modelValue"],inheritAttrs:!1,setup:function(e,t){var n=Object(l["ref"])(null),o=window.$("<div ng-include=\"'".concat(e.templateFile,"?cb=").concat(r["Matomo"].cacheBuster,"'\"></div>")),i=r["Matomo"].helper.getAngularDependency("$timeout"),a=r["Matomo"].helper.getAngularDependency("$rootScope"),u=a.$new();return u.formField=Object.assign(Object.assign({},Jt(e.formField)),{},{value:Jt(e.modelValue)}),u.$watch("formField.value",(function(n,o){n!==o&&JSON.stringify(n)!==JSON.stringify(e.modelValue)&&t.emit("update:modelValue",Jt(n))})),Object(l["watch"])((function(){return e.modelValue}),(function(e){JSON.stringify(e)!==JSON.stringify(u.formField.value)&&i((function(){u.formField.value=e}))})),Object(l["watch"])((function(){return e.formField}),(function(e){i((function(){var t=u.formField.value;u.formField=Object.assign(Object.assign({},Jt(e)),{},{value:t})}))}),{deep:!0}),Object(l["onMounted"])((function(){window.$(n.value).append(o),r["Matomo"].helper.compileAngularComponents(o,{scope:u,params:{formField:Object.assign(Object.assign({},Jt(e.formField)),{},{value:e.modelValue})}})})),{root:n}}});Ht.render=Pt;var Dt=Ht;function It(e){return It="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},It(e)}var Lt=["password","url","search","email"],zt=["textarea","checkbox","text"],Ut={checkbox:"FieldCheckbox","expandable-select":"FieldExpandableSelect","field-array":"FieldFieldArray",file:"FieldFile",hidden:"FieldHidden",multiselect:"FieldSelect",multituple:"FieldMultituple",number:"FieldNumber",radio:"FieldRadio",select:"FieldSelect",site:"FieldSite",text:"FieldText",textarea:"FieldTextarea"},Kt={FieldSelect:Ye,FieldCheckboxArray:$t,FieldRadio:$t,FieldExpandableSelect:z},_t=Object(l["defineComponent"])({props:{modelValue:null,formField:{type:Object,required:!0}},emits:["update:modelValue"],components:{FieldCheckbox:g,FieldCheckboxArray:B,FieldExpandableSelect:K,FieldFieldArray:G,FieldFile:ne,FieldHidden:le,FieldMultituple:de,FieldNumber:ve,FieldRadio:je,FieldSelect:et,FieldSite:rt,FieldText:st,FieldTextArray:bt,FieldTextarea:jt,FieldTextareaArray:kt},setup:function(e){var t=Object(l["ref"])(null),n=function(e){var n;e&&t.value&&"function"!==typeof e.render&&(n="string"===typeof e?0===e.indexOf("#")?window.$(e):window.vueSanitize(e):e,window.$(t.value).html("").append(n))};return Object(l["watch"])((function(){return e.formField.inlineHelp}),n),Object(l["onMounted"])((function(){n(e.formField.inlineHelp)})),{inlineHelp:t}},computed:{inlineHelpComponent:function(){var e=this.formField,t=e.inlineHelp;if(t&&"function"===typeof t.render)return e.inlineHelp},inlineHelpBind:function(){return this.inlineHelpComponent?this.formField.inlineHelpBind:void 0},childComponent:function(){var e=this.formField;if(e.component){var t=e.component;if(e.component.plugin){var n=e.component,o=n.plugin,i=n.name;if(!o||!i)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");t=Object(r["useExternalPluginComponent"])(o,i)}return Object(l["markRaw"])(t)}if(e.templateFile)return Object(l["markRaw"])(Dt);var a=e.uiControl,u=Ut[a];return-1!==Lt.indexOf(a)&&(u="FieldText"),"array"===this.formField.type&&-1!==zt.indexOf(a)&&(u="".concat(u,"Array")),u},extraChildComponentParams:function(){return"multiselect"===this.formField.uiControl?{multiple:!0}:{}},showFormHelp:function(){return this.formField.description||this.formField.inlineHelp||this.showDefaultValue||this.hasInlineHelpSlot},showDefaultValue:function(){return this.defaultValuePretty&&"checkbox"!==this.formField.uiControl&&"radio"!==this.formField.uiControl},showField:function(){return!(this.formField&&this.formField.condition&&this.formField.condition instanceof Function)||this.formField.condition()},processedModelValue:function(){var e=this.formField;if("boolean"===e.type){var t=this.modelValue&&this.modelValue>0&&"0"!==this.modelValue;if("checkbox"===e.uiControl)return t;if("radio"===e.uiControl)return t?"1":"0"}return this.modelValue},defaultValue:function(){var e=this.formField.defaultValue;return Array.isArray(e)?e.join(","):e},availableOptions:function(){var e=this.childComponent;if("string"!==typeof e)return null;var t=this.formField;return t.availableValues&&Kt[e]?Kt[e](t.availableValues,t.type,t.uiControlAttributes):null},defaultValuePretty:function(){var e=this.formField,t=e.defaultValue,n=this.availableOptions;if("string"===typeof t&&t){var o=null;try{o=JSON.parse(t)}catch(r){}if(null!==o&&"object"===It(o))return""}if(!Array.isArray(n))return Array.isArray(t)?"":t?"".concat(t):"";var i=[];return Array.isArray(t)||(t=[t]),(n||[]).forEach((function(e){"undefined"!==typeof e.value&&-1!==t.indexOf(e.key)&&i.push(e.value)})),i.join(", ")},defaultValuePrettyTruncated:function(){return this.defaultValuePretty.substring(0,50)},hasInlineHelpSlot:function(){var e,t;if(!this.$slots["inline-help"])return!1;var n=this.$slots["inline-help"]();return!(null===n||void 0===n||null===(e=n[0])||void 0===e||null===(t=e.children)||void 0===t||!t.length)}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});_t.render=m;var qt=_t; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Rt(e){if(e){var t=e.plugin,n=e.name;if(!t||!n)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(i["useExternalPluginComponent"])(t,n)}}function Gt(e,t){var n={};return Object.values(e.allSettings||{}).forEach((function(e){"0"===e.value?n[e.name]=0:n[e.name]=e.value})),e.$eval(t,n)}Object(i["createAngularJsAdapter"])({component:qt,scope:{modelValue:{default:function(e){var t=e.piwikFormField;return"string"!==typeof t.value||!t.value||"array"!==t.type&&"multituple"!==t.uiControl&&"field-array"!==t.uiControl&&"multiselect"!==t.uiControl&&"site"!==t.uiControl||(t.value=JSON.parse(t.value)),"checkbox"===t.uiControl?Object(i["transformAngularJsBoolAttr"])(t.value):t.value}},piwikFormField:{vue:"formField",angularJsBind:"=",transform:function(e,t,n){var o=e;function r(){if(o.templateFile)return Object(l["markRaw"])(Dt);var e=Rt(o.component);return e?Object(l["markRaw"])(e):void 0}return Object.assign(Object.assign({},o),{},{condition:o.condition?Gt.bind(null,n,o.condition):o.condition,disabled:Object(i["transformAngularJsBoolAttr"])(o.disabled),autocomplete:Object(i["transformAngularJsBoolAttr"])(o.autocomplete),autofocus:Object(i["transformAngularJsBoolAttr"])(o.autofocus),tabindex:Object(i["transformAngularJsIntAttr"])(o.tabindex),fullWidth:Object(i["transformAngularJsBoolAttr"])(o.fullWidth),maxlength:Object(i["transformAngularJsIntAttr"])(o.maxlength),required:Object(i["transformAngularJsBoolAttr"])(o.required),rows:Object(i["transformAngularJsIntAttr"])(o.rows),min:Object(i["transformAngularJsIntAttr"])(o.min),max:Object(i["transformAngularJsIntAttr"])(o.max),component:r()})}},allSettings:{angularJsBind:"="}},directiveName:"piwikFormField",events:{"update:modelValue":function(e,t,n,o,r,i,l){e!==n.piwikFormField.value&&l((function(){n.piwikFormField.value=e}))}},$inject:["$timeout"],postCreate:function(e,t){t.$watch("piwikFormField.value",(function(t,n){t!==n&&(e.modelValue=t)})),t.$watch("allSettings",(function(){e.formField=Object.assign(Object.assign({},e.formField),{},{condition:t.piwikFormField.condition?Gt.bind(null,t,t.piwikFormField.condition):t.piwikFormField.condition})}),!0)}});function Wt(e,t,n,o,r,i){var a=Object(l["resolveComponent"])("FormField");return Object(l["openBlock"])(),Object(l["createBlock"])(a,{"form-field":e.field,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})},null,8,["form-field","model-value"])}var Zt={multiselect:"array",checkbox:"boolean",site:"object",number:"integer"},Yt=Object(l["defineComponent"])({props:{modelValue:null,uicontrol:String,name:String,defaultValue:null,options:[Object,Array],description:String,introduction:String,title:String,inlineHelp:[String,Object],inlineHelpBind:Object,disabled:Boolean,uiControlAttributes:{type:Object,default:function(){return{}}},uiControlOptions:{type:Object,default:function(){return{}}},autocomplete:Boolean,condition:Function,varType:String,autofocus:Boolean,tabindex:Number,fullWidth:Boolean,maxlength:Number,required:Boolean,placeholder:String,rows:Number,min:Number,max:Number,component:null,templateFile:String},emits:["update:modelValue"],components:{FormField:qt},computed:{type:function(){if(this.varType)return this.varType;var e=this.uicontrol;return e&&Zt[e]?Zt[e]:"string"},field:function(){return{uiControl:this.uicontrol,type:this.type,name:this.name,defaultValue:this.defaultValue,availableValues:this.options,description:this.description,introduction:this.introduction,inlineHelp:this.inlineHelp,inlineHelpBind:this.inlineHelpBind,title:this.title,component:this.component,templateFile:this.templateFile,uiControlAttributes:Object.assign(Object.assign({},this.uiControlAttributes),{},{disabled:this.disabled,autocomplete:this.autocomplete,tabindex:this.tabindex,autofocus:this.autofocus,rows:this.rows,required:this.required,maxlength:this.maxlength,placeholder:this.placeholder,min:this.min,max:this.max}),fullWidth:this.fullWidth,uiControlOptions:this.uiControlOptions}}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});Yt.render=Wt;var Qt=Yt; + */function Rt(e){if(e){var t=e.plugin,n=e.name;if(!t||!n)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(r["useExternalPluginComponent"])(t,n)}}function Gt(e,t){var n={};return Object.values(e.allSettings||{}).forEach((function(e){"0"===e.value?n[e.name]=0:n[e.name]=e.value})),e.$eval(t,n)}Object(r["createAngularJsAdapter"])({component:qt,scope:{modelValue:{default:function(e){var t=e.piwikFormField;return"string"!==typeof t.value||!t.value||"array"!==t.type&&"multituple"!==t.uiControl&&"field-array"!==t.uiControl&&"multiselect"!==t.uiControl&&"site"!==t.uiControl||(t.value=JSON.parse(t.value)),"checkbox"===t.uiControl?Object(r["transformAngularJsBoolAttr"])(t.value):t.value}},piwikFormField:{vue:"formField",angularJsBind:"=",transform:function(e,t,n){var o=e;function i(){if(o.templateFile)return Object(l["markRaw"])(Dt);var e=Rt(o.component);return e?Object(l["markRaw"])(e):void 0}return Object.assign(Object.assign({},o),{},{condition:o.condition?Gt.bind(null,n,o.condition):o.condition,disabled:Object(r["transformAngularJsBoolAttr"])(o.disabled),autocomplete:Object(r["transformAngularJsBoolAttr"])(o.autocomplete),autofocus:Object(r["transformAngularJsBoolAttr"])(o.autofocus),tabindex:Object(r["transformAngularJsIntAttr"])(o.tabindex),fullWidth:Object(r["transformAngularJsBoolAttr"])(o.fullWidth),maxlength:Object(r["transformAngularJsIntAttr"])(o.maxlength),required:Object(r["transformAngularJsBoolAttr"])(o.required),rows:Object(r["transformAngularJsIntAttr"])(o.rows),min:Object(r["transformAngularJsIntAttr"])(o.min),max:Object(r["transformAngularJsIntAttr"])(o.max),component:i()})}},allSettings:{angularJsBind:"="}},directiveName:"piwikFormField",events:{"update:modelValue":function(e,t,n,o,i,r,l){e!==n.piwikFormField.value&&l((function(){n.piwikFormField.value=e}))}},$inject:["$timeout"],postCreate:function(e,t){t.$watch("piwikFormField.value",(function(t,n){t!==n&&(e.modelValue=t)})),t.$watch("allSettings",(function(){e.formField=Object.assign(Object.assign({},e.formField),{},{condition:t.piwikFormField.condition?Gt.bind(null,t,t.piwikFormField.condition):t.piwikFormField.condition})}),!0)}});function Wt(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("FormField");return Object(l["openBlock"])(),Object(l["createBlock"])(a,{"form-field":e.field,"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.onChange(t)})},{"inline-help":Object(l["withCtx"])((function(){return[Object(l["renderSlot"])(e.$slots,"inline-help")]})),_:3},8,["form-field","model-value"])}var Zt={multiselect:"array",checkbox:"boolean",site:"object",number:"integer"},Yt=Object(l["defineComponent"])({props:{modelValue:null,uicontrol:String,name:String,defaultValue:null,options:[Object,Array],description:String,introduction:String,title:String,inlineHelp:[String,Object],inlineHelpBind:Object,disabled:Boolean,uiControlAttributes:{type:Object,default:function(){return{}}},uiControlOptions:{type:Object,default:function(){return{}}},autocomplete:Boolean,condition:Function,varType:String,autofocus:Boolean,tabindex:Number,fullWidth:Boolean,maxlength:Number,required:Boolean,placeholder:String,rows:Number,min:Number,max:Number,component:null,templateFile:String},emits:["update:modelValue"],components:{FormField:qt},computed:{type:function(){if(this.varType)return this.varType;var e=this.uicontrol;return e&&Zt[e]?Zt[e]:"string"},field:function(){return{uiControl:this.uicontrol,type:this.type,name:this.name,defaultValue:this.defaultValue,availableValues:this.options,description:this.description,introduction:this.introduction,inlineHelp:this.inlineHelp,inlineHelpBind:this.inlineHelpBind,title:this.title,component:this.component,templateFile:this.templateFile,uiControlAttributes:Object.assign(Object.assign({},this.uiControlAttributes),{},{disabled:this.disabled,autocomplete:this.autocomplete,tabindex:this.tabindex,autofocus:this.autofocus,rows:this.rows,required:this.required,maxlength:this.maxlength,placeholder:this.placeholder,min:this.min,max:this.max}),fullWidth:this.fullWidth,uiControlOptions:this.uiControlOptions}}},methods:{onChange:function(e){this.$emit("update:modelValue",e)}}});Yt.render=Wt;var Qt=Yt; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Xt(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var o=JSON.parse(e);return"site"===n&&(o.name=i["Matomo"].helper.htmlDecode(o.name)),o}return"checkbox"===n&&"array"!==t?Object(i["transformAngularJsBoolAttr"])(e):e}Object(i["createAngularJsAdapter"])({component:Qt,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return Xt(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:i["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){if(e)return function(t){return n.$eval(e,t)}}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:i["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:i["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(e){if(n.templateFile)return Object(l["shallowRef"])(Dt);var o=e.plugin,r=e.name;if(!o||!r)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(l["shallowRef"])(Object(i["useExternalPluginComponent"])(o,r))}}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,o,r,i,l){var a=i?i.$viewValue:n.value;e!==a&&l((function(){i?(i.$setViewValue(e),i.$render()):n.value=e}))}},postCreate:function(e,t,n,o,r){var a=r;if(a){if(a.$render=function(){Object(l["nextTick"])((function(){e.modelValue=Object(i["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value){var u=Xt(t.value,t.varType,t.uicontrol);a.$setViewValue(u)}else a.$setViewValue(e.modelValue);"site"===t.uicontrol&&a.$viewValue&&setTimeout((function(){a.$setViewValue(Object.assign({},a.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var o=Xt(n,t.varType,t.uicontrol);Object(l["nextTick"])((function(){e.modelValue=o}))}}))}});var en,tn={class:"pluginSettings",ref:"root"},nn=["id"],on={class:"card-content"},rn=["id"],ln=["onClick","disabled","value"],an={class:"confirm-password-modal modal"},un={class:"modal-content"},cn={class:"modal-footer"},sn=["disabled"];function dn(e,t,n,o,r,i){var a=this,u=Object(l["resolveComponent"])("GroupedSettings"),c=Object(l["resolveComponent"])("ActivityIndicator"),s=Object(l["resolveComponent"])("Field");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",tn,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settingsPerPlugin,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:"card",id:"".concat(t.pluginName,"PluginSettings"),key:"".concat(t.pluginName,"PluginSettings")},[Object(l["createElementVNode"])("div",on,[Object(l["createElementVNode"])("h2",{class:"card-title",id:t.pluginName},Object(l["toDisplayString"])(t.title),9,rn),Object(l["createVNode"])(u,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"]),Object(l["createElementVNode"])("input",{type:"button",onClick:function(n){return e.saveSetting(t.pluginName)},disabled:e.isLoading,class:"pluginsSettingsSubmit btn",value:e.translate("General_Save")},null,8,ln),Object(l["createVNode"])(c,{loading:e.isLoading||e.isSaving[t.pluginName]},null,8,["loading"])])],8,nn)})),128)),Object(l["createElementVNode"])("div",an,[Object(l["createElementVNode"])("div",un,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(s,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(l["createElementVNode"])("div",cn,[Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",disabled:e.passwordConfirmation?void 0:"disabled",onClick:t[1]||(t[1]=function(t){t.preventDefault(),e.save(a.settingsToSave)})},Object(l["toDisplayString"])(e.translate("General_Yes")),9,sn),Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[2]||(t[2]=function(e){return e.preventDefault()})},Object(l["toDisplayString"])(e.translate("General_No")),1)])])],512)}function mn(e,t,n,o,r,i){var a=Object(l["resolveComponent"])("GroupedSetting");return Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settings,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:"".concat(e.groupPrefix).concat(t.name)},[Object(l["createVNode"])(a,{"model-value":e.allSettingValues["".concat(e.groupPrefix).concat(t.name)],"onUpdate:modelValue":function(n){return e.$emit("change",{name:t.name,value:n})},setting:t,"condition-values":e.settingValues},null,8,["model-value","onUpdate:modelValue","setting","condition-values"])])})),128)}function fn(e,t,n,o,r,i){var a=Object(l["resolveComponent"])("FormField");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createVNode"])(a,{"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.changeValue(t)}),"form-field":e.settingWithComponent},null,8,["model-value","form-field"])],512)),[[l["vShow"],e.showField]])}var pn=Object(l["defineComponent"])({props:{setting:{type:Object,required:!0},modelValue:null,conditionValues:{type:Object,required:!0}},components:{FormField:qt},emits:["update:modelValue"],computed:{settingWithComponent:function(){return this.setting.templateFile?Object.assign(Object.assign({},this.setting),{},{component:Dt}):this.setting},showField:function(){var e=this.setting.condition;if(!e)return!0;if(!en){var t=i["Matomo"].helper.getAngularDependency("$rootScope");en=t.$new(!0)}return en.$eval(e,this.conditionValues)}},methods:{changeValue:function(e){this.$emit("update:modelValue",e)}}});pn.render=fn;var bn=pn;function vn(e,t){return jn(e)||yn(e,t)||gn(e,t)||hn()}function hn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gn(e,t){if(e){if("string"===typeof e)return On(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?On(e,t):void 0}}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function yn(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(i.push(o.value),t&&i.length===t)break}catch(u){a=!0,r=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw r}}return i}}function jn(e){if(Array.isArray(e))return e}var Vn=Object(l["defineComponent"])({props:{groupName:String,settings:{type:Array,required:!0},allSettingValues:{type:Object,required:!0}},emits:["change"],components:{GroupedSetting:bn},computed:{settingValues:function(){var e=this,t=Object.entries(this.allSettingValues).filter((function(t){var n=vn(t,1),o=n[0];if(e.groupName){var r=o.split("."),i=vn(r,1),l=i[0];if(l!==e.groupName)return!1}return!0})).map((function(t){var n=vn(t,2),o=n[0],r=n[1];return e.groupName?[o.split(".")[1],r]:[o,r]}));return Object.fromEntries(t)},groupPrefix:function(){return this.groupName?"".concat(this.groupName,"."):""}}});Vn.render=mn;var wn=Vn;function Cn(e,t){return Bn(e)||Fn(e,t)||kn(e,t)||Sn()}function Sn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kn(e,t){if(e){if("string"===typeof e)return An(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?An(e,t):void 0}}function An(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Fn(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(i.push(o.value),t&&i.length===t)break}catch(u){a=!0,r=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw r}}return i}}function Bn(e){if(Array.isArray(e))return e}var En=window,xn=En.$,Nn=Object(l["defineComponent"])({props:{mode:String},components:{ActivityIndicator:i["ActivityIndicator"],Field:Qt,GroupedSettings:wn},data:function(){return{isLoading:!0,isSaving:{},passwordConfirmation:"",settingsToSave:null,settingsPerPlugin:[],settingValues:{}}},created:function(){var e=this;i["AjaxHelper"].fetch({method:this.apiMethod}).then((function(t){e.isLoading=!1,e.settingsPerPlugin=t,t.forEach((function(t){t.settings.forEach((function(n){e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}))})),window.anchorLinkFix.scrollToAnchorInUrl(),e.addSectionsToTableOfContents()})).catch((function(){e.isLoading=!1}))},computed:{apiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.getSystemSettings":"CorePluginsAdmin.getUserSettings"},saveApiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.setSystemSettings":"CorePluginsAdmin.setUserSettings"}},methods:{addSectionsToTableOfContents:function(){var e=xn("#generalSettingsTOC");if(e.length){var t=this.settingsPerPlugin;t.forEach((function(t){var n=t.pluginName,o=t.settings;n&&("CoreAdminHome"===n&&o?o.filter((function(e){return e.introduction})).forEach((function(t){e.append('<a href="#/'.concat(n,'PluginSettings">').concat(t.introduction,"</a> "))})):e.append('<a href="#/'.concat(n,'">').concat(n.replace(/([A-Z])/g," $1").trim(),"</a> ")))}))}},saveSetting:function(e){"admin"===this.mode?this.showPasswordConfirmModal(e):this.save(e)},showPasswordConfirmModal:function(e){var t=this;this.settingsToSave=e;var n=this.$refs.root,o=xn(n),r=function(n){var r=n.keyCode?n.keyCode:n.which;13===r&&(o.find(".confirm-password-modal").modal("close"),t.save(e))};o.find(".confirm-password-modal").modal({dismissible:!1,onOpenEnd:function(){var e=".modal.open #currentUserPassword";xn(e).focus(),xn(e).off("keypress").keypress(r)}}).modal("open")},save:function(e){var t=this,n=this.saveApiMethod;this.isSaving[e]=!0;var o=this.getValuesForPlugin(e);i["AjaxHelper"].post({method:n},{settingValues:o,passwordConfirmation:this.passwordConfirmation}).then((function(){t.isSaving[e]=!1;var n=i["NotificationsStore"].show({message:Object(i["translate"])("CoreAdminHome_PluginSettingsSaveSuccess"),id:"generalSettings",context:"success",type:"transient"});i["NotificationsStore"].scrollToNotification(n)})).catch((function(){t.isSaving[e]=!1})),this.passwordConfirmation="",this.settingsToSave=null},getValuesForPlugin:function(e){var t={};return t[e]||(t[e]=[]),Object.entries(this.settingValues).forEach((function(n){var o=Cn(n,2),r=o[0],i=o[1],l=r.split("."),a=Cn(l,2),u=a[0],c=a[1];if(u===e){var s=i;!1===s?s="0":!0===s&&(s="1"),t[u].push({name:c,value:s})}})),t}}});Nn.render=dn;var Tn=Nn,$n=(Object(i["createAngularJsAdapter"])({component:Tn,scope:{mode:{angularJsBind:"@"}},directiveName:"piwikPluginSettings"}),window),Mn=$n.$; + */function Xt(e,t,n){if("string"===typeof e&&e&&("array"===t||"multituple"===n||"field-array"===n||"multiselect"===n||"site"===n)){var o=JSON.parse(e);return"site"===n&&(o.name=r["Matomo"].helper.htmlDecode(o.name)),o}return"checkbox"===n&&"array"!==t?Object(r["transformAngularJsBoolAttr"])(e):e}Object(r["createAngularJsAdapter"])({component:Qt,require:"?ngModel",scope:{uicontrol:{angularJsBind:"@"},name:{angularJsBind:"@"},value:{vue:"modelValue",angularJsBind:"@",transform:function(e,t,n){return Xt(e,n.varType,n.uicontrol)}},default:{vue:"defaultValue",angularJsBind:"@"},options:{angularJsBind:"="},description:{angularJsBind:"@"},introduction:{angularJsBind:"@"},title:{angularJsBind:"@"},inlineHelp:{angularJsBind:"@"},disabled:{angularJsBind:"=",transform:r["transformAngularJsBoolAttr"]},uiControlAttributes:{angularJsBind:"="},uiControlOptions:{angularJsBind:"="},autocomplete:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},condition:{angularJsBind:"@",transform:function(e,t,n){if(e)return function(t){return n.$eval(e,t)}}},varType:{angularJsBind:"@"},autofocus:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},tabindex:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},fullWidth:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},maxlength:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},required:{angularJsBind:"@",transform:r["transformAngularJsBoolAttr"]},placeholder:{angularJsBind:"@"},rows:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},min:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},max:{angularJsBind:"@",transform:r["transformAngularJsIntAttr"]},component:{angularJsBind:"<",transform:function(e,t,n){if(e){if(n.templateFile)return Object(l["shallowRef"])(Dt);var o=e.plugin,i=e.name;if(!o||!i)throw new Error("Invalid component property given to piwik-field directive, must be {plugin: '...',name: '...'}");return Object(l["shallowRef"])(Object(r["useExternalPluginComponent"])(o,i))}}}},directiveName:"piwikField",$inject:["$timeout"],events:{"update:modelValue":function(e,t,n,o,i,r,l){var a=r?r.$viewValue:n.value;e!==a&&l((function(){r?(r.$setViewValue(e),r.$render()):n.value=e}))}},postCreate:function(e,t,n,o,i){var a=i;if(a){if(a.$render=function(){Object(l["nextTick"])((function(){e.modelValue=Object(r["removeAngularJsSpecificProperties"])(a.$viewValue)}))},"undefined"!==typeof t.value){var u=Xt(t.value,t.varType,t.uicontrol);a.$setViewValue(u)}else a.$setViewValue(e.modelValue);"site"===t.uicontrol&&a.$viewValue&&setTimeout((function(){a.$setViewValue(Object.assign({},a.$viewValue))}))}else t.$watch("value",(function(n){if(n!==e.modelValue){var o=Xt(n,t.varType,t.uicontrol);Object(l["nextTick"])((function(){e.modelValue=o}))}}))}});var en,tn={class:"pluginSettings",ref:"root"},nn=["id"],on={class:"card-content"},rn=["id"],ln=["onClick","disabled","value"],an={class:"confirm-password-modal modal"},un={class:"modal-content"},cn={class:"modal-footer"},sn=["disabled"];function dn(e,t,n,o,i,r){var a=this,u=Object(l["resolveComponent"])("GroupedSettings"),c=Object(l["resolveComponent"])("ActivityIndicator"),s=Object(l["resolveComponent"])("Field");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",tn,[(Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settingsPerPlugin,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{class:"card",id:"".concat(t.pluginName,"PluginSettings"),key:"".concat(t.pluginName,"PluginSettings")},[Object(l["createElementVNode"])("div",on,[Object(l["createElementVNode"])("h2",{class:"card-title",id:t.pluginName},Object(l["toDisplayString"])(t.title),9,rn),Object(l["createVNode"])(u,{"group-name":t.pluginName,settings:t.settings,"all-setting-values":e.settingValues,onChange:function(n){return e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}},null,8,["group-name","settings","all-setting-values","onChange"]),Object(l["createElementVNode"])("input",{type:"button",onClick:function(n){return e.saveSetting(t.pluginName)},disabled:e.isLoading,class:"pluginsSettingsSubmit btn",value:e.translate("General_Save")},null,8,ln),Object(l["createVNode"])(c,{loading:e.isLoading||e.isSaving[t.pluginName]},null,8,["loading"])])],8,nn)})),128)),Object(l["createElementVNode"])("div",an,[Object(l["createElementVNode"])("div",un,[Object(l["createElementVNode"])("h2",null,Object(l["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(l["createElementVNode"])("div",null,[Object(l["createVNode"])(s,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(l["createElementVNode"])("div",cn,[Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",disabled:e.passwordConfirmation?void 0:"disabled",onClick:t[1]||(t[1]=function(t){t.preventDefault(),e.save(a.settingsToSave)})},Object(l["toDisplayString"])(e.translate("General_Yes")),9,sn),Object(l["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[2]||(t[2]=function(e){return e.preventDefault()})},Object(l["toDisplayString"])(e.translate("General_No")),1)])])],512)}function mn(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("GroupedSetting");return Object(l["openBlock"])(!0),Object(l["createElementBlock"])(l["Fragment"],null,Object(l["renderList"])(e.settings,(function(t){return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",{key:"".concat(e.groupPrefix).concat(t.name)},[Object(l["createVNode"])(a,{"model-value":e.allSettingValues["".concat(e.groupPrefix).concat(t.name)],"onUpdate:modelValue":function(n){return e.$emit("change",{name:t.name,value:n})},setting:t,"condition-values":e.settingValues},null,8,["model-value","onUpdate:modelValue","setting","condition-values"])])})),128)}function fn(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("FormField");return Object(l["withDirectives"])((Object(l["openBlock"])(),Object(l["createElementBlock"])("div",null,[Object(l["createVNode"])(a,{"model-value":e.modelValue,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.changeValue(t)}),"form-field":e.settingWithComponent},null,8,["model-value","form-field"])],512)),[[l["vShow"],e.showField]])}var pn=Object(l["defineComponent"])({props:{setting:{type:Object,required:!0},modelValue:null,conditionValues:{type:Object,required:!0}},components:{FormField:qt},emits:["update:modelValue"],computed:{settingWithComponent:function(){return this.setting.templateFile?Object.assign(Object.assign({},this.setting),{},{component:Dt}):this.setting},showField:function(){var e=this.setting.condition;if(!e)return!0;if(!en){var t=r["Matomo"].helper.getAngularDependency("$rootScope");en=t.$new(!0)}return en.$eval(e,this.conditionValues)}},methods:{changeValue:function(e){this.$emit("update:modelValue",e)}}});pn.render=fn;var bn=pn;function vn(e,t){return yn(e)||jn(e,t)||gn(e,t)||hn()}function hn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gn(e,t){if(e){if("string"===typeof e)return On(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?On(e,t):void 0}}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function jn(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function yn(e){if(Array.isArray(e))return e}var Vn=Object(l["defineComponent"])({props:{groupName:String,settings:{type:Array,required:!0},allSettingValues:{type:Object,required:!0}},emits:["change"],components:{GroupedSetting:bn},computed:{settingValues:function(){var e=this,t=Object.entries(this.allSettingValues).filter((function(t){var n=vn(t,1),o=n[0];if(e.groupName){var i=o.split("."),r=vn(i,1),l=r[0];if(l!==e.groupName)return!1}return!0})).map((function(t){var n=vn(t,2),o=n[0],i=n[1];return e.groupName?[o.split(".")[1],i]:[o,i]}));return Object.fromEntries(t)},groupPrefix:function(){return this.groupName?"".concat(this.groupName,"."):""}}});Vn.render=mn;var wn=Vn;function Cn(e,t){return Bn(e)||Fn(e,t)||kn(e,t)||Sn()}function Sn(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function kn(e,t){if(e){if("string"===typeof e)return An(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?An(e,t):void 0}}function An(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function Fn(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,i,r=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(o=n.next()).done);l=!0)if(r.push(o.value),t&&r.length===t)break}catch(u){a=!0,i=u}finally{try{l||null==n["return"]||n["return"]()}finally{if(a)throw i}}return r}}function Bn(e){if(Array.isArray(e))return e}var En=window,xn=En.$,Nn=Object(l["defineComponent"])({props:{mode:String},components:{ActivityIndicator:r["ActivityIndicator"],Field:Qt,GroupedSettings:wn},data:function(){return{isLoading:!0,isSaving:{},passwordConfirmation:"",settingsToSave:null,settingsPerPlugin:[],settingValues:{}}},created:function(){var e=this;r["AjaxHelper"].fetch({method:this.apiMethod}).then((function(t){e.isLoading=!1,e.settingsPerPlugin=t,t.forEach((function(t){t.settings.forEach((function(n){e.settingValues["".concat(t.pluginName,".").concat(n.name)]=n.value}))})),window.anchorLinkFix.scrollToAnchorInUrl(),e.addSectionsToTableOfContents()})).catch((function(){e.isLoading=!1}))},computed:{apiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.getSystemSettings":"CorePluginsAdmin.getUserSettings"},saveApiMethod:function(){return"admin"===this.mode?"CorePluginsAdmin.setSystemSettings":"CorePluginsAdmin.setUserSettings"}},methods:{addSectionsToTableOfContents:function(){var e=xn("#generalSettingsTOC");if(e.length){var t=this.settingsPerPlugin;t.forEach((function(t){var n=t.pluginName,o=t.settings;n&&("CoreAdminHome"===n&&o?o.filter((function(e){return e.introduction})).forEach((function(t){e.append('<a href="#/'.concat(n,'PluginSettings">').concat(t.introduction,"</a> "))})):e.append('<a href="#/'.concat(n,'">').concat(n.replace(/([A-Z])/g," $1").trim(),"</a> ")))}))}},saveSetting:function(e){"admin"===this.mode?this.showPasswordConfirmModal(e):this.save(e)},showPasswordConfirmModal:function(e){var t=this;this.settingsToSave=e;var n=this.$refs.root,o=xn(n),i=function(n){var i=n.keyCode?n.keyCode:n.which;13===i&&(o.find(".confirm-password-modal").modal("close"),t.save(e))};o.find(".confirm-password-modal").modal({dismissible:!1,onOpenEnd:function(){var e=".modal.open #currentUserPassword";xn(e).focus(),xn(e).off("keypress").keypress(i)}}).modal("open")},save:function(e){var t=this,n=this.saveApiMethod;this.isSaving[e]=!0;var o=this.getValuesForPlugin(e);r["AjaxHelper"].post({method:n},{settingValues:o,passwordConfirmation:this.passwordConfirmation}).then((function(){t.isSaving[e]=!1;var n=r["NotificationsStore"].show({message:Object(r["translate"])("CoreAdminHome_PluginSettingsSaveSuccess"),id:"generalSettings",context:"success",type:"transient"});r["NotificationsStore"].scrollToNotification(n)})).catch((function(){t.isSaving[e]=!1})),this.passwordConfirmation="",this.settingsToSave=null},getValuesForPlugin:function(e){var t={};return t[e]||(t[e]=[]),Object.entries(this.settingValues).forEach((function(n){var o=Cn(n,2),i=o[0],r=o[1],l=i.split("."),a=Cn(l,2),u=a[0],c=a[1];if(u===e){var s=r;!1===s?s="0":!0===s&&(s="1"),t[u].push({name:c,value:s})}})),t}}});Nn.render=dn;var Tn=Nn,$n=(Object(r["createAngularJsAdapter"])({component:Tn,scope:{mode:{angularJsBind:"@"}},directiveName:"piwikPluginSettings"}),window),Mn=$n.$; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function Pn(e,t){t.preventDefault();var n=Mn(t.target).attr("href"),o=Mn(t.target).attr("data-plugin-name");if(n&&o){e.value.uninstallConfirmMessage||(e.value.uninstallConfirmMessage=Mn("#uninstallPluginConfirm").text());var r=(e.value.uninstallConfirmMessage||"").replace("%s",o);Mn("#uninstallPluginConfirm").text(r),i["Matomo"].helper.modalConfirm("#confirmUninstallPlugin",{yes:function(){window.location.href=n}})}}function Jn(e){e.preventDefault();var t=Mn(e.target).data("overlay-id");i["Matomo"].helper.modalConfirm("#".concat(t),{})}var Hn={mounted:function(e,t){setTimeout((function(){t.value.uninstallConfirmMessage="",Mn(e).find(".uninstall").click(Pn.bind(null,t)),Mn(e).find(".plugin-donation-link").click(Jn)}))}}; + */function Pn(e,t){t.preventDefault();var n=Mn(t.target).attr("href"),o=Mn(t.target).attr("data-plugin-name");if(n&&o){e.value.uninstallConfirmMessage||(e.value.uninstallConfirmMessage=Mn("#uninstallPluginConfirm").text());var i=(e.value.uninstallConfirmMessage||"").replace("%s",o);Mn("#uninstallPluginConfirm").text(i),r["Matomo"].helper.modalConfirm("#confirmUninstallPlugin",{yes:function(){window.location.href=n}})}}function Jn(e){e.preventDefault();var t=Mn(e.target).data("overlay-id");r["Matomo"].helper.modalConfirm("#".concat(t),{})}var Hn={mounted:function(e,t){setTimeout((function(){t.value.uninstallConfirmMessage="",Mn(e).find(".uninstall").click(Pn.bind(null,t)),Mn(e).find(".plugin-donation-link").click(Jn)}))}}; /*! * Matomo - free/libre analytics platform * @@ -35,7 +35,7 @@ * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -var Ln=window,In=Ln.$;function zn(e){e.preventDefault(),i["Matomo"].helper.modalConfirm("#installPluginByUpload",{})}function Un(e){var t=In("[name=pluginZip]"),n=t.val();n&&".zip"===n.slice(-4)?t.data("maxSize")>0&&t[0].files[0].size>1048576*t.data("maxSize")&&(e.preventDefault(),alert(Object(i["translate"])("CorePluginsAdmin_FileExceedsUploadLimit"))):(e.preventDefault(),alert(Object(i["translate"])("CorePluginsAdmin_NoZipFileSelected")))}var Kn={mounted:function(){setTimeout((function(){In(".uploadPlugin").click(zn),In("#uploadPluginForm").submit(Un)}))}}; +var In=window,Ln=In.$;function zn(e){e.preventDefault(),r["Matomo"].helper.modalConfirm("#installPluginByUpload",{})}function Un(e){var t=Ln("[name=pluginZip]"),n=t.val();n&&".zip"===n.slice(-4)?t.data("maxSize")>0&&t[0].files[0].size>1048576*t.data("maxSize")&&(e.preventDefault(),alert(Object(r["translate"])("CorePluginsAdmin_FileExceedsUploadLimit"))):(e.preventDefault(),alert(Object(r["translate"])("CorePluginsAdmin_NoZipFileSelected")))}var Kn={mounted:function(){setTimeout((function(){Ln(".uploadPlugin").click(zn),Ln("#uploadPluginForm").submit(Un)}))}}; /*! * Matomo - free/libre analytics platform * @@ -48,13 +48,13 @@ var Ln=window,In=Ln.$;function zn(e){e.preventDefault(),i["Matomo"].helper.modal * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later */ -var qn=window,Rn=qn.$;function Gn(e){return e.find(".origin a.active").data("filter-origin")}function Wn(e){return e.find(".status a.active").data("filter-status")}function Zn(e,t){var n="#plugins tr";return n+="all"===e?"[data-filter-origin]":"[data-filter-origin=".concat(e,"]"),n+="all"===t?"[data-filter-status]":"[data-filter-status=".concat(t,"]"),Rn(n)}function Yn(e,t,n,o){var r=Zn(n,o).length,i=" (".concat(r,")");e.find("".concat(t," .counter")).text(i)}function Qn(e){var t=Gn(e),n=Wn(e);Yn(e,'[data-filter-status="all"]',t,"all"),Yn(e,'[data-filter-status="active"]',t,"active"),Yn(e,'[data-filter-status="inactive"]',t,"inactive"),Yn(e,'[data-filter-origin="all"]',"all",n),Yn(e,'[data-filter-origin="core"]',"core",n),Yn(e,'[data-filter-origin="official"]',"official",n),Yn(e,'[data-filter-origin="thirdparty"]',"thirdparty",n)}function Xn(e){var t=Gn(e),n=Wn(e),o=Zn(t,n);Rn("#plugins tr[data-filter-origin][data-filter-status]").css("display","none"),o.css("display","table-row"),Qn(e)}function eo(e,t){t.preventDefault(),Rn(t.target).siblings().removeClass("active"),Rn(t.target).addClass("active"),Xn(e)}function to(e,t){t.preventDefault(),Rn(t.target).siblings().removeClass("active"),Rn(t.target).addClass("active"),Xn(e)}var no={mounted:function(e){setTimeout((function(){Qn(Rn(e)),Rn(e).find(".status").on("click","a",eo.bind(null,Rn(e))),Rn(e).find(".origin").on("click","a",to.bind(null,Rn(e)))}))}}; +var qn=window,Rn=qn.$;function Gn(e){return e.find(".origin a.active").data("filter-origin")}function Wn(e){return e.find(".status a.active").data("filter-status")}function Zn(e,t){var n="#plugins tr";return n+="all"===e?"[data-filter-origin]":"[data-filter-origin=".concat(e,"]"),n+="all"===t?"[data-filter-status]":"[data-filter-status=".concat(t,"]"),Rn(n)}function Yn(e,t,n,o){var i=Zn(n,o).length,r=" (".concat(i,")");e.find("".concat(t," .counter")).text(r)}function Qn(e){var t=Gn(e),n=Wn(e);Yn(e,'[data-filter-status="all"]',t,"all"),Yn(e,'[data-filter-status="active"]',t,"active"),Yn(e,'[data-filter-status="inactive"]',t,"inactive"),Yn(e,'[data-filter-origin="all"]',"all",n),Yn(e,'[data-filter-origin="core"]',"core",n),Yn(e,'[data-filter-origin="official"]',"official",n),Yn(e,'[data-filter-origin="thirdparty"]',"thirdparty",n)}function Xn(e){var t=Gn(e),n=Wn(e),o=Zn(t,n);Rn("#plugins tr[data-filter-origin][data-filter-status]").css("display","none"),o.css("display","table-row"),Qn(e)}function eo(e,t){t.preventDefault(),Rn(t.target).siblings().removeClass("active"),Rn(t.target).addClass("active"),Xn(e)}function to(e,t){t.preventDefault(),Rn(t.target).siblings().removeClass("active"),Rn(t.target).addClass("active"),Xn(e)}var no={mounted:function(e){setTimeout((function(){Qn(Rn(e)),Rn(e).find(".status").on("click","a",eo.bind(null,Rn(e))),Rn(e).find(".origin").on("click","a",to.bind(null,Rn(e)))}))}}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function oo(){return{restrict:"A",link:function(e,t){no.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikPluginFilter",oo);var ro={class:"matomo-save-button",style:{display:"inline-block"}},io=["disabled","value"];function lo(e,t,n,o,r,i){var a=Object(l["resolveComponent"])("ActivityIndicator");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",ro,[Object(l["createElementVNode"])("input",{type:"button",onClick:t[0]||(t[0]=function(t){return e.onConfirm(t)}),disabled:e.saving||e.disabled,class:"btn",value:e.value?e.value:e.translate("General_Save")},null,8,io),Object(l["createVNode"])(a,{loading:e.saving},null,8,["loading"])])}var ao=Object(l["defineComponent"])({props:{saving:Boolean,value:String,disabled:Boolean},components:{ActivityIndicator:i["ActivityIndicator"]},emits:["confirm"],methods:{onConfirm:function(e){this.$emit("confirm",e)}}});ao.render=lo;var uo=ao,co=(Object(i["createAngularJsAdapter"])({component:uo,scope:{saving:{angularJsBind:"=?"},value:{angularJsBind:"@?"},disabled:{angularJsBind:"=?"},onconfirm:{angularJsBind:"&?",vue:"confirm"}},events:{confirm:function(e,t,n,o,r,i,l){o[0].click(),l()}},replace:!0,directiveName:"piwikSaveButton",$inject:["$timeout"]}),window),so=co.$,mo={mounted:function(e){setTimeout((function(){so(e).find("input[type=text]").keypress((function(t){var n=t.keyCode||t.which;13===n&&so(e).find(".matomo-save-button input").triggerHandler("click")}))}))}}; + */function oo(){return{restrict:"A",link:function(e,t){no.mounted(t[0])}}}window.angular.module("piwikApp").directive("piwikPluginFilter",oo);var io={class:"matomo-save-button",style:{display:"inline-block"}},ro=["disabled","value"];function lo(e,t,n,o,i,r){var a=Object(l["resolveComponent"])("ActivityIndicator");return Object(l["openBlock"])(),Object(l["createElementBlock"])("div",io,[Object(l["createElementVNode"])("input",{type:"button",onClick:t[0]||(t[0]=function(t){return e.onConfirm(t)}),disabled:e.saving||e.disabled,class:"btn",value:e.value?e.value:e.translate("General_Save")},null,8,ro),Object(l["createVNode"])(a,{loading:e.saving},null,8,["loading"])])}var ao=Object(l["defineComponent"])({props:{saving:Boolean,value:String,disabled:Boolean},components:{ActivityIndicator:r["ActivityIndicator"]},emits:["confirm"],methods:{onConfirm:function(e){this.$emit("confirm",e)}}});ao.render=lo;var uo=ao,co=(Object(r["createAngularJsAdapter"])({component:uo,scope:{saving:{angularJsBind:"=?"},value:{angularJsBind:"@?"},disabled:{angularJsBind:"=?"},onconfirm:{angularJsBind:"&?",vue:"confirm"}},events:{confirm:function(e,t,n,o,i,r,l){o[0].click(),l()}},replace:!0,directiveName:"piwikSaveButton",$inject:["$timeout"]}),window),so=co.$,mo={mounted:function(e){setTimeout((function(){so(e).find("input[type=text]").keypress((function(t){var n=t.keyCode||t.which;13===n&&so(e).find(".matomo-save-button input").triggerHandler("click")}))}))}}; /*! * Matomo - free/libre analytics platform * diff --git a/plugins/CorePluginsAdmin/vue/src/Field/Field.vue b/plugins/CorePluginsAdmin/vue/src/Field/Field.vue index 02184e242b..b564ec9acd 100644 --- a/plugins/CorePluginsAdmin/vue/src/Field/Field.vue +++ b/plugins/CorePluginsAdmin/vue/src/Field/Field.vue @@ -9,7 +9,11 @@ :form-field="field" :model-value="modelValue" @update:model-value="onChange($event)" - /> + > + <template v-slot:inline-help> + <slot name="inline-help"></slot> + </template> + </FormField> </template> <script lang="ts"> diff --git a/plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue b/plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue index 1982b7ff07..57186f0d9e 100644 --- a/plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue +++ b/plugins/CorePluginsAdmin/vue/src/FormField/FormField.vue @@ -53,13 +53,15 @@ <span class="inline-help" ref="inlineHelp" - v-if="formField.inlineHelp" + v-if="formField.inlineHelp || hasInlineHelpSlot" > <component v-if="inlineHelpComponent" :is="inlineHelpComponent" v-bind="inlineHelpBind" /> + + <slot name="inline-help"></slot> </span> <span v-show="showDefaultValue"> <br /> @@ -277,7 +279,8 @@ export default defineComponent({ showFormHelp() { return this.formField.description || this.formField.inlineHelp - || this.showDefaultValue; + || this.showDefaultValue + || this.hasInlineHelpSlot; }, showDefaultValue() { return this.defaultValuePretty @@ -391,6 +394,14 @@ export default defineComponent({ defaultValuePrettyTruncated() { return this.defaultValuePretty.substring(0, 50); }, + hasInlineHelpSlot() { + if (!this.$slots['inline-help']) { + return false; + } + + const inlineHelpSlot = this.$slots['inline-help'](); + return !!inlineHelpSlot?.[0]?.children?.length; + }, }, methods: { onChange(newValue: unknown) { diff --git a/plugins/GeoIp2/GeoIp2.php b/plugins/GeoIp2/GeoIp2.php index 3f9363a3f2..273cffeacd 100644 --- a/plugins/GeoIp2/GeoIp2.php +++ b/plugins/GeoIp2/GeoIp2.php @@ -24,7 +24,6 @@ class GeoIp2 extends \Piwik\Plugin public function registerEvents() { return array( - 'AssetManager.getJavaScriptFiles' => 'getJsFiles', 'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys', 'Installation.defaultSettingsForm.init' => 'installationFormInit', 'Installation.defaultSettingsForm.submit' => 'installationFormSubmit', @@ -44,12 +43,6 @@ class GeoIp2 extends \Piwik\Plugin } } - public function getJsFiles(&$jsFiles) - { - $jsFiles[] = "plugins/GeoIp2/angularjs/geoip2-updater/geoip2-updater.controller.js"; - $jsFiles[] = "plugins/GeoIp2/angularjs/geoip2-updater/geoip2-updater.directive.js"; - } - public function getClientSideTranslationKeys(&$translationKeys) { $translationKeys[] = "GeoIp2_FatalErrorDuringDownload"; @@ -57,6 +50,29 @@ class GeoIp2 extends \Piwik\Plugin $translationKeys[] = "General_Done"; $translationKeys[] = "General_Save"; $translationKeys[] = "General_Continue"; + $translationKeys[] = 'GeoIp2_ISPRequiresProviderPlugin'; + $translationKeys[] = 'GeoIp2_UpdaterWasLastRun'; + $translationKeys[] = 'GeoIp2_UpdaterIsNotScheduledToRun'; + $translationKeys[] = 'GeoIp2_GeoIPUpdaterIntro'; + $translationKeys[] = 'GeoIp2_IWantToDownloadFreeGeoIP'; + $translationKeys[] = 'General_GetStarted'; + $translationKeys[] = 'GeoIp2_GeoIPDatabases'; + $translationKeys[] = 'GeoIp2_NotManagingGeoIPDBs'; + $translationKeys[] = 'GeoIp2_IPurchasedGeoIPDBs'; + $translationKeys[] = 'UserCountry_GeoIpDbIpAccuracyNote'; + $translationKeys[] = 'GeoIp2_GeoIPUpdaterInstructions'; + $translationKeys[] = 'GeoIp2_GeoLiteCityLink'; + $translationKeys[] = 'UserCountry_MaxMindLinkExplanation'; + $translationKeys[] = 'GeoIp2_LocationDatabase'; + $translationKeys[] = 'Actions_ColumnDownloadURL'; + $translationKeys[] = 'GeoIp2_LocationDatabaseHint'; + $translationKeys[] = 'GeoIp2_ISPDatabase'; + $translationKeys[] = 'GeoIp2_DownloadNewDatabasesEvery'; + $translationKeys[] = 'GeoIp2_CannotSetupGeoIPAutoUpdating'; + $translationKeys[] = 'GeoIp2_UpdaterHasNotBeenRun'; + $translationKeys[] = 'GeoIp2_UpdaterScheduledForNextRun'; + $translationKeys[] = 'GeoIp2_UpdaterWillRunNext'; + $translationKeys[] = 'GeoIp2_DownloadingDb'; } /** diff --git a/plugins/GeoIp2/angularjs/geoip2-updater/geoip2-updater.controller.js b/plugins/GeoIp2/angularjs/geoip2-updater/geoip2-updater.controller.js deleted file mode 100644 index 1d3ec3772c..0000000000 --- a/plugins/GeoIp2/angularjs/geoip2-updater/geoip2-updater.controller.js +++ /dev/null @@ -1,149 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ -(function () { - angular.module('piwikApp').controller('Geoip2UpdaterController', Geoip2UpdaterController); - - Geoip2UpdaterController.$inject = ['piwikApi', '$window']; - - function Geoip2UpdaterController(piwikApi, $window) { - // remember to keep controller very simple. Create a service/factory (model) if needed - var self = this; - - this.buttonUpdateSaveText = _pk_translate('General_Save'); - this.progressUpdateLabel = ''; - - // geoip database wizard - var downloadNextChunk = function (action, thisId, progressBarId, cont, extraData, callback) { - var data = {}; - for (var k in extraData) { - data[k] = extraData[k]; - } - - piwikApi.withTokenInUrl(); - piwikApi.post({ - module: 'GeoIp2', - action: action, - 'continue': cont ? 1 : 0 - }, data).then(function (response) { - if (!response || response.error) { - callback(response); - } else { - // update progress bar - var newProgressVal = Math.floor((response.current_size / response.expected_file_size) * 100); - self[progressBarId] = Math.min(newProgressVal, 100); - - // if incomplete, download next chunk, otherwise, show updater manager - if (newProgressVal < 100) { - downloadNextChunk(action, thisId, progressBarId, true, extraData, callback); - } else { - callback(response); - } - } - }, function () { - callback({error: _pk_translate('GeoIp2_FatalErrorDuringDownload')}); - }); - }; - - this.startDownloadFreeGeoIp = function () { - this.showFreeDownload = true; - this.showPiwikNotManagingInfo = false; - - this.progressFreeDownload = 0; - - // start download of free dbs - downloadNextChunk( - 'downloadFreeDBIPLiteDB', - 'geoipdb-screen2-download', - 'progressFreeDownload', - false, - {}, - function (response) { - if (response.error) { - $('#geoipdb-update-info').html(response.error); - self.geoipDatabaseInstalled = true; - } else { - $window.location.reload(); - } - } - ); - }; - - this.startAutomaticUpdateGeoIp = function () { - this.buttonUpdateSaveText = _pk_translate('General_Continue'); - this.showGeoIpUpdateInfo(); - }; - - this.showGeoIpUpdateInfo = function () { - this.geoipDatabaseInstalled = true; - - // todo we need to replace this the proper way eventually - $('#geoip-db-mangement .card-title').text(_pk_translate('GeoIp2_SetupAutomaticUpdatesOfGeoIP')); - } - - this.saveGeoIpLinks = function () { - var currentDownloading = null; - var updateGeoIPSuccess = function (response) { - if (response && response.error) { - self.isUpdatingGeoIpDatabase = false; - - var UI = require('piwik/UI'); - var notification = new UI.Notification(); - notification.show(response.error, { - placeat: '#geoipdb-update-info-error', - context: 'error', - style: {display: 'inline-block'}, - id: 'userCountryGeoIpUpdate' - }); - - } else if (response && response.to_download) { - var continuing = currentDownloading == response.to_download; - currentDownloading = response.to_download; - - // show progress bar w/ message - self.progressUpdateDownload = 0; - self.progressUpdateLabel = response.to_download_label; - self.isUpdatingGeoIpDatabase = true; - - // start/continue download - downloadNextChunk( - 'downloadMissingGeoIpDb', 'geoipdb-update-info', 'progressUpdateDownload', - continuing, {key: response.to_download}, updateGeoIPSuccess); - - } else { - self.progressUpdateLabel = ''; - self.isUpdatingGeoIpDatabase = false; - - var UI = require('piwik/UI'); - var notification = new UI.Notification(); - notification.show(_pk_translate('General_Done'), { - placeat: '#done-updating-updater', - context: 'success', - noclear: true, - type: 'toast', - style: {display: 'inline-block'}, - id: 'userCountryGeoIpUpdate' - }); - - $('#geoip-updater-next-run-time').html(response.nextRunTime).parent().effect('highlight', {color: '#FFFFCB'}, 2000); - } - }; - - piwikApi.withTokenInUrl(); - piwikApi.post({ - period: this.updatePeriod, - module: 'GeoIp2', - action: 'updateGeoIPLinks' - }, { - loc_db: this.locationDbUrl, - isp_db: this.ispDbUrl, - org_db: this.orgDbUrl - }).then(updateGeoIPSuccess); - }; - - - } -})();
\ No newline at end of file diff --git a/plugins/GeoIp2/angularjs/geoip2-updater/geoip2-updater.directive.js b/plugins/GeoIp2/angularjs/geoip2-updater/geoip2-updater.directive.js deleted file mode 100644 index 5ccc7e4704..0000000000 --- a/plugins/GeoIp2/angularjs/geoip2-updater/geoip2-updater.directive.js +++ /dev/null @@ -1,37 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - * <div piwik-geoip2-updater> - */ -(function () { - angular.module('piwikApp').directive('piwikGeoip2Updater', piwikGeoip2Updater); - - piwikGeoip2Updater.$inject = ['piwik']; - - function piwikGeoip2Updater(piwik){ - - return { - restrict: 'A', - transclude: true, - controller: 'Geoip2UpdaterController', - controllerAs: 'locationUpdater', - template: '<div ng-transclude></div>', - compile: function (element, attrs) { - - return function (scope, element, attrs, controller) { - controller.geoipDatabaseInstalled = '0' !== attrs.geoipDatabaseInstalled; - controller.showFreeDownload = false; - controller.showPiwikNotManagingInfo = true; - controller.progressFreeDownload = 0; - controller.progressUpdateDownload = 0; - }; - } - }; - } -})();
\ No newline at end of file diff --git a/plugins/GeoIp2/templates/configuration.twig b/plugins/GeoIp2/templates/configuration.twig index 91ea3dd5d6..537b27e7e5 100644 --- a/plugins/GeoIp2/templates/configuration.twig +++ b/plugins/GeoIp2/templates/configuration.twig @@ -1,51 +1,17 @@ -<div piwik-content-block - content-title="{% if not geoIPDatabasesInstalled %}{{ 'GeoIp2_GeoIPDatabases'|translate|e('html_attr') }}{% else %}{{ 'GeoIp2_SetupAutomaticUpdatesOfGeoIP'|translate|e('html_attr') }}{% endif %}" - id="geoip-db-mangement"> - - <div piwik-geoip2-updater - geoip-database-installed="{% if geoIPDatabasesInstalled %}1{% else %}0{% endif %}"> - - {% if showGeoIPUpdateSection %} - {% if not geoIPDatabasesInstalled %} - <div ng-show="!locationUpdater.geoipDatabaseInstalled"> - <div ng-show="locationUpdater.showPiwikNotManagingInfo"> - <h3>{{ 'GeoIp2_NotManagingGeoIPDBs'|translate|e('html_attr') }}</h3> - <div id="manage-geoip-dbs"> - <div class="row" id="geoipdb-screen1"> - <div class="geoipdb-column-1 col s6"> - <p>{{ 'GeoIp2_IWantToDownloadFreeGeoIP'|translate|raw }}<sup><small>*</small></sup></p> - </div> - <div class="geoipdb-column-2 col s6"> - <p>{{ 'GeoIp2_IPurchasedGeoIPDBs'|translate('<a rel="noreferrer noopener" href="http://www.maxmind.com/en/geolocation_landing?rId=piwik">','</a>','<a rel="noreferrer noopener" href="https://db-ip.com/db/?refid=mtm">','</a>')|raw }}</p> - </div> - <div class="geoipdb-column-1 col s6"> - <input type="button" class="btn" - ng-click="locationUpdater.startDownloadFreeGeoIp()" - value="{{ 'General_GetStarted'|translate }}..."/> - </div> - <div class="geoipdb-column-2 col s6"> - <input type="button" class="btn" - ng-click="locationUpdater.startAutomaticUpdateGeoIp()" - value="{{ 'General_GetStarted'|translate }}..." id="start-automatic-update-geoip"/> - </div> - </div> - <div class="row"> - <p><sup>* <small>{{ 'UserCountry_GeoIpDbIpAccuracyNote'|translate('<a href="https://dev.maxmind.com/geoip/geoip2/geolite2/?rId=piwik" rel="noreferrer noopener" target="_blank">', '</a>')|raw }}.</small></sup></p> - </div> - </div> - </div> - <div id="geoipdb-screen2-download" ng-show="locationUpdater.showFreeDownload"> - <div piwik-progressbar - label="{{ ('GeoIp2_DownloadingDb'|translate('<a href="'~dbipLiteUrl~'">'~dbipLiteFilename~'</a>') ~ '...')|json_encode }}" - progress="locationUpdater.progressFreeDownload"> - </div> - </div> - </div> - {% endif %} - - {% include "@GeoIp2/_updaterManage.twig" %} - {% else %} - <p class="form-description">{{ 'GeoIp2_CannotSetupGeoIPAutoUpdating'|translate }}</p> - {% endif %} - </div> -</div>
\ No newline at end of file +<div + piwik-geoip2-updater + geoip-database-started-installed="{{ geoIPDatabasesInstalled|default(null)|json_encode|e('html_attr') }}" + show-geoip-update-section="{{ showGeoIPUpdateSection|default(null)|json_encode|e('html_attr') }}" + dbip-lite-url="{{ dbipLiteUrl|default(null)|json_encode|e('html_attr') }}" + dbip-lite-filename="{{ dbipLiteFilename|default(null)|json_encode|e('html_attr') }}" + geoip-loc-url="{{ geoIPLocUrl|default(null)|json_encode|e('html_attr') }}" + is-provider-plugin-active="{{ isProviderPluginActive|default(null)|json_encode|e('html_attr') }}" + geoip-isp-url="{{ geoIPIspUrl|default(null)|json_encode|e('html_attr') }}" + last-time-updater-run="{{ lastTimeUpdaterRun|default(null)|json_encode|e('html_attr') }}" + geoip-update-period="{{ geoIPUpdatePeriod|default(null)|json_encode|e('html_attr') }}" + update-period-options="{{ updatePeriodOptions|default(null)|json_encode|e('html_attr') }}" + is-provider-plugin-active="{{ isProviderPluginActive|default(null)|json_encode|e('html_attr') }}" + next-run-time="{{ (nextRunTime ? nextRunTime.getTimestamp() : null)|json_encode|e('html_attr') }}" + next-run-time-pretty="{{ (nextRunTime ? nextRunTime.toString() : null)|json_encode|e('html_attr') }}" +> +</div> diff --git a/plugins/GeoIp2/vue/dist/GeoIp2.umd.js b/plugins/GeoIp2/vue/dist/GeoIp2.umd.js new file mode 100644 index 0000000000..7e2379e2db --- /dev/null +++ b/plugins/GeoIp2/vue/dist/GeoIp2.umd.js @@ -0,0 +1,661 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("CoreHome"), require("vue"), require("CorePluginsAdmin")); + else if(typeof define === 'function' && define.amd) + define(["CoreHome", , "CorePluginsAdmin"], factory); + else if(typeof exports === 'object') + exports["GeoIp2"] = factory(require("CoreHome"), require("vue"), require("CorePluginsAdmin")); + else + root["GeoIp2"] = factory(root["CoreHome"], root["Vue"], root["CorePluginsAdmin"]); +})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__19dc__, __WEBPACK_EXTERNAL_MODULE__8bbf__, __WEBPACK_EXTERNAL_MODULE_a5a2__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "plugins/GeoIp2/vue/dist/"; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "fae3"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "19dc": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__19dc__; + +/***/ }), + +/***/ "8bbf": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE__8bbf__; + +/***/ }), + +/***/ "a5a2": +/***/ (function(module, exports) { + +module.exports = __WEBPACK_EXTERNAL_MODULE_a5a2__; + +/***/ }), + +/***/ "fae3": +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +// ESM COMPAT FLAG +__webpack_require__.r(__webpack_exports__); + +// EXPORTS +__webpack_require__.d(__webpack_exports__, "Geoip2Updater", function() { return /* reexport */ Geoip2Updater; }); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js +// This file is imported into lib/wc client bundles. + +if (typeof window !== 'undefined') { + var currentScript = window.document.currentScript + if (false) { var getCurrentScript; } + + var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/) + if (src) { + __webpack_require__.p = src[1] // eslint-disable-line + } +} + +// Indicate to webpack that this file can be concatenated +/* harmony default export */ var setPublicPath = (null); + +// EXTERNAL MODULE: external "CoreHome" +var external_CoreHome_ = __webpack_require__("19dc"); + +// EXTERNAL MODULE: external {"commonjs":"vue","commonjs2":"vue","root":"Vue"} +var external_commonjs_vue_commonjs2_vue_root_Vue_ = __webpack_require__("8bbf"); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.vue?vue&type=template&id=10f3bd2c + +var _hoisted_1 = { + key: 0 +}; +var _hoisted_2 = { + key: 0 +}; +var _hoisted_3 = { + id: "manage-geoip-dbs" +}; +var _hoisted_4 = { + class: "row", + id: "geoipdb-screen1" +}; +var _hoisted_5 = { + class: "geoipdb-column-1 col s6" +}; + +var _hoisted_6 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("sup", null, [/*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("small", null, "*")], -1); + +var _hoisted_7 = { + class: "geoipdb-column-2 col s6" +}; +var _hoisted_8 = ["innerHTML"]; +var _hoisted_9 = { + class: "geoipdb-column-1 col s6" +}; +var _hoisted_10 = ["value"]; +var _hoisted_11 = { + class: "geoipdb-column-2 col s6" +}; +var _hoisted_12 = ["value"]; +var _hoisted_13 = { + class: "row" +}; + +var _hoisted_14 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])("* "); + +var _hoisted_15 = ["innerHTML"]; +var _hoisted_16 = { + id: "geoipdb-screen2-download" +}; +var _hoisted_17 = { + key: 1, + id: "geoipdb-update-info" +}; +var _hoisted_18 = ["innerHTML"]; + +var _hoisted_19 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_20 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_21 = ["innerHTML"]; +var _hoisted_22 = ["innerHTML"]; + +var _hoisted_23 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_24 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_25 = { + id: "locationProviderUpdatePeriodInlineHelp", + class: "inline-help-node", + ref: "inlineHelpNode" +}; +var _hoisted_26 = ["innerHTML"]; +var _hoisted_27 = { + key: 1 +}; + +var _hoisted_28 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_29 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); + +var _hoisted_30 = ["innerHTML"]; +var _hoisted_31 = ["value"]; + +var _hoisted_32 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + id: "done-updating-updater" +}, null, -1); + +var _hoisted_33 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + id: "geoipdb-update-info-error" +}, null, -1); + +var _hoisted_34 = ["innerHTML"]; +var _hoisted_35 = { + key: 1 +}; +var _hoisted_36 = { + class: "form-description" +}; +function render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Progressbar = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Progressbar"); + + var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); + + var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ContentBlock, { + "content-title": _ctx.contentTitle, + id: "geoip-db-mangement" + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [_ctx.showGeoipUpdateSection ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_1, [!_ctx.geoipDatabaseInstalled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GeoIp2_NotManagingGeoIPDBs')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GeoIp2_IWantToDownloadFreeGeoIP')), 1), _hoisted_6])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", { + innerHTML: _ctx.purchasedGeoIpText + }, null, 8, _hoisted_8)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + class: "btn", + onClick: _cache[0] || (_cache[0] = function ($event) { + return _ctx.startDownloadFreeGeoIp(); + }), + value: "".concat(_ctx.translate('General_GetStarted'), "...") + }, null, 8, _hoisted_10)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + class: "btn", + id: "start-automatic-update-geoip", + onClick: _cache[1] || (_cache[1] = function ($event) { + return _ctx.startAutomaticUpdateGeoIp(); + }), + value: "".concat(_ctx.translate('General_GetStarted'), "...") + }, null, 8, _hoisted_12)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("sup", null, [_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("small", { + innerHTML: _ctx.accuracyNote + }, null, 8, _hoisted_15)])])])])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showPiwikNotManagingInfo]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Progressbar, { + label: _ctx.freeProgressbarLabel, + progress: _ctx.progressFreeDownload + }, null, 8, ["label", "progress"])])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showFreeDownload]])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.geoipDatabaseInstalled && !_ctx.downloadErrorMessage ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.geoIPUpdaterInstructions + }, null, 8, _hoisted_18), _hoisted_19, _hoisted_20, !!_ctx.dbipLiteUrl ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 0, + innerHTML: _ctx.geoliteCityLink + }, null, 8, _hoisted_21)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.maxMindLinkExplanation + }, null, 8, _hoisted_22), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, [_hoisted_23, _hoisted_24, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GeoIp2_GeoIPUpdaterIntro')) + ": ", 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.geoipDatabaseInstalled]])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "text", + name: "geoip-location-db", + introduction: _ctx.translate('GeoIp2_LocationDatabase'), + title: _ctx.translate('Actions_ColumnDownloadURL'), + "inline-help": _ctx.translate('GeoIp2_LocationDatabaseHint'), + modelValue: _ctx.locationDbUrl, + "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) { + return _ctx.locationDbUrl = $event; + }) + }, null, 8, ["introduction", "title", "inline-help", "modelValue"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "text", + name: "geoip-isp-db", + introduction: _ctx.translate('GeoIp2_ISPDatabase'), + title: _ctx.translate('Actions_ColumnDownloadURL'), + "inline-help": _ctx.providerPluginHelp, + modelValue: _ctx.ispDbUrl, + "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) { + return _ctx.ispDbUrl = $event; + }), + disabled: !_ctx.isProviderPluginActive + }, null, 8, ["introduction", "title", "inline-help", "modelValue", "disabled"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + uicontrol: "radio", + name: "geoip-update-period", + introduction: _ctx.translate('GeoIp2_DownloadNewDatabasesEvery'), + modelValue: _ctx.updatePeriod, + "onUpdate:modelValue": _cache[4] || (_cache[4] = function ($event) { + return _ctx.updatePeriod = $event; + }), + options: _ctx.updatePeriodOptions + }, { + "inline-help": Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_25, [_ctx.lastTimeUpdaterRun ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", { + key: 0, + innerHTML: _ctx.$sanitize(_ctx.translate('GeoIp2_UpdaterWasLastRun', _ctx.lastTimeUpdaterRun)) + }, null, 8, _hoisted_26)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_27, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GeoIp2_UpdaterHasNotBeenRun')), 1)), _hoisted_28, _hoisted_29, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + id: "geoip-updater-next-run-time", + innerHTML: _ctx.$sanitize(_ctx.nextRunTimeText) + }, null, 8, _hoisted_30)], 512)]; + }), + _: 1 + }, 8, ["introduction", "modelValue", "options"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "button", + class: "btn", + onClick: _cache[5] || (_cache[5] = function ($event) { + return _ctx.saveGeoIpLinks(); + }), + value: _ctx.buttonUpdateSaveText + }, null, 8, _hoisted_31), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [_hoisted_32, _hoisted_33, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Progressbar, { + progress: _ctx.progressUpdateDownload, + label: _ctx.progressUpdateLabel + }, null, 8, ["progress", "label"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isUpdatingGeoIpDatabase]])])])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.downloadErrorMessage ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + key: 2, + innerHTML: _ctx.$sanitize(_ctx.downloadErrorMessage) + }, null, 8, _hoisted_34)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_35, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", _hoisted_36, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GeoIp2_CannotSetupGeoIPAutoUpdating')), 1)]))]; + }), + _: 1 + }, 8, ["content-title"]); +} +// CONCATENATED MODULE: ./plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.vue?vue&type=template&id=10f3bd2c + +// EXTERNAL MODULE: external "CorePluginsAdmin" +var external_CorePluginsAdmin_ = __webpack_require__("a5a2"); + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.vue?vue&type=script&lang=ts + + + +var _window = window, + $ = _window.$; +/* harmony default export */ var Geoip2Updatervue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + geoipDatabaseStartedInstalled: Boolean, + showGeoipUpdateSection: { + type: Boolean, + required: true + }, + dbipLiteUrl: { + type: String, + required: true + }, + dbipLiteFilename: { + type: String, + required: true + }, + geoipLocUrl: String, + isProviderPluginActive: Boolean, + geoipIspUrl: String, + lastTimeUpdaterRun: String, + geoipUpdatePeriod: String, + updatePeriodOptions: { + type: Object, + required: true + }, + nextRunTime: Number, + nextRunTimePretty: String + }, + components: { + Progressbar: external_CoreHome_["Progressbar"], + Field: external_CorePluginsAdmin_["Field"], + ContentBlock: external_CoreHome_["ContentBlock"] + }, + data: function data() { + return { + geoipDatabaseInstalled: !!this.geoipDatabaseStartedInstalled, + showFreeDownload: false, + showPiwikNotManagingInfo: true, + progressFreeDownload: 0, + progressUpdateDownload: 0, + buttonUpdateSaveText: Object(external_CoreHome_["translate"])('General_Save'), + progressUpdateLabel: '', + locationDbUrl: this.geoipLocUrl || '', + ispDbUrl: this.geoipIspUrl || '', + orgDbUrl: '', + updatePeriod: this.geoipUpdatePeriod || 'month', + isUpdatingGeoIpDatabase: false, + downloadErrorMessage: null + }; + }, + methods: { + startDownloadFreeGeoIp: function startDownloadFreeGeoIp() { + var _this = this; + + this.showFreeDownload = true; + this.showPiwikNotManagingInfo = false; + this.progressFreeDownload = 0; // start download of free dbs + + this.downloadNextChunk('downloadFreeDBIPLiteDB', function (v) { + _this.progressFreeDownload = v; + }, false, {}).then(function () { + window.location.reload(); + }).catch(function (e) { + _this.geoipDatabaseInstalled = true; + _this.downloadErrorMessage = e.message; + }); + }, + startAutomaticUpdateGeoIp: function startAutomaticUpdateGeoIp() { + this.buttonUpdateSaveText = Object(external_CoreHome_["translate"])('General_Continue'); + this.showGeoIpUpdateInfo(); + }, + showGeoIpUpdateInfo: function showGeoIpUpdateInfo() { + this.geoipDatabaseInstalled = true; // todo we need to replace this the proper way eventually + }, + saveGeoIpLinks: function saveGeoIpLinks() { + var _this2 = this; + + return external_CoreHome_["AjaxHelper"].post({ + period: this.updatePeriod, + module: 'GeoIp2', + action: 'updateGeoIPLinks' + }, { + loc_db: this.locationDbUrl, + isp_db: this.ispDbUrl, + org_db: this.orgDbUrl + }, { + withTokenInUrl: true + }).then(function (response) { + return _this2.downloadNextFileIfNeeded(response, null); + }).then(function (response) { + _this2.progressUpdateLabel = ''; + _this2.isUpdatingGeoIpDatabase = false; + external_CoreHome_["NotificationsStore"].show({ + message: Object(external_CoreHome_["translate"])('General_Done'), + placeat: '#done-updating-updater', + context: 'success', + noclear: true, + type: 'toast', + style: { + display: 'inline-block' + }, + id: 'userCountryGeoIpUpdate' + }); + _this2.nextRunTimePrettyUpdated = response.nextRunTime; + $(_this2.$refs.inlineHelpNode).effect('highlight', { + color: '#FFFFCB' + }, 2000); + return undefined; + }).catch(function (e) { + _this2.isUpdatingGeoIpDatabase = false; + external_CoreHome_["NotificationsStore"].show({ + message: e.message, + placeat: '#geoipdb-update-info-error', + context: 'error', + style: { + display: 'inline-block' + }, + id: 'userCountryGeoIpUpdate', + type: 'transient' + }); + }); + }, + downloadNextFileIfNeeded: function downloadNextFileIfNeeded(response, currentDownloading) { + var _this3 = this; + + if (response !== null && response !== void 0 && response.to_download) { + var continuing = currentDownloading === response.to_download; + this.progressUpdateDownload = 0; + this.progressUpdateLabel = response.to_download_label; + this.isUpdatingGeoIpDatabase = true; // start/continue download + + return this.downloadNextChunk('downloadMissingGeoIpDb', function (v) { + _this3.progressUpdateDownload = v; + }, continuing, { + key: response.to_download + }).then(function (r) { + return _this3.downloadNextFileIfNeeded(r, response.to_download); + }); + } + + return Promise.resolve(response); + }, + downloadNextChunk: function downloadNextChunk(action, progressBarSet, cont, extraData) { + var _this4 = this; + + var data = Object.assign({}, extraData); + return external_CoreHome_["AjaxHelper"].post({ + module: 'GeoIp2', + action: action, + continue: cont ? 1 : 0 + }, data, { + withTokenInUrl: true + }).catch(function () { + throw new Error(Object(external_CoreHome_["translate"])('GeoIp2_FatalErrorDuringDownload')); + }).then(function (response) { + if (response.error) { + throw new Error(response.error); + } // update progress bar + + + var newProgressVal = Math.floor(response.current_size / response.expected_file_size * 100); // if incomplete, download next chunk, otherwise, show updater manager + + progressBarSet(Math.min(newProgressVal, 100)); + + if (newProgressVal < 100) { + return _this4.downloadNextChunk(action, progressBarSet, true, extraData); + } + + return response; + }); + } + }, + computed: { + nextRunTimeText: function nextRunTimeText() { + if (this.nextRunTimePrettyUpdated) { + return this.nextRunTimePrettyUpdated; + } + + if (!this.nextRunTime) { + return Object(external_CoreHome_["translate"])('GeoIp2_UpdaterIsNotScheduledToRun'); + } + + if (this.nextRunTime * 1000 < Date.now()) { + return Object(external_CoreHome_["translate"])('GeoIp2_UpdaterScheduledForNextRun'); + } + + return Object(external_CoreHome_["translate"])('GeoIp2_UpdaterWillRunNext', "<strong>".concat(this.nextRunTimePretty, "</strong>")); + }, + providerPluginHelp: function providerPluginHelp() { + if (this.isProviderPluginActive) { + return undefined; + } + + var text = Object(external_CoreHome_["translate"])('GeoIp2_ISPRequiresProviderPlugin'); + return "<div style=\"margin:0\" class='alert alert-warning'>".concat(text, "</div>"); + }, + contentTitle: function contentTitle() { + return Object(external_CoreHome_["translate"])(this.geoipDatabaseInstalled ? 'GeoIp2_SetupAutomaticUpdatesOfGeoIP' : 'GeoIp2_GeoIPDatabases'); + }, + accuracyNote: function accuracyNote() { + return Object(external_CoreHome_["translate"])('UserCountry_GeoIpDbIpAccuracyNote', '<a href="https://dev.maxmind.com/geoip/geoip2/geolite2/?rId=piwik" rel="noreferrer noopener" target="_blank">', '</a>'); + }, + purchasedGeoIpText: function purchasedGeoIpText() { + var maxMindLink = 'http://www.maxmind.com/en/geolocation_landing?rId=piwik'; + return Object(external_CoreHome_["translate"])('GeoIp2_IPurchasedGeoIPDBs', "<a rel=\"noreferrer noopener\" href=\"".concat(maxMindLink, "\" target=\"_blank\">"), '</a>', '<a rel="noreferrer noopener" href="https://db-ip.com/db/?refid=mtm" target="_blank">', '</a>'); + }, + geoIPUpdaterInstructions: function geoIPUpdaterInstructions() { + return Object(external_CoreHome_["translate"])('GeoIp2_GeoIPUpdaterInstructions', '<a href="http://www.maxmind.com/?rId=piwik" rel="noreferrer noopener" target="_blank">', '</a>', '<a rel="noreferrer noopener" href="https://db-ip.com/?refid=mtm" target="_blank">', '</a>'); + }, + geoliteCityLink: function geoliteCityLink() { + var translation = Object(external_CoreHome_["translate"])('GeoIp2_GeoLiteCityLink', "<a rel=\"noreferrer noopener\" href=\"".concat(this.dbipLiteUrl, "\" target=\"_blank\">"), this.dbipLiteUrl, '</a>'); + return "".concat(translation, "<br /><br />"); + }, + maxMindLinkExplanation: function maxMindLinkExplanation() { + var link = 'https://matomo.org/faq/how-to/' + 'how-do-i-get-the-geolocation-download-url-for-the-free-maxmind-db/'; + return Object(external_CoreHome_["translate"])('UserCountry_MaxMindLinkExplanation', "<a href=\"".concat(link, "\" rel=\"noreferrer noopener\" target=\"_blank\">"), '</a>'); + }, + freeProgressbarLabel: function freeProgressbarLabel() { + return Object(external_CoreHome_["translate"])('GeoIp2_DownloadingDb', "<a href=\"".concat(this.dbipLiteUrl, "\">").concat(this.dbipLiteFilename, "</a>...")); + } + } +})); +// CONCATENATED MODULE: ./plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.vue + + + +Geoip2Updatervue_type_script_lang_ts.render = render + +/* harmony default export */ var Geoip2Updater = (Geoip2Updatervue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + +/* harmony default export */ var Geoip2Updater_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ + component: Geoip2Updater, + scope: { + geoIpDatabasesInstalled: { + angularJsBind: '<' + }, + showGeoIpUpdateSection: { + angularJsBind: '<' + }, + dbipLiteUrl: { + angularJsBind: '<' + }, + dbipLiteFilename: { + angularJsBind: '<' + }, + geoipLocUrl: { + angularJsBind: '<' + }, + isProviderPluginActive: { + angularJsBind: '<' + }, + geoipIspUrl: { + angularJsBind: '<' + }, + lastTimeUpdaterRun: { + angularJsBind: '<' + }, + geoipUpdatePeriod: { + angularJsBind: '<' + }, + updatePeriodOptions: { + angularJsBind: '<' + }, + geoipDatabaseStartedInstalled: { + angularJsBind: '<' + }, + showGeoipUpdateSection: { + angularJsBind: '<' + }, + nextRunTime: { + angularJsBind: '<' + }, + nextRunTimePretty: { + angularJsBind: '<' + } + }, + directiveName: 'piwikGeoip2Updater', + transclude: true +})); +// CONCATENATED MODULE: ./plugins/GeoIp2/vue/src/index.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + +// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js + + + + +/***/ }) + +/******/ }); +}); +//# sourceMappingURL=GeoIp2.umd.js.map
\ No newline at end of file diff --git a/plugins/GeoIp2/vue/dist/GeoIp2.umd.min.js b/plugins/GeoIp2/vue/dist/GeoIp2.umd.min.js new file mode 100644 index 0000000000..b98a1fd5d2 --- /dev/null +++ b/plugins/GeoIp2/vue/dist/GeoIp2.umd.min.js @@ -0,0 +1,8 @@ +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["GeoIp2"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["GeoIp2"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/GeoIp2/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"Geoip2Updater",(function(){return W})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(n.p=r[1])}var a=n("19dc"),i=n("8bbf"),l={key:0},d={key:0},c={id:"manage-geoip-dbs"},s={class:"row",id:"geoipdb-screen1"},p={class:"geoipdb-column-1 col s6"},u=Object(i["createElementVNode"])("sup",null,[Object(i["createElementVNode"])("small",null,"*")],-1),b={class:"geoipdb-column-2 col s6"},m=["innerHTML"],g={class:"geoipdb-column-1 col s6"},f=["value"],j={class:"geoipdb-column-2 col s6"},O=["value"],h={class:"row"},w=Object(i["createTextVNode"])("* "),I=["innerHTML"],v={id:"geoipdb-screen2-download"},N={key:1,id:"geoipdb-update-info"},U=["innerHTML"],D=Object(i["createElementVNode"])("br",null,null,-1),G=Object(i["createElementVNode"])("br",null,null,-1),k=["innerHTML"],x=["innerHTML"],y=Object(i["createElementVNode"])("br",null,null,-1),P=Object(i["createElementVNode"])("br",null,null,-1),V={id:"locationProviderUpdatePeriodInlineHelp",class:"inline-help-node",ref:"inlineHelpNode"},E=["innerHTML"],_={key:1},T=Object(i["createElementVNode"])("br",null,null,-1),L=Object(i["createElementVNode"])("br",null,null,-1),B=["innerHTML"],S=["value"],C=Object(i["createElementVNode"])("div",{id:"done-updating-updater"},null,-1),M=Object(i["createElementVNode"])("div",{id:"geoipdb-update-info-error"},null,-1),H=["innerHTML"],F={key:1},R={class:"form-description"};function A(e,t,n,o,r,a){var A=Object(i["resolveComponent"])("Progressbar"),J=Object(i["resolveComponent"])("Field"),q=Object(i["resolveComponent"])("ContentBlock");return Object(i["openBlock"])(),Object(i["createBlock"])(q,{"content-title":e.contentTitle,id:"geoip-db-mangement"},{default:Object(i["withCtx"])((function(){return[e.showGeoipUpdateSection?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",l,[e.geoipDatabaseInstalled?Object(i["createCommentVNode"])("",!0):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",d,[Object(i["withDirectives"])(Object(i["createElementVNode"])("div",null,[Object(i["createElementVNode"])("h3",null,Object(i["toDisplayString"])(e.translate("GeoIp2_NotManagingGeoIPDBs")),1),Object(i["createElementVNode"])("div",c,[Object(i["createElementVNode"])("div",s,[Object(i["createElementVNode"])("div",p,[Object(i["createElementVNode"])("p",null,[Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("GeoIp2_IWantToDownloadFreeGeoIP")),1),u])]),Object(i["createElementVNode"])("div",b,[Object(i["createElementVNode"])("p",{innerHTML:e.purchasedGeoIpText},null,8,m)]),Object(i["createElementVNode"])("div",g,[Object(i["createElementVNode"])("input",{type:"button",class:"btn",onClick:t[0]||(t[0]=function(t){return e.startDownloadFreeGeoIp()}),value:"".concat(e.translate("General_GetStarted"),"...")},null,8,f)]),Object(i["createElementVNode"])("div",j,[Object(i["createElementVNode"])("input",{type:"button",class:"btn",id:"start-automatic-update-geoip",onClick:t[1]||(t[1]=function(t){return e.startAutomaticUpdateGeoIp()}),value:"".concat(e.translate("General_GetStarted"),"...")},null,8,O)])]),Object(i["createElementVNode"])("div",h,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("sup",null,[w,Object(i["createElementVNode"])("small",{innerHTML:e.accuracyNote},null,8,I)])])])])],512),[[i["vShow"],e.showPiwikNotManagingInfo]]),Object(i["withDirectives"])(Object(i["createElementVNode"])("div",v,[Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(A,{label:e.freeProgressbarLabel,progress:e.progressFreeDownload},null,8,["label","progress"])])],512),[[i["vShow"],e.showFreeDownload]])])),e.geoipDatabaseInstalled&&!e.downloadErrorMessage?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",N,[Object(i["createElementVNode"])("p",null,[Object(i["createElementVNode"])("span",{innerHTML:e.geoIPUpdaterInstructions},null,8,U),D,G,e.dbipLiteUrl?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",{key:0,innerHTML:e.geoliteCityLink},null,8,k)):Object(i["createCommentVNode"])("",!0),Object(i["createElementVNode"])("span",{innerHTML:e.maxMindLinkExplanation},null,8,x),Object(i["withDirectives"])(Object(i["createElementVNode"])("span",null,[y,P,Object(i["createTextVNode"])(Object(i["toDisplayString"])(e.translate("GeoIp2_GeoIPUpdaterIntro"))+": ",1)],512),[[i["vShow"],e.geoipDatabaseInstalled]])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(J,{uicontrol:"text",name:"geoip-location-db",introduction:e.translate("GeoIp2_LocationDatabase"),title:e.translate("Actions_ColumnDownloadURL"),"inline-help":e.translate("GeoIp2_LocationDatabaseHint"),modelValue:e.locationDbUrl,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.locationDbUrl=t})},null,8,["introduction","title","inline-help","modelValue"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(J,{uicontrol:"text",name:"geoip-isp-db",introduction:e.translate("GeoIp2_ISPDatabase"),title:e.translate("Actions_ColumnDownloadURL"),"inline-help":e.providerPluginHelp,modelValue:e.ispDbUrl,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.ispDbUrl=t}),disabled:!e.isProviderPluginActive},null,8,["introduction","title","inline-help","modelValue","disabled"])]),Object(i["createElementVNode"])("div",null,[Object(i["createVNode"])(J,{uicontrol:"radio",name:"geoip-update-period",introduction:e.translate("GeoIp2_DownloadNewDatabasesEvery"),modelValue:e.updatePeriod,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.updatePeriod=t}),options:e.updatePeriodOptions},{"inline-help":Object(i["withCtx"])((function(){return[Object(i["createElementVNode"])("div",V,[e.lastTimeUpdaterRun?(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.translate("GeoIp2_UpdaterWasLastRun",e.lastTimeUpdaterRun))},null,8,E)):(Object(i["openBlock"])(),Object(i["createElementBlock"])("span",_,Object(i["toDisplayString"])(e.translate("GeoIp2_UpdaterHasNotBeenRun")),1)),T,L,Object(i["createElementVNode"])("div",{id:"geoip-updater-next-run-time",innerHTML:e.$sanitize(e.nextRunTimeText)},null,8,B)],512)]})),_:1},8,["introduction","modelValue","options"])]),Object(i["createElementVNode"])("input",{type:"button",class:"btn",onClick:t[5]||(t[5]=function(t){return e.saveGeoIpLinks()}),value:e.buttonUpdateSaveText},null,8,S),Object(i["createElementVNode"])("div",null,[C,M,Object(i["createElementVNode"])("div",null,[Object(i["withDirectives"])(Object(i["createVNode"])(A,{progress:e.progressUpdateDownload,label:e.progressUpdateLabel},null,8,["progress","label"]),[[i["vShow"],e.isUpdatingGeoIpDatabase]])])])])):Object(i["createCommentVNode"])("",!0),e.downloadErrorMessage?(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",{key:2,innerHTML:e.$sanitize(e.downloadErrorMessage)},null,8,H)):Object(i["createCommentVNode"])("",!0)])):(Object(i["openBlock"])(),Object(i["createElementBlock"])("div",F,[Object(i["createElementVNode"])("p",R,Object(i["toDisplayString"])(e.translate("GeoIp2_CannotSetupGeoIPAutoUpdating")),1)]))]})),_:1},8,["content-title"])}var J=n("a5a2"),q=window,$=q.$,z=Object(i["defineComponent"])({props:{geoipDatabaseStartedInstalled:Boolean,showGeoipUpdateSection:{type:Boolean,required:!0},dbipLiteUrl:{type:String,required:!0},dbipLiteFilename:{type:String,required:!0},geoipLocUrl:String,isProviderPluginActive:Boolean,geoipIspUrl:String,lastTimeUpdaterRun:String,geoipUpdatePeriod:String,updatePeriodOptions:{type:Object,required:!0},nextRunTime:Number,nextRunTimePretty:String},components:{Progressbar:a["Progressbar"],Field:J["Field"],ContentBlock:a["ContentBlock"]},data:function(){return{geoipDatabaseInstalled:!!this.geoipDatabaseStartedInstalled,showFreeDownload:!1,showPiwikNotManagingInfo:!0,progressFreeDownload:0,progressUpdateDownload:0,buttonUpdateSaveText:Object(a["translate"])("General_Save"),progressUpdateLabel:"",locationDbUrl:this.geoipLocUrl||"",ispDbUrl:this.geoipIspUrl||"",orgDbUrl:"",updatePeriod:this.geoipUpdatePeriod||"month",isUpdatingGeoIpDatabase:!1,downloadErrorMessage:null}},methods:{startDownloadFreeGeoIp:function(){var e=this;this.showFreeDownload=!0,this.showPiwikNotManagingInfo=!1,this.progressFreeDownload=0,this.downloadNextChunk("downloadFreeDBIPLiteDB",(function(t){e.progressFreeDownload=t}),!1,{}).then((function(){window.location.reload()})).catch((function(t){e.geoipDatabaseInstalled=!0,e.downloadErrorMessage=t.message}))},startAutomaticUpdateGeoIp:function(){this.buttonUpdateSaveText=Object(a["translate"])("General_Continue"),this.showGeoIpUpdateInfo()},showGeoIpUpdateInfo:function(){this.geoipDatabaseInstalled=!0},saveGeoIpLinks:function(){var e=this;return a["AjaxHelper"].post({period:this.updatePeriod,module:"GeoIp2",action:"updateGeoIPLinks"},{loc_db:this.locationDbUrl,isp_db:this.ispDbUrl,org_db:this.orgDbUrl},{withTokenInUrl:!0}).then((function(t){return e.downloadNextFileIfNeeded(t,null)})).then((function(t){e.progressUpdateLabel="",e.isUpdatingGeoIpDatabase=!1,a["NotificationsStore"].show({message:Object(a["translate"])("General_Done"),placeat:"#done-updating-updater",context:"success",noclear:!0,type:"toast",style:{display:"inline-block"},id:"userCountryGeoIpUpdate"}),e.nextRunTimePrettyUpdated=t.nextRunTime,$(e.$refs.inlineHelpNode).effect("highlight",{color:"#FFFFCB"},2e3)})).catch((function(t){e.isUpdatingGeoIpDatabase=!1,a["NotificationsStore"].show({message:t.message,placeat:"#geoipdb-update-info-error",context:"error",style:{display:"inline-block"},id:"userCountryGeoIpUpdate",type:"transient"})}))},downloadNextFileIfNeeded:function(e,t){var n=this;if(null!==e&&void 0!==e&&e.to_download){var o=t===e.to_download;return this.progressUpdateDownload=0,this.progressUpdateLabel=e.to_download_label,this.isUpdatingGeoIpDatabase=!0,this.downloadNextChunk("downloadMissingGeoIpDb",(function(e){n.progressUpdateDownload=e}),o,{key:e.to_download}).then((function(t){return n.downloadNextFileIfNeeded(t,e.to_download)}))}return Promise.resolve(e)},downloadNextChunk:function(e,t,n,o){var r=this,i=Object.assign({},o);return a["AjaxHelper"].post({module:"GeoIp2",action:e,continue:n?1:0},i,{withTokenInUrl:!0}).catch((function(){throw new Error(Object(a["translate"])("GeoIp2_FatalErrorDuringDownload"))})).then((function(n){if(n.error)throw new Error(n.error);var a=Math.floor(n.current_size/n.expected_file_size*100);return t(Math.min(a,100)),a<100?r.downloadNextChunk(e,t,!0,o):n}))}},computed:{nextRunTimeText:function(){return this.nextRunTimePrettyUpdated?this.nextRunTimePrettyUpdated:this.nextRunTime?1e3*this.nextRunTime<Date.now()?Object(a["translate"])("GeoIp2_UpdaterScheduledForNextRun"):Object(a["translate"])("GeoIp2_UpdaterWillRunNext","<strong>".concat(this.nextRunTimePretty,"</strong>")):Object(a["translate"])("GeoIp2_UpdaterIsNotScheduledToRun")},providerPluginHelp:function(){if(!this.isProviderPluginActive){var e=Object(a["translate"])("GeoIp2_ISPRequiresProviderPlugin");return"<div style=\"margin:0\" class='alert alert-warning'>".concat(e,"</div>")}},contentTitle:function(){return Object(a["translate"])(this.geoipDatabaseInstalled?"GeoIp2_SetupAutomaticUpdatesOfGeoIP":"GeoIp2_GeoIPDatabases")},accuracyNote:function(){return Object(a["translate"])("UserCountry_GeoIpDbIpAccuracyNote",'<a href="https://dev.maxmind.com/geoip/geoip2/geolite2/?rId=piwik" rel="noreferrer noopener" target="_blank">',"</a>")},purchasedGeoIpText:function(){var e="http://www.maxmind.com/en/geolocation_landing?rId=piwik";return Object(a["translate"])("GeoIp2_IPurchasedGeoIPDBs",'<a rel="noreferrer noopener" href="'.concat(e,'" target="_blank">'),"</a>",'<a rel="noreferrer noopener" href="https://db-ip.com/db/?refid=mtm" target="_blank">',"</a>")},geoIPUpdaterInstructions:function(){return Object(a["translate"])("GeoIp2_GeoIPUpdaterInstructions",'<a href="http://www.maxmind.com/?rId=piwik" rel="noreferrer noopener" target="_blank">',"</a>",'<a rel="noreferrer noopener" href="https://db-ip.com/?refid=mtm" target="_blank">',"</a>")},geoliteCityLink:function(){var e=Object(a["translate"])("GeoIp2_GeoLiteCityLink",'<a rel="noreferrer noopener" href="'.concat(this.dbipLiteUrl,'" target="_blank">'),this.dbipLiteUrl,"</a>");return"".concat(e,"<br /><br />")},maxMindLinkExplanation:function(){var e="https://matomo.org/faq/how-to/how-do-i-get-the-geolocation-download-url-for-the-free-maxmind-db/";return Object(a["translate"])("UserCountry_MaxMindLinkExplanation",'<a href="'.concat(e,'" rel="noreferrer noopener" target="_blank">'),"</a>")},freeProgressbarLabel:function(){return Object(a["translate"])("GeoIp2_DownloadingDb",'<a href="'.concat(this.dbipLiteUrl,'">').concat(this.dbipLiteFilename,"</a>..."))}}});z.render=A;var W=z; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */Object(a["createAngularJsAdapter"])({component:W,scope:{geoIpDatabasesInstalled:{angularJsBind:"<"},showGeoIpUpdateSection:{angularJsBind:"<"},dbipLiteUrl:{angularJsBind:"<"},dbipLiteFilename:{angularJsBind:"<"},geoipLocUrl:{angularJsBind:"<"},isProviderPluginActive:{angularJsBind:"<"},geoipIspUrl:{angularJsBind:"<"},lastTimeUpdaterRun:{angularJsBind:"<"},geoipUpdatePeriod:{angularJsBind:"<"},updatePeriodOptions:{angularJsBind:"<"},geoipDatabaseStartedInstalled:{angularJsBind:"<"},showGeoipUpdateSection:{angularJsBind:"<"},nextRunTime:{angularJsBind:"<"},nextRunTimePretty:{angularJsBind:"<"}},directiveName:"piwikGeoip2Updater",transclude:!0})}})})); +//# sourceMappingURL=GeoIp2.umd.min.js.map
\ No newline at end of file diff --git a/plugins/GeoIp2/vue/dist/umd.metadata.json b/plugins/GeoIp2/vue/dist/umd.metadata.json new file mode 100644 index 0000000000..dce4477a3c --- /dev/null +++ b/plugins/GeoIp2/vue/dist/umd.metadata.json @@ -0,0 +1,6 @@ +{ + "dependsOn": [ + "CoreHome", + "CorePluginsAdmin" + ] +}
\ No newline at end of file diff --git a/plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.adapter.ts b/plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.adapter.ts new file mode 100644 index 0000000000..4ab8d05aa8 --- /dev/null +++ b/plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.adapter.ts @@ -0,0 +1,59 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { createAngularJsAdapter } from 'CoreHome'; +import Geoip2Updater from './Geoip2Updater.vue'; + +export default createAngularJsAdapter({ + component: Geoip2Updater, + scope: { + geoIpDatabasesInstalled: { + angularJsBind: '<', + }, + showGeoIpUpdateSection: { + angularJsBind: '<', + }, + dbipLiteUrl: { + angularJsBind: '<', + }, + dbipLiteFilename: { + angularJsBind: '<', + }, + geoipLocUrl: { + angularJsBind: '<', + }, + isProviderPluginActive: { + angularJsBind: '<', + }, + geoipIspUrl: { + angularJsBind: '<', + }, + lastTimeUpdaterRun: { + angularJsBind: '<', + }, + geoipUpdatePeriod: { + angularJsBind: '<', + }, + updatePeriodOptions: { + angularJsBind: '<', + }, + geoipDatabaseStartedInstalled: { + angularJsBind: '<', + }, + showGeoipUpdateSection: { + angularJsBind: '<', + }, + nextRunTime: { + angularJsBind: '<', + }, + nextRunTimePretty: { + angularJsBind: '<', + }, + }, + directiveName: 'piwikGeoip2Updater', + transclude: true, +}); diff --git a/plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.vue b/plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.vue new file mode 100644 index 0000000000..ed1f840905 --- /dev/null +++ b/plugins/GeoIp2/vue/src/Geoip2Updater/Geoip2Updater.vue @@ -0,0 +1,474 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <ContentBlock :content-title="contentTitle" id="geoip-db-mangement"> + <div v-if="showGeoipUpdateSection"> + <div v-if="!geoipDatabaseInstalled"> + <div v-show="showPiwikNotManagingInfo"> + <h3>{{ translate('GeoIp2_NotManagingGeoIPDBs') }}</h3> + <div id="manage-geoip-dbs"> + <div + class="row" + id="geoipdb-screen1" + > + <div class="geoipdb-column-1 col s6"> + <p>{{ translate('GeoIp2_IWantToDownloadFreeGeoIP') }}<sup><small>*</small></sup></p> + </div> + <div class="geoipdb-column-2 col s6"> + <p v-html="purchasedGeoIpText"></p> + </div> + <div class="geoipdb-column-1 col s6"> + <input + type="button" + class="btn" + @click="startDownloadFreeGeoIp()" + :value="`${translate('General_GetStarted')}...`" + /> + </div> + <div class="geoipdb-column-2 col s6"> + <input + type="button" + class="btn" + id="start-automatic-update-geoip" + @click="startAutomaticUpdateGeoIp()" + :value="`${translate('General_GetStarted')}...`" + /> + </div> + </div> + <div class="row"> + <p><sup>* <small v-html="accuracyNote"></small></sup></p> + </div> + </div> + </div> + <div + id="geoipdb-screen2-download" + v-show="showFreeDownload" + > + <div> + <Progressbar + :label="freeProgressbarLabel" + :progress="progressFreeDownload" + > + </Progressbar> + </div> + </div> + </div> + + <div + id="geoipdb-update-info" + v-if="geoipDatabaseInstalled && !downloadErrorMessage" + > + <p> + <span v-html="geoIPUpdaterInstructions"></span> + <br /><br /> + <span v-if="!!dbipLiteUrl" v-html="geoliteCityLink"></span> + <span v-html="maxMindLinkExplanation"></span> + <span v-show="geoipDatabaseInstalled"> + <br /><br />{{ translate('GeoIp2_GeoIPUpdaterIntro') }}: + </span> + </p> + <div> + <Field + uicontrol="text" + name="geoip-location-db" + :introduction="translate('GeoIp2_LocationDatabase')" + :title="translate('Actions_ColumnDownloadURL')" + :inline-help="translate('GeoIp2_LocationDatabaseHint')" + v-model="locationDbUrl" + > + </Field> + </div> + <div> + <Field + uicontrol="text" + name="geoip-isp-db" + :introduction="translate('GeoIp2_ISPDatabase')" + :title="translate('Actions_ColumnDownloadURL')" + :inline-help="providerPluginHelp" + v-model="ispDbUrl" + :disabled="!isProviderPluginActive" + > + </Field> + </div> + <div> + <Field + uicontrol="radio" + name="geoip-update-period" + :introduction="translate('GeoIp2_DownloadNewDatabasesEvery')" + v-model="updatePeriod" + :options="updatePeriodOptions" + > + <template v-slot:inline-help> + <div + id="locationProviderUpdatePeriodInlineHelp" + class="inline-help-node" + ref="inlineHelpNode" + > + <span + v-if="lastTimeUpdaterRun" + v-html="$sanitize( + translate('GeoIp2_UpdaterWasLastRun', lastTimeUpdaterRun), + )" + /> + <span v-else>{{ translate('GeoIp2_UpdaterHasNotBeenRun') }}</span> + <br /><br /> + <div id="geoip-updater-next-run-time" v-html="$sanitize(nextRunTimeText)"> + </div> + </div> + </template> + </Field> + </div> + <input + type="button" + class="btn" + @click="saveGeoIpLinks()" + :value="buttonUpdateSaveText" + /> + <div> + <div id="done-updating-updater" /> + <div id="geoipdb-update-info-error" /> + <div> + <Progressbar + v-show="isUpdatingGeoIpDatabase" + :progress="progressUpdateDownload" + :label="progressUpdateLabel" + /> + </div> + </div> + </div> + <div v-if="downloadErrorMessage" v-html="$sanitize(downloadErrorMessage)"></div> + </div> + <div v-else> + <p class="form-description">{{ translate('GeoIp2_CannotSetupGeoIPAutoUpdating') }}</p> + </div> + </ContentBlock> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { + translate, + AjaxHelper, + Progressbar, + ContentBlock, + NotificationsStore, +} from 'CoreHome'; +import { Field } from 'CorePluginsAdmin'; + +interface Geoip2UpdaterState { + geoipDatabaseInstalled: boolean; + showFreeDownload: boolean; + showPiwikNotManagingInfo: boolean; + progressFreeDownload: number; + progressUpdateDownload: number; + buttonUpdateSaveText: string; + progressUpdateLabel: string; + locationDbUrl: string; + ispDbUrl: string; + orgDbUrl: string; + updatePeriod: string; + isUpdatingGeoIpDatabase: boolean; + downloadErrorMessage: string|null; + nextRunTimePrettyUpdated?: string; +} + +interface UpdateGeoIpLinksResponse { + to_download?: string; + to_download_label?: string; + nextRunTime: string; +} + +interface DownloadChunkResponse { + current_size: number; + expected_file_size: number; + nextRunTime?: string; + to_download?: string; + to_download_label?: string; + error?: string; +} + +const { $ } = window; + +export default defineComponent({ + props: { + geoipDatabaseStartedInstalled: Boolean, + showGeoipUpdateSection: { + type: Boolean, + required: true, + }, + dbipLiteUrl: { + type: String, + required: true, + }, + dbipLiteFilename: { + type: String, + required: true, + }, + geoipLocUrl: String, + isProviderPluginActive: Boolean, + geoipIspUrl: String, + lastTimeUpdaterRun: String, + geoipUpdatePeriod: String, + updatePeriodOptions: { + type: Object, + required: true, + }, + nextRunTime: Number, + nextRunTimePretty: String, + }, + components: { + Progressbar, + Field, + ContentBlock, + }, + data(): Geoip2UpdaterState { + return { + geoipDatabaseInstalled: !!this.geoipDatabaseStartedInstalled, + showFreeDownload: false, + showPiwikNotManagingInfo: true, + progressFreeDownload: 0, + progressUpdateDownload: 0, + buttonUpdateSaveText: translate('General_Save'), + progressUpdateLabel: '', + locationDbUrl: this.geoipLocUrl || '', + ispDbUrl: this.geoipIspUrl || '', + orgDbUrl: '', + updatePeriod: this.geoipUpdatePeriod || 'month', + isUpdatingGeoIpDatabase: false, + downloadErrorMessage: null, + }; + }, + methods: { + startDownloadFreeGeoIp() { + this.showFreeDownload = true; + this.showPiwikNotManagingInfo = false; + this.progressFreeDownload = 0; // start download of free dbs + + this.downloadNextChunk( + 'downloadFreeDBIPLiteDB', + (v) => { + this.progressFreeDownload = v; + }, + false, + {}, + ).then(() => { + window.location.reload(); + }).catch((e) => { + this.geoipDatabaseInstalled = true; + this.downloadErrorMessage = e.message; + }); + }, + startAutomaticUpdateGeoIp() { + this.buttonUpdateSaveText = translate('General_Continue'); + this.showGeoIpUpdateInfo(); + }, + showGeoIpUpdateInfo() { + this.geoipDatabaseInstalled = true; // todo we need to replace this the proper way eventually + }, + saveGeoIpLinks() { + return AjaxHelper.post<UpdateGeoIpLinksResponse>( + { + period: this.updatePeriod, + module: 'GeoIp2', + action: 'updateGeoIPLinks', + }, + { + loc_db: this.locationDbUrl, + isp_db: this.ispDbUrl, + org_db: this.orgDbUrl, + }, + { + withTokenInUrl: true, + }, + ).then( + (response) => this.downloadNextFileIfNeeded(response, null), + ).then((response) => { + this.progressUpdateLabel = ''; + this.isUpdatingGeoIpDatabase = false; + + NotificationsStore.show({ + message: translate('General_Done'), + placeat: '#done-updating-updater', + context: 'success', + noclear: true, + type: 'toast', + style: { + display: 'inline-block', + }, + id: 'userCountryGeoIpUpdate', + }); + + this.nextRunTimePrettyUpdated = response.nextRunTime; + $(this.$refs.inlineHelpNode as HTMLElement).effect('highlight', { + color: '#FFFFCB', + }, 2000); + + return undefined; + }).catch((e) => { + this.isUpdatingGeoIpDatabase = false; + + NotificationsStore.show({ + message: e.message, + placeat: '#geoipdb-update-info-error', + context: 'error', + style: { + display: 'inline-block', + }, + id: 'userCountryGeoIpUpdate', + type: 'transient', + }); + }); + }, + downloadNextFileIfNeeded( + response: DownloadChunkResponse|UpdateGeoIpLinksResponse, + currentDownloading?: string|null, + ): Promise<DownloadChunkResponse|UpdateGeoIpLinksResponse> { + if (response?.to_download) { + const continuing = currentDownloading === response.to_download; + + this.progressUpdateDownload = 0; + this.progressUpdateLabel = response.to_download_label!; + this.isUpdatingGeoIpDatabase = true; // start/continue download + + return this.downloadNextChunk( + 'downloadMissingGeoIpDb', + (v) => { + this.progressUpdateDownload = v; + }, + continuing, + { + key: response.to_download, + }, + ).then((r) => this.downloadNextFileIfNeeded(r, response.to_download)); + } + + return Promise.resolve(response); + }, + downloadNextChunk( + action: string, + progressBarSet: (value: number) => void, + cont: boolean, + extraData: QueryParameters, + ): Promise<DownloadChunkResponse> { + const data: QueryParameters = { ...extraData }; + + return AjaxHelper.post<DownloadChunkResponse>( + { + module: 'GeoIp2', + action, + continue: cont ? 1 : 0, + }, + data, + { withTokenInUrl: true }, + ).catch(() => { + throw new Error(translate('GeoIp2_FatalErrorDuringDownload')); + }).then((response) => { + if (response.error) { + throw new Error(response.error!); + } + + // update progress bar + const newProgressVal = Math.floor( + (response.current_size / response.expected_file_size) * 100, + ); + + // if incomplete, download next chunk, otherwise, show updater manager + progressBarSet(Math.min(newProgressVal, 100)); + + if (newProgressVal < 100) { + return this.downloadNextChunk(action, progressBarSet, true, extraData); + } + + return response; + }); + }, + }, + computed: { + nextRunTimeText() { + if (this.nextRunTimePrettyUpdated) { + return this.nextRunTimePrettyUpdated; + } + + if (!this.nextRunTime) { + return translate('GeoIp2_UpdaterIsNotScheduledToRun'); + } + + if (this.nextRunTime * 1000 < Date.now()) { + return translate('GeoIp2_UpdaterScheduledForNextRun'); + } + + return translate( + 'GeoIp2_UpdaterWillRunNext', + `<strong>${this.nextRunTimePretty}</strong>`, + ); + }, + providerPluginHelp() { + if (this.isProviderPluginActive) { + return undefined; + } + + const text = translate('GeoIp2_ISPRequiresProviderPlugin'); + return `<div style="margin:0" class='alert alert-warning'>${text}</div>`; + }, + contentTitle() { + return translate( + this.geoipDatabaseInstalled ? 'GeoIp2_SetupAutomaticUpdatesOfGeoIP' : 'GeoIp2_GeoIPDatabases', + ); + }, + accuracyNote() { + return translate( + 'UserCountry_GeoIpDbIpAccuracyNote', + '<a href="https://dev.maxmind.com/geoip/geoip2/geolite2/?rId=piwik" rel="noreferrer noopener" target="_blank">', + '</a>', + ); + }, + purchasedGeoIpText() { + const maxMindLink = 'http://www.maxmind.com/en/geolocation_landing?rId=piwik'; + return translate( + 'GeoIp2_IPurchasedGeoIPDBs', + `<a rel="noreferrer noopener" href="${maxMindLink}" target="_blank">`, + '</a>', + '<a rel="noreferrer noopener" href="https://db-ip.com/db/?refid=mtm" target="_blank">', + '</a>', + ); + }, + geoIPUpdaterInstructions() { + return translate( + 'GeoIp2_GeoIPUpdaterInstructions', + '<a href="http://www.maxmind.com/?rId=piwik" rel="noreferrer noopener" target="_blank">', + '</a>', + '<a rel="noreferrer noopener" href="https://db-ip.com/?refid=mtm" target="_blank">', + '</a>', + ); + }, + geoliteCityLink() { + const translation = translate( + 'GeoIp2_GeoLiteCityLink', + `<a rel="noreferrer noopener" href="${this.dbipLiteUrl}" target="_blank">`, + this.dbipLiteUrl, + '</a>', + ); + return `${translation}<br /><br />`; + }, + maxMindLinkExplanation() { + const link = 'https://matomo.org/faq/how-to/' + + 'how-do-i-get-the-geolocation-download-url-for-the-free-maxmind-db/'; + return translate( + 'UserCountry_MaxMindLinkExplanation', + `<a href="${link}" rel="noreferrer noopener" target="_blank">`, + '</a>', + ); + }, + freeProgressbarLabel() { + return translate( + 'GeoIp2_DownloadingDb', + `<a href="${this.dbipLiteUrl}">${this.dbipLiteFilename}</a>...`, + ); + }, + }, +}); +</script> diff --git a/plugins/GeoIp2/vue/src/index.ts b/plugins/GeoIp2/vue/src/index.ts new file mode 100644 index 0000000000..f7050104d1 --- /dev/null +++ b/plugins/GeoIp2/vue/src/index.ts @@ -0,0 +1,10 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import './Geoip2Updater/Geoip2Updater.adapter'; + +export { default as Geoip2Updater } from './Geoip2Updater/Geoip2Updater.vue'; |