diff --git a/Template/Tag/MatomoTag.web.js b/Template/Tag/MatomoTag.web.js
index 887f10a76..5de43484f 100644
--- a/Template/Tag/MatomoTag.web.js
+++ b/Template/Tag/MatomoTag.web.js
@@ -334,6 +334,74 @@
} else if (trackingType === 'goal') {
tracker.trackGoal(parameters.get('idGoal'), parameters.get('goalCustomRevenue'), dimensionsObject);
}
+
+ if (matomoConfig.customData && matomoConfig.customData.length && matomoConfig.customData[0].name && matomoConfig.customData[0].value) {
+ tracker.setCustomData(matomoConfig.customData[0].name, matomoConfig.customData[0].value);
+ }
+
+ if (matomoConfig.setDownloadExtensions) {
+ tracker.setDownloadExtensions(matomoConfig.setDownloadExtensions.split(','));
+ }
+
+ if (matomoConfig.addDownloadExtensions) {
+ tracker.addDownloadExtensions(matomoConfig.addDownloadExtensions.split(','));
+ }
+
+ if (matomoConfig.removeDownloadExtensions) {
+ tracker.removeDownloadExtensions(matomoConfig.removeDownloadExtensions.split(','));
+ }
+
+ if (matomoConfig.setIgnoreClasses) {
+ tracker.setIgnoreClasses(matomoConfig.setIgnoreClasses.split(','));
+ }
+
+ if (matomoConfig.setReferrerUrl) {
+ tracker.setReferrerUrl(matomoConfig.setReferrerUrl);
+ }
+
+ if (matomoConfig.setAPIUrl) {
+ tracker.setAPIUrl(matomoConfig.setAPIUrl);
+ }
+
+ if (matomoConfig.setPageViewId) {
+ tracker.setPageViewId(matomoConfig.setPageViewId);
+ }
+
+ if (matomoConfig.setExcludedReferrers) {
+ tracker.setExcludedReferrers(matomoConfig.setExcludedReferrers.split(','));
+ }
+
+ if (matomoConfig.setDownloadClasses) {
+ tracker.setDownloadClasses(matomoConfig.setDownloadClasses.split(','));
+ }
+
+ if (matomoConfig.setLinkClasses) {
+ tracker.setLinkClasses(matomoConfig.setLinkClasses.split(','));
+ }
+
+ if (matomoConfig.setCampaignNameKey) {
+ tracker.setCampaignNameKey(matomoConfig.setCampaignNameKey);
+ }
+
+ if (matomoConfig.setCampaignKeywordKey) {
+ tracker.setCampaignKeywordKey(matomoConfig.setCampaignKeywordKey);
+ }
+
+ if (matomoConfig.setConsentGiven) {
+ tracker.setConsentGiven();
+ }
+
+ if (matomoConfig.rememberConsentGiven) {
+ if (matomoConfig.rememberConsentGivenForHours) {
+ tracker.rememberConsentGiven(matomoConfig.rememberConsentGivenForHours);
+ } else {
+ tracker.rememberConsentGiven();
+ }
+ }
+
+ if (matomoConfig.forgetConsentGiven) {
+ tracker.forgetConsentGiven();
+ }
}
});
diff --git a/Template/Variable/MatomoConfigurationVariable.php b/Template/Variable/MatomoConfigurationVariable.php
index c49b87cf1..14543c846 100644
--- a/Template/Variable/MatomoConfigurationVariable.php
+++ b/Template/Variable/MatomoConfigurationVariable.php
@@ -42,7 +42,7 @@ public function getIcon()
public function hasAdvancedSettings()
{
- return false;
+ return true;
}
public function getParameters()
@@ -431,6 +431,176 @@ public function getParameters()
$field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
$field->validators[] = new CustomRequestProcessing($idSite, $idContainer);
}),
+ $this->makeSetting('customData', array(), FieldConfig::TYPE_ARRAY, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoCustomDataTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoCustomDataDescription');
+ $field->validate = function ($value) {
+ if (empty($value)) {
+ return;
+ }
+ if (!is_array($value)) {
+ throw new \Exception(Piwik::translate('TagManager_MatomoConfigurationMatomoCustomDimensionsException'));
+ }
+ };
+
+ $field->uiControl = FieldConfig::UI_CONTROL_MULTI_TUPLE;
+ $field->uiControlAttributes['rows'] = 1;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field1 = new FieldConfig\MultiPair('Name', 'name', FieldConfig::UI_CONTROL_TEXT);
+ $field1->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field2 = new FieldConfig\MultiPair('Value', 'value', FieldConfig::UI_CONTROL_TEXT);
+ $field2->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['field1'] = $field1->toArray();
+ $field->uiControlAttributes['field2'] = $field2->toArray();
+ }),
+ $this->makeSetting('setDownloadExtensions', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetDownloadExtensionsTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetDownloadExtensionsDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('addDownloadExtensions', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoAddDownloadExtensionsTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoAddDownloadExtensionsDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('removeDownloadExtensions', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoRemoveDownloadExtensionsTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoRemoveDownloadExtensionsDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setIgnoreClasses', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetIgnoreClassesTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetIgnoreClassesDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setReferrerUrl', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetReferrerUrlTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetReferrerUrlDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setApiUrl', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetApiUrlTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetApiUrlDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setPageViewId', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetPageViewIdTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetPageViewIdDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setExcludedReferrers', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetExcludedReferrersTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetExcludedReferrersDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setDownloadClasses', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetDownloadClassesTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetDownloadClassesDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setLinkClasses', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetLinkClassesTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetLinkClassesDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setCampaignNameKey', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetCampaignNameKeyTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetCampaignNameKeyDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setCampaignKeywordKey', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetCampaignKeywordKeyTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetCampaignKeywordKeyDescription');
+ $field->customFieldComponent = self::FIELD_VARIABLE_COMPONENT;
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('setConsentGiven', false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoSetConsentGiveTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoSetConsentGiveDescription');
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('rememberConsentGiven', false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoRememberConsentGivenTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoRememberConsentGivenDescription');
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
+ $this->makeSetting('rememberConsentGivenForHours', '', FieldConfig::TYPE_STRING, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoRememberConsentGivenForHoursTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoRememberConsentGivenForHoursDescription');
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ $field->validate = function ($value) {
+ if ($value && !is_numeric($value)) {
+ throw new \Exception(
+ rtrim(Piwik::translate('TagManager_MatomoConfigurationMatomoRememberConsentGivenForHoursTitle'), '.') . ': ' .
+ Piwik::translate('TagManager_MatomoConfigurationNonNumericValueException')
+ );
+ }
+ };
+ }),
+ $this->makeSetting('forgetConsentGiven', false, FieldConfig::TYPE_BOOL, function (FieldConfig $field) {
+ $field->title = Piwik::translate('TagManager_MatomoConfigurationMatomoForgetConsentGivenTitle');
+ $field->description = Piwik::translate('TagManager_MatomoConfigurationMatomoForgetConsentGivenDescription');
+ $field->uiControlAttributes['showAdvancedSettings'] = 1; // This is used to hide/show this option under Advanced settings
+ $field->transform = function ($value) {
+ return trim($value);
+ };
+ }),
);
$pluginParameters = [];
@@ -450,9 +620,7 @@ public function getParameters()
});
}
- $parameters = $this->insertPluginParameters($pluginParameters, $parameters, $insertAfter = 'enableLinkTracking');
-
- return $parameters;
+ return $this->insertPluginParameters($pluginParameters, $parameters, $insertAfter = 'enableLinkTracking');
}
private function insertPluginParameters($pluginParameters, $parameters, $insertAfter)
diff --git a/Updates/5.2.1-b1.php b/Updates/5.2.1-b1.php
new file mode 100644
index 000000000..c20a062cb
--- /dev/null
+++ b/Updates/5.2.1-b1.php
@@ -0,0 +1,80 @@
+migration = $factory;
+ }
+
+ /**
+ * Return database migrations to be executed in this update.
+ *
+ * Database migrations should be defined here, instead of in `doUpdate()`, since this method is used
+ * in the `core:update` command when displaying the queries an update will run. If you execute
+ * migrations directly in `doUpdate()`, they won't be displayed to the user. Migrations will be executed in the
+ * order as positioned in the returned array.
+ *
+ * @param Updater $updater
+ * @return Migration\Db[]
+ */
+ public function getMigrations(Updater $updater)
+ {
+ return array(
+ );
+ }
+
+ /**
+ * Perform the incremental version update.
+ *
+ * This method should perform all updating logic. If you define queries in the `getMigrations()` method,
+ * you must call {@link Updater::executeMigrations()} here.
+ *
+ * @param Updater $updater
+ */
+ public function doUpdate(Updater $updater)
+ {
+ $updater->executeMigrations(__FILE__, $this->getMigrations($updater));
+
+ // Migrate the MatomoConfiguration type variables to all include the newly configured advanced fields.
+ $migrator = new NewVariableParameterMigrator(MatomoConfigurationVariable::ID, 'customData', []);
+ $migrator->addField('setDownloadExtensions', '');
+ $migrator->addField('addDownloadExtensions', '');
+ $migrator->addField('removeDownloadExtensions', '');
+ $migrator->addField('setIgnoreClasses', '');
+ $migrator->addField('setReferrerUrl', '');
+ $migrator->addField('setApiUrl', '');
+ $migrator->addField('setPageViewId', '');
+ $migrator->addField('setExcludedReferrers', '');
+ $migrator->addField('setDownloadClasses', '');
+ $migrator->addField('setLinkClasses', '');
+ $migrator->addField('setCampaignNameKey', '');
+ $migrator->addField('setCampaignKeywordKey', '');
+ $migrator->addField('setConsentGiven', '');
+ $migrator->addField('rememberConsentGiven', '');
+ $migrator->addField('rememberConsentGivenForHours', '');
+ $migrator->addField('forgetConsentGiven', '');
+ $migrator->migrate();
+ }
+}
diff --git a/lang/en.json b/lang/en.json
index 52c130695..303430947 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -1114,6 +1114,41 @@
"CopyXDescription": "To duplicate this %1$s, select the website and container you’d like to add the %1$s to. This will create an exact copy of all settings of the %1$s.",
"CopyXSuccess": "A copy was successfully created. %1$sNavigate to the new %2$s now%3$s.",
"LearnMoreFullStop": "%1$sLearn more%2$s.",
- "CustomHTMLTagNameInlineHelpText": "%1$sNote:%2$s If you are targeting users in Europe, be aware that triggering retargeting tags like Google Ads Remarketing requires user consent under GDPR. %3$sLearn more%4$s."
+ "CustomHTMLTagNameInlineHelpText": "%1$sNote:%2$s If you are targeting users in Europe, be aware that triggering retargeting tags like Google Ads Remarketing requires user consent under GDPR. %3$sLearn more%4$s.",
+ "MatomoConfigurationMatomoCustomDataTitle": "Custom Data",
+ "MatomoConfigurationMatomoCustomDataDescription": "Optionally set custom data in your tracking request.",
+ "MatomoConfigurationMatomoSetDownloadExtensionsTitle": "Set Download Extensions",
+ "MatomoConfigurationMatomoSetDownloadExtensionsDescription": "Set a list of file extensions to be recognized as downloads. Example: doc or doc,xls",
+ "MatomoConfigurationMatomoAddDownloadExtensionsTitle": "Add Download Extensions",
+ "MatomoConfigurationMatomoAddDownloadExtensionsDescription": "Specify additional file extensions to be recognized as downloads. Example: doc or doc,xls",
+ "MatomoConfigurationMatomoRemoveDownloadExtensionsTitle": "Remove Download Extensions",
+ "MatomoConfigurationMatomoRemoveDownloadExtensionsDescription": "Specify file extensions to be removed from the list of download file extensions. Example: doc or doc,xls",
+ "MatomoConfigurationMatomoSetIgnoreClassesTitle": "Set Ignore Classes",
+ "MatomoConfigurationMatomoSetIgnoreClassesDescription": "Set classes to be ignored if present in link (in addition to matomo_ignore and piwik_ignore). Example classA or classA,classB",
+ "MatomoConfigurationMatomoSetReferrerUrlTitle": "Set Referrer URL",
+ "MatomoConfigurationMatomoSetReferrerUrlDescription": "Override the detected Http-Referer. We recommend you call this method early in your tracking code before you call trackPageView if it should be applied to all tracking requests.",
+ "MatomoConfigurationMatomoSetApiUrlTitle": "Set API URL",
+ "MatomoConfigurationMatomoSetApiUrlDescription": "Specify the Matomo HTTP API URL endpoint. Points to the root directory of piwik, e.g. https://matomo.example.org/ or https://example.org/matomo/. This function is only useful when the 'Overlay' report is not working. By default, you do not need to use this function.",
+ "MatomoConfigurationMatomoSetPageViewIdTitle": "Set Pageview ID",
+ "MatomoConfigurationMatomoSetPageViewIdDescription": "Override PageView id for every use of logPageView(). Do not use this if you call trackPageView() multiple times during tracking (e.g. when tracking a single page application).",
+ "MatomoConfigurationMatomoSetExcludedReferrersTitle": "Set Excluded Referrer",
+ "MatomoConfigurationMatomoSetExcludedReferrersDescription": "Set array of hostnames or domains that should be ignored as referrers. For wildcard subdomains, you can use .example.com or *.example.com",
+ "MatomoConfigurationMatomoSetDownloadClassesTitle": "Set Download Classes",
+ "MatomoConfigurationMatomoSetDownloadClassesDescription": "Set classes to be treated as downloads (in addition to matomo_download)",
+ "MatomoConfigurationMatomoSetLinkClassesTitle": "Set Link Classes",
+ "MatomoConfigurationMatomoSetLinkClassesDescription": "Set classes to be treated as outlinks (in addition to piwik_link). Example class1 or class1,class2",
+ "MatomoConfigurationMatomoSetCampaignNameKeyTitle": "Set campaign name key",
+ "MatomoConfigurationMatomoSetCampaignNameKeyDescription": "Set campaign name parameter(s).",
+ "MatomoConfigurationMatomoSetCampaignKeywordKeyTitle": "Set campaign keyword name key",
+ "MatomoConfigurationMatomoSetCampaignKeywordKeyDescription": "Set campaign keyword parameter(s).",
+ "MatomoConfigurationMatomoSetConsentGiveTitle": "Set consent given.",
+ "MatomoConfigurationMatomoSetConsentGiveDescription": "Mark that the current user has consented. The consent is one-time only, so in a subsequent browser session, the user will have to consent again. To remember consent, see the Remember consent given option below.",
+ "MatomoConfigurationMatomoRememberConsentGivenTitle": "Remember consent given.",
+ "MatomoConfigurationMatomoRememberConsentGivenDescription": "Mark that the current user has consented, and remembers this consent through a browser cookie. The next time the user visits the site, Matomo will remember that they consented, and track them. If you enable this option, you do not need to enable Set consent given option.",
+ "MatomoConfigurationMatomoRememberConsentGivenForHoursTitle": "Expire consent.",
+ "MatomoConfigurationMatomoRememberConsentGivenForHoursDescription": "Optionally set after how many hours the consent should expire. By default the consent is valid for 30 years unless cookies are deleted by the user or the browser prior to this.",
+ "MatomoConfigurationNonNumericValueException": "Invalid value, only numeric values are allowed.",
+ "MatomoConfigurationMatomoForgetConsentGivenTitle": "Forget consent given.",
+ "MatomoConfigurationMatomoForgetConsentGivenDescription": "Remove a user's consent, both if the consent was one-time only and if the consent was remembered. After calling this method, the user will have to consent again in order to be tracked."
}
}
diff --git a/stylesheets/manageEdit.less b/stylesheets/manageEdit.less
index 90f1ec337..a19831d64 100644
--- a/stylesheets/manageEdit.less
+++ b/stylesheets/manageEdit.less
@@ -136,4 +136,11 @@
body.tagmanager .modal.open .expandableList {
position: relative;
+}
+
+.editVariable {
+ .form-group.row.matomo-form-field:has(#customData-p1-0) {
+ margin-top: -1rem;
+ margin-bottom: -1rem;
+ }
}
\ No newline at end of file
diff --git a/tests/System/expected/test___TagManager.exportContainerVersion_site_default_container.xml b/tests/System/expected/test___TagManager.exportContainerVersion_site_default_container.xml
index cf0f203d2..4307e9494 100644
--- a/tests/System/expected/test___TagManager.exportContainerVersion_site_default_container.xml
+++ b/tests/System/expected/test___TagManager.exportContainerVersion_site_default_container.xml
@@ -134,6 +134,24 @@
GET
application/x-www-form-urlencoded; charset=UTF-8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 0
+
+ 0
diff --git a/tests/System/expected/test_webContext__TagManager.getAvailableVariableTypesInContext.xml b/tests/System/expected/test_webContext__TagManager.getAvailableVariableTypesInContext.xml
index 41fb7b66d..63bcf1b81 100644
--- a/tests/System/expected/test_webContext__TagManager.getAvailableVariableTypesInContext.xml
+++ b/tests/System/expected/test_webContext__TagManager.getAvailableVariableTypesInContext.xml
@@ -873,7 +873,7 @@
web
- 0
+ 1
0
@@ -1657,7 +1657,110 @@
- Can be set to a variable of type "Custom Request Processing Function" to augment or override default request sending behaviour.
+ Can be set to a variable of type "Custom Request Processing Function" to augment or override default request sending behaviour.
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ customData
+ Custom Data
+
+
+
+
+ array
+ multituple
+
+ 1
+ 1
+
+ name
+ Name
+ text
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+
+ value
+ Value
+ text
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+
+
+ Optionally set custom data in your tracking request.
+
+
+
+ 0
+
+
+ setDownloadExtensions
+ Set Download Extensions
+
+
+ string
+ text
+
+ 1
+
+
+ Set a list of file extensions to be recognized as downloads. Example: doc or doc,xls
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ addDownloadExtensions
+ Add Download Extensions
+
+
+ string
+ text
+
+ 1
+
+
+ Specify additional file extensions to be recognized as downloads. Example: doc or doc,xls
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ removeDownloadExtensions
+ Remove Download Extensions
+
+
+ string
+ text
+
+ 1
+
+
+ Specify file extensions to be removed from the list of download file extensions. Example: doc or doc,xls
@@ -1667,6 +1770,263 @@
FieldVariableTemplate
+
+ setIgnoreClasses
+ Set Ignore Classes
+
+
+ string
+ text
+
+ 1
+
+
+ Set classes to be ignored if present in link (in addition to matomo_ignore and piwik_ignore). Example classA or classA,classB
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setReferrerUrl
+ Set Referrer URL
+
+
+ string
+ text
+
+ 1
+
+
+ Override the detected Http-Referer. We recommend you call this method early in your tracking code before you call trackPageView if it should be applied to all tracking requests.
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setApiUrl
+ Set API URL
+
+
+ string
+ text
+
+ 1
+
+
+ Specify the Matomo HTTP API URL endpoint. Points to the root directory of piwik, e.g. https://matomo.example.org/ or https://example.org/matomo/. This function is only useful when the 'Overlay' report is not working. By default, you do not need to use this function.
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setPageViewId
+ Set Pageview ID
+
+
+ string
+ text
+
+ 1
+
+
+ Override PageView id for every use of logPageView(). Do not use this if you call trackPageView() multiple times during tracking (e.g. when tracking a single page application).
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setExcludedReferrers
+ Set Excluded Referrer
+
+
+ string
+ text
+
+ 1
+
+
+ Set array of hostnames or domains that should be ignored as referrers. For wildcard subdomains, you can use .example.com or *.example.com
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setDownloadClasses
+ Set Download Classes
+
+
+ string
+ text
+
+ 1
+
+
+ Set classes to be treated as downloads (in addition to matomo_download)
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setLinkClasses
+ Set Link Classes
+
+
+ string
+ text
+
+ 1
+
+
+ Set classes to be treated as outlinks (in addition to piwik_link). Example class1 or class1,class2
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setCampaignNameKey
+ Set campaign name key
+
+
+ string
+ text
+
+ 1
+
+
+ Set campaign name parameter(s).
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setCampaignKeywordKey
+ Set campaign keyword name key
+
+
+ string
+ text
+
+ 1
+
+
+ Set campaign keyword parameter(s).
+
+
+
+ 0
+
+ TagManager
+ FieldVariableTemplate
+
+
+
+ setConsentGiven
+ Set consent given.
+ 0
+ 0
+ boolean
+ checkbox
+
+ 1
+
+
+ Mark that the current user has consented. The consent is one-time only, so in a subsequent browser session, the user will have to consent again. To remember consent, see the Remember consent given option below.
+
+
+
+ 0
+
+
+ rememberConsentGiven
+ Remember consent given.
+ 0
+ 0
+ boolean
+ checkbox
+
+ 1
+
+
+ Mark that the current user has consented, and remembers this consent through a browser cookie. The next time the user visits the site, Matomo will remember that they consented, and track them. If you enable this option, you do not need to enable Set consent given option.
+
+
+
+ 0
+
+
+ rememberConsentGivenForHours
+ Expire consent.
+
+
+ string
+ text
+
+ 1
+
+
+ Optionally set after how many hours the consent should expire. By default the consent is valid for 30 years unless cookies are deleted by the user or the browser prior to this.
+
+
+
+ 0
+
+
+ forgetConsentGiven
+ Forget consent given.
+ 0
+ 0
+ boolean
+ checkbox
+
+ 1
+
+
+ Remove a user's consent, both if the consent was one-time only and if the consent was remembered. After calling this method, the user will have to consent again in order to be tracked.
+
+
+
+ 0
+
diff --git a/vue/dist/TagManager.umd.js b/vue/dist/TagManager.umd.js
index f8133c3b3..82453acdf 100644
--- a/vue/dist/TagManager.umd.js
+++ b/vue/dist/TagManager.umd.js
@@ -989,90 +989,93 @@ function FieldVariableTypeTemplatevue_type_template_id_74bb398d_render(_ctx, _ca
FieldVariableTypeTemplatevue_type_script_lang_ts.render = FieldVariableTypeTemplatevue_type_template_id_74bb398d_render
/* harmony default export */ var FieldVariableTypeTemplate = (FieldVariableTypeTemplatevue_type_script_lang_ts);
-// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/TagManager/vue/src/Variable/VariableEdit.vue?vue&type=template&id=6ce63297
+// 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/TagManager/vue/src/Variable/VariableEdit.vue?vue&type=template&id=49751742
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-var VariableEditvue_type_template_id_6ce63297_hoisted_1 = {
+var VariableEditvue_type_template_id_49751742_hoisted_1 = {
class: "editVariable tagManagerManageEdit",
ref: "root"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_2 = {
+var VariableEditvue_type_template_id_49751742_hoisted_2 = {
class: "loadingPiwik"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", {
+var VariableEditvue_type_template_id_49751742_hoisted_3 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", {
src: "plugins/Morpheus/images/loading-blue.gif"
}, null, -1);
-var VariableEditvue_type_template_id_6ce63297_hoisted_4 = {
+var VariableEditvue_type_template_id_49751742_hoisted_4 = {
class: "loadingPiwik"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", {
+var VariableEditvue_type_template_id_49751742_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("img", {
src: "plugins/Morpheus/images/loading-blue.gif"
}, null, -1);
-var VariableEditvue_type_template_id_6ce63297_hoisted_6 = {
+var VariableEditvue_type_template_id_49751742_hoisted_6 = {
key: 0,
class: "form-group row"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_7 = {
+var VariableEditvue_type_template_id_49751742_hoisted_7 = {
class: "col s12"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_8 = {
+var VariableEditvue_type_template_id_49751742_hoisted_8 = {
key: 1
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_9 = {
+var VariableEditvue_type_template_id_49751742_hoisted_9 = {
class: "form-group row"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_10 = {
+var VariableEditvue_type_template_id_49751742_hoisted_10 = {
class: "col s12"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_11 = {
+var VariableEditvue_type_template_id_49751742_hoisted_11 = {
+ key: 2
+};
+var VariableEditvue_type_template_id_49751742_hoisted_12 = {
class: "innerFormField"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_12 = {
+var VariableEditvue_type_template_id_49751742_hoisted_13 = {
class: "form-group row"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_13 = {
+var VariableEditvue_type_template_id_49751742_hoisted_14 = {
class: "col s12 m12"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_14 = {
+var VariableEditvue_type_template_id_49751742_hoisted_15 = {
for: "lookup_table"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_15 = {
+var VariableEditvue_type_template_id_49751742_hoisted_16 = {
class: "innerFormField comparisonField"
};
-var VariableEditvue_type_template_id_6ce63297_hoisted_16 = {
+var _hoisted_17 = {
class: "innerFormField"
};
-var _hoisted_17 = {
+var _hoisted_18 = {
class: "innerFormField"
};
-var _hoisted_18 = ["onClick", "title"];
-var _hoisted_19 = {
+var _hoisted_19 = ["onClick", "title"];
+var _hoisted_20 = {
class: "entityCancel"
};
-var _hoisted_20 = {
+var _hoisted_21 = {
id: "confirmSelectVariableType"
};
-var _hoisted_21 = {
+var _hoisted_22 = {
class: "collection-header"
};
-var _hoisted_22 = ["onClick", "title"];
-var _hoisted_23 = ["src"];
-var _hoisted_24 = {
+var _hoisted_23 = ["onClick", "title"];
+var _hoisted_24 = ["src"];
+var _hoisted_25 = {
class: "title"
};
-var _hoisted_25 = {
+var _hoisted_26 = {
class: "secondary-content"
};
-var _hoisted_26 = ["title"];
-var _hoisted_27 = {
+var _hoisted_27 = ["title"];
+var _hoisted_28 = {
class: "entityCancel"
};
-function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props, $setup, $data, $options) {
+function VariableEditvue_type_template_id_49751742_render(_ctx, _cache, $props, $setup, $data, $options) {
var _this = this;
var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field");
@@ -1083,15 +1086,15 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock");
- return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, {
+ return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", VariableEditvue_type_template_id_49751742_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, {
feature: "Tag Manager",
"content-title": _ctx.editTitle
}, {
default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () {
- var _ctx$variable$typeMet, _ctx$variable$typeMet2, _ctx$variable$typeMet3, _ctx$variable$typeMet4, _ctx$variable$typeMet5;
+ var _ctx$variable$typeMet, _ctx$variable$typeMet2, _ctx$variable$typeMet3, _ctx$variable$typeMet4, _ctx$variable$typeMet5, _ctx$variable$typeMet6, _ctx$variable$typeMet7;
- return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", VariableEditvue_type_template_id_6ce63297_hoisted_2, [VariableEditvue_type_template_id_6ce63297_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_LoadingData')), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isLoading]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", VariableEditvue_type_template_id_6ce63297_hoisted_4, [VariableEditvue_type_template_id_6ce63297_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_UpdatingData')), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isUpdating]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("form", {
- onSubmit: _cache[8] || (_cache[8] = function ($event) {
+ return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", VariableEditvue_type_template_id_49751742_hoisted_2, [VariableEditvue_type_template_id_49751742_hoisted_3, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_LoadingData')), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isLoading]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", VariableEditvue_type_template_id_49751742_hoisted_4, [VariableEditvue_type_template_id_49751742_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(" " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_UpdatingData')), 1)])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isUpdating]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("form", {
+ onSubmit: _cache[9] || (_cache[9] = function ($event) {
return _ctx.edit ? _ctx.updateVariable() : _ctx.createVariable();
})
}, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
@@ -1122,13 +1125,13 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
title: _ctx.translate('TagManager_Description'),
"inline-help": _ctx.translate('TagManager_VariableDescriptionHelp'),
placeholder: _ctx.translate('TagManager_VariableDescriptionPlaceholder')
- }, null, 8, ["model-value", "title", "inline-help", "placeholder"])]), (_ctx$variable$typeMet = _ctx.variable.typeMetadata) !== null && _ctx$variable$typeMet !== void 0 && (_ctx$variable$typeMet2 = _ctx$variable$typeMet.parameters) !== null && _ctx$variable$typeMet2 !== void 0 && _ctx$variable$typeMet2.length ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_ConfigureThisVariable')), 1)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.variable ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_GroupedSettings, {
+ }, null, 8, ["model-value", "title", "inline-help", "placeholder"])]), (_ctx$variable$typeMet = _ctx.variable.typeMetadata) !== null && _ctx$variable$typeMet !== void 0 && (_ctx$variable$typeMet2 = _ctx$variable$typeMet.parameters) !== null && _ctx$variable$typeMet2 !== void 0 && _ctx$variable$typeMet2.length ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", VariableEditvue_type_template_id_49751742_hoisted_6, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_49751742_hoisted_7, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_ConfigureThisVariable')), 1)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.variable ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", VariableEditvue_type_template_id_49751742_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_GroupedSettings, {
settings: ((_ctx$variable$typeMet3 = _ctx.variable.typeMetadata) === null || _ctx$variable$typeMet3 === void 0 ? void 0 : _ctx$variable$typeMet3.parameters) || [],
"all-setting-values": _ctx.parameterValues,
onChange: _cache[2] || (_cache[2] = function ($event) {
return _ctx.parameterValues[$event.name] = $event.value;
})
- }, null, 8, ["settings", "all-setting-values"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ }, null, 8, ["settings", "all-setting-values"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_49751742_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_49751742_hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h3", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
class: "showAdvancedSettings",
onClick: _cache[3] || (_cache[3] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) {
return _ctx.showAdvanced = true;
@@ -1138,11 +1141,17 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
onClick: _cache[4] || (_cache[4] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) {
return _ctx.showAdvanced = false;
}, ["prevent"]))
- }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_HideAdvancedSettings')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showAdvanced]])])])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], (_ctx$variable$typeMet4 = _ctx.variable.typeMetadata) === null || _ctx$variable$typeMet4 === void 0 ? void 0 : _ctx$variable$typeMet4.hasAdvancedSettings]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_HideAdvancedSettings')), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showAdvanced]])])])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], (_ctx$variable$typeMet4 = _ctx.variable.typeMetadata) === null || _ctx$variable$typeMet4 === void 0 ? void 0 : _ctx$variable$typeMet4.hasAdvancedSettings]]), _ctx.variable && _ctx.variable.typeMetadata && _ctx.variable.typeMetadata.id === 'MatomoConfiguration' ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", VariableEditvue_type_template_id_49751742_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_GroupedSettings, {
+ settings: ((_ctx$variable$typeMet5 = _ctx.variable.typeMetadata) === null || _ctx$variable$typeMet5 === void 0 ? void 0 : _ctx$variable$typeMet5.advancedParameters) || [],
+ "all-setting-values": _ctx.parameterValues,
+ onChange: _cache[5] || (_cache[5] = function ($event) {
+ return _ctx.parameterValues[$event.name] = $event.value;
+ })
+ }, null, 8, ["settings", "all-setting-values"])], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showAdvanced && ((_ctx$variable$typeMet6 = _ctx.variable.typeMetadata) === null || _ctx$variable$typeMet6 === void 0 ? void 0 : _ctx$variable$typeMet6.hasAdvancedSettings)]]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_49751742_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
uicontrol: "text",
name: "default_value",
"model-value": _ctx.variable.default_value,
- "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) {
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) {
_ctx.variable.default_value = $event;
_ctx.setValueHasChanged();
@@ -1150,11 +1159,11 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
title: _ctx.translate('TagManager_DefaultValue'),
"inline-help": _ctx.translate('TagManager_DefaultValueHelp'),
placeholder: _ctx.translate('TagManager_DefaultValuePlaceholder')
- }, null, 8, ["model-value", "title", "inline-help", "placeholder"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", VariableEditvue_type_template_id_6ce63297_hoisted_14, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_LookupTableTitle')), 1), (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.variable.lookup_table, function (lookup, index) {
+ }, null, 8, ["model-value", "title", "inline-help", "placeholder"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_49751742_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_49751742_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", VariableEditvue_type_template_id_49751742_hoisted_15, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_LookupTableTitle')), 1), (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.variable.lookup_table, function (lookup, index) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", {
key: index,
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])("lookupTable lookupTable".concat(index, " multiple valign-wrapper"))
- }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_49751742_hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
uicontrol: "select",
name: "lookup_table_comparison",
"model-value": lookup.comparison,
@@ -1165,7 +1174,7 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
},
"full-width": true,
options: _ctx.availableLookUpComparisons
- }, null, 8, ["model-value", "onUpdate:modelValue", "options"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", VariableEditvue_type_template_id_6ce63297_hoisted_16, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ }, null, 8, ["model-value", "onUpdate:modelValue", "options"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
uicontrol: "text",
name: "lookup_table_matchvalue",
"model-value": lookup.match_value,
@@ -1176,7 +1185,7 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
},
"full-width": true,
placeholder: _ctx.translate('TagManager_LookupTableMatchValue')
- }, null, 8, ["model-value", "onUpdate:modelValue", "placeholder"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_17, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
+ }, null, 8, ["model-value", "onUpdate:modelValue", "placeholder"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, {
uicontrol: "text",
name: "lookup_table_outvalue",
"model-value": lookup.out_value,
@@ -1194,26 +1203,26 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
return _ctx.removeLookUpEntry(index);
},
title: _ctx.translate('General_Remove')
- }, null, 8, _hoisted_18)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2);
- }), 128))])])])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showAdvanced && ((_ctx$variable$typeMet5 = _ctx.variable.typeMetadata) === null || _ctx$variable$typeMet5 === void 0 ? void 0 : _ctx$variable$typeMet5.hasAdvancedSettings)]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
+ }, null, 8, _hoisted_19)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2);
+ }), 128))])])])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.showAdvanced && ((_ctx$variable$typeMet7 = _ctx.variable.typeMetadata) === null || _ctx$variable$typeMet7 === void 0 ? void 0 : _ctx$variable$typeMet7.hasAdvancedSettings) && _ctx.variable && _ctx.variable.typeMetadata && _ctx.variable.typeMetadata.id !== 'MatomoConfiguration']]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", {
class: "alert alert-warning"
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('TagManager_UseCustomTemplateCapabilityRequired', _ctx.translate('TagManager_CapabilityUseCustomTemplates'))), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.isVariableDisabled]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, {
class: "createButton",
- onConfirm: _cache[6] || (_cache[6] = function ($event) {
+ onConfirm: _cache[7] || (_cache[7] = function ($event) {
return _ctx.edit ? _ctx.updateVariable() : _ctx.createVariable();
}),
disabled: _ctx.isUpdating || !_ctx.isDirty,
saving: _ctx.isUpdating,
value: _ctx.edit ? _ctx.translate('CoreUpdater_UpdateTitle') : _ctx.translate('TagManager_CreateNewVariable')
- }, null, 8, ["disabled", "saving", "value"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isVariableDisabled]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
- onClick: _cache[7] || (_cache[7] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) {
+ }, null, 8, ["disabled", "saving", "value"]), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isVariableDisabled]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ onClick: _cache[8] || (_cache[8] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) {
return _ctx.cancel();
}, ["prevent"]))
- }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Cancel')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isEmbedded]])])], 544), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.chooseVariableType && _ctx.editTitle]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_20, [(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.availableVariables, function (variableCategory, index) {
+ }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Cancel')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isEmbedded]])])], 544), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.chooseVariableType && _ctx.editTitle]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_21, [(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.availableVariables, function (variableCategory, index) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("ul", {
class: "collection with-header",
key: index
- }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", _hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(variableCategory.name), 1)]), (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"])(variableCategory.types, function (variableTemplate, index) {
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", _hoisted_22, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h4", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(variableCategory.name), 1)]), (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"])(variableCategory.types, function (variableTemplate, index) {
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", {
key: index,
class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["collection-item avatar", _defineProperty({
@@ -1228,13 +1237,13 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
alt: "",
class: "circle",
src: variableTemplate.icon
- }, null, 8, _hoisted_23)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_24, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(variableTemplate.name), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(variableTemplate.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], variableTemplate.description]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_25, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", {
+ }, null, 8, _hoisted_24)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_25, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(variableTemplate.name), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(variableTemplate.description), 513), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], variableTemplate.description]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_26, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", {
class: "icon-help",
title: variableTemplate.help
- }, null, 8, _hoisted_26)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !!variableTemplate.help]])], 10, _hoisted_22);
+ }, null, 8, _hoisted_27)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !!variableTemplate.help]])], 10, _hoisted_23);
}), 128))]);
- }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_27, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
- onClick: _cache[9] || (_cache[9] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) {
+ }), 128)), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_28, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", {
+ onClick: _cache[10] || (_cache[10] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) {
return _ctx.cancel();
}, ["prevent"]))
}, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Cancel')), 1)], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], !_ctx.isEmbedded]])], 512), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.chooseVariableType]])];
@@ -1242,7 +1251,7 @@ function VariableEditvue_type_template_id_6ce63297_render(_ctx, _cache, $props,
_: 1
}, 8, ["content-title"])], 512);
}
-// CONCATENATED MODULE: ./plugins/TagManager/vue/src/Variable/VariableEdit.vue?vue&type=template&id=6ce63297
+// CONCATENATED MODULE: ./plugins/TagManager/vue/src/Variable/VariableEdit.vue?vue&type=template&id=49751742
// CONCATENATED MODULE: ./plugins/TagManager/vue/src/Variable/Variables.store.ts
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || Variables_store_unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -1298,7 +1307,7 @@ var Variables_store_VariablesStore = /*#__PURE__*/function () {
}));
Variables_store_defineProperty(this, "state", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
- return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(_this.privateState);
+ return _this.privateState;
}));
Variables_store_defineProperty(this, "isLoading", Object(external_commonjs_vue_commonjs2_vue_root_Vue_["computed"])(function () {
@@ -1351,7 +1360,7 @@ var Variables_store_VariablesStore = /*#__PURE__*/function () {
filter_limit: '-1'
}).then(function (record) {
_this2.privateState.variables = [].concat(Variables_store_toConsumableArray(_this2.privateState.variables), [record]);
- return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(record);
+ return record;
}).finally(function () {
_this2.privateState.isLoadingSingle = false;
});
@@ -1390,7 +1399,7 @@ var Variables_store_VariablesStore = /*#__PURE__*/function () {
idContext: idContext,
filter_limit: '-1'
}).then(function (variables) {
- return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["readonly"])(variables);
+ return variables;
});
}
@@ -1625,6 +1634,7 @@ var notificationId = 'tagvariablemanagement';
editTitle: '',
variable: {},
parameterValues: {},
+ advancedParameters: {},
isUpdatingVar: false
};
},
@@ -1710,6 +1720,12 @@ var notificationId = 'tagvariablemanagement';
}
_this.variable = Object(external_CoreHome_["clone"])(variable);
+ _this.variable.typeMetadata.parameters = variable.typeMetadata.parameters.filter(function (item) {
+ return !Object.prototype.hasOwnProperty.call(item, 'uiControlAttributes') || !Object.prototype.hasOwnProperty.call(item.uiControlAttributes, 'showAdvancedSettings');
+ });
+ _this.variable.typeMetadata.advancedParameters = variable.typeMetadata.parameters.filter(function (item) {
+ return Object.prototype.hasOwnProperty.call(item, 'uiControlAttributes') && Object.prototype.hasOwnProperty.call(item.uiControlAttributes, 'showAdvancedSettings');
+ });
_this.parameterValues = Object.fromEntries(variable.typeMetadata.parameters.map(function (s) {
return [s.name, s.value];
}));
@@ -1803,14 +1819,23 @@ var notificationId = 'tagvariablemanagement';
lookup_table: [],
typeMetadata: variableTemplate
};
+ this.variable.typeMetadata.advancedParameters = [];
+ var advancedOptions = variableTemplate.parameters.filter(function (item) {
+ return Object.prototype.hasOwnProperty.call(item, 'uiControlAttributes') && Object.prototype.hasOwnProperty.call(item.uiControlAttributes, 'showAdvancedSettings');
+ });
+ var nonAdvancedOptions = variableTemplate.parameters.filter(function (item) {
+ return !Object.prototype.hasOwnProperty.call(item, 'uiControlAttributes') || !Object.prototype.hasOwnProperty.call(item.uiControlAttributes, 'showAdvancedSettings');
+ });
+ this.parameterValues = Object.fromEntries(variableTemplate.parameters.map(function (s) {
+ return [s.name, s.value];
+ }));
+ this.variable.typeMetadata.advancedParameters = advancedOptions;
+ this.variable.typeMetadata.parameters = nonAdvancedOptions;
if ((_this$variable$typeMe2 = this.variable.typeMetadata) !== null && _this$variable$typeMe2 !== void 0 && _this$variable$typeMe2.name) {
this.editTitle += ": ".concat(this.variable.typeMetadata.name);
}
- this.parameterValues = Object.fromEntries(variableTemplate.parameters.map(function (s) {
- return [s.name, s.value];
- }));
this.addLookUpEntry(); // we directly make the create button visible as sometimes some variables do not have
// any settings
@@ -2000,7 +2025,7 @@ var notificationId = 'tagvariablemanagement';
-VariableEditvue_type_script_lang_ts.render = VariableEditvue_type_template_id_6ce63297_render
+VariableEditvue_type_script_lang_ts.render = VariableEditvue_type_template_id_49751742_render
/* harmony default export */ var VariableEdit = (VariableEditvue_type_script_lang_ts);
// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/TagManager/vue/src/Variable/VariableList.vue?vue&type=template&id=01892e51
@@ -2062,7 +2087,7 @@ var VariableListvue_type_template_id_01892e51_hoisted_26 = /*#__PURE__*/Object(e
var VariableListvue_type_template_id_01892e51_hoisted_27 = {
class: "collection-header"
};
-var _hoisted_28 = {
+var VariableListvue_type_template_id_01892e51_hoisted_28 = {
class: "title"
};
var _hoisted_29 = ["textContent"];
@@ -2188,7 +2213,7 @@ function VariableListvue_type_template_id_01892e51_render(_ctx, _cache, $props,
return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", {
class: "collection-item",
key: variableTemplate.id
- }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_28, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(variableTemplate.name) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
+ }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", VariableListvue_type_template_id_01892e51_hoisted_28, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(variableTemplate.name) + " ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", {
class: "variableId",
textContent: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])("{{".concat(variableTemplate.id, "}}"))
}, null, 8, _hoisted_29)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", _hoisted_30, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("i", {
diff --git a/vue/dist/TagManager.umd.min.js b/vue/dist/TagManager.umd.min.js
index 6f93eb542..353a26337 100644
--- a/vue/dist/TagManager.umd.min.js
+++ b/vue/dist/TagManager.umd.min.js
@@ -1,64 +1,64 @@
-(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["TagManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["TagManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(a){if(t[a])return t[a].exports;var i=t[a]={i:a,l:!1,exports:{}};return e[a].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,a){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(a,i,function(t){return e[t]}.bind(null,i));return a},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/TagManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"ImportVersion",(function(){return p})),n.d(t,"VariableSelect",(function(){return G})),n.d(t,"VariableSelectType",(function(){return ne})),n.d(t,"FieldTextareaVariable",(function(){return ue})),n.d(t,"FieldVariableTemplate",(function(){return Te})),n.d(t,"FieldVariableTypeTemplate",(function(){return Ne})),n.d(t,"VariableEdit",(function(){return Et})),n.d(t,"VariableList",(function(){return Tn})),n.d(t,"VariableManage",(function(){return Sn})),n.d(t,"TriggerEdit",(function(){return Ea})),n.d(t,"TriggerList",(function(){return mi})),n.d(t,"TriggerManage",(function(){return fi})),n.d(t,"TagEdit",(function(){return So})),n.d(t,"TagList",(function(){return Vl})),n.d(t,"TagManage",(function(){return kl})),n.d(t,"VersionEdit",(function(){return Hc})),n.d(t,"VersionList",(function(){return Bs})),n.d(t,"VersionManage",(function(){return Hs})),n.d(t,"ContainerEdit",(function(){return bd})),n.d(t,"ContainerList",(function(){return Yd})),n.d(t,"ContainerManage",(function(){return tu})),n.d(t,"ContainerDashboard",(function(){return Ku})),n.d(t,"ContainerSelector",(function(){return cg})),n.d(t,"ManageInstallTagCode",(function(){return Xg})),n.d(t,"TrackingCodeCommon",(function(){return Cm})),n.d(t,"TrackingCodePage",(function(){return Mm})),n.d(t,"TrackingSPAPage",(function(){return ab})),n.d(t,"Debugging",(function(){return yp})),n.d(t,"CopyDialog",(function(){return wp})),"undefined"!==typeof window){var a=window.document.currentScript,i=a&&a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("8bbf"),o={class:"tagManagerImportVersion"},l={class:"ui-confirm",id:"confirmImportContainerVersion",ref:"confirmImportContainerVersion"},c=["value"],s=["value"];function d(e,t,n,a,i,d){var u=Object(r["resolveComponent"])("ActivityIndicator"),g=Object(r["resolveComponent"])("Field"),m=Object(r["resolveComponent"])("SaveButton"),b=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",o,[Object(r["createVNode"])(b,{"content-title":e.translate("TagManager_ImportVersion")},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VersionImportInfo")),1),Object(r["createVNode"])(u,{loading:e.isUpdating,"loading-message":e.translate("TagManager_UpdatingData")},null,8,["loading","loading-message"]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(g,{uicontrol:"text",modelValue:e.backupName,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.backupName=t}),name:"backupName",placeholder:" ",title:e.backupNameTitle,"inline-help":e.translate("TagManager_BackupVersionNameHelp")},null,8,["modelValue","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(g,{uicontrol:"textarea",modelValue:e.importContent,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.importContent=t}),name:"importContent",placeholder:" ","full-width":!0,title:e.translate("TagManager_VersionImportContentTitle")},null,8,["modelValue","title"])]),Object(r["createVNode"])(m,{class:"importVersion",disabled:!e.importContent,onConfirm:t[2]||(t[2]=function(t){return e.importVersion(e.backupName,e.importContent)}),value:e.translate("TagManager_VersionImportOverwriteContent")},null,8,["disabled","value"])]})),_:1},8,["content-title"]),Object(r["createElementVNode"])("div",l,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_ConfirmImportContainerVersion")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,c),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,s)],512)])}var u=n("19dc"),g=n("a5a2"),m="importContainerVersion",b=Object(r["defineComponent"])({props:{idContainer:{type:String,required:!0}},components:{ContentBlock:u["ContentBlock"],ActivityIndicator:u["ActivityIndicator"],Field:g["Field"],SaveButton:g["SaveButton"]},data:function(){return{isUpdating:!1,backupName:"",importContent:""}},methods:{showNotification:function(e,t){var n=u["NotificationsStore"].show({message:e,context:t,type:"transient",id:m});setTimeout((function(){u["NotificationsStore"].scrollToNotification(n)}),200)},importVersion:function(e,t){var n=this;if(t){var a;try{a=JSON.parse(t)}catch(i){return void this.showNotification(Object(u["translate"])("TagManager_ErrorInvalidContainerImportFormat"),"error")}"tags"in a&&"triggers"in a&&"variables"in a&&"idcontainer"in a&&"context"in a?u["Matomo"].helper.modalConfirm(this.$refs.confirmImportContainerVersion,{yes:function(){n.isUpdating=!0;var e={exportedContainerVersion:t};u["AjaxHelper"].post({method:"TagManager.importContainerVersion",idContainer:n.idContainer,backupName:n.backupName},e).then((function(){n.showNotification(Object(u["translate"])("TagManager_VersionImportSuccess"),"success"),n.isUpdating=!1,window.location.reload()})).catch((function(){n.isUpdating=!1}))}}):this.showNotification(Object(u["translate"])("TagManager_ErrorContainerVersionImportIncomplete"),"error")}}},computed:{backupNameTitle:function(){return"".concat(Object(u["translate"])("TagManager_BackupVersionName")," (").concat(Object(u["translate"])("General_Recommended"),")")}}});b.render=d;var p=b,h={class:"tagManagerManageSelect tagManagerVariableSelect"},f={class:"tableActionBar"},v=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),j={class:"collection with-header"},O={class:"collection-header"},T=["onClick"],y={class:"title"},V={class:"secondary-content"},C=["onClick","title"],N={class:"collection-header"},E=["onClick"],S={class:"title"},w={class:"secondary-content"},k=["title"],M={class:"tableActionBar"},_=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1);function D(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("ActivityIndicator");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",h,[Object(r["createVNode"])(l,{loading:e.isLoading},null,8,["loading"]),Object(r["createElementVNode"])("div",f,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createNewVariable",onClick:t[0]||(t[0]=function(t){return e.createVariable()})},[v,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVariable")),1)],512),[[r["vShow"],!e.isLoading]])]),Object(r["createElementVNode"])("ul",j,[Object(r["createElementVNode"])("li",O,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(e.translate("TagManager_CustomVariables")),1)]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.containerVariables,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"collection-item",onClick:function(n){return e.selectVariable(t)},key:n},[Object(r["createElementVNode"])("span",y,Object(r["toDisplayString"])(t.name)+" ("+Object(r["toDisplayString"])(e.translate("TagManager_Type"))+": "+Object(r["toDisplayString"])(t.type)+") ",1),Object(r["createElementVNode"])("span",V,[Object(r["createElementVNode"])("i",{class:"icon-edit",onClick:Object(r["withModifiers"])((function(n){return e.editVariable(t)}),["stop"]),title:e.translate("General_Edit")},null,8,C)])],8,T)})),128))]),Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_PreconfiguredVariables")),1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.preconfiguredVariables,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("ul",{class:"collection with-header",key:t.name},[Object(r["createElementVNode"])("li",N,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(t.name),1)]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.types,(function(t,n){return Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"collection-item",key:n,onClick:function(n){return e.selectVariable(t)}},[Object(r["createElementVNode"])("span",S,Object(r["toDisplayString"])(t.name),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",w,[Object(r["createElementVNode"])("i",{class:"icon-help",title:t.description},null,8,k)],512),[[r["vShow"],!!t.description]])],8,E)),[[r["vShow"],t.is_pre_configured]])})),128))])})),128)),Object(r["createElementVNode"])("div",M,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createNewVariable",onClick:t[1]||(t[1]=function(t){return e.createVariable()})},[_,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVariable",e.translate("TagManager_Variable"))),1)],512),[[r["vShow"],!e.isLoading]])])])}function A(e){return U(e)||L(e)||B(e)||x()}function x(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function B(e,t){if(e){if("string"===typeof e)return P(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(e,t):void 0}}function L(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function U(e){if(Array.isArray(e))return P(e)}function P(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n-1&&(this.variable.lookup_table.splice(e,1),this.isDirty=!0)},createVariableType:function(e){var t,n=this;e&&this.isVariableTemplateDisabled[e.id]||(this.chooseVariableType=!1,this.editTitle=Object(u["translate"])("TagManager_CreateNewVariable"),this.variable={idsite:parseInt("".concat(u["Matomo"].idSite),10),name:ft.suggestNameForType(e.name)||"",description:"",type:e.id,idcontainer:this.idContainer,idcontainerversion:this.idContainerVersion,default_value:"",lookup_table:[],typeMetadata:e},null!==(t=this.variable.typeMetadata)&&void 0!==t&&t.name&&(this.editTitle+=": ".concat(this.variable.typeMetadata.name)),this.parameterValues=Object.fromEntries(e.parameters.map((function(e){return[e.name,e.value]}))),this.addLookUpEntry(),this.isDirty=!0,Object(r["nextTick"])((function(){if(n.$refs.root){var e=n.$refs.root;e.scrollIntoView();var t=e.querySelector("#name");t&&t.focus()}})))},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idVariable,u["MatomoUrl"].updateHash(e)},createVariable:function(){var e=this;this.removeAnyVariableNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVar=!0,ft.createOrUpdateVariable(Object.assign(Object.assign({},this.variable),{},{name:encodeURIComponent(this.variable.name)}),"TagManager.addContainerVariable",this.idContainer,this.idContainerVersion,this.parameterValues).then((function(t){if(t){e.isDirty=!1;var n=t.value;ft.reload(e.idContainer,e.idContainerVersion).then((function(){if(e.isEmbedded)return e.variable.idvariable=n,void e.$emit("changeVariable",{variable:e.variable});e.cancel(),setTimeout((function(){var t=Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Variable")),n="";e.hasPublishCapability()&&(n=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(t," ").concat(n),"success")}),200)}))}})).finally((function(){e.isUpdatingVar=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateVariable:function(){var e=this;this.removeAnyVariableNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVar=!0,ft.createOrUpdateVariable(Object.assign(Object.assign({},this.variable),{},{name:encodeURIComponent(this.variable.name)}),"TagManager.updateContainerVariable",this.idContainer,this.idContainerVersion,this.parameterValues).then((function(t){if(t)if(e.isEmbedded)e.$emit("changeVariable",{variable:e.variable});else{e.isDirty=!1,ft.reload(e.idContainer,e.idContainerVersion).then((function(){e.initIdVariable()})),e.cancel();var n=Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Variable")),a="";e.hasPublishCapability()&&(a=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(n," ").concat(a),"success")}})).finally((function(){e.isUpdatingVar=!1})))},checkRequiredFieldsAreSet:function(){return!!this.variable.name||(this.showErrorFieldNotProvidedNotification(Object(u["translate"])("General_Name")),!1)},hasPublishCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_write")&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")}},computed:{typeInlineHelp:function(){var e,t,n=(null===(e=this.variable.typeMetadata)||void 0===e?void 0:e.description)||"",a=(null===(t=this.variable.typeMetadata)||void 0===t?void 0:t.help)||"";return"".concat(n," ").concat(a)},create:function(){return 0===this.idVariable},edit:function(){return!this.create},isLoading:function(){return ft.isLoading.value||Vt.isLoading.value},isUpdating:function(){return ft.isUpdating.value||this.isUpdatingVar},availableLookUpComparisons:function(){return Vt.comparisonOptions.value},isVariableTemplateDisabled:function(){var e=this,t={};return this.availableVariables.forEach((function(n){n.types.forEach((function(n){t[n.id]=!e.canUseCustomTemplates&&n.isCustomTemplate}))})),t},isVariableDisabled:function(){var e;return!this.canUseCustomTemplates&&(null===(e=this.variable.typeMetadata)||void 0===e?void 0:e.isCustomTemplate)},variableParameterValues:function(){var e;return null!==(e=this.variable.typeMetadata)&&void 0!==e&&e.parameters?this.parameterValues:null},variableLookupTable:function(){return this.variable.lookup_table}}});Nt.render=et;var Et=Nt,St={class:"tagManagerManageList tagManagerVariableList"},wt={class:"variableSearchFilter"},kt=["title"],Mt=["title"],_t=["title"],Dt=["title"],At=["title"],xt=["title"],Bt={colspan:"7"},Lt={class:"loadingPiwik"},Ut=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Pt={colspan:"7"},It=["id"],Ft=["title"],Ht=["title"],Gt=["title"],$t={class:"lookupTable"},Rt={class:"icon-ok"},qt=["title"],zt=["onClick","title"],Wt=["onClick","title"],Xt=["onClick","title"],Kt={class:"tableActionBar"},Jt=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Yt=["title"],Zt=Object(r["createElementVNode"])("span",{class:"icon-help preconfiguredVariablesHelp"},null,-1),Qt={class:"collection-header"},en={class:"title"},tn=["textContent"],nn={class:"secondary-content"},an=["title"],rn={class:"ui-confirm",id:"confirmDeleteVariable",ref:"confirmDeleteVariable"},on=["value"],ln=["value"],cn={class:"ui-confirm",id:"confirmDeleteVariableNotPossible",ref:"confirmDeleteVariableNotPossible"},sn={class:"collection"},dn=["value"];function un(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("ContentBlock"),s=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",St,[Object(r["createVNode"])(c,{feature:"Tag Manager",class:"tagManagerCustomVariablesList","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Variables")),"help-text":e.variablesHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VariableUsageBenefits")),1),Object(r["createElementVNode"])("div",wt,[Object(r["withDirectives"])(Object(r["createVNode"])(l,{uicontrol:"text",name:"variableSearch",title:e.translate("General_Search"),modelValue:e.variableSearch,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.variableSearch=t})},null,8,["title","modelValue"]),[[r["vShow"],e.variables.length>0]])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",{class:"name",title:e.nameTranslatedText},Object(r["toDisplayString"])(e.translate("General_Name")),9,kt),Object(r["createElementVNode"])("th",{class:"description",title:e.descriptionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Description")),9,Mt),Object(r["createElementVNode"])("th",{class:"type",title:e.typeTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Type")),9,_t),Object(r["createElementVNode"])("th",{class:"lookupTable",title:e.lookupTableTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_LookupTable")),9,Dt),Object(r["createElementVNode"])("th",{class:"lastUpdated",title:e.lastUpdatedTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_LastUpdated")),9,At),Object(r["withDirectives"])(Object(r["createElementVNode"])("th",{class:"action",title:e.actionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Actions")),9,xt),[[r["vShow"],e.hasWriteAccess]])])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Bt,[Object(r["createElementVNode"])("span",Lt,[Ut,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Pt,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoVariablesFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerVariableNow",onClick:t[1]||(t[1]=function(t){return e.createVariable()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVariableNow")),513),[[r["vShow"],e.hasWriteAccess]])])],512),[[r["vShow"],!e.isLoading&&!e.variables.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedVariables,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{id:"variable".concat(t.idvariable),class:"variables",key:t.idvariable},[Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,Ft),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,Ht),Object(r["createElementVNode"])("td",{class:"type",title:t.typeMetadata.description},Object(r["toDisplayString"])(t.typeMetadata.name),9,Gt),Object(r["createElementVNode"])("td",$t,[Object(r["withDirectives"])(Object(r["createElementVNode"])("span",Rt,null,512),[[r["vShow"],t.lookup_table.length]])]),Object(r["createElementVNode"])("td",{class:"lastUpdated",title:e.translate("TagManager_CreatedOnX",t.created_date_pretty)},[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.updated_date_pretty),1)],8,qt),Object(r["withDirectives"])(Object(r["createElementVNode"])("td",{class:Object(r["normalizeClass"])(e.getActionClasses)},[Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editVariable(t.idvariable,t.type)},title:e.translate("TagManager_EditVariable")},null,8,zt),Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteVariable(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Variable"))},null,8,Wt),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-content-copy",onClick:function(n){return e.openCopyDialog(t)},title:e.translate("TagManager_CopyX",e.translate("TagManager_Variable"))},null,8,Xt),[[r["vShow"],e.hasPublishCapability()]])],2),[[r["vShow"],e.hasWriteAccess]])],8,It)})),128))])],512),[[s]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Kt,[Object(r["createElementVNode"])("a",{class:"createNewVariable",value:"",onClick:t[2]||(t[2]=function(t){return e.createVariable()})},[Jt,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVariable")),1)])],512),[[r["vShow"],e.hasWriteAccess]])]})),_:1},8,["content-title","help-text"]),Object(r["createElementVNode"])("h2",{title:e.translate("TagManager_PreConfiguredInfoTitle")},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_PreconfiguredVariables"))+" ",1),Zt],8,Yt),Object(r["createElementVNode"])("div",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.containerVariables,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("ul",{class:"collection with-header",key:t},[Object(r["createElementVNode"])("li",Qt,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(e.name),1)]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.types,(function(e){return Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"collection-item",key:e.id},[Object(r["createElementVNode"])("span",en,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.name)+" ",1),Object(r["createElementVNode"])("span",{class:"variableId",textContent:Object(r["toDisplayString"])("{{".concat(e.id,"}}"))},null,8,tn)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",nn,[Object(r["createElementVNode"])("i",{class:"icon-help",title:e.description},null,8,an)],512),[[r["vShow"],!!e.description]])],512)),[[r["vShow"],e.is_pre_configured]])})),128))])})),128))]),Object(r["createElementVNode"])("div",rn,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteVariableConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,on),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,ln)],512),Object(r["createElementVNode"])("div",cn,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_VariableCannotBeDeleted")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VariableBeingUsedBy")),1),Object(r["createElementVNode"])("ul",sn,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.variableReferences,(function(e){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"collection-item",key:"".concat(e.referenceType,".").concat(e.referenceId)},Object(r["toDisplayString"])(e.referenceTypeName)+": "+Object(r["toDisplayString"])(e.referenceName),1)})),128))]),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VariableBeingUsedNeedsRemove")),1),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Cancel")},null,8,dn)],512)])}function gn(e){return hn(e)||pn(e)||bn(e)||mn()}function mn(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function bn(e,t){if(e){if("string"===typeof e)return fn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fn(e,t):void 0}}function pn(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function hn(e){if(Array.isArray(e))return fn(e)}function fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.name?1:0})),t},nameTranslatedText:function(){return this.translate("TagManager_VariablesNameDescription")},descriptionTranslatedText:function(){return this.translate("TagManager_VariablesDescriptionDescription")},typeTranslatedText:function(){return this.translate("TagManager_VariablesTypeDescription")},lookupTableTranslatedText:function(){return this.translate("TagManager_VariablesLookupTableDescription")},lastUpdatedTranslatedText:function(){return this.translate("TagManager_VariablesLastUpdatedDescription")},actionTranslatedText:function(){return this.translate("TagManager_VariablesActionDescription")},getActionClasses:function(){var e=this.hasPublishCapability()?" hasCopyAction":"";return"action".concat(e)}}});On.render=un;var Tn=On,yn={class:"manageVariable"},Vn={key:0},Cn={key:1};function Nn(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("VariableList"),c=Object(r["resolveComponent"])("VariableEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",yn,[e.editMode?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Vn,[Object(r["createVNode"])(l,{"id-container-version":e.idContainerVersion,"id-container":e.idContainer,"variables-help-text":e.variablesHelpText},null,8,["id-container-version","id-container","variables-help-text"])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Cn,[Object(r["createVNode"])(c,{"id-container-version":e.idContainerVersion,"id-container":e.idContainer,"id-variable":e.idVariable},null,8,["id-container-version","id-container","id-variable"])])):Object(r["createCommentVNode"])("",!0)])}var En=Object(r["defineComponent"])({props:{idContainerVersion:Number,idContainer:String,variablesHelpText:String},components:{VariableList:Tn,VariableEdit:Et},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idVariable}),(function(t){e.onIdVariableParamChange(t)})),u["NotificationsStore"].remove("variablevariablemanagement"),this.onIdVariableParamChange(u["MatomoUrl"].hashParsed.value.idVariable)},methods:{onIdVariableParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddVariable",t),this.isAddAllowed=!!t.isAllowed}}},computed:{idVariable:function(){var e=u["MatomoUrl"].hashParsed.value.idVariable;return this.isAddAllowed||"0"!==e?e?parseInt(e,10):e:null},editMode:function(){return"number"===typeof this.idVariable}}});En.render=Nn;var Sn=En;function wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kn={class:"editTrigger tagManagerManageEdit",ref:"root"},Mn={class:"loadingPiwik"},_n=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Dn={class:"loadingPiwik"},An=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),xn={class:"form-group row"},Bn={class:"col s12"},Ln={key:0},Un={class:"form-group row"},Pn={class:"col s12"},In={class:"form-group row multiple"},Fn={class:"col s12 input-field m6"},Hn={class:"col s12 input-field m6"},Gn={class:"form-help"},$n=["innerHTML"],Rn={class:"col s12 m12"},qn={class:"innerFormField"},zn={class:"innerFormField comparisonField"},Wn={class:"innerFormField"},Xn=["onClick","title"],Kn={class:"triggerConditionNode"},Jn={class:"entityCancel"},Yn={id:"confirmSelectTriggerType"},Zn={class:"collection-header"},Qn=["onClick","title"],ea=["src"],ta={class:"title"},na={class:"secondary-content"},aa=["title"],ia={class:"entityCancel"};function ra(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("GroupedSettings"),s=Object(r["resolveComponent"])("SaveButton"),d=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",kn,[Object(r["createVNode"])(d,{feature:"Tag Manager","content-title":e.editTitle},{default:Object(r["withCtx"])((function(){var n,a,i,o,d;return[Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Mn,[_n,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[r["vShow"],e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Dn,[An,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_UpdatingData")),1)])],512),[[r["vShow"],e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("form",{onSubmit:t[5]||(t[5]=function(t){return e.edit?e.updateTrigger():e.createTrigger()})},[Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-warning"},Object(r["toDisplayString"])(e.translate("TagManager_UseCustomTemplateCapabilityRequired",e.translate("TagManager_CapabilityUseCustomTemplates"))),513),[[r["vShow"],e.isTriggerDisabled]]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"name","model-value":e.trigger.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.trigger.name=t,e.setValueHasChanged()}),maxlength:255,title:e.translate("General_Name"),"inline-help":e.translate("TagManager_TriggerNameHelp"),placeholder:e.translate("TagManager_TriggerNamePlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"textarea",name:"description","model-value":e.trigger.description,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.trigger.description=t,e.setValueHasChanged()}),maxlength:1e3,title:e.translate("TagManager_Description"),"inline-help":e.translate("TagManager_TriggerDescriptionHelp"),placeholder:e.translate("TagManager_TriggerDescriptionPlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",xn,[Object(r["createElementVNode"])("div",Bn,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_ConfigureThisTrigger")),1)])],512),[[r["vShow"],null===(n=e.trigger.typeMetadata)||void 0===n||null===(a=n.parameters)||void 0===a?void 0:a.length]]),e.trigger?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ln,[Object(r["createVNode"])(c,{settings:(null===(i=e.trigger.typeMetadata)||void 0===i?void 0:i.parameters)||[],"all-setting-values":e.parameterValues,onChange:t[2]||(t[2]=function(t){return e.parameterValues[t.name]=t.value})},null,8,["settings","all-setting-values"])])):Object(r["createCommentVNode"])("",!0),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Un,[Object(r["createElementVNode"])("div",Pn,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_OnlyTriggerWhen"))+" "+Object(r["toDisplayString"])(e.translate("Goals_Optional")),1)])],512),[[r["vShow"],null===(o=e.trigger.typeMetadata)||void 0===o?void 0:o.hasAdvancedSettings]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",In,[Object(r["createElementVNode"])("div",Fn,[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerConditionsHelp")),1)]),Object(r["createElementVNode"])("div",Hn,[Object(r["createElementVNode"])("div",Gn,[Object(r["createElementVNode"])("span",{class:"inline-help",innerHTML:e.$sanitize(e.triggerInlineHelpText)},null,8,$n)])]),Object(r["createElementVNode"])("div",Rn,[Object(r["createElementVNode"])("div",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.trigger.conditions,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:n,class:Object(r["normalizeClass"])(["condition multiple valign-wrapper","condition".concat(n)])},[Object(r["createElementVNode"])("div",qn,[Object(r["createVNode"])(l,{uicontrol:"expandable-select",name:"condition_actual","model-value":t.actual,"onUpdate:modelValue":function(n){t.actual=n,e.setValueHasChanged()},"full-width":!0,options:e.availableVariables,title:e.variableIdToName[t.actual]||t.actual},null,8,["model-value","onUpdate:modelValue","options","title"])]),Object(r["createElementVNode"])("div",zn,[Object(r["createVNode"])(l,{uicontrol:"select",name:"condition_comparison","model-value":t.comparison,"onUpdate:modelValue":function(n){t.comparison=n,e.setValueHasChanged()},"full-width":!0,options:e.availableComparisons},null,8,["model-value","onUpdate:modelValue","options"])]),Object(r["createElementVNode"])("div",Wn,[Object(r["createVNode"])(l,{uicontrol:"text",name:"condition_expected","model-value":t.expected,"onUpdate:modelValue":function(n){t.expected=n,e.setValueHasChanged(),e.onConditionChange()},"full-width":!0},null,8,["model-value","onUpdate:modelValue"])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeConditionEntry(n)},title:e.translate("General_Remove")},null,8,Xn),[[r["vShow"],!(n+1===e.trigger.conditions.length)]])],2)})),128))]),Object(r["createElementVNode"])("p",Kn,Object(r["toDisplayString"])(e.translate("TagManager_TriggerConditionNode")),1)])])],512),[[r["vShow"],null===(d=e.trigger.typeMetadata)||void 0===d?void 0:d.hasAdvancedSettings]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-warning"},Object(r["toDisplayString"])(e.translate("TagManager_UseCustomTemplateCapabilityRequired",e.translate("TagManager_CapabilityUseCustomTemplates"))),513),[[r["vShow"],e.isTriggerDisabled]]),Object(r["withDirectives"])(Object(r["createVNode"])(s,{class:"createButton",onConfirm:t[3]||(t[3]=function(t){return e.edit?e.updateTrigger():e.createTrigger()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.saveButtonText},null,8,["disabled","saving","value"]),[[r["vShow"],!e.isTriggerDisabled]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Jn,[Object(r["createElementVNode"])("a",{onClick:t[4]||(t[4]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)],512),[[r["vShow"],!e.isEmbedded]])])],544),[[r["vShow"],!e.chooseTriggerType&&e.editTitle]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Yn,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.availableTriggers,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("ul",{class:"collection with-header",key:n},[Object(r["createElementVNode"])("li",Zn,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(t.name),1)]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.types,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:Object(r["normalizeClass"])(["collection-item avatar",wn({disabledTemplate:e.isTriggerTemplateDisabled[t.id]},"templateType".concat(t.id),!0)]),onClick:function(n){return e.createTriggerType(t)},key:n,title:e.isTriggerTemplateDisabled[t.id]?e.collectionItemAvatarText:""},[t.icon?(Object(r["openBlock"])(),Object(r["createElementBlock"])("img",{key:0,alt:"",class:"circle",src:t.icon},null,8,ea)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("span",ta,Object(r["toDisplayString"])(t.name),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(t.description),513),[[r["vShow"],t.description]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",na,[Object(r["createElementVNode"])("i",{class:"icon-help",title:t.help},null,8,aa)],512),[[r["vShow"],!!t.help]])],10,Qn)})),128))])})),128)),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",ia,[Object(r["createElementVNode"])("a",{onClick:t[6]||(t[6]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)],512),[[r["vShow"],!e.isEmbedded]])],512),[[r["vShow"],e.chooseTriggerType]])]})),_:1},8,["content-title"])],512)}function oa(e,t){return sa(e)||ca(e,t)||ma(e,t)||la()}function la(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ca(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(a=n.next()).done);o=!0)if(r.push(a.value),t&&r.length===t)break}catch(c){l=!0,i=c}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw i}}return r}}function sa(e){if(Array.isArray(e))return e}function da(e){return da="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},da(e)}function ua(e){return pa(e)||ba(e)||ma(e)||ga()}function ga(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ma(e,t){if(e){if("string"===typeof e)return ha(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ha(e,t):void 0}}function ba(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function pa(e){if(Array.isArray(e))return ha(e)}function ha(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n-1&&(this.variable.lookup_table.splice(e,1),this.isDirty=!0)},createVariableType:function(e){var t,n=this;if(!e||!this.isVariableTemplateDisabled[e.id]){this.chooseVariableType=!1,this.editTitle=Object(u["translate"])("TagManager_CreateNewVariable"),this.variable={idsite:parseInt("".concat(u["Matomo"].idSite),10),name:vt.suggestNameForType(e.name)||"",description:"",type:e.id,idcontainer:this.idContainer,idcontainerversion:this.idContainerVersion,default_value:"",lookup_table:[],typeMetadata:e},this.variable.typeMetadata.advancedParameters=[];var a=e.parameters.filter((function(e){return Object.prototype.hasOwnProperty.call(e,"uiControlAttributes")&&Object.prototype.hasOwnProperty.call(e.uiControlAttributes,"showAdvancedSettings")})),i=e.parameters.filter((function(e){return!Object.prototype.hasOwnProperty.call(e,"uiControlAttributes")||!Object.prototype.hasOwnProperty.call(e.uiControlAttributes,"showAdvancedSettings")}));this.parameterValues=Object.fromEntries(e.parameters.map((function(e){return[e.name,e.value]}))),this.variable.typeMetadata.advancedParameters=a,this.variable.typeMetadata.parameters=i,null!==(t=this.variable.typeMetadata)&&void 0!==t&&t.name&&(this.editTitle+=": ".concat(this.variable.typeMetadata.name)),this.addLookUpEntry(),this.isDirty=!0,Object(r["nextTick"])((function(){if(n.$refs.root){var e=n.$refs.root;e.scrollIntoView();var t=e.querySelector("#name");t&&t.focus()}}))}},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idVariable,u["MatomoUrl"].updateHash(e)},createVariable:function(){var e=this;this.removeAnyVariableNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVar=!0,vt.createOrUpdateVariable(Object.assign(Object.assign({},this.variable),{},{name:encodeURIComponent(this.variable.name)}),"TagManager.addContainerVariable",this.idContainer,this.idContainerVersion,this.parameterValues).then((function(t){if(t){e.isDirty=!1;var n=t.value;vt.reload(e.idContainer,e.idContainerVersion).then((function(){if(e.isEmbedded)return e.variable.idvariable=n,void e.$emit("changeVariable",{variable:e.variable});e.cancel(),setTimeout((function(){var t=Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Variable")),n="";e.hasPublishCapability()&&(n=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(t," ").concat(n),"success")}),200)}))}})).finally((function(){e.isUpdatingVar=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateVariable:function(){var e=this;this.removeAnyVariableNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVar=!0,vt.createOrUpdateVariable(Object.assign(Object.assign({},this.variable),{},{name:encodeURIComponent(this.variable.name)}),"TagManager.updateContainerVariable",this.idContainer,this.idContainerVersion,this.parameterValues).then((function(t){if(t)if(e.isEmbedded)e.$emit("changeVariable",{variable:e.variable});else{e.isDirty=!1,vt.reload(e.idContainer,e.idContainerVersion).then((function(){e.initIdVariable()})),e.cancel();var n=Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Variable")),a="";e.hasPublishCapability()&&(a=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(n," ").concat(a),"success")}})).finally((function(){e.isUpdatingVar=!1})))},checkRequiredFieldsAreSet:function(){return!!this.variable.name||(this.showErrorFieldNotProvidedNotification(Object(u["translate"])("General_Name")),!1)},hasPublishCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_write")&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")}},computed:{typeInlineHelp:function(){var e,t,n=(null===(e=this.variable.typeMetadata)||void 0===e?void 0:e.description)||"",a=(null===(t=this.variable.typeMetadata)||void 0===t?void 0:t.help)||"";return"".concat(n," ").concat(a)},create:function(){return 0===this.idVariable},edit:function(){return!this.create},isLoading:function(){return vt.isLoading.value||Ct.isLoading.value},isUpdating:function(){return vt.isUpdating.value||this.isUpdatingVar},availableLookUpComparisons:function(){return Ct.comparisonOptions.value},isVariableTemplateDisabled:function(){var e=this,t={};return this.availableVariables.forEach((function(n){n.types.forEach((function(n){t[n.id]=!e.canUseCustomTemplates&&n.isCustomTemplate}))})),t},isVariableDisabled:function(){var e;return!this.canUseCustomTemplates&&(null===(e=this.variable.typeMetadata)||void 0===e?void 0:e.isCustomTemplate)},variableParameterValues:function(){var e;return null!==(e=this.variable.typeMetadata)&&void 0!==e&&e.parameters?this.parameterValues:null},variableLookupTable:function(){return this.variable.lookup_table}}});Et.render=tt;var St=Et,wt={class:"tagManagerManageList tagManagerVariableList"},kt={class:"variableSearchFilter"},Mt=["title"],_t=["title"],Dt=["title"],At=["title"],xt=["title"],Bt=["title"],Lt={colspan:"7"},Ut={class:"loadingPiwik"},Pt=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),It={colspan:"7"},Ft=["id"],Ht=["title"],Gt=["title"],$t=["title"],Rt={class:"lookupTable"},qt={class:"icon-ok"},zt=["title"],Wt=["onClick","title"],Xt=["onClick","title"],Kt=["onClick","title"],Jt={class:"tableActionBar"},Yt=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Zt=["title"],Qt=Object(r["createElementVNode"])("span",{class:"icon-help preconfiguredVariablesHelp"},null,-1),en={class:"collection-header"},tn={class:"title"},nn=["textContent"],an={class:"secondary-content"},rn=["title"],on={class:"ui-confirm",id:"confirmDeleteVariable",ref:"confirmDeleteVariable"},ln=["value"],cn=["value"],sn={class:"ui-confirm",id:"confirmDeleteVariableNotPossible",ref:"confirmDeleteVariableNotPossible"},dn={class:"collection"},un=["value"];function gn(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("ContentBlock"),s=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",wt,[Object(r["createVNode"])(c,{feature:"Tag Manager",class:"tagManagerCustomVariablesList","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Variables")),"help-text":e.variablesHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VariableUsageBenefits")),1),Object(r["createElementVNode"])("div",kt,[Object(r["withDirectives"])(Object(r["createVNode"])(l,{uicontrol:"text",name:"variableSearch",title:e.translate("General_Search"),modelValue:e.variableSearch,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.variableSearch=t})},null,8,["title","modelValue"]),[[r["vShow"],e.variables.length>0]])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",{class:"name",title:e.nameTranslatedText},Object(r["toDisplayString"])(e.translate("General_Name")),9,Mt),Object(r["createElementVNode"])("th",{class:"description",title:e.descriptionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Description")),9,_t),Object(r["createElementVNode"])("th",{class:"type",title:e.typeTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Type")),9,Dt),Object(r["createElementVNode"])("th",{class:"lookupTable",title:e.lookupTableTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_LookupTable")),9,At),Object(r["createElementVNode"])("th",{class:"lastUpdated",title:e.lastUpdatedTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_LastUpdated")),9,xt),Object(r["withDirectives"])(Object(r["createElementVNode"])("th",{class:"action",title:e.actionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Actions")),9,Bt),[[r["vShow"],e.hasWriteAccess]])])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Lt,[Object(r["createElementVNode"])("span",Ut,[Pt,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",It,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoVariablesFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerVariableNow",onClick:t[1]||(t[1]=function(t){return e.createVariable()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVariableNow")),513),[[r["vShow"],e.hasWriteAccess]])])],512),[[r["vShow"],!e.isLoading&&!e.variables.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedVariables,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{id:"variable".concat(t.idvariable),class:"variables",key:t.idvariable},[Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,Ht),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,Gt),Object(r["createElementVNode"])("td",{class:"type",title:t.typeMetadata.description},Object(r["toDisplayString"])(t.typeMetadata.name),9,$t),Object(r["createElementVNode"])("td",Rt,[Object(r["withDirectives"])(Object(r["createElementVNode"])("span",qt,null,512),[[r["vShow"],t.lookup_table.length]])]),Object(r["createElementVNode"])("td",{class:"lastUpdated",title:e.translate("TagManager_CreatedOnX",t.created_date_pretty)},[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.updated_date_pretty),1)],8,zt),Object(r["withDirectives"])(Object(r["createElementVNode"])("td",{class:Object(r["normalizeClass"])(e.getActionClasses)},[Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editVariable(t.idvariable,t.type)},title:e.translate("TagManager_EditVariable")},null,8,Wt),Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteVariable(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Variable"))},null,8,Xt),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-content-copy",onClick:function(n){return e.openCopyDialog(t)},title:e.translate("TagManager_CopyX",e.translate("TagManager_Variable"))},null,8,Kt),[[r["vShow"],e.hasPublishCapability()]])],2),[[r["vShow"],e.hasWriteAccess]])],8,Ft)})),128))])],512),[[s]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Jt,[Object(r["createElementVNode"])("a",{class:"createNewVariable",value:"",onClick:t[2]||(t[2]=function(t){return e.createVariable()})},[Yt,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVariable")),1)])],512),[[r["vShow"],e.hasWriteAccess]])]})),_:1},8,["content-title","help-text"]),Object(r["createElementVNode"])("h2",{title:e.translate("TagManager_PreConfiguredInfoTitle")},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_PreconfiguredVariables"))+" ",1),Qt],8,Zt),Object(r["createElementVNode"])("div",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.containerVariables,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("ul",{class:"collection with-header",key:t},[Object(r["createElementVNode"])("li",en,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(e.name),1)]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.types,(function(e){return Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"collection-item",key:e.id},[Object(r["createElementVNode"])("span",tn,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.name)+" ",1),Object(r["createElementVNode"])("span",{class:"variableId",textContent:Object(r["toDisplayString"])("{{".concat(e.id,"}}"))},null,8,nn)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",an,[Object(r["createElementVNode"])("i",{class:"icon-help",title:e.description},null,8,rn)],512),[[r["vShow"],!!e.description]])],512)),[[r["vShow"],e.is_pre_configured]])})),128))])})),128))]),Object(r["createElementVNode"])("div",on,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteVariableConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,ln),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,cn)],512),Object(r["createElementVNode"])("div",sn,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_VariableCannotBeDeleted")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VariableBeingUsedBy")),1),Object(r["createElementVNode"])("ul",dn,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.variableReferences,(function(e){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"collection-item",key:"".concat(e.referenceType,".").concat(e.referenceId)},Object(r["toDisplayString"])(e.referenceTypeName)+": "+Object(r["toDisplayString"])(e.referenceName),1)})),128))]),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VariableBeingUsedNeedsRemove")),1),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Cancel")},null,8,un)],512)])}function bn(e){return fn(e)||hn(e)||pn(e)||mn()}function mn(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pn(e,t){if(e){if("string"===typeof e)return vn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vn(e,t):void 0}}function hn(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function fn(e){if(Array.isArray(e))return vn(e)}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.name?1:0})),t},nameTranslatedText:function(){return this.translate("TagManager_VariablesNameDescription")},descriptionTranslatedText:function(){return this.translate("TagManager_VariablesDescriptionDescription")},typeTranslatedText:function(){return this.translate("TagManager_VariablesTypeDescription")},lookupTableTranslatedText:function(){return this.translate("TagManager_VariablesLookupTableDescription")},lastUpdatedTranslatedText:function(){return this.translate("TagManager_VariablesLastUpdatedDescription")},actionTranslatedText:function(){return this.translate("TagManager_VariablesActionDescription")},getActionClasses:function(){var e=this.hasPublishCapability()?" hasCopyAction":"";return"action".concat(e)}}});Tn.render=gn;var yn=Tn,Vn={class:"manageVariable"},Cn={key:0},Nn={key:1};function En(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("VariableList"),c=Object(r["resolveComponent"])("VariableEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Vn,[e.editMode?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Cn,[Object(r["createVNode"])(l,{"id-container-version":e.idContainerVersion,"id-container":e.idContainer,"variables-help-text":e.variablesHelpText},null,8,["id-container-version","id-container","variables-help-text"])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Nn,[Object(r["createVNode"])(c,{"id-container-version":e.idContainerVersion,"id-container":e.idContainer,"id-variable":e.idVariable},null,8,["id-container-version","id-container","id-variable"])])):Object(r["createCommentVNode"])("",!0)])}var Sn=Object(r["defineComponent"])({props:{idContainerVersion:Number,idContainer:String,variablesHelpText:String},components:{VariableList:yn,VariableEdit:St},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idVariable}),(function(t){e.onIdVariableParamChange(t)})),u["NotificationsStore"].remove("variablevariablemanagement"),this.onIdVariableParamChange(u["MatomoUrl"].hashParsed.value.idVariable)},methods:{onIdVariableParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddVariable",t),this.isAddAllowed=!!t.isAllowed}}},computed:{idVariable:function(){var e=u["MatomoUrl"].hashParsed.value.idVariable;return this.isAddAllowed||"0"!==e?e?parseInt(e,10):e:null},editMode:function(){return"number"===typeof this.idVariable}}});Sn.render=En;var wn=Sn;function kn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Mn={class:"editTrigger tagManagerManageEdit",ref:"root"},_n={class:"loadingPiwik"},Dn=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),An={class:"loadingPiwik"},xn=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Bn={class:"form-group row"},Ln={class:"col s12"},Un={key:0},Pn={class:"form-group row"},In={class:"col s12"},Fn={class:"form-group row multiple"},Hn={class:"col s12 input-field m6"},Gn={class:"col s12 input-field m6"},$n={class:"form-help"},Rn=["innerHTML"],qn={class:"col s12 m12"},zn={class:"innerFormField"},Wn={class:"innerFormField comparisonField"},Xn={class:"innerFormField"},Kn=["onClick","title"],Jn={class:"triggerConditionNode"},Yn={class:"entityCancel"},Zn={id:"confirmSelectTriggerType"},Qn={class:"collection-header"},ea=["onClick","title"],ta=["src"],na={class:"title"},aa={class:"secondary-content"},ia=["title"],ra={class:"entityCancel"};function oa(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("GroupedSettings"),s=Object(r["resolveComponent"])("SaveButton"),d=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Mn,[Object(r["createVNode"])(d,{feature:"Tag Manager","content-title":e.editTitle},{default:Object(r["withCtx"])((function(){var n,a,i,o,d;return[Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",_n,[Dn,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[r["vShow"],e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",An,[xn,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_UpdatingData")),1)])],512),[[r["vShow"],e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("form",{onSubmit:t[5]||(t[5]=function(t){return e.edit?e.updateTrigger():e.createTrigger()})},[Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-warning"},Object(r["toDisplayString"])(e.translate("TagManager_UseCustomTemplateCapabilityRequired",e.translate("TagManager_CapabilityUseCustomTemplates"))),513),[[r["vShow"],e.isTriggerDisabled]]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"name","model-value":e.trigger.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.trigger.name=t,e.setValueHasChanged()}),maxlength:255,title:e.translate("General_Name"),"inline-help":e.translate("TagManager_TriggerNameHelp"),placeholder:e.translate("TagManager_TriggerNamePlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"textarea",name:"description","model-value":e.trigger.description,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.trigger.description=t,e.setValueHasChanged()}),maxlength:1e3,title:e.translate("TagManager_Description"),"inline-help":e.translate("TagManager_TriggerDescriptionHelp"),placeholder:e.translate("TagManager_TriggerDescriptionPlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Bn,[Object(r["createElementVNode"])("div",Ln,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_ConfigureThisTrigger")),1)])],512),[[r["vShow"],null===(n=e.trigger.typeMetadata)||void 0===n||null===(a=n.parameters)||void 0===a?void 0:a.length]]),e.trigger?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Un,[Object(r["createVNode"])(c,{settings:(null===(i=e.trigger.typeMetadata)||void 0===i?void 0:i.parameters)||[],"all-setting-values":e.parameterValues,onChange:t[2]||(t[2]=function(t){return e.parameterValues[t.name]=t.value})},null,8,["settings","all-setting-values"])])):Object(r["createCommentVNode"])("",!0),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Pn,[Object(r["createElementVNode"])("div",In,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_OnlyTriggerWhen"))+" "+Object(r["toDisplayString"])(e.translate("Goals_Optional")),1)])],512),[[r["vShow"],null===(o=e.trigger.typeMetadata)||void 0===o?void 0:o.hasAdvancedSettings]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",Fn,[Object(r["createElementVNode"])("div",Hn,[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerConditionsHelp")),1)]),Object(r["createElementVNode"])("div",Gn,[Object(r["createElementVNode"])("div",$n,[Object(r["createElementVNode"])("span",{class:"inline-help",innerHTML:e.$sanitize(e.triggerInlineHelpText)},null,8,Rn)])]),Object(r["createElementVNode"])("div",qn,[Object(r["createElementVNode"])("div",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.trigger.conditions,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:n,class:Object(r["normalizeClass"])(["condition multiple valign-wrapper","condition".concat(n)])},[Object(r["createElementVNode"])("div",zn,[Object(r["createVNode"])(l,{uicontrol:"expandable-select",name:"condition_actual","model-value":t.actual,"onUpdate:modelValue":function(n){t.actual=n,e.setValueHasChanged()},"full-width":!0,options:e.availableVariables,title:e.variableIdToName[t.actual]||t.actual},null,8,["model-value","onUpdate:modelValue","options","title"])]),Object(r["createElementVNode"])("div",Wn,[Object(r["createVNode"])(l,{uicontrol:"select",name:"condition_comparison","model-value":t.comparison,"onUpdate:modelValue":function(n){t.comparison=n,e.setValueHasChanged()},"full-width":!0,options:e.availableComparisons},null,8,["model-value","onUpdate:modelValue","options"])]),Object(r["createElementVNode"])("div",Xn,[Object(r["createVNode"])(l,{uicontrol:"text",name:"condition_expected","model-value":t.expected,"onUpdate:modelValue":function(n){t.expected=n,e.setValueHasChanged(),e.onConditionChange()},"full-width":!0},null,8,["model-value","onUpdate:modelValue"])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",{class:"icon-minus valign",onClick:function(t){return e.removeConditionEntry(n)},title:e.translate("General_Remove")},null,8,Kn),[[r["vShow"],!(n+1===e.trigger.conditions.length)]])],2)})),128))]),Object(r["createElementVNode"])("p",Jn,Object(r["toDisplayString"])(e.translate("TagManager_TriggerConditionNode")),1)])])],512),[[r["vShow"],null===(d=e.trigger.typeMetadata)||void 0===d?void 0:d.hasAdvancedSettings]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-warning"},Object(r["toDisplayString"])(e.translate("TagManager_UseCustomTemplateCapabilityRequired",e.translate("TagManager_CapabilityUseCustomTemplates"))),513),[[r["vShow"],e.isTriggerDisabled]]),Object(r["withDirectives"])(Object(r["createVNode"])(s,{class:"createButton",onConfirm:t[3]||(t[3]=function(t){return e.edit?e.updateTrigger():e.createTrigger()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.saveButtonText},null,8,["disabled","saving","value"]),[[r["vShow"],!e.isTriggerDisabled]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Yn,[Object(r["createElementVNode"])("a",{onClick:t[4]||(t[4]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)],512),[[r["vShow"],!e.isEmbedded]])])],544),[[r["vShow"],!e.chooseTriggerType&&e.editTitle]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Zn,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.availableTriggers,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("ul",{class:"collection with-header",key:n},[Object(r["createElementVNode"])("li",Qn,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(t.name),1)]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.types,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:Object(r["normalizeClass"])(["collection-item avatar",kn({disabledTemplate:e.isTriggerTemplateDisabled[t.id]},"templateType".concat(t.id),!0)]),onClick:function(n){return e.createTriggerType(t)},key:n,title:e.isTriggerTemplateDisabled[t.id]?e.collectionItemAvatarText:""},[t.icon?(Object(r["openBlock"])(),Object(r["createElementBlock"])("img",{key:0,alt:"",class:"circle",src:t.icon},null,8,ta)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("span",na,Object(r["toDisplayString"])(t.name),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(t.description),513),[[r["vShow"],t.description]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",aa,[Object(r["createElementVNode"])("i",{class:"icon-help",title:t.help},null,8,ia)],512),[[r["vShow"],!!t.help]])],10,ea)})),128))])})),128)),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",ra,[Object(r["createElementVNode"])("a",{onClick:t[6]||(t[6]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)],512),[[r["vShow"],!e.isEmbedded]])],512),[[r["vShow"],e.chooseTriggerType]])]})),_:1},8,["content-title"])],512)}function la(e,t){return da(e)||sa(e,t)||ma(e,t)||ca()}function ca(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function sa(e,t){var n=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var a,i,r=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(a=n.next()).done);o=!0)if(r.push(a.value),t&&r.length===t)break}catch(c){l=!0,i=c}finally{try{o||null==n["return"]||n["return"]()}finally{if(l)throw i}}return r}}function da(e){if(Array.isArray(e))return e}function ua(e){return ua="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ua(e)}function ga(e){return ha(e)||pa(e)||ma(e)||ba()}function ba(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ma(e,t){if(e){if("string"===typeof e)return fa(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fa(e,t):void 0}}function pa(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ha(e){if(Array.isArray(e))return fa(e)}function fa(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n-1){var t=this.trigger.conditions.length-1;t===e?this.trigger.conditions[e]=this.makeDefaultCondition():this.trigger.conditions.splice(e,1),this.isDirty=!0}},createTriggerType:function(e){var t,n=this;e&&this.isTriggerTemplateDisabled[e.id]||(this.chooseTriggerType=!1,this.editTitle=Object(u["translate"])("TagManager_CreateNewTrigger"),this.trigger={idsite:parseInt("".concat(u["Matomo"].idSite),10),name:ya.suggestNameForType(e.name)||"",description:"",type:e.id,idcontainerversion:this.idContainerVersion,conditions:[],typeMetadata:e},null!==(t=this.trigger.typeMetadata)&&void 0!==t&&t.name&&(this.editTitle+=": ".concat(this.trigger.typeMetadata.name)),this.parameterValues=Object.fromEntries(e.parameters.map((function(e){return[e.name,e.value]}))),this.addConditionEntry(),this.isDirty=!0,Object(r["nextTick"])((function(){if(n.$refs.root){var e=n.$refs.root;e.scrollIntoView();var t=e.querySelector("#name");t&&t.focus()}})))},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idTrigger,u["MatomoUrl"].updateHash(e)},createTrigger:function(){var e=this;this.removeAnyTriggerNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingTrigger=!0,ya.createOrUpdateTrigger(this.trigger,"TagManager.addContainerTrigger",this.idContainer,this.idContainerVersion,this.parameterValues).then((function(t){var n=t.value;e.isDirty=!1,ya.reload(e.idContainer,e.idContainerVersion).then((function(){if(e.isEmbedded)return e.trigger.idtrigger=n,void e.$emit("changeTrigger",{trigger:e.trigger});e.cancel(),setTimeout((function(){var t=Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Trigger")),n="";e.hasPublishCapability()&&(n=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(t," ").concat(n),"success")}),200)}))})).finally((function(){e.isUpdatingTrigger=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateTrigger:function(){var e=this;this.removeAnyTriggerNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingTrigger=!0,ya.createOrUpdateTrigger(this.trigger,"TagManager.updateContainerTrigger",this.idContainer,this.idContainerVersion,this.parameterValues).then((function(t){if(t){if(e.isEmbedded)return e.$emit("changeTrigger",{trigger:e.trigger}),void ya.reload(e.idContainer,e.idContainerVersion);e.isDirty=!1,ya.reload(e.idContainer,e.idContainerVersion).then((function(){e.initIdTrigger()})),e.cancel();var n=Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Trigger")),a="";e.hasPublishCapability()&&(a=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(n," ").concat(a),"success")}})).finally((function(){e.isUpdatingTrigger=!1})))},makeDefaultCondition:function(){var e,t="PageUrl";if(null!==(e=this.trigger)&&void 0!==e&&e.typeMetadata){var n=this.trigger.typeMetadata.id;Ca[n]&&(t=Ca[n])}return{comparison:"equals",actual:t,expected:""}},hasPublishCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_write")&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")}},computed:{isLoading:function(){return ya.isLoading.value||Vt.isLoading.value},isUpdating:function(){return ya.isUpdating.value||this.isUpdatingTrigger},create:function(){return 0===this.idTrigger},edit:function(){return!this.create},canUseCustomTemplates:function(){return u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},isTriggerDisabled:function(){var e;return!this.canUseCustomTemplates&&(null===(e=this.trigger.typeMetadata)||void 0===e?void 0:e.isCustomTemplate)},saveButtonText:function(){return this.edit?Object(u["translate"])("CoreUpdater_UpdateTitle"):Object(u["translate"])("TagManager_CreateNewTrigger")},collectionItemAvatarText:function(){return Object(u["translate"])("TagManager_UseCustomTemplateCapabilityRequired",Object(u["translate"])("TagManager_CapabilityUseCustomTemplates"))},triggerInlineHelpText:function(){return Object(u["translate"])("TagManager_TriggerConditionsHelpText",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/create-a-trigger-to-track-interactions-on-all-nested-elements/"),"")},availableComparisons:function(){return Vt.comparisonOptions.value},isTriggerTemplateDisabled:function(){var e=this,t={};return this.availableTriggers.forEach((function(n){n.types.forEach((function(n){t[n.id]=!e.canUseCustomTemplates&&n.isCustomTemplate}))})),t},triggerParameterValues:function(){var e;return null!==(e=this.trigger.typeMetadata)&&void 0!==e&&e.parameters?this.parameterValues:null}}});Na.render=ra;var Ea=Na,Sa={class:"tagManagerManageList tagManagerTriggerList"},wa={class:"triggerSearchFilter"},ka=["title"],Ma=["title"],_a=["title"],Da=["title"],Aa=["title"],xa=["title"],Ba={colspan:"7"},La={class:"loadingPiwik"},Ua=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Pa={colspan:"7"},Ia=["id"],Fa=["title"],Ha=["title"],Ga=["title"],$a={class:"conditions"},Ra={class:"icon-ok"},qa=["title"],za=["onClick","title"],Wa=["onClick","title"],Xa=["onClick","title"],Ka={class:"tableActionBar"},Ja=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Ya={class:"ui-confirm",id:"confirmDeleteTrigger",ref:"confirmDeleteTrigger"},Za=["value"],Qa=["value"],ei={class:"ui-confirm",id:"confirmDeleteTriggerNotPossible",ref:"confirmDeleteTriggerNotPossible"},ti={class:"collection"},ni=["value"];function ai(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("ContentBlock"),s=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Sa,[Object(r["createVNode"])(c,{feature:"Tag Manager","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Triggers")),"help-text":e.triggersHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerUsageBenefits")),1),Object(r["createElementVNode"])("div",wa,[Object(r["withDirectives"])(Object(r["createVNode"])(l,{uicontrol:"text",name:"triggerSearch",title:e.translate("General_Search"),modelValue:e.triggerSearch,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.triggerSearch=t})},null,8,["title","modelValue"]),[[r["vShow"],e.triggers.length>0]])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",{class:"name",title:e.nameTranslatedText},Object(r["toDisplayString"])(e.translate("General_Name")),9,ka),Object(r["createElementVNode"])("th",{class:"description",title:e.descriptionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Description")),9,Ma),Object(r["createElementVNode"])("th",{class:"type",title:e.typeTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Type")),9,_a),Object(r["createElementVNode"])("th",{class:"conditions",title:e.filterTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Filter")),9,Da),Object(r["createElementVNode"])("th",{class:"lastUpdated",title:e.lastUpdatedTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_LastUpdated")),9,Aa),Object(r["withDirectives"])(Object(r["createElementVNode"])("th",{class:"action",title:e.actionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Actions")),9,xa),[[r["vShow"],e.hasWriteAccess]])])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Ba,[Object(r["createElementVNode"])("span",La,[Ua,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Pa,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoTriggersFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerTriggerNow",onClick:t[1]||(t[1]=function(t){return e.createTrigger()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTriggerNow")),513),[[r["vShow"],e.hasWriteAccess]])])],512),[[r["vShow"],!e.isLoading&&0===e.triggers.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedTriggers,(function(t){var n;return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{id:"trigger".concat(t.idtrigger),class:"triggers",key:t.idtrigger},[Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,Fa),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,Ha),Object(r["createElementVNode"])("td",{class:"type",title:t.typeMetadata.description},Object(r["toDisplayString"])(t.typeMetadata.name),9,Ga),Object(r["createElementVNode"])("td",$a,[Object(r["withDirectives"])(Object(r["createElementVNode"])("span",Ra,null,512),[[r["vShow"],null===(n=t.conditions)||void 0===n?void 0:n.length]])]),Object(r["createElementVNode"])("td",{class:"lastUpdated",title:e.translate("TagManager_CreatedOnX",t.created_date_pretty)},[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.updated_date_pretty),1)],8,qa),Object(r["withDirectives"])(Object(r["createElementVNode"])("td",{class:Object(r["normalizeClass"])(e.getActionClasses)},[Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editTrigger(t.idtrigger,t.type)},title:e.translate("TagManager_EditTrigger")},null,8,za),Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteTrigger(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Trigger"))},null,8,Wa),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-content-copy",onClick:function(n){return e.openCopyDialog(t)},title:e.translate("TagManager_CopyX",e.translate("TagManager_Trigger"))},null,8,Xa),[[r["vShow"],e.hasPublishCapability()]])],2),[[r["vShow"],e.hasWriteAccess]])],8,Ia)})),128))])],512),[[s]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Ka,[Object(r["createElementVNode"])("a",{class:"createNewTrigger",value:"",onClick:t[2]||(t[2]=function(t){return e.createTrigger()})},[Ja,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTrigger")),1)])],512),[[r["vShow"],e.hasWriteAccess]])]})),_:1},8,["content-title","help-text"]),Object(r["createElementVNode"])("div",Ya,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteTriggerConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Za),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,Qa)],512),Object(r["createElementVNode"])("div",ei,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerCannotBeDeleted")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerBeingUsedBy")),1),Object(r["createElementVNode"])("ul",ti,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.triggerReferences,(function(e){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"collection-item",key:e.referenceId},Object(r["toDisplayString"])(e.referenceTypeName)+": "+Object(r["toDisplayString"])(e.referenceName),1)})),128))]),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerBeingUsedNeedsRemove")),1),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Cancel")},null,8,ni)],512)])}function ii(e){return ci(e)||li(e)||oi(e)||ri()}function ri(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function oi(e,t){if(e){if("string"===typeof e)return si(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?si(e,t):void 0}}function li(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function ci(e){if(Array.isArray(e))return si(e)}function si(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.name?1:0})),t},nameTranslatedText:function(){return this.translate("TagManager_TriggersNameDescription")},descriptionTranslatedText:function(){return this.translate("TagManager_TriggersDescriptionDescription")},typeTranslatedText:function(){return this.translate("TagManager_TriggersTypeDescription")},filterTranslatedText:function(){return this.translate("TagManager_TriggersFilterDescription")},lastUpdatedTranslatedText:function(){return this.translate("TagManager_TriggersLastUpdatedDescription")},actionTranslatedText:function(){return this.translate("TagManager_TriggersActionDescription")},getActionClasses:function(){var e=this.hasPublishCapability()?" hasCopyAction":"";return"action".concat(e)}}});gi.render=ai;var mi=gi,bi={class:"manageTrigger"};function pi(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("TriggerList"),c=Object(r["resolveComponent"])("TriggerEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",bi,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion,"triggers-help-text":e.triggersHelpText},null,8,["id-container","id-container-version","triggers-help-text"])])],512),[[r["vShow"],!e.editMode]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion,"id-trigger":e.idTrigger},null,8,["id-container","id-container-version","id-trigger"])])],512),[[r["vShow"],e.editMode]])])}var hi=Object(r["defineComponent"])({props:{idContainerVersion:Number,idContainer:String,triggersHelpText:String},components:{TriggerList:mi,TriggerEdit:Ea},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idTrigger}),(function(t){e.onIdTriggerParamChange(t)})),u["NotificationsStore"].remove("triggertriggermanagement"),this.onIdTriggerParamChange(u["MatomoUrl"].hashParsed.value.idTrigger)},methods:{onIdTriggerParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddTrigger",t),this.isAddAllowed=!!t.isAllowed}}},computed:{idTrigger:function(){var e=u["MatomoUrl"].hashParsed.value.idTrigger;return this.isAddAllowed||"0"!==e?e?parseInt(e,10):e:null},editMode:function(){return"number"===typeof this.idTrigger}}});hi.render=pi;var fi=hi;function vi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ji={class:"editTag tagManagerManageEdit",ref:"root"},Oi={class:"loadingPiwik"},Ti=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),yi={class:"loadingPiwik"},Vi=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Ci={class:"form-group row"},Ni={class:"col s12"},Ei={key:0},Si={class:"form-group row"},wi={class:"col s12"},ki={class:"form-group row"},Mi={class:"col s12"},_i={class:"form-group row tagStartDate"},Di={class:"col s12 m6"},Ai={class:"row"},xi={class:"col s12"},Bi={for:"start_date_date",class:"active"},Li={class:"tagStartDate"},Ui={class:"col s12 m6 "},Pi={class:"form-help"},Ii={class:"inline-help"},Fi=["innerHTML"],Hi=Object(r["createElementVNode"])("br",null,null,-1),Gi=["innerHTML"],$i={class:"form-group row tagEndDate"},Ri={class:"col s12 m6"},qi={class:"row"},zi={class:"col s12"},Wi={for:"end_date_date",class:"active"},Xi={class:"tagEndDate"},Ki={class:"col s12 m6"},Ji={class:"form-help"},Yi={class:"inline-help"},Zi=["innerHTML"],Qi=Object(r["createElementVNode"])("br",null,null,-1),er=["innerHTML"],tr={class:"entityCancel"},nr={id:"confirmSelectTagType"},ar={class:"collection-header"},ir=["onClick","title"],rr=["src"],or={class:"title"},lr={class:"secondary-content"},cr=["title"],sr={class:"entityCancel"};function dr(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("GroupedSettings"),s=Object(r["resolveComponent"])("TagTriggerArray"),d=Object(r["resolveComponent"])("TagDateInput"),u=Object(r["resolveComponent"])("SaveButton"),g=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ji,[Object(r["createVNode"])(g,{feature:"Tag Manager","content-title":e.editTitle},{default:Object(r["withCtx"])((function(){var n,a,i,o,g;return[Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Oi,[Ti,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[r["vShow"],e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",yi,[Vi,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_UpdatingData")),1)])],512),[[r["vShow"],e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("form",{onSubmit:t[18]||(t[18]=function(t){return e.edit?e.updateTag():e.createTag()})},[Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-warning"},Object(r["toDisplayString"])(e.translate("TagManager_UseCustomTemplateCapabilityRequired",e.translate("TagManager_CapabilityUseCustomTemplates"))),513),[[r["vShow"],e.isTagDisabled]]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"name","model-value":e.tag.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.tag.name=t,e.setValueHasChanged()}),maxlength:255,title:e.translate("General_Name"),"inline-help":e.tagNameHelpText,placeholder:e.translate("TagManager_TagNamePlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"textarea",name:"description","model-value":e.tag.description,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.tag.description=t,e.setValueHasChanged()}),maxlength:1e3,title:e.translate("TagManager_Description"),placeholder:e.translate("TagManager_TagDescriptionPlaceholder")},null,8,["model-value","title","placeholder"])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Ci,[Object(r["createElementVNode"])("div",Ni,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_ConfigureWhatTagDoes")),1)])],512),[[r["vShow"],null===(n=e.tag.typeMetadata)||void 0===n?void 0:n.parameters.length]]),e.tag?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ei,[Object(r["createVNode"])(c,{settings:(null===(a=e.tag.typeMetadata)||void 0===a?void 0:a.parameters)||[],"all-setting-values":e.parameterValues,onChange:t[2]||(t[2]=function(t){e.parameterValues[t.name]=t.value,e.setValueHasChanged()})},null,8,["settings","all-setting-values"])])):Object(r["createCommentVNode"])("",!0),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Si,[Object(r["createElementVNode"])("div",wi,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_ConfigureWhenTagDoes")),1)])],512),[[r["vShow"],null===(i=e.tag.typeMetadata)||void 0===i?void 0:i.parameters.length]]),Object(r["createVNode"])(s,{"container-triggers":e.containerTriggers,type:"fire",title:e.translate("TagManager_FireTriggerTitle"),help:e.translate("TagManager_FireTriggerHelp",e.translate("TagManager_FireLimit")),"model-value":e.fireTriggers,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.fireTriggers=t,e.setValueHasChanged(),e.onFireTriggerChange()}),onCreate:t[4]||(t[4]=function(t){return e.onCreateNewFireTrigger()}),onEdit:t[5]||(t[5]=function(t){return e.editTrigger(t)})},null,8,["container-triggers","title","help","model-value"]),Object(r["createVNode"])(s,{"container-triggers":e.containerTriggers,type:"block",title:e.translate("TagManager_BlockTriggerTitle"),help:e.translate("TagManager_BlockTriggerHelp"),"model-value":e.blockTriggers,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.blockTriggers=t,e.setValueHasChanged(),e.onBlockTriggerChange()}),onCreate:t[7]||(t[7]=function(t){return e.onCreateNewBlockTrigger()}),onEdit:t[8]||(t[8]=function(t){return e.editTrigger(t)})},null,8,["container-triggers","title","help","model-value"]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",ki,[Object(r["createElementVNode"])("div",Mi,[Object(r["createElementVNode"])("h3",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{href:"",class:"showAdvancedSettings",onClick:t[9]||(t[9]=Object(r["withModifiers"])((function(t){return e.showAdvanced=!0}),["prevent"]))},Object(r["toDisplayString"])(e.translate("TagManager_ShowAdvancedSettings")),513),[[r["vShow"],!e.showAdvanced]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{href:"",class:"hideAdvancedSettings",onClick:t[10]||(t[10]=Object(r["withModifiers"])((function(t){return e.showAdvanced=!1}),["prevent"]))},Object(r["toDisplayString"])(e.translate("TagManager_HideAdvancedSettings")),513),[[r["vShow"],e.showAdvanced]])])])],512),[[r["vShow"],null===(o=e.tag.typeMetadata)||void 0===o?void 0:o.hasAdvancedSettings]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"radio",name:"fire_limit","model-value":e.tag.fire_limit,"onUpdate:modelValue":t[11]||(t[11]=function(t){e.tag.fire_limit=t,e.setValueHasChanged()}),options:e.availableFireLimits,title:e.translate("TagManager_FireLimit"),"inline-help":e.fireLimitHelp},null,8,["model-value","options","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"fire_delay","model-value":e.tag.fire_delay,"onUpdate:modelValue":t[12]||(t[12]=function(t){e.tag.fire_delay=t,e.setValueHasChanged()}),maxlength:8,title:e.translate("TagManager_FireDelay"),"inline-help":e.translate("TagManager_FireDelayHelp"),placeholder:e.translate("TagManager_PlaceholderZero")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"priority","model-value":e.tag.priority,"onUpdate:modelValue":t[13]||(t[13]=function(t){e.tag.priority=t,e.setValueHasChanged()}),maxlength:4,title:e.translate("TagManager_Priority"),"inline-help":e.translate("TagManager_PriorityHelp"),placeholder:e.translate("TagManager_PriorityPlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",_i,[Object(r["createElementVNode"])("div",Di,[Object(r["createElementVNode"])("div",Ai,[Object(r["createElementVNode"])("div",xi,[Object(r["createElementVNode"])("label",Bi,Object(r["toDisplayString"])(e.translate("TagManager_StartDate"))+":",1)]),Object(r["createElementVNode"])("div",Li,[Object(r["createVNode"])(d,{name:"start_date","model-value":e.tag.start_date,"onUpdate:modelValue":t[14]||(t[14]=function(t){e.tag.start_date=t,e.setValueHasChanged()}),"default-time":"00:00:00"},null,8,["model-value"])])])]),Object(r["createElementVNode"])("div",Ui,[Object(r["createElementVNode"])("div",Pi,[Object(r["createElementVNode"])("span",Ii,[Object(r["createElementVNode"])("span",null,[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("TagManager_TagStartDateHelp","",""))},null,8,Fi),Hi,Object(r["createElementVNode"])("span",{class:"currentLocalTime",innerHTML:e.$sanitize(e.translate("TagManager_CurrentTimeInLocalTimezone","",e.currentTime,""))},null,8,Gi)])])])])]),Object(r["createElementVNode"])("div",$i,[Object(r["createElementVNode"])("div",Ri,[Object(r["createElementVNode"])("div",qi,[Object(r["createElementVNode"])("div",zi,[Object(r["createElementVNode"])("label",Wi,Object(r["toDisplayString"])(e.translate("TagManager_EndDate"))+":",1)]),Object(r["createElementVNode"])("div",Xi,[Object(r["createVNode"])(d,{name:"end_date","model-value":e.tag.end_date,"onUpdate:modelValue":t[15]||(t[15]=function(t){e.tag.end_date=t,e.setValueHasChanged()}),"default-time":"23:59:59"},null,8,["model-value"])])])]),Object(r["createElementVNode"])("div",Ki,[Object(r["createElementVNode"])("div",Ji,[Object(r["createElementVNode"])("span",Yi,[Object(r["createElementVNode"])("span",null,[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("TagManager_TagEndDateHelp","",""))},null,8,Zi),Qi,Object(r["createElementVNode"])("span",{class:"currentLocalTime",innerHTML:e.$sanitize(e.translate("TagManager_CurrentTimeInLocalTimezone","",e.currentTime,""))},null,8,er)])])])])])],512),[[r["vShow"],e.showAdvanced&&(null===(g=e.tag.typeMetadata)||void 0===g?void 0:g.hasAdvancedSettings)]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-warning"},Object(r["toDisplayString"])(e.translate("TagManager_UseCustomTemplateCapabilityRequired",e.translate("TagManager_CapabilityUseCustomTemplates"))),513),[[r["vShow"],e.isTagDisabled]]),Object(r["withDirectives"])(Object(r["createVNode"])(u,{class:"createButton",onConfirm:t[16]||(t[16]=function(t){return e.edit?e.updateTag():e.createTag()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.edit?e.translate("CoreUpdater_UpdateTitle"):e.translate("TagManager_CreateNewTag")},null,8,["disabled","saving","value"]),[[r["vShow"],!e.isTagDisabled]]),Object(r["createElementVNode"])("div",tr,[Object(r["createElementVNode"])("a",{onClick:t[17]||(t[17]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)])])],544),[[r["vShow"],!e.chooseTagType&&e.editTitle]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",nr,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.availableTags,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("ul",{class:"collection with-header",key:t.name},[Object(r["createElementVNode"])("li",ar,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(t.name),1)]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.types,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:n,class:Object(r["normalizeClass"])(["collection-item avatar",vi({disabledTemplate:e.isTagTemplateDisabled[t.id]},"templateType".concat(t.id),!0)]),onClick:function(n){return e.createTagType(t)},title:e.isTagTemplateDisabled[t.id]?e.collectionItemAvatarText:""},[t.icon?(Object(r["openBlock"])(),Object(r["createElementBlock"])("img",{key:0,alt:"",class:"circle",src:t.icon},null,8,rr)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("span",or,Object(r["toDisplayString"])(t.name),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(t.description),513),[[r["vShow"],t.description]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",lr,[Object(r["createElementVNode"])("i",{class:"icon-help",title:t.help},null,8,cr)],512),[[r["vShow"],!!t.help]])],10,ir)})),128))])})),128)),Object(r["createElementVNode"])("div",sr,[Object(r["createElementVNode"])("a",{onClick:t[19]||(t[19]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)])],512),[[r["vShow"],e.chooseTagType]])]})),_:1},8,["content-title"])],512)}function ur(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(e,t){for(var n=0;n-1){var t=this.trigger.conditions.length-1;t===e?this.trigger.conditions[e]=this.makeDefaultCondition():this.trigger.conditions.splice(e,1),this.isDirty=!0}},createTriggerType:function(e){var t,n=this;e&&this.isTriggerTemplateDisabled[e.id]||(this.chooseTriggerType=!1,this.editTitle=Object(u["translate"])("TagManager_CreateNewTrigger"),this.trigger={idsite:parseInt("".concat(u["Matomo"].idSite),10),name:Va.suggestNameForType(e.name)||"",description:"",type:e.id,idcontainerversion:this.idContainerVersion,conditions:[],typeMetadata:e},null!==(t=this.trigger.typeMetadata)&&void 0!==t&&t.name&&(this.editTitle+=": ".concat(this.trigger.typeMetadata.name)),this.parameterValues=Object.fromEntries(e.parameters.map((function(e){return[e.name,e.value]}))),this.addConditionEntry(),this.isDirty=!0,Object(r["nextTick"])((function(){if(n.$refs.root){var e=n.$refs.root;e.scrollIntoView();var t=e.querySelector("#name");t&&t.focus()}})))},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idTrigger,u["MatomoUrl"].updateHash(e)},createTrigger:function(){var e=this;this.removeAnyTriggerNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingTrigger=!0,Va.createOrUpdateTrigger(this.trigger,"TagManager.addContainerTrigger",this.idContainer,this.idContainerVersion,this.parameterValues).then((function(t){var n=t.value;e.isDirty=!1,Va.reload(e.idContainer,e.idContainerVersion).then((function(){if(e.isEmbedded)return e.trigger.idtrigger=n,void e.$emit("changeTrigger",{trigger:e.trigger});e.cancel(),setTimeout((function(){var t=Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Trigger")),n="";e.hasPublishCapability()&&(n=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(t," ").concat(n),"success")}),200)}))})).finally((function(){e.isUpdatingTrigger=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateTrigger:function(){var e=this;this.removeAnyTriggerNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingTrigger=!0,Va.createOrUpdateTrigger(this.trigger,"TagManager.updateContainerTrigger",this.idContainer,this.idContainerVersion,this.parameterValues).then((function(t){if(t){if(e.isEmbedded)return e.$emit("changeTrigger",{trigger:e.trigger}),void Va.reload(e.idContainer,e.idContainerVersion);e.isDirty=!1,Va.reload(e.idContainer,e.idContainerVersion).then((function(){e.initIdTrigger()})),e.cancel();var n=Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Trigger")),a="";e.hasPublishCapability()&&(a=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(n," ").concat(a),"success")}})).finally((function(){e.isUpdatingTrigger=!1})))},makeDefaultCondition:function(){var e,t="PageUrl";if(null!==(e=this.trigger)&&void 0!==e&&e.typeMetadata){var n=this.trigger.typeMetadata.id;Na[n]&&(t=Na[n])}return{comparison:"equals",actual:t,expected:""}},hasPublishCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_write")&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")}},computed:{isLoading:function(){return Va.isLoading.value||Ct.isLoading.value},isUpdating:function(){return Va.isUpdating.value||this.isUpdatingTrigger},create:function(){return 0===this.idTrigger},edit:function(){return!this.create},canUseCustomTemplates:function(){return u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},isTriggerDisabled:function(){var e;return!this.canUseCustomTemplates&&(null===(e=this.trigger.typeMetadata)||void 0===e?void 0:e.isCustomTemplate)},saveButtonText:function(){return this.edit?Object(u["translate"])("CoreUpdater_UpdateTitle"):Object(u["translate"])("TagManager_CreateNewTrigger")},collectionItemAvatarText:function(){return Object(u["translate"])("TagManager_UseCustomTemplateCapabilityRequired",Object(u["translate"])("TagManager_CapabilityUseCustomTemplates"))},triggerInlineHelpText:function(){return Object(u["translate"])("TagManager_TriggerConditionsHelpText",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/create-a-trigger-to-track-interactions-on-all-nested-elements/"),"")},availableComparisons:function(){return Ct.comparisonOptions.value},isTriggerTemplateDisabled:function(){var e=this,t={};return this.availableTriggers.forEach((function(n){n.types.forEach((function(n){t[n.id]=!e.canUseCustomTemplates&&n.isCustomTemplate}))})),t},triggerParameterValues:function(){var e;return null!==(e=this.trigger.typeMetadata)&&void 0!==e&&e.parameters?this.parameterValues:null}}});Ea.render=oa;var Sa=Ea,wa={class:"tagManagerManageList tagManagerTriggerList"},ka={class:"triggerSearchFilter"},Ma=["title"],_a=["title"],Da=["title"],Aa=["title"],xa=["title"],Ba=["title"],La={colspan:"7"},Ua={class:"loadingPiwik"},Pa=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Ia={colspan:"7"},Fa=["id"],Ha=["title"],Ga=["title"],$a=["title"],Ra={class:"conditions"},qa={class:"icon-ok"},za=["title"],Wa=["onClick","title"],Xa=["onClick","title"],Ka=["onClick","title"],Ja={class:"tableActionBar"},Ya=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Za={class:"ui-confirm",id:"confirmDeleteTrigger",ref:"confirmDeleteTrigger"},Qa=["value"],ei=["value"],ti={class:"ui-confirm",id:"confirmDeleteTriggerNotPossible",ref:"confirmDeleteTriggerNotPossible"},ni={class:"collection"},ai=["value"];function ii(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("ContentBlock"),s=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",wa,[Object(r["createVNode"])(c,{feature:"Tag Manager","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Triggers")),"help-text":e.triggersHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerUsageBenefits")),1),Object(r["createElementVNode"])("div",ka,[Object(r["withDirectives"])(Object(r["createVNode"])(l,{uicontrol:"text",name:"triggerSearch",title:e.translate("General_Search"),modelValue:e.triggerSearch,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.triggerSearch=t})},null,8,["title","modelValue"]),[[r["vShow"],e.triggers.length>0]])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",{class:"name",title:e.nameTranslatedText},Object(r["toDisplayString"])(e.translate("General_Name")),9,Ma),Object(r["createElementVNode"])("th",{class:"description",title:e.descriptionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Description")),9,_a),Object(r["createElementVNode"])("th",{class:"type",title:e.typeTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Type")),9,Da),Object(r["createElementVNode"])("th",{class:"conditions",title:e.filterTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Filter")),9,Aa),Object(r["createElementVNode"])("th",{class:"lastUpdated",title:e.lastUpdatedTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_LastUpdated")),9,xa),Object(r["withDirectives"])(Object(r["createElementVNode"])("th",{class:"action",title:e.actionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Actions")),9,Ba),[[r["vShow"],e.hasWriteAccess]])])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",La,[Object(r["createElementVNode"])("span",Ua,[Pa,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Ia,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoTriggersFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerTriggerNow",onClick:t[1]||(t[1]=function(t){return e.createTrigger()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTriggerNow")),513),[[r["vShow"],e.hasWriteAccess]])])],512),[[r["vShow"],!e.isLoading&&0===e.triggers.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedTriggers,(function(t){var n;return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{id:"trigger".concat(t.idtrigger),class:"triggers",key:t.idtrigger},[Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,Ha),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,Ga),Object(r["createElementVNode"])("td",{class:"type",title:t.typeMetadata.description},Object(r["toDisplayString"])(t.typeMetadata.name),9,$a),Object(r["createElementVNode"])("td",Ra,[Object(r["withDirectives"])(Object(r["createElementVNode"])("span",qa,null,512),[[r["vShow"],null===(n=t.conditions)||void 0===n?void 0:n.length]])]),Object(r["createElementVNode"])("td",{class:"lastUpdated",title:e.translate("TagManager_CreatedOnX",t.created_date_pretty)},[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.updated_date_pretty),1)],8,za),Object(r["withDirectives"])(Object(r["createElementVNode"])("td",{class:Object(r["normalizeClass"])(e.getActionClasses)},[Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editTrigger(t.idtrigger,t.type)},title:e.translate("TagManager_EditTrigger")},null,8,Wa),Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteTrigger(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Trigger"))},null,8,Xa),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-content-copy",onClick:function(n){return e.openCopyDialog(t)},title:e.translate("TagManager_CopyX",e.translate("TagManager_Trigger"))},null,8,Ka),[[r["vShow"],e.hasPublishCapability()]])],2),[[r["vShow"],e.hasWriteAccess]])],8,Fa)})),128))])],512),[[s]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Ja,[Object(r["createElementVNode"])("a",{class:"createNewTrigger",value:"",onClick:t[2]||(t[2]=function(t){return e.createTrigger()})},[Ya,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTrigger")),1)])],512),[[r["vShow"],e.hasWriteAccess]])]})),_:1},8,["content-title","help-text"]),Object(r["createElementVNode"])("div",Za,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteTriggerConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Qa),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,ei)],512),Object(r["createElementVNode"])("div",ti,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerCannotBeDeleted")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerBeingUsedBy")),1),Object(r["createElementVNode"])("ul",ni,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.triggerReferences,(function(e){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:"collection-item",key:e.referenceId},Object(r["toDisplayString"])(e.referenceTypeName)+": "+Object(r["toDisplayString"])(e.referenceName),1)})),128))]),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TriggerBeingUsedNeedsRemove")),1),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Cancel")},null,8,ai)],512)])}function ri(e){return si(e)||ci(e)||li(e)||oi()}function oi(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function li(e,t){if(e){if("string"===typeof e)return di(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?di(e,t):void 0}}function ci(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function si(e){if(Array.isArray(e))return di(e)}function di(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.name?1:0})),t},nameTranslatedText:function(){return this.translate("TagManager_TriggersNameDescription")},descriptionTranslatedText:function(){return this.translate("TagManager_TriggersDescriptionDescription")},typeTranslatedText:function(){return this.translate("TagManager_TriggersTypeDescription")},filterTranslatedText:function(){return this.translate("TagManager_TriggersFilterDescription")},lastUpdatedTranslatedText:function(){return this.translate("TagManager_TriggersLastUpdatedDescription")},actionTranslatedText:function(){return this.translate("TagManager_TriggersActionDescription")},getActionClasses:function(){var e=this.hasPublishCapability()?" hasCopyAction":"";return"action".concat(e)}}});bi.render=ii;var mi=bi,pi={class:"manageTrigger"};function hi(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("TriggerList"),c=Object(r["resolveComponent"])("TriggerEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",pi,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion,"triggers-help-text":e.triggersHelpText},null,8,["id-container","id-container-version","triggers-help-text"])])],512),[[r["vShow"],!e.editMode]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion,"id-trigger":e.idTrigger},null,8,["id-container","id-container-version","id-trigger"])])],512),[[r["vShow"],e.editMode]])])}var fi=Object(r["defineComponent"])({props:{idContainerVersion:Number,idContainer:String,triggersHelpText:String},components:{TriggerList:mi,TriggerEdit:Sa},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idTrigger}),(function(t){e.onIdTriggerParamChange(t)})),u["NotificationsStore"].remove("triggertriggermanagement"),this.onIdTriggerParamChange(u["MatomoUrl"].hashParsed.value.idTrigger)},methods:{onIdTriggerParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddTrigger",t),this.isAddAllowed=!!t.isAllowed}}},computed:{idTrigger:function(){var e=u["MatomoUrl"].hashParsed.value.idTrigger;return this.isAddAllowed||"0"!==e?e?parseInt(e,10):e:null},editMode:function(){return"number"===typeof this.idTrigger}}});fi.render=hi;var vi=fi;function ji(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Oi={class:"editTag tagManagerManageEdit",ref:"root"},Ti={class:"loadingPiwik"},yi=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Vi={class:"loadingPiwik"},Ci=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Ni={class:"form-group row"},Ei={class:"col s12"},Si={key:0},wi={class:"form-group row"},ki={class:"col s12"},Mi={class:"form-group row"},_i={class:"col s12"},Di={class:"form-group row tagStartDate"},Ai={class:"col s12 m6"},xi={class:"row"},Bi={class:"col s12"},Li={for:"start_date_date",class:"active"},Ui={class:"tagStartDate"},Pi={class:"col s12 m6 "},Ii={class:"form-help"},Fi={class:"inline-help"},Hi=["innerHTML"],Gi=Object(r["createElementVNode"])("br",null,null,-1),$i=["innerHTML"],Ri={class:"form-group row tagEndDate"},qi={class:"col s12 m6"},zi={class:"row"},Wi={class:"col s12"},Xi={for:"end_date_date",class:"active"},Ki={class:"tagEndDate"},Ji={class:"col s12 m6"},Yi={class:"form-help"},Zi={class:"inline-help"},Qi=["innerHTML"],er=Object(r["createElementVNode"])("br",null,null,-1),tr=["innerHTML"],nr={class:"entityCancel"},ar={id:"confirmSelectTagType"},ir={class:"collection-header"},rr=["onClick","title"],or=["src"],lr={class:"title"},cr={class:"secondary-content"},sr=["title"],dr={class:"entityCancel"};function ur(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("GroupedSettings"),s=Object(r["resolveComponent"])("TagTriggerArray"),d=Object(r["resolveComponent"])("TagDateInput"),u=Object(r["resolveComponent"])("SaveButton"),g=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Oi,[Object(r["createVNode"])(g,{feature:"Tag Manager","content-title":e.editTitle},{default:Object(r["withCtx"])((function(){var n,a,i,o,g;return[Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Ti,[yi,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[r["vShow"],e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Vi,[Ci,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_UpdatingData")),1)])],512),[[r["vShow"],e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("form",{onSubmit:t[18]||(t[18]=function(t){return e.edit?e.updateTag():e.createTag()})},[Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-warning"},Object(r["toDisplayString"])(e.translate("TagManager_UseCustomTemplateCapabilityRequired",e.translate("TagManager_CapabilityUseCustomTemplates"))),513),[[r["vShow"],e.isTagDisabled]]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"name","model-value":e.tag.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.tag.name=t,e.setValueHasChanged()}),maxlength:255,title:e.translate("General_Name"),"inline-help":e.tagNameHelpText,placeholder:e.translate("TagManager_TagNamePlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"textarea",name:"description","model-value":e.tag.description,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.tag.description=t,e.setValueHasChanged()}),maxlength:1e3,title:e.translate("TagManager_Description"),placeholder:e.translate("TagManager_TagDescriptionPlaceholder")},null,8,["model-value","title","placeholder"])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Ni,[Object(r["createElementVNode"])("div",Ei,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_ConfigureWhatTagDoes")),1)])],512),[[r["vShow"],null===(n=e.tag.typeMetadata)||void 0===n?void 0:n.parameters.length]]),e.tag?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Si,[Object(r["createVNode"])(c,{settings:(null===(a=e.tag.typeMetadata)||void 0===a?void 0:a.parameters)||[],"all-setting-values":e.parameterValues,onChange:t[2]||(t[2]=function(t){e.parameterValues[t.name]=t.value,e.setValueHasChanged()})},null,8,["settings","all-setting-values"])])):Object(r["createCommentVNode"])("",!0),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",wi,[Object(r["createElementVNode"])("div",ki,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_ConfigureWhenTagDoes")),1)])],512),[[r["vShow"],null===(i=e.tag.typeMetadata)||void 0===i?void 0:i.parameters.length]]),Object(r["createVNode"])(s,{"container-triggers":e.containerTriggers,type:"fire",title:e.translate("TagManager_FireTriggerTitle"),help:e.translate("TagManager_FireTriggerHelp",e.translate("TagManager_FireLimit")),"model-value":e.fireTriggers,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.fireTriggers=t,e.setValueHasChanged(),e.onFireTriggerChange()}),onCreate:t[4]||(t[4]=function(t){return e.onCreateNewFireTrigger()}),onEdit:t[5]||(t[5]=function(t){return e.editTrigger(t)})},null,8,["container-triggers","title","help","model-value"]),Object(r["createVNode"])(s,{"container-triggers":e.containerTriggers,type:"block",title:e.translate("TagManager_BlockTriggerTitle"),help:e.translate("TagManager_BlockTriggerHelp"),"model-value":e.blockTriggers,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.blockTriggers=t,e.setValueHasChanged(),e.onBlockTriggerChange()}),onCreate:t[7]||(t[7]=function(t){return e.onCreateNewBlockTrigger()}),onEdit:t[8]||(t[8]=function(t){return e.editTrigger(t)})},null,8,["container-triggers","title","help","model-value"]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Mi,[Object(r["createElementVNode"])("div",_i,[Object(r["createElementVNode"])("h3",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{href:"",class:"showAdvancedSettings",onClick:t[9]||(t[9]=Object(r["withModifiers"])((function(t){return e.showAdvanced=!0}),["prevent"]))},Object(r["toDisplayString"])(e.translate("TagManager_ShowAdvancedSettings")),513),[[r["vShow"],!e.showAdvanced]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{href:"",class:"hideAdvancedSettings",onClick:t[10]||(t[10]=Object(r["withModifiers"])((function(t){return e.showAdvanced=!1}),["prevent"]))},Object(r["toDisplayString"])(e.translate("TagManager_HideAdvancedSettings")),513),[[r["vShow"],e.showAdvanced]])])])],512),[[r["vShow"],null===(o=e.tag.typeMetadata)||void 0===o?void 0:o.hasAdvancedSettings]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"radio",name:"fire_limit","model-value":e.tag.fire_limit,"onUpdate:modelValue":t[11]||(t[11]=function(t){e.tag.fire_limit=t,e.setValueHasChanged()}),options:e.availableFireLimits,title:e.translate("TagManager_FireLimit"),"inline-help":e.fireLimitHelp},null,8,["model-value","options","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"fire_delay","model-value":e.tag.fire_delay,"onUpdate:modelValue":t[12]||(t[12]=function(t){e.tag.fire_delay=t,e.setValueHasChanged()}),maxlength:8,title:e.translate("TagManager_FireDelay"),"inline-help":e.translate("TagManager_FireDelayHelp"),placeholder:e.translate("TagManager_PlaceholderZero")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"priority","model-value":e.tag.priority,"onUpdate:modelValue":t[13]||(t[13]=function(t){e.tag.priority=t,e.setValueHasChanged()}),maxlength:4,title:e.translate("TagManager_Priority"),"inline-help":e.translate("TagManager_PriorityHelp"),placeholder:e.translate("TagManager_PriorityPlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",Di,[Object(r["createElementVNode"])("div",Ai,[Object(r["createElementVNode"])("div",xi,[Object(r["createElementVNode"])("div",Bi,[Object(r["createElementVNode"])("label",Li,Object(r["toDisplayString"])(e.translate("TagManager_StartDate"))+":",1)]),Object(r["createElementVNode"])("div",Ui,[Object(r["createVNode"])(d,{name:"start_date","model-value":e.tag.start_date,"onUpdate:modelValue":t[14]||(t[14]=function(t){e.tag.start_date=t,e.setValueHasChanged()}),"default-time":"00:00:00"},null,8,["model-value"])])])]),Object(r["createElementVNode"])("div",Pi,[Object(r["createElementVNode"])("div",Ii,[Object(r["createElementVNode"])("span",Fi,[Object(r["createElementVNode"])("span",null,[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("TagManager_TagStartDateHelp","",""))},null,8,Hi),Gi,Object(r["createElementVNode"])("span",{class:"currentLocalTime",innerHTML:e.$sanitize(e.translate("TagManager_CurrentTimeInLocalTimezone","",e.currentTime,""))},null,8,$i)])])])])]),Object(r["createElementVNode"])("div",Ri,[Object(r["createElementVNode"])("div",qi,[Object(r["createElementVNode"])("div",zi,[Object(r["createElementVNode"])("div",Wi,[Object(r["createElementVNode"])("label",Xi,Object(r["toDisplayString"])(e.translate("TagManager_EndDate"))+":",1)]),Object(r["createElementVNode"])("div",Ki,[Object(r["createVNode"])(d,{name:"end_date","model-value":e.tag.end_date,"onUpdate:modelValue":t[15]||(t[15]=function(t){e.tag.end_date=t,e.setValueHasChanged()}),"default-time":"23:59:59"},null,8,["model-value"])])])]),Object(r["createElementVNode"])("div",Ji,[Object(r["createElementVNode"])("div",Yi,[Object(r["createElementVNode"])("span",Zi,[Object(r["createElementVNode"])("span",null,[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("TagManager_TagEndDateHelp","",""))},null,8,Qi),er,Object(r["createElementVNode"])("span",{class:"currentLocalTime",innerHTML:e.$sanitize(e.translate("TagManager_CurrentTimeInLocalTimezone","",e.currentTime,""))},null,8,tr)])])])])])],512),[[r["vShow"],e.showAdvanced&&(null===(g=e.tag.typeMetadata)||void 0===g?void 0:g.hasAdvancedSettings)]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-warning"},Object(r["toDisplayString"])(e.translate("TagManager_UseCustomTemplateCapabilityRequired",e.translate("TagManager_CapabilityUseCustomTemplates"))),513),[[r["vShow"],e.isTagDisabled]]),Object(r["withDirectives"])(Object(r["createVNode"])(u,{class:"createButton",onConfirm:t[16]||(t[16]=function(t){return e.edit?e.updateTag():e.createTag()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.edit?e.translate("CoreUpdater_UpdateTitle"):e.translate("TagManager_CreateNewTag")},null,8,["disabled","saving","value"]),[[r["vShow"],!e.isTagDisabled]]),Object(r["createElementVNode"])("div",nr,[Object(r["createElementVNode"])("a",{onClick:t[17]||(t[17]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)])])],544),[[r["vShow"],!e.chooseTagType&&e.editTitle]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",ar,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.availableTags,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("ul",{class:"collection with-header",key:t.name},[Object(r["createElementVNode"])("li",ir,[Object(r["createElementVNode"])("h4",null,Object(r["toDisplayString"])(t.name),1)]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.types,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:n,class:Object(r["normalizeClass"])(["collection-item avatar",ji({disabledTemplate:e.isTagTemplateDisabled[t.id]},"templateType".concat(t.id),!0)]),onClick:function(n){return e.createTagType(t)},title:e.isTagTemplateDisabled[t.id]?e.collectionItemAvatarText:""},[t.icon?(Object(r["openBlock"])(),Object(r["createElementBlock"])("img",{key:0,alt:"",class:"circle",src:t.icon},null,8,or)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("span",lr,Object(r["toDisplayString"])(t.name),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(t.description),513),[[r["vShow"],t.description]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",cr,[Object(r["createElementVNode"])("i",{class:"icon-help",title:t.help},null,8,sr)],512),[[r["vShow"],!!t.help]])],10,rr)})),128))])})),128)),Object(r["createElementVNode"])("div",dr,[Object(r["createElementVNode"])("a",{onClick:t[19]||(t[19]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)])],512),[[r["vShow"],e.chooseTagType]])]})),_:1},8,["content-title"])],512)}function gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function br(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n-1){var t=this.blockTriggers.length-1;t===e?this.blockTriggers[e]=null:this.blockTriggers.splice(e,1),this.isDirty=!0}},onFireTriggerChange:function(){var e=this.fireTriggers.every((function(e){return!!e}));e&&this.addFireTrigger()},addFireTrigger:function(){this.fireTriggers.push(null),this.isDirty=!0},removeFireTrigger:function(e){if(e>-1){var t=this.fireTriggers.length-1;t===e?this.fireTriggers[e]=null:this.fireTriggers.splice(e,1),this.isDirty=!0}},createTagType:function(e){var t,n=this;e&&this.isTagTemplateDisabled[e.id]||(this.chooseTagType=!1,this.tag={idsite:parseInt("".concat(u["Matomo"].idSite),10),name:bo.suggestNameForType(e.name)||"",type:e.id,fire_limit:"unlimited",priority:"GoogleTag"===e.id||"GoogleAnalytics4"===e.id?1:999,fire_delay:0,typeMetadata:e},this.editTitle=Object(u["translate"])("TagManager_CreateNewTag"),null!==(t=this.tag.typeMetadata)&&void 0!==t&&t.name&&(this.editTitle+=": ".concat(this.tag.typeMetadata.name)),this.blockTriggers=[null],this.fireTriggers=[null],this.parameterValues=Object.fromEntries(e.parameters.map((function(e){return[e.name,e.value]}))),this.isDirty=!1,setTimeout((function(){var e=Vo(n.$refs.root);e.length&&e[0]&&e[0].scrollIntoView(),e.find("#name").focus()}),1))},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idTag,u["MatomoUrl"].updateHash(e)},createTag:function(){var e=this;this.removeAnyTagNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingTag=!0,bo.createOrUpdateTag(this.tag,"TagManager.addContainerTag",this.idContainer,this.idContainerVersion,this.parameterValues,this.fireTriggers.filter((function(e){return!!e})),this.blockTriggers.filter((function(e){return!!e}))).then((function(t){t&&(e.isDirty=!1,bo.reload(e.idContainer,e.idContainerVersion).then((function(){e.cancel(),setTimeout((function(){var t=Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Tag")),n="";e.hasPublishCapability()&&(n=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(t," ").concat(n),"success")}),200)})))})).finally((function(){e.isUpdatingTag=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateTag:function(){var e=this;this.removeAnyTagNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingTag=!0,bo.createOrUpdateTag(this.tag,"TagManager.updateContainerTag",this.idContainer,this.idContainerVersion,this.parameterValues,this.fireTriggers.filter((function(e){return!!e})),this.blockTriggers.filter((function(e){return!!e}))).then((function(t){if(t){e.isDirty=!1,bo.reload(e.idContainer,e.idContainerVersion).then((function(){e.initIdTag()})),e.cancel();var n=Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Tag")),a="";e.hasPublishCapability()&&(a=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(n," ").concat(a),"success")}})).finally((function(){e.isUpdatingTag=!1})))},checkRequiredFieldsAreSet:function(){if(!this.tag.name){var e=Object(u["translate"])("General_Name");return this.showErrorFieldNotProvidedNotification(e),!1}return!(!this.fireTriggers||!this.fireTriggers.length)||(this.showNotification(Object(u["translate"])("TagManager_TagFireTriggerRequirement"),"error"),!1)},hasPublishCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_write")&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")}},computed:{availableFireLimits:function(){return hr.fireLimitsOptions.value},isLoading:function(){return ya.isLoading.value||hr.isLoading.value},isUpdating:function(){return ya.isUpdating.value||this.isUpdatingTag},create:function(){return 0===this.idTag},edit:function(){return!this.create},canUseCustomTemplates:function(){return u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},isTagDisabled:function(){var e;return!this.canUseCustomTemplates&&(null===(e=this.tag.typeMetadata)||void 0===e?void 0:e.isCustomTemplate)},isTagTemplateDisabled:function(){var e=this,t={};return this.availableTags.forEach((function(n){n.types.forEach((function(n){t[n.id]=!e.canUseCustomTemplates&&n.isCustomTemplate}))})),t},collectionItemAvatarText:function(){return Object(u["translate"])("TagManager_UseCustomTemplateCapabilityRequired",Object(u["translate"])("TagManager_CapabilityUseCustomTemplates"))},fireLimitHelp:function(){return Object(u["translate"])("TagManager_FireLimitHelp",Object(u["translate"])("TagManager_Unlimited"),Object(u["translate"])("TagManager_OncePage"),Object(u["translate"])("TagManager_Once24Hours"),Object(u["translate"])("TagManager_OnceLifetime"))},tagNameHelpText:function(){var e="";return console.log(this.tag),"CustomHtml"===this.tag.type&&(e=Object(u["translate"])("TagManager_CustomHTMLTagNameInlineHelpText","
","",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/how-to-add-google-ads-remarketing-tags-in-matomo-tag-manager/"),"")),Object(u["translate"])("TagManager_TagNameHelpV2")+e}}});Eo.render=dr;var So=Eo,wo={class:"tagManagerManageList tagManagerTagList"},ko={class:"tagSearchFilter"},Mo=["title"],_o=["title"],Do=["title"],Ao=["title"],xo=["title"],Bo=["title"],Lo={colspan:"6"},Uo={class:"loadingPiwik"},Po=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Io={colspan:"6"},Fo=["id"],Ho=["title"],Go=["title"],$o=["title"],Ro={class:"triggers"},qo=["onClick","title"],zo=["title"],Wo=["onClick","title"],Xo=["title"],Ko=["title"],Jo=["onClick","title"],Yo=["onClick","title"],Zo=["onClick","title"],Qo=["onClick","title"],el=["onClick","title"],tl={class:"tableActionBar"},nl=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),al={class:"ui-confirm",id:"confirmDeleteTag",ref:"confirmDeleteTag"},il=["value"],rl=["value"],ol={class:"ui-confirm",id:"confirmPauseTag",ref:"confirmPauseTag"},ll=["value"],cl=["value"],sl={class:"ui-confirm",id:"confirmResumeTag",ref:"confirmResumeTag"},dl=["value"],ul=["value"];function gl(e,t,n,a,i,o){var l=this,c=Object(r["resolveComponent"])("Field"),s=Object(r["resolveComponent"])("ContentBlock"),d=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",wo,[Object(r["createVNode"])(s,{feature:"Tag Manager","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Tags")),"help-text":e.tagsHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TagUsageBenefits")),1),Object(r["createElementVNode"])("div",ko,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{uicontrol:"text",name:"tagSearch",title:e.translate("General_Search"),modelValue:e.tagSearch,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.tagSearch=t})},null,8,["title","modelValue"]),[[r["vShow"],e.tags.length>0]])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",{class:"name",title:e.nameTranslatedText},Object(r["toDisplayString"])(e.translate("General_Name")),9,Mo),Object(r["createElementVNode"])("th",{class:"description",title:e.descriptionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Description")),9,_o),Object(r["createElementVNode"])("th",{class:"type",title:e.typeTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Type")),9,Do),Object(r["createElementVNode"])("th",{class:"triggers",title:e.triggersTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Triggers")),9,Ao),Object(r["createElementVNode"])("th",{class:"lastUpdated",title:e.lastUpdatedTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_LastUpdated")),9,xo),Object(r["withDirectives"])(Object(r["createElementVNode"])("th",{class:"action",title:e.actionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Actions")),9,Bo),[[r["vShow"],e.hasWriteAccess]])])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Lo,[Object(r["createElementVNode"])("span",Uo,[Po,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Io,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoTagsFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerTagNow",onClick:t[1]||(t[1]=function(t){return e.createTag()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTagNow")),513),[[r["vShow"],e.hasWriteAccess]])])],512),[[r["vShow"],!e.isLoading&&0===e.tags.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedTags,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{class:"tags",key:t.idtag,id:"tag".concat(t.idtag)},[Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,Ho),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,Go),Object(r["createElementVNode"])("td",{class:"type",title:t.typeMetadata.description},Object(r["toDisplayString"])(t.typeMetadata.name),9,$o),Object(r["createElementVNode"])("td",Ro,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.fire_trigger_ids,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n,style:{"margin-right":"3.5px"}},[e.hasWriteAccess?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,style:{display:"inline-block","vertical-align":"top !important"},class:"chip",href:"",onClick:Object(r["withModifiers"])((function(n){return e.editTrigger(t)}),["prevent"]),title:l.triggers[t]},Object(r["toDisplayString"])(e.truncateText(l.triggers[t],e.triggerTruncateLength)),9,qo)):Object(r["createCommentVNode"])("",!0),e.hasWriteAccess?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:1,class:"chip",title:l.triggers[t]},Object(r["toDisplayString"])(e.truncateText(l.triggers[t],e.triggerTruncateLength)),9,zo))])})),128)),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Except"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.block_trigger_ids,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n,style:{"margin-right":"3.5px"}},[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"chip",href:"",onClick:Object(r["withModifiers"])((function(n){return e.editTrigger(t)}),["prevent"]),title:l.triggers[t]},Object(r["toDisplayString"])(e.truncateText(l.triggers[t],e.triggerTruncateLength)),9,Wo),[[r["vShow"],e.hasWriteAccess]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",{class:"chip",title:l.triggers[t]},Object(r["toDisplayString"])(e.truncateText(l.triggers[t],e.triggerTruncateLength)),9,Xo),[[r["vShow"],!e.hasWriteAccess]])])})),128))],512),[[r["vShow"],t.block_trigger_ids.length]])]),Object(r["createElementVNode"])("td",{class:"lastUpdated",title:e.translate("TagManager_CreatedOnX",t.created_date_pretty)},[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.updated_date_pretty),1)],8,Ko),Object(r["withDirectives"])(Object(r["createElementVNode"])("td",{class:Object(r["normalizeClass"])(e.getActionClasses)},[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-pause",onClick:function(n){return e.pauseTag(t)},title:e.translate("TagManager_PauseX",e.translate("TagManager_Tag"))},null,8,Jo),[[r["vShow"],"active"===t.status]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-play",onClick:function(n){return e.resumeTag(t)},title:e.translate("TagManager_ResumeX",e.translate("TagManager_Tag"))},null,8,Yo),[[r["vShow"],"paused"===t.status]]),Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editTag(t.idtag,t.type)},title:e.translate("TagManager_EditTag")},null,8,Zo),Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteTag(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Tag"))},null,8,Qo),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-content-copy",onClick:function(n){return e.openCopyDialog(t)},title:e.translate("TagManager_CopyX",e.translate("TagManager_Tag"))},null,8,el),[[r["vShow"],e.hasPublishCapability()]])],2),[[r["vShow"],e.hasWriteAccess]])],8,Fo)})),128))])],512),[[d]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",tl,[Object(r["createElementVNode"])("a",{class:"createNewTag",value:"",onClick:t[2]||(t[2]=function(t){return e.createTag()})},[nl,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTag")),1)])],512),[[r["vShow"],e.hasWriteAccess]])]})),_:1},8,["content-title","help-text"]),Object(r["createElementVNode"])("div",al,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteTagConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,il),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,rl)],512),Object(r["createElementVNode"])("div",ol,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_PauseTagConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,ll),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,cl)],512),Object(r["createElementVNode"])("div",sl,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_ResumeTagConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,dl),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,ul)],512)])}function ml(e){return fl(e)||hl(e)||pl(e)||bl()}function bl(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function pl(e,t){if(e){if("string"===typeof e)return vl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vl(e,t):void 0}}function hl(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function fl(e){if(Array.isArray(e))return vl(e)}function vl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n',"")),this.showNotification("".concat(n," ").concat(a),"success")},showNotification:function(e,t){var n=u["NotificationsStore"].show({message:e,context:t,id:Tl,type:"transient"});setTimeout((function(){u["NotificationsStore"].scrollToNotification(n)}),200)},openCopyDialog:function(e){var t=u["MatomoUrl"].stringify({module:"TagManager",action:"copyTagDialog",idSite:e.idsite,idContainer:this.idContainer,idTag:e.idtag,idContainerVersion:this.idContainerVersion});window.Piwik_Popover.createPopupAndLoadUrl(t,"","mtmCopyTag")}},computed:{triggers:function(){var e={};return ya.triggers.value.forEach((function(t){e["".concat(t.idtrigger)]=t.name})),e},isLoading:function(){return bo.isLoading.value},isUpdating:function(){return bo.isUpdating.value},tags:function(){return bo.tags.value},sortedTags:function(){var e=this,t=this.tagSearch.toLowerCase(),n=ml(this.tags).filter((function(n){return Object.keys(n).some((function(a){var i=n,r="";if("string"===typeof i[a])r=i[a];else if("typeMetadata"===a){var o=i.typeMetadata;r=o.name}else if("fire_trigger_ids"===a)e.triggers&&i.fire_trigger_ids&&Object.values(i.fire_trigger_ids).forEach((function(t){e.triggers[t]&&(r+="".concat(e.triggers[t]," "))}));else if("parameters"===a&&"CustomHtml"===i.type){var l=i.parameters;r=l.customHtml}return-1!==r.toLowerCase().indexOf(t)}))}));return n.sort((function(e,t){return e.namet.name?1:0})),n},nameTranslatedText:function(){return this.translate("TagManager_TagsNameDescription")},descriptionTranslatedText:function(){return this.translate("TagManager_TagsDescriptionDescription")},typeTranslatedText:function(){return this.translate("TagManager_TagsTypeDescription")},triggersTranslatedText:function(){return this.translate("TagManager_TagsTriggersDescription")},lastUpdatedTranslatedText:function(){return this.translate("TagManager_TagsLastUpdatedDescription")},actionTranslatedText:function(){return this.translate("TagManager_TagsActionDescription")},getActionClasses:function(){var e=this.hasPublishCapability()?" hasCopyAction":"";return"action".concat(e)}}});yl.render=gl;var Vl=yl,Cl={class:"manageTag"},Nl={key:0},El={key:1};function Sl(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("TagList"),c=Object(r["resolveComponent"])("TagEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Cl,[e.editMode?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Nl,[Object(r["createVNode"])(l,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion,"tags-help-text":e.tagsHelpText},null,8,["id-container","id-container-version","tags-help-text"])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",El,[Object(r["createVNode"])(c,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion,"id-tag":e.idTag},null,8,["id-container","id-container-version","id-tag"])])):Object(r["createCommentVNode"])("",!0)])}var wl=Object(r["defineComponent"])({props:{idContainerVersion:Number,idContainer:String,tagsHelpText:String},components:{TagList:Vl,TagEdit:So},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idTag}),(function(t){e.onIdTagParamChange(t)})),u["NotificationsStore"].remove("tagtagmanagement"),this.onIdTagParamChange(u["MatomoUrl"].hashParsed.value.idTag)},methods:{onIdTagParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddTag",t),this.isAddAllowed=!!t.isAllowed}}},computed:{idTag:function(){var e=u["MatomoUrl"].hashParsed.value.idTag;return this.isAddAllowed||"0"!==e?e?parseInt(e,10):e:null},editMode:function(){return"number"===typeof this.idTag}}});wl.render=Sl;var kl=wl,Ml={class:"editVersion tagManagerManageEdit"},_l={class:"loadingPiwik"},Dl=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Al={class:"loadingPiwik"},xl=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Bl={key:0},Ll={key:0},Ul={key:1},Pl=["innerHTML"],Il={key:2,class:"versionChanges"},Fl={key:0},Hl={colspan:"4"},Gl={key:1},$l={colspan:"4"},Rl={class:"lastUpdated"},ql={class:"entityCancel"};function zl(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("SaveButton"),s=Object(r["resolveComponent"])("ActivityIndicator"),d=Object(r["resolveComponent"])("ContentBlock"),u=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ml,[Object(r["createVNode"])(d,{feature:"Tag Manager","content-title":e.editTitle},{default:Object(r["withCtx"])((function(){var n;return[Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",_l,[Dl,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[r["vShow"],e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Al,[xl,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_UpdatingData")),1)])],512),[[r["vShow"],e.isUpdating]]),Object(r["createElementVNode"])("form",{onSubmit:t[6]||(t[6]=function(t){return e.edit?e.updateVersion():e.createVersion()})},[Object(r["createElementVNode"])("div",null,[e.hasPublishCapability()||e.hasWriteCapability()&&e.hasPublishToLiveCapability()?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Bl,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"name","inline-help":e.versionNameHelpText,"inline-help-bind":{lastVersion:e.lastVersion},"model-value":e.version.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.version.name=t,e.setValueHasChanged()}),maxlength:50,title:e.translate("TagManager_VersionName"),placeholder:e.translate("TagManager_VersionNamePlaceholder")},null,8,["inline-help","inline-help-bind","model-value","title","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"textarea",name:"description","model-value":e.version.description,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.version.description=t,e.setValueHasChanged()}),title:e.translate("TagManager_VersionDescriptionOptional"),"inline-help":e.translate("TagManager_VersionDescriptionHelp"),placeholder:e.translate("TagManager_VersionDescriptionPlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createVNode"])(c,{class:"createButton no-publish",onConfirm:t[2]||(t[2]=function(t){return e.edit?e.updateVersion():e.createVersion()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.edit?e.translate("CoreUpdater_UpdateTitle"):e.translate("TagManager_CreateVersionWithoutPublishing")},null,8,["disabled","saving","value"]),e.create&&e.environments.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ll,[Object(r["createVNode"])(l,{uicontrol:"select",name:"environment","inline-help":e.selectTagManagerEnvironmentHelp,"inline-help-bind":{canPublishToLive:e.canPublishToLive},"model-value":null===(n=e.version.environments)||void 0===n?void 0:n[0],"onUpdate:modelValue":t[3]||(t[3]=function(t){e.version.environments[0]=t,e.setValueHasChanged()}),options:e.environments,introduction:e.translate("TagManager_OrCreateAndPublishVersion"),title:e.translate("TagManager_Environment")},null,8,["inline-help","inline-help-bind","model-value","options","introduction","title"])])):Object(r["createCommentVNode"])("",!0),e.create&&e.environments.length?(Object(r["openBlock"])(),Object(r["createBlock"])(c,{key:1,class:"publishButton",onConfirm:t[4]||(t[4]=function(t){return e.createVersionAndPublish()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.translate("TagManager_CreateVersionAndPublishRelease")},null,8,["disabled","saving","value"])):Object(r["createCommentVNode"])("",!0)])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ul,[Object(r["createElementVNode"])("div",{class:"alert alert-warning",innerHTML:e.$sanitize(e.showNoAccessErrorMessage)},null,8,Pl)])),e.lastVersion?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Il,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_ChangesSinceLastVersion"))+":",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("SitesManager_Type")),1),Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("General_Name")),1),Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("TagManager_Change")),1),Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("TagManager_LastUpdated")),1)])]),Object(r["createElementVNode"])("tbody",null,[e.isLoadingVersionChanges?(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",Fl,[Object(r["createElementVNode"])("td",Hl,[Object(r["createVNode"])(s,{"loading-message":e.translate("TagManager_DetectingChanges"),loading:!0},null,8,["loading-message"])])])):Object(r["createCommentVNode"])("",!0),e.versionChanges.length||e.isLoadingVersionChanges?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",Gl,[Object(r["createElementVNode"])("td",$l,Object(r["toDisplayString"])(e.translate("UserCountryMap_None")),1)])),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.versionChanges,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:n},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.translate(t.entityType)),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(t.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.translate(t.type)),1),Object(r["createElementVNode"])("td",Rl,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.lastChanged),1)])])})),128))])],512),[[u]])])):Object(r["createCommentVNode"])("",!0),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",ql,[Object(r["createElementVNode"])("a",{onClick:t[5]||(t[5]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)],512),[[r["vShow"],!e.isEmbedded]])])],32)]})),_:1},8,["content-title"])])}function Wl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Xl(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n-1){var t=this.blockTriggers.length-1;t===e?this.blockTriggers[e]=null:this.blockTriggers.splice(e,1),this.isDirty=!0}},onFireTriggerChange:function(){var e=this.fireTriggers.every((function(e){return!!e}));e&&this.addFireTrigger()},addFireTrigger:function(){this.fireTriggers.push(null),this.isDirty=!0},removeFireTrigger:function(e){if(e>-1){var t=this.fireTriggers.length-1;t===e?this.fireTriggers[e]=null:this.fireTriggers.splice(e,1),this.isDirty=!0}},createTagType:function(e){var t,n=this;e&&this.isTagTemplateDisabled[e.id]||(this.chooseTagType=!1,this.tag={idsite:parseInt("".concat(u["Matomo"].idSite),10),name:po.suggestNameForType(e.name)||"",type:e.id,fire_limit:"unlimited",priority:"GoogleTag"===e.id||"GoogleAnalytics4"===e.id?1:999,fire_delay:0,typeMetadata:e},this.editTitle=Object(u["translate"])("TagManager_CreateNewTag"),null!==(t=this.tag.typeMetadata)&&void 0!==t&&t.name&&(this.editTitle+=": ".concat(this.tag.typeMetadata.name)),this.blockTriggers=[null],this.fireTriggers=[null],this.parameterValues=Object.fromEntries(e.parameters.map((function(e){return[e.name,e.value]}))),this.isDirty=!1,setTimeout((function(){var e=Co(n.$refs.root);e.length&&e[0]&&e[0].scrollIntoView(),e.find("#name").focus()}),1))},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idTag,u["MatomoUrl"].updateHash(e)},createTag:function(){var e=this;this.removeAnyTagNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingTag=!0,po.createOrUpdateTag(this.tag,"TagManager.addContainerTag",this.idContainer,this.idContainerVersion,this.parameterValues,this.fireTriggers.filter((function(e){return!!e})),this.blockTriggers.filter((function(e){return!!e}))).then((function(t){t&&(e.isDirty=!1,po.reload(e.idContainer,e.idContainerVersion).then((function(){e.cancel(),setTimeout((function(){var t=Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Tag")),n="";e.hasPublishCapability()&&(n=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(t," ").concat(n),"success")}),200)})))})).finally((function(){e.isUpdatingTag=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateTag:function(){var e=this;this.removeAnyTagNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingTag=!0,po.createOrUpdateTag(this.tag,"TagManager.updateContainerTag",this.idContainer,this.idContainerVersion,this.parameterValues,this.fireTriggers.filter((function(e){return!!e})),this.blockTriggers.filter((function(e){return!!e}))).then((function(t){if(t){e.isDirty=!1,po.reload(e.idContainer,e.idContainerVersion).then((function(){e.initIdTag()})),e.cancel();var n=Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Tag")),a="";e.hasPublishCapability()&&(a=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(n," ").concat(a),"success")}})).finally((function(){e.isUpdatingTag=!1})))},checkRequiredFieldsAreSet:function(){if(!this.tag.name){var e=Object(u["translate"])("General_Name");return this.showErrorFieldNotProvidedNotification(e),!1}return!(!this.fireTriggers||!this.fireTriggers.length)||(this.showNotification(Object(u["translate"])("TagManager_TagFireTriggerRequirement"),"error"),!1)},hasPublishCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_write")&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")}},computed:{availableFireLimits:function(){return fr.fireLimitsOptions.value},isLoading:function(){return Va.isLoading.value||fr.isLoading.value},isUpdating:function(){return Va.isUpdating.value||this.isUpdatingTag},create:function(){return 0===this.idTag},edit:function(){return!this.create},canUseCustomTemplates:function(){return u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},isTagDisabled:function(){var e;return!this.canUseCustomTemplates&&(null===(e=this.tag.typeMetadata)||void 0===e?void 0:e.isCustomTemplate)},isTagTemplateDisabled:function(){var e=this,t={};return this.availableTags.forEach((function(n){n.types.forEach((function(n){t[n.id]=!e.canUseCustomTemplates&&n.isCustomTemplate}))})),t},collectionItemAvatarText:function(){return Object(u["translate"])("TagManager_UseCustomTemplateCapabilityRequired",Object(u["translate"])("TagManager_CapabilityUseCustomTemplates"))},fireLimitHelp:function(){return Object(u["translate"])("TagManager_FireLimitHelp",Object(u["translate"])("TagManager_Unlimited"),Object(u["translate"])("TagManager_OncePage"),Object(u["translate"])("TagManager_Once24Hours"),Object(u["translate"])("TagManager_OnceLifetime"))},tagNameHelpText:function(){var e="";return console.log(this.tag),"CustomHtml"===this.tag.type&&(e=Object(u["translate"])("TagManager_CustomHTMLTagNameInlineHelpText","
","",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/how-to-add-google-ads-remarketing-tags-in-matomo-tag-manager/"),"")),Object(u["translate"])("TagManager_TagNameHelpV2")+e}}});So.render=ur;var wo=So,ko={class:"tagManagerManageList tagManagerTagList"},Mo={class:"tagSearchFilter"},_o=["title"],Do=["title"],Ao=["title"],xo=["title"],Bo=["title"],Lo=["title"],Uo={colspan:"6"},Po={class:"loadingPiwik"},Io=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Fo={colspan:"6"},Ho=["id"],Go=["title"],$o=["title"],Ro=["title"],qo={class:"triggers"},zo=["onClick","title"],Wo=["title"],Xo=["onClick","title"],Ko=["title"],Jo=["title"],Yo=["onClick","title"],Zo=["onClick","title"],Qo=["onClick","title"],el=["onClick","title"],tl=["onClick","title"],nl={class:"tableActionBar"},al=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),il={class:"ui-confirm",id:"confirmDeleteTag",ref:"confirmDeleteTag"},rl=["value"],ol=["value"],ll={class:"ui-confirm",id:"confirmPauseTag",ref:"confirmPauseTag"},cl=["value"],sl=["value"],dl={class:"ui-confirm",id:"confirmResumeTag",ref:"confirmResumeTag"},ul=["value"],gl=["value"];function bl(e,t,n,a,i,o){var l=this,c=Object(r["resolveComponent"])("Field"),s=Object(r["resolveComponent"])("ContentBlock"),d=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ko,[Object(r["createVNode"])(s,{feature:"Tag Manager","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Tags")),"help-text":e.tagsHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_TagUsageBenefits")),1),Object(r["createElementVNode"])("div",Mo,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{uicontrol:"text",name:"tagSearch",title:e.translate("General_Search"),modelValue:e.tagSearch,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.tagSearch=t})},null,8,["title","modelValue"]),[[r["vShow"],e.tags.length>0]])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",{class:"name",title:e.nameTranslatedText},Object(r["toDisplayString"])(e.translate("General_Name")),9,_o),Object(r["createElementVNode"])("th",{class:"description",title:e.descriptionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Description")),9,Do),Object(r["createElementVNode"])("th",{class:"type",title:e.typeTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Type")),9,Ao),Object(r["createElementVNode"])("th",{class:"triggers",title:e.triggersTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Triggers")),9,xo),Object(r["createElementVNode"])("th",{class:"lastUpdated",title:e.lastUpdatedTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_LastUpdated")),9,Bo),Object(r["withDirectives"])(Object(r["createElementVNode"])("th",{class:"action",title:e.actionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Actions")),9,Lo),[[r["vShow"],e.hasWriteAccess]])])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Uo,[Object(r["createElementVNode"])("span",Po,[Io,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Fo,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoTagsFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerTagNow",onClick:t[1]||(t[1]=function(t){return e.createTag()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTagNow")),513),[[r["vShow"],e.hasWriteAccess]])])],512),[[r["vShow"],!e.isLoading&&0===e.tags.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedTags,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{class:"tags",key:t.idtag,id:"tag".concat(t.idtag)},[Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,Go),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,$o),Object(r["createElementVNode"])("td",{class:"type",title:t.typeMetadata.description},Object(r["toDisplayString"])(t.typeMetadata.name),9,Ro),Object(r["createElementVNode"])("td",qo,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.fire_trigger_ids,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n,style:{"margin-right":"3.5px"}},[e.hasWriteAccess?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,style:{display:"inline-block","vertical-align":"top !important"},class:"chip",href:"",onClick:Object(r["withModifiers"])((function(n){return e.editTrigger(t)}),["prevent"]),title:l.triggers[t]},Object(r["toDisplayString"])(e.truncateText(l.triggers[t],e.triggerTruncateLength)),9,zo)):Object(r["createCommentVNode"])("",!0),e.hasWriteAccess?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:1,class:"chip",title:l.triggers[t]},Object(r["toDisplayString"])(e.truncateText(l.triggers[t],e.triggerTruncateLength)),9,Wo))])})),128)),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Except"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.block_trigger_ids,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n,style:{"margin-right":"3.5px"}},[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"chip",href:"",onClick:Object(r["withModifiers"])((function(n){return e.editTrigger(t)}),["prevent"]),title:l.triggers[t]},Object(r["toDisplayString"])(e.truncateText(l.triggers[t],e.triggerTruncateLength)),9,Xo),[[r["vShow"],e.hasWriteAccess]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",{class:"chip",title:l.triggers[t]},Object(r["toDisplayString"])(e.truncateText(l.triggers[t],e.triggerTruncateLength)),9,Ko),[[r["vShow"],!e.hasWriteAccess]])])})),128))],512),[[r["vShow"],t.block_trigger_ids.length]])]),Object(r["createElementVNode"])("td",{class:"lastUpdated",title:e.translate("TagManager_CreatedOnX",t.created_date_pretty)},[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.updated_date_pretty),1)],8,Jo),Object(r["withDirectives"])(Object(r["createElementVNode"])("td",{class:Object(r["normalizeClass"])(e.getActionClasses)},[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-pause",onClick:function(n){return e.pauseTag(t)},title:e.translate("TagManager_PauseX",e.translate("TagManager_Tag"))},null,8,Yo),[[r["vShow"],"active"===t.status]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-play",onClick:function(n){return e.resumeTag(t)},title:e.translate("TagManager_ResumeX",e.translate("TagManager_Tag"))},null,8,Zo),[[r["vShow"],"paused"===t.status]]),Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editTag(t.idtag,t.type)},title:e.translate("TagManager_EditTag")},null,8,Qo),Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteTag(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Tag"))},null,8,el),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-content-copy",onClick:function(n){return e.openCopyDialog(t)},title:e.translate("TagManager_CopyX",e.translate("TagManager_Tag"))},null,8,tl),[[r["vShow"],e.hasPublishCapability()]])],2),[[r["vShow"],e.hasWriteAccess]])],8,Ho)})),128))])],512),[[d]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",nl,[Object(r["createElementVNode"])("a",{class:"createNewTag",value:"",onClick:t[2]||(t[2]=function(t){return e.createTag()})},[al,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTag")),1)])],512),[[r["vShow"],e.hasWriteAccess]])]})),_:1},8,["content-title","help-text"]),Object(r["createElementVNode"])("div",il,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteTagConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,rl),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,ol)],512),Object(r["createElementVNode"])("div",ll,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_PauseTagConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,cl),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,sl)],512),Object(r["createElementVNode"])("div",dl,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_ResumeTagConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,ul),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,gl)],512)])}function ml(e){return vl(e)||fl(e)||hl(e)||pl()}function pl(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function hl(e,t){if(e){if("string"===typeof e)return jl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jl(e,t):void 0}}function fl(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function vl(e){if(Array.isArray(e))return jl(e)}function jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n',"")),this.showNotification("".concat(n," ").concat(a),"success")},showNotification:function(e,t){var n=u["NotificationsStore"].show({message:e,context:t,id:yl,type:"transient"});setTimeout((function(){u["NotificationsStore"].scrollToNotification(n)}),200)},openCopyDialog:function(e){var t=u["MatomoUrl"].stringify({module:"TagManager",action:"copyTagDialog",idSite:e.idsite,idContainer:this.idContainer,idTag:e.idtag,idContainerVersion:this.idContainerVersion});window.Piwik_Popover.createPopupAndLoadUrl(t,"","mtmCopyTag")}},computed:{triggers:function(){var e={};return Va.triggers.value.forEach((function(t){e["".concat(t.idtrigger)]=t.name})),e},isLoading:function(){return po.isLoading.value},isUpdating:function(){return po.isUpdating.value},tags:function(){return po.tags.value},sortedTags:function(){var e=this,t=this.tagSearch.toLowerCase(),n=ml(this.tags).filter((function(n){return Object.keys(n).some((function(a){var i=n,r="";if("string"===typeof i[a])r=i[a];else if("typeMetadata"===a){var o=i.typeMetadata;r=o.name}else if("fire_trigger_ids"===a)e.triggers&&i.fire_trigger_ids&&Object.values(i.fire_trigger_ids).forEach((function(t){e.triggers[t]&&(r+="".concat(e.triggers[t]," "))}));else if("parameters"===a&&"CustomHtml"===i.type){var l=i.parameters;r=l.customHtml}return-1!==r.toLowerCase().indexOf(t)}))}));return n.sort((function(e,t){return e.namet.name?1:0})),n},nameTranslatedText:function(){return this.translate("TagManager_TagsNameDescription")},descriptionTranslatedText:function(){return this.translate("TagManager_TagsDescriptionDescription")},typeTranslatedText:function(){return this.translate("TagManager_TagsTypeDescription")},triggersTranslatedText:function(){return this.translate("TagManager_TagsTriggersDescription")},lastUpdatedTranslatedText:function(){return this.translate("TagManager_TagsLastUpdatedDescription")},actionTranslatedText:function(){return this.translate("TagManager_TagsActionDescription")},getActionClasses:function(){var e=this.hasPublishCapability()?" hasCopyAction":"";return"action".concat(e)}}});Vl.render=bl;var Cl=Vl,Nl={class:"manageTag"},El={key:0},Sl={key:1};function wl(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("TagList"),c=Object(r["resolveComponent"])("TagEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Nl,[e.editMode?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",El,[Object(r["createVNode"])(l,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion,"tags-help-text":e.tagsHelpText},null,8,["id-container","id-container-version","tags-help-text"])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Sl,[Object(r["createVNode"])(c,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion,"id-tag":e.idTag},null,8,["id-container","id-container-version","id-tag"])])):Object(r["createCommentVNode"])("",!0)])}var kl=Object(r["defineComponent"])({props:{idContainerVersion:Number,idContainer:String,tagsHelpText:String},components:{TagList:Cl,TagEdit:wo},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idTag}),(function(t){e.onIdTagParamChange(t)})),u["NotificationsStore"].remove("tagtagmanagement"),this.onIdTagParamChange(u["MatomoUrl"].hashParsed.value.idTag)},methods:{onIdTagParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddTag",t),this.isAddAllowed=!!t.isAllowed}}},computed:{idTag:function(){var e=u["MatomoUrl"].hashParsed.value.idTag;return this.isAddAllowed||"0"!==e?e?parseInt(e,10):e:null},editMode:function(){return"number"===typeof this.idTag}}});kl.render=wl;var Ml=kl,_l={class:"editVersion tagManagerManageEdit"},Dl={class:"loadingPiwik"},Al=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),xl={class:"loadingPiwik"},Bl=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Ll={key:0},Ul={key:0},Pl={key:1},Il=["innerHTML"],Fl={key:2,class:"versionChanges"},Hl={key:0},Gl={colspan:"4"},$l={key:1},Rl={colspan:"4"},ql={class:"lastUpdated"},zl={class:"entityCancel"};function Wl(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("SaveButton"),s=Object(r["resolveComponent"])("ActivityIndicator"),d=Object(r["resolveComponent"])("ContentBlock"),u=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",_l,[Object(r["createVNode"])(d,{feature:"Tag Manager","content-title":e.editTitle},{default:Object(r["withCtx"])((function(){var n;return[Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Dl,[Al,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[r["vShow"],e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",xl,[Bl,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_UpdatingData")),1)])],512),[[r["vShow"],e.isUpdating]]),Object(r["createElementVNode"])("form",{onSubmit:t[6]||(t[6]=function(t){return e.edit?e.updateVersion():e.createVersion()})},[Object(r["createElementVNode"])("div",null,[e.hasPublishCapability()||e.hasWriteCapability()&&e.hasPublishToLiveCapability()?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ll,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"name","inline-help":e.versionNameHelpText,"inline-help-bind":{lastVersion:e.lastVersion},"model-value":e.version.name,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.version.name=t,e.setValueHasChanged()}),maxlength:50,title:e.translate("TagManager_VersionName"),placeholder:e.translate("TagManager_VersionNamePlaceholder")},null,8,["inline-help","inline-help-bind","model-value","title","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"textarea",name:"description","model-value":e.version.description,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.version.description=t,e.setValueHasChanged()}),title:e.translate("TagManager_VersionDescriptionOptional"),"inline-help":e.translate("TagManager_VersionDescriptionHelp"),placeholder:e.translate("TagManager_VersionDescriptionPlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createVNode"])(c,{class:"createButton no-publish",onConfirm:t[2]||(t[2]=function(t){return e.edit?e.updateVersion():e.createVersion()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.edit?e.translate("CoreUpdater_UpdateTitle"):e.translate("TagManager_CreateVersionWithoutPublishing")},null,8,["disabled","saving","value"]),e.create&&e.environments.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ul,[Object(r["createVNode"])(l,{uicontrol:"select",name:"environment","inline-help":e.selectTagManagerEnvironmentHelp,"inline-help-bind":{canPublishToLive:e.canPublishToLive},"model-value":null===(n=e.version.environments)||void 0===n?void 0:n[0],"onUpdate:modelValue":t[3]||(t[3]=function(t){e.version.environments[0]=t,e.setValueHasChanged()}),options:e.environments,introduction:e.translate("TagManager_OrCreateAndPublishVersion"),title:e.translate("TagManager_Environment")},null,8,["inline-help","inline-help-bind","model-value","options","introduction","title"])])):Object(r["createCommentVNode"])("",!0),e.create&&e.environments.length?(Object(r["openBlock"])(),Object(r["createBlock"])(c,{key:1,class:"publishButton",onConfirm:t[4]||(t[4]=function(t){return e.createVersionAndPublish()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.translate("TagManager_CreateVersionAndPublishRelease")},null,8,["disabled","saving","value"])):Object(r["createCommentVNode"])("",!0)])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Pl,[Object(r["createElementVNode"])("div",{class:"alert alert-warning",innerHTML:e.$sanitize(e.showNoAccessErrorMessage)},null,8,Il)])),e.lastVersion?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Fl,[Object(r["createElementVNode"])("h3",null,Object(r["toDisplayString"])(e.translate("TagManager_ChangesSinceLastVersion"))+":",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("SitesManager_Type")),1),Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("General_Name")),1),Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("TagManager_Change")),1),Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("TagManager_LastUpdated")),1)])]),Object(r["createElementVNode"])("tbody",null,[e.isLoadingVersionChanges?(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",Hl,[Object(r["createElementVNode"])("td",Gl,[Object(r["createVNode"])(s,{"loading-message":e.translate("TagManager_DetectingChanges"),loading:!0},null,8,["loading-message"])])])):Object(r["createCommentVNode"])("",!0),e.versionChanges.length||e.isLoadingVersionChanges?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",$l,[Object(r["createElementVNode"])("td",Rl,Object(r["toDisplayString"])(e.translate("UserCountryMap_None")),1)])),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.versionChanges,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:n},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.translate(t.entityType)),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(t.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.translate(t.type)),1),Object(r["createElementVNode"])("td",ql,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.lastChanged),1)])])})),128))])],512),[[u]])])):Object(r["createCommentVNode"])("",!0),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",zl,[Object(r["createElementVNode"])("a",{onClick:t[5]||(t[5]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)],512),[[r["vShow"],!e.isEmbedded]])])],32)]})),_:1},8,["content-title"])])}function Xl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kl(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);n".concat(e.lastVersion,"")))},null,8,Nc),[[r["vShow"],e.lastVersion]])])}var Sc=Object(r["defineComponent"])({props:{lastVersion:String}});Sc.render=Ec;var wc=Sc,kc={id:"selectTagManagerEnvironmentHelp",class:"inline-help-node"};function Mc(e,t,n,a,i,o){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",kc,[Object(r["createElementVNode"])("div",null,Object(r["toDisplayString"])(e.translate("TagManager_VersionEnvironmentHelp")),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-info",style:{"margin-bottom":"0","padding-bottom":"0"}},Object(r["toDisplayString"])(e.translate("TagManager_PublishLiveEnvironmentCapabilityRequired",e.translate("TagManager_CapabilityPublishLiveContainer"))),513),[[r["vShow"],!e.canPublishToLive]])])}var _c=Object(r["defineComponent"])({props:{canPublishToLive:Boolean}});_c.render=Mc;var Dc=_c;function Ac(e){return Uc(e)||Lc(e)||Bc(e)||xc()}function xc(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Bc(e,t){if(e){if("string"===typeof e)return Pc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Pc(e,t):void 0}}function Lc(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Uc(e){if(Array.isArray(e))return Pc(e)}function Pc(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n=n.length-1||t.idcontainerversion===e.idContainerVersion&&n[i+1]&&(e.lastVersion=u["Matomo"].helper.htmlEntities(n[i+1].name),a=n[i+1].idcontainerversion)})),e.lastVersion&&(e.isLoadingVersionChanges=!0,sc(e.idContainer,e.idContainerVersion,a).then((function(t){t.sort((function(e,t){return new Date(t.lastChanged).valueOf()-new Date(e.lastChanged).valueOf()})),e.versionChanges=t,e.isLoadingVersionChanges=!1})),e.create&&!e.version.name&&/^\d+$/.test(e.lastVersion)&&(e.version.name="".concat(parseInt(e.lastVersion,10)+1),e.isDirty=!0))}})),u["Matomo"].helper.lazyScrollToContent(),this.edit&&this.idContainerVersion)Tc.findVersion(this.idContainer,this.idContainerVersion).then((function(t){t&&(e.version=Object(u["clone"])(t),e.isDirty=!1)}));else if(this.create){if(this.version={idSite:u["Matomo"].idSite,idcontainer:this.idContainer,name:"",description:""},this.canPublishToLive)this.version.environments=["live"];else{var t=this.environments.find((function(e){return"live"!==e.key}));this.version.environments=t?[t.key]:[]}this.isDirty=!1}},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idContainerVersion,u["MatomoUrl"].updateHash(e)},createVersion:function(){var e=this;this.removeAnyVersionNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVersion=!0,Tc.createOrUpdateVersion(this.version,"TagManager.createContainerVersion",this.idContainer).then((function(t){if(t){e.isDirty=!1;var n=t.value;if(e.isEmbedded)return e.version.idcontainerversion=n,void e.$emit("changeVersion",{version:e.version});Tc.reload(e.idContainer).then((function(){u["MatomoUrl"].updateHash(Object.assign(Object.assign({},u["MatomoUrl"].hashParsed.value),{},{idContainerVersion:n})),setTimeout((function(){var t=Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Version")),n="";e.hasPublishCapability()&&(n=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(t," ").concat(n),"success")}),200)}))}})).finally((function(){e.isUpdatingVersion=!1})))},createVersionAndPublish:function(){var e=this;this.removeAnyVersionNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVersion=!0,Tc.createOrUpdateVersion(this.version,"TagManager.createContainerVersion",this.idContainer).then((function(t){if(!t)return null;var n=t.value;return e.version.idcontainerversion=n,Tc.publishVersion(e.idContainer,n,e.version.environments[0]).then((function(){e.isDirty=!1,e.isEmbedded?e.$emit("changeVersion",{version:e.version}):Tc.reload(e.idContainer).then((function(){u["MatomoUrl"].updateHash(Object.assign(Object.assign({},u["MatomoUrl"].hashParsed.value),{},{idContainerVersion:n})),setTimeout((function(){e.showNotification(Object(u["translate"])("TagManager_VersionPublishSuccess"),"success")}),200)}))}))})).finally((function(){e.isUpdatingVersion=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateVersion:function(){var e=this;this.removeAnyVersionNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVersion=!0,Tc.createOrUpdateVersion(this.version,"TagManager.updateContainerVersion",this.idContainer).then((function(t){t&&(e.isEmbedded?e.$emit("changeVersion",{version:e.version}):(e.isDirty=!1,e.version={},Tc.reload(e.idContainer).then((function(){e.initIdContainerVersion()})),e.showNotification(Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Version")),"success")))})).finally((function(){e.isUpdatingVersion=!1})))},checkRequiredFieldsAreSet:function(){if(!this.version.name){var e=Object(u["translate"])("General_Name");return this.showErrorFieldNotProvidedNotification(e),!1}return!0},hasPublishCapability:function(){return this.hasWriteCapability()&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},hasWriteCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_write")},hasPublishToLiveCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_publish_live_container")}},computed:{create:function(){return 0===this.idContainerVersion},edit:function(){return!this.create},isLoading:function(){return ft.isLoading.value||Vt.isLoading.value},isUpdating:function(){return ft.isUpdating.value||this.isUpdatingVersion},environments:function(){var e=Zl.environmentsWithPublishOptions.value;if(!this.canPublishToLive){var t=e.findIndex((function(e){return"live"===e.key}));t>-1&&(e[t].disabled=!0)}return e},canPublishToLive:function(){return u["Matomo"].hasUserCapability("tagmanager_publish_live_container")},versionNameHelpText:function(){return Object(r["markRaw"])(wc)},selectTagManagerEnvironmentHelp:function(){return Object(r["markRaw"])(Dc)},editTitle:function(){return this.create?Object(u["translate"])("TagManager_CreateNewVersion"):Object(u["translate"])("TagManager_EditVersion")},showNoAccessErrorMessage:function(){return Object(u["translate"])("TagManager_VersionEditWithNoAccessMessage",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/faq_26547/"),"")}}});Fc.render=zl;var Hc=Fc,Gc={class:"tagManagerManageList tagManagerVersionList"},$c={class:"versionSearchFilter"},Rc=["title"],qc=["title"],zc=["title"],Wc=["title"],Xc=["title"],Kc=["title"],Jc={colspan:"7"},Yc={class:"loadingPiwik"},Zc=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Qc={colspan:"7"},es=["id"],ts={class:"index"},ns=["title"],as=["title"],is={class:"environments"},rs=["title"],os={class:"created"},ls={class:"action"},cs=["onClick","title"],ss=["onClick","title"],ds=["onClick","href","title"],us=["onClick","title"],gs=["onClick","title"],ms={class:"tableActionBar"},bs=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),ps=["href"],hs=Object(r["createElementVNode"])("span",{class:"icon-export"}," ",-1),fs=Object(r["createElementVNode"])("span",{class:"icon-upload"}," ",-1),vs={class:"ui-confirm",id:"confirmDeleteVersion",ref:"confirmDeleteVersion"},js=["value"],Os=["value"],Ts={class:"ui-confirm",id:"confirmPublishVersion",ref:"confirmPublishVersion"},ys={key:0,class:"alert alert-info",style:{"margin-top":"16px"}},Vs=["value"],Cs=["value"];function Ns(e,t,n,a,i,o){var l,c=Object(r["resolveComponent"])("Field"),s=Object(r["resolveComponent"])("ContentBlock"),d=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Gc,[Object(r["createVNode"])(s,{feature:"Tag Manager","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Versions")),"help-text":e.versionsHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VersionUsageBenefits"))+" "+Object(r["toDisplayString"])(e.translate("TagManager_ConfigureEnvironmentsSuperUser")),1),Object(r["createElementVNode"])("div",$c,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{uicontrol:"text",name:"versionSearch",title:e.translate("General_Search"),modelValue:e.versionSearch,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.versionSearch=t})},null,8,["title","modelValue"]),[[r["vShow"],e.versions.length>0]])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",{class:"index",title:e.revisionTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Revision")),9,Rc),Object(r["createElementVNode"])("th",{class:"name",title:e.nameTranslatedText},Object(r["toDisplayString"])(e.translate("General_Name")),9,qc),Object(r["createElementVNode"])("th",{class:"description",title:e.descriptionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Description")),9,zc),Object(r["createElementVNode"])("th",{class:"environments",title:e.environmentTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Environments")),9,Wc),Object(r["createElementVNode"])("th",{class:"created",title:e.createdTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Created")),9,Xc),Object(r["createElementVNode"])("th",{class:"action",title:e.actionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Actions")),9,Kc)])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Jc,[Object(r["createElementVNode"])("span",Yc,[Zc,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Qc,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoVersionsFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerVersionNow",onClick:t[1]||(t[1]=function(t){return e.createVersion()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVersionNow")),513),[[r["vShow"],e.hasWriteAccess&&e.hasCustomTemplatesCapability]])])],512),[[r["vShow"],!e.isLoading&&0===e.versions.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedVersions,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{id:"version".concat(t.idcontainerversion),class:"versions",key:t.revision},[Object(r["createElementVNode"])("td",ts,Object(r["toDisplayString"])(t.revision),1),Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,ns),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,as),Object(r["createElementVNode"])("td",is,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.releases,(function(n,a){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:a,title:e.translate("TagManager_ReleaseInfo",n.release_login,n.release_date_pretty)},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.ucfirst(n.environment)),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,", ",512),[[r["vShow"],a!==t.releases.length-1]])],8,rs)})),128))]),Object(r["createElementVNode"])("td",os,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.created_date_pretty),1)]),Object(r["createElementVNode"])("td",ls,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-rocket",onClick:function(n){return e.publishVersion(t)},title:e.translate("TagManager_PublishVersion",t.name)},null,8,cs),[[r["vShow"],e.hasWriteAccess&&(e.hasCustomTemplatesCapability||e.canPublishToLive)]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-bug",onClick:function(n){return e.enableDebugMode(t.idcontainerversion)},title:e.translate("TagManager_EnablePreviewDebug")},null,8,ss),[[r["vShow"],e.hasWriteAccess]]),Object(r["createElementVNode"])("a",{target:"_blank",class:"table-action icon-export",onClick:Object(r["withModifiers"])((function(n){e.exportVersion(t.idcontainerversion,t.name)}),["prevent"]),href:e.getExportUrl(t),title:e.translate("TagManager_ExportX",e.translate("TagManager_Version"))},null,8,ds),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editVersion(t.idcontainerversion)},title:e.translate("TagManager_EditX",e.translate("TagManager_Version"))},null,8,us),[[r["vShow"],e.hasWriteAccess]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteVersion(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Version"))},null,8,gs),[[r["vShow"],0===t.releases.length&&e.hasWriteAccess&&e.hasCustomTemplatesCapability]])])],8,es)})),128))])],512),[[d]]),Object(r["createElementVNode"])("div",ms,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createNewVersion",onClick:t[2]||(t[2]=function(t){return e.createVersion()})},[bs,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVersion")),1)],512),[[r["vShow"],e.hasWriteAccess&&e.hasCustomTemplatesCapability]]),Object(r["createElementVNode"])("a",{class:"exportDraft",target:"_blank",onClick:t[3]||(t[3]=function(t){e.exportVersion(null,"draft"),t.preventDefault()}),href:e.getExportDraftUrl()},[hs,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_ExportDraft")),1)],8,ps),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"importVersion",onClick:t[4]||(t[4]=function(t){return e.importVersion()})},[fs,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Import")),1)],512),[[r["vShow"],e.hasWriteAccess&&e.hasCustomTemplatesCapability]])])]})),_:1},8,["content-title","help-text"]),Object(r["createElementVNode"])("div",vs,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteVersionConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,js),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,Os)],512),Object(r["createElementVNode"])("div",Ts,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_PublishVersion",null===(l=e.versionToBePublished)||void 0===l?void 0:l.name)),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{uicontrol:"select",name:"environment",modelValue:e.availableEnvironmentsToPublish.deployEnvironment,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.availableEnvironmentsToPublish.deployEnvironment=t}),options:e.availableEnvironmentsToPublish.environnments,"full-width":!0,title:e.translate("TagManager_Environment")},null,8,["modelValue","options","title"])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{style:{"margin-bottom":"0"},class:"alert alert-info"},Object(r["toDisplayString"])(e.translate("TagManager_PublishLiveEnvironmentCapabilityRequired",e.translate("TagManager_CapabilityPublishLiveContainer"))),513),[[r["vShow"],!e.canPublishToLive]])],512),[[r["vShow"],e.availableEnvironmentsToPublish.environnments.length]]),e.availableEnvironmentsToPublish.environnments.length?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ys,Object(r["toDisplayString"])(e.translate("TagManager_VersionAlreadyPublishedToAllEnvironments")),1)),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("TagManager_PublishRelease")},null,8,Vs),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Cancel")},null,8,Cs)],512)])}function Es(e){return Ms(e)||ks(e)||ws(e)||Ss()}function Ss(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ws(e,t){if(e){if("string"===typeof e)return _s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_s(e,t):void 0}}function ks(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ms(e){if(Array.isArray(e))return _s(e)}function _s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.revision?0:1})),t},hasWriteAccess:function(){return u["Matomo"].hasUserCapability("tagmanager_write")},hasCustomTemplatesCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},canPublishToLive:function(){return u["Matomo"].hasUserCapability("tagmanager_publish_live_container")},revisionTranslatedText:function(){return this.translate("TagManager_VersionsRevisionDescription")},nameTranslatedText:function(){return this.translate("TagManager_VersionsNameDescription")},descriptionTranslatedText:function(){return this.translate("TagManager_VersionsDescriptionDescription")},environmentTranslatedText:function(){return this.translate("TagManager_VersionsEnvironmentsDescription")},createdTranslatedText:function(){return this.translate("TagManager_VersionsCreatedDescription")},actionTranslatedText:function(){return this.translate("TagManager_VersionsActionDescription")}}});xs.render=Ns;var Bs=xs,Ls={class:"manageVersion"},Us={key:0},Ps={key:1};function Is(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("VersionList"),c=Object(r["resolveComponent"])("VersionEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ls,[e.editMode?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Us,[Object(r["createVNode"])(l,{"id-container":e.idContainer,"versions-help-text":e.versionsHelpText},null,8,["id-container","versions-help-text"])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ps,[Object(r["createVNode"])(c,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion},null,8,["id-container","id-container-version"])])):Object(r["createCommentVNode"])("",!0)])}var Fs=Object(r["defineComponent"])({props:{idContainer:String,versionsHelpText:String},components:{VersionList:Bs,VersionEdit:Hc},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idContainerVersion}),(function(t){e.onIdContainerVersionParamChange(t)})),u["NotificationsStore"].remove("versiontagmanagement"),this.onIdContainerVersionParamChange(u["MatomoUrl"].hashParsed.value.idContainerVersion)},methods:{onIdContainerVersionParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddVersion",t),this.isAddAllowed=!!t.isAllowed}}},computed:{idContainerVersion:function(){var e=u["MatomoUrl"].hashParsed.value.idContainerVersion;return this.isAddAllowed||"0"!==e?e?parseInt(e,10):e:null},editMode:function(){return"number"===typeof this.idContainerVersion}}});Fs.render=Is;var Hs=Fs,Gs={class:"loadingPiwik"},$s=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Rs={class:"loadingPiwik"},qs=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),zs={class:"entityCancel"};function Ws(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("SaveButton"),s=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createBlock"])(s,{class:"editContainer tagManagerManageEdit",feature:"Tag Manager","content-title":e.editTitle},{default:Object(r["withCtx"])((function(){return[Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Gs,[$s,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[r["vShow"],e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",Rs,[qs,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_UpdatingData")),1)])],512),[[r["vShow"],e.isUpdating]]),Object(r["createElementVNode"])("form",{onSubmit:t[8]||(t[8]=function(t){return e.edit?e.updateContainer():e.createContainer()})},[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createVNode"])(l,{uicontrol:"text",name:"idcontainer","model-value":e.container.idcontainer,disabled:!0,title:e.translate("General_Id")},null,8,["model-value","title"]),[[r["vShow"],e.edit]])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"select",name:"context","model-value":e.container.context,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.container.context=t,e.setValueHasChanged()}),disabled:!0,options:e.contexts,title:e.translate("TagManager_Context"),"inline-help":e.translate("TagManager_ContainerContextHelp")},null,8,["model-value","options","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"name","model-value":e.container.name,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.container.name=t,e.setValueHasChanged()}),maxlength:255,title:e.translate("General_Name"),"inline-help":e.translate("TagManager_ContainerNameHelp"),placeholder:e.translate("TagManager_ContainerNamePlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"textarea",name:"description","model-value":e.container.description,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.container.description=t,e.setValueHasChanged()}),title:e.translate("TagManager_Description"),"inline-help":e.translate("TagManager_ContainerDescriptionHelp"),placeholder:e.translate("TagManager_ContainerDescriptionPlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"checkbox",name:"ignoreGtmDataLayer","model-value":e.container.ignoreGtmDataLayer,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.container.ignoreGtmDataLayer=t,e.setValueHasChanged()}),title:e.translate("TagManager_IgnoreGtmDataLaterTitle"),"inline-help":e.translate("TagManager_IgnoreGtmDataLaterDescription")},null,8,["model-value","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"checkbox",name:"activelySyncGtmDataLayer","model-value":e.container.activelySyncGtmDataLayer,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.container.activelySyncGtmDataLayer=t,e.setValueHasChanged()}),title:e.translate("TagManager_ActivelySyncGtmDataLayerTitle"),"inline-help":e.translate("TagManager_ActivelySyncGtmDataLayerDescription")},null,8,["model-value","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"checkbox",name:"isTagFireLimitAllowedInPreviewMode","model-value":e.container.isTagFireLimitAllowedInPreviewMode,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.container.isTagFireLimitAllowedInPreviewMode=t,e.setValueHasChanged()}),title:e.translate("TagManager_TagFireLimitAllowedInPreviewModeTitle"),"inline-help":e.translate("TagManager_TagFireLimitAllowedInPreviewModeDescription")},null,8,["model-value","title","inline-help"])]),Object(r["createVNode"])(c,{class:"createButton",onConfirm:t[6]||(t[6]=function(t){return e.edit?e.updateContainer():e.createContainer()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.edit?e.translate("CoreUpdater_UpdateTitle"):e.translate("TagManager_CreateNewContainer")},null,8,["disabled","saving","value"]),Object(r["createElementVNode"])("div",zs,[Object(r["createElementVNode"])("a",{onClick:t[7]||(t[7]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)])])],32)]})),_:1},8,["content-title"])}function Xs(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ks(e,t){for(var n=0;n".concat(e.lastVersion,"")))},null,8,Ec),[[r["vShow"],e.lastVersion]])])}var wc=Object(r["defineComponent"])({props:{lastVersion:String}});wc.render=Sc;var kc=wc,Mc={id:"selectTagManagerEnvironmentHelp",class:"inline-help-node"};function _c(e,t,n,a,i,o){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Mc,[Object(r["createElementVNode"])("div",null,Object(r["toDisplayString"])(e.translate("TagManager_VersionEnvironmentHelp")),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{class:"alert alert-info",style:{"margin-bottom":"0","padding-bottom":"0"}},Object(r["toDisplayString"])(e.translate("TagManager_PublishLiveEnvironmentCapabilityRequired",e.translate("TagManager_CapabilityPublishLiveContainer"))),513),[[r["vShow"],!e.canPublishToLive]])])}var Dc=Object(r["defineComponent"])({props:{canPublishToLive:Boolean}});Dc.render=_c;var Ac=Dc;function xc(e){return Pc(e)||Uc(e)||Lc(e)||Bc()}function Bc(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Lc(e,t){if(e){if("string"===typeof e)return Ic(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ic(e,t):void 0}}function Uc(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Pc(e){if(Array.isArray(e))return Ic(e)}function Ic(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n=n.length-1||t.idcontainerversion===e.idContainerVersion&&n[i+1]&&(e.lastVersion=u["Matomo"].helper.htmlEntities(n[i+1].name),a=n[i+1].idcontainerversion)})),e.lastVersion&&(e.isLoadingVersionChanges=!0,dc(e.idContainer,e.idContainerVersion,a).then((function(t){t.sort((function(e,t){return new Date(t.lastChanged).valueOf()-new Date(e.lastChanged).valueOf()})),e.versionChanges=t,e.isLoadingVersionChanges=!1})),e.create&&!e.version.name&&/^\d+$/.test(e.lastVersion)&&(e.version.name="".concat(parseInt(e.lastVersion,10)+1),e.isDirty=!0))}})),u["Matomo"].helper.lazyScrollToContent(),this.edit&&this.idContainerVersion)yc.findVersion(this.idContainer,this.idContainerVersion).then((function(t){t&&(e.version=Object(u["clone"])(t),e.isDirty=!1)}));else if(this.create){if(this.version={idSite:u["Matomo"].idSite,idcontainer:this.idContainer,name:"",description:""},this.canPublishToLive)this.version.environments=["live"];else{var t=this.environments.find((function(e){return"live"!==e.key}));this.version.environments=t?[t.key]:[]}this.isDirty=!1}},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idContainerVersion,u["MatomoUrl"].updateHash(e)},createVersion:function(){var e=this;this.removeAnyVersionNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVersion=!0,yc.createOrUpdateVersion(this.version,"TagManager.createContainerVersion",this.idContainer).then((function(t){if(t){e.isDirty=!1;var n=t.value;if(e.isEmbedded)return e.version.idcontainerversion=n,void e.$emit("changeVersion",{version:e.version});yc.reload(e.idContainer).then((function(){u["MatomoUrl"].updateHash(Object.assign(Object.assign({},u["MatomoUrl"].hashParsed.value),{},{idContainerVersion:n})),setTimeout((function(){var t=Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Version")),n="";e.hasPublishCapability()&&(n=Object(u["translate"])("TagManager_WantToDeployThisChangeCreateVersion",'',"")),e.showNotification("".concat(t," ").concat(n),"success")}),200)}))}})).finally((function(){e.isUpdatingVersion=!1})))},createVersionAndPublish:function(){var e=this;this.removeAnyVersionNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVersion=!0,yc.createOrUpdateVersion(this.version,"TagManager.createContainerVersion",this.idContainer).then((function(t){if(!t)return null;var n=t.value;return e.version.idcontainerversion=n,yc.publishVersion(e.idContainer,n,e.version.environments[0]).then((function(){e.isDirty=!1,e.isEmbedded?e.$emit("changeVersion",{version:e.version}):yc.reload(e.idContainer).then((function(){u["MatomoUrl"].updateHash(Object.assign(Object.assign({},u["MatomoUrl"].hashParsed.value),{},{idContainerVersion:n})),setTimeout((function(){e.showNotification(Object(u["translate"])("TagManager_VersionPublishSuccess"),"success")}),200)}))}))})).finally((function(){e.isUpdatingVersion=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateVersion:function(){var e=this;this.removeAnyVersionNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVersion=!0,yc.createOrUpdateVersion(this.version,"TagManager.updateContainerVersion",this.idContainer).then((function(t){t&&(e.isEmbedded?e.$emit("changeVersion",{version:e.version}):(e.isDirty=!1,e.version={},yc.reload(e.idContainer).then((function(){e.initIdContainerVersion()})),e.showNotification(Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Version")),"success")))})).finally((function(){e.isUpdatingVersion=!1})))},checkRequiredFieldsAreSet:function(){if(!this.version.name){var e=Object(u["translate"])("General_Name");return this.showErrorFieldNotProvidedNotification(e),!1}return!0},hasPublishCapability:function(){return this.hasWriteCapability()&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},hasWriteCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_write")},hasPublishToLiveCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_publish_live_container")}},computed:{create:function(){return 0===this.idContainerVersion},edit:function(){return!this.create},isLoading:function(){return vt.isLoading.value||Ct.isLoading.value},isUpdating:function(){return vt.isUpdating.value||this.isUpdatingVersion},environments:function(){var e=Ql.environmentsWithPublishOptions.value;if(!this.canPublishToLive){var t=e.findIndex((function(e){return"live"===e.key}));t>-1&&(e[t].disabled=!0)}return e},canPublishToLive:function(){return u["Matomo"].hasUserCapability("tagmanager_publish_live_container")},versionNameHelpText:function(){return Object(r["markRaw"])(kc)},selectTagManagerEnvironmentHelp:function(){return Object(r["markRaw"])(Ac)},editTitle:function(){return this.create?Object(u["translate"])("TagManager_CreateNewVersion"):Object(u["translate"])("TagManager_EditVersion")},showNoAccessErrorMessage:function(){return Object(u["translate"])("TagManager_VersionEditWithNoAccessMessage",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/faq_26547/"),"")}}});Hc.render=Wl;var Gc=Hc,$c={class:"tagManagerManageList tagManagerVersionList"},Rc={class:"versionSearchFilter"},qc=["title"],zc=["title"],Wc=["title"],Xc=["title"],Kc=["title"],Jc=["title"],Yc={colspan:"7"},Zc={class:"loadingPiwik"},Qc=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),es={colspan:"7"},ts=["id"],ns={class:"index"},as=["title"],is=["title"],rs={class:"environments"},os=["title"],ls={class:"created"},cs={class:"action"},ss=["onClick","title"],ds=["onClick","title"],us=["onClick","href","title"],gs=["onClick","title"],bs=["onClick","title"],ms={class:"tableActionBar"},ps=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),hs=["href"],fs=Object(r["createElementVNode"])("span",{class:"icon-export"}," ",-1),vs=Object(r["createElementVNode"])("span",{class:"icon-upload"}," ",-1),js={class:"ui-confirm",id:"confirmDeleteVersion",ref:"confirmDeleteVersion"},Os=["value"],Ts=["value"],ys={class:"ui-confirm",id:"confirmPublishVersion",ref:"confirmPublishVersion"},Vs={key:0,class:"alert alert-info",style:{"margin-top":"16px"}},Cs=["value"],Ns=["value"];function Es(e,t,n,a,i,o){var l,c=Object(r["resolveComponent"])("Field"),s=Object(r["resolveComponent"])("ContentBlock"),d=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",$c,[Object(r["createVNode"])(s,{feature:"Tag Manager","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Versions")),"help-text":e.versionsHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_VersionUsageBenefits"))+" "+Object(r["toDisplayString"])(e.translate("TagManager_ConfigureEnvironmentsSuperUser")),1),Object(r["createElementVNode"])("div",Rc,[Object(r["withDirectives"])(Object(r["createVNode"])(c,{uicontrol:"text",name:"versionSearch",title:e.translate("General_Search"),modelValue:e.versionSearch,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.versionSearch=t})},null,8,["title","modelValue"]),[[r["vShow"],e.versions.length>0]])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",{class:"index",title:e.revisionTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Revision")),9,qc),Object(r["createElementVNode"])("th",{class:"name",title:e.nameTranslatedText},Object(r["toDisplayString"])(e.translate("General_Name")),9,zc),Object(r["createElementVNode"])("th",{class:"description",title:e.descriptionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Description")),9,Wc),Object(r["createElementVNode"])("th",{class:"environments",title:e.environmentTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Environments")),9,Xc),Object(r["createElementVNode"])("th",{class:"created",title:e.createdTranslatedText},Object(r["toDisplayString"])(e.translate("TagManager_Created")),9,Kc),Object(r["createElementVNode"])("th",{class:"action",title:e.actionTranslatedText},Object(r["toDisplayString"])(e.translate("General_Actions")),9,Jc)])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Yc,[Object(r["createElementVNode"])("span",Zc,[Qc,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",es,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoVersionsFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerVersionNow",onClick:t[1]||(t[1]=function(t){return e.createVersion()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVersionNow")),513),[[r["vShow"],e.hasWriteAccess&&e.hasCustomTemplatesCapability]])])],512),[[r["vShow"],!e.isLoading&&0===e.versions.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedVersions,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{id:"version".concat(t.idcontainerversion),class:"versions",key:t.revision},[Object(r["createElementVNode"])("td",ns,Object(r["toDisplayString"])(t.revision),1),Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,as),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,is),Object(r["createElementVNode"])("td",rs,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(t.releases,(function(n,a){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:a,title:e.translate("TagManager_ReleaseInfo",n.release_login,n.release_date_pretty)},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.ucfirst(n.environment)),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,", ",512),[[r["vShow"],a!==t.releases.length-1]])],8,os)})),128))]),Object(r["createElementVNode"])("td",ls,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.created_date_pretty),1)]),Object(r["createElementVNode"])("td",cs,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-rocket",onClick:function(n){return e.publishVersion(t)},title:e.translate("TagManager_PublishVersion",t.name)},null,8,ss),[[r["vShow"],e.hasWriteAccess&&(e.hasCustomTemplatesCapability||e.canPublishToLive)]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-bug",onClick:function(n){return e.enableDebugMode(t.idcontainerversion)},title:e.translate("TagManager_EnablePreviewDebug")},null,8,ds),[[r["vShow"],e.hasWriteAccess]]),Object(r["createElementVNode"])("a",{target:"_blank",class:"table-action icon-export",onClick:Object(r["withModifiers"])((function(n){e.exportVersion(t.idcontainerversion,t.name)}),["prevent"]),href:e.getExportUrl(t),title:e.translate("TagManager_ExportX",e.translate("TagManager_Version"))},null,8,us),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editVersion(t.idcontainerversion)},title:e.translate("TagManager_EditX",e.translate("TagManager_Version"))},null,8,gs),[[r["vShow"],e.hasWriteAccess]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteVersion(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Version"))},null,8,bs),[[r["vShow"],0===t.releases.length&&e.hasWriteAccess&&e.hasCustomTemplatesCapability]])])],8,ts)})),128))])],512),[[d]]),Object(r["createElementVNode"])("div",ms,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createNewVersion",onClick:t[2]||(t[2]=function(t){return e.createVersion()})},[ps,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVersion")),1)],512),[[r["vShow"],e.hasWriteAccess&&e.hasCustomTemplatesCapability]]),Object(r["createElementVNode"])("a",{class:"exportDraft",target:"_blank",onClick:t[3]||(t[3]=function(t){e.exportVersion(null,"draft"),t.preventDefault()}),href:e.getExportDraftUrl()},[fs,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_ExportDraft")),1)],8,hs),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"importVersion",onClick:t[4]||(t[4]=function(t){return e.importVersion()})},[vs,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Import")),1)],512),[[r["vShow"],e.hasWriteAccess&&e.hasCustomTemplatesCapability]])])]})),_:1},8,["content-title","help-text"]),Object(r["createElementVNode"])("div",js,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteVersionConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Os),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,Ts)],512),Object(r["createElementVNode"])("div",ys,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_PublishVersion",null===(l=e.versionToBePublished)||void 0===l?void 0:l.name)),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{uicontrol:"select",name:"environment",modelValue:e.availableEnvironmentsToPublish.deployEnvironment,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.availableEnvironmentsToPublish.deployEnvironment=t}),options:e.availableEnvironmentsToPublish.environnments,"full-width":!0,title:e.translate("TagManager_Environment")},null,8,["modelValue","options","title"])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",{style:{"margin-bottom":"0"},class:"alert alert-info"},Object(r["toDisplayString"])(e.translate("TagManager_PublishLiveEnvironmentCapabilityRequired",e.translate("TagManager_CapabilityPublishLiveContainer"))),513),[[r["vShow"],!e.canPublishToLive]])],512),[[r["vShow"],e.availableEnvironmentsToPublish.environnments.length]]),e.availableEnvironmentsToPublish.environnments.length?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Vs,Object(r["toDisplayString"])(e.translate("TagManager_VersionAlreadyPublishedToAllEnvironments")),1)),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("TagManager_PublishRelease")},null,8,Cs),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_Cancel")},null,8,Ns)],512)])}function Ss(e){return _s(e)||Ms(e)||ks(e)||ws()}function ws(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ks(e,t){if(e){if("string"===typeof e)return Ds(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ds(e,t):void 0}}function Ms(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _s(e){if(Array.isArray(e))return Ds(e)}function Ds(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.revision?0:1})),t},hasWriteAccess:function(){return u["Matomo"].hasUserCapability("tagmanager_write")},hasCustomTemplatesCapability:function(){return u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},canPublishToLive:function(){return u["Matomo"].hasUserCapability("tagmanager_publish_live_container")},revisionTranslatedText:function(){return this.translate("TagManager_VersionsRevisionDescription")},nameTranslatedText:function(){return this.translate("TagManager_VersionsNameDescription")},descriptionTranslatedText:function(){return this.translate("TagManager_VersionsDescriptionDescription")},environmentTranslatedText:function(){return this.translate("TagManager_VersionsEnvironmentsDescription")},createdTranslatedText:function(){return this.translate("TagManager_VersionsCreatedDescription")},actionTranslatedText:function(){return this.translate("TagManager_VersionsActionDescription")}}});Bs.render=Es;var Ls=Bs,Us={class:"manageVersion"},Ps={key:0},Is={key:1};function Fs(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("VersionList"),c=Object(r["resolveComponent"])("VersionEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Us,[e.editMode?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ps,[Object(r["createVNode"])(l,{"id-container":e.idContainer,"versions-help-text":e.versionsHelpText},null,8,["id-container","versions-help-text"])])),e.editMode?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Is,[Object(r["createVNode"])(c,{"id-container":e.idContainer,"id-container-version":e.idContainerVersion},null,8,["id-container","id-container-version"])])):Object(r["createCommentVNode"])("",!0)])}var Hs=Object(r["defineComponent"])({props:{idContainer:String,versionsHelpText:String},components:{VersionList:Ls,VersionEdit:Gc},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idContainerVersion}),(function(t){e.onIdContainerVersionParamChange(t)})),u["NotificationsStore"].remove("versiontagmanagement"),this.onIdContainerVersionParamChange(u["MatomoUrl"].hashParsed.value.idContainerVersion)},methods:{onIdContainerVersionParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddVersion",t),this.isAddAllowed=!!t.isAllowed}}},computed:{idContainerVersion:function(){var e=u["MatomoUrl"].hashParsed.value.idContainerVersion;return this.isAddAllowed||"0"!==e?e?parseInt(e,10):e:null},editMode:function(){return"number"===typeof this.idContainerVersion}}});Hs.render=Fs;var Gs=Hs,$s={class:"loadingPiwik"},Rs=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),qs={class:"loadingPiwik"},zs=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Ws={class:"entityCancel"};function Xs(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("SaveButton"),s=Object(r["resolveComponent"])("ContentBlock");return Object(r["openBlock"])(),Object(r["createBlock"])(s,{class:"editContainer tagManagerManageEdit",feature:"Tag Manager","content-title":e.editTitle},{default:Object(r["withCtx"])((function(){return[Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",$s,[Rs,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])],512),[[r["vShow"],e.isLoading]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("span",qs,[zs,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_UpdatingData")),1)])],512),[[r["vShow"],e.isUpdating]]),Object(r["createElementVNode"])("form",{onSubmit:t[8]||(t[8]=function(t){return e.edit?e.updateContainer():e.createContainer()})},[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createVNode"])(l,{uicontrol:"text",name:"idcontainer","model-value":e.container.idcontainer,disabled:!0,title:e.translate("General_Id")},null,8,["model-value","title"]),[[r["vShow"],e.edit]])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"select",name:"context","model-value":e.container.context,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.container.context=t,e.setValueHasChanged()}),disabled:!0,options:e.contexts,title:e.translate("TagManager_Context"),"inline-help":e.translate("TagManager_ContainerContextHelp")},null,8,["model-value","options","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"text",name:"name","model-value":e.container.name,"onUpdate:modelValue":t[1]||(t[1]=function(t){e.container.name=t,e.setValueHasChanged()}),maxlength:255,title:e.translate("General_Name"),"inline-help":e.translate("TagManager_ContainerNameHelp"),placeholder:e.translate("TagManager_ContainerNamePlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"textarea",name:"description","model-value":e.container.description,"onUpdate:modelValue":t[2]||(t[2]=function(t){e.container.description=t,e.setValueHasChanged()}),title:e.translate("TagManager_Description"),"inline-help":e.translate("TagManager_ContainerDescriptionHelp"),placeholder:e.translate("TagManager_ContainerDescriptionPlaceholder")},null,8,["model-value","title","inline-help","placeholder"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"checkbox",name:"ignoreGtmDataLayer","model-value":e.container.ignoreGtmDataLayer,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.container.ignoreGtmDataLayer=t,e.setValueHasChanged()}),title:e.translate("TagManager_IgnoreGtmDataLaterTitle"),"inline-help":e.translate("TagManager_IgnoreGtmDataLaterDescription")},null,8,["model-value","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"checkbox",name:"activelySyncGtmDataLayer","model-value":e.container.activelySyncGtmDataLayer,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.container.activelySyncGtmDataLayer=t,e.setValueHasChanged()}),title:e.translate("TagManager_ActivelySyncGtmDataLayerTitle"),"inline-help":e.translate("TagManager_ActivelySyncGtmDataLayerDescription")},null,8,["model-value","title","inline-help"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"checkbox",name:"isTagFireLimitAllowedInPreviewMode","model-value":e.container.isTagFireLimitAllowedInPreviewMode,"onUpdate:modelValue":t[5]||(t[5]=function(t){e.container.isTagFireLimitAllowedInPreviewMode=t,e.setValueHasChanged()}),title:e.translate("TagManager_TagFireLimitAllowedInPreviewModeTitle"),"inline-help":e.translate("TagManager_TagFireLimitAllowedInPreviewModeDescription")},null,8,["model-value","title","inline-help"])]),Object(r["createVNode"])(c,{class:"createButton",onConfirm:t[6]||(t[6]=function(t){return e.edit?e.updateContainer():e.createContainer()}),disabled:e.isUpdating||!e.isDirty,saving:e.isUpdating,value:e.edit?e.translate("CoreUpdater_UpdateTitle"):e.translate("TagManager_CreateNewContainer")},null,8,["disabled","saving","value"]),Object(r["createElementVNode"])("div",Ws,[Object(r["createElementVNode"])("a",{onClick:t[7]||(t[7]=function(t){return e.cancel()})},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)])])],32)]})),_:1},8,["content-title"])}function Ks(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Js(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);ne.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.created_date?-1:0})),e},getManageContainersIntro:function(){var e=Object(u["externalLink"])("https://matomo.org/guide/tag-manager/getting-started-with-tag-manager/");return Object(u["translate"])("TagManager_ManageContainersIntro",e,"")},canCopyContainer:function(){return u["Matomo"].hasUserCapability("tagmanager_write")&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},getActionClasses:function(){var e=this.canCopyContainer?" hasCopyAction":"";return"action".concat(e)}},methods:{createContainer:function(){this.editContainer("0")},editContainer:function(e){u["MatomoUrl"].updateHash(Object.assign(Object.assign({},u["MatomoUrl"].hashParsed.value),{},{idContainer:e}))},installCode:function(e){Kd.showInstallCode(e)},deleteContainer:function(e){function t(){ud.deleteContainer(e.idcontainer).then((function(){ud.reload(),u["NotificationsStore"].remove("CopyDialogResultNotification")}))}u["Matomo"].helper.modalConfirm(this.$refs.confirmDeleteContainer,{yes:t})},truncateText:function(e,t){return e.length>t?"".concat(e.substr(0,t-3),"..."):e},openCopyDialog:function(e){var t=u["MatomoUrl"].stringify({module:"TagManager",action:"copyContainerDialog",idSite:e.idsite,idContainer:e.idcontainer});window.Piwik_Popover.createPopupAndLoadUrl(t,"","mtmCopyContainer")}}});Jd.render=Hd;var Yd=Jd,Zd={class:"manageContainer"};function Qd(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("ContainerList"),c=Object(r["resolveComponent"])("ContainerEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Zd,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{"is-super-user":e.isSuperUser},null,8,["is-super-user"])],512),[[r["vShow"],!e.editMode]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{"id-container":e.idContainer},null,8,["id-container"])],512),[[r["vShow"],e.editMode]])])}var eu=Object(r["defineComponent"])({props:{isSuperUser:{type:Boolean,required:!0}},components:{ContainerList:Yd,ContainerEdit:bd},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idContainer}),(function(t){e.onIdContainerParamChange(t)})),u["NotificationsStore"].remove("containertagmanagement"),this.onIdContainerParamChange(u["MatomoUrl"].hashParsed.value.idContainer)},computed:{idContainer:function(){var e=u["MatomoUrl"].hashParsed.value.idContainer;return this.isAddAllowed||""!==e?e:null},editMode:function(){return!!this.idContainer}},methods:{onIdContainerParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddVersion",t),this.isAddAllowed=!!t.isAllowed}}}});eu.render=Qd;var tu=eu,nu={class:"containerDashboard"},au={key:0},iu={class:"dashboardCreationDate"},ru={key:0},ou=Object(r["createElementVNode"])("br",null,null,-1),lu=["innerHTML"],cu={class:"row",style:{"margin-left":"-0.75rem"}},su={class:"col m6 s12"},du={key:0},uu=["href","title"],gu={key:0},mu=Object(r["createElementVNode"])("hr",null,null,-1),bu=["href"],pu=Object(r["createElementVNode"])("span",{class:"icon-edit"}," ",-1),hu=["href"],fu=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),vu={class:"col m6 s12"},ju={key:0},Ou=["href","title"],Tu=Object(r["createElementVNode"])("hr",null,null,-1),yu=["href"],Vu=Object(r["createElementVNode"])("span",{class:"icon-edit"}," ",-1),Cu=["href"],Nu=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Eu={class:"row",style:{"margin-left":"-0.75rem"}},Su={class:"col m6 s12"},wu=["href","title"],ku={key:0},Mu=Object(r["createElementVNode"])("hr",null,null,-1),_u=["href"],Du=Object(r["createElementVNode"])("span",{class:"icon-edit"}," ",-1),Au=["href"],xu=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Bu={class:"col m6 s12"},Lu=["title","href"],Uu={key:0},Pu=Object(r["createElementVNode"])("br",null,null,-1),Iu=["title"],Fu={key:0},Hu=Object(r["createElementVNode"])("hr",null,null,-1),Gu=["href"],$u=Object(r["createElementVNode"])("span",{class:"icon-edit"}," ",-1),Ru=["href"],qu=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1);function zu(e,t,n,a,i,o){var l,c,s=Object(r["resolveComponent"])("ActivityIndicator"),d=Object(r["resolveComponent"])("EnrichedHeadline"),u=Object(r["resolveComponent"])("ContentBlock"),g=Object(r["resolveDirective"])("content-intro");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",nu,[Object(r["createVNode"])(s,{loading:e.isLoading},null,8,["loading"]),e.isLoading?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",au,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("h2",null,[Object(r["createVNode"])(d,{"feature-name":"Tag Manager","inline-help":e.dashboardHelpText},{default:Object(r["withCtx"])((function(){var t;return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_ContainerX",null===(t=e.container)||void 0===t?void 0:t.name)),1)]})),_:1},8,["inline-help"])]),Object(r["createElementVNode"])("p",iu,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.containerMetaInformation)+" ",1),null!==(l=e.containerVersion)&&void 0!==l&&l.description?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",ru,[ou,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_Description"))+": "+Object(r["toDisplayString"])(null===(c=e.containerVersion)||void 0===c?void 0:c.description),1)])):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("p",{innerHTML:e.$sanitize(e.containerDashboardDescription)},null,8,lu)],512),[[g]]),Object(r["createElementVNode"])("div",cu,[Object(r["createElementVNode"])("div",su,[Object(r["createVNode"])(u,{feature:"Tag Manager","content-title":"".concat(e.tagCount," ").concat(e.translate("TagManager_Tags")),"help-text":e.tagsHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,[e.tagCount?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",du,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Names"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedContainerVersionTags,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("a",{href:e.linkTo("manageTags",{idTag:t.idtag}),title:e.translate("TagManager_EntityDateTypeMetaInformation",t.created_date_pretty,t.updated_date_pretty,t.type)},Object(r["toDisplayString"])(t.name),9,uu),n!==e.sortedContainerVersionTags.length-1?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",gu,", ")):Object(r["createCommentVNode"])("",!0)])})),128))])):Object(r["createCommentVNode"])("",!0)]),mu,Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageTags")},[pu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_EditTags")),1)],8,bu),Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageTags",{idTag:0})},[fu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTag")),1)],8,hu)]})),_:1},8,["content-title","help-text"])]),Object(r["createElementVNode"])("div",vu,[Object(r["createVNode"])(u,{feature:"Tag Manager","content-title":"".concat(e.triggerCount," ").concat(e.translate("TagManager_Triggers")),"help-text":e.triggersHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,[e.triggerCount?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",ju,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Names"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedTriggers,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("a",{href:e.linkTo("manageTriggers",{idTrigger:t.idtrigger}),title:e.translate("TagManager_EntityDateTypeMetaInformation",t.created_date_pretty,t.updated_date_pretty,t.type)},Object(r["toDisplayString"])(t.name),9,Ou),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,", ",512),[[r["vShow"],n!==e.sortedTriggers.length-1]])])})),128))])):Object(r["createCommentVNode"])("",!0)]),Tu,Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageTriggers")},[Vu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_EditTriggers")),1)],8,yu),Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageTriggers",{idTrigger:0})},[Nu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTrigger")),1)],8,Cu)]})),_:1},8,["content-title","help-text"])])]),Object(r["createElementVNode"])("div",Eu,[Object(r["createElementVNode"])("div",Su,[Object(r["createVNode"])(u,{feature:"Tag Manager","content-title":"".concat(e.variableCount," ").concat(e.translate("TagManager_Variables")),"help-text":e.variablesHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Names"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedVariables,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("a",{href:e.linkTo("manageVariables",{idVariable:t.idvariable}),title:e.translate("TagManager_EntityDateTypeMetaInformation",t.created_date_pretty,t.updated_date_pretty,t.type)},Object(r["toDisplayString"])(t.name),9,wu),n!==e.sortedVariables.length-1?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",ku,", ")):Object(r["createCommentVNode"])("",!0)])})),128))],512),[[r["vShow"],e.variableCount]])]),Mu,Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageVariables")},[Du,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_EditVariables")),1)],8,_u),Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageVariables",{idVariable:0})},[xu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVariable")),1)],8,Au)]})),_:1},8,["content-title","help-text"])]),Object(r["createElementVNode"])("div",Bu,[Object(r["createVNode"])(u,{feature:"Tag Manager","content-title":"".concat(e.versionCount," ").concat(e.translate("TagManager_Versions")),"help-text":e.versionsHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_LastVersions"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.lastVersions,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("a",{title:e.lastVersionLinkTitle(t),href:e.linkTo("manageVersions",{idContainerVersion:t.idcontainerversion})},Object(r["toDisplayString"])(t.name),9,Lu),n!==e.lastVersions.length-1?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",Uu,", ")):Object(r["createCommentVNode"])("",!0)])})),128))],512),[[r["vShow"],e.lastVersions.length]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[Pu,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_Environments"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.container.releases,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("span",{title:e.releaseTooltip(t)},Object(r["toDisplayString"])(e.ucfirst(t.environment)),9,Iu),n!==e.container.releases.length-1?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",Fu,", ")):Object(r["createCommentVNode"])("",!0)])})),128))],512),[[r["vShow"],e.container.releases.length]])]),Hu,Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageVersions")},[$u,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_EditVersions")),1)],8,Gu),Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageVersions",{idContainerVersion:0})},[qu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVersion")),1)],8,Ru)]})),_:1},8,["content-title","help-text"])])])]))])}function Wu(e){e.sort((function(e,t){return e.namet.name?1:0}))}var Xu=Object(r["defineComponent"])({props:{idContainer:String,dashboardHelpText:String,tagsHelpText:String,triggersHelpText:String,variablesHelpText:String,versionsHelpText:String},components:{ActivityIndicator:u["ActivityIndicator"],EnrichedHeadline:u["EnrichedHeadline"],ContentBlock:u["ContentBlock"]},directives:{ContentIntro:u["ContentIntro"]},data:function(){return{container:null,containerVersion:null,isLoading:!1}},created:function(){var e=this;Qs.init(),this.isLoading=!0;var t=u["AjaxHelper"].fetch({method:"TagManager.getContainer",idContainer:this.idContainer}).then((function(t){e.container=t})),n=u["AjaxHelper"].fetch({method:"TagManager.exportContainerVersion",idContainer:this.idContainer}).then((function(t){e.containerVersion=t}));Promise.all([t,n]).finally((function(){e.isLoading=!1}))},methods:{linkTo:function(e,t){var n=u["MatomoUrl"].stringify(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{module:"TagManager",action:e}));return t&&(n+="#?".concat(u["MatomoUrl"].stringify(t))),"?".concat(n)},lastVersionLinkTitle:function(e){return"Created on ".concat(e.created_date_pretty)+", description: '".concat(e.description,"'")},releaseTooltip:function(e){var t=Object(u["translate"])("TagManager_ReleaseInfo",e.release_login,e.release_date_pretty),n=Object(u["translate"])("TagManager_ReleaseVersionInfo",e.version_name);return"".concat(t," ").concat(n)},ucfirst:function(e){return"".concat(e.substr(0,1).toUpperCase()).concat(e.substr(1))}},computed:{lastVersions:function(){var e,t;return null!==(e=this.container)&&void 0!==e&&null!==(t=e.versions)&&void 0!==t&&t.length?this.container.versions.slice(0,5):[]},contexts:function(){var e={};return Qs.contexts.value.forEach((function(t){var n=t.id,a=t.name;e[n]=a})),e},containerMetaInformation:function(){var e;return Object(u["translate"])("TagManager_ContainerIdInformation",(null===(e=this.containerVersion)||void 0===e?void 0:e.idcontainer)||"")},containerDashboardDescription:function(){var e=Object(u["externalLink"])("https://matomo.org/guide/tag-manager/getting-started-with-tag-manager/");return Object(u["translate"])("TagManager_ContainerDashboardDescription",e,"")},sortedContainerVersionTags:function(){var e,t=(null===(e=this.containerVersion)||void 0===e?void 0:e.tags)||[];return Wu(t),t},sortedTriggers:function(){var e,t=(null===(e=this.containerVersion)||void 0===e?void 0:e.triggers)||[];return Wu(t),t},sortedVariables:function(){var e,t=(null===(e=this.containerVersion)||void 0===e?void 0:e.variables)||[];return Wu(t),t},tagCount:function(){var e;return null===(e=this.containerVersion)||void 0===e?void 0:e.tags.length},triggerCount:function(){var e;return null===(e=this.containerVersion)||void 0===e?void 0:e.triggers.length},versionCount:function(){var e;return null===(e=this.container)||void 0===e?void 0:e.versions.length},variableCount:function(){var e;return null===(e=this.containerVersion)||void 0===e?void 0:e.variables.length}}});Xu.render=zu;var Ku=Xu,Ju=["title"],Yu={class:"title"},Zu=Object(r["createElementVNode"])("span",{class:"icon icon-chevron-down"}," ",-1),Qu={class:"dropdown positionInViewport"},eg={class:"custom_select_container"},tg={class:"custom_select_ul_list"},ng=["title"],ag=["href"];function ig(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("ActivityIndicator"),c=Object(r["resolveDirective"])("focus-anywhere-but-here");return Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{class:Object(r["normalizeClass"])(["tagContainerSelector piwikSelector borderedControl",{expanded:e.showContainerList}]),onClick:t[1]||(t[1]=function(t){e.fetchContainers(),e.showContainerList=!e.showContainerList}),title:e.translate("TagManager_ChooseContainer")},[Object(r["createElementVNode"])("a",Yu,[Zu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.truncateText(e.actualContainerName,50)),1)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Qu,[Object(r["createVNode"])(l,{loading:e.isLoading},null,8,["loading"]),Object(r["createElementVNode"])("div",eg,[Object(r["createElementVNode"])("ul",tg,[Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("a",{tabindex:"-1",onClick:t[0]||(t[0]=Object(r["withModifiers"])((function(){}),["prevent","stop"]))},Object(r["toDisplayString"])(e.translate("TagManager_NoContainersFound")),1)],512),[[r["vShow"],!e.isLoading&&0===e.containers.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.containers,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{title:"".concat(t.name," (").concat(t.idcontainer,")"),key:t.idcontainer},[Object(r["createElementVNode"])("a",{href:e.linkTo(t.idcontainer)},Object(r["toDisplayString"])(t.name)+" ("+Object(r["toDisplayString"])(t.idcontainer)+") ",9,ag)],8,ng)})),128))])])],512),[[r["vShow"],e.showContainerList]])],10,Ju)),[[c,{blur:e.onBlur}]])}var rg=window,og=rg.tagManagerHelper,lg=Object(r["defineComponent"])({props:{containerName:String},components:{ActivityIndicator:u["ActivityIndicator"]},directives:{FocusAnywhereButHere:u["FocusAnywhereButHere"]},data:function(){return{containers:[],isLoading:!1,showContainerList:!1}},created:function(){setTimeout((function(){window.initTopControls()}))},methods:{fetchContainers:function(){var e=this;this.isLoading=!0,this.containers=[],u["AjaxHelper"].fetch({method:"TagManager.getContainers"}).then((function(t){e.containers=t})).finally((function(){e.isLoading=!1}))},linkTo:function(e){var t=u["MatomoUrl"].urlParsed.value.action;t&&"manageContainers"!==t||(t=this.hasWriteAccess?"dashboard":"manageTags");var n=u["MatomoUrl"].stringify(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{idContainer:e,action:t}));return"".concat(window.location.pathname,"?").concat(n)},onBlur:function(){this.showContainerList=!1},truncateText:function(e,t){return og.truncateText(e,t)}},computed:{actualContainerName:function(){return this.containerName?Object(u["translate"])("TagManager_ContainerX",this.containerName):Object(u["translate"])("TagManager_ChooseContainer")},hasWriteAccess:function(){return u["Matomo"].hasUserCapability("tagmanager_write")}}});lg.render=ig;var cg=lg,sg={style:{"margin-left":"-0.75rem"}},dg=Object(r["createElementVNode"])("br",null,null,-1),ug=["href"],gg=["textContent"],mg={style:{"margin-top":"1rem"}},bg=["innerHTML"],pg=Object(r["createElementVNode"])("br",null,null,-1),hg=["href"],fg={class:"environment"},vg={class:"name"},jg={class:"name"},Og={class:"released_by"},Tg={class:"released_on"},yg={key:0},Vg={colspan:"7"},Cg={class:"loadingPiwik"},Ng=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Eg={key:1},Sg={colspan:"7"},wg={class:"environment"},kg={class:"name"},Mg={class:"revision"},_g={class:"released_by"},Dg={class:"released_on"},Ag={class:"date"};function xg(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("ActivityIndicator"),s=Object(r["resolveComponent"])("ContentBlock"),d=Object(r["resolveDirective"])("copy-to-clipboard"),u=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createBlock"])(s,{class:"manageInstallTagCode",feature:"Tag Manager","content-title":"Install Code"},{default:Object(r["withCtx"])((function(){var n,a;return[Object(r["createElementVNode"])("div",sg,[Object(r["createVNode"])(l,{uicontrol:"select",name:"environment","model-value":e.environment,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.environment=t,e.fetchInstallInstructions(e.environment)}),options:e.environments,title:e.translate("TagManager_Environment")},null,8,["model-value","options","title"])]),Object(r["createVNode"])(c,{loading:e.isLoading},null,8,["loading"]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.installInstructions,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:n},[Object(r["createElementVNode"])("p",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(t.description)+" ",1),dg,t.helpUrl?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,target:"_blank",href:t.helpUrl},Object(r["toDisplayString"])(e.translate("TagManager_LearnMore")),9,ug)):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("div",null,[t.embedCode?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("pre",{key:0,textContent:Object(r["toDisplayString"])(t.embedCode)},null,8,gg)),[[d,{}]]):Object(r["createCommentVNode"])("",!0)])])})),128)),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_InstallCodePublishEnvironmentNote","preview"))+" "+Object(r["toDisplayString"])(e.translate("TagManager_ConfigureEnvironmentsSuperUser")),1),Object(r["createElementVNode"])("p",mg,[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("TagManager_InstallCodeDataLayerNote","",""))},null,8,bg),pg,Object(r["createElementVNode"])("a",{target:"_blank",href:e.externalRawLink("https://matomo.org/faq/tag-manager/data-layer-in-matomo-tag-manager/")},Object(r["toDisplayString"])(e.translate("TagManager_LearnMore")),9,hg)]),Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_ReleasesOverview")),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",fg,Object(r["toDisplayString"])(e.translate("TagManager_Environment")),1),Object(r["createElementVNode"])("th",vg,Object(r["toDisplayString"])(e.translate("TagManager_VersionName")),1),Object(r["createElementVNode"])("th",jg,Object(r["toDisplayString"])(e.translate("TagManager_VersionRevision")),1),Object(r["createElementVNode"])("th",Og,Object(r["toDisplayString"])(e.translate("TagManager_ReleasedBy")),1),Object(r["createElementVNode"])("th",Tg,Object(r["toDisplayString"])(e.translate("TagManager_ReleasedOn")),1)])]),Object(r["createElementVNode"])("tbody",null,[e.isLoading?(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",yg,[Object(r["createElementVNode"])("td",Vg,[Object(r["createElementVNode"])("span",Cg,[Ng,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])])):Object(r["createCommentVNode"])("",!0),e.isLoading||0!==(null===(n=e.container)||void 0===n||null===(a=n.releases)||void 0===a?void 0:a.length)?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",Eg,[Object(r["createElementVNode"])("td",Sg,Object(r["toDisplayString"])(e.translate("TagManager_NoReleasesFound")),1)])),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedReleases,(function(t){var n,a;return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:t.idcontainerrelease},[Object(r["createElementVNode"])("td",wg,Object(r["toDisplayString"])(e.ucfirst(t.environment)),1),Object(r["createElementVNode"])("td",kg,Object(r["toDisplayString"])(null===(n=e.releaseVersions[t.idcontainerrelease])||void 0===n?void 0:n.name),1),Object(r["createElementVNode"])("td",Mg,Object(r["toDisplayString"])(null===(a=e.releaseVersions[t.idcontainerrelease])||void 0===a?void 0:a.revision),1),Object(r["createElementVNode"])("td",_g,Object(r["toDisplayString"])(t.release_login),1),Object(r["createElementVNode"])("td",Dg,[Object(r["createElementVNode"])("span",Ag,Object(r["toDisplayString"])(t.release_date_pretty),1)])])})),128))])],512),[[u]])]})),_:1})}function Bg(e){return Pg(e)||Ug(e)||Hg(e)||Lg()}function Lg(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ug(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Pg(e){if(Array.isArray(e))return Gg(e)}function Ig(e,t){return Rg(e)||$g(e,t)||Hg(e,t)||Fg()}function Fg(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Hg(e,t){if(e){if("string"===typeof e)return Gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gg(e,t):void 0}}function Gg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.release_date?-1:t.index-e.index})),t}}});Wg.render=xg;var Xg=Wg,Kg={class:"tagManagerTrackingCode"},Jg={key:0},Yg={class:"trackingCodeAdvancedOptions"},Zg={class:"advance-option"},Qg=Object(r["createElementVNode"])("span",{class:"icon-chevron-down"},null,-1),em=Object(r["createElementVNode"])("span",{class:"icon-chevron-up"},null,-1),tm={id:"mtm-advanced-options"},nm=["innerHTML"],am={key:1,class:"row"},im={class:"col s12 m4 "},rm={class:"form-group row"},om={class:"col s12 input-field"},lm={for:"tagManagerTrackingCodeSite",class:"siteSelectorLabel"},cm={class:"sites_autocomplete"},sm={class:"col s12 m4"},dm={class:"col s12 m4"},um=["innerHTML"],gm={key:1,class:"alert alert-info"},mm={href:""},bm={key:0},pm=["href"],hm=Object(r["createTextVNode"])(". "),fm=["innerHTML"],vm=["textContent"],jm=["innerHTML"],Om={key:1};function Tm(e,t,n,a,i,o){var l=this,c=Object(r["resolveComponent"])("ActivityIndicator"),s=Object(r["resolveComponent"])("SiteSelector"),d=Object(r["resolveComponent"])("Field"),u=Object(r["resolveDirective"])("copy-to-clipboard");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Kg,[e.showContainerRow?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Jg,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_OptionallyCustomiseContainer"))+" ",1),Object(r["createElementVNode"])("div",Yg,[Object(r["createElementVNode"])("div",Zg,[Object(r["createElementVNode"])("span",null,[e.isAdvancedDisplayed?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,href:"javascript:;",onClick:t[0]||(t[0]=Object(r["withModifiers"])((function(t){return e.isAdvancedDisplayed=!0}),["prevent"]))},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("CoreAdminHome_ShowAdvancedOptions"))+" ",1),Qg])),e.isAdvancedDisplayed?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:1,href:"javascript:;",onClick:t[1]||(t[1]=Object(r["withModifiers"])((function(t){return e.isAdvancedDisplayed=!1}),["prevent"]))},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("CoreAdminHome_HideAdvancedOptions"))+" ",1),em])):Object(r["createCommentVNode"])("",!0)])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",tm,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.getAdvancedStepText)},null,8,nm),e.showContainerRow||e.environments.length>1?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createBlock"])(c,{key:0,loading:!0},null,512)),[[r["vShow"],e.isLoading]]):Object(r["createCommentVNode"])("",!0),e.showContainerRow||e.environments.length>1?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("div",am,[Object(r["createElementVNode"])("div",im,[Object(r["createElementVNode"])("div",rm,[Object(r["createElementVNode"])("div",om,[Object(r["createElementVNode"])("label",lm,Object(r["toDisplayString"])(e.translate("General_Website")),1),Object(r["createElementVNode"])("div",cm,[Object(r["createVNode"])(s,{id:"tagManagerTrackingCodeSite",modelValue:e.site,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.site=t}),"show-all-sites-item":!1,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(r["createElementVNode"])("div",sm,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(d,{uicontrol:"select",name:"containers","model-value":e.idContainer,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.idContainer=t,e.onContainerChange()}),options:e.containerOptions,disabled:e.containerOptions.length<=1,"full-width":!0,title:e.translate("TagManager_Container")},null,8,["model-value","options","disabled","title"])])]),Object(r["createElementVNode"])("div",dm,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(d,{uicontrol:"select",name:"environment","model-value":e.environment,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.environment=t,l.$emit("fetchInstallInstructions")}),options:e.environments,disabled:e.environments.length<=1,"full-width":!0,title:e.translate("TagManager_Environment")},null,8,["model-value","options","disabled","title"])])])],512)),[[r["vShow"],!e.isLoading]]):Object(r["createCommentVNode"])("",!0),e.idContainer?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:2,innerHTML:e.$sanitize(e.getAdvancedStepInfo)},null,8,um)):Object(r["createCommentVNode"])("",!0)])],512),[[r["vShow"],e.isAdvancedDisplayed]])])])):Object(r["createCommentVNode"])("",!0),e.idContainer&&e.noReleaseFound?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",gm,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoReleasesFoundForContainer"))+" ",1),Object(r["createElementVNode"])("a",mm,Object(r["toDisplayString"])(e.translate("TagManager_PublishVersionToEnvironmentToViewEmbedCode")),1)])):Object(r["createCommentVNode"])("",!0),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.installInstructions,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])(r["Fragment"],{key:n},[e.showDescription?(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",bm,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(t.description)+" ",1),t.helpUrl?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,target:"_blank",href:t.helpUrl},Object(r["toDisplayString"])(e.translate("TagManager_LearnMore")),9,pm)):Object(r["createCommentVNode"])("",!0),hm])):Object(r["createCommentVNode"])("",!0),e.showPlainMtmSteps?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:1,innerHTML:e.$sanitize(e.getMtmStep3)},null,8,fm)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("pre",{class:"codeblock",textContent:Object(r["toDisplayString"])(t.embedCode),ref:"codeblock"},null,8,vm),[[u,{}]])])],64)})),128)),e.showBottom&&!e.noReleaseFound&&e.idContainer?(Object(r["openBlock"])(),Object(r["createElementBlock"])(r["Fragment"],{key:2},[e.showTestSection?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Om,[(Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["resolveDynamicComponent"])(e.testComponent),{site:e.site},null,8,["site"]))])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",{key:0,innerHTML:e.$sanitize(e.getCongratulationsText)},null,8,jm))],64)):Object(r["createCommentVNode"])("",!0)])}function ym(e){return"".concat(e.substr(0,1).toUpperCase()).concat(e.substr(1))}var Vm=Object(r["defineComponent"])({props:{showContainerRow:Boolean,showBottom:Boolean,showDescription:Boolean,showPlainMtmSteps:Boolean,showTestSection:Boolean,showAdvancedOptions:{required:!1,type:Boolean,default:!1}},components:{ActivityIndicator:u["ActivityIndicator"],SiteSelector:u["SiteSelector"],Field:g["Field"]},emits:["fetchInstallInstructions"],directives:{CopyToClipboard:u["CopyToClipboard"]},data:function(){return{containerVariables:[],isLoading:!1,idContainer:"",environment:"",environments:[],environmentNameMap:{},containerMap:{},containerOptions:[],site:{id:u["Matomo"].idSite,name:u["Matomo"].helper.htmlDecode(u["Matomo"].siteName)},matomoConfigs:[],releases:[],installInstructions:[],noReleaseFound:!1,isAdvancedDisplayed:!1}},created:function(){var e=this;u["AjaxHelper"].fetch({method:"TagManager.getAvailableEnvironments",filter_limit:"-1"}).then((function(t){var n;n=Array.isArray(t)?t:Object.values(t),e.environmentNameMap=Object.fromEntries(n.map((function(e){var t=e.id,n=e.name;return[t,n]})))})),this.onSiteChange(),this.isAdvancedDisplayed=this.showAdvancedOptions},watch:{site:function(){this.onSiteChange()}},methods:{onSiteChange:function(){var e,t=this;this.installInstructions=[],this.containerOptions=[],this.containerMap={},this.environments=[],this.matomoConfigs=[],this.idContainer="",null!==(e=this.site)&&void 0!==e&&e.id&&(this.isLoading=!0,u["AjaxHelper"].fetch({method:"TagManager.getContainers",filter_limit:"-1",idSite:this.site.id}).then((function(e){if(t.containerOptions=[],null===e||void 0===e||!e.length)return t.idContainer="",t.isAdvancedDisplayed=!0,void t.containerOptions.push({key:"",value:t.translate("TagManager_NoContainersFound")});e.forEach((function(e){t.idContainer||(t.idContainer=e.idcontainer),t.containerMap[e.idcontainer]=e,t.containerOptions.push({key:e.idcontainer,value:e.name})})),t.onContainerChange()})).finally((function(){t.isLoading=!1})))},onContainerChange:function(){var e=this;if(this.noReleaseFound=!1,this.idContainer){this.installInstructions=[];var t=this.containerMap[this.idContainer],n=t.draft.idcontainerversion;this.environment="",this.environments=[];var a=t.releases||[];a.find((function(e){return"live"===e.environment}))&&(this.environment="live"),a.forEach((function(t){if("preview"!==t.environment){e.environment||(e.environment=t.environment);var n=ym(t.environment);t.environment in e.environmentNameMap&&(n=e.environmentNameMap[t.environment]),e.environments.push({key:t.environment,value:n})}})),this.environments.length||(this.noReleaseFound=!0,this.environments.push({key:"",value:this.translate("TagManager_NoReleasesFound")})),this.$emit("fetchInstallInstructions"),this.fetchVariables(n)}},linkTo:function(e,t,n,a){var i=u["MatomoUrl"].stringify(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{module:"TagManager",action:e,idSite:t,idContainer:n})),r="".concat(window.location.pathname,"?").concat(i);return a&&(r+="#?".concat(u["MatomoUrl"].stringify(a))),r},fetchVariables:function(e){var t,n=this;this.matomoConfigs=[],this.idContainer&&null!==(t=this.site)&&void 0!==t&&t.id&&e&&u["AjaxHelper"].fetch({method:"TagManager.getContainerVariables",filter_limit:"-1",idContainer:this.idContainer,idContainerVersion:e,idSite:this.site.id}).then((function(e){n.matomoConfigs=e.filter((function(e){return"MatomoConfiguration"===e.type}))})).finally((function(){n.isLoading=!1}))}},computed:{getLearnMoreLink:function(){return Object(u["translate"])("TagManager_CustomHtmlTagHelpText",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/container-dashboard-in-matomo-tag-manager/"),"")},getMtmStep3:function(){return Object(u["translate"])("TagManager_CopyCodePasteInHeader","</head>")},getCongratulationsText:function(){return Object(u["translate"])("TagManager_SiteWithoutDataReactFollowStepCompleted","","")},testComponent:function(){return this.showTestSection?Object(u["useExternalPluginComponent"])("JsTrackerInstallCheck","JsTrackerInstallCheck"):""},getAdvancedStepText:function(){var e,t=Object(u["translate"])("TagManager_SelectContainerForWebsite","","");if(this.idContainer)return t;var n=this.linkTo("manageContainers",String(null===(e=this.site)||void 0===e?void 0:e.id),""),a=Object(u["translate"])("TagManager_ManageContainersLink",''),"");return"".concat(t," ").concat(a)},getAdvancedStepInfo:function(){var e=this.site&&this.site.id?this.site.id:"",t=this.linkTo("dashboard",e,this.idContainer,[]);return Object(u["translate"])("TagManager_CustomiseContainer",''),"",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/container-dashboard-in-matomo-tag-manager/"),"")}}});Vm.render=Tm;var Cm=Vm,Nm=Object(r["createElementVNode"])("br",null,null,-1),Em={class:"followStepsHeading"},Sm={style:{"list-style":"inside decimal"}};function wm(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("TrackingCodeCommon");return Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["resolveDynamicComponent"])("getTrackingMethodsForSite"===e.currentAction?"div":"ContentBlock"),{anchor:"tagmanager","content-title":e.translate("TagManager_MatomoTagManager")},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_MtmTrackingCodeIntro")),1),Nm,Object(r["createElementVNode"])("p",Em,[Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataCloudflareFollowStepsIntro")),1)]),Object(r["createElementVNode"])("ol",Sm,[Object(r["createVNode"])(l,{"show-container-row":e.showContainerRow,showBottom:!0,showDescription:!1,showPlainMtmSteps:!0,showAdvancedOptions:"trackingCodeGenerator"===e.currentAction,showTestSection:"getTrackingMethodsForSite"===e.currentAction&&e.isJsTrackerInstallCheckAvailable,onFetchInstallInstructions:e.fetchInstallInstructions,ref:"trackingCodeCommon"},null,8,["show-container-row","showAdvancedOptions","showTestSection","onFetchInstallInstructions"])])]})),_:1},8,["content-title"])}var km=Object(r["defineComponent"])({props:{currentAction:String,showContainerRow:Boolean,isJsTrackerInstallCheckAvailable:Boolean},components:{ContentBlock:u["ContentBlock"],TrackingCodeCommon:Cm},methods:{fetchInstallInstructions:function(){var e,t,n=this,a=this.$refs.trackingCodeCommon;a.installInstructions=[],null!==a&&void 0!==a&&null!==(e=a.site)&&void 0!==e&&e.id&&null!==a&&void 0!==a&&a.environment&&(a.isLoading=!0,u["AjaxHelper"].fetch({method:"TagManager.getContainerInstallInstructions",filter_limit:"-1",idContainer:null===a||void 0===a?void 0:a.idContainer,environment:null===a||void 0===a?void 0:a.environment,idSite:null===a||void 0===a||null===(t=a.site)||void 0===t?void 0:t.id}).then((function(e){a.installInstructions=e,Object(r["nextTick"])((function(){var e=Array.isArray(n.$refs.codeblock)?n.$refs.codeblock:[n.$refs.codeblock];e.forEach((function(e){$(e).effect("highlight",{},1500)}))}))})).finally((function(){a.isLoading=!1})))}}});km.render=wm;var Mm=km,_m={class:"list-style-decimal"},Dm={ref:"step1"},Am=["innerHTML"],xm=["innerHTML"],Bm=["textContent"],Lm=["innerHTML"],Um=["textContent"],Pm=["innerHTML"],Im=["innerHTML"],Fm=["innerHTML"],Hm=["textContent"],Gm={style:{"list-style":"lower-alpha","list-style-position":"inside"}},$m=["innerHTML"],Rm=["innerHTML"],qm=["innerHTML"],zm=["textContent"],Wm=["textContent"],Xm=["innerHTML"],Km=["textContent"],Jm=["innerHTML"],Ym=["innerHTML"],Zm=["textContent"];function Qm(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("TrackingCodeCommon"),c=Object(r["resolveDirective"])("copy-to-clipboard");return Object(r["openBlock"])(),Object(r["createElementBlock"])("ol",_m,[Object(r["withDirectives"])(Object(r["createElementVNode"])("li",Dm,[Object(r["createVNode"])(l,{"show-container-row":e.showContainerRow,showBottom:!1,showDescription:!1,onFetchInstallInstructions:e.fetchInstallInstructionsSPA,ref:"trackingCodeCommon"},null,8,["show-container-row","onFetchInstallInstructions"])],512),[[r["vShow"],e.step1HasContent]]),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.setupStep2)},null,8,Am),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep3)},null,8,xm),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchClickX("TagManager_CreateNewTrigger"))},null,8,Bm),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep5)},null,8,Lm),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchClickX("TagManager_CreateNewTrigger"))},null,8,Um),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.setupStep7)},null,8,Pm),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep8)},null,8,Im),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep9)},null,8,Fm),Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",{textContent:Object(r["toDisplayString"])(e.fetchFollowStep10)},null,8,Hm),Object(r["createElementVNode"])("ol",Gm,[Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep10a)},null,8,$m),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep10b)},null,8,Rm)])]),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep11)},null,8,qm),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchClickX("General_Update"))},null,8,zm),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchFollowStep13)},null,8,Wm),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep14)},null,8,Xm),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchFollowStep15)},null,8,Km),Object(r["createElementVNode"])("li",null,["react"===e.jsFramework?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.fetchFollowStep16React)},null,8,Jm)):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.fetchFollowStep16SPA)},null,8,Ym)),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.installInstructions,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:t},[Object(r["withDirectives"])(Object(r["createElementVNode"])("pre",{class:"codeblock",textContent:Object(r["toDisplayString"])(e.embedCode),ref:"codeblock"},null,8,Zm),[[c,{}]])])})),128))])])}var eb=Object(r["defineComponent"])({props:{showContainerRow:Boolean,jsFramework:String},components:{TrackingCodeCommon:Cm},directives:{CopyToClipboard:u["CopyToClipboard"]},data:function(){return{setupStep1:"",setupStep2:"",setupStep7:"",installInstructions:[]}},methods:{fetchInstallInstructionsSPA:function(){var e,t,n=this,a=this.$refs.trackingCodeCommon;if(this.installInstructions=[],null!==a&&void 0!==a&&a.idContainer&&null!==a&&void 0!==a&&a.environment&&null!==a&&void 0!==a&&null!==(e=a.site)&&void 0!==e&&e.id){var i=this.linkTo("manageContainers",a.site.id,a.idContainer);this.setupStep1=Object(u["translate"])("TagManager_SPAFollowStep1","
","",''),"");var o=this.linkTo("manageTriggers",a.site.id,a.idContainer);this.setupStep2=Object(u["translate"])("TagManager_SPAFollowStep2",''),"");var l=this.linkTo("manageTags",a.site.id,a.idContainer);this.setupStep7=Object(u["translate"])("TagManager_SPAFollowStep7",''),""),a.isLoading=!0,u["AjaxHelper"].fetch({method:"TagManager.getContainerInstallInstructions",filter_limit:"-1",idContainer:null===a||void 0===a?void 0:a.idContainer,environment:null===a||void 0===a?void 0:a.environment,idSite:null===a||void 0===a||null===(t=a.site)||void 0===t?void 0:t.id,jsFramework:this.jsFramework}).then((function(e){n.installInstructions=e,Object(r["nextTick"])((function(){var e=Array.isArray(n.$refs.codeblock)?n.$refs.codeblock:[n.$refs.codeblock];e.forEach((function(e){$(e).effect("highlight",{},1500)}))}))})).finally((function(){a.isLoading=!1}))}},linkTo:function(e,t,n,a){var i=u["MatomoUrl"].stringify(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{module:"TagManager",action:e,idSite:t,idContainer:n}));return a&&(i+="#?".concat(u["MatomoUrl"].stringify(a))),"?".concat(i)},fetchClickX:function(e){return Object(u["translate"])("General_ClickX",Object(u["translate"])(e))}},computed:{step1HasContent:function(){var e=this.$refs.step1;return e&&""!==e.textContent},fetchFollowStep3:function(){return Object(u["translate"])("TagManager_SPAFollowStep3","".concat(Object(u["translate"])("TagManager_PageViewTriggerName"),""),Object(u["translate"])("TagManager_PageViewTriggerName"),Object(u["externalLink"])("https://matomo.org/faq/tag-manager/how-do-i-track-pageviews-of-my-website-using-matomo-tag-manager/#create-pageview-trigger"),"")},fetchFollowStep5:function(){return Object(u["translate"])("TagManager_SPAFollowStep5","".concat(Object(u["translate"])("TagManager_HistoryChangeTriggerName"),""),Object(u["translate"])("TagManager_CategoryUserEngagement"))},fetchFollowStep8:function(){return Object(u["translate"])("TagManager_SPAFollowStep8","".concat(Object(u["translate"])("TagManager_PageViewTriggerName"),""),"".concat(Object(u["translate"])("TagManager_MatomoTagName"),""),Object(u["translate"])("TagManager_PageViewTriggerName"),Object(u["externalLink"])("https://matomo.org/faq/tag-manager/how-do-i-track-pageviews-of-my-website-using-matomo-tag-manager/#create-pageview-tag"),"")},fetchFollowStep9:function(){return Object(u["translate"])("TagManager_SPAFollowStep9",Object(u["translate"])("TagManager_ConfigureWhatTagDoes"),Object(u["translate"])("TagManager_CustomTitle"),"","")},fetchFollowStep10:function(){return Object(u["translate"])("TagManager_SPAFollowStep10",Object(u["translate"])("TagManager_CustomUrl"))},fetchFollowStep10a:function(){return Object(u["translate"])("TagManager_SPAFollowStep10a","","",Object(u["translate"])("TagManager_CustomUrl"))},fetchFollowStep10b:function(){return Object(u["translate"])("TagManager_SPAFollowStep10b",Object(u["translate"])("TagManager_CustomUrl"),"","")},fetchFollowStep11:function(){return Object(u["translate"])("TagManager_SPAFollowStep11",Object(u["translate"])("TagManager_ConfigureWhenTagDoes"),Object(u["translate"])("TagManager_FireTriggerTitle"),"".concat(Object(u["translate"])("TagManager_HistoryChangeTriggerName"),""),"".concat(Object(u["translate"])("TagManager_PageViewTriggerName"),""))},fetchFollowStep13:function(){return Object(u["translate"])("TagManager_SPAFollowStep13",Object(u["translate"])("TagManager_Publish"))},fetchFollowStep14:function(){return Object(u["translate"])("TagManager_SPAFollowStep14",Object(u["translate"])("TagManager_VersionName"),"","")},fetchFollowStep15:function(){return Object(u["translate"])("TagManager_SPAFollowStep15",Object(u["translate"])("TagManager_CreateVersionAndPublishRelease"))},fetchFollowStep16SPA:function(){return Object(u["translate"])("TagManager_SPAFollowStep16","</head>",Object(u["externalLink"])("https://developer.matomo.org/guides/tagmanager/embedding"),"")},fetchFollowStep16React:function(){return Object(u["translate"])("TagManager_ReactFollowStep16","","","App.js","React.useEffect","Hello World","React.js")}}});eb.render=Qm;var tb,nb,ab=eb,ib={class:"nav-wrapper"},rb={class:"pull-right"},ob=Object(r["createElementVNode"])("svg",{class:"tm-icon tm-icon-close"},[Object(r["createElementVNode"])("use",{"xlink:href":"#tm-icon-close"})],-1),lb=[ob],cb={class:"pull-right"},sb=Object(r["createElementVNode"])("svg",{"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden"},version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[Object(r["createElementVNode"])("defs",null,[Object(r["createElementVNode"])("symbol",{id:"tm-icon-checkmark",viewBox:"0 0 32 32"},[Object(r["createElementVNode"])("path",{d:"M27 4l-15 15-7-7-5 5 12 12 20-20z"})])])],-1),db=Object(r["createElementVNode"])("svg",{"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden"},version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[Object(r["createElementVNode"])("symbol",{id:"tm-icon-close",viewBox:"0 0 32 32"},[Object(r["createElementVNode"])("path",{d:"M31.33 0.67c0.893 0.893 0.893 2.34 0 3.232l-27.427 27.427c-0.893 0.893-2.34\n 0.893-3.232 0s-0.893-2.34 0-3.232l27.427-27.427c0.892-0.893 2.34-0.893 3.232 0z"}),Object(r["createElementVNode"])("path",{d:"M0.67 0.67c0.893-0.893 2.34-0.893 3.232 0l27.427 27.427c0.893 0.892 0.893\n 2.34 0 3.232s-2.34 0.892-3.232 0l-27.427-27.427c-0.893-0.893-0.893-2.34 0-3.232z"})])],-1),ub={class:"page",style:{clear:"both"}},gb={key:0,id:"secondNavBar",class:"Menu--dashboard z-depth-1"},mb={class:"navbar",role:"menu",style:{padding:"0"}},bb={class:"menuTab",role:"menuitem"},pb={class:"item",style:{"font-weight":"normal"}},hb=Object(r["createTextVNode"])(" Events "),fb={key:0},vb=Object(r["createElementVNode"])("br",null,null,-1),jb=Object(r["createElementVNode"])("br",null,null,-1),Ob=Object(r["createElementVNode"])("label",{for:"onlyfiredTags",class:"lbl-onlyfiredTags"},"Only fired tags",-1),Tb={key:0,style:{padding:"0 0 1rem 1.2rem"}},yb=["onClick","title"],Vb={title:"This tag was fired"},Cb=Object(r["createElementVNode"])("svg",{class:"tm-icon tm-icon-checkmark"},[Object(r["createElementVNode"])("use",{"xlink:href":"#tm-icon-checkmark"})],-1),Nb=[Cb],Eb={class:"pageWrap"},Sb={class:"home",id:"content"},wb=Object(r["createElementVNode"])("h3",null,"Fired Tags",-1),kb={class:"entityTable"},Mb=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Action"),Object(r["createElementVNode"])("th",null,"Name"),Object(r["createElementVNode"])("th",null,"Type"),Object(r["createElementVNode"])("th",null,"Fired count")])],-1),_b={key:0},Db=Object(r["createElementVNode"])("td",{colspan:"4"},"No tags",-1),Ab=[Db],xb=Object(r["createElementVNode"])("h3",{style:{"margin-top":"30px"}},"Not Yet Fired Tags",-1),Bb={class:"entityTable"},Lb=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Name"),Object(r["createElementVNode"])("th",null,"Type")])],-1),Ub=Object(r["createElementVNode"])("td",{colspan:"4"},"No tags",-1),Pb=[Ub],Ib=Object(r["createElementVNode"])("h3",null,"Triggers",-1),Fb={class:"entityTable"},Hb=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Name"),Object(r["createElementVNode"])("th",null,"Type")])],-1),Gb={key:0},$b=Object(r["createElementVNode"])("td",{colspan:"4"},"No trigger",-1),Rb=[$b],qb={key:1},zb=Object(r["createElementVNode"])("h3",null,"Pushed data by this event",-1),Wb={class:"entityTable"},Xb={style:{"word-break":"break-all"}},Kb=Object(r["createElementVNode"])("br",null,null,-1),Jb=Object(r["createElementVNode"])("h3",null,"Content after this event",-1),Yb={class:"entityTable"},Zb={style:{"word-break":"break-all"}},Qb={class:"entityTable"},ep=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Name"),Object(r["createElementVNode"])("th",null,"Type"),Object(r["createElementVNode"])("th",null,"Value")])],-1),tp={key:0},np=Object(r["createElementVNode"])("td",{colspan:"3"},"No variables",-1),ap=[np],ip={style:{"word-break":"break-all"}},rp={class:"entityTable"},op=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Time"),Object(r["createElementVNode"])("th",null,"Message")])],-1),lp={style:{"word-break":"break-all"}},cp=Object(r["createElementVNode"])("br",null,null,-1);function sp(e,t,n,a,i,o){var l,c,s,d,u,g,m,b,p,h;return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",null,[Object(r["createElementVNode"])("nav",null,[Object(r["createElementVNode"])("div",ib,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["renderSlot"])(e.$slots,"logo")]),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"tags"===e.contentTab||!e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(t){return e.contentTab="tags"})},"Tags")],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"triggers"===e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[1]||(t[1]=function(t){return e.contentTab="triggers"})},"Triggers")],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"variables"===e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[2]||(t[2]=function(t){return e.contentTab="variables"})},"Variables")],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"dataLayer"===e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[3]||(t[3]=function(t){return e.contentTab="dataLayer"})},"Data Layer")],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"logs"===e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[4]||(t[4]=function(t){return e.contentTab="logs"})},"Logs")],2),Object(r["createElementVNode"])("li",rb,[Object(r["createElementVNode"])("a",{id:"mtmCloseDebug",onClick:t[5]||(t[5]=function(t){return e.mtmCloseDebugWindow()})},lb)]),Object(r["createElementVNode"])("li",cb,[Object(r["createElementVNode"])("a",{id:"mtmUpdateDebugPosition",onClick:t[6]||(t[6]=function(t){return e.mtmUpdateDebugPosition()})},Object(r["toDisplayString"])(e.positionText),1)])])])]),sb,db,Object(r["createElementVNode"])("div",ub,["logs"!==e.contentTab?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",gb,[Object(r["createElementVNode"])("ul",mb,[Object(r["createElementVNode"])("li",bb,[Object(r["createElementVNode"])("span",pb,[hb,e.mtmEvents.length>0?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",fb,[vb,jb,Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"checkbox",class:"onlyFiredTags-chk",name:"onlyfiredTags",id:"onlyfiredTags",value:"1","onUpdate:modelValue":t[7]||(t[7]=function(t){return e.onlyfiredTags=t}),style:{"margin-right":"3.5px"}},null,512),[[r["vModelCheckbox"],e.onlyfiredTags]]),Ob])):Object(r["createCommentVNode"])("",!0)])]),0===e.mtmEvents.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Tb,"No event executed")):Object(r["createCommentVNode"])("",!0),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.mtmEventsReversed,(function(t,n){var a,i;return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:Object(r["normalizeClass"])(["menuTab",{active:n===e.selectedEventIndex}]),role:"menuitem",key:n},[(t.tags||[]).length||!e.onlyfiredTags?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,class:"item",onClick:function(n){return e.selectEvent(t.index0)},title:"Time: ".concat(t.time,". Trigger: ").concat(null===(a=t.metTrigger)||void 0===a?void 0:a.name)},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(t.index)+": "+Object(r["toDisplayString"])(t.name)+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",Vb,Nb,512),[[r["vShow"],null===(i=t.tags)||void 0===i?void 0:i.length]])],8,yb)):Object(r["createCommentVNode"])("",!0)],2)})),128))])])):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("div",Eb,[Object(r["createElementVNode"])("div",Sb,[Object(r["withDirectives"])(Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.homeTabTitle),513),[[r["vShow"],"logs"!==e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[wb,Object(r["createElementVNode"])("table",kb,[Mb,Object(r["createElementVNode"])("tbody",null,[null!==(l=e.selectedEvent)&&void 0!==l&&null!==(c=l.tags)&&void 0!==c&&c.length?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",_b,Ab)),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])((null===(s=e.selectedEvent)||void 0===s?void 0:s.tags)||[],(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:t},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.action),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.type),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.numExecuted),1)])})),128))])]),xb,Object(r["createElementVNode"])("table",Bb,[Lb,Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,Pb,512),[[r["vShow"],0===e.notFiredTags.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.notFiredTags,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:t},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.type),1)])})),128))])])],512),[[r["vShow"],"tags"===e.contentTab||!e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Ib,Object(r["createElementVNode"])("table",Fb,[Hb,Object(r["createElementVNode"])("tbody",null,[null!==(d=e.selectedEvent)&&void 0!==d&&d.metTrigger?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",Gb,Rb)),null!==(u=e.selectedEvent)&&void 0!==u&&u.metTrigger?(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",qb,[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.selectedEvent.metTrigger.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.selectedEvent.metTrigger.type),1)])):Object(r["createCommentVNode"])("",!0)])])],512),[[r["vShow"],"triggers"===e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[zb,Object(r["createElementVNode"])("table",Wb,[Object(r["createElementVNode"])("tbody",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Xb,Object(r["toDisplayString"])(e.selectedEventData),1)])])]),Kb,Jb,Object(r["createElementVNode"])("table",Yb,[Object(r["createElementVNode"])("tbody",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Zb,Object(r["toDisplayString"])(e.selectedEventContainerDataLayer),1)])])])],512),[[r["vShow"],"dataLayer"===e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("table",Qb,[ep,Object(r["createElementVNode"])("tbody",null,[null!==(g=e.selectedEvent)&&void 0!==g&&null!==(m=g.container)&&void 0!==m&&null!==(b=m.variables)&&void 0!==b&&b.length?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",tp,ap)),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])((null===(p=e.selectedEvent)||void 0===p||null===(h=p.container)||void 0===h?void 0:h.variables)||[],(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:n},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(t.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(t.type),1),Object(r["createElementVNode"])("td",ip,Object(r["toDisplayString"])(e.stringifySelectedVariable(t)),1)])})),128))])])],512),[[r["vShow"],"variables"===e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("table",rp,[op,Object(r["createElementVNode"])("tbody",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.mtmLogs,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:t},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.time),1),Object(r["createElementVNode"])("td",lp,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.messages,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:t},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e),1),cp])})),128))])])})),128))])])],512),[[r["vShow"],"logs"===e.contentTab]])])])])])}function dp(e){return bp(e)||mp(e)||gp(e)||up()}function up(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function gp(e,t){if(e){if("string"===typeof e)return pp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pp(e,t):void 0}}function mp(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function bp(e){if(Array.isArray(e))return pp(e)}function pp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt||n.push.apply(n,dp(e.tags.map((function(e){return e.name}))))}));var a=[];return this.selectedEvent.container.tags.forEach((function(e){-1===n.indexOf(e.name)&&a.push(e)})),a},selectedEvent:function(){return this.mtmEvents[this.selectedEventIndex]},mtmEvents:function(){return window.mtmDbgData.mtmEvents},mtmEventsReversed:function(){var e=dp(this.mtmEvents);return e.reverse(),e},mtmLogs:function(){return window.mtmDbgData.mtmLogs},selectedEventData:function(){var e;return(null===(e=this.selectedEvent)||void 0===e?void 0:e.eventData)&&JSON.stringify(this.selectedEvent.eventData,Op())},selectedEventContainerDataLayer:function(){var e,t;return(null===(e=this.selectedEvent)||void 0===e||null===(t=e.container)||void 0===t?void 0:t.dataLayer)&&JSON.stringify(this.selectedEvent.container.dataLayer,Op())}}});Tp.render=sp;var yp=Tp,Vp={class:"copyMtmObjectDialog"},Cp=["innerHTML"],Np=["innerHTML"];function Ep(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveDirective"])("form");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Vp,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.getCopyDialogTitle),1),Object(r["createElementVNode"])("p",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.getCopyDescription)+" ",1),Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.getLearnMoreLink),class:"learnMore"},null,8,Cp)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"site",name:"destinationSite",title:e.translate("TagManager_ChooseWebsite"),modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t})},null,8,["title","modelValue"]),"container"!==e.copyType.toLowerCase()?(Object(r["openBlock"])(),Object(r["createBlock"])(l,{key:0,uicontrol:"select",name:"idDestinationContainer",options:e.containerOptions,disabled:e.containerOptions.length<=1,"full-width":!0,title:e.translate("TagManager_Container"),modelValue:e.idDestinationContainer,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.idDestinationContainer=t})},null,8,["options","disabled","title","modelValue"])):Object(r["createCommentVNode"])("",!0),"container"===e.copyType.toLowerCase()?(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",{key:1,class:"copyNote",innerHTML:e.$sanitize(e.getCopyContainerNote)},null,8,Np)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("button",{class:"btn",onClick:t[2]||(t[2]=function(){return e.performCopy&&e.performCopy.apply(e,arguments)})},Object(r["toDisplayString"])(e.translate("General_Copy")),1)],512),[[c]])])}var Sp=Object(r["defineComponent"])({props:{defaultSite:{type:Object,required:!0},copyType:{type:String,required:!0},copyNonce:{type:String,required:!1,default:""},idToCopy:{type:[String,Number],required:!0},idSourceContainer:{type:String,required:!1,default:""},idContainerVersion:{type:Number,required:!1,default:0}},directives:{Form:g["Form"]},components:{Field:g["Field"]},data:function(){return{site:this.defaultSite,idDestinationContainer:"",containerOptions:[]}},created:function(){this.onSiteChange(),this.idDestinationContainer=this.idSourceContainer},watch:{site:function(){this.onSiteChange()}},methods:{onSiteChange:function(){var e,t=this;"container"!==this.copyType.toLowerCase()&&(this.containerOptions=[],this.idDestinationContainer="",null!==(e=this.site)&&void 0!==e&&e.id&&u["AjaxHelper"].fetch({method:"TagManager.getContainers",filter_limit:"-1",idSite:this.site.id}).then((function(e){if(t.containerOptions=[],null===e||void 0===e||!e.length)return t.idDestinationContainer="",void t.containerOptions.push({key:"",value:t.translate("TagManager_NoContainersFound")});e.forEach((function(e){t.idDestinationContainer||(t.idDestinationContainer=e.idcontainer),t.containerOptions.push({key:e.idcontainer,value:e.name})}))})))},performCopy:function(){var e,t=this,n={module:"TagManager",action:"",idSite:this.defaultSite.id,idDestinationSite:null!==(e=this.site)&&void 0!==e&&e.id?this.site.id:0,nonce:this.copyNonce,idDestinationContainer:"",idSourceContainer:"",idContainerVersion:0,idContainer:0,idTag:0,idTrigger:0,idVariable:0};switch(this.copyType.toLowerCase()){case"container":n.action="copyContainer",n.idContainer=this.idToCopy;break;case"tag":n.action="copyTag",n.idTag=this.idToCopy;break;case"trigger":n.action="copyTrigger",n.idTrigger=this.idToCopy;break;case"variable":n.action="copyVariable",n.idVariable=this.idToCopy;break;default:throw Error("Unrecognised copy object type.")}this.idDestinationContainer&&(n.idDestinationContainer=this.idDestinationContainer),this.idSourceContainer&&(n.idSourceContainer=this.idSourceContainer),this.idContainerVersion>0&&(n.idContainerVersion=this.idContainerVersion),u["AjaxHelper"].fetch(n).then((function(e){if(!e||!e.isSuccess||!e.urlToNewCopy){var n=Object(u["translate"])("General_ErrorRequest","",""),a=u["NotificationsStore"].show({message:n,id:"CopyDialogResultNotification",context:"error",type:"transient"});return u["NotificationsStore"].scrollToNotification(a),void window.Piwik_Popover.close()}t.reloadEntityStore(),t.displaySuccessNotification(e.urlToNewCopy),window.Piwik_Popover.close()}))},reloadEntityStore:function(){switch(this.copyType.toLowerCase()){case"container":ud.reload();break;case"tag":bo.reload(this.idSourceContainer,this.idContainerVersion);break;case"trigger":ya.reload(this.idSourceContainer,this.idContainerVersion);break;case"variable":ft.reload(this.idSourceContainer,this.idContainerVersion);break;default:throw Error("Unrecognised copy object type.")}},displaySuccessNotification:function(e){var t="TagManager_CopyXSuccess",n="";switch(this.copyType.toLowerCase()){case"container":n="TagManager_ContainerLowercase";break;case"tag":n="TagManager_TagLowercase";break;case"trigger":n="TagManager_TriggerLowercase";break;case"variable":n="TagManager_VariableLowercase";break;default:throw Error("Unrecognised copy object type.")}var a=Object(u["translate"])(t,[''),Object(u["translate"])(n),""]),i=u["NotificationsStore"].show({message:a,id:"CopyDialogResultNotification",context:"success",type:"transient"});u["NotificationsStore"].scrollToNotification(i)}},computed:{getCopyDialogTitle:function(){var e="";switch(this.copyType.toLowerCase()){case"container":e=Object(u["translate"])("TagManager_Container");break;case"tag":e=Object(u["translate"])("TagManager_Tag");break;case"trigger":e=Object(u["translate"])("TagManager_Trigger");break;case"variable":e=Object(u["translate"])("TagManager_Variable");break;default:throw Error("Unrecognised copy object type.")}return Object(u["translate"])("TagManager_CopyX",e)},getCopyDescription:function(){if("container"===this.copyType.toLowerCase())return Object(u["translate"])("TagManager_CopyContainerDescription");var e="";switch(this.copyType.toLowerCase()){case"tag":e=Object(u["translate"])("TagManager_TagLowercase");break;case"trigger":e=Object(u["translate"])("TagManager_TriggerLowercase");break;case"variable":e=Object(u["translate"])("TagManager_VariableLowercase");break;default:throw Error("Unrecognised copy object type.")}return Object(u["translate"])("TagManager_CopyXDescription",e)},getCopyContainerNote:function(){return Object(u["translate"])("TagManager_CopyContainerNote","","")},getCopyUrl:function(){var e,t={module:"TagManager",action:"",idSite:this.defaultSite.id,idDestinationSite:null!==(e=this.site)&&void 0!==e&&e.id?this.site.id:0,nonce:this.copyNonce,idDestinationContainer:"",idSourceContainer:"",idContainerVersion:0,idContainer:0,idTag:0,idTrigger:0,idVariable:0};switch(this.copyType.toLowerCase()){case"container":t.action="copyContainer",t.idContainer=this.idToCopy;break;case"tag":t.action="copyTag",t.idTag=this.idToCopy;break;case"trigger":t.action="copyTrigger",t.idTrigger=this.idToCopy;break;case"variable":t.action="copyVariable",t.idVariable=this.idToCopy;break;default:throw Error("Unrecognised copy object type.")}return this.idDestinationContainer&&(t.idDestinationContainer=this.idDestinationContainer),this.idSourceContainer&&(t.idSourceContainer=this.idSourceContainer),this.idContainerVersion>0&&(t.idContainerVersion=this.idContainerVersion),"?".concat(u["MatomoUrl"].stringify(t))},getLearnMoreLink:function(){var e="";switch(this.copyType.toLowerCase()){case"container":e="https://matomo.org/faq/tag-manager/how-to-copy-a-matomo-tag-manager-container-and-its-components";break;case"tag":e="https://matomo.org/faq/tag-manager/how-to-copy-a-tag-in-matomo-tag-manager ";break;case"trigger":e="https://matomo.org/faq/tag-manager/how-to-copy-a-trigger-in-matomo-tag-manager";break;case"variable":e="https://matomo.org/faq/tag-manager/how-to-copy-a-variable-in-matomo-tag-manager";break;default:throw Error("Unrecognised copy object type.")}var t=Object(u["externalLink"])(e);return Object(u["translate"])("TagManager_LearnMoreFullStop",t,"")}}});Sp.render=Ep;var wp=Sp;
+ */var ud=function(){function e(){var t=this;ld(this,e),dd(this,"privateState",Object(r["reactive"])({containers:[],isLoadingContainers:!1,isLoadingSingle:!1,isUpdating:!1})),dd(this,"state",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState)}))),dd(this,"isLoading",Object(r["computed"])((function(){var e=t.state.value;return e.isLoadingContainers||e.isLoadingSingle}))),dd(this,"isUpdating",Object(r["computed"])((function(){return t.state.value.isUpdating}))),dd(this,"containers",Object(r["computed"])((function(){return t.state.value.containers}))),dd(this,"fetchPromise",null)}return sd(e,[{key:"reload",value:function(){return this.privateState.containers=[],this.fetchPromise=null,this.fetchContainers()}},{key:"fetchContainers",value:function(){var e=this;return this.privateState.isLoadingContainers=!0,this.privateState.containers=[],this.fetchPromise||(this.fetchPromise=u["AjaxHelper"].fetch({method:"TagManager.getContainers",filter_limit:"-1"})),Promise.resolve(this.fetchPromise).then((function(t){return e.privateState.containers=t,e.privateState.isLoadingContainers=!1,e.containers.value})).finally((function(){e.privateState.isLoadingContainers=!1}))}},{key:"findContainer",value:function(e){var t=this,n=this.containers.value.find((function(t){return t.idcontainer===e}));return n?Promise.resolve(n):(this.privateState.isLoadingSingle=!0,u["AjaxHelper"].fetch({idContainer:e,method:"TagManager.getContainer",filter_limit:"-1"}).then((function(e){return t.privateState.containers=[].concat(td(t.privateState.containers),[e]),Object(r["readonly"])(e)})).finally((function(){t.privateState.isLoadingSingle=!1})))}},{key:"deleteContainer",value:function(e){var t=this;return this.privateState.isUpdating=!0,this.privateState.containers=[],u["AjaxHelper"].fetch({idContainer:e,method:"TagManager.deleteContainer"},{withTokenInUrl:!0}).finally((function(){t.privateState.isUpdating=!1}))}},{key:"createOrUpdateContainer",value:function(e,t){var n=this;return this.privateState.isUpdating=!0,u["AjaxHelper"].post({method:t,idContainer:e.idcontainer},{name:e.name,description:e.description,ignoreGtmDataLayer:e.ignoreGtmDataLayer,activelySyncGtmDataLayer:e.activelySyncGtmDataLayer,isTagFireLimitAllowedInPreviewMode:e.isTagFireLimitAllowedInPreviewMode,context:e.context},{withTokenInUrl:!0}).finally((function(){n.privateState.isUpdating=!1}))}}]),e}(),gd=new ud,bd="containertagmanagement",md=Object(r["defineComponent"])({props:{idContainer:String},components:{ContentBlock:u["ContentBlock"],Field:g["Field"],SaveButton:g["SaveButton"]},data:function(){return{isDirty:!1,editTitle:"",isUpdatingVersion:!1,container:{}}},created:function(){ed.init(),Ct.init(),this.initIdContainer()},watch:{idContainer:function(e){null!==e&&this.initIdContainer()}},methods:{removeAnyContainerNotification:function(){u["NotificationsStore"].remove(bd),u["NotificationsStore"].remove("ajaxHelper")},showNotification:function(e,t){var n=u["NotificationsStore"].show({message:e,context:t,id:bd,type:"transient"});setTimeout((function(){u["NotificationsStore"].scrollToNotification(n)}),200)},showErrorFieldNotProvidedNotification:function(e){var t=Object(u["translate"])("TagManager_ErrorXNotProvided",[e]);this.showNotification(t,"error")},initIdContainer:function(){var e=this;this.container={},u["Matomo"].helper.lazyScrollToContent(),this.edit&&this.idContainer?(this.editTitle=Object(u["translate"])("TagManager_EditContainer"),gd.findContainer(this.idContainer).then((function(t){t&&(e.container=Object(u["clone"])(t),e.isDirty=!1)}))):this.create&&(this.editTitle=Object(u["translate"])("TagManager_CreateNewContainer"),this.container={idSite:u["Matomo"].idSite,name:"",context:"web",description:"",activelySyncGtmDataLayer:!0},this.isDirty=!1)},cancel:function(){var e=Object.assign({},u["MatomoUrl"].hashParsed.value);delete e.idContainer,u["MatomoUrl"].updateHash(e)},createContainer:function(){var e=this;this.removeAnyContainerNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdatingVersion=!0,gd.createOrUpdateContainer(this.container,"TagManager.addContainer").then((function(t){if(e.isUpdatingVersion=!1,t){e.isDirty=!1;var n=t.value;e.showNotification(Object(u["translate"])("TagManager_CreatedX",Object(u["translate"])("TagManager_Container")),"success"),u["MatomoUrl"].updateUrl(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{module:"TagManager",action:"dashboard",idContainer:n}))}})).finally((function(){e.isUpdatingVersion=!1})))},setValueHasChanged:function(){this.isDirty=!0},updateContainer:function(){var e=this;this.removeAnyContainerNotification(),this.checkRequiredFieldsAreSet()&&(this.isUpdating=!0,gd.createOrUpdateContainer(this.container,"TagManager.updateContainer").then((function(t){t&&(e.isDirty=!1,e.container={},gd.reload().then((function(){e.initIdContainer()})),e.showNotification(Object(u["translate"])("TagManager_UpdatedX",Object(u["translate"])("TagManager_Container")),"success"))})))},checkRequiredFieldsAreSet:function(){if(!this.container.name){var e=Object(u["translate"])("General_Name");return this.showErrorFieldNotProvidedNotification(e),!1}return!0}},computed:{contexts:function(){return ed.contextsOptions.value},create:function(){return"0"===this.idContainer},edit:function(){return!this.create},isLoading:function(){return vt.isLoading.value||Ct.isLoading.value},isUpdating:function(){return vt.isUpdating.value||this.isUpdatingVersion}}});md.render=Xs;var pd=md,hd={class:"tagManagerManageList tagManagerContainerList"},fd=["innerHTML"],vd={class:"index"},jd={class:"name"},Od={class:"description"},Td={class:"created"},yd={class:"action"},Vd={colspan:"5"},Cd={class:"loadingPiwik"},Nd=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Ed={colspan:"5"},Sd=["id"],wd=["title"],kd=["title"],Md=["title"],_d={class:"created"},Dd=["href","title"],Ad=["onClick","title"],xd=["onClick","title"],Bd=["onClick","title"],Ld=["onClick","title"],Ud={class:"tableActionBar"},Pd=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Id={class:"ui-confirm",id:"confirmDeleteContainer",ref:"confirmDeleteContainer"},Fd=["value"],Hd=["value"];function Gd(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("ContentBlock"),c=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",hd,[Object(r["createVNode"])(l,{feature:"Tag Manager","content-title":e.translate("TagManager_ManageX",e.translate("TagManager_Containers"))},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",{innerHTML:e.$sanitize(e.getManageContainersIntro)},null,8,fd),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",vd,Object(r["toDisplayString"])(e.translate("General_Id")),1),Object(r["createElementVNode"])("th",jd,Object(r["toDisplayString"])(e.translate("General_Name")),1),Object(r["createElementVNode"])("th",Od,Object(r["toDisplayString"])(e.translate("General_Description")),1),Object(r["createElementVNode"])("th",Td,Object(r["toDisplayString"])(e.translate("TagManager_CreatedDate")),1),Object(r["createElementVNode"])("th",yd,Object(r["toDisplayString"])(e.translate("General_Actions")),1)])]),Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Vd,[Object(r["createElementVNode"])("span",Cd,[Nd,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])],512),[[r["vShow"],e.isLoading||e.isUpdating]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Ed,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoContainersFound"))+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"createContainerNow",onClick:t[0]||(t[0]=function(t){return e.createContainer()})},Object(r["toDisplayString"])(e.translate("TagManager_CreateNewContainerNow")),513),[[r["vShow"],e.hasWriteAccess]])])],512),[[r["vShow"],!e.isLoading&&0===e.containers.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedContainers,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{id:"container".concat(t.idcontainer),class:"containers",key:t.idcontainer},[Object(r["createElementVNode"])("td",{class:"index",title:"".concat(e.translate("TagManager_Context"),": ")+e.contexts[t.context]},Object(r["toDisplayString"])(t.idcontainer),9,wd),Object(r["createElementVNode"])("td",{class:"name",title:t.name},Object(r["toDisplayString"])(e.truncateText(t.name,50)),9,kd),Object(r["createElementVNode"])("td",{class:"description",title:t.description},Object(r["toDisplayString"])(e.truncateText(t.description,75)),9,Md),Object(r["createElementVNode"])("td",_d,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(t.created_date_pretty),1)]),Object(r["createElementVNode"])("td",{class:Object(r["normalizeClass"])(e.getActionClasses)},[Object(r["createElementVNode"])("a",{class:"table-action icon-configure",href:"?module=TagManager&action="+e.containerDefaultAction+"&idContainer="+t.idcontainer+"&idSite="+t.idsite+"&period=day&date=yesterday",title:e.translate("TagManager_ConfigureX",e.translate("TagManager_Container"))},null,8,Dd),Object(r["createElementVNode"])("a",{class:"table-action installCode icon-embed",onClick:function(n){return e.installCode(t.idcontainer)},title:e.translate("TagManager_InstallCode")},null,8,Ad),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-edit",onClick:function(n){return e.editContainer(t.idcontainer)},title:e.translate("TagManager_EditX",e.translate("TagManager_Container"))},null,8,xd),[[r["vShow"],e.hasWriteAccess]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-delete",onClick:function(n){return e.deleteContainer(t)},title:e.translate("TagManager_DeleteX",e.translate("TagManager_Container"))},null,8,Bd),[[r["vShow"],e.hasWriteAccess]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:"table-action icon-content-copy",onClick:function(n){return e.openCopyDialog(t)},title:e.translate("TagManager_CopyX",e.translate("TagManager_Container"))},null,8,Ld),[[r["vShow"],e.canCopyContainer]])],2)],8,Sd)})),128))])],512),[[c]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Ud,[Object(r["createElementVNode"])("a",{class:"createNewContainer",value:"",onClick:t[1]||(t[1]=function(t){return e.createContainer()})},[Pd,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewContainer")),1)])],512),[[r["vShow"],e.hasWriteAccess]])]})),_:1},8,["content-title"]),Object(r["createElementVNode"])("div",Id,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_DeleteContainerConfirm")),1),Object(r["createElementVNode"])("input",{role:"yes",type:"button",value:e.translate("General_Yes")},null,8,Fd),Object(r["createElementVNode"])("input",{role:"no",type:"button",value:e.translate("General_No")},null,8,Hd)],512)])}function $d(e){return Wd(e)||zd(e)||qd(e)||Rd()}function Rd(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qd(e,t){if(e){if("string"===typeof e)return Xd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xd(e,t):void 0}}function zd(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Wd(e){if(Array.isArray(e))return Xd(e)}function Xd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.created_date?-1:0})),e},getManageContainersIntro:function(){var e=Object(u["externalLink"])("https://matomo.org/guide/tag-manager/getting-started-with-tag-manager/");return Object(u["translate"])("TagManager_ManageContainersIntro",e,"")},canCopyContainer:function(){return u["Matomo"].hasUserCapability("tagmanager_write")&&u["Matomo"].hasUserCapability("tagmanager_use_custom_templates")},getActionClasses:function(){var e=this.canCopyContainer?" hasCopyAction":"";return"action".concat(e)}},methods:{createContainer:function(){this.editContainer("0")},editContainer:function(e){u["MatomoUrl"].updateHash(Object.assign(Object.assign({},u["MatomoUrl"].hashParsed.value),{},{idContainer:e}))},installCode:function(e){Jd.showInstallCode(e)},deleteContainer:function(e){function t(){gd.deleteContainer(e.idcontainer).then((function(){gd.reload(),u["NotificationsStore"].remove("CopyDialogResultNotification")}))}u["Matomo"].helper.modalConfirm(this.$refs.confirmDeleteContainer,{yes:t})},truncateText:function(e,t){return e.length>t?"".concat(e.substr(0,t-3),"..."):e},openCopyDialog:function(e){var t=u["MatomoUrl"].stringify({module:"TagManager",action:"copyContainerDialog",idSite:e.idsite,idContainer:e.idcontainer});window.Piwik_Popover.createPopupAndLoadUrl(t,"","mtmCopyContainer")}}});Yd.render=Gd;var Zd=Yd,Qd={class:"manageContainer"};function eu(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("ContainerList"),c=Object(r["resolveComponent"])("ContainerEdit");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Qd,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{"is-super-user":e.isSuperUser},null,8,["is-super-user"])],512),[[r["vShow"],!e.editMode]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{"id-container":e.idContainer},null,8,["id-container"])],512),[[r["vShow"],e.editMode]])])}var tu=Object(r["defineComponent"])({props:{isSuperUser:{type:Boolean,required:!0}},components:{ContainerList:Zd,ContainerEdit:pd},data:function(){return{isAddAllowed:!1}},created:function(){var e=this;Object(r["watch"])((function(){return u["MatomoUrl"].hashParsed.value.idContainer}),(function(t){e.onIdContainerParamChange(t)})),u["NotificationsStore"].remove("containertagmanagement"),this.onIdContainerParamChange(u["MatomoUrl"].hashParsed.value.idContainer)},computed:{idContainer:function(){var e=u["MatomoUrl"].hashParsed.value.idContainer;return this.isAddAllowed||""!==e?e:null},editMode:function(){return!!this.idContainer}},methods:{onIdContainerParamChange:function(e){if("0"===e){var t={isAllowed:!0};u["Matomo"].postEvent("TagManager.initAddVersion",t),this.isAddAllowed=!!t.isAllowed}}}});tu.render=eu;var nu=tu,au={class:"containerDashboard"},iu={key:0},ru={class:"dashboardCreationDate"},ou={key:0},lu=Object(r["createElementVNode"])("br",null,null,-1),cu=["innerHTML"],su={class:"row",style:{"margin-left":"-0.75rem"}},du={class:"col m6 s12"},uu={key:0},gu=["href","title"],bu={key:0},mu=Object(r["createElementVNode"])("hr",null,null,-1),pu=["href"],hu=Object(r["createElementVNode"])("span",{class:"icon-edit"}," ",-1),fu=["href"],vu=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),ju={class:"col m6 s12"},Ou={key:0},Tu=["href","title"],yu=Object(r["createElementVNode"])("hr",null,null,-1),Vu=["href"],Cu=Object(r["createElementVNode"])("span",{class:"icon-edit"}," ",-1),Nu=["href"],Eu=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Su={class:"row",style:{"margin-left":"-0.75rem"}},wu={class:"col m6 s12"},ku=["href","title"],Mu={key:0},_u=Object(r["createElementVNode"])("hr",null,null,-1),Du=["href"],Au=Object(r["createElementVNode"])("span",{class:"icon-edit"}," ",-1),xu=["href"],Bu=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1),Lu={class:"col m6 s12"},Uu=["title","href"],Pu={key:0},Iu=Object(r["createElementVNode"])("br",null,null,-1),Fu=["title"],Hu={key:0},Gu=Object(r["createElementVNode"])("hr",null,null,-1),$u=["href"],Ru=Object(r["createElementVNode"])("span",{class:"icon-edit"}," ",-1),qu=["href"],zu=Object(r["createElementVNode"])("span",{class:"icon-add"}," ",-1);function Wu(e,t,n,a,i,o){var l,c,s=Object(r["resolveComponent"])("ActivityIndicator"),d=Object(r["resolveComponent"])("EnrichedHeadline"),u=Object(r["resolveComponent"])("ContentBlock"),g=Object(r["resolveDirective"])("content-intro");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",au,[Object(r["createVNode"])(s,{loading:e.isLoading},null,8,["loading"]),e.isLoading?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",iu,[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("h2",null,[Object(r["createVNode"])(d,{"feature-name":"Tag Manager","inline-help":e.dashboardHelpText},{default:Object(r["withCtx"])((function(){var t;return[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_ContainerX",null===(t=e.container)||void 0===t?void 0:t.name)),1)]})),_:1},8,["inline-help"])]),Object(r["createElementVNode"])("p",ru,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.containerMetaInformation)+" ",1),null!==(l=e.containerVersion)&&void 0!==l&&l.description?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",ou,[lu,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_Description"))+": "+Object(r["toDisplayString"])(null===(c=e.containerVersion)||void 0===c?void 0:c.description),1)])):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("p",{innerHTML:e.$sanitize(e.containerDashboardDescription)},null,8,cu)],512),[[g]]),Object(r["createElementVNode"])("div",su,[Object(r["createElementVNode"])("div",du,[Object(r["createVNode"])(u,{feature:"Tag Manager","content-title":"".concat(e.tagCount," ").concat(e.translate("TagManager_Tags")),"help-text":e.tagsHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,[e.tagCount?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",uu,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Names"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedContainerVersionTags,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("a",{href:e.linkTo("manageTags",{idTag:t.idtag}),title:e.translate("TagManager_EntityDateTypeMetaInformation",t.created_date_pretty,t.updated_date_pretty,t.type)},Object(r["toDisplayString"])(t.name),9,gu),n!==e.sortedContainerVersionTags.length-1?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",bu,", ")):Object(r["createCommentVNode"])("",!0)])})),128))])):Object(r["createCommentVNode"])("",!0)]),mu,Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageTags")},[hu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_EditTags")),1)],8,pu),Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageTags",{idTag:0})},[vu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTag")),1)],8,fu)]})),_:1},8,["content-title","help-text"])]),Object(r["createElementVNode"])("div",ju,[Object(r["createVNode"])(u,{feature:"Tag Manager","content-title":"".concat(e.triggerCount," ").concat(e.translate("TagManager_Triggers")),"help-text":e.triggersHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,[e.triggerCount?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",Ou,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Names"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedTriggers,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("a",{href:e.linkTo("manageTriggers",{idTrigger:t.idtrigger}),title:e.translate("TagManager_EntityDateTypeMetaInformation",t.created_date_pretty,t.updated_date_pretty,t.type)},Object(r["toDisplayString"])(t.name),9,Tu),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,", ",512),[[r["vShow"],n!==e.sortedTriggers.length-1]])])})),128))])):Object(r["createCommentVNode"])("",!0)]),yu,Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageTriggers")},[Cu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_EditTriggers")),1)],8,Vu),Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageTriggers",{idTrigger:0})},[Eu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewTrigger")),1)],8,Nu)]})),_:1},8,["content-title","help-text"])])]),Object(r["createElementVNode"])("div",Su,[Object(r["createElementVNode"])("div",wu,[Object(r["createVNode"])(u,{feature:"Tag Manager","content-title":"".concat(e.variableCount," ").concat(e.translate("TagManager_Variables")),"help-text":e.variablesHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_Names"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedVariables,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("a",{href:e.linkTo("manageVariables",{idVariable:t.idvariable}),title:e.translate("TagManager_EntityDateTypeMetaInformation",t.created_date_pretty,t.updated_date_pretty,t.type)},Object(r["toDisplayString"])(t.name),9,ku),n!==e.sortedVariables.length-1?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",Mu,", ")):Object(r["createCommentVNode"])("",!0)])})),128))],512),[[r["vShow"],e.variableCount]])]),_u,Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageVariables")},[Au,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_EditVariables")),1)],8,Du),Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageVariables",{idVariable:0})},[Bu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVariable")),1)],8,xu)]})),_:1},8,["content-title","help-text"])]),Object(r["createElementVNode"])("div",Lu,[Object(r["createVNode"])(u,{feature:"Tag Manager","content-title":"".concat(e.versionCount," ").concat(e.translate("TagManager_Versions")),"help-text":e.versionsHelpText},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_LastVersions"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.lastVersions,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("a",{title:e.lastVersionLinkTitle(t),href:e.linkTo("manageVersions",{idContainerVersion:t.idcontainerversion})},Object(r["toDisplayString"])(t.name),9,Uu),n!==e.lastVersions.length-1?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",Pu,", ")):Object(r["createCommentVNode"])("",!0)])})),128))],512),[[r["vShow"],e.lastVersions.length]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",null,[Iu,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("TagManager_Environments"))+": ",1),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.container.releases,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:n},[Object(r["createElementVNode"])("span",{title:e.releaseTooltip(t)},Object(r["toDisplayString"])(e.ucfirst(t.environment)),9,Fu),n!==e.container.releases.length-1?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",Hu,", ")):Object(r["createCommentVNode"])("",!0)])})),128))],512),[[r["vShow"],e.container.releases.length]])]),Gu,Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageVersions")},[Ru,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_EditVersions")),1)],8,$u),Object(r["createElementVNode"])("a",{class:"btn-flat",href:e.linkTo("manageVersions",{idContainerVersion:0})},[zu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_CreateNewVersion")),1)],8,qu)]})),_:1},8,["content-title","help-text"])])])]))])}function Xu(e){e.sort((function(e,t){return e.namet.name?1:0}))}var Ku=Object(r["defineComponent"])({props:{idContainer:String,dashboardHelpText:String,tagsHelpText:String,triggersHelpText:String,variablesHelpText:String,versionsHelpText:String},components:{ActivityIndicator:u["ActivityIndicator"],EnrichedHeadline:u["EnrichedHeadline"],ContentBlock:u["ContentBlock"]},directives:{ContentIntro:u["ContentIntro"]},data:function(){return{container:null,containerVersion:null,isLoading:!1}},created:function(){var e=this;ed.init(),this.isLoading=!0;var t=u["AjaxHelper"].fetch({method:"TagManager.getContainer",idContainer:this.idContainer}).then((function(t){e.container=t})),n=u["AjaxHelper"].fetch({method:"TagManager.exportContainerVersion",idContainer:this.idContainer}).then((function(t){e.containerVersion=t}));Promise.all([t,n]).finally((function(){e.isLoading=!1}))},methods:{linkTo:function(e,t){var n=u["MatomoUrl"].stringify(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{module:"TagManager",action:e}));return t&&(n+="#?".concat(u["MatomoUrl"].stringify(t))),"?".concat(n)},lastVersionLinkTitle:function(e){return"Created on ".concat(e.created_date_pretty)+", description: '".concat(e.description,"'")},releaseTooltip:function(e){var t=Object(u["translate"])("TagManager_ReleaseInfo",e.release_login,e.release_date_pretty),n=Object(u["translate"])("TagManager_ReleaseVersionInfo",e.version_name);return"".concat(t," ").concat(n)},ucfirst:function(e){return"".concat(e.substr(0,1).toUpperCase()).concat(e.substr(1))}},computed:{lastVersions:function(){var e,t;return null!==(e=this.container)&&void 0!==e&&null!==(t=e.versions)&&void 0!==t&&t.length?this.container.versions.slice(0,5):[]},contexts:function(){var e={};return ed.contexts.value.forEach((function(t){var n=t.id,a=t.name;e[n]=a})),e},containerMetaInformation:function(){var e;return Object(u["translate"])("TagManager_ContainerIdInformation",(null===(e=this.containerVersion)||void 0===e?void 0:e.idcontainer)||"")},containerDashboardDescription:function(){var e=Object(u["externalLink"])("https://matomo.org/guide/tag-manager/getting-started-with-tag-manager/");return Object(u["translate"])("TagManager_ContainerDashboardDescription",e,"")},sortedContainerVersionTags:function(){var e,t=(null===(e=this.containerVersion)||void 0===e?void 0:e.tags)||[];return Xu(t),t},sortedTriggers:function(){var e,t=(null===(e=this.containerVersion)||void 0===e?void 0:e.triggers)||[];return Xu(t),t},sortedVariables:function(){var e,t=(null===(e=this.containerVersion)||void 0===e?void 0:e.variables)||[];return Xu(t),t},tagCount:function(){var e;return null===(e=this.containerVersion)||void 0===e?void 0:e.tags.length},triggerCount:function(){var e;return null===(e=this.containerVersion)||void 0===e?void 0:e.triggers.length},versionCount:function(){var e;return null===(e=this.container)||void 0===e?void 0:e.versions.length},variableCount:function(){var e;return null===(e=this.containerVersion)||void 0===e?void 0:e.variables.length}}});Ku.render=Wu;var Ju=Ku,Yu=["title"],Zu={class:"title"},Qu=Object(r["createElementVNode"])("span",{class:"icon icon-chevron-down"}," ",-1),eg={class:"dropdown positionInViewport"},tg={class:"custom_select_container"},ng={class:"custom_select_ul_list"},ag=["title"],ig=["href"];function rg(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("ActivityIndicator"),c=Object(r["resolveDirective"])("focus-anywhere-but-here");return Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{class:Object(r["normalizeClass"])(["tagContainerSelector piwikSelector borderedControl",{expanded:e.showContainerList}]),onClick:t[1]||(t[1]=function(t){e.fetchContainers(),e.showContainerList=!e.showContainerList}),title:e.translate("TagManager_ChooseContainer")},[Object(r["createElementVNode"])("a",Zu,[Qu,Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.truncateText(e.actualContainerName,50)),1)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",eg,[Object(r["createVNode"])(l,{loading:e.isLoading},null,8,["loading"]),Object(r["createElementVNode"])("div",tg,[Object(r["createElementVNode"])("ul",ng,[Object(r["withDirectives"])(Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("a",{tabindex:"-1",onClick:t[0]||(t[0]=Object(r["withModifiers"])((function(){}),["prevent","stop"]))},Object(r["toDisplayString"])(e.translate("TagManager_NoContainersFound")),1)],512),[[r["vShow"],!e.isLoading&&0===e.containers.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.containers,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{title:"".concat(t.name," (").concat(t.idcontainer,")"),key:t.idcontainer},[Object(r["createElementVNode"])("a",{href:e.linkTo(t.idcontainer)},Object(r["toDisplayString"])(t.name)+" ("+Object(r["toDisplayString"])(t.idcontainer)+") ",9,ig)],8,ag)})),128))])])],512),[[r["vShow"],e.showContainerList]])],10,Yu)),[[c,{blur:e.onBlur}]])}var og=window,lg=og.tagManagerHelper,cg=Object(r["defineComponent"])({props:{containerName:String},components:{ActivityIndicator:u["ActivityIndicator"]},directives:{FocusAnywhereButHere:u["FocusAnywhereButHere"]},data:function(){return{containers:[],isLoading:!1,showContainerList:!1}},created:function(){setTimeout((function(){window.initTopControls()}))},methods:{fetchContainers:function(){var e=this;this.isLoading=!0,this.containers=[],u["AjaxHelper"].fetch({method:"TagManager.getContainers"}).then((function(t){e.containers=t})).finally((function(){e.isLoading=!1}))},linkTo:function(e){var t=u["MatomoUrl"].urlParsed.value.action;t&&"manageContainers"!==t||(t=this.hasWriteAccess?"dashboard":"manageTags");var n=u["MatomoUrl"].stringify(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{idContainer:e,action:t}));return"".concat(window.location.pathname,"?").concat(n)},onBlur:function(){this.showContainerList=!1},truncateText:function(e,t){return lg.truncateText(e,t)}},computed:{actualContainerName:function(){return this.containerName?Object(u["translate"])("TagManager_ContainerX",this.containerName):Object(u["translate"])("TagManager_ChooseContainer")},hasWriteAccess:function(){return u["Matomo"].hasUserCapability("tagmanager_write")}}});cg.render=rg;var sg=cg,dg={style:{"margin-left":"-0.75rem"}},ug=Object(r["createElementVNode"])("br",null,null,-1),gg=["href"],bg=["textContent"],mg={style:{"margin-top":"1rem"}},pg=["innerHTML"],hg=Object(r["createElementVNode"])("br",null,null,-1),fg=["href"],vg={class:"environment"},jg={class:"name"},Og={class:"name"},Tg={class:"released_by"},yg={class:"released_on"},Vg={key:0},Cg={colspan:"7"},Ng={class:"loadingPiwik"},Eg=Object(r["createElementVNode"])("img",{src:"plugins/Morpheus/images/loading-blue.gif"},null,-1),Sg={key:1},wg={colspan:"7"},kg={class:"environment"},Mg={class:"name"},_g={class:"revision"},Dg={class:"released_by"},Ag={class:"released_on"},xg={class:"date"};function Bg(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("ActivityIndicator"),s=Object(r["resolveComponent"])("ContentBlock"),d=Object(r["resolveDirective"])("copy-to-clipboard"),u=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createBlock"])(s,{class:"manageInstallTagCode",feature:"Tag Manager","content-title":"Install Code"},{default:Object(r["withCtx"])((function(){var n,a;return[Object(r["createElementVNode"])("div",dg,[Object(r["createVNode"])(l,{uicontrol:"select",name:"environment","model-value":e.environment,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.environment=t,e.fetchInstallInstructions(e.environment)}),options:e.environments,title:e.translate("TagManager_Environment")},null,8,["model-value","options","title"])]),Object(r["createVNode"])(c,{loading:e.isLoading},null,8,["loading"]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.installInstructions,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:n},[Object(r["createElementVNode"])("p",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(t.description)+" ",1),ug,t.helpUrl?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,target:"_blank",href:t.helpUrl},Object(r["toDisplayString"])(e.translate("TagManager_LearnMore")),9,gg)):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("div",null,[t.embedCode?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("pre",{key:0,textContent:Object(r["toDisplayString"])(t.embedCode)},null,8,bg)),[[d,{}]]):Object(r["createCommentVNode"])("",!0)])])})),128)),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_InstallCodePublishEnvironmentNote","preview"))+" "+Object(r["toDisplayString"])(e.translate("TagManager_ConfigureEnvironmentsSuperUser")),1),Object(r["createElementVNode"])("p",mg,[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.translate("TagManager_InstallCodeDataLayerNote","",""))},null,8,pg),hg,Object(r["createElementVNode"])("a",{target:"_blank",href:e.externalRawLink("https://matomo.org/faq/tag-manager/data-layer-in-matomo-tag-manager/")},Object(r["toDisplayString"])(e.translate("TagManager_LearnMore")),9,fg)]),Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("TagManager_ReleasesOverview")),1),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",null,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",vg,Object(r["toDisplayString"])(e.translate("TagManager_Environment")),1),Object(r["createElementVNode"])("th",jg,Object(r["toDisplayString"])(e.translate("TagManager_VersionName")),1),Object(r["createElementVNode"])("th",Og,Object(r["toDisplayString"])(e.translate("TagManager_VersionRevision")),1),Object(r["createElementVNode"])("th",Tg,Object(r["toDisplayString"])(e.translate("TagManager_ReleasedBy")),1),Object(r["createElementVNode"])("th",yg,Object(r["toDisplayString"])(e.translate("TagManager_ReleasedOn")),1)])]),Object(r["createElementVNode"])("tbody",null,[e.isLoading?(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",Vg,[Object(r["createElementVNode"])("td",Cg,[Object(r["createElementVNode"])("span",Ng,[Eg,Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("General_LoadingData")),1)])])])):Object(r["createCommentVNode"])("",!0),e.isLoading||0!==(null===(n=e.container)||void 0===n||null===(a=n.releases)||void 0===a?void 0:a.length)?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",Sg,[Object(r["createElementVNode"])("td",wg,Object(r["toDisplayString"])(e.translate("TagManager_NoReleasesFound")),1)])),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.sortedReleases,(function(t){var n,a;return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:t.idcontainerrelease},[Object(r["createElementVNode"])("td",kg,Object(r["toDisplayString"])(e.ucfirst(t.environment)),1),Object(r["createElementVNode"])("td",Mg,Object(r["toDisplayString"])(null===(n=e.releaseVersions[t.idcontainerrelease])||void 0===n?void 0:n.name),1),Object(r["createElementVNode"])("td",_g,Object(r["toDisplayString"])(null===(a=e.releaseVersions[t.idcontainerrelease])||void 0===a?void 0:a.revision),1),Object(r["createElementVNode"])("td",Dg,Object(r["toDisplayString"])(t.release_login),1),Object(r["createElementVNode"])("td",Ag,[Object(r["createElementVNode"])("span",xg,Object(r["toDisplayString"])(t.release_date_pretty),1)])])})),128))])],512),[[u]])]})),_:1})}function Lg(e){return Ig(e)||Pg(e)||Gg(e)||Ug()}function Ug(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Pg(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Ig(e){if(Array.isArray(e))return $g(e)}function Fg(e,t){return qg(e)||Rg(e,t)||Gg(e,t)||Hg()}function Hg(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Gg(e,t){if(e){if("string"===typeof e)return $g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$g(e,t):void 0}}function $g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt.release_date?-1:t.index-e.index})),t}}});Xg.render=Bg;var Kg=Xg,Jg={class:"tagManagerTrackingCode"},Yg={key:0},Zg={class:"trackingCodeAdvancedOptions"},Qg={class:"advance-option"},eb=Object(r["createElementVNode"])("span",{class:"icon-chevron-down"},null,-1),tb=Object(r["createElementVNode"])("span",{class:"icon-chevron-up"},null,-1),nb={id:"mtm-advanced-options"},ab=["innerHTML"],ib={key:1,class:"row"},rb={class:"col s12 m4 "},ob={class:"form-group row"},lb={class:"col s12 input-field"},cb={for:"tagManagerTrackingCodeSite",class:"siteSelectorLabel"},sb={class:"sites_autocomplete"},db={class:"col s12 m4"},ub={class:"col s12 m4"},gb=["innerHTML"],bb={key:1,class:"alert alert-info"},mb={href:""},pb={key:0},hb=["href"],fb=Object(r["createTextVNode"])(". "),vb=["innerHTML"],jb=["textContent"],Ob=["innerHTML"],Tb={key:1};function yb(e,t,n,a,i,o){var l=this,c=Object(r["resolveComponent"])("ActivityIndicator"),s=Object(r["resolveComponent"])("SiteSelector"),d=Object(r["resolveComponent"])("Field"),u=Object(r["resolveDirective"])("copy-to-clipboard");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Jg,[e.showContainerRow?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Yg,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_OptionallyCustomiseContainer"))+" ",1),Object(r["createElementVNode"])("div",Zg,[Object(r["createElementVNode"])("div",Qg,[Object(r["createElementVNode"])("span",null,[e.isAdvancedDisplayed?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,href:"javascript:;",onClick:t[0]||(t[0]=Object(r["withModifiers"])((function(t){return e.isAdvancedDisplayed=!0}),["prevent"]))},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("CoreAdminHome_ShowAdvancedOptions"))+" ",1),eb])),e.isAdvancedDisplayed?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:1,href:"javascript:;",onClick:t[1]||(t[1]=Object(r["withModifiers"])((function(t){return e.isAdvancedDisplayed=!1}),["prevent"]))},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("CoreAdminHome_HideAdvancedOptions"))+" ",1),tb])):Object(r["createCommentVNode"])("",!0)])]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",nb,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.getAdvancedStepText)},null,8,ab),e.showContainerRow||e.environments.length>1?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createBlock"])(c,{key:0,loading:!0},null,512)),[[r["vShow"],e.isLoading]]):Object(r["createCommentVNode"])("",!0),e.showContainerRow||e.environments.length>1?Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ib,[Object(r["createElementVNode"])("div",rb,[Object(r["createElementVNode"])("div",ob,[Object(r["createElementVNode"])("div",lb,[Object(r["createElementVNode"])("label",cb,Object(r["toDisplayString"])(e.translate("General_Website")),1),Object(r["createElementVNode"])("div",sb,[Object(r["createVNode"])(s,{id:"tagManagerTrackingCodeSite",modelValue:e.site,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.site=t}),"show-all-sites-item":!1,"switch-site-on-select":!1,"show-selected-site":!0},null,8,["modelValue"])])])])]),Object(r["createElementVNode"])("div",db,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(d,{uicontrol:"select",name:"containers","model-value":e.idContainer,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.idContainer=t,e.onContainerChange()}),options:e.containerOptions,disabled:e.containerOptions.length<=1,"full-width":!0,title:e.translate("TagManager_Container")},null,8,["model-value","options","disabled","title"])])]),Object(r["createElementVNode"])("div",ub,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(d,{uicontrol:"select",name:"environment","model-value":e.environment,"onUpdate:modelValue":t[4]||(t[4]=function(t){e.environment=t,l.$emit("fetchInstallInstructions")}),options:e.environments,disabled:e.environments.length<=1,"full-width":!0,title:e.translate("TagManager_Environment")},null,8,["model-value","options","disabled","title"])])])],512)),[[r["vShow"],!e.isLoading]]):Object(r["createCommentVNode"])("",!0),e.idContainer?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:2,innerHTML:e.$sanitize(e.getAdvancedStepInfo)},null,8,gb)):Object(r["createCommentVNode"])("",!0)])],512),[[r["vShow"],e.isAdvancedDisplayed]])])])):Object(r["createCommentVNode"])("",!0),e.idContainer&&e.noReleaseFound?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",bb,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("TagManager_NoReleasesFoundForContainer"))+" ",1),Object(r["createElementVNode"])("a",mb,Object(r["toDisplayString"])(e.translate("TagManager_PublishVersionToEnvironmentToViewEmbedCode")),1)])):Object(r["createCommentVNode"])("",!0),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.installInstructions,(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])(r["Fragment"],{key:n},[e.showDescription?(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",pb,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(t.description)+" ",1),t.helpUrl?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,target:"_blank",href:t.helpUrl},Object(r["toDisplayString"])(e.translate("TagManager_LearnMore")),9,hb)):Object(r["createCommentVNode"])("",!0),fb])):Object(r["createCommentVNode"])("",!0),e.showPlainMtmSteps?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:1,innerHTML:e.$sanitize(e.getMtmStep3)},null,8,vb)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("div",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("pre",{class:"codeblock",textContent:Object(r["toDisplayString"])(t.embedCode),ref:"codeblock"},null,8,jb),[[u,{}]])])],64)})),128)),e.showBottom&&!e.noReleaseFound&&e.idContainer?(Object(r["openBlock"])(),Object(r["createElementBlock"])(r["Fragment"],{key:2},[e.showTestSection?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",Tb,[(Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["resolveDynamicComponent"])(e.testComponent),{site:e.site},null,8,["site"]))])):(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",{key:0,innerHTML:e.$sanitize(e.getCongratulationsText)},null,8,Ob))],64)):Object(r["createCommentVNode"])("",!0)])}function Vb(e){return"".concat(e.substr(0,1).toUpperCase()).concat(e.substr(1))}var Cb=Object(r["defineComponent"])({props:{showContainerRow:Boolean,showBottom:Boolean,showDescription:Boolean,showPlainMtmSteps:Boolean,showTestSection:Boolean,showAdvancedOptions:{required:!1,type:Boolean,default:!1}},components:{ActivityIndicator:u["ActivityIndicator"],SiteSelector:u["SiteSelector"],Field:g["Field"]},emits:["fetchInstallInstructions"],directives:{CopyToClipboard:u["CopyToClipboard"]},data:function(){return{containerVariables:[],isLoading:!1,idContainer:"",environment:"",environments:[],environmentNameMap:{},containerMap:{},containerOptions:[],site:{id:u["Matomo"].idSite,name:u["Matomo"].helper.htmlDecode(u["Matomo"].siteName)},matomoConfigs:[],releases:[],installInstructions:[],noReleaseFound:!1,isAdvancedDisplayed:!1}},created:function(){var e=this;u["AjaxHelper"].fetch({method:"TagManager.getAvailableEnvironments",filter_limit:"-1"}).then((function(t){var n;n=Array.isArray(t)?t:Object.values(t),e.environmentNameMap=Object.fromEntries(n.map((function(e){var t=e.id,n=e.name;return[t,n]})))})),this.onSiteChange(),this.isAdvancedDisplayed=this.showAdvancedOptions},watch:{site:function(){this.onSiteChange()}},methods:{onSiteChange:function(){var e,t=this;this.installInstructions=[],this.containerOptions=[],this.containerMap={},this.environments=[],this.matomoConfigs=[],this.idContainer="",null!==(e=this.site)&&void 0!==e&&e.id&&(this.isLoading=!0,u["AjaxHelper"].fetch({method:"TagManager.getContainers",filter_limit:"-1",idSite:this.site.id}).then((function(e){if(t.containerOptions=[],null===e||void 0===e||!e.length)return t.idContainer="",t.isAdvancedDisplayed=!0,void t.containerOptions.push({key:"",value:t.translate("TagManager_NoContainersFound")});e.forEach((function(e){t.idContainer||(t.idContainer=e.idcontainer),t.containerMap[e.idcontainer]=e,t.containerOptions.push({key:e.idcontainer,value:e.name})})),t.onContainerChange()})).finally((function(){t.isLoading=!1})))},onContainerChange:function(){var e=this;if(this.noReleaseFound=!1,this.idContainer){this.installInstructions=[];var t=this.containerMap[this.idContainer],n=t.draft.idcontainerversion;this.environment="",this.environments=[];var a=t.releases||[];a.find((function(e){return"live"===e.environment}))&&(this.environment="live"),a.forEach((function(t){if("preview"!==t.environment){e.environment||(e.environment=t.environment);var n=Vb(t.environment);t.environment in e.environmentNameMap&&(n=e.environmentNameMap[t.environment]),e.environments.push({key:t.environment,value:n})}})),this.environments.length||(this.noReleaseFound=!0,this.environments.push({key:"",value:this.translate("TagManager_NoReleasesFound")})),this.$emit("fetchInstallInstructions"),this.fetchVariables(n)}},linkTo:function(e,t,n,a){var i=u["MatomoUrl"].stringify(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{module:"TagManager",action:e,idSite:t,idContainer:n})),r="".concat(window.location.pathname,"?").concat(i);return a&&(r+="#?".concat(u["MatomoUrl"].stringify(a))),r},fetchVariables:function(e){var t,n=this;this.matomoConfigs=[],this.idContainer&&null!==(t=this.site)&&void 0!==t&&t.id&&e&&u["AjaxHelper"].fetch({method:"TagManager.getContainerVariables",filter_limit:"-1",idContainer:this.idContainer,idContainerVersion:e,idSite:this.site.id}).then((function(e){n.matomoConfigs=e.filter((function(e){return"MatomoConfiguration"===e.type}))})).finally((function(){n.isLoading=!1}))}},computed:{getLearnMoreLink:function(){return Object(u["translate"])("TagManager_CustomHtmlTagHelpText",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/container-dashboard-in-matomo-tag-manager/"),"")},getMtmStep3:function(){return Object(u["translate"])("TagManager_CopyCodePasteInHeader","</head>")},getCongratulationsText:function(){return Object(u["translate"])("TagManager_SiteWithoutDataReactFollowStepCompleted","","")},testComponent:function(){return this.showTestSection?Object(u["useExternalPluginComponent"])("JsTrackerInstallCheck","JsTrackerInstallCheck"):""},getAdvancedStepText:function(){var e,t=Object(u["translate"])("TagManager_SelectContainerForWebsite","","");if(this.idContainer)return t;var n=this.linkTo("manageContainers",String(null===(e=this.site)||void 0===e?void 0:e.id),""),a=Object(u["translate"])("TagManager_ManageContainersLink",''),"");return"".concat(t," ").concat(a)},getAdvancedStepInfo:function(){var e=this.site&&this.site.id?this.site.id:"",t=this.linkTo("dashboard",e,this.idContainer,[]);return Object(u["translate"])("TagManager_CustomiseContainer",''),"",Object(u["externalLink"])("https://matomo.org/faq/tag-manager/container-dashboard-in-matomo-tag-manager/"),"")}}});Cb.render=yb;var Nb=Cb,Eb=Object(r["createElementVNode"])("br",null,null,-1),Sb={class:"followStepsHeading"},wb={style:{"list-style":"inside decimal"}};function kb(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("TrackingCodeCommon");return Object(r["openBlock"])(),Object(r["createBlock"])(Object(r["resolveDynamicComponent"])("getTrackingMethodsForSite"===e.currentAction?"div":"ContentBlock"),{anchor:"tagmanager","content-title":e.translate("TagManager_MatomoTagManager")},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("TagManager_MtmTrackingCodeIntro")),1),Eb,Object(r["createElementVNode"])("p",Sb,[Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.translate("SitesManager_SiteWithoutDataCloudflareFollowStepsIntro")),1)]),Object(r["createElementVNode"])("ol",wb,[Object(r["createVNode"])(l,{"show-container-row":e.showContainerRow,showBottom:!0,showDescription:!1,showPlainMtmSteps:!0,showAdvancedOptions:"trackingCodeGenerator"===e.currentAction,showTestSection:"getTrackingMethodsForSite"===e.currentAction&&e.isJsTrackerInstallCheckAvailable,onFetchInstallInstructions:e.fetchInstallInstructions,ref:"trackingCodeCommon"},null,8,["show-container-row","showAdvancedOptions","showTestSection","onFetchInstallInstructions"])])]})),_:1},8,["content-title"])}var Mb=Object(r["defineComponent"])({props:{currentAction:String,showContainerRow:Boolean,isJsTrackerInstallCheckAvailable:Boolean},components:{ContentBlock:u["ContentBlock"],TrackingCodeCommon:Nb},methods:{fetchInstallInstructions:function(){var e,t,n=this,a=this.$refs.trackingCodeCommon;a.installInstructions=[],null!==a&&void 0!==a&&null!==(e=a.site)&&void 0!==e&&e.id&&null!==a&&void 0!==a&&a.environment&&(a.isLoading=!0,u["AjaxHelper"].fetch({method:"TagManager.getContainerInstallInstructions",filter_limit:"-1",idContainer:null===a||void 0===a?void 0:a.idContainer,environment:null===a||void 0===a?void 0:a.environment,idSite:null===a||void 0===a||null===(t=a.site)||void 0===t?void 0:t.id}).then((function(e){a.installInstructions=e,Object(r["nextTick"])((function(){var e=Array.isArray(n.$refs.codeblock)?n.$refs.codeblock:[n.$refs.codeblock];e.forEach((function(e){$(e).effect("highlight",{},1500)}))}))})).finally((function(){a.isLoading=!1})))}}});Mb.render=kb;var _b=Mb,Db={class:"list-style-decimal"},Ab={ref:"step1"},xb=["innerHTML"],Bb=["innerHTML"],Lb=["textContent"],Ub=["innerHTML"],Pb=["textContent"],Ib=["innerHTML"],Fb=["innerHTML"],Hb=["innerHTML"],Gb=["textContent"],$b={style:{"list-style":"lower-alpha","list-style-position":"inside"}},Rb=["innerHTML"],qb=["innerHTML"],zb=["innerHTML"],Wb=["textContent"],Xb=["textContent"],Kb=["innerHTML"],Jb=["textContent"],Yb=["innerHTML"],Zb=["innerHTML"],Qb=["textContent"];function em(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("TrackingCodeCommon"),c=Object(r["resolveDirective"])("copy-to-clipboard");return Object(r["openBlock"])(),Object(r["createElementBlock"])("ol",Db,[Object(r["withDirectives"])(Object(r["createElementVNode"])("li",Ab,[Object(r["createVNode"])(l,{"show-container-row":e.showContainerRow,showBottom:!1,showDescription:!1,onFetchInstallInstructions:e.fetchInstallInstructionsSPA,ref:"trackingCodeCommon"},null,8,["show-container-row","onFetchInstallInstructions"])],512),[[r["vShow"],e.step1HasContent]]),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.setupStep2)},null,8,xb),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep3)},null,8,Bb),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchClickX("TagManager_CreateNewTrigger"))},null,8,Lb),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep5)},null,8,Ub),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchClickX("TagManager_CreateNewTrigger"))},null,8,Pb),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.setupStep7)},null,8,Ib),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep8)},null,8,Fb),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep9)},null,8,Hb),Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("span",{textContent:Object(r["toDisplayString"])(e.fetchFollowStep10)},null,8,Gb),Object(r["createElementVNode"])("ol",$b,[Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep10a)},null,8,Rb),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep10b)},null,8,qb)])]),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep11)},null,8,zb),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchClickX("General_Update"))},null,8,Wb),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchFollowStep13)},null,8,Xb),Object(r["createElementVNode"])("li",{innerHTML:e.$sanitize(e.fetchFollowStep14)},null,8,Kb),Object(r["createElementVNode"])("li",{textContent:Object(r["toDisplayString"])(e.fetchFollowStep15)},null,8,Jb),Object(r["createElementVNode"])("li",null,["react"===e.jsFramework?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:0,innerHTML:e.$sanitize(e.fetchFollowStep16React)},null,8,Yb)):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:1,innerHTML:e.$sanitize(e.fetchFollowStep16SPA)},null,8,Zb)),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.installInstructions,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:t},[Object(r["withDirectives"])(Object(r["createElementVNode"])("pre",{class:"codeblock",textContent:Object(r["toDisplayString"])(e.embedCode),ref:"codeblock"},null,8,Qb),[[c,{}]])])})),128))])])}var tm=Object(r["defineComponent"])({props:{showContainerRow:Boolean,jsFramework:String},components:{TrackingCodeCommon:Nb},directives:{CopyToClipboard:u["CopyToClipboard"]},data:function(){return{setupStep1:"",setupStep2:"",setupStep7:"",installInstructions:[]}},methods:{fetchInstallInstructionsSPA:function(){var e,t,n=this,a=this.$refs.trackingCodeCommon;if(this.installInstructions=[],null!==a&&void 0!==a&&a.idContainer&&null!==a&&void 0!==a&&a.environment&&null!==a&&void 0!==a&&null!==(e=a.site)&&void 0!==e&&e.id){var i=this.linkTo("manageContainers",a.site.id,a.idContainer);this.setupStep1=Object(u["translate"])("TagManager_SPAFollowStep1","
","",''),"");var o=this.linkTo("manageTriggers",a.site.id,a.idContainer);this.setupStep2=Object(u["translate"])("TagManager_SPAFollowStep2",''),"");var l=this.linkTo("manageTags",a.site.id,a.idContainer);this.setupStep7=Object(u["translate"])("TagManager_SPAFollowStep7",''),""),a.isLoading=!0,u["AjaxHelper"].fetch({method:"TagManager.getContainerInstallInstructions",filter_limit:"-1",idContainer:null===a||void 0===a?void 0:a.idContainer,environment:null===a||void 0===a?void 0:a.environment,idSite:null===a||void 0===a||null===(t=a.site)||void 0===t?void 0:t.id,jsFramework:this.jsFramework}).then((function(e){n.installInstructions=e,Object(r["nextTick"])((function(){var e=Array.isArray(n.$refs.codeblock)?n.$refs.codeblock:[n.$refs.codeblock];e.forEach((function(e){$(e).effect("highlight",{},1500)}))}))})).finally((function(){a.isLoading=!1}))}},linkTo:function(e,t,n,a){var i=u["MatomoUrl"].stringify(Object.assign(Object.assign({},u["MatomoUrl"].urlParsed.value),{},{module:"TagManager",action:e,idSite:t,idContainer:n}));return a&&(i+="#?".concat(u["MatomoUrl"].stringify(a))),"?".concat(i)},fetchClickX:function(e){return Object(u["translate"])("General_ClickX",Object(u["translate"])(e))}},computed:{step1HasContent:function(){var e=this.$refs.step1;return e&&""!==e.textContent},fetchFollowStep3:function(){return Object(u["translate"])("TagManager_SPAFollowStep3","".concat(Object(u["translate"])("TagManager_PageViewTriggerName"),""),Object(u["translate"])("TagManager_PageViewTriggerName"),Object(u["externalLink"])("https://matomo.org/faq/tag-manager/how-do-i-track-pageviews-of-my-website-using-matomo-tag-manager/#create-pageview-trigger"),"")},fetchFollowStep5:function(){return Object(u["translate"])("TagManager_SPAFollowStep5","".concat(Object(u["translate"])("TagManager_HistoryChangeTriggerName"),""),Object(u["translate"])("TagManager_CategoryUserEngagement"))},fetchFollowStep8:function(){return Object(u["translate"])("TagManager_SPAFollowStep8","".concat(Object(u["translate"])("TagManager_PageViewTriggerName"),""),"".concat(Object(u["translate"])("TagManager_MatomoTagName"),""),Object(u["translate"])("TagManager_PageViewTriggerName"),Object(u["externalLink"])("https://matomo.org/faq/tag-manager/how-do-i-track-pageviews-of-my-website-using-matomo-tag-manager/#create-pageview-tag"),"")},fetchFollowStep9:function(){return Object(u["translate"])("TagManager_SPAFollowStep9",Object(u["translate"])("TagManager_ConfigureWhatTagDoes"),Object(u["translate"])("TagManager_CustomTitle"),"","")},fetchFollowStep10:function(){return Object(u["translate"])("TagManager_SPAFollowStep10",Object(u["translate"])("TagManager_CustomUrl"))},fetchFollowStep10a:function(){return Object(u["translate"])("TagManager_SPAFollowStep10a","","",Object(u["translate"])("TagManager_CustomUrl"))},fetchFollowStep10b:function(){return Object(u["translate"])("TagManager_SPAFollowStep10b",Object(u["translate"])("TagManager_CustomUrl"),"","")},fetchFollowStep11:function(){return Object(u["translate"])("TagManager_SPAFollowStep11",Object(u["translate"])("TagManager_ConfigureWhenTagDoes"),Object(u["translate"])("TagManager_FireTriggerTitle"),"".concat(Object(u["translate"])("TagManager_HistoryChangeTriggerName"),""),"".concat(Object(u["translate"])("TagManager_PageViewTriggerName"),""))},fetchFollowStep13:function(){return Object(u["translate"])("TagManager_SPAFollowStep13",Object(u["translate"])("TagManager_Publish"))},fetchFollowStep14:function(){return Object(u["translate"])("TagManager_SPAFollowStep14",Object(u["translate"])("TagManager_VersionName"),"","")},fetchFollowStep15:function(){return Object(u["translate"])("TagManager_SPAFollowStep15",Object(u["translate"])("TagManager_CreateVersionAndPublishRelease"))},fetchFollowStep16SPA:function(){return Object(u["translate"])("TagManager_SPAFollowStep16","</head>",Object(u["externalLink"])("https://developer.matomo.org/guides/tagmanager/embedding"),"")},fetchFollowStep16React:function(){return Object(u["translate"])("TagManager_ReactFollowStep16","","","App.js","React.useEffect","Hello World","React.js")}}});tm.render=em;var nm,am,im=tm,rm={class:"nav-wrapper"},om={class:"pull-right"},lm=Object(r["createElementVNode"])("svg",{class:"tm-icon tm-icon-close"},[Object(r["createElementVNode"])("use",{"xlink:href":"#tm-icon-close"})],-1),cm=[lm],sm={class:"pull-right"},dm=Object(r["createElementVNode"])("svg",{"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden"},version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[Object(r["createElementVNode"])("defs",null,[Object(r["createElementVNode"])("symbol",{id:"tm-icon-checkmark",viewBox:"0 0 32 32"},[Object(r["createElementVNode"])("path",{d:"M27 4l-15 15-7-7-5 5 12 12 20-20z"})])])],-1),um=Object(r["createElementVNode"])("svg",{"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden"},version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink"},[Object(r["createElementVNode"])("symbol",{id:"tm-icon-close",viewBox:"0 0 32 32"},[Object(r["createElementVNode"])("path",{d:"M31.33 0.67c0.893 0.893 0.893 2.34 0 3.232l-27.427 27.427c-0.893 0.893-2.34\n 0.893-3.232 0s-0.893-2.34 0-3.232l27.427-27.427c0.892-0.893 2.34-0.893 3.232 0z"}),Object(r["createElementVNode"])("path",{d:"M0.67 0.67c0.893-0.893 2.34-0.893 3.232 0l27.427 27.427c0.893 0.892 0.893\n 2.34 0 3.232s-2.34 0.892-3.232 0l-27.427-27.427c-0.893-0.893-0.893-2.34 0-3.232z"})])],-1),gm={class:"page",style:{clear:"both"}},bm={key:0,id:"secondNavBar",class:"Menu--dashboard z-depth-1"},mm={class:"navbar",role:"menu",style:{padding:"0"}},pm={class:"menuTab",role:"menuitem"},hm={class:"item",style:{"font-weight":"normal"}},fm=Object(r["createTextVNode"])(" Events "),vm={key:0},jm=Object(r["createElementVNode"])("br",null,null,-1),Om=Object(r["createElementVNode"])("br",null,null,-1),Tm=Object(r["createElementVNode"])("label",{for:"onlyfiredTags",class:"lbl-onlyfiredTags"},"Only fired tags",-1),ym={key:0,style:{padding:"0 0 1rem 1.2rem"}},Vm=["onClick","title"],Cm={title:"This tag was fired"},Nm=Object(r["createElementVNode"])("svg",{class:"tm-icon tm-icon-checkmark"},[Object(r["createElementVNode"])("use",{"xlink:href":"#tm-icon-checkmark"})],-1),Em=[Nm],Sm={class:"pageWrap"},wm={class:"home",id:"content"},km=Object(r["createElementVNode"])("h3",null,"Fired Tags",-1),Mm={class:"entityTable"},_m=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Action"),Object(r["createElementVNode"])("th",null,"Name"),Object(r["createElementVNode"])("th",null,"Type"),Object(r["createElementVNode"])("th",null,"Fired count")])],-1),Dm={key:0},Am=Object(r["createElementVNode"])("td",{colspan:"4"},"No tags",-1),xm=[Am],Bm=Object(r["createElementVNode"])("h3",{style:{"margin-top":"30px"}},"Not Yet Fired Tags",-1),Lm={class:"entityTable"},Um=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Name"),Object(r["createElementVNode"])("th",null,"Type")])],-1),Pm=Object(r["createElementVNode"])("td",{colspan:"4"},"No tags",-1),Im=[Pm],Fm=Object(r["createElementVNode"])("h3",null,"Triggers",-1),Hm={class:"entityTable"},Gm=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Name"),Object(r["createElementVNode"])("th",null,"Type")])],-1),$m={key:0},Rm=Object(r["createElementVNode"])("td",{colspan:"4"},"No trigger",-1),qm=[Rm],zm={key:1},Wm=Object(r["createElementVNode"])("h3",null,"Pushed data by this event",-1),Xm={class:"entityTable"},Km={style:{"word-break":"break-all"}},Jm=Object(r["createElementVNode"])("br",null,null,-1),Ym=Object(r["createElementVNode"])("h3",null,"Content after this event",-1),Zm={class:"entityTable"},Qm={style:{"word-break":"break-all"}},ep={class:"entityTable"},tp=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Name"),Object(r["createElementVNode"])("th",null,"Type"),Object(r["createElementVNode"])("th",null,"Value")])],-1),np={key:0},ap=Object(r["createElementVNode"])("td",{colspan:"3"},"No variables",-1),ip=[ap],rp={style:{"word-break":"break-all"}},op={class:"entityTable"},lp=Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",null,"Time"),Object(r["createElementVNode"])("th",null,"Message")])],-1),cp={style:{"word-break":"break-all"}},sp=Object(r["createElementVNode"])("br",null,null,-1);function dp(e,t,n,a,i,o){var l,c,s,d,u,g,b,m,p,h;return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",null,[Object(r["createElementVNode"])("nav",null,[Object(r["createElementVNode"])("div",rm,[Object(r["createElementVNode"])("ul",null,[Object(r["createElementVNode"])("li",null,[Object(r["renderSlot"])(e.$slots,"logo")]),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"tags"===e.contentTab||!e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[0]||(t[0]=function(t){return e.contentTab="tags"})},"Tags")],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"triggers"===e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[1]||(t[1]=function(t){return e.contentTab="triggers"})},"Triggers")],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"variables"===e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[2]||(t[2]=function(t){return e.contentTab="variables"})},"Variables")],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"dataLayer"===e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[3]||(t[3]=function(t){return e.contentTab="dataLayer"})},"Data Layer")],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])({active:"logs"===e.contentTab})},[Object(r["createElementVNode"])("a",{onClick:t[4]||(t[4]=function(t){return e.contentTab="logs"})},"Logs")],2),Object(r["createElementVNode"])("li",om,[Object(r["createElementVNode"])("a",{id:"mtmCloseDebug",onClick:t[5]||(t[5]=function(t){return e.mtmCloseDebugWindow()})},cm)]),Object(r["createElementVNode"])("li",sm,[Object(r["createElementVNode"])("a",{id:"mtmUpdateDebugPosition",onClick:t[6]||(t[6]=function(t){return e.mtmUpdateDebugPosition()})},Object(r["toDisplayString"])(e.positionText),1)])])])]),dm,um,Object(r["createElementVNode"])("div",gm,["logs"!==e.contentTab?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",bm,[Object(r["createElementVNode"])("ul",mm,[Object(r["createElementVNode"])("li",pm,[Object(r["createElementVNode"])("span",hm,[fm,e.mtmEvents.length>0?(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",vm,[jm,Om,Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"checkbox",class:"onlyFiredTags-chk",name:"onlyfiredTags",id:"onlyfiredTags",value:"1","onUpdate:modelValue":t[7]||(t[7]=function(t){return e.onlyfiredTags=t}),style:{"margin-right":"3.5px"}},null,512),[[r["vModelCheckbox"],e.onlyfiredTags]]),Tm])):Object(r["createCommentVNode"])("",!0)])]),0===e.mtmEvents.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",ym,"No event executed")):Object(r["createCommentVNode"])("",!0),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.mtmEventsReversed,(function(t,n){var a,i;return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{class:Object(r["normalizeClass"])(["menuTab",{active:n===e.selectedEventIndex}]),role:"menuitem",key:n},[(t.tags||[]).length||!e.onlyfiredTags?(Object(r["openBlock"])(),Object(r["createElementBlock"])("a",{key:0,class:"item",onClick:function(n){return e.selectEvent(t.index0)},title:"Time: ".concat(t.time,". Trigger: ").concat(null===(a=t.metTrigger)||void 0===a?void 0:a.name)},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(t.index)+": "+Object(r["toDisplayString"])(t.name)+" ",1),Object(r["withDirectives"])(Object(r["createElementVNode"])("span",Cm,Em,512),[[r["vShow"],null===(i=t.tags)||void 0===i?void 0:i.length]])],8,Vm)):Object(r["createCommentVNode"])("",!0)],2)})),128))])])):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("div",Sm,[Object(r["createElementVNode"])("div",wm,[Object(r["withDirectives"])(Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.homeTabTitle),513),[[r["vShow"],"logs"!==e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[km,Object(r["createElementVNode"])("table",Mm,[_m,Object(r["createElementVNode"])("tbody",null,[null!==(l=e.selectedEvent)&&void 0!==l&&null!==(c=l.tags)&&void 0!==c&&c.length?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",Dm,xm)),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])((null===(s=e.selectedEvent)||void 0===s?void 0:s.tags)||[],(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:t},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.action),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.type),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.numExecuted),1)])})),128))])]),Bm,Object(r["createElementVNode"])("table",Lm,[Um,Object(r["createElementVNode"])("tbody",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("tr",null,Im,512),[[r["vShow"],0===e.notFiredTags.length]]),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.notFiredTags,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:t},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.type),1)])})),128))])])],512),[[r["vShow"],"tags"===e.contentTab||!e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Fm,Object(r["createElementVNode"])("table",Hm,[Gm,Object(r["createElementVNode"])("tbody",null,[null!==(d=e.selectedEvent)&&void 0!==d&&d.metTrigger?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",$m,qm)),null!==(u=e.selectedEvent)&&void 0!==u&&u.metTrigger?(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",zm,[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.selectedEvent.metTrigger.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.selectedEvent.metTrigger.type),1)])):Object(r["createCommentVNode"])("",!0)])])],512),[[r["vShow"],"triggers"===e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Wm,Object(r["createElementVNode"])("table",Xm,[Object(r["createElementVNode"])("tbody",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Km,Object(r["toDisplayString"])(e.selectedEventData),1)])])]),Jm,Ym,Object(r["createElementVNode"])("table",Zm,[Object(r["createElementVNode"])("tbody",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("td",Qm,Object(r["toDisplayString"])(e.selectedEventContainerDataLayer),1)])])])],512),[[r["vShow"],"dataLayer"===e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("table",ep,[tp,Object(r["createElementVNode"])("tbody",null,[null!==(g=e.selectedEvent)&&void 0!==g&&null!==(b=g.container)&&void 0!==b&&null!==(m=b.variables)&&void 0!==m&&m.length?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",np,ip)),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])((null===(p=e.selectedEvent)||void 0===p||null===(h=p.container)||void 0===h?void 0:h.variables)||[],(function(t,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:n},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(t.name),1),Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(t.type),1),Object(r["createElementVNode"])("td",rp,Object(r["toDisplayString"])(e.stringifySelectedVariable(t)),1)])})),128))])])],512),[[r["vShow"],"variables"===e.contentTab]]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("table",op,[lp,Object(r["createElementVNode"])("tbody",null,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.mtmLogs,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:t},[Object(r["createElementVNode"])("td",null,Object(r["toDisplayString"])(e.time),1),Object(r["createElementVNode"])("td",cp,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.messages,(function(e,t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:t},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e),1),sp])})),128))])])})),128))])])],512),[[r["vShow"],"logs"===e.contentTab]])])])])])}function up(e){return pp(e)||mp(e)||bp(e)||gp()}function gp(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function bp(e,t){if(e){if("string"===typeof e)return hp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?hp(e,t):void 0}}function mp(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function pp(e){if(Array.isArray(e))return hp(e)}function hp(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);nt||n.push.apply(n,up(e.tags.map((function(e){return e.name}))))}));var a=[];return this.selectedEvent.container.tags.forEach((function(e){-1===n.indexOf(e.name)&&a.push(e)})),a},selectedEvent:function(){return this.mtmEvents[this.selectedEventIndex]},mtmEvents:function(){return window.mtmDbgData.mtmEvents},mtmEventsReversed:function(){var e=up(this.mtmEvents);return e.reverse(),e},mtmLogs:function(){return window.mtmDbgData.mtmLogs},selectedEventData:function(){var e;return(null===(e=this.selectedEvent)||void 0===e?void 0:e.eventData)&&JSON.stringify(this.selectedEvent.eventData,Tp())},selectedEventContainerDataLayer:function(){var e,t;return(null===(e=this.selectedEvent)||void 0===e||null===(t=e.container)||void 0===t?void 0:t.dataLayer)&&JSON.stringify(this.selectedEvent.container.dataLayer,Tp())}}});yp.render=dp;var Vp=yp,Cp={class:"copyMtmObjectDialog"},Np=["innerHTML"],Ep=["innerHTML"];function Sp(e,t,n,a,i,o){var l=Object(r["resolveComponent"])("Field"),c=Object(r["resolveDirective"])("form");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Cp,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.getCopyDialogTitle),1),Object(r["createElementVNode"])("p",null,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.getCopyDescription)+" ",1),Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.getLearnMoreLink),class:"learnMore"},null,8,Np)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{uicontrol:"site",name:"destinationSite",title:e.translate("TagManager_ChooseWebsite"),modelValue:e.site,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.site=t})},null,8,["title","modelValue"]),"container"!==e.copyType.toLowerCase()?(Object(r["openBlock"])(),Object(r["createBlock"])(l,{key:0,uicontrol:"select",name:"idDestinationContainer",options:e.containerOptions,disabled:e.containerOptions.length<=1,"full-width":!0,title:e.translate("TagManager_Container"),modelValue:e.idDestinationContainer,"onUpdate:modelValue":t[1]||(t[1]=function(t){return e.idDestinationContainer=t})},null,8,["options","disabled","title","modelValue"])):Object(r["createCommentVNode"])("",!0),"container"===e.copyType.toLowerCase()?(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",{key:1,class:"copyNote",innerHTML:e.$sanitize(e.getCopyContainerNote)},null,8,Ep)):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("button",{class:"btn",onClick:t[2]||(t[2]=function(){return e.performCopy&&e.performCopy.apply(e,arguments)})},Object(r["toDisplayString"])(e.translate("General_Copy")),1)],512),[[c]])])}var wp=Object(r["defineComponent"])({props:{defaultSite:{type:Object,required:!0},copyType:{type:String,required:!0},copyNonce:{type:String,required:!1,default:""},idToCopy:{type:[String,Number],required:!0},idSourceContainer:{type:String,required:!1,default:""},idContainerVersion:{type:Number,required:!1,default:0}},directives:{Form:g["Form"]},components:{Field:g["Field"]},data:function(){return{site:this.defaultSite,idDestinationContainer:"",containerOptions:[]}},created:function(){this.onSiteChange(),this.idDestinationContainer=this.idSourceContainer},watch:{site:function(){this.onSiteChange()}},methods:{onSiteChange:function(){var e,t=this;"container"!==this.copyType.toLowerCase()&&(this.containerOptions=[],this.idDestinationContainer="",null!==(e=this.site)&&void 0!==e&&e.id&&u["AjaxHelper"].fetch({method:"TagManager.getContainers",filter_limit:"-1",idSite:this.site.id}).then((function(e){if(t.containerOptions=[],null===e||void 0===e||!e.length)return t.idDestinationContainer="",void t.containerOptions.push({key:"",value:t.translate("TagManager_NoContainersFound")});e.forEach((function(e){t.idDestinationContainer||(t.idDestinationContainer=e.idcontainer),t.containerOptions.push({key:e.idcontainer,value:e.name})}))})))},performCopy:function(){var e,t=this,n={module:"TagManager",action:"",idSite:this.defaultSite.id,idDestinationSite:null!==(e=this.site)&&void 0!==e&&e.id?this.site.id:0,nonce:this.copyNonce,idDestinationContainer:"",idSourceContainer:"",idContainerVersion:0,idContainer:0,idTag:0,idTrigger:0,idVariable:0};switch(this.copyType.toLowerCase()){case"container":n.action="copyContainer",n.idContainer=this.idToCopy;break;case"tag":n.action="copyTag",n.idTag=this.idToCopy;break;case"trigger":n.action="copyTrigger",n.idTrigger=this.idToCopy;break;case"variable":n.action="copyVariable",n.idVariable=this.idToCopy;break;default:throw Error("Unrecognised copy object type.")}this.idDestinationContainer&&(n.idDestinationContainer=this.idDestinationContainer),this.idSourceContainer&&(n.idSourceContainer=this.idSourceContainer),this.idContainerVersion>0&&(n.idContainerVersion=this.idContainerVersion),u["AjaxHelper"].fetch(n).then((function(e){if(!e||!e.isSuccess||!e.urlToNewCopy){var n=Object(u["translate"])("General_ErrorRequest","",""),a=u["NotificationsStore"].show({message:n,id:"CopyDialogResultNotification",context:"error",type:"transient"});return u["NotificationsStore"].scrollToNotification(a),void window.Piwik_Popover.close()}t.reloadEntityStore(),t.displaySuccessNotification(e.urlToNewCopy),window.Piwik_Popover.close()}))},reloadEntityStore:function(){switch(this.copyType.toLowerCase()){case"container":gd.reload();break;case"tag":po.reload(this.idSourceContainer,this.idContainerVersion);break;case"trigger":Va.reload(this.idSourceContainer,this.idContainerVersion);break;case"variable":vt.reload(this.idSourceContainer,this.idContainerVersion);break;default:throw Error("Unrecognised copy object type.")}},displaySuccessNotification:function(e){var t="TagManager_CopyXSuccess",n="";switch(this.copyType.toLowerCase()){case"container":n="TagManager_ContainerLowercase";break;case"tag":n="TagManager_TagLowercase";break;case"trigger":n="TagManager_TriggerLowercase";break;case"variable":n="TagManager_VariableLowercase";break;default:throw Error("Unrecognised copy object type.")}var a=Object(u["translate"])(t,[''),Object(u["translate"])(n),""]),i=u["NotificationsStore"].show({message:a,id:"CopyDialogResultNotification",context:"success",type:"transient"});u["NotificationsStore"].scrollToNotification(i)}},computed:{getCopyDialogTitle:function(){var e="";switch(this.copyType.toLowerCase()){case"container":e=Object(u["translate"])("TagManager_Container");break;case"tag":e=Object(u["translate"])("TagManager_Tag");break;case"trigger":e=Object(u["translate"])("TagManager_Trigger");break;case"variable":e=Object(u["translate"])("TagManager_Variable");break;default:throw Error("Unrecognised copy object type.")}return Object(u["translate"])("TagManager_CopyX",e)},getCopyDescription:function(){if("container"===this.copyType.toLowerCase())return Object(u["translate"])("TagManager_CopyContainerDescription");var e="";switch(this.copyType.toLowerCase()){case"tag":e=Object(u["translate"])("TagManager_TagLowercase");break;case"trigger":e=Object(u["translate"])("TagManager_TriggerLowercase");break;case"variable":e=Object(u["translate"])("TagManager_VariableLowercase");break;default:throw Error("Unrecognised copy object type.")}return Object(u["translate"])("TagManager_CopyXDescription",e)},getCopyContainerNote:function(){return Object(u["translate"])("TagManager_CopyContainerNote","","")},getCopyUrl:function(){var e,t={module:"TagManager",action:"",idSite:this.defaultSite.id,idDestinationSite:null!==(e=this.site)&&void 0!==e&&e.id?this.site.id:0,nonce:this.copyNonce,idDestinationContainer:"",idSourceContainer:"",idContainerVersion:0,idContainer:0,idTag:0,idTrigger:0,idVariable:0};switch(this.copyType.toLowerCase()){case"container":t.action="copyContainer",t.idContainer=this.idToCopy;break;case"tag":t.action="copyTag",t.idTag=this.idToCopy;break;case"trigger":t.action="copyTrigger",t.idTrigger=this.idToCopy;break;case"variable":t.action="copyVariable",t.idVariable=this.idToCopy;break;default:throw Error("Unrecognised copy object type.")}return this.idDestinationContainer&&(t.idDestinationContainer=this.idDestinationContainer),this.idSourceContainer&&(t.idSourceContainer=this.idSourceContainer),this.idContainerVersion>0&&(t.idContainerVersion=this.idContainerVersion),"?".concat(u["MatomoUrl"].stringify(t))},getLearnMoreLink:function(){var e="";switch(this.copyType.toLowerCase()){case"container":e="https://matomo.org/faq/tag-manager/how-to-copy-a-matomo-tag-manager-container-and-its-components";break;case"tag":e="https://matomo.org/faq/tag-manager/how-to-copy-a-tag-in-matomo-tag-manager ";break;case"trigger":e="https://matomo.org/faq/tag-manager/how-to-copy-a-trigger-in-matomo-tag-manager";break;case"variable":e="https://matomo.org/faq/tag-manager/how-to-copy-a-variable-in-matomo-tag-manager";break;default:throw Error("Unrecognised copy object type.")}var t=Object(u["externalLink"])(e);return Object(u["translate"])("TagManager_LearnMoreFullStop",t,"")}}});wp.render=Sp;var kp=wp;
/*!
* Matomo - free/libre analytics platform
*
diff --git a/vue/src/Variable/VariableEdit.vue b/vue/src/Variable/VariableEdit.vue
index d056bfdb3..c0805471f 100644
--- a/vue/src/Variable/VariableEdit.vue
+++ b/vue/src/Variable/VariableEdit.vue
@@ -94,7 +94,19 @@
-