diff --git a/CHANGELOG.md b/CHANGELOG.md index cd8c8f0f6..981449feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ## Changelog +# 4.6.12 +- Important: Disabled re-import date range feature for GA3 imports to avoid deleting of existing data + # 4.6.11 - Ignore custom dimensions assigned the Item scope diff --git a/Commands/ImportReports.php b/Commands/ImportReports.php index adf1c35d7..6d57dfccc 100644 --- a/Commands/ImportReports.php +++ b/Commands/ImportReports.php @@ -220,7 +220,9 @@ protected function executeImpl(InputInterface $input, OutputInterface $output) return; } - $dateRangesToReImport = empty($status['reimport_ranges']) ? [] : $status['reimport_ranges']; + // Disabled reimport of daterange for GA3 +// $dateRangesToReImport = empty($status['reimport_ranges']) ? [] : $status['reimport_ranges']; + $dateRangesToReImport = []; $dateRangesToReImport = array_map(function ($d) { return [Date::factory($d[0]), Date::factory($d[1])]; }, $dateRangesToReImport); diff --git a/Controller.php b/Controller.php index 777e75f67..c28a6d6f4 100644 --- a/Controller.php +++ b/Controller.php @@ -596,6 +596,9 @@ public function scheduleReImport() new Site($idSite); $isGA4 = Common::getRequestVar('isGA4', 0, 'int') == 1; + if (!$isGA4) { + throw new \Exception('Reimport for GA3 is disabled, as it will lead to data loss for already imported date ranges.'); + } $startDate = Common::getRequestVar('startDate', null, 'string'); $startDate = Date::factory($startDate); diff --git a/plugin.json b/plugin.json index 304777257..2c7b51130 100644 --- a/plugin.json +++ b/plugin.json @@ -1,7 +1,7 @@ { "name": "GoogleAnalyticsImporter", "description": "Import reports from a Google Analytics account into Matomo.", - "version": "4.6.11", + "version": "4.6.12", "theme": false, "require": { "matomo": ">=4.10.0-b1,<5.0.0-b1" diff --git a/tests/Fixtures/ImportedFromGoogle.php b/tests/Fixtures/ImportedFromGoogle.php index 9a6c1380c..8486ed9d0 100644 --- a/tests/Fixtures/ImportedFromGoogle.php +++ b/tests/Fixtures/ImportedFromGoogle.php @@ -64,8 +64,8 @@ public function setUp(): void $this->getGoogleAnalyticsParams(); $this->runGoogleImporter($this->importedDateRange1); - $this->extendEndDate($idSite = 1, '2019-06-27', '2019-07-02'); - $this->scheduleReimport($idSite = 1, '2019-06-27', '2019-06-27'); + $this->extendEndDate($idSite = 1, '2019-06-27', '2019-06-27'); +// $this->scheduleReimport($idSite = 1, '2019-06-27', '2019-06-27'); $output = $this->runGoogleImporter($this->importedDateRange2, $idSite = 1); $this->assertStringContainsString('Importing the following date ranges in order: 2019-06-27,2019-06-27', $output); diff --git a/tests/UI/GoogleAnalyticsImporter_spec.js b/tests/UI/GoogleAnalyticsImporter_spec.js index cc27d6269..003578c3c 100644 --- a/tests/UI/GoogleAnalyticsImporter_spec.js +++ b/tests/UI/GoogleAnalyticsImporter_spec.js @@ -86,25 +86,6 @@ describe("GoogleAnalyticsImporter", function () { expect(await content.screenshot()).to.matchImage('resumed_import'); }); - it('should schedule a re-import when the modal is used', async function () { - await page.waitForTimeout(90000); - - await page.click('#reimport-date-range'); - - await page.waitForSelector('#openScheduleReimportModal', { visible: true }); - await page.type('#re-import-start-date', '2019-06-27'); - await page.type('#re-import-end-date', '2019-06-27'); - - await page.click('#scheduleReimportSubmit'); - await page.waitForNetworkIdle(); - await page.waitForSelector('.pageWrap'); - - await removeStartResumeFinishTime(); - - const content = await page.$('.pageWrap'); - expect(await content.screenshot()).to.matchImage('reimport_range'); - }); - it("should show that the import finished when the import finishes", async function () { let totalTime = 0; while (true) { // wait until import finishes diff --git a/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_errored_import.png b/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_errored_import.png index afa4e30b8..c4149e93f 100644 Binary files a/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_errored_import.png and b/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_errored_import.png differ diff --git a/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_finished_import.png b/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_finished_import.png index 5e7ae46c2..4d7bc4a67 100644 Binary files a/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_finished_import.png and b/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_finished_import.png differ diff --git a/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_resumed_import.png b/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_resumed_import.png index ed8022376..5b98f0c16 100644 Binary files a/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_resumed_import.png and b/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_resumed_import.png differ diff --git a/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_start_import.png b/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_start_import.png index b8b90f232..e06f03652 100644 Binary files a/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_start_import.png and b/tests/UI/expected-ui-screenshots/GoogleAnalyticsImporter_start_import.png differ diff --git a/vue/dist/GoogleAnalyticsImporter.umd.js b/vue/dist/GoogleAnalyticsImporter.umd.js index 866589ef8..40e297231 100644 --- a/vue/dist/GoogleAnalyticsImporter.umd.js +++ b/vue/dist/GoogleAnalyticsImporter.umd.js @@ -857,34 +857,34 @@ function ImportStatusvue_type_template_id_041bd7a0_render(_ctx, _cache, $props, } // CONCATENATED MODULE: ./plugins/GoogleAnalyticsImporter/vue/src/ImportStatus/ImportStatus.vue?vue&type=template&id=041bd7a0 -// 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/GoogleAnalyticsImporter/vue/src/ImportStatus/ImportStatusRow.vue?vue&type=template&id=8911814e +// 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/GoogleAnalyticsImporter/vue/src/ImportStatus/ImportStatusRow.vue?vue&type=template&id=8a637ef8 -var ImportStatusRowvue_type_template_id_8911814e_hoisted_1 = ["data-idsite"]; -var ImportStatusRowvue_type_template_id_8911814e_hoisted_2 = { +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_1 = ["data-idsite"]; +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_2 = { class: "sitename" }; -var ImportStatusRowvue_type_template_id_8911814e_hoisted_3 = ["href"]; -var ImportStatusRowvue_type_template_id_8911814e_hoisted_4 = { +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_3 = ["href"]; +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_4 = { key: 1, style: { "text-transform": "uppercase" } }; -var ImportStatusRowvue_type_template_id_8911814e_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var ImportStatusRowvue_type_template_id_8911814e_hoisted_6 = ["innerHTML"]; -var ImportStatusRowvue_type_template_id_8911814e_hoisted_7 = { +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_6 = ["innerHTML"]; +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_7 = { class: "status" }; -var ImportStatusRowvue_type_template_id_8911814e_hoisted_8 = { +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_8 = { key: 0 }; -var ImportStatusRowvue_type_template_id_8911814e_hoisted_9 = ["title"]; +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_9 = ["title"]; -var ImportStatusRowvue_type_template_id_8911814e_hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_10 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("br", null, null, -1); -var ImportStatusRowvue_type_template_id_8911814e_hoisted_11 = { +var ImportStatusRowvue_type_template_id_8a637ef8_hoisted_11 = { key: 0 }; var _hoisted_12 = { @@ -976,22 +976,22 @@ var _hoisted_45 = { }; var _hoisted_46 = ["title"]; var _hoisted_47 = ["title"]; -function ImportStatusRowvue_type_template_id_8911814e_render(_ctx, _cache, $props, $setup, $data, $options) { +function ImportStatusRowvue_type_template_id_8a637ef8_render(_ctx, _cache, $props, $setup, $data, $options) { var _ctx$status$reimport_; return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", { "data-idsite": _ctx.status.idSite - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", ImportStatusRowvue_type_template_id_8911814e_hoisted_2, [_ctx.status.site ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", ImportStatusRowvue_type_template_id_8a637ef8_hoisted_2, [_ctx.status.site ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { key: 0, target: "_blank", href: _ctx.siteUrl - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.siteName), 9, ImportStatusRowvue_type_template_id_8911814e_hoisted_3)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ImportStatusRowvue_type_template_id_8911814e_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_SiteDeleted')), 1)), ImportStatusRowvue_type_template_id_8911814e_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_SiteID')) + ": " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.status.idSite), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.siteName), 9, ImportStatusRowvue_type_template_id_8a637ef8_hoisted_3)) : (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ImportStatusRowvue_type_template_id_8a637ef8_hoisted_4, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_SiteDeleted')), 1)), ImportStatusRowvue_type_template_id_8a637ef8_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_SiteID')) + ": " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.status.idSite), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", { class: "ga-info", innerHTML: _ctx.$sanitize(_ctx.gaInfoPretty) - }, null, 8, ImportStatusRowvue_type_template_id_8911814e_hoisted_6), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", ImportStatusRowvue_type_template_id_8911814e_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.status.status) + " ", 1), _ctx.status.status === 'rate_limited' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ImportStatusRowvue_type_template_id_8911814e_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + }, null, 8, ImportStatusRowvue_type_template_id_8a637ef8_hoisted_6), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", ImportStatusRowvue_type_template_id_8a637ef8_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.status.status) + " ", 1), _ctx.status.status === 'rate_limited' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", ImportStatusRowvue_type_template_id_8a637ef8_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon icon-help", title: _ctx.translate('GoogleAnalyticsImporter_RateLimitHelp') - }, null, 8, ImportStatusRowvue_type_template_id_8911814e_hoisted_9), ImportStatusRowvue_type_template_id_8911814e_hoisted_10, _ctx.status.days_finished_since_rate_limit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ImportStatusRowvue_type_template_id_8911814e_hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_FinishedImportingDaysWaiting', _ctx.status.days_finished_since_rate_limit)), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.status.status === 'cloud_rate_limited' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + }, null, 8, ImportStatusRowvue_type_template_id_8a637ef8_hoisted_9), ImportStatusRowvue_type_template_id_8a637ef8_hoisted_10, _ctx.status.days_finished_since_rate_limit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", ImportStatusRowvue_type_template_id_8a637ef8_hoisted_11, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_FinishedImportingDaysWaiting', _ctx.status.days_finished_since_rate_limit)), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.status.status === 'cloud_rate_limited' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { class: "icon icon-help", title: _ctx.status.error }, null, 8, _hoisted_13), _hoisted_14, _ctx.status.days_finished_since_rate_limit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", _hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_FinishedImportingDaysWaiting', _ctx.status.days_finished_since_rate_limit)), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.status.status === 'rate_limited_hourly' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", _hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { @@ -1011,14 +1011,15 @@ function ImportStatusRowvue_type_template_id_8911814e_render(_ctx, _cache, $prop onClick: _cache[0] || (_cache[0] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.$emit('end-import'); }, ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_EditEndDate')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_EditEndDate')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [_ctx.status.isGA4 ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("a", { + key: 0, id: "reimport-date-range", class: "table-command-link", href: "", onClick: _cache[1] || (_cache[1] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.$emit('reimport'); }, ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_ReimportDate')), 1)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_33, [(_ctx$status$reimport_ = _ctx.status.reimport_ranges) !== null && _ctx$status$reimport_ !== void 0 && _ctx$status$reimport_.length ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", _hoisted_34, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.status.reimport_ranges, function (entry, index) { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('GoogleAnalyticsImporter_ReimportDate')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", _hoisted_33, [(_ctx$status$reimport_ = _ctx.status.reimport_ranges) !== null && _ctx$status$reimport_ !== void 0 && _ctx$status$reimport_.length ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", _hoisted_34, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.status.reimport_ranges, function (entry, index) { return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { key: index }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(entry[0]) + "," + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(entry[1]), 1); @@ -1040,9 +1041,9 @@ function ImportStatusRowvue_type_template_id_8911814e_render(_ctx, _cache, $prop return _ctx.$emit('manuallyResume'); }, ["prevent"])), title: _ctx.translate('GoogleAnalyticsImporter_ResumeDesc') - }, null, 8, _hoisted_47)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 8, ImportStatusRowvue_type_template_id_8911814e_hoisted_1); + }, null, 8, _hoisted_47)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 8, ImportStatusRowvue_type_template_id_8a637ef8_hoisted_1); } -// CONCATENATED MODULE: ./plugins/GoogleAnalyticsImporter/vue/src/ImportStatus/ImportStatusRow.vue?vue&type=template&id=8911814e +// CONCATENATED MODULE: ./plugins/GoogleAnalyticsImporter/vue/src/ImportStatus/ImportStatusRow.vue?vue&type=template&id=8a637ef8 // 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/GoogleAnalyticsImporter/vue/src/ImportStatus/ImportStatusRow.vue?vue&type=script&lang=ts @@ -1097,7 +1098,7 @@ function ImportStatusRowvue_type_template_id_8911814e_render(_ctx, _cache, $prop -ImportStatusRowvue_type_script_lang_ts.render = ImportStatusRowvue_type_template_id_8911814e_render +ImportStatusRowvue_type_script_lang_ts.render = ImportStatusRowvue_type_template_id_8a637ef8_render /* harmony default export */ var ImportStatusRow = (ImportStatusRowvue_type_script_lang_ts); // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/GoogleAnalyticsImporter/vue/src/ImportStatus/ImportStatus.vue?vue&type=script&lang=ts diff --git a/vue/dist/GoogleAnalyticsImporter.umd.min.js b/vue/dist/GoogleAnalyticsImporter.umd.min.js index bdb528649..36bbe9cbf 100644 --- a/vue/dist/GoogleAnalyticsImporter.umd.min.js +++ b/vue/dist/GoogleAnalyticsImporter.umd.min.js @@ -1,4 +1,4 @@ -(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["GoogleAnalyticsImporter"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["GoogleAnalyticsImporter"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,o){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="plugins/GoogleAnalyticsImporter/vue/dist/",o(o.s="fae3")}({"19dc":function(t,o){t.exports=e},"8bbf":function(e,o){e.exports=t},a5a2:function(e,t){e.exports=o},fae3:function(e,t,o){"use strict";if(o.r(t),o.d(t,"ImportScheduler",(function(){return V})),o.d(t,"ImportSchedulerGA4",(function(){return M})),o.d(t,"ImportSelector",(function(){return U})),o.d(t,"ImportStatus",(function(){return We})),o.d(t,"ConfigureConnection",(function(){return Gt})),"undefined"!==typeof window){var n=window.document.currentScript,r=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(o.p=r[1])}var l=o("19dc"),a=["Transitions.getTransitions","UsersFlow.getUsersFlow","UsersFlow.getUsersFlowPretty","UsersFlow.getInteractionActions"],i=window,c=i.$;l["Matomo"].on("widget:loaded",(function(e){var t=e.parameters,o=e.element,n="".concat(t.module,".").concat(t.action);if(-1!==a.indexOf(n)){var r=l["Matomo"].importedFromGoogleStartDate,i=l["Matomo"].importedFromGoogleEndDate;if(r&&i){r=Object(l["parseDate"])(r),i=Object(l["parseDate"])(i);var s=l["MatomoUrl"].parsed.value.period,m=l["MatomoUrl"].parsed.value.date,d=l["Periods"].parse(s,m).getDateRange(),p=!(r.getTime()>d[1].getTime()||i.getTime()
'.concat(u,"
");c(o).find(".card-content>div").append(b)}}}}));var s=o("8bbf"),m={name:"startDate"},d={name:"endDate"},p={name:"propertyId"},u={name:"accountId"},b={name:"viewId"},g={name:"isMobileApp"},O={name:"timezone"},j={name:"extraCustomDimensions"},y={name:"forceIgnoreOutOfCustomDimSlotError"},h={name:"isVerboseLoggingEnabled"},f=["disabled"];function I(e,t,o,n,r,l){var a=Object(s["resolveComponent"])("Field");return Object(s["openBlock"])(),Object(s["createElementBlock"])("div",null,[Object(s["createElementVNode"])("p",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ScheduleImportDescription")),1),Object(s["createElementVNode"])("div",m,[Object(s["createVNode"])(a,{uicontrol:"text",name:"startDate",modelValue:e.startDate,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDate=t}),title:e.translate("GoogleAnalyticsImporter_StartDate"),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_CreationDate")," (YYYY-MM-DD)"),"inline-help":e.translate("GoogleAnalyticsImporter_StartDateHelp")},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",d,[Object(s["createVNode"])(a,{uicontrol:"text",name:"endDate",modelValue:e.endDate,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.endDate=t}),title:e.translate("GoogleAnalyticsImporter_EndDate"),placeholder:e.translate("GoogleAnalyticsImporter_None"),"inline-help":e.endDateHelp},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",p,[Object(s["createVNode"])(a,{uicontrol:"text",name:"propertyId",modelValue:e.propertyId,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.propertyId=t}),placeholder:"eg. UA-XXXXX-X",title:e.translate("GoogleAnalyticsImporter_PropertyId"),"inline-help":e.translate("GoogleAnalyticsImporter_PropertyIdHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",u,[Object(s["createVNode"])(a,{uicontrol:"text",name:"accountId",placeholder:"eg. 1234567",modelValue:e.accountId,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.accountId=t}),title:e.translate("GoogleAnalyticsImporter_AccountId"),"inline-help":e.translate("GoogleAnalyticsImporter_AccountIdHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",b,[Object(s["createVNode"])(a,{uicontrol:"text",name:"viewId",placeholder:"eg. 1234567",modelValue:e.viewId,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.viewId=t}),title:e.translate("GoogleAnalyticsImporter_ViewId"),"inline-help":e.translate("GoogleAnalyticsImporter_ViewIdHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",g,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"isMobileApp",modelValue:e.isMobileApp,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.isMobileApp=t}),title:e.translate("GoogleAnalyticsImporter_IsMobileApp"),"inline-help":e.translate("GoogleAnalyticsImporter_IsMobileAppHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",O,[Object(s["createVNode"])(a,{uicontrol:"text",name:"timezone",modelValue:e.timezone,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.timezone=t}),title:e.translate("GoogleAnalyticsImporter_Timezone"),placeholder:e.translate("GoogleAnalyticsImporter_Optional"),"inline-help":e.timezoneHelp},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",j,[Object(s["createVNode"])(a,{uicontrol:"multituple",name:"extraCustomDimensions",modelValue:e.extraCustomDimensions,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.extraCustomDimensions=t}),title:e.translate("GoogleAnalyticsImporter_ExtraCustomDimensions"),"inline-help":e.extraCustomDimensionsHelp,"ui-control-attributes":e.extraCustomDimensionsField},null,8,["modelValue","title","inline-help","ui-control-attributes"])]),Object(s["createElementVNode"])("div",y,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"forceIgnoreOutOfCustomDimSlotError",modelValue:e.ignoreCustomDimensionSlotCheck,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.ignoreCustomDimensionSlotCheck=t}),title:e.translate("GoogleAnalyticsImporter_ForceCustomDimensionSlotCheck"),"inline-help":e.forceIgnoreOutOfCustomDimSlotErrorHelp},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("h3",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Troubleshooting")),1),Object(s["createElementVNode"])("div",h,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"isVerboseLoggingEnabled",modelValue:e.isVerboseLoggingEnabled,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.isVerboseLoggingEnabled=t}),title:e.translate("GoogleAnalyticsImporter_IsVerboseLoggingEnabled"),"inline-help":e.isVerboseLoggingEnabledHelp},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("button",{type:"submit",id:"startImportSubmit",class:"btn",onClick:t[10]||(t[10]=function(t){return e.startImport()}),disabled:e.isStartingImport},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Start")),9,f)])}var D=o("a5a2"),A=Object(s["defineComponent"])({props:{startImportNonce:{type:String,required:!0},maxEndDateDesc:String,extraCustomDimensionsField:{type:Object,required:!0}},components:{Field:D["Field"]},data:function(){return{isStartingImport:!1,extraCustomDimensions:[],isVerboseLoggingEnabled:!1,ignoreCustomDimensionSlotCheck:!1,startDate:"",endDate:"",propertyId:"",accountId:"",viewId:"",isMobileApp:!1,timezone:""}},created:function(){return this},methods:{startImport:function(){if(this.startDate)try{Object(l["parseDate"])(this.startDate)}catch(o){var e=l["NotificationsStore"].show({message:Object(l["translate"])("GoogleAnalyticsImporter_InvalidDateFormat",["YYYY-MM-DD"]),context:"error",type:"transient"});return void l["NotificationsStore"].scrollToNotification(e)}this.isStartingImport=!0;var t=!this.ignoreCustomDimensionSlotCheck;return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"startImport",startDate:this.startDate,endDate:this.endDate,propertyId:this.propertyId,viewId:this.viewId,nonce:this.startImportNonce,accountId:this.accountId,isMobileApp:this.isMobileApp?"1":"0",timezone:this.timezone,extraCustomDimensions:this.extraCustomDimensions,isVerboseLoggingEnabled:this.isVerboseLoggingEnabled?"1":"0",forceCustomDimensionSlotCheck:t?"1":"0"},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))}},computed:{endDateHelp:function(){var e=Object(l["translate"])("GoogleAnalyticsImporter_EndDateHelpText"),t=this.maxEndDateDesc&&Object(l["translate"])("

GoogleAnalyticsImporter_MaxEndDateHelp",this.maxEndDateDesc);return"".concat(e," ").concat(t||"")},timezoneHelp:function(){var e="https://www.php.net/manual/en/timezones.php";return Object(l["translate"])("GoogleAnalyticsImporter_TimezoneHelp",''),"")},extraCustomDimensionsHelp:function(){var e="https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/";return Object(l["translate"])("GoogleAnalyticsImporter_ExtraCustomDimensionsHelp",''),"")},forceIgnoreOutOfCustomDimSlotErrorHelp:function(){var e="https://matomo.org/docs/custom-dimensions/";return Object(l["translate"])("GoogleAnalyticsImporter_ForceCustomDimensionSlotCheckHelp",''),"")},isVerboseLoggingEnabledHelp:function(){return Object(l["translate"])("GoogleAnalyticsImporter_IsVerboseLoggingEnabledHelp","/path/to/matomo/tmp/logs/","gaimportlog.$idSite.$matomoDomain.log")}}});A.render=I;var V=A,E={name:"startDateGA4"},S={name:"endDateGA4"},G={name:"propertyIdGA4"},N={name:"isMobileAppGA4"},_={name:"timezoneGA4"},k={name:"extraCustomDimensionsGA4"},C={name:"forceIgnoreOutOfCustomDimSlotErrorGA4"},v={name:"isVerboseLoggingEnabledGA4"},x=["disabled"];function B(e,t,o,n,r,l){var a=Object(s["resolveComponent"])("Field");return Object(s["openBlock"])(),Object(s["createElementBlock"])("div",null,[Object(s["createElementVNode"])("p",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ScheduleImportDescription")),1),Object(s["createElementVNode"])("div",E,[Object(s["createVNode"])(a,{uicontrol:"text",name:"startDateGA4",modelValue:e.startDateGA4,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDateGA4=t}),title:e.translate("GoogleAnalyticsImporter_StartDate"),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_CreationDate")," (YYYY-MM-DD)"),"inline-help":e.translate("GoogleAnalyticsImporter_StartDateHelp")},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",S,[Object(s["createVNode"])(a,{uicontrol:"text",name:"endDateGA4",modelValue:e.endDateGA4,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.endDateGA4=t}),title:e.translate("GoogleAnalyticsImporter_EndDate"),placeholder:e.translate("GoogleAnalyticsImporter_None"),"inline-help":e.endDateHelp},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",G,[Object(s["createVNode"])(a,{uicontrol:"text",name:"propertyIdGA4",modelValue:e.propertyIdGA4,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.propertyIdGA4=t}),placeholder:"eg. properties/{PROPERTY_ID}",title:e.translate("GoogleAnalyticsImporter_PropertyIdGA4"),"inline-help":e.translate("GoogleAnalyticsImporter_PropertyIdGA4Help")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",N,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"isMobileAppGA4",modelValue:e.isMobileAppGA4,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.isMobileAppGA4=t}),title:e.translate("GoogleAnalyticsImporter_IsMobileApp"),"inline-help":e.translate("GoogleAnalyticsImporter_IsMobileAppHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",_,[Object(s["createVNode"])(a,{uicontrol:"text",name:"timezoneGA4",modelValue:e.timezoneGA4,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.timezoneGA4=t}),title:e.translate("GoogleAnalyticsImporter_Timezone"),placeholder:e.translate("GoogleAnalyticsImporter_Optional"),"inline-help":e.timezoneHelp},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",k,[Object(s["createVNode"])(a,{uicontrol:"multituple",name:"extraCustomDimensionsGA4",modelValue:e.extraCustomDimensionsGA4,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.extraCustomDimensionsGA4=t}),title:e.translate("GoogleAnalyticsImporter_ExtraCustomDimensions"),"inline-help":e.extraCustomDimensionsHelp,"ui-control-attributes":e.extraCustomDimensionsField},null,8,["modelValue","title","inline-help","ui-control-attributes"])]),Object(s["createElementVNode"])("div",C,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"forceIgnoreOutOfCustomDimSlotErrorGA4",modelValue:e.ignoreCustomDimensionSlotCheckGA4,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.ignoreCustomDimensionSlotCheckGA4=t}),title:e.translate("GoogleAnalyticsImporter_ForceCustomDimensionSlotCheck"),"inline-help":e.forceIgnoreOutOfCustomDimSlotErrorHelp},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("h3",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Troubleshooting")),1),Object(s["createElementVNode"])("div",v,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"isVerboseLoggingEnabledGA4",modelValue:e.isVerboseLoggingEnabledGA4,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.isVerboseLoggingEnabledGA4=t}),title:e.translate("GoogleAnalyticsImporter_IsVerboseLoggingEnabled"),"inline-help":e.isVerboseLoggingEnabledHelp},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("button",{type:"submit",id:"startImportSubmitGA4",class:"btn",onClick:t[8]||(t[8]=function(t){return e.startImportGA4()}),disabled:e.isStartingImport},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Start")),9,x)])}var T=Object(s["defineComponent"])({props:{startImportNonce:{type:String,required:!0},maxEndDateDesc:String,extraCustomDimensionsField:{type:Object,required:!0}},components:{Field:D["Field"]},data:function(){return{isStartingImport:!1,extraCustomDimensionsGA4:[],isVerboseLoggingEnabledGA4:!1,ignoreCustomDimensionSlotCheckGA4:!1,startDateGA4:"",endDateGA4:"",propertyIdGA4:"",accountId:"",viewId:"",isMobileAppGA4:!1,timezoneGA4:""}},created:function(){return this},methods:{startImportGA4:function(){if(this.startDateGA4)try{Object(l["parseDate"])(this.startDateGA4)}catch(o){var e=l["NotificationsStore"].show({message:Object(l["translate"])("GoogleAnalyticsImporter_InvalidDateFormat",["YYYY-MM-DD"]),context:"error",type:"transient"});return void l["NotificationsStore"].scrollToNotification(e)}this.isStartingImport=!0;var t=!this.ignoreCustomDimensionSlotCheckGA4;return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"startImportGA4",startDate:this.startDateGA4,endDate:this.endDateGA4,propertyId:this.propertyIdGA4,viewId:this.viewId,nonce:this.startImportNonce,accountId:this.accountId,isMobileApp:this.isMobileAppGA4?"1":"0",timezone:this.timezoneGA4,extraCustomDimensions:this.extraCustomDimensionsGA4,isVerboseLoggingEnabled:this.isVerboseLoggingEnabledGA4?"1":"0",forceCustomDimensionSlotCheck:t?"1":"0"},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))}},computed:{endDateHelp:function(){var e=Object(l["translate"])("GoogleAnalyticsImporter_EndDateHelpText"),t=this.maxEndDateDesc&&Object(l["translate"])("

GoogleAnalyticsImporter_MaxEndDateHelp",this.maxEndDateDesc);return"".concat(e," ").concat(t||"")},timezoneHelp:function(){var e="https://www.php.net/manual/en/timezones.php";return Object(l["translate"])("GoogleAnalyticsImporter_TimezoneGA4Help",''),"")},extraCustomDimensionsHelp:function(){var e="https://ga-dev-tools.web.app/ga4/dimensions-metrics-explorer/";return Object(l["translate"])("GoogleAnalyticsImporter_ExtraCustomDimensionsGA4Help",''),"")},forceIgnoreOutOfCustomDimSlotErrorHelp:function(){var e="https://matomo.org/docs/custom-dimensions/";return Object(l["translate"])("GoogleAnalyticsImporter_ForceCustomDimensionSlotCheckHelp",''),"")},isVerboseLoggingEnabledHelp:function(){return Object(l["translate"])("GoogleAnalyticsImporter_IsVerboseLoggingEnabledHelp","/path/to/matomo/tmp/logs/","gaimportlog.$idSite.$matomoDomain.log")}}});T.render=B;var M=T;function w(e,t,o,n,r,l){var a=Object(s["resolveComponent"])("Field"),i=Object(s["resolveDirective"])("form");return Object(s["withDirectives"])((Object(s["openBlock"])(),Object(s["createElementBlock"])("div",null,[Object(s["createElementVNode"])("div",null,[Object(s["createVNode"])(a,{uicontrol:"radio",name:"selectedImporter",modelValue:e.selectedImporter,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.selectedImporter=t}),options:e.importOptionsUa,"inline-help":e.translate("GoogleAnalyticsImporter_SelectImporterUAInlineHelpText")},null,8,["modelValue","options","inline-help"]),Object(s["createVNode"])(a,{uicontrol:"radio",name:"selectedImporter",modelValue:e.selectedImporterGA4,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.selectedImporterGA4=t}),options:e.importOptionsGa4,"inline-help":e.translate("GoogleAnalyticsImporter_SelectImporterGA4InlineHelpText")},null,8,["modelValue","options","inline-help"])])],512)),[[i]])}var H=Object(s["defineComponent"])({props:{importOptionsUa:{type:Object,required:!0},importOptionsGa4:{type:Object,required:!0}},components:{Field:D["Field"]},directives:{Form:D["Form"]},data:function(){return{selectedImporter:"",selectedImporterGA4:""}}});H.render=w;var U=H,F={ref:"root"},L={class:"entityTable importStatusesTable"},R={class:"modal",id:"openScheduleReimportModal"},z={class:"modal-content"},P={class:"modal-footer"},q={class:"modal",id:"editImportEndDate"},Y={class:"modal-content"},$={class:"modal-footer"};function W(e,t,o,n,r,l){var a=Object(s["resolveComponent"])("ImportStatusRow"),i=Object(s["resolveComponent"])("Field"),c=Object(s["resolveDirective"])("tooltips");return Object(s["withDirectives"])((Object(s["openBlock"])(),Object(s["createElementBlock"])("div",F,[Object(s["createElementVNode"])("table",L,[Object(s["createElementVNode"])("thead",null,[Object(s["createElementVNode"])("tr",null,[Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_MatomoSite")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GoogleAnalyticsInfo")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Status")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LatestDayProcessed")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ScheduledReImports")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_StartFinishTimes")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Actions")),1)])]),Object(s["createElementVNode"])("tbody",null,[(Object(s["openBlock"])(!0),Object(s["createElementBlock"])(s["Fragment"],null,Object(s["renderList"])(e.statuses,(function(t,o){return Object(s["openBlock"])(),Object(s["createBlock"])(a,{status:t,key:o,onEndImport:function(o){return e.showEditImportEndDateModal(t.idSite,t.isGA4)},onReimport:function(o){return e.openScheduleReimportModal(t.idSite,t.isGA4)},onDelete:function(o){return e.deleteImportStatus(t.idSite,o.isDone)},onManuallyResume:function(o){return e.manuallyResume(t.idSite,t.isGA4)}},null,8,["status","onEndImport","onReimport","onDelete","onManuallyResume"])})),128))])]),Object(s["createElementVNode"])("div",R,[Object(s["createElementVNode"])("div",z,[Object(s["createElementVNode"])("h3",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_EnterImportDateRange")),1),Object(s["createElementVNode"])("div",null,[Object(s["createVNode"])(i,{name:"re-import-start-date",uicontrol:"text",modelValue:e.reimportStartDate,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reimportStartDate=t}),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_StartDate")," (YYYY-MM-DD)")},null,8,["modelValue","placeholder"])]),Object(s["createElementVNode"])("div",null,[Object(s["createVNode"])(i,{name:"re-import-end-date",uicontrol:"text",modelValue:e.reimportEndDate,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.reimportEndDate=t}),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_EndDate")," (YYYY-MM-DD)")},null,8,["modelValue","placeholder"])])]),Object(s["createElementVNode"])("div",P,[Object(s["createElementVNode"])("a",{id:"scheduleReimportSubmit",href:"",class:"modal-action modal-close btn",onClick:t[2]||(t[2]=Object(s["withModifiers"])((function(t){return e.scheduleReimport()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Schedule")),1),Object(s["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[3]||(t[3]=Object(s["withModifiers"])((function(){}),["prevent"]))},Object(s["toDisplayString"])(e.translate("General_Cancel")),1)])]),Object(s["createElementVNode"])("div",q,[Object(s["createElementVNode"])("div",Y,[Object(s["createElementVNode"])("h3",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_EnterImportEndDate")),1),Object(s["createElementVNode"])("p",null,[Object(s["createElementVNode"])("em",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LeaveEmptyToRemove")),1)]),Object(s["createElementVNode"])("div",null,[Object(s["createVNode"])(i,{name:"new-import-end-date",uicontrol:"text",modelValue:e.newImportEndDate,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.newImportEndDate=t}),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_EndDate")," (YYYY-MM-DD)")},null,8,["modelValue","placeholder"])])]),Object(s["createElementVNode"])("div",$,[Object(s["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[5]||(t[5]=function(t){return e.changeImportEndDateModal()}),style:{"margin-right":"3.5px"}},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Change")),1),Object(s["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[6]||(t[6]=function(t){return e.cancelEditImportEndDateModal()})},Object(s["toDisplayString"])(e.translate("General_Cancel")),1)])])],512)),[[c,{content:e.tooltipContent,delay:500,duration:200}]])}var X=["data-idsite"],J={class:"sitename"},K=["href"],Q={key:1,style:{"text-transform":"uppercase"}},Z=Object(s["createElementVNode"])("br",null,null,-1),ee=["innerHTML"],te={class:"status"},oe={key:0},ne=["title"],re=Object(s["createElementVNode"])("br",null,null,-1),le={key:0},ae={key:1},ie=["title"],ce=Object(s["createElementVNode"])("br",null,null,-1),se={key:0},me={key:2},de=["title"],pe={key:3},ue=["title"],be={key:4},ge=Object(s["createElementVNode"])("br",null,null,-1),Oe=["innerHTML"],je={key:5},ye=["title"],he=Object(s["createElementVNode"])("br",null,null,-1),fe={class:"last-date-imported"},Ie=Object(s["createElementVNode"])("br",null,null,-1),De=Object(s["createElementVNode"])("br",null,null,-1),Ae=Object(s["createElementVNode"])("br",null,null,-1),Ve=Object(s["createElementVNode"])("br",null,null,-1),Ee=Object(s["createElementVNode"])("br",null,null,-1),Se={key:0},Ge={class:"scheduled-reimports"},Ne={key:0},_e={key:1},ke={class:"import-start-finish-times"},Ce=Object(s["createElementVNode"])("br",null,null,-1),ve=Object(s["createElementVNode"])("br",null,null,-1),xe={key:0},Be={key:1},Te={key:0},Me={key:1},we={key:2},He={key:3},Ue={class:"actions"},Fe=["title"],Le=["title"];function Re(e,t,o,n,r,l){var a;return Object(s["openBlock"])(),Object(s["createElementBlock"])("tr",{"data-idsite":e.status.idSite},[Object(s["createElementVNode"])("td",J,[e.status.site?(Object(s["openBlock"])(),Object(s["createElementBlock"])("a",{key:0,target:"_blank",href:e.siteUrl},Object(s["toDisplayString"])(e.siteName),9,K)):(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",Q,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_SiteDeleted")),1)),Z,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_SiteID"))+": "+Object(s["toDisplayString"])(e.status.idSite),1)]),Object(s["createElementVNode"])("td",{class:"ga-info",innerHTML:e.$sanitize(e.gaInfoPretty)},null,8,ee),Object(s["createElementVNode"])("td",te,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.status.status)+" ",1),"rate_limited"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",oe,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.translate("GoogleAnalyticsImporter_RateLimitHelp")},null,8,ne),re,e.status.days_finished_since_rate_limit?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",le,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_FinishedImportingDaysWaiting",e.status.days_finished_since_rate_limit)),1)):Object(s["createCommentVNode"])("",!0)])):Object(s["createCommentVNode"])("",!0),"cloud_rate_limited"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",ae,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.status.error},null,8,ie),ce,e.status.days_finished_since_rate_limit?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",se,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_FinishedImportingDaysWaiting",e.status.days_finished_since_rate_limit)),1)):Object(s["createCommentVNode"])("",!0)])):Object(s["createCommentVNode"])("",!0),"rate_limited_hourly"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",me,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.translate("GoogleAnalyticsImporter_RateLimitHourlyHelp")},null,8,de)])):Object(s["createCommentVNode"])("",!0),"future_date_import_pending"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",pe,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.translate("GoogleAnalyticsImporter_FutureDateHelp",e.status.future_resume_date)},null,8,ue)])):"errored"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",be,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ErrorMessage"))+": "+Object(s["toDisplayString"])(e.status.error||"no message")+" ",1),ge,Object(s["createElementVNode"])("span",{innerHTML:e.$sanitize(e.errorMessageBugReportRequest)},null,8,Oe)])):"killed"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",je,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.translate("GoogleAnalyticsImporter_KilledStatusHelp")},null,8,ye),he,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ErrorMessage"))+": "+Object(s["toDisplayString"])(e.status.error||"no message"),1)])):Object(s["createCommentVNode"])("",!0)]),Object(s["createElementVNode"])("td",fe,[Object(s["createElementVNode"])("div",null,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LastDayImported"))+": "+Object(s["toDisplayString"])(e.status.last_date_imported||e.noneText),1),Ie,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LastDayArchived"))+": "+Object(s["toDisplayString"])(e.status.last_day_archived||e.noneText),1),De,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ImportStartDate"))+": "+Object(s["toDisplayString"])(e.status.import_range_start||e.websiteCreationTime)+" ",1),Ae,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ImportEndDate"))+": "+Object(s["toDisplayString"])(e.status.import_range_end||e.noneText)+" ",1),Ve,Ee]),"finished"!==e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",Se,[Object(s["createElementVNode"])("a",{class:"edit-import-end-link table-command-link",href:"",onClick:t[0]||(t[0]=Object(s["withModifiers"])((function(t){return e.$emit("end-import")}),["prevent"]))},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_EditEndDate")),1)])):Object(s["createCommentVNode"])("",!0),Object(s["createElementVNode"])("div",null,[Object(s["createElementVNode"])("a",{id:"reimport-date-range",class:"table-command-link",href:"",onClick:t[1]||(t[1]=Object(s["withModifiers"])((function(t){return e.$emit("reimport")}),["prevent"]))},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ReimportDate")),1)])]),Object(s["createElementVNode"])("td",Ge,[null!==(a=e.status.reimport_ranges)&&void 0!==a&&a.length?(Object(s["openBlock"])(),Object(s["createElementBlock"])("ul",Ne,[(Object(s["openBlock"])(!0),Object(s["createElementBlock"])(s["Fragment"],null,Object(s["renderList"])(e.status.reimport_ranges,(function(e,t){return Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:t},Object(s["toDisplayString"])(e[0])+","+Object(s["toDisplayString"])(e[1]),1)})),128))])):(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",_e,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_None")),1))]),Object(s["createElementVNode"])("td",ke,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ImportStartTime"))+": "+Object(s["toDisplayString"])(e.status.import_start_time||e.noneText),1),Ce,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LastResumeTime"))+": "+Object(s["toDisplayString"])(e.status.last_job_start_time||e.noneText),1),ve,"finished"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",xe,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_TimeFinished"))+": "+Object(s["toDisplayString"])(e.status.import_end_time||e.noneText),1)):e.status.estimated_days_left_to_finish?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",Be,[e.thisJobShouldFinishToday?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",Te,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ThisJobShouldFinishToday")),1)):(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",Me,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_EstimatedFinishIn",e.status.estimated_days_left_to_finish)),1))])):e.status.import_range_end?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",we,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_JobWillRunUntilManuallyCancelled")),1)):(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",He,Object(s["toDisplayString"])(e.translate("General_Unknown")),1))]),Object(s["createElementVNode"])("td",Ue,[Object(s["createElementVNode"])("a",{class:Object(s["normalizeClass"])(["table-action",{"icon-delete":e.isDone,"icon-close":!e.isDone}]),onClick:t[2]||(t[2]=Object(s["withModifiers"])((function(t){return e.$emit("delete",{isDone:e.isDone})}),["prevent"])),title:e.isDone?e.translate("General_Remove"):e.translate("General_Cancel")},null,10,Fe),-1===["finished","ongoing","started"].indexOf(e.status.status)?(Object(s["openBlock"])(),Object(s["createElementBlock"])("a",{key:0,class:"table-action icon-play",onClick:t[3]||(t[3]=Object(s["withModifiers"])((function(t){return e.$emit("manuallyResume")}),["prevent"])),title:e.translate("GoogleAnalyticsImporter_ResumeDesc")},null,8,Le)):Object(s["createCommentVNode"])("",!0)])],8,X)}var ze=Object(s["defineComponent"])({props:{status:{type:Object,required:!0}},emits:["end-import","reimport","delete","manuallyResume"],computed:{isDone:function(){return"finished"===this.status.status},siteUrl:function(){return"?".concat(l["MatomoUrl"].stringify(Object.assign(Object.assign({period:"day",date:"today"},l["MatomoUrl"].urlParsed.value),{},{idSite:this.status.idSite,module:"CoreHome",action:"index"})))},gaInfoPretty:function(){return(this.status.gaInfoPretty||"").replace(/\n/g,"
")},errorMessageBugReportRequest:function(){return Object(l["translate"])("GoogleAnalyticsImporter_ErrorMessageBugReportRequest",'',"")},thisJobShouldFinishToday:function(){return 0===this.status.estimated_days_left_to_finish||"0"===this.status.estimated_days_left_to_finish},siteName:function(){var e;return l["Matomo"].helper.htmlDecode(null===(e=this.status.site)||void 0===e?void 0:e.name)},noneText:function(){return Object(l["translate"])("GoogleAnalyticsImporter_None")},websiteCreationTime:function(){return Object(l["translate"])("GoogleAnalyticsImporter_CreationDate")}}});ze.render=Re;var Pe=ze,qe=window,Ye=qe.$,$e=Object(s["defineComponent"])({props:{statuses:{type:Array,required:!0},stopImportNonce:{type:String,required:!0},changeImportEndDateNonce:{type:String,required:!0},resumeImportNonce:{type:String,required:!0},scheduleReImportNonce:{type:String,required:!0}},components:{Field:D["Field"],ImportStatusRow:Pe},directives:{Tooltips:l["Tooltips"]},data:function(){return{editImportEndDateIdSite:null,reimportDateRangeIdSite:null,reimportStartDate:"",reimportEndDate:"",newImportEndDate:"",isGA4:!1}},methods:{showEditImportEndDateModal:function(e,t){this.editImportEndDateIdSite=e,this.isGA4=t,Ye("#editImportEndDate").modal({dismissible:!1}).modal("open")},cancelEditImportEndDateModal:function(){this.editImportEndDateIdSite=null,this.isGA4=!1},manuallyResume:function(e,t){return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"resumeImport",idSite:e,isGA4:t?1:0,nonce:this.resumeImportNonce},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))},deleteImportStatus:function(e,t){var o=this;if(t)return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"deleteImportStatus",idSite:e,nonce:this.stopImportNonce},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}));l["Matomo"].helper.modalConfirm("#confirmCancelJob",{yes:function(){o.deleteImportStatus(e,!0)}})},openScheduleReimportModal:function(e,t){this.reimportDateRangeIdSite=e,this.isGA4=t,Ye("#openScheduleReimportModal").modal({dismissible:!1}).modal("open")},changeImportEndDateModal:function(){return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"changeImportEndDate",idSite:this.editImportEndDateIdSite,nonce:this.changeImportEndDateNonce,endDate:this.newImportEndDate},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))},scheduleReimport:function(){return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"scheduleReImport",idSite:this.reimportDateRangeIdSite,startDate:this.reimportStartDate,endDate:this.reimportEndDate,nonce:this.scheduleReImportNonce,isGA4:this.isGA4?1:0},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))}},computed:{tooltipContent:function(){return function(){var e=Ye(this);if(""===e.attr("piwik-field"))return"";var t=Ye(this).attr("title")||"";return window.vueSanitize(t.replace(/\n/g,"
"))}}}});$e.render=W;var We=$e,Xe={key:0,class:"form-group row"},Je={class:"col s12 m6"},Ke=Object(s["createElementVNode"])("br",null,null,-1),Qe=["innerHTML"],Ze={class:"col s12 m6"},et=["innerHTML"],tt=["innerHTML"],ot=["textContent"],nt={class:"form-group row"},rt=["action"],lt={key:0,type:"hidden",name:"isNoDataPage",value:"1"},at=["value"],it=["disabled"],ct=Object(s["createElementVNode"])("span",{class:"icon-upload"},null,-1),st=Object(s["createElementVNode"])("span",{class:"icon-upload"},null,-1),mt={key:1,class:"system-success connected-message-successful"},dt=Object(s["createElementVNode"])("span",{class:"icon-ok"},null,-1),pt=["innerHTML"],ut=["innerHTML"],bt=["action"],gt=["value"],Ot=["disabled","textContent"],jt={key:0,class:"system-success connected-message-successful"},yt=Object(s["createElementVNode"])("span",{class:"icon-ok"},null,-1),ht=["innerHTML"],ft=["textContent"],It=["textContent"],Dt=["innerHTML"],At=["innerHTML"],Vt=["textContent"];function Et(e,t,o,n,r,l){return Object(s["openBlock"])(),Object(s["createElementBlock"])(s["Fragment"],null,[e.isNoDataPage?Object(s["createCommentVNode"])("",!0):(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",Xe,[Object(s["createElementVNode"])("div",Je,[Object(s["createElementVNode"])("p",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ConfigureTheImporterLabel1")),1),Object(s["createElementVNode"])("p",null,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ConfigureTheImporterLabel2")),1),Ke,Object(s["createElementVNode"])("span",{innerHTML:e.$sanitize(e.setupGoogleAnalyticsImportFaq)},null,8,Qe)])]),Object(s["createElementVNode"])("div",Ze,[Object(s["createElementVNode"])("div",{class:"form-help",innerHTML:e.$sanitize(e.translate("GoogleAnalyticsImporter_ConfigureTheImporterHelpNewDate","",""))},null,8,et)])])),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:1,innerHTML:e.$sanitize(e.getAdvanceConnectStep01Text)},null,8,tt)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:2,textContent:Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep02"))},null,8,ot)):Object(s["createCommentVNode"])("",!0),Object(s["createElementVNode"])("div",nt,[Object(s["createElementVNode"])("div",{class:Object(s["normalizeClass"])(e.getClass)},[Object(s["createElementVNode"])("form",{id:"configFileUploadForm",action:e.actionUrl,method:"POST",enctype:"multipart/form-data"},[Object(s["createElementVNode"])("input",{type:"file",id:"clientfile",name:"clientfile",accept:".json",onChange:t[0]||(t[0]=function(){return e.processFileChange&&e.processFileChange.apply(e,arguments)}),style:{display:"none"}},null,32),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("input",lt)):Object(s["createCommentVNode"])("",!0),Object(s["createElementVNode"])("input",{type:"hidden",name:"config_nonce",value:e.configNonce},null,8,at),Object(s["createElementVNode"])("button",{type:"button",class:"btn advance-upload-button",onClick:t[1]||(t[1]=function(t){return e.selectConfigFile()}),disabled:e.isUploadButtonDisabled},[Object(s["withDirectives"])(Object(s["createElementVNode"])("span",null,[ct,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("General_Upload")),1)],512),[[s["vShow"],!e.isUploadButtonDisabled]]),Object(s["withDirectives"])(Object(s["createElementVNode"])("span",null,[st,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Uploading")),1)],512),[[s["vShow"],e.isUploadButtonDisabled]])],8,it),e.isNoDataPage&&e.hasClientConfiguration?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",mt,[dt,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_UploadSuccessful")),1)])):Object(s["createCommentVNode"])("",!0)],8,rt)],2)]),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:3,innerHTML:e.$sanitize(e.getAdvanceConnectStep03Text)},null,8,pt)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",{key:4,style:{"margin-left":"1.2rem"},class:"complete-note-warning",innerHTML:e.$sanitize(e.getOauthCompleteWarningMessage)},null,8,ut)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("form",{key:5,target:"_blank",method:"post",action:e.authorizeUrl},[Object(s["createElementVNode"])("input",{type:"hidden",name:"auth_nonce",value:e.forwardToAuthNonce},null,8,gt),Object(s["createElementVNode"])("button",{disabled:!1===e.hasClientConfiguration,textContent:Object(s["toDisplayString"])(e.getAuthorizeText),type:"submit",class:"btn btn-forward-to-Oauth"},null,8,Ot),e.isNoDataPage&&e.hasClientConfiguration&&e.isConfigured?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",jt,[yt,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_AccountsConnectedSuccessfully")),1)])):Object(s["createCommentVNode"])("",!0)],8,bt)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:6,innerHTML:e.$sanitize(e.getAdvanceConnectStep04Text)},null,8,ht)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:7,textContent:Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep05"))},null,8,ft)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:8,textContent:Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep06"))},null,8,It)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:9,innerHTML:e.$sanitize(e.getAdvanceConnectStep07Text)},null,8,Dt)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:10,innerHTML:e.$sanitize(e.getAdvanceConnectStep08Text)},null,8,At)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:11,textContent:Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep09"))},null,8,Vt)):Object(s["createCommentVNode"])("",!0)],64)}var St=Object(s["defineComponent"])({data:function(){return{isSelectingFile:!1,isUploading:!1}},props:{actionUrl:{type:String,required:!0},configNonce:{type:String,required:!0},isNoDataPage:Boolean,hasClientConfiguration:Boolean,indexActionUrl:String,authorizeUrl:String,forwardToAuthNonce:String,isConfigured:Boolean},methods:{selectConfigFile:function(){this.isSelectingFile=!0;var e=document.getElementById("clientfile");e&&e.click()},processFileChange:function(){var e=document.getElementById("clientfile"),t=document.getElementById("configFileUploadForm");e&&e.value&&t&&(this.isUploading=!0,t.submit())},checkForCancel:function(){if(this.isSelectingFile&&!this.isUploading){var e=document.getElementById("clientfile");e&&!e.value&&(this.isSelectingFile=!1)}}},computed:{setupGoogleAnalyticsImportFaq:function(){var e="https://matomo.org/faq/general/set-up-google-analytics-import/";return Object(l["translate"])("GoogleAnalyticsImporter_ConfigureTheImporterLabel3",''),"")},isUploadButtonDisabled:function(){return this.isSelectingFile||this.isUploading},getAdvanceConnectStep01Text:function(){var e="https://matomo.org/faq/general/set-up-google-analytics-import/";return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep01",''),"")},getAdvanceConnectStep03Text:function(){return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep03",this.translate("GoogleAnalyticsImporter_Authorize"))},getAdvanceConnectStep04Text:function(){var e="https://matomo.org/faq/general/running-the-google-analytics-import/";return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep04",''),"",''),"")},getAdvanceConnectStep05Text:function(){return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep05",''),"")},getAdvanceConnectStep07Text:function(){return"".concat(this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep07",this.translate("GoogleAnalyticsImporter_Start")),'
').concat(this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep07Note","","",this.translate("GoogleAnalyticsImporter_Start")),"
")},getAdvanceConnectStep08Text:function(){return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep08",''),"")},getOauthCompleteWarningMessage:function(){return this.translate("GoogleAnalyticsImporter_GoogleOauthCompleteWarning","","")},getClass:function(){var e="col s12";return this.isNoDataPage?e+=" p-half-point":e+=" m6",e},getAuthorizeText:function(){return this.isConfigured?this.translate("GoogleAnalyticsImporter_ReAuthorize"):this.translate("GoogleAnalyticsImporter_Authorize")}},mounted:function(){document.body.onfocus=this.checkForCancel}});St.render=Et;var Gt=St; +(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["GoogleAnalyticsImporter"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["GoogleAnalyticsImporter"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,o){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="plugins/GoogleAnalyticsImporter/vue/dist/",o(o.s="fae3")}({"19dc":function(t,o){t.exports=e},"8bbf":function(e,o){e.exports=t},a5a2:function(e,t){e.exports=o},fae3:function(e,t,o){"use strict";if(o.r(t),o.d(t,"ImportScheduler",(function(){return V})),o.d(t,"ImportSchedulerGA4",(function(){return M})),o.d(t,"ImportSelector",(function(){return U})),o.d(t,"ImportStatus",(function(){return We})),o.d(t,"ConfigureConnection",(function(){return Gt})),"undefined"!==typeof window){var n=window.document.currentScript,r=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(o.p=r[1])}var l=o("19dc"),a=["Transitions.getTransitions","UsersFlow.getUsersFlow","UsersFlow.getUsersFlowPretty","UsersFlow.getInteractionActions"],i=window,c=i.$;l["Matomo"].on("widget:loaded",(function(e){var t=e.parameters,o=e.element,n="".concat(t.module,".").concat(t.action);if(-1!==a.indexOf(n)){var r=l["Matomo"].importedFromGoogleStartDate,i=l["Matomo"].importedFromGoogleEndDate;if(r&&i){r=Object(l["parseDate"])(r),i=Object(l["parseDate"])(i);var s=l["MatomoUrl"].parsed.value.period,m=l["MatomoUrl"].parsed.value.date,d=l["Periods"].parse(s,m).getDateRange(),p=!(r.getTime()>d[1].getTime()||i.getTime()
'.concat(u,"
");c(o).find(".card-content>div").append(b)}}}}));var s=o("8bbf"),m={name:"startDate"},d={name:"endDate"},p={name:"propertyId"},u={name:"accountId"},b={name:"viewId"},g={name:"isMobileApp"},O={name:"timezone"},j={name:"extraCustomDimensions"},y={name:"forceIgnoreOutOfCustomDimSlotError"},h={name:"isVerboseLoggingEnabled"},f=["disabled"];function I(e,t,o,n,r,l){var a=Object(s["resolveComponent"])("Field");return Object(s["openBlock"])(),Object(s["createElementBlock"])("div",null,[Object(s["createElementVNode"])("p",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ScheduleImportDescription")),1),Object(s["createElementVNode"])("div",m,[Object(s["createVNode"])(a,{uicontrol:"text",name:"startDate",modelValue:e.startDate,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDate=t}),title:e.translate("GoogleAnalyticsImporter_StartDate"),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_CreationDate")," (YYYY-MM-DD)"),"inline-help":e.translate("GoogleAnalyticsImporter_StartDateHelp")},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",d,[Object(s["createVNode"])(a,{uicontrol:"text",name:"endDate",modelValue:e.endDate,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.endDate=t}),title:e.translate("GoogleAnalyticsImporter_EndDate"),placeholder:e.translate("GoogleAnalyticsImporter_None"),"inline-help":e.endDateHelp},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",p,[Object(s["createVNode"])(a,{uicontrol:"text",name:"propertyId",modelValue:e.propertyId,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.propertyId=t}),placeholder:"eg. UA-XXXXX-X",title:e.translate("GoogleAnalyticsImporter_PropertyId"),"inline-help":e.translate("GoogleAnalyticsImporter_PropertyIdHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",u,[Object(s["createVNode"])(a,{uicontrol:"text",name:"accountId",placeholder:"eg. 1234567",modelValue:e.accountId,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.accountId=t}),title:e.translate("GoogleAnalyticsImporter_AccountId"),"inline-help":e.translate("GoogleAnalyticsImporter_AccountIdHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",b,[Object(s["createVNode"])(a,{uicontrol:"text",name:"viewId",placeholder:"eg. 1234567",modelValue:e.viewId,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.viewId=t}),title:e.translate("GoogleAnalyticsImporter_ViewId"),"inline-help":e.translate("GoogleAnalyticsImporter_ViewIdHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",g,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"isMobileApp",modelValue:e.isMobileApp,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.isMobileApp=t}),title:e.translate("GoogleAnalyticsImporter_IsMobileApp"),"inline-help":e.translate("GoogleAnalyticsImporter_IsMobileAppHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",O,[Object(s["createVNode"])(a,{uicontrol:"text",name:"timezone",modelValue:e.timezone,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.timezone=t}),title:e.translate("GoogleAnalyticsImporter_Timezone"),placeholder:e.translate("GoogleAnalyticsImporter_Optional"),"inline-help":e.timezoneHelp},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",j,[Object(s["createVNode"])(a,{uicontrol:"multituple",name:"extraCustomDimensions",modelValue:e.extraCustomDimensions,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.extraCustomDimensions=t}),title:e.translate("GoogleAnalyticsImporter_ExtraCustomDimensions"),"inline-help":e.extraCustomDimensionsHelp,"ui-control-attributes":e.extraCustomDimensionsField},null,8,["modelValue","title","inline-help","ui-control-attributes"])]),Object(s["createElementVNode"])("div",y,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"forceIgnoreOutOfCustomDimSlotError",modelValue:e.ignoreCustomDimensionSlotCheck,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.ignoreCustomDimensionSlotCheck=t}),title:e.translate("GoogleAnalyticsImporter_ForceCustomDimensionSlotCheck"),"inline-help":e.forceIgnoreOutOfCustomDimSlotErrorHelp},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("h3",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Troubleshooting")),1),Object(s["createElementVNode"])("div",h,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"isVerboseLoggingEnabled",modelValue:e.isVerboseLoggingEnabled,"onUpdate:modelValue":t[9]||(t[9]=function(t){return e.isVerboseLoggingEnabled=t}),title:e.translate("GoogleAnalyticsImporter_IsVerboseLoggingEnabled"),"inline-help":e.isVerboseLoggingEnabledHelp},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("button",{type:"submit",id:"startImportSubmit",class:"btn",onClick:t[10]||(t[10]=function(t){return e.startImport()}),disabled:e.isStartingImport},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Start")),9,f)])}var D=o("a5a2"),A=Object(s["defineComponent"])({props:{startImportNonce:{type:String,required:!0},maxEndDateDesc:String,extraCustomDimensionsField:{type:Object,required:!0}},components:{Field:D["Field"]},data:function(){return{isStartingImport:!1,extraCustomDimensions:[],isVerboseLoggingEnabled:!1,ignoreCustomDimensionSlotCheck:!1,startDate:"",endDate:"",propertyId:"",accountId:"",viewId:"",isMobileApp:!1,timezone:""}},created:function(){return this},methods:{startImport:function(){if(this.startDate)try{Object(l["parseDate"])(this.startDate)}catch(o){var e=l["NotificationsStore"].show({message:Object(l["translate"])("GoogleAnalyticsImporter_InvalidDateFormat",["YYYY-MM-DD"]),context:"error",type:"transient"});return void l["NotificationsStore"].scrollToNotification(e)}this.isStartingImport=!0;var t=!this.ignoreCustomDimensionSlotCheck;return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"startImport",startDate:this.startDate,endDate:this.endDate,propertyId:this.propertyId,viewId:this.viewId,nonce:this.startImportNonce,accountId:this.accountId,isMobileApp:this.isMobileApp?"1":"0",timezone:this.timezone,extraCustomDimensions:this.extraCustomDimensions,isVerboseLoggingEnabled:this.isVerboseLoggingEnabled?"1":"0",forceCustomDimensionSlotCheck:t?"1":"0"},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))}},computed:{endDateHelp:function(){var e=Object(l["translate"])("GoogleAnalyticsImporter_EndDateHelpText"),t=this.maxEndDateDesc&&Object(l["translate"])("

GoogleAnalyticsImporter_MaxEndDateHelp",this.maxEndDateDesc);return"".concat(e," ").concat(t||"")},timezoneHelp:function(){var e="https://www.php.net/manual/en/timezones.php";return Object(l["translate"])("GoogleAnalyticsImporter_TimezoneHelp",''),"")},extraCustomDimensionsHelp:function(){var e="https://ga-dev-tools.appspot.com/dimensions-metrics-explorer/";return Object(l["translate"])("GoogleAnalyticsImporter_ExtraCustomDimensionsHelp",''),"")},forceIgnoreOutOfCustomDimSlotErrorHelp:function(){var e="https://matomo.org/docs/custom-dimensions/";return Object(l["translate"])("GoogleAnalyticsImporter_ForceCustomDimensionSlotCheckHelp",''),"")},isVerboseLoggingEnabledHelp:function(){return Object(l["translate"])("GoogleAnalyticsImporter_IsVerboseLoggingEnabledHelp","/path/to/matomo/tmp/logs/","gaimportlog.$idSite.$matomoDomain.log")}}});A.render=I;var V=A,E={name:"startDateGA4"},S={name:"endDateGA4"},G={name:"propertyIdGA4"},N={name:"isMobileAppGA4"},_={name:"timezoneGA4"},k={name:"extraCustomDimensionsGA4"},C={name:"forceIgnoreOutOfCustomDimSlotErrorGA4"},v={name:"isVerboseLoggingEnabledGA4"},x=["disabled"];function B(e,t,o,n,r,l){var a=Object(s["resolveComponent"])("Field");return Object(s["openBlock"])(),Object(s["createElementBlock"])("div",null,[Object(s["createElementVNode"])("p",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ScheduleImportDescription")),1),Object(s["createElementVNode"])("div",E,[Object(s["createVNode"])(a,{uicontrol:"text",name:"startDateGA4",modelValue:e.startDateGA4,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.startDateGA4=t}),title:e.translate("GoogleAnalyticsImporter_StartDate"),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_CreationDate")," (YYYY-MM-DD)"),"inline-help":e.translate("GoogleAnalyticsImporter_StartDateHelp")},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",S,[Object(s["createVNode"])(a,{uicontrol:"text",name:"endDateGA4",modelValue:e.endDateGA4,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.endDateGA4=t}),title:e.translate("GoogleAnalyticsImporter_EndDate"),placeholder:e.translate("GoogleAnalyticsImporter_None"),"inline-help":e.endDateHelp},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",G,[Object(s["createVNode"])(a,{uicontrol:"text",name:"propertyIdGA4",modelValue:e.propertyIdGA4,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.propertyIdGA4=t}),placeholder:"eg. properties/{PROPERTY_ID}",title:e.translate("GoogleAnalyticsImporter_PropertyIdGA4"),"inline-help":e.translate("GoogleAnalyticsImporter_PropertyIdGA4Help")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",N,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"isMobileAppGA4",modelValue:e.isMobileAppGA4,"onUpdate:modelValue":t[3]||(t[3]=function(t){return e.isMobileAppGA4=t}),title:e.translate("GoogleAnalyticsImporter_IsMobileApp"),"inline-help":e.translate("GoogleAnalyticsImporter_IsMobileAppHelp")},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("div",_,[Object(s["createVNode"])(a,{uicontrol:"text",name:"timezoneGA4",modelValue:e.timezoneGA4,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.timezoneGA4=t}),title:e.translate("GoogleAnalyticsImporter_Timezone"),placeholder:e.translate("GoogleAnalyticsImporter_Optional"),"inline-help":e.timezoneHelp},null,8,["modelValue","title","placeholder","inline-help"])]),Object(s["createElementVNode"])("div",k,[Object(s["createVNode"])(a,{uicontrol:"multituple",name:"extraCustomDimensionsGA4",modelValue:e.extraCustomDimensionsGA4,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.extraCustomDimensionsGA4=t}),title:e.translate("GoogleAnalyticsImporter_ExtraCustomDimensions"),"inline-help":e.extraCustomDimensionsHelp,"ui-control-attributes":e.extraCustomDimensionsField},null,8,["modelValue","title","inline-help","ui-control-attributes"])]),Object(s["createElementVNode"])("div",C,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"forceIgnoreOutOfCustomDimSlotErrorGA4",modelValue:e.ignoreCustomDimensionSlotCheckGA4,"onUpdate:modelValue":t[6]||(t[6]=function(t){return e.ignoreCustomDimensionSlotCheckGA4=t}),title:e.translate("GoogleAnalyticsImporter_ForceCustomDimensionSlotCheck"),"inline-help":e.forceIgnoreOutOfCustomDimSlotErrorHelp},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("h3",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Troubleshooting")),1),Object(s["createElementVNode"])("div",v,[Object(s["createVNode"])(a,{uicontrol:"checkbox",name:"isVerboseLoggingEnabledGA4",modelValue:e.isVerboseLoggingEnabledGA4,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.isVerboseLoggingEnabledGA4=t}),title:e.translate("GoogleAnalyticsImporter_IsVerboseLoggingEnabled"),"inline-help":e.isVerboseLoggingEnabledHelp},null,8,["modelValue","title","inline-help"])]),Object(s["createElementVNode"])("button",{type:"submit",id:"startImportSubmitGA4",class:"btn",onClick:t[8]||(t[8]=function(t){return e.startImportGA4()}),disabled:e.isStartingImport},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Start")),9,x)])}var T=Object(s["defineComponent"])({props:{startImportNonce:{type:String,required:!0},maxEndDateDesc:String,extraCustomDimensionsField:{type:Object,required:!0}},components:{Field:D["Field"]},data:function(){return{isStartingImport:!1,extraCustomDimensionsGA4:[],isVerboseLoggingEnabledGA4:!1,ignoreCustomDimensionSlotCheckGA4:!1,startDateGA4:"",endDateGA4:"",propertyIdGA4:"",accountId:"",viewId:"",isMobileAppGA4:!1,timezoneGA4:""}},created:function(){return this},methods:{startImportGA4:function(){if(this.startDateGA4)try{Object(l["parseDate"])(this.startDateGA4)}catch(o){var e=l["NotificationsStore"].show({message:Object(l["translate"])("GoogleAnalyticsImporter_InvalidDateFormat",["YYYY-MM-DD"]),context:"error",type:"transient"});return void l["NotificationsStore"].scrollToNotification(e)}this.isStartingImport=!0;var t=!this.ignoreCustomDimensionSlotCheckGA4;return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"startImportGA4",startDate:this.startDateGA4,endDate:this.endDateGA4,propertyId:this.propertyIdGA4,viewId:this.viewId,nonce:this.startImportNonce,accountId:this.accountId,isMobileApp:this.isMobileAppGA4?"1":"0",timezone:this.timezoneGA4,extraCustomDimensions:this.extraCustomDimensionsGA4,isVerboseLoggingEnabled:this.isVerboseLoggingEnabledGA4?"1":"0",forceCustomDimensionSlotCheck:t?"1":"0"},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))}},computed:{endDateHelp:function(){var e=Object(l["translate"])("GoogleAnalyticsImporter_EndDateHelpText"),t=this.maxEndDateDesc&&Object(l["translate"])("

GoogleAnalyticsImporter_MaxEndDateHelp",this.maxEndDateDesc);return"".concat(e," ").concat(t||"")},timezoneHelp:function(){var e="https://www.php.net/manual/en/timezones.php";return Object(l["translate"])("GoogleAnalyticsImporter_TimezoneGA4Help",''),"")},extraCustomDimensionsHelp:function(){var e="https://ga-dev-tools.web.app/ga4/dimensions-metrics-explorer/";return Object(l["translate"])("GoogleAnalyticsImporter_ExtraCustomDimensionsGA4Help",''),"")},forceIgnoreOutOfCustomDimSlotErrorHelp:function(){var e="https://matomo.org/docs/custom-dimensions/";return Object(l["translate"])("GoogleAnalyticsImporter_ForceCustomDimensionSlotCheckHelp",''),"")},isVerboseLoggingEnabledHelp:function(){return Object(l["translate"])("GoogleAnalyticsImporter_IsVerboseLoggingEnabledHelp","/path/to/matomo/tmp/logs/","gaimportlog.$idSite.$matomoDomain.log")}}});T.render=B;var M=T;function w(e,t,o,n,r,l){var a=Object(s["resolveComponent"])("Field"),i=Object(s["resolveDirective"])("form");return Object(s["withDirectives"])((Object(s["openBlock"])(),Object(s["createElementBlock"])("div",null,[Object(s["createElementVNode"])("div",null,[Object(s["createVNode"])(a,{uicontrol:"radio",name:"selectedImporter",modelValue:e.selectedImporter,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.selectedImporter=t}),options:e.importOptionsUa,"inline-help":e.translate("GoogleAnalyticsImporter_SelectImporterUAInlineHelpText")},null,8,["modelValue","options","inline-help"]),Object(s["createVNode"])(a,{uicontrol:"radio",name:"selectedImporter",modelValue:e.selectedImporterGA4,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.selectedImporterGA4=t}),options:e.importOptionsGa4,"inline-help":e.translate("GoogleAnalyticsImporter_SelectImporterGA4InlineHelpText")},null,8,["modelValue","options","inline-help"])])],512)),[[i]])}var H=Object(s["defineComponent"])({props:{importOptionsUa:{type:Object,required:!0},importOptionsGa4:{type:Object,required:!0}},components:{Field:D["Field"]},directives:{Form:D["Form"]},data:function(){return{selectedImporter:"",selectedImporterGA4:""}}});H.render=w;var U=H,F={ref:"root"},L={class:"entityTable importStatusesTable"},R={class:"modal",id:"openScheduleReimportModal"},z={class:"modal-content"},P={class:"modal-footer"},q={class:"modal",id:"editImportEndDate"},Y={class:"modal-content"},$={class:"modal-footer"};function W(e,t,o,n,r,l){var a=Object(s["resolveComponent"])("ImportStatusRow"),i=Object(s["resolveComponent"])("Field"),c=Object(s["resolveDirective"])("tooltips");return Object(s["withDirectives"])((Object(s["openBlock"])(),Object(s["createElementBlock"])("div",F,[Object(s["createElementVNode"])("table",L,[Object(s["createElementVNode"])("thead",null,[Object(s["createElementVNode"])("tr",null,[Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_MatomoSite")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GoogleAnalyticsInfo")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Status")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LatestDayProcessed")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ScheduledReImports")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_StartFinishTimes")),1),Object(s["createElementVNode"])("th",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Actions")),1)])]),Object(s["createElementVNode"])("tbody",null,[(Object(s["openBlock"])(!0),Object(s["createElementBlock"])(s["Fragment"],null,Object(s["renderList"])(e.statuses,(function(t,o){return Object(s["openBlock"])(),Object(s["createBlock"])(a,{status:t,key:o,onEndImport:function(o){return e.showEditImportEndDateModal(t.idSite,t.isGA4)},onReimport:function(o){return e.openScheduleReimportModal(t.idSite,t.isGA4)},onDelete:function(o){return e.deleteImportStatus(t.idSite,o.isDone)},onManuallyResume:function(o){return e.manuallyResume(t.idSite,t.isGA4)}},null,8,["status","onEndImport","onReimport","onDelete","onManuallyResume"])})),128))])]),Object(s["createElementVNode"])("div",R,[Object(s["createElementVNode"])("div",z,[Object(s["createElementVNode"])("h3",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_EnterImportDateRange")),1),Object(s["createElementVNode"])("div",null,[Object(s["createVNode"])(i,{name:"re-import-start-date",uicontrol:"text",modelValue:e.reimportStartDate,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.reimportStartDate=t}),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_StartDate")," (YYYY-MM-DD)")},null,8,["modelValue","placeholder"])]),Object(s["createElementVNode"])("div",null,[Object(s["createVNode"])(i,{name:"re-import-end-date",uicontrol:"text",modelValue:e.reimportEndDate,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.reimportEndDate=t}),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_EndDate")," (YYYY-MM-DD)")},null,8,["modelValue","placeholder"])])]),Object(s["createElementVNode"])("div",P,[Object(s["createElementVNode"])("a",{id:"scheduleReimportSubmit",href:"",class:"modal-action modal-close btn",onClick:t[2]||(t[2]=Object(s["withModifiers"])((function(t){return e.scheduleReimport()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Schedule")),1),Object(s["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[3]||(t[3]=Object(s["withModifiers"])((function(){}),["prevent"]))},Object(s["toDisplayString"])(e.translate("General_Cancel")),1)])]),Object(s["createElementVNode"])("div",q,[Object(s["createElementVNode"])("div",Y,[Object(s["createElementVNode"])("h3",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_EnterImportEndDate")),1),Object(s["createElementVNode"])("p",null,[Object(s["createElementVNode"])("em",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LeaveEmptyToRemove")),1)]),Object(s["createElementVNode"])("div",null,[Object(s["createVNode"])(i,{name:"new-import-end-date",uicontrol:"text",modelValue:e.newImportEndDate,"onUpdate:modelValue":t[4]||(t[4]=function(t){return e.newImportEndDate=t}),placeholder:"".concat(e.translate("GoogleAnalyticsImporter_EndDate")," (YYYY-MM-DD)")},null,8,["modelValue","placeholder"])])]),Object(s["createElementVNode"])("div",$,[Object(s["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[5]||(t[5]=function(t){return e.changeImportEndDateModal()}),style:{"margin-right":"3.5px"}},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Change")),1),Object(s["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[6]||(t[6]=function(t){return e.cancelEditImportEndDateModal()})},Object(s["toDisplayString"])(e.translate("General_Cancel")),1)])])],512)),[[c,{content:e.tooltipContent,delay:500,duration:200}]])}var X=["data-idsite"],J={class:"sitename"},K=["href"],Q={key:1,style:{"text-transform":"uppercase"}},Z=Object(s["createElementVNode"])("br",null,null,-1),ee=["innerHTML"],te={class:"status"},oe={key:0},ne=["title"],re=Object(s["createElementVNode"])("br",null,null,-1),le={key:0},ae={key:1},ie=["title"],ce=Object(s["createElementVNode"])("br",null,null,-1),se={key:0},me={key:2},de=["title"],pe={key:3},ue=["title"],be={key:4},ge=Object(s["createElementVNode"])("br",null,null,-1),Oe=["innerHTML"],je={key:5},ye=["title"],he=Object(s["createElementVNode"])("br",null,null,-1),fe={class:"last-date-imported"},Ie=Object(s["createElementVNode"])("br",null,null,-1),De=Object(s["createElementVNode"])("br",null,null,-1),Ae=Object(s["createElementVNode"])("br",null,null,-1),Ve=Object(s["createElementVNode"])("br",null,null,-1),Ee=Object(s["createElementVNode"])("br",null,null,-1),Se={key:0},Ge={class:"scheduled-reimports"},Ne={key:0},_e={key:1},ke={class:"import-start-finish-times"},Ce=Object(s["createElementVNode"])("br",null,null,-1),ve=Object(s["createElementVNode"])("br",null,null,-1),xe={key:0},Be={key:1},Te={key:0},Me={key:1},we={key:2},He={key:3},Ue={class:"actions"},Fe=["title"],Le=["title"];function Re(e,t,o,n,r,l){var a;return Object(s["openBlock"])(),Object(s["createElementBlock"])("tr",{"data-idsite":e.status.idSite},[Object(s["createElementVNode"])("td",J,[e.status.site?(Object(s["openBlock"])(),Object(s["createElementBlock"])("a",{key:0,target:"_blank",href:e.siteUrl},Object(s["toDisplayString"])(e.siteName),9,K)):(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",Q,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_SiteDeleted")),1)),Z,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_SiteID"))+": "+Object(s["toDisplayString"])(e.status.idSite),1)]),Object(s["createElementVNode"])("td",{class:"ga-info",innerHTML:e.$sanitize(e.gaInfoPretty)},null,8,ee),Object(s["createElementVNode"])("td",te,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.status.status)+" ",1),"rate_limited"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",oe,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.translate("GoogleAnalyticsImporter_RateLimitHelp")},null,8,ne),re,e.status.days_finished_since_rate_limit?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",le,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_FinishedImportingDaysWaiting",e.status.days_finished_since_rate_limit)),1)):Object(s["createCommentVNode"])("",!0)])):Object(s["createCommentVNode"])("",!0),"cloud_rate_limited"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",ae,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.status.error},null,8,ie),ce,e.status.days_finished_since_rate_limit?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",se,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_FinishedImportingDaysWaiting",e.status.days_finished_since_rate_limit)),1)):Object(s["createCommentVNode"])("",!0)])):Object(s["createCommentVNode"])("",!0),"rate_limited_hourly"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",me,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.translate("GoogleAnalyticsImporter_RateLimitHourlyHelp")},null,8,de)])):Object(s["createCommentVNode"])("",!0),"future_date_import_pending"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",pe,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.translate("GoogleAnalyticsImporter_FutureDateHelp",e.status.future_resume_date)},null,8,ue)])):"errored"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",be,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ErrorMessage"))+": "+Object(s["toDisplayString"])(e.status.error||"no message")+" ",1),ge,Object(s["createElementVNode"])("span",{innerHTML:e.$sanitize(e.errorMessageBugReportRequest)},null,8,Oe)])):"killed"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",je,[Object(s["createElementVNode"])("span",{class:"icon icon-help",title:e.translate("GoogleAnalyticsImporter_KilledStatusHelp")},null,8,ye),he,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ErrorMessage"))+": "+Object(s["toDisplayString"])(e.status.error||"no message"),1)])):Object(s["createCommentVNode"])("",!0)]),Object(s["createElementVNode"])("td",fe,[Object(s["createElementVNode"])("div",null,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LastDayImported"))+": "+Object(s["toDisplayString"])(e.status.last_date_imported||e.noneText),1),Ie,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LastDayArchived"))+": "+Object(s["toDisplayString"])(e.status.last_day_archived||e.noneText),1),De,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ImportStartDate"))+": "+Object(s["toDisplayString"])(e.status.import_range_start||e.websiteCreationTime)+" ",1),Ae,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ImportEndDate"))+": "+Object(s["toDisplayString"])(e.status.import_range_end||e.noneText)+" ",1),Ve,Ee]),"finished"!==e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",Se,[Object(s["createElementVNode"])("a",{class:"edit-import-end-link table-command-link",href:"",onClick:t[0]||(t[0]=Object(s["withModifiers"])((function(t){return e.$emit("end-import")}),["prevent"]))},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_EditEndDate")),1)])):Object(s["createCommentVNode"])("",!0),Object(s["createElementVNode"])("div",null,[e.status.isGA4?(Object(s["openBlock"])(),Object(s["createElementBlock"])("a",{key:0,id:"reimport-date-range",class:"table-command-link",href:"",onClick:t[1]||(t[1]=Object(s["withModifiers"])((function(t){return e.$emit("reimport")}),["prevent"]))},Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ReimportDate")),1)):Object(s["createCommentVNode"])("",!0)])]),Object(s["createElementVNode"])("td",Ge,[null!==(a=e.status.reimport_ranges)&&void 0!==a&&a.length?(Object(s["openBlock"])(),Object(s["createElementBlock"])("ul",Ne,[(Object(s["openBlock"])(!0),Object(s["createElementBlock"])(s["Fragment"],null,Object(s["renderList"])(e.status.reimport_ranges,(function(e,t){return Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:t},Object(s["toDisplayString"])(e[0])+","+Object(s["toDisplayString"])(e[1]),1)})),128))])):(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",_e,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_None")),1))]),Object(s["createElementVNode"])("td",ke,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ImportStartTime"))+": "+Object(s["toDisplayString"])(e.status.import_start_time||e.noneText),1),Ce,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_LastResumeTime"))+": "+Object(s["toDisplayString"])(e.status.last_job_start_time||e.noneText),1),ve,"finished"===e.status.status?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",xe,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_TimeFinished"))+": "+Object(s["toDisplayString"])(e.status.import_end_time||e.noneText),1)):e.status.estimated_days_left_to_finish?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",Be,[e.thisJobShouldFinishToday?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",Te,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ThisJobShouldFinishToday")),1)):(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",Me,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_EstimatedFinishIn",e.status.estimated_days_left_to_finish)),1))])):e.status.import_range_end?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",we,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_JobWillRunUntilManuallyCancelled")),1)):(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",He,Object(s["toDisplayString"])(e.translate("General_Unknown")),1))]),Object(s["createElementVNode"])("td",Ue,[Object(s["createElementVNode"])("a",{class:Object(s["normalizeClass"])(["table-action",{"icon-delete":e.isDone,"icon-close":!e.isDone}]),onClick:t[2]||(t[2]=Object(s["withModifiers"])((function(t){return e.$emit("delete",{isDone:e.isDone})}),["prevent"])),title:e.isDone?e.translate("General_Remove"):e.translate("General_Cancel")},null,10,Fe),-1===["finished","ongoing","started"].indexOf(e.status.status)?(Object(s["openBlock"])(),Object(s["createElementBlock"])("a",{key:0,class:"table-action icon-play",onClick:t[3]||(t[3]=Object(s["withModifiers"])((function(t){return e.$emit("manuallyResume")}),["prevent"])),title:e.translate("GoogleAnalyticsImporter_ResumeDesc")},null,8,Le)):Object(s["createCommentVNode"])("",!0)])],8,X)}var ze=Object(s["defineComponent"])({props:{status:{type:Object,required:!0}},emits:["end-import","reimport","delete","manuallyResume"],computed:{isDone:function(){return"finished"===this.status.status},siteUrl:function(){return"?".concat(l["MatomoUrl"].stringify(Object.assign(Object.assign({period:"day",date:"today"},l["MatomoUrl"].urlParsed.value),{},{idSite:this.status.idSite,module:"CoreHome",action:"index"})))},gaInfoPretty:function(){return(this.status.gaInfoPretty||"").replace(/\n/g,"
")},errorMessageBugReportRequest:function(){return Object(l["translate"])("GoogleAnalyticsImporter_ErrorMessageBugReportRequest",'',"")},thisJobShouldFinishToday:function(){return 0===this.status.estimated_days_left_to_finish||"0"===this.status.estimated_days_left_to_finish},siteName:function(){var e;return l["Matomo"].helper.htmlDecode(null===(e=this.status.site)||void 0===e?void 0:e.name)},noneText:function(){return Object(l["translate"])("GoogleAnalyticsImporter_None")},websiteCreationTime:function(){return Object(l["translate"])("GoogleAnalyticsImporter_CreationDate")}}});ze.render=Re;var Pe=ze,qe=window,Ye=qe.$,$e=Object(s["defineComponent"])({props:{statuses:{type:Array,required:!0},stopImportNonce:{type:String,required:!0},changeImportEndDateNonce:{type:String,required:!0},resumeImportNonce:{type:String,required:!0},scheduleReImportNonce:{type:String,required:!0}},components:{Field:D["Field"],ImportStatusRow:Pe},directives:{Tooltips:l["Tooltips"]},data:function(){return{editImportEndDateIdSite:null,reimportDateRangeIdSite:null,reimportStartDate:"",reimportEndDate:"",newImportEndDate:"",isGA4:!1}},methods:{showEditImportEndDateModal:function(e,t){this.editImportEndDateIdSite=e,this.isGA4=t,Ye("#editImportEndDate").modal({dismissible:!1}).modal("open")},cancelEditImportEndDateModal:function(){this.editImportEndDateIdSite=null,this.isGA4=!1},manuallyResume:function(e,t){return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"resumeImport",idSite:e,isGA4:t?1:0,nonce:this.resumeImportNonce},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))},deleteImportStatus:function(e,t){var o=this;if(t)return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"deleteImportStatus",idSite:e,nonce:this.stopImportNonce},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}));l["Matomo"].helper.modalConfirm("#confirmCancelJob",{yes:function(){o.deleteImportStatus(e,!0)}})},openScheduleReimportModal:function(e,t){this.reimportDateRangeIdSite=e,this.isGA4=t,Ye("#openScheduleReimportModal").modal({dismissible:!1}).modal("open")},changeImportEndDateModal:function(){return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"changeImportEndDate",idSite:this.editImportEndDateIdSite,nonce:this.changeImportEndDateNonce,endDate:this.newImportEndDate},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))},scheduleReimport:function(){return l["AjaxHelper"].post({module:"GoogleAnalyticsImporter",action:"scheduleReImport",idSite:this.reimportDateRangeIdSite,startDate:this.reimportStartDate,endDate:this.reimportEndDate,nonce:this.scheduleReImportNonce,isGA4:this.isGA4?1:0},{},{withTokenInUrl:!0}).finally((function(){window.location.reload()}))}},computed:{tooltipContent:function(){return function(){var e=Ye(this);if(""===e.attr("piwik-field"))return"";var t=Ye(this).attr("title")||"";return window.vueSanitize(t.replace(/\n/g,"
"))}}}});$e.render=W;var We=$e,Xe={key:0,class:"form-group row"},Je={class:"col s12 m6"},Ke=Object(s["createElementVNode"])("br",null,null,-1),Qe=["innerHTML"],Ze={class:"col s12 m6"},et=["innerHTML"],tt=["innerHTML"],ot=["textContent"],nt={class:"form-group row"},rt=["action"],lt={key:0,type:"hidden",name:"isNoDataPage",value:"1"},at=["value"],it=["disabled"],ct=Object(s["createElementVNode"])("span",{class:"icon-upload"},null,-1),st=Object(s["createElementVNode"])("span",{class:"icon-upload"},null,-1),mt={key:1,class:"system-success connected-message-successful"},dt=Object(s["createElementVNode"])("span",{class:"icon-ok"},null,-1),pt=["innerHTML"],ut=["innerHTML"],bt=["action"],gt=["value"],Ot=["disabled","textContent"],jt={key:0,class:"system-success connected-message-successful"},yt=Object(s["createElementVNode"])("span",{class:"icon-ok"},null,-1),ht=["innerHTML"],ft=["textContent"],It=["textContent"],Dt=["innerHTML"],At=["innerHTML"],Vt=["textContent"];function Et(e,t,o,n,r,l){return Object(s["openBlock"])(),Object(s["createElementBlock"])(s["Fragment"],null,[e.isNoDataPage?Object(s["createCommentVNode"])("",!0):(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",Xe,[Object(s["createElementVNode"])("div",Je,[Object(s["createElementVNode"])("p",null,Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ConfigureTheImporterLabel1")),1),Object(s["createElementVNode"])("p",null,[Object(s["createTextVNode"])(Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_ConfigureTheImporterLabel2")),1),Ke,Object(s["createElementVNode"])("span",{innerHTML:e.$sanitize(e.setupGoogleAnalyticsImportFaq)},null,8,Qe)])]),Object(s["createElementVNode"])("div",Ze,[Object(s["createElementVNode"])("div",{class:"form-help",innerHTML:e.$sanitize(e.translate("GoogleAnalyticsImporter_ConfigureTheImporterHelpNewDate","",""))},null,8,et)])])),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:1,innerHTML:e.$sanitize(e.getAdvanceConnectStep01Text)},null,8,tt)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:2,textContent:Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep02"))},null,8,ot)):Object(s["createCommentVNode"])("",!0),Object(s["createElementVNode"])("div",nt,[Object(s["createElementVNode"])("div",{class:Object(s["normalizeClass"])(e.getClass)},[Object(s["createElementVNode"])("form",{id:"configFileUploadForm",action:e.actionUrl,method:"POST",enctype:"multipart/form-data"},[Object(s["createElementVNode"])("input",{type:"file",id:"clientfile",name:"clientfile",accept:".json",onChange:t[0]||(t[0]=function(){return e.processFileChange&&e.processFileChange.apply(e,arguments)}),style:{display:"none"}},null,32),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("input",lt)):Object(s["createCommentVNode"])("",!0),Object(s["createElementVNode"])("input",{type:"hidden",name:"config_nonce",value:e.configNonce},null,8,at),Object(s["createElementVNode"])("button",{type:"button",class:"btn advance-upload-button",onClick:t[1]||(t[1]=function(t){return e.selectConfigFile()}),disabled:e.isUploadButtonDisabled},[Object(s["withDirectives"])(Object(s["createElementVNode"])("span",null,[ct,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("General_Upload")),1)],512),[[s["vShow"],!e.isUploadButtonDisabled]]),Object(s["withDirectives"])(Object(s["createElementVNode"])("span",null,[st,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_Uploading")),1)],512),[[s["vShow"],e.isUploadButtonDisabled]])],8,it),e.isNoDataPage&&e.hasClientConfiguration?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",mt,[dt,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_UploadSuccessful")),1)])):Object(s["createCommentVNode"])("",!0)],8,rt)],2)]),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:3,innerHTML:e.$sanitize(e.getAdvanceConnectStep03Text)},null,8,pt)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("div",{key:4,style:{"margin-left":"1.2rem"},class:"complete-note-warning",innerHTML:e.$sanitize(e.getOauthCompleteWarningMessage)},null,8,ut)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("form",{key:5,target:"_blank",method:"post",action:e.authorizeUrl},[Object(s["createElementVNode"])("input",{type:"hidden",name:"auth_nonce",value:e.forwardToAuthNonce},null,8,gt),Object(s["createElementVNode"])("button",{disabled:!1===e.hasClientConfiguration,textContent:Object(s["toDisplayString"])(e.getAuthorizeText),type:"submit",class:"btn btn-forward-to-Oauth"},null,8,Ot),e.isNoDataPage&&e.hasClientConfiguration&&e.isConfigured?(Object(s["openBlock"])(),Object(s["createElementBlock"])("span",jt,[yt,Object(s["createTextVNode"])(" "+Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_AccountsConnectedSuccessfully")),1)])):Object(s["createCommentVNode"])("",!0)],8,bt)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:6,innerHTML:e.$sanitize(e.getAdvanceConnectStep04Text)},null,8,ht)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:7,textContent:Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep05"))},null,8,ft)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:8,textContent:Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep06"))},null,8,It)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:9,innerHTML:e.$sanitize(e.getAdvanceConnectStep07Text)},null,8,Dt)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:10,innerHTML:e.$sanitize(e.getAdvanceConnectStep08Text)},null,8,At)):Object(s["createCommentVNode"])("",!0),e.isNoDataPage?(Object(s["openBlock"])(),Object(s["createElementBlock"])("li",{key:11,textContent:Object(s["toDisplayString"])(e.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep09"))},null,8,Vt)):Object(s["createCommentVNode"])("",!0)],64)}var St=Object(s["defineComponent"])({data:function(){return{isSelectingFile:!1,isUploading:!1}},props:{actionUrl:{type:String,required:!0},configNonce:{type:String,required:!0},isNoDataPage:Boolean,hasClientConfiguration:Boolean,indexActionUrl:String,authorizeUrl:String,forwardToAuthNonce:String,isConfigured:Boolean},methods:{selectConfigFile:function(){this.isSelectingFile=!0;var e=document.getElementById("clientfile");e&&e.click()},processFileChange:function(){var e=document.getElementById("clientfile"),t=document.getElementById("configFileUploadForm");e&&e.value&&t&&(this.isUploading=!0,t.submit())},checkForCancel:function(){if(this.isSelectingFile&&!this.isUploading){var e=document.getElementById("clientfile");e&&!e.value&&(this.isSelectingFile=!1)}}},computed:{setupGoogleAnalyticsImportFaq:function(){var e="https://matomo.org/faq/general/set-up-google-analytics-import/";return Object(l["translate"])("GoogleAnalyticsImporter_ConfigureTheImporterLabel3",''),"")},isUploadButtonDisabled:function(){return this.isSelectingFile||this.isUploading},getAdvanceConnectStep01Text:function(){var e="https://matomo.org/faq/general/set-up-google-analytics-import/";return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep01",''),"")},getAdvanceConnectStep03Text:function(){return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep03",this.translate("GoogleAnalyticsImporter_Authorize"))},getAdvanceConnectStep04Text:function(){var e="https://matomo.org/faq/general/running-the-google-analytics-import/";return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep04",''),"",''),"")},getAdvanceConnectStep05Text:function(){return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep05",''),"")},getAdvanceConnectStep07Text:function(){return"".concat(this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep07",this.translate("GoogleAnalyticsImporter_Start")),'
').concat(this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep07Note","","",this.translate("GoogleAnalyticsImporter_Start")),"
")},getAdvanceConnectStep08Text:function(){return this.translate("GoogleAnalyticsImporter_GAImportNoDataScreenStep08",''),"")},getOauthCompleteWarningMessage:function(){return this.translate("GoogleAnalyticsImporter_GoogleOauthCompleteWarning","","")},getClass:function(){var e="col s12";return this.isNoDataPage?e+=" p-half-point":e+=" m6",e},getAuthorizeText:function(){return this.isConfigured?this.translate("GoogleAnalyticsImporter_ReAuthorize"):this.translate("GoogleAnalyticsImporter_Authorize")}},mounted:function(){document.body.onfocus=this.checkForCancel}});St.render=Et;var Gt=St; /*! * Matomo - free/libre analytics platform * diff --git a/vue/src/ImportStatus/ImportStatusRow.vue b/vue/src/ImportStatus/ImportStatusRow.vue index 0bdd1f4ba..77c4b54e0 100644 --- a/vue/src/ImportStatus/ImportStatusRow.vue +++ b/vue/src/ImportStatus/ImportStatusRow.vue @@ -96,6 +96,7 @@