| @@ -1,6 +1,1683 @@ | ||
| 1 | 1 | (self["webpackChunkelementorFrontend"] = self["webpackChunkelementorFrontend"] || []).push([["frontend-modules"],{ |
| 2 | 2 | |
| 3 | +/***/ "../app/assets/js/event-track/apps-event-tracking.js": | |
| 4 | +/*!***********************************************************!*\ | |
| 5 | + !*** ../app/assets/js/event-track/apps-event-tracking.js ***! | |
| 6 | + \***********************************************************/ | |
| 7 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8 | + | |
| 9 | +"use strict"; | |
| 10 | + | |
| 11 | + | |
| 12 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 13 | +Object.defineProperty(exports, "__esModule", ({ | |
| 14 | + value: true | |
| 15 | +})); | |
| 16 | +exports.appsEventTrackingDispatch = exports.AppsEventTracking = void 0; | |
| 17 | +var _eventsConfig = _interopRequireDefault(__webpack_require__(/*! ../../../../core/common/modules/events-manager/assets/js/events-config */ "../core/common/modules/events-manager/assets/js/events-config.js")); | |
| 18 | +const EVENTS_MAP = { | |
| 19 | + PAGE_VIEWS_WEBSITE_TEMPLATES: 'page_views_website_templates', | |
| 20 | + KITS_CLOUD_UPGRADE_CLICKED: 'kits_cloud_upgrade_clicked', | |
| 21 | + EXPORT_KIT_CUSTOMIZATION: 'export_kit_customization', | |
| 22 | + IMPORT_KIT_CUSTOMIZATION: 'import_kit_customization', | |
| 23 | + KIT_IMPORT_STATUS: 'kit_import_status', | |
| 24 | + KIT_CLOUD_LIBRARY_APPLY: 'kit_cloud_library_apply', | |
| 25 | + KIT_CLOUD_LIBRARY_DELETE: 'kit_cloud_library_delete', | |
| 26 | + IMPORT_EXPORT_ADMIN_ACTION: 'ie_admin_action', | |
| 27 | + KIT_IMPORT_UPLOAD_FILE: 'kit_import_upload_file' | |
| 28 | +}; | |
| 29 | +const appsEventTrackingDispatch = (command, eventParams) => { | |
| 30 | + // Add existing eventParams key value pair to the data/details object. | |
| 31 | + const objectCreator = (array, obj) => { | |
| 32 | + for (const key of array) { | |
| 33 | + if (eventParams.hasOwnProperty(key) && eventParams[key] !== null) { | |
| 34 | + obj[key] = eventParams[key]; | |
| 35 | + } | |
| 36 | + } | |
| 37 | + return obj; | |
| 38 | + }; | |
| 39 | + const dataKeys = []; | |
| 40 | + const detailsKeys = ['layout', 'site_part', 'error', 'document_name', 'document_type', 'view_type_clicked', 'tag', 'sort_direction', 'sort_type', 'action', 'grid_location', 'kit_name', 'page_source', 'element_position', 'element', 'event_type', 'modal_type', 'method', 'status', 'step', 'item', 'category', 'element_location', 'search_term', 'section', 'site_area']; | |
| 41 | + const data = {}; | |
| 42 | + const details = {}; | |
| 43 | + const init = () => { | |
| 44 | + objectCreator(detailsKeys, details); | |
| 45 | + objectCreator(dataKeys, data); | |
| 46 | + const commandSplit = command.split('/'); | |
| 47 | + data.placement = commandSplit[0]; | |
| 48 | + data.event = commandSplit[1]; | |
| 49 | + | |
| 50 | + // If 'details' is not empty, add the details object to the data object. | |
| 51 | + if (Object.keys(details).length) { | |
| 52 | + data.details = details; | |
| 53 | + } | |
| 54 | + }; | |
| 55 | + init(); | |
| 56 | + $e.run(command, data); | |
| 57 | +}; | |
| 58 | +exports.appsEventTrackingDispatch = appsEventTrackingDispatch; | |
| 59 | +class AppsEventTracking { | |
| 60 | + static dispatchEvent(eventName, payload) { | |
| 61 | + return elementorCommon.eventsManager.dispatchEvent(eventName, payload); | |
| 62 | + } | |
| 63 | + static sendPageViewsWebsiteTemplates(page) { | |
| 64 | + return this.dispatchEvent(EVENTS_MAP.PAGE_VIEWS_WEBSITE_TEMPLATES, { | |
| 65 | + trigger: _eventsConfig.default.triggers.pageLoaded, | |
| 66 | + page_loaded: page, | |
| 67 | + secondary_location: page | |
| 68 | + }); | |
| 69 | + } | |
| 70 | + static sendKitsCloudUpgradeClicked(upgradeLocation) { | |
| 71 | + return this.dispatchEvent(EVENTS_MAP.KITS_CLOUD_UPGRADE_CLICKED, { | |
| 72 | + trigger: _eventsConfig.default.triggers.click, | |
| 73 | + secondary_location: upgradeLocation, | |
| 74 | + upgrade_location: upgradeLocation | |
| 75 | + }); | |
| 76 | + } | |
| 77 | + static sendExportKitCustomization(payload) { | |
| 78 | + return this.dispatchEvent(EVENTS_MAP.EXPORT_KIT_CUSTOMIZATION, { | |
| 79 | + trigger: _eventsConfig.default.triggers.click, | |
| 80 | + ...payload | |
| 81 | + }); | |
| 82 | + } | |
| 83 | + static sendImportKitCustomization(payload) { | |
| 84 | + return this.dispatchEvent(EVENTS_MAP.IMPORT_KIT_CUSTOMIZATION, { | |
| 85 | + trigger: _eventsConfig.default.triggers.click, | |
| 86 | + ...payload | |
| 87 | + }); | |
| 88 | + } | |
| 89 | + static sendKitImportStatus(error = null) { | |
| 90 | + const isError = !!error; | |
| 91 | + return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_STATUS, { | |
| 92 | + kit_import_status: !isError, | |
| 93 | + ...(isError && { | |
| 94 | + kit_import_error: error.message | |
| 95 | + }) | |
| 96 | + }); | |
| 97 | + } | |
| 98 | + static sendKitCloudLibraryApply(kitId, kitApplyUrl) { | |
| 99 | + return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_APPLY, { | |
| 100 | + trigger: _eventsConfig.default.triggers.click, | |
| 101 | + kit_cloud_id: kitId, | |
| 102 | + ...(kitApplyUrl && { | |
| 103 | + kit_apply_url: kitApplyUrl | |
| 104 | + }) | |
| 105 | + }); | |
| 106 | + } | |
| 107 | + static sendKitCloudLibraryDelete() { | |
| 108 | + return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_DELETE, { | |
| 109 | + trigger: _eventsConfig.default.triggers.click | |
| 110 | + }); | |
| 111 | + } | |
| 112 | + static sendImportExportAdminAction(actionType) { | |
| 113 | + return this.dispatchEvent(EVENTS_MAP.IMPORT_EXPORT_ADMIN_ACTION, { | |
| 114 | + trigger: _eventsConfig.default.triggers.click, | |
| 115 | + action_type: actionType | |
| 116 | + }); | |
| 117 | + } | |
| 118 | + static sendKitImportUploadFile(status) { | |
| 119 | + return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_UPLOAD_FILE, { | |
| 120 | + kit_import_upload_file_status: status | |
| 121 | + }); | |
| 122 | + } | |
| 123 | +} | |
| 124 | +exports.AppsEventTracking = AppsEventTracking; | |
| 125 | + | |
| 126 | +/***/ }), | |
| 127 | + | |
| 128 | +/***/ "../app/assets/js/event-track/dashboard/action-controls.js": | |
| 129 | +/*!*****************************************************************!*\ | |
| 130 | + !*** ../app/assets/js/event-track/dashboard/action-controls.js ***! | |
| 131 | + \*****************************************************************/ | |
| 132 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 133 | + | |
| 134 | +"use strict"; | |
| 135 | + | |
| 136 | + | |
| 137 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 138 | +Object.defineProperty(exports, "__esModule", ({ | |
| 139 | + value: true | |
| 140 | +})); | |
| 141 | +exports["default"] = void 0; | |
| 142 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 143 | +__webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ "../node_modules/core-js/modules/esnext.iterator.for-each.js"); | |
| 144 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 145 | +var _utils = __webpack_require__(/*! ./utils */ "../app/assets/js/event-track/dashboard/utils.js"); | |
| 146 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 147 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } | |
| 148 | +const EXCLUDED_SELECTORS = { | |
| 149 | + ADMIN_MENU: '#adminmenu', | |
| 150 | + TOP_BAR: '.e-admin-top-bar', | |
| 151 | + TOP_BAR_EDITOR_ONE: '#editor-one-top-bar', | |
| 152 | + WP_ADMIN_BAR: '#wpadminbar', | |
| 153 | + SUBMENU: '.wp-submenu', | |
| 154 | + PROMO_PAGE: '.e-feature-promotion', | |
| 155 | + PROMO_BLANK_STATE: '.elementor-blank_state', | |
| 156 | + APP: '.e-app', | |
| 157 | + SIDEBAR_NAVIGATION: '#editor-one-sidebar-navigation', | |
| 158 | + FLYOUT_MENU: '.elementor-submenu-flyout' | |
| 159 | +}; | |
| 160 | +class ActionControlTracking extends _baseTracking.default { | |
| 161 | + static init() { | |
| 162 | + if (!_utils.DashboardUtils.isElementorPage()) { | |
| 163 | + return; | |
| 164 | + } | |
| 165 | + this.attachDelegatedHandlers(); | |
| 166 | + this.addTrackingAttributesToFilterButtons(); | |
| 167 | + this.initializeLinkDataIds(); | |
| 168 | + } | |
| 169 | + static initializeLinkDataIds() { | |
| 170 | + const initializeLinks = () => { | |
| 171 | + const links = document.querySelectorAll('a[href]'); | |
| 172 | + links.forEach(link => { | |
| 173 | + if (this.isExcludedElement(link) || this.isNavigationLink(link) || link.hasAttribute('data-id')) { | |
| 174 | + return; | |
| 175 | + } | |
| 176 | + const href = link.getAttribute('href'); | |
| 177 | + if (!href) { | |
| 178 | + return; | |
| 179 | + } | |
| 180 | + const cleanedHref = this.removeNonceFromUrl(href); | |
| 181 | + if (cleanedHref) { | |
| 182 | + link.setAttribute('data-id', cleanedHref); | |
| 183 | + } | |
| 184 | + }); | |
| 185 | + }; | |
| 186 | + if ('loading' === document.readyState) { | |
| 187 | + document.addEventListener('DOMContentLoaded', initializeLinks); | |
| 188 | + } else { | |
| 189 | + initializeLinks(); | |
| 190 | + } | |
| 191 | + } | |
| 192 | + static addTrackingAttributesToFilterButtons() { | |
| 193 | + const body = document.body; | |
| 194 | + if (!body) { | |
| 195 | + return; | |
| 196 | + } | |
| 197 | + let screenPrefix = ''; | |
| 198 | + switch (true) { | |
| 199 | + case body.classList.contains('post-type-elementor_library'): | |
| 200 | + screenPrefix = 'elementor_library-library'; | |
| 201 | + break; | |
| 202 | + case body.classList.contains('post-type-e-floating-buttons'): | |
| 203 | + screenPrefix = 'e-floating-buttons'; | |
| 204 | + break; | |
| 205 | + default: | |
| 206 | + return; | |
| 207 | + } | |
| 208 | + const addDataIdToListTableButtons = () => { | |
| 209 | + const buttonConfigs = [{ | |
| 210 | + id: 'post-query-submit', | |
| 211 | + suffix: 'filter' | |
| 212 | + }, { | |
| 213 | + id: 'search-submit', | |
| 214 | + suffix: 'search' | |
| 215 | + }, { | |
| 216 | + id: 'doaction', | |
| 217 | + suffix: 'apply' | |
| 218 | + }, { | |
| 219 | + id: 'doaction2', | |
| 220 | + suffix: 'apply-bottom' | |
| 221 | + }]; | |
| 222 | + buttonConfigs.forEach(config => { | |
| 223 | + const button = document.getElementById(config.id); | |
| 224 | + if (!button || button.hasAttribute('data-id')) { | |
| 225 | + return; | |
| 226 | + } | |
| 227 | + button.setAttribute('data-id', `${screenPrefix}-button-${config.suffix}`); | |
| 228 | + }); | |
| 229 | + }; | |
| 230 | + if ('loading' === document.readyState) { | |
| 231 | + document.addEventListener('DOMContentLoaded', addDataIdToListTableButtons); | |
| 232 | + } else { | |
| 233 | + addDataIdToListTableButtons(); | |
| 234 | + } | |
| 235 | + } | |
| 236 | + static isExcludedElement(element) { | |
| 237 | + for (const selector of Object.values(EXCLUDED_SELECTORS)) { | |
| 238 | + if (element.closest(selector)) { | |
| 239 | + return true; | |
| 240 | + } | |
| 241 | + } | |
| 242 | + if (element.classList.contains('go-pro')) { | |
| 243 | + return true; | |
| 244 | + } | |
| 245 | + return false; | |
| 246 | + } | |
| 247 | + static attachDelegatedHandlers() { | |
| 248 | + const FILTER_BUTTON_IDS = ['search-submit', 'post-query-submit']; | |
| 249 | + this.addEventListenerTracked(document, 'click', event => { | |
| 250 | + const base = event.target && 1 === event.target.nodeType ? event.target : event.target?.parentElement; | |
| 251 | + if (!base) { | |
| 252 | + return; | |
| 253 | + } | |
| 254 | + const toggle = base.closest('.elementor-role-toggle'); | |
| 255 | + if (toggle && !this.isExcludedElement(toggle)) { | |
| 256 | + this.trackControl(toggle, _wpDashboardTracking.CONTROL_TYPES.TOGGLE); | |
| 257 | + return; | |
| 258 | + } | |
| 259 | + const button = base.closest('button, input[type="submit"], input[type="button"], .button, .e-btn'); | |
| 260 | + if (button && !this.isExcludedElement(button)) { | |
| 261 | + if (FILTER_BUTTON_IDS.includes(button.id)) { | |
| 262 | + this.trackControl(button, _wpDashboardTracking.CONTROL_TYPES.FILTER); | |
| 263 | + return; | |
| 264 | + } | |
| 265 | + this.trackControl(button, _wpDashboardTracking.CONTROL_TYPES.BUTTON); | |
| 266 | + return; | |
| 267 | + } | |
| 268 | + const link = base.closest('a'); | |
| 269 | + if (link && !this.isExcludedElement(link) && !this.isNavigationLink(link)) { | |
| 270 | + this.trackControl(link, _wpDashboardTracking.CONTROL_TYPES.LINK); | |
| 271 | + } | |
| 272 | + }, { | |
| 273 | + capture: false | |
| 274 | + }); | |
| 275 | + this.addEventListenerTracked(document, 'change', event => { | |
| 276 | + const base = event.target && 1 === event.target.nodeType ? event.target : event.target?.parentElement; | |
| 277 | + if (!base) { | |
| 278 | + return; | |
| 279 | + } | |
| 280 | + let toggle = null; | |
| 281 | + if (_wpDashboardTracking.default.isEditorOneActive()) { | |
| 282 | + toggle = base.closest('.MuiSwitch-switchBase'); | |
| 283 | + } else { | |
| 284 | + toggle = base.closest('.components-toggle-control'); | |
| 285 | + } | |
| 286 | + if (toggle && !this.isExcludedElement(toggle)) { | |
| 287 | + this.trackControl(toggle, _wpDashboardTracking.CONTROL_TYPES.TOGGLE); | |
| 288 | + return; | |
| 289 | + } | |
| 290 | + const checkbox = base.closest('input[type="checkbox"]'); | |
| 291 | + if (checkbox && !this.isExcludedElement(checkbox)) { | |
| 292 | + this.trackControl(checkbox, _wpDashboardTracking.CONTROL_TYPES.CHECKBOX); | |
| 293 | + return; | |
| 294 | + } | |
| 295 | + const radio = base.closest('input[type="radio"]'); | |
| 296 | + if (radio && !this.isExcludedElement(radio)) { | |
| 297 | + this.trackControl(radio, _wpDashboardTracking.CONTROL_TYPES.RADIO); | |
| 298 | + return; | |
| 299 | + } | |
| 300 | + const select = base.closest('select'); | |
| 301 | + if (select && !this.isExcludedElement(select)) { | |
| 302 | + this.trackControl(select, _wpDashboardTracking.CONTROL_TYPES.SELECT); | |
| 303 | + } | |
| 304 | + }); | |
| 305 | + } | |
| 306 | + static isNavigationLink(link) { | |
| 307 | + const href = link.getAttribute('href'); | |
| 308 | + if (!href) { | |
| 309 | + return false; | |
| 310 | + } | |
| 311 | + if (href.startsWith('#') && href.includes('tab')) { | |
| 312 | + return true; | |
| 313 | + } | |
| 314 | + if (link.classList.contains('nav-tab')) { | |
| 315 | + return true; | |
| 316 | + } | |
| 317 | + const isInNavigation = link.closest('.wp-submenu, #adminmenu, .e-admin-top-bar, #wpadminbar'); | |
| 318 | + return !!isInNavigation; | |
| 319 | + } | |
| 320 | + static trackControl(element, controlType) { | |
| 321 | + const controlIdentifier = this.extractControlIdentifier(element, controlType); | |
| 322 | + if (!controlIdentifier) { | |
| 323 | + return; | |
| 324 | + } | |
| 325 | + _wpDashboardTracking.default.trackActionControl(controlIdentifier, controlType); | |
| 326 | + } | |
| 327 | + static extractControlIdentifier(element, controlType) { | |
| 328 | + if (_wpDashboardTracking.CONTROL_TYPES.RADIO === controlType) { | |
| 329 | + const name = element.getAttribute('name'); | |
| 330 | + const value = element.value || element.getAttribute('value'); | |
| 331 | + if (name && value) { | |
| 332 | + return `${name}-${value}`; | |
| 333 | + } | |
| 334 | + if (name) { | |
| 335 | + return name; | |
| 336 | + } | |
| 337 | + } | |
| 338 | + if (_wpDashboardTracking.CONTROL_TYPES.SELECT === controlType) { | |
| 339 | + const name = element.getAttribute('name'); | |
| 340 | + if (name) { | |
| 341 | + return name; | |
| 342 | + } | |
| 343 | + } | |
| 344 | + if (_wpDashboardTracking.CONTROL_TYPES.CHECKBOX === controlType) { | |
| 345 | + const name = element.getAttribute('name'); | |
| 346 | + if (name) { | |
| 347 | + const checkboxesWithSameName = document.querySelectorAll(`input[type="checkbox"][name="${CSS.escape(name)}"]`); | |
| 348 | + if (checkboxesWithSameName.length > 1) { | |
| 349 | + const value = element.value || element.getAttribute('value'); | |
| 350 | + if (value) { | |
| 351 | + return `${name}-${value}`; | |
| 352 | + } | |
| 353 | + } | |
| 354 | + return name; | |
| 355 | + } | |
| 356 | + } | |
| 357 | + if (_wpDashboardTracking.CONTROL_TYPES.LINK === controlType) { | |
| 358 | + const dataId = element.getAttribute('data-id'); | |
| 359 | + if (dataId) { | |
| 360 | + return dataId; | |
| 361 | + } | |
| 362 | + const href = element.getAttribute('href'); | |
| 363 | + if (href) { | |
| 364 | + return this.removeNonceFromUrl(href); | |
| 365 | + } | |
| 366 | + } | |
| 367 | + if (_wpDashboardTracking.CONTROL_TYPES.BUTTON === controlType || _wpDashboardTracking.CONTROL_TYPES.TOGGLE === controlType || _wpDashboardTracking.CONTROL_TYPES.FILTER === controlType) { | |
| 368 | + const dataId = element.getAttribute('data-id'); | |
| 369 | + if (dataId) { | |
| 370 | + return dataId; | |
| 371 | + } | |
| 372 | + const classIdMatch = this.extractClassId(element); | |
| 373 | + if (classIdMatch) { | |
| 374 | + return classIdMatch; | |
| 375 | + } | |
| 376 | + } | |
| 377 | + return ''; | |
| 378 | + } | |
| 379 | + static extractClassId(element) { | |
| 380 | + const classes = element.className; | |
| 381 | + if (!classes || 'string' !== typeof classes) { | |
| 382 | + return ''; | |
| 383 | + } | |
| 384 | + const classList = classes.split(' '); | |
| 385 | + for (const cls of classList) { | |
| 386 | + if (cls.startsWith('e-id-')) { | |
| 387 | + return cls.substring(5); | |
| 388 | + } | |
| 389 | + } | |
| 390 | + return ''; | |
| 391 | + } | |
| 392 | + static removeNonceFromUrl(url) { | |
| 393 | + try { | |
| 394 | + const urlObj = new URL(url, window.location.origin); | |
| 395 | + urlObj.searchParams.delete('_wpnonce'); | |
| 396 | + const postParam = urlObj.searchParams.get('post'); | |
| 397 | + if (postParam !== null && /^[0-9]+$/.test(postParam)) { | |
| 398 | + urlObj.searchParams.delete('post'); | |
| 399 | + } | |
| 400 | + return urlObj.pathname + urlObj.search + urlObj.hash; | |
| 401 | + } catch (e) { | |
| 402 | + return url; | |
| 403 | + } | |
| 404 | + } | |
| 405 | +} | |
| 406 | +var _default = exports["default"] = ActionControlTracking; | |
| 407 | + | |
| 408 | +/***/ }), | |
| 409 | + | |
| 410 | +/***/ "../app/assets/js/event-track/dashboard/base-tracking.js": | |
| 411 | +/*!***************************************************************!*\ | |
| 412 | + !*** ../app/assets/js/event-track/dashboard/base-tracking.js ***! | |
| 413 | + \***************************************************************/ | |
| 414 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 415 | + | |
| 416 | +"use strict"; | |
| 417 | + | |
| 418 | + | |
| 419 | +Object.defineProperty(exports, "__esModule", ({ | |
| 420 | + value: true | |
| 421 | +})); | |
| 422 | +exports["default"] = void 0; | |
| 423 | +__webpack_require__(/*! core-js/modules/es.array.push.js */ "../node_modules/core-js/modules/es.array.push.js"); | |
| 424 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 425 | +__webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ "../node_modules/core-js/modules/esnext.iterator.for-each.js"); | |
| 426 | +class BaseTracking { | |
| 427 | + static ensureOwnArrays() { | |
| 428 | + if (!Object.prototype.hasOwnProperty.call(this, 'observers')) { | |
| 429 | + this.observers = []; | |
| 430 | + } | |
| 431 | + if (!Object.prototype.hasOwnProperty.call(this, 'eventListeners')) { | |
| 432 | + this.eventListeners = []; | |
| 433 | + } | |
| 434 | + } | |
| 435 | + static destroy() { | |
| 436 | + this.ensureOwnArrays(); | |
| 437 | + this.observers.forEach(observer => observer.disconnect()); | |
| 438 | + this.observers = []; | |
| 439 | + this.eventListeners.forEach(({ | |
| 440 | + target, | |
| 441 | + type, | |
| 442 | + handler, | |
| 443 | + options | |
| 444 | + }) => { | |
| 445 | + target.removeEventListener(type, handler, options); | |
| 446 | + }); | |
| 447 | + this.eventListeners = []; | |
| 448 | + } | |
| 449 | + static addObserver(target, options, callback) { | |
| 450 | + this.ensureOwnArrays(); | |
| 451 | + const observer = new MutationObserver(callback); | |
| 452 | + observer.observe(target, options); | |
| 453 | + this.observers.push(observer); | |
| 454 | + return observer; | |
| 455 | + } | |
| 456 | + static addEventListenerTracked(target, type, handler, options = {}) { | |
| 457 | + this.ensureOwnArrays(); | |
| 458 | + target.addEventListener(type, handler, options); | |
| 459 | + this.eventListeners.push({ | |
| 460 | + target, | |
| 461 | + type, | |
| 462 | + handler, | |
| 463 | + options | |
| 464 | + }); | |
| 465 | + } | |
| 466 | +} | |
| 467 | +var _default = exports["default"] = BaseTracking; | |
| 468 | + | |
| 469 | +/***/ }), | |
| 470 | + | |
| 471 | +/***/ "../app/assets/js/event-track/dashboard/menu-promotion.js": | |
| 472 | +/*!****************************************************************!*\ | |
| 473 | + !*** ../app/assets/js/event-track/dashboard/menu-promotion.js ***! | |
| 474 | + \****************************************************************/ | |
| 475 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 476 | + | |
| 477 | +"use strict"; | |
| 478 | + | |
| 479 | + | |
| 480 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 481 | +Object.defineProperty(exports, "__esModule", ({ | |
| 482 | + value: true | |
| 483 | +})); | |
| 484 | +exports["default"] = void 0; | |
| 485 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 486 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 487 | +const PROMO_MENU_ITEMS = { | |
| 488 | + go_elementor_pro: 'Upgrade' | |
| 489 | +}; | |
| 490 | +class MenuPromotionTracking extends _baseTracking.default { | |
| 491 | + static init() { | |
| 492 | + this.attachDelegatedTracking(); | |
| 493 | + } | |
| 494 | + static attachDelegatedTracking() { | |
| 495 | + this.addEventListenerTracked(document, 'click', event => { | |
| 496 | + const target = event.target; | |
| 497 | + if (!target) { | |
| 498 | + return; | |
| 499 | + } | |
| 500 | + const link = target.closest('a'); | |
| 501 | + if (!link) { | |
| 502 | + return; | |
| 503 | + } | |
| 504 | + const href = link.getAttribute('href'); | |
| 505 | + if (!href) { | |
| 506 | + return; | |
| 507 | + } | |
| 508 | + const menuItemKey = this.extractPromoMenuKey(href); | |
| 509 | + if (!menuItemKey) { | |
| 510 | + return; | |
| 511 | + } | |
| 512 | + this.handleMenuPromoClick(link, menuItemKey); | |
| 513 | + }, { | |
| 514 | + capture: true | |
| 515 | + }); | |
| 516 | + } | |
| 517 | + static extractPromoMenuKey(href) { | |
| 518 | + for (const menuItemKey of Object.keys(PROMO_MENU_ITEMS)) { | |
| 519 | + if (href.includes(`page=${menuItemKey}`)) { | |
| 520 | + return menuItemKey; | |
| 521 | + } | |
| 522 | + } | |
| 523 | + return null; | |
| 524 | + } | |
| 525 | + static handleMenuPromoClick(menuItem, menuItemKey) { | |
| 526 | + const destination = menuItem.getAttribute('href'); | |
| 527 | + const promoName = PROMO_MENU_ITEMS[menuItemKey]; | |
| 528 | + const path = menuItemKey.replace('elementor_', '').replace(/_/g, '/'); | |
| 529 | + _wpDashboardTracking.default.trackPromoClicked(promoName, destination, path); | |
| 530 | + } | |
| 531 | +} | |
| 532 | +var _default = exports["default"] = MenuPromotionTracking; | |
| 533 | + | |
| 534 | +/***/ }), | |
| 535 | + | |
| 536 | +/***/ "../app/assets/js/event-track/dashboard/navigation.js": | |
| 537 | +/*!************************************************************!*\ | |
| 538 | + !*** ../app/assets/js/event-track/dashboard/navigation.js ***! | |
| 539 | + \************************************************************/ | |
| 540 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 541 | + | |
| 542 | +"use strict"; | |
| 543 | + | |
| 544 | + | |
| 545 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 546 | +Object.defineProperty(exports, "__esModule", ({ | |
| 547 | + value: true | |
| 548 | +})); | |
| 549 | +exports["default"] = void 0; | |
| 550 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 551 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 552 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } | |
| 553 | +const ELEMENTOR_MENU_SELECTORS = { | |
| 554 | + ELEMENTOR_TOP_LEVEL: 'li#toplevel_page_elementor', | |
| 555 | + TEMPLATES_TOP_LEVEL: 'li#menu-posts-elementor_library', | |
| 556 | + ELEMENTOR_HOME_TOP_LEVEL: 'li#toplevel_page_elementor-home', | |
| 557 | + ADMIN_MENU: '#adminmenu', | |
| 558 | + TOP_LEVEL_LINK: '.wp-menu-name', | |
| 559 | + SUBMENU_CONTAINER: '.wp-submenu', | |
| 560 | + SUBMENU_ITEM: '.wp-submenu li a', | |
| 561 | + SUBMENU_ITEM_TOP_LEVEL: '.wp-has-submenu', | |
| 562 | + SIDEBAR_NAVIGATION: '#editor-one-sidebar-navigation' | |
| 563 | +}; | |
| 564 | +class NavigationTracking extends _baseTracking.default { | |
| 565 | + static init() { | |
| 566 | + if (_wpDashboardTracking.default.isEditorOneActive()) { | |
| 567 | + this.attachSidebarNavigationTracking(); | |
| 568 | + this.attachElementorHomeMenuTracking(); | |
| 569 | + } else { | |
| 570 | + this.attachElementorMenuTracking(); | |
| 571 | + this.attachTemplatesMenuTracking(); | |
| 572 | + } | |
| 573 | + } | |
| 574 | + static attachTemplatesMenuTracking() { | |
| 575 | + const templatesMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.TEMPLATES_TOP_LEVEL); | |
| 576 | + if (!templatesMenu) { | |
| 577 | + return; | |
| 578 | + } | |
| 579 | + this.attachMenuTracking(templatesMenu, 'Templates'); | |
| 580 | + } | |
| 581 | + static attachElementorHomeMenuTracking() { | |
| 582 | + const elementorHomeMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_HOME_TOP_LEVEL); | |
| 583 | + if (!elementorHomeMenu) { | |
| 584 | + return; | |
| 585 | + } | |
| 586 | + this.attachMenuTracking(elementorHomeMenu, 'Elementor'); | |
| 587 | + } | |
| 588 | + static attachElementorMenuTracking() { | |
| 589 | + const elementorMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_TOP_LEVEL); | |
| 590 | + if (!elementorMenu) { | |
| 591 | + return; | |
| 592 | + } | |
| 593 | + this.attachMenuTracking(elementorMenu, 'Elementor'); | |
| 594 | + } | |
| 595 | + static attachSidebarNavigationTracking() { | |
| 596 | + const sidebar = document.querySelector(ELEMENTOR_MENU_SELECTORS.SIDEBAR_NAVIGATION); | |
| 597 | + if (sidebar) { | |
| 598 | + this.attachSidebarClickListener(sidebar); | |
| 599 | + } | |
| 600 | + } | |
| 601 | + static attachSidebarClickListener(sidebar) { | |
| 602 | + this.addEventListenerTracked(sidebar, 'click', event => { | |
| 603 | + this.handleSidebarClick(event); | |
| 604 | + }, { | |
| 605 | + capture: true | |
| 606 | + }); | |
| 607 | + } | |
| 608 | + static attachMenuTracking(menuElement, menuName) { | |
| 609 | + this.addEventListenerTracked(menuElement, 'click', event => { | |
| 610 | + this.handleMenuClick(event, menuName); | |
| 611 | + }); | |
| 612 | + } | |
| 613 | + static handleMenuClick(event, menuName) { | |
| 614 | + const link = event.target.closest('a'); | |
| 615 | + if (!link) { | |
| 616 | + return; | |
| 617 | + } | |
| 618 | + const isTopLevel = link.classList.contains('menu-top'); | |
| 619 | + const itemId = this.extractItemId(link); | |
| 620 | + const area = this.determineNavArea(link); | |
| 621 | + _wpDashboardTracking.default.trackNavClicked(itemId, isTopLevel ? null : menuName, area); | |
| 622 | + } | |
| 623 | + static handleSidebarClick(event) { | |
| 624 | + const clickedElement = event.target.closest('a, button, [role="button"]'); | |
| 625 | + if (!clickedElement) { | |
| 626 | + return; | |
| 627 | + } | |
| 628 | + const itemId = this.extractSidebarItemId(clickedElement); | |
| 629 | + _wpDashboardTracking.default.trackNavClicked(itemId, null, _wpDashboardTracking.NAV_AREAS.SIDEBAR_MENU); | |
| 630 | + } | |
| 631 | + static extractSidebarItemId(element) { | |
| 632 | + const paragraph = element.querySelector('p'); | |
| 633 | + if (paragraph) { | |
| 634 | + return paragraph.textContent.trim(); | |
| 635 | + } | |
| 636 | + const textContent = element.textContent.trim(); | |
| 637 | + if (textContent) { | |
| 638 | + return textContent; | |
| 639 | + } | |
| 640 | + return 'unknown'; | |
| 641 | + } | |
| 642 | + static extractPageFromUrl(href) { | |
| 643 | + const urlParams = new URLSearchParams(href.split('?')[1] || ''); | |
| 644 | + const page = urlParams.get('page'); | |
| 645 | + if (page) { | |
| 646 | + return page; | |
| 647 | + } | |
| 648 | + const postType = urlParams.get('post_type'); | |
| 649 | + if (postType) { | |
| 650 | + return postType; | |
| 651 | + } | |
| 652 | + return 'unknown'; | |
| 653 | + } | |
| 654 | + static extractItemId(link) { | |
| 655 | + const textContent = link.textContent.trim(); | |
| 656 | + if (textContent) { | |
| 657 | + return textContent; | |
| 658 | + } | |
| 659 | + const href = link.getAttribute('href'); | |
| 660 | + if (href) { | |
| 661 | + return this.extractPageFromUrl(href); | |
| 662 | + } | |
| 663 | + const linkId = link.getAttribute('id'); | |
| 664 | + if (linkId) { | |
| 665 | + return linkId; | |
| 666 | + } | |
| 667 | + return 'unknown'; | |
| 668 | + } | |
| 669 | + static determineNavArea(link) { | |
| 670 | + const parentMenu = link.closest('li.menu-top'); | |
| 671 | + if (parentMenu) { | |
| 672 | + const isSubmenuItem = link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_CONTAINER); | |
| 673 | + if (isSubmenuItem) { | |
| 674 | + const submenuElement = link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_ITEM_TOP_LEVEL); | |
| 675 | + if (submenuElement.classList.contains('wp-not-current-submenu')) { | |
| 676 | + return _wpDashboardTracking.NAV_AREAS.HOVER_MENU; | |
| 677 | + } | |
| 678 | + return _wpDashboardTracking.NAV_AREAS.SUBMENU; | |
| 679 | + } | |
| 680 | + return _wpDashboardTracking.NAV_AREAS.LEFT_MENU; | |
| 681 | + } | |
| 682 | + return _wpDashboardTracking.NAV_AREAS.LEFT_MENU; | |
| 683 | + } | |
| 684 | +} | |
| 685 | +var _default = exports["default"] = NavigationTracking; | |
| 686 | + | |
| 687 | +/***/ }), | |
| 688 | + | |
| 689 | +/***/ "../app/assets/js/event-track/dashboard/plugin-actions.js": | |
| 690 | +/*!****************************************************************!*\ | |
| 691 | + !*** ../app/assets/js/event-track/dashboard/plugin-actions.js ***! | |
| 692 | + \****************************************************************/ | |
| 693 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 694 | + | |
| 695 | +"use strict"; | |
| 696 | + | |
| 697 | + | |
| 698 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 699 | +Object.defineProperty(exports, "__esModule", ({ | |
| 700 | + value: true | |
| 701 | +})); | |
| 702 | +exports["default"] = void 0; | |
| 703 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 704 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 705 | +const PLUGIN_TYPE = { | |
| 706 | + ELEMENTOR: 'core', | |
| 707 | + ELEMENTOR_PRO: 'pro' | |
| 708 | +}; | |
| 709 | +class PluginActions extends _baseTracking.default { | |
| 710 | + static selectedReason = null; | |
| 711 | + static init() { | |
| 712 | + this.attachCoreDeactivationTracking(); | |
| 713 | + this.attachProDeactivationTracking(); | |
| 714 | + this.attachProDeletionTracking(); | |
| 715 | + } | |
| 716 | + static attachCoreDeactivationTracking() { | |
| 717 | + const dialogForm = document.querySelector('#elementor-deactivate-feedback-dialog-form'); | |
| 718 | + if (!dialogForm) { | |
| 719 | + return; | |
| 720 | + } | |
| 721 | + this.addEventListenerTracked(dialogForm, 'change', event => { | |
| 722 | + const target = event.target; | |
| 723 | + if (target.classList.contains('elementor-deactivate-feedback-dialog-input')) { | |
| 724 | + this.selectedReason = target.value; | |
| 725 | + } | |
| 726 | + }); | |
| 727 | + this.observeModalButtons(); | |
| 728 | + } | |
| 729 | + static attachProDeactivationTracking() { | |
| 730 | + const pluginsTable = document.querySelector('.plugins'); | |
| 731 | + if (!pluginsTable) { | |
| 732 | + return; | |
| 733 | + } | |
| 734 | + this.addEventListenerTracked(pluginsTable, 'click', event => { | |
| 735 | + const link = event.target.closest('a'); | |
| 736 | + if (link && 'deactivate-elementor-pro' === link.id) { | |
| 737 | + this.trackProDeactivation(); | |
| 738 | + } | |
| 739 | + }, { | |
| 740 | + capture: true | |
| 741 | + }); | |
| 742 | + } | |
| 743 | + static observeModalButtons() { | |
| 744 | + const checkAndAttachDelegation = () => { | |
| 745 | + const modal = document.querySelector('#elementor-deactivate-feedback-modal'); | |
| 746 | + if (!modal) { | |
| 747 | + return false; | |
| 748 | + } | |
| 749 | + this.addEventListenerTracked(modal, 'click', event => { | |
| 750 | + const submitButton = event.target.closest('.dialog-submit'); | |
| 751 | + const skipButton = event.target.closest('.dialog-skip'); | |
| 752 | + if (submitButton) { | |
| 753 | + this.trackCoreDeactivation('submit&deactivate'); | |
| 754 | + } else if (skipButton) { | |
| 755 | + this.trackCoreDeactivation('skip&deactivate'); | |
| 756 | + } | |
| 757 | + }, { | |
| 758 | + capture: true | |
| 759 | + }); | |
| 760 | + return true; | |
| 761 | + }; | |
| 762 | + if (checkAndAttachDelegation()) { | |
| 763 | + return; | |
| 764 | + } | |
| 765 | + this.addObserver(document.body, { | |
| 766 | + childList: true, | |
| 767 | + subtree: true | |
| 768 | + }, (mutations, observer) => { | |
| 769 | + if (checkAndAttachDelegation()) { | |
| 770 | + observer.disconnect(); | |
| 771 | + } | |
| 772 | + }); | |
| 773 | + } | |
| 774 | + static getUserInput() { | |
| 775 | + const reasonsWithInput = ['found_a_better_plugin', 'other']; | |
| 776 | + if (!this.selectedReason || !reasonsWithInput.includes(this.selectedReason)) { | |
| 777 | + return null; | |
| 778 | + } | |
| 779 | + const inputField = document.querySelector(`input[name="reason_${this.selectedReason}"]`); | |
| 780 | + if (inputField && inputField.value) { | |
| 781 | + return inputField.value; | |
| 782 | + } | |
| 783 | + return null; | |
| 784 | + } | |
| 785 | + static trackCoreDeactivation(action) { | |
| 786 | + const properties = { | |
| 787 | + deactivate_form_submit: action, | |
| 788 | + deactivate_plugin_type: PLUGIN_TYPE.ELEMENTOR | |
| 789 | + }; | |
| 790 | + if (this.selectedReason) { | |
| 791 | + properties.deactivate_feedback_reason = this.selectedReason; | |
| 792 | + } | |
| 793 | + const userInput = this.getUserInput(); | |
| 794 | + if (userInput) { | |
| 795 | + properties.deactivate_feedback_reason += `/${userInput}`; | |
| 796 | + } | |
| 797 | + _wpDashboardTracking.default.dispatchEvent('wpdash_deactivate_plugin', properties, { | |
| 798 | + send_immediately: true | |
| 799 | + }); | |
| 800 | + } | |
| 801 | + static trackProDeactivation() { | |
| 802 | + this.trackProAction('deactivate'); | |
| 803 | + } | |
| 804 | + static attachProDeletionTracking() { | |
| 805 | + if ('undefined' === typeof jQuery) { | |
| 806 | + return; | |
| 807 | + } | |
| 808 | + jQuery(document).on('wp-plugin-deleting', (event, args) => { | |
| 809 | + if ('elementor-pro' === args?.slug) { | |
| 810 | + this.trackProAction('delete'); | |
| 811 | + } | |
| 812 | + }); | |
| 813 | + } | |
| 814 | + static destroy() { | |
| 815 | + if ('undefined' !== typeof jQuery) { | |
| 816 | + jQuery(document).off('wp-plugin-deleting'); | |
| 817 | + } | |
| 818 | + _baseTracking.default.destroy.call(this); | |
| 819 | + } | |
| 820 | + static trackProAction(action) { | |
| 821 | + const eventMap = { | |
| 822 | + deactivate: { | |
| 823 | + eventName: 'wpdash_deactivate_plugin', | |
| 824 | + propertyKey: 'deactivate_plugin_type' | |
| 825 | + }, | |
| 826 | + delete: { | |
| 827 | + eventName: 'wpdash_delete_plugin', | |
| 828 | + propertyKey: 'plugin_delete' | |
| 829 | + } | |
| 830 | + }; | |
| 831 | + const config = eventMap[action]; | |
| 832 | + if (!config) { | |
| 833 | + return; | |
| 834 | + } | |
| 835 | + const properties = { | |
| 836 | + [config.propertyKey]: PLUGIN_TYPE.ELEMENTOR_PRO | |
| 837 | + }; | |
| 838 | + _wpDashboardTracking.default.dispatchEvent(config.eventName, properties, { | |
| 839 | + send_immediately: true | |
| 840 | + }); | |
| 841 | + } | |
| 842 | +} | |
| 843 | +var _default = exports["default"] = PluginActions; | |
| 844 | + | |
| 845 | +/***/ }), | |
| 846 | + | |
| 847 | +/***/ "../app/assets/js/event-track/dashboard/promotion.js": | |
| 848 | +/*!***********************************************************!*\ | |
| 849 | + !*** ../app/assets/js/event-track/dashboard/promotion.js ***! | |
| 850 | + \***********************************************************/ | |
| 851 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 852 | + | |
| 853 | +"use strict"; | |
| 854 | + | |
| 855 | + | |
| 856 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 857 | +Object.defineProperty(exports, "__esModule", ({ | |
| 858 | + value: true | |
| 859 | +})); | |
| 860 | +exports["default"] = void 0; | |
| 861 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 862 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 863 | +const PROMO_SELECTORS = { | |
| 864 | + PROMO_PAGE: '.e-feature-promotion, .elementor-settings-form-page, #elementor-element-manager-wrap', | |
| 865 | + PROMO_BLANK_STATE: '.elementor-blank_state', | |
| 866 | + CTA_BUTTON: '.go-pro', | |
| 867 | + TITLE: 'h3' | |
| 868 | +}; | |
| 869 | +class PromotionTracking extends _baseTracking.default { | |
| 870 | + static init() { | |
| 871 | + this.attachDelegatedTracking(); | |
| 872 | + } | |
| 873 | + static attachDelegatedTracking() { | |
| 874 | + this.addEventListenerTracked(document, 'click', event => { | |
| 875 | + const target = event.target; | |
| 876 | + if (!target) { | |
| 877 | + return; | |
| 878 | + } | |
| 879 | + const button = target.closest(`a${PROMO_SELECTORS.CTA_BUTTON}`); | |
| 880 | + if (!button) { | |
| 881 | + return; | |
| 882 | + } | |
| 883 | + const promoPage = button.closest(`${PROMO_SELECTORS.PROMO_PAGE}, ${PROMO_SELECTORS.PROMO_BLANK_STATE}`); | |
| 884 | + if (!promoPage) { | |
| 885 | + return; | |
| 886 | + } | |
| 887 | + this.handlePromoClick(button, promoPage); | |
| 888 | + }, { | |
| 889 | + capture: true | |
| 890 | + }); | |
| 891 | + } | |
| 892 | + static handlePromoClick(button, promoPage) { | |
| 893 | + const promoTitle = this.extractPromoTitle(promoPage, button); | |
| 894 | + const destination = button.getAttribute('href'); | |
| 895 | + const path = this.extractPromoPath(); | |
| 896 | + _wpDashboardTracking.default.trackPromoClicked(promoTitle, destination, path); | |
| 897 | + } | |
| 898 | + static extractPromoTitle(promoPage, button) { | |
| 899 | + const titleElement = promoPage.querySelector(PROMO_SELECTORS.TITLE); | |
| 900 | + return titleElement ? titleElement.textContent.trim() : button.textContent.trim(); | |
| 901 | + } | |
| 902 | + static extractPromoPath() { | |
| 903 | + const urlParams = new URLSearchParams(window.location.search); | |
| 904 | + const page = urlParams.get('page'); | |
| 905 | + if (!page) { | |
| 906 | + return 'elementor'; | |
| 907 | + } | |
| 908 | + return page.replace('elementor_', '').replace(/_/g, '/'); | |
| 909 | + } | |
| 910 | +} | |
| 911 | +var _default = exports["default"] = PromotionTracking; | |
| 912 | + | |
| 913 | +/***/ }), | |
| 914 | + | |
| 915 | +/***/ "../app/assets/js/event-track/dashboard/screen-view.js": | |
| 916 | +/*!*************************************************************!*\ | |
| 917 | + !*** ../app/assets/js/event-track/dashboard/screen-view.js ***! | |
| 918 | + \*************************************************************/ | |
| 919 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 920 | + | |
| 921 | +"use strict"; | |
| 922 | + | |
| 923 | + | |
| 924 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 925 | +Object.defineProperty(exports, "__esModule", ({ | |
| 926 | + value: true | |
| 927 | +})); | |
| 928 | +exports["default"] = void 0; | |
| 929 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 930 | +__webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ "../node_modules/core-js/modules/esnext.iterator.filter.js"); | |
| 931 | +__webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ "../node_modules/core-js/modules/esnext.iterator.for-each.js"); | |
| 932 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 933 | +var _utils = __webpack_require__(/*! ./utils */ "../app/assets/js/event-track/dashboard/utils.js"); | |
| 934 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 935 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } | |
| 936 | +const SCREEN_SELECTORS = { | |
| 937 | + NAV_TAB_WRAPPER: '.nav-tab-wrapper', | |
| 938 | + NAV_TAB: '.nav-tab', | |
| 939 | + NAV_TAB_ACTIVE: '.nav-tab-active', | |
| 940 | + SETTINGS_FORM_PAGE: '.elementor-settings-form-page', | |
| 941 | + SETTINGS_FORM_PAGE_ACTIVE: '.elementor-settings-form-page.elementor-active', | |
| 942 | + FLOATING_ELEMENTS_MODAL: '#elementor-new-floating-elements-modal', | |
| 943 | + TEMPLATE_DIALOG_MODAL: '#elementor-new-template-dialog-content' | |
| 944 | +}; | |
| 945 | +const TRACKED_MODALS = [SCREEN_SELECTORS.FLOATING_ELEMENTS_MODAL, SCREEN_SELECTORS.TEMPLATE_DIALOG_MODAL]; | |
| 946 | +class ScreenViewTracking extends _baseTracking.default { | |
| 947 | + static trackedScreens = new Set(); | |
| 948 | + static init() { | |
| 949 | + if (!_utils.DashboardUtils.isElementorPage()) { | |
| 950 | + return; | |
| 951 | + } | |
| 952 | + this.attachTabChangeTracking(); | |
| 953 | + } | |
| 954 | + static destroy() { | |
| 955 | + super.destroy(); | |
| 956 | + this.trackedScreens.clear(); | |
| 957 | + } | |
| 958 | + static getScreenData() { | |
| 959 | + const urlParams = new URLSearchParams(window.location.search); | |
| 960 | + const page = urlParams.get('page'); | |
| 961 | + const postType = urlParams.get('post_type'); | |
| 962 | + const hash = window.location.hash; | |
| 963 | + let screenId = ''; | |
| 964 | + let screenType = ''; | |
| 965 | + if (page) { | |
| 966 | + screenId = page; | |
| 967 | + } else if (postType) { | |
| 968 | + screenId = postType; | |
| 969 | + } else { | |
| 970 | + screenId = this.getScreenIdFromBody(); | |
| 971 | + } | |
| 972 | + if (this.isElementorAppPage()) { | |
| 973 | + const appScreenData = this.getAppScreenData(hash); | |
| 974 | + if (appScreenData) { | |
| 975 | + return appScreenData; | |
| 976 | + } | |
| 977 | + } | |
| 978 | + const hasNavTabs = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); | |
| 979 | + const hasSettingsTabs = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE).length > 1; | |
| 980 | + if (hasNavTabs || hasSettingsTabs || hash && !this.isElementorAppPage()) { | |
| 981 | + screenType = _wpDashboardTracking.SCREEN_TYPES.TAB; | |
| 982 | + if (hash) { | |
| 983 | + const tabId = hash.replace(/^#(tab-)?/, ''); | |
| 984 | + screenId = `${screenId}-${tabId}`; | |
| 985 | + } else if (hasNavTabs) { | |
| 986 | + const activeTab = document.querySelector(SCREEN_SELECTORS.NAV_TAB_ACTIVE); | |
| 987 | + if (activeTab) { | |
| 988 | + const tabText = activeTab.textContent.trim(); | |
| 989 | + const tabHref = activeTab.getAttribute('href'); | |
| 990 | + if (tabText) { | |
| 991 | + screenId = `${screenId}-${this.sanitizeScreenId(tabText)}`; | |
| 992 | + } else if (tabHref && tabHref.includes('#')) { | |
| 993 | + const tabId = tabHref.split('#')[1]; | |
| 994 | + screenId = `${screenId}-${tabId}`; | |
| 995 | + } | |
| 996 | + } | |
| 997 | + } else if (hasSettingsTabs) { | |
| 998 | + const activeSettingsTab = document.querySelector(SCREEN_SELECTORS.SETTINGS_FORM_PAGE_ACTIVE); | |
| 999 | + if (activeSettingsTab) { | |
| 1000 | + const tabId = activeSettingsTab.id; | |
| 1001 | + if (tabId) { | |
| 1002 | + screenId = `${screenId}-${tabId}`; | |
| 1003 | + } | |
| 1004 | + } | |
| 1005 | + } | |
| 1006 | + } | |
| 1007 | + return { | |
| 1008 | + screenId, | |
| 1009 | + screenType | |
| 1010 | + }; | |
| 1011 | + } | |
| 1012 | + static isElementorAppPage() { | |
| 1013 | + const urlParams = new URLSearchParams(window.location.search); | |
| 1014 | + return 'elementor-app' === urlParams.get('page'); | |
| 1015 | + } | |
| 1016 | + static getAppScreenData(hash) { | |
| 1017 | + if (!hash) { | |
| 1018 | + return null; | |
| 1019 | + } | |
| 1020 | + const cleanHash = hash.replace(/^#/, ''); | |
| 1021 | + if (!cleanHash.startsWith('/')) { | |
| 1022 | + return null; | |
| 1023 | + } | |
| 1024 | + const pathParts = cleanHash.split('/').filter(Boolean); | |
| 1025 | + if (0 === pathParts.length) { | |
| 1026 | + return null; | |
| 1027 | + } | |
| 1028 | + const screenId = pathParts.join('/'); | |
| 1029 | + const screenType = _wpDashboardTracking.SCREEN_TYPES.APP_SCREEN; | |
| 1030 | + return { | |
| 1031 | + screenId, | |
| 1032 | + screenType | |
| 1033 | + }; | |
| 1034 | + } | |
| 1035 | + static getScreenIdFromBody() { | |
| 1036 | + const body = document.body; | |
| 1037 | + const bodyClasses = body.className.split(' '); | |
| 1038 | + for (const cls of bodyClasses) { | |
| 1039 | + if (cls.startsWith('elementor') && (cls.includes('page') || cls.includes('post-type'))) { | |
| 1040 | + return cls; | |
| 1041 | + } | |
| 1042 | + } | |
| 1043 | + return 'elementor-unknown'; | |
| 1044 | + } | |
| 1045 | + static sanitizeScreenId(text) { | |
| 1046 | + return text.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, ''); | |
| 1047 | + } | |
| 1048 | + static attachTabChangeTracking() { | |
| 1049 | + this.attachNavTabTracking(); | |
| 1050 | + this.attachHashChangeTracking(); | |
| 1051 | + this.attachSettingsTabTracking(); | |
| 1052 | + this.attachModalTracking(); | |
| 1053 | + } | |
| 1054 | + static attachNavTabTracking() { | |
| 1055 | + const wrapper = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); | |
| 1056 | + if (!wrapper) { | |
| 1057 | + return; | |
| 1058 | + } | |
| 1059 | + this.addEventListenerTracked(wrapper, 'click', event => { | |
| 1060 | + const navTab = event.target.closest(SCREEN_SELECTORS.NAV_TAB); | |
| 1061 | + if (navTab && !navTab.classList.contains('nav-tab-active')) { | |
| 1062 | + const screenData = this.getScreenData(); | |
| 1063 | + if (screenData) { | |
| 1064 | + this.trackScreen(screenData.screenId, screenData.screenType); | |
| 1065 | + } | |
| 1066 | + } | |
| 1067 | + }); | |
| 1068 | + } | |
| 1069 | + static attachHashChangeTracking() { | |
| 1070 | + this.addEventListenerTracked(window, 'hashchange', () => { | |
| 1071 | + const screenData = this.getScreenData(); | |
| 1072 | + if (screenData) { | |
| 1073 | + this.trackScreen(screenData.screenId, screenData.screenType); | |
| 1074 | + } | |
| 1075 | + }); | |
| 1076 | + } | |
| 1077 | + static attachSettingsTabTracking() { | |
| 1078 | + const settingsPages = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE); | |
| 1079 | + if (0 === settingsPages.length) { | |
| 1080 | + return; | |
| 1081 | + } | |
| 1082 | + settingsPages.forEach(page => { | |
| 1083 | + this.addObserver(page, { | |
| 1084 | + attributes: true, | |
| 1085 | + attributeFilter: ['class'] | |
| 1086 | + }, () => { | |
| 1087 | + const screenData = this.getScreenData(); | |
| 1088 | + if (screenData) { | |
| 1089 | + this.trackScreen(screenData.screenId, screenData.screenType); | |
| 1090 | + } | |
| 1091 | + }); | |
| 1092 | + }); | |
| 1093 | + } | |
| 1094 | + static attachModalTracking() { | |
| 1095 | + this.addObserver(document.body, { | |
| 1096 | + childList: true, | |
| 1097 | + subtree: true | |
| 1098 | + }, mutations => { | |
| 1099 | + for (const mutation of mutations) { | |
| 1100 | + if ('childList' === mutation.type) { | |
| 1101 | + TRACKED_MODALS.forEach(modalSelector => { | |
| 1102 | + const modal = document.querySelector(modalSelector); | |
| 1103 | + if (modal && this.isModalVisible(modal)) { | |
| 1104 | + const modalId = modalSelector.replace('#', ''); | |
| 1105 | + this.trackScreen(modalId, _wpDashboardTracking.SCREEN_TYPES.POPUP); | |
| 1106 | + } | |
| 1107 | + }); | |
| 1108 | + } | |
| 1109 | + } | |
| 1110 | + }); | |
| 1111 | + } | |
| 1112 | + static isModalVisible(element) { | |
| 1113 | + if (!element) { | |
| 1114 | + return false; | |
| 1115 | + } | |
| 1116 | + const style = window.getComputedStyle(element); | |
| 1117 | + return 'none' !== style.display && 0 !== parseFloat(style.opacity); | |
| 1118 | + } | |
| 1119 | + static trackScreen(screenId, screenType = _wpDashboardTracking.SCREEN_TYPES.TOP_LEVEL_PAGE) { | |
| 1120 | + const trackingKey = `${screenId}-${screenType}`; | |
| 1121 | + if (this.trackedScreens.has(trackingKey)) { | |
| 1122 | + return; | |
| 1123 | + } | |
| 1124 | + this.trackedScreens.add(trackingKey); | |
| 1125 | + _wpDashboardTracking.default.trackScreenViewed(screenId, screenType); | |
| 1126 | + } | |
| 1127 | +} | |
| 1128 | +var _default = exports["default"] = ScreenViewTracking; | |
| 1129 | + | |
| 1130 | +/***/ }), | |
| 1131 | + | |
| 1132 | +/***/ "../app/assets/js/event-track/dashboard/top-bar.js": | |
| 1133 | +/*!*********************************************************!*\ | |
| 1134 | + !*** ../app/assets/js/event-track/dashboard/top-bar.js ***! | |
| 1135 | + \*********************************************************/ | |
| 1136 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1137 | + | |
| 1138 | +"use strict"; | |
| 1139 | + | |
| 1140 | + | |
| 1141 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1142 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1143 | + value: true | |
| 1144 | +})); | |
| 1145 | +exports["default"] = void 0; | |
| 1146 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 1147 | +__webpack_require__(/*! core-js/modules/esnext.iterator.filter.js */ "../node_modules/core-js/modules/esnext.iterator.filter.js"); | |
| 1148 | +__webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ "../node_modules/core-js/modules/esnext.iterator.for-each.js"); | |
| 1149 | +var _wpDashboardTracking = _interopRequireWildcard(__webpack_require__(/*! ../wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 1150 | +var _baseTracking = _interopRequireDefault(__webpack_require__(/*! ./base-tracking */ "../app/assets/js/event-track/dashboard/base-tracking.js")); | |
| 1151 | +function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); } | |
| 1152 | +const TOP_BAR_SELECTORS = { | |
| 1153 | + TOP_BAR_ROOT: '.e-admin-top-bar', | |
| 1154 | + BAR_BUTTON: '.e-admin-top-bar__bar-button', | |
| 1155 | + BUTTON_TITLE: '.e-admin-top-bar__bar-button-title', | |
| 1156 | + MAIN_AREA: '.e-admin-top-bar__main-area', | |
| 1157 | + SECONDARY_AREA: '.e-admin-top-bar__secondary-area' | |
| 1158 | +}; | |
| 1159 | +class TopBarTracking extends _baseTracking.default { | |
| 1160 | + static init() { | |
| 1161 | + this.waitForTopBar(); | |
| 1162 | + } | |
| 1163 | + static waitForTopBar() { | |
| 1164 | + const topBar = document.querySelector(TOP_BAR_SELECTORS.TOP_BAR_ROOT); | |
| 1165 | + if (topBar) { | |
| 1166 | + this.attachTopBarTracking(topBar); | |
| 1167 | + return; | |
| 1168 | + } | |
| 1169 | + const observer = this.addObserver(document.body, { | |
| 1170 | + childList: true, | |
| 1171 | + subtree: true | |
| 1172 | + }, () => { | |
| 1173 | + const foundTopBar = document.querySelector(TOP_BAR_SELECTORS.TOP_BAR_ROOT); | |
| 1174 | + if (foundTopBar) { | |
| 1175 | + this.attachTopBarTracking(foundTopBar); | |
| 1176 | + observer.disconnect(); | |
| 1177 | + clearTimeout(timeoutId); | |
| 1178 | + } | |
| 1179 | + }); | |
| 1180 | + const timeoutId = setTimeout(() => { | |
| 1181 | + observer.disconnect(); | |
| 1182 | + }, 10000); | |
| 1183 | + } | |
| 1184 | + static attachTopBarTracking(topBar) { | |
| 1185 | + const buttons = topBar.querySelectorAll(TOP_BAR_SELECTORS.BAR_BUTTON); | |
| 1186 | + buttons.forEach(button => { | |
| 1187 | + this.addEventListenerTracked(button, 'click', event => { | |
| 1188 | + this.handleTopBarClick(event); | |
| 1189 | + }); | |
| 1190 | + }); | |
| 1191 | + this.observeTopBarChanges(topBar); | |
| 1192 | + } | |
| 1193 | + static observeTopBarChanges(topBar) { | |
| 1194 | + this.addObserver(topBar, { | |
| 1195 | + childList: true, | |
| 1196 | + subtree: true | |
| 1197 | + }, mutations => { | |
| 1198 | + mutations.forEach(mutation => { | |
| 1199 | + if ('childList' === mutation.type) { | |
| 1200 | + mutation.addedNodes.forEach(node => { | |
| 1201 | + if (1 === node.nodeType) { | |
| 1202 | + if (node.matches && node.matches(TOP_BAR_SELECTORS.BAR_BUTTON)) { | |
| 1203 | + this.addEventListenerTracked(node, 'click', event => { | |
| 1204 | + this.handleTopBarClick(event); | |
| 1205 | + }); | |
| 1206 | + } else { | |
| 1207 | + const buttons = node.querySelectorAll ? node.querySelectorAll(TOP_BAR_SELECTORS.BAR_BUTTON) : []; | |
| 1208 | + buttons.forEach(button => { | |
| 1209 | + this.addEventListenerTracked(button, 'click', event => { | |
| 1210 | + this.handleTopBarClick(event); | |
| 1211 | + }); | |
| 1212 | + }); | |
| 1213 | + } | |
| 1214 | + } | |
| 1215 | + }); | |
| 1216 | + } | |
| 1217 | + }); | |
| 1218 | + }); | |
| 1219 | + } | |
| 1220 | + static handleTopBarClick(event) { | |
| 1221 | + const button = event.currentTarget; | |
| 1222 | + const itemId = this.extractItemId(button); | |
| 1223 | + _wpDashboardTracking.default.trackNavClicked(itemId, null, _wpDashboardTracking.NAV_AREAS.TOP_BAR); | |
| 1224 | + } | |
| 1225 | + static extractItemId(button) { | |
| 1226 | + const titleElement = button.querySelector(TOP_BAR_SELECTORS.BUTTON_TITLE); | |
| 1227 | + if (titleElement && titleElement.textContent.trim()) { | |
| 1228 | + return titleElement.textContent.trim(); | |
| 1229 | + } | |
| 1230 | + const textContent = button.textContent.trim(); | |
| 1231 | + if (textContent) { | |
| 1232 | + return textContent; | |
| 1233 | + } | |
| 1234 | + const href = button.getAttribute('href'); | |
| 1235 | + if (href) { | |
| 1236 | + const urlParams = new URLSearchParams(href.split('?')[1] || ''); | |
| 1237 | + const page = urlParams.get('page'); | |
| 1238 | + if (page) { | |
| 1239 | + return page; | |
| 1240 | + } | |
| 1241 | + if (href.includes('/wp-admin/')) { | |
| 1242 | + const pathParts = href.split('/wp-admin/')[1]; | |
| 1243 | + if (pathParts) { | |
| 1244 | + return pathParts.split('?')[0]; | |
| 1245 | + } | |
| 1246 | + } | |
| 1247 | + try { | |
| 1248 | + const url = new URL(href, window.location.origin); | |
| 1249 | + return url.pathname.split('/').filter(Boolean).pop() || url.hostname; | |
| 1250 | + } catch (error) { | |
| 1251 | + return href; | |
| 1252 | + } | |
| 1253 | + } | |
| 1254 | + const dataInfo = button.getAttribute('data-info'); | |
| 1255 | + if (dataInfo) { | |
| 1256 | + return dataInfo; | |
| 1257 | + } | |
| 1258 | + const classes = button.className.split(' ').filter(cls => cls && 'e-admin-top-bar__bar-button' !== cls); | |
| 1259 | + if (classes.length > 0) { | |
| 1260 | + return classes.join('-'); | |
| 1261 | + } | |
| 1262 | + return 'unknown-top-bar-button'; | |
| 1263 | + } | |
| 1264 | +} | |
| 1265 | +var _default = exports["default"] = TopBarTracking; | |
| 1266 | + | |
| 1267 | +/***/ }), | |
| 1268 | + | |
| 1269 | +/***/ "../app/assets/js/event-track/dashboard/utils.js": | |
| 1270 | +/*!*******************************************************!*\ | |
| 1271 | + !*** ../app/assets/js/event-track/dashboard/utils.js ***! | |
| 1272 | + \*******************************************************/ | |
| 1273 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1274 | + | |
| 1275 | +"use strict"; | |
| 1276 | + | |
| 1277 | + | |
| 1278 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1279 | + value: true | |
| 1280 | +})); | |
| 1281 | +exports.DashboardUtils = void 0; | |
| 1282 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 1283 | +__webpack_require__(/*! core-js/modules/esnext.iterator.some.js */ "../node_modules/core-js/modules/esnext.iterator.some.js"); | |
| 1284 | +const DashboardUtils = exports.DashboardUtils = { | |
| 1285 | + isElementorPage() { | |
| 1286 | + const urlParams = new URLSearchParams(window.location.search); | |
| 1287 | + const page = urlParams.get('page'); | |
| 1288 | + if (page && (page.startsWith('elementor') || page.includes('elementor'))) { | |
| 1289 | + return true; | |
| 1290 | + } | |
| 1291 | + const postType = urlParams.get('post_type'); | |
| 1292 | + if ('elementor_library' === postType || 'e-floating-buttons' === postType) { | |
| 1293 | + return true; | |
| 1294 | + } | |
| 1295 | + const body = document.body; | |
| 1296 | + const bodyClasses = body.className.split(' '); | |
| 1297 | + return bodyClasses.some(cls => cls.includes('elementor') && (cls.includes('page') || cls.includes('post-type'))); | |
| 1298 | + } | |
| 1299 | +}; | |
| 1300 | + | |
| 1301 | +/***/ }), | |
| 1302 | + | |
| 1303 | +/***/ "../app/assets/js/event-track/wp-dashboard-tracking.js": | |
| 1304 | +/*!*************************************************************!*\ | |
| 1305 | + !*** ../app/assets/js/event-track/wp-dashboard-tracking.js ***! | |
| 1306 | + \*************************************************************/ | |
| 1307 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1308 | + | |
| 1309 | +"use strict"; | |
| 1310 | + | |
| 1311 | + | |
| 1312 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1313 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1314 | + value: true | |
| 1315 | +})); | |
| 1316 | +exports["default"] = exports.SCREEN_TYPES = exports.NAV_AREAS = exports.CONTROL_TYPES = void 0; | |
| 1317 | +__webpack_require__(/*! core-js/modules/es.array.push.js */ "../node_modules/core-js/modules/es.array.push.js"); | |
| 1318 | +__webpack_require__(/*! core-js/modules/esnext.iterator.constructor.js */ "../node_modules/core-js/modules/esnext.iterator.constructor.js"); | |
| 1319 | +__webpack_require__(/*! core-js/modules/esnext.iterator.for-each.js */ "../node_modules/core-js/modules/esnext.iterator.for-each.js"); | |
| 1320 | +var _navigation = _interopRequireDefault(__webpack_require__(/*! ./dashboard/navigation */ "../app/assets/js/event-track/dashboard/navigation.js")); | |
| 1321 | +var _pluginActions = _interopRequireDefault(__webpack_require__(/*! ./dashboard/plugin-actions */ "../app/assets/js/event-track/dashboard/plugin-actions.js")); | |
| 1322 | +var _promotion = _interopRequireDefault(__webpack_require__(/*! ./dashboard/promotion */ "../app/assets/js/event-track/dashboard/promotion.js")); | |
| 1323 | +var _screenView = _interopRequireDefault(__webpack_require__(/*! ./dashboard/screen-view */ "../app/assets/js/event-track/dashboard/screen-view.js")); | |
| 1324 | +var _menuPromotion = _interopRequireDefault(__webpack_require__(/*! ./dashboard/menu-promotion */ "../app/assets/js/event-track/dashboard/menu-promotion.js")); | |
| 1325 | +var _actionControls = _interopRequireDefault(__webpack_require__(/*! ./dashboard/action-controls */ "../app/assets/js/event-track/dashboard/action-controls.js")); | |
| 1326 | +var _topBar = _interopRequireDefault(__webpack_require__(/*! ./dashboard/top-bar */ "../app/assets/js/event-track/dashboard/top-bar.js")); | |
| 1327 | +const SESSION_TIMEOUT_MINUTES = 30; | |
| 1328 | +const MINUTE_MS = 60 * 1000; | |
| 1329 | +const SESSION_TIMEOUT = SESSION_TIMEOUT_MINUTES * MINUTE_MS; | |
| 1330 | +const ACTIVITY_CHECK_INTERVAL = 1 * MINUTE_MS; | |
| 1331 | +const SESSION_STORAGE_KEY = 'elementor_wpdash_session'; | |
| 1332 | +const PENDING_NAV_CLICK_KEY = 'elementor_wpdash_pending_nav'; | |
| 1333 | +const CONTROL_TYPES = exports.CONTROL_TYPES = { | |
| 1334 | + BUTTON: 'button', | |
| 1335 | + CHECKBOX: 'checkbox', | |
| 1336 | + RADIO: 'radio', | |
| 1337 | + LINK: 'link', | |
| 1338 | + SELECT: 'select', | |
| 1339 | + TOGGLE: 'toggle', | |
| 1340 | + FILTER: 'filter' | |
| 1341 | +}; | |
| 1342 | +const NAV_AREAS = exports.NAV_AREAS = { | |
| 1343 | + LEFT_MENU: 'left_menu', | |
| 1344 | + SUBMENU: 'submenu', | |
| 1345 | + HOVER_MENU: 'hover_menu', | |
| 1346 | + TOP_BAR: 'top_bar', | |
| 1347 | + SIDEBAR_MENU: 'sidebar' | |
| 1348 | +}; | |
| 1349 | +const SCREEN_TYPES = exports.SCREEN_TYPES = { | |
| 1350 | + TAB: 'tab', | |
| 1351 | + POPUP: 'popup', | |
| 1352 | + APP_SCREEN: 'app_screen' | |
| 1353 | +}; | |
| 1354 | +class WpDashboardTracking { | |
| 1355 | + static sessionStartTime = Date.now(); | |
| 1356 | + static lastActivityTime = Date.now(); | |
| 1357 | + static sessionEnded = false; | |
| 1358 | + static navItemsVisited = new Set(); | |
| 1359 | + static activityCheckInterval = null; | |
| 1360 | + static initialized = false; | |
| 1361 | + static navigationListeners = []; | |
| 1362 | + static isNavigatingToElementor = false; | |
| 1363 | + static init() { | |
| 1364 | + if (this.initialized) { | |
| 1365 | + return; | |
| 1366 | + } | |
| 1367 | + this.restoreOrCreateSession(); | |
| 1368 | + if (this.isEventsManagerAvailable()) { | |
| 1369 | + this.startSessionMonitoring(); | |
| 1370 | + this.attachActivityListeners(); | |
| 1371 | + this.attachNavigationListener(); | |
| 1372 | + this.initialized = true; | |
| 1373 | + } | |
| 1374 | + } | |
| 1375 | + static restoreOrCreateSession() { | |
| 1376 | + const storedSession = this.getStoredSession(); | |
| 1377 | + if (storedSession) { | |
| 1378 | + this.sessionStartTime = storedSession.sessionStartTime; | |
| 1379 | + this.navItemsVisited = new Set(storedSession.navItemsVisited); | |
| 1380 | + this.lastActivityTime = Date.now(); | |
| 1381 | + this.sessionEnded = false; | |
| 1382 | + } else { | |
| 1383 | + this.sessionStartTime = Date.now(); | |
| 1384 | + this.lastActivityTime = Date.now(); | |
| 1385 | + this.sessionEnded = false; | |
| 1386 | + this.navItemsVisited = new Set(); | |
| 1387 | + } | |
| 1388 | + this.processPendingNavClick(); | |
| 1389 | + this.saveSessionToStorage(); | |
| 1390 | + } | |
| 1391 | + static isEditorOneActive() { | |
| 1392 | + return elementorCommon?.config?.editor_events?.isEditorOneActive ?? false; | |
| 1393 | + } | |
| 1394 | + static processPendingNavClick() { | |
| 1395 | + try { | |
| 1396 | + const pendingNav = sessionStorage.getItem(PENDING_NAV_CLICK_KEY); | |
| 1397 | + if (pendingNav) { | |
| 1398 | + const { | |
| 1399 | + itemId, | |
| 1400 | + rootItem, | |
| 1401 | + area | |
| 1402 | + } = JSON.parse(pendingNav); | |
| 1403 | + this.navItemsVisited.add(itemId); | |
| 1404 | + const properties = { | |
| 1405 | + wpdash_nav_item_id: itemId, | |
| 1406 | + wpdash_nav_area: area | |
| 1407 | + }; | |
| 1408 | + if (rootItem) { | |
| 1409 | + properties.wpdash_nav_item_root = rootItem; | |
| 1410 | + } | |
| 1411 | + this.dispatchEvent('wpdash_nav_clicked', properties, { | |
| 1412 | + send_immediately: true | |
| 1413 | + }); | |
| 1414 | + sessionStorage.removeItem(PENDING_NAV_CLICK_KEY); | |
| 1415 | + } | |
| 1416 | + } catch (error) { | |
| 1417 | + sessionStorage.removeItem(PENDING_NAV_CLICK_KEY); | |
| 1418 | + } | |
| 1419 | + } | |
| 1420 | + static getStoredSession() { | |
| 1421 | + try { | |
| 1422 | + const stored = sessionStorage.getItem(SESSION_STORAGE_KEY); | |
| 1423 | + return stored ? JSON.parse(stored) : null; | |
| 1424 | + } catch (error) { | |
| 1425 | + return null; | |
| 1426 | + } | |
| 1427 | + } | |
| 1428 | + static saveSessionToStorage() { | |
| 1429 | + const sessionData = { | |
| 1430 | + sessionStartTime: this.sessionStartTime, | |
| 1431 | + navItemsVisited: Array.from(this.navItemsVisited) | |
| 1432 | + }; | |
| 1433 | + sessionStorage.setItem(SESSION_STORAGE_KEY, JSON.stringify(sessionData)); | |
| 1434 | + } | |
| 1435 | + static clearStoredSession() { | |
| 1436 | + sessionStorage.removeItem(SESSION_STORAGE_KEY); | |
| 1437 | + } | |
| 1438 | + static isEventsManagerAvailable() { | |
| 1439 | + return elementorCommon?.eventsManager && 'function' === typeof elementorCommon.eventsManager.dispatchEvent; | |
| 1440 | + } | |
| 1441 | + static canSendEvents() { | |
| 1442 | + return elementorCommon?.config?.editor_events?.can_send_events || false; | |
| 1443 | + } | |
| 1444 | + static dispatchEvent(eventName, properties = {}, options = {}) { | |
| 1445 | + if (!this.isEventsManagerAvailable() || !this.canSendEvents()) { | |
| 1446 | + return; | |
| 1447 | + } | |
| 1448 | + elementorCommon.eventsManager.dispatchEvent(eventName, properties, options); | |
| 1449 | + } | |
| 1450 | + static updateActivity() { | |
| 1451 | + this.lastActivityTime = Date.now(); | |
| 1452 | + } | |
| 1453 | + static startSessionMonitoring() { | |
| 1454 | + this.activityCheckInterval = setInterval(() => { | |
| 1455 | + this.checkSessionTimeout(); | |
| 1456 | + }, ACTIVITY_CHECK_INTERVAL); | |
| 1457 | + window.addEventListener('beforeunload', () => { | |
| 1458 | + if (!this.sessionEnded && !this.isNavigatingToElementor) { | |
| 1459 | + this.trackSessionEnd('tab_closed'); | |
| 1460 | + } | |
| 1461 | + }); | |
| 1462 | + document.addEventListener('visibilitychange', () => { | |
| 1463 | + if (!this.sessionEnded && document.hidden) { | |
| 1464 | + const timeSinceLastActivity = Date.now() - this.lastActivityTime; | |
| 1465 | + if (timeSinceLastActivity > SESSION_TIMEOUT) { | |
| 1466 | + this.trackSessionEnd('tab_inactive'); | |
| 1467 | + } | |
| 1468 | + } | |
| 1469 | + }); | |
| 1470 | + } | |
| 1471 | + static isElementorPage(url) { | |
| 1472 | + try { | |
| 1473 | + const urlObj = new URL(url, window.location.origin); | |
| 1474 | + const params = urlObj.searchParams; | |
| 1475 | + const page = params.get('page'); | |
| 1476 | + const postType = params.get('post_type'); | |
| 1477 | + const action = params.get('action'); | |
| 1478 | + const elementorPages = ['elementor', 'go_knowledge_base_site', 'e-form-submissions']; | |
| 1479 | + const elementorPostTypes = ['elementor_library', 'e-floating-buttons']; | |
| 1480 | + return page && elementorPages.some(p => page.includes(p)) || postType && elementorPostTypes.includes(postType) || action && action.includes('elementor'); | |
| 1481 | + } catch (error) { | |
| 1482 | + return false; | |
| 1483 | + } | |
| 1484 | + } | |
| 1485 | + static isPluginsPage(url) { | |
| 1486 | + try { | |
| 1487 | + const urlObj = new URL(url, window.location.origin); | |
| 1488 | + return urlObj.pathname.includes('plugins.php'); | |
| 1489 | + } catch (error) { | |
| 1490 | + return false; | |
| 1491 | + } | |
| 1492 | + } | |
| 1493 | + static isNavigatingAwayFromElementor(targetUrl) { | |
| 1494 | + if (!targetUrl) { | |
| 1495 | + return false; | |
| 1496 | + } | |
| 1497 | + if (targetUrl.startsWith('#')) { | |
| 1498 | + return false; | |
| 1499 | + } | |
| 1500 | + return !this.isElementorPage(targetUrl); | |
| 1501 | + } | |
| 1502 | + static isLinkOpeningInNewTab(link) { | |
| 1503 | + const target = link.getAttribute('target'); | |
| 1504 | + return '_blank' === target || '_new' === target; | |
| 1505 | + } | |
| 1506 | + static attachNavigationListener() { | |
| 1507 | + const handleLinkClick = event => { | |
| 1508 | + const link = event.target.closest('a'); | |
| 1509 | + if (link && link.href) { | |
| 1510 | + if (this.isLinkOpeningInNewTab(link)) { | |
| 1511 | + return; | |
| 1512 | + } | |
| 1513 | + if (!this.sessionEnded && this.isNavigatingAwayFromElementor(link.href)) { | |
| 1514 | + this.trackSessionEnd('navigate_away'); | |
| 1515 | + } else if (this.isElementorPage(link.href)) { | |
| 1516 | + this.isNavigatingToElementor = true; | |
| 1517 | + } | |
| 1518 | + } | |
| 1519 | + const isSidebar = event.target.closest('#editor-one-sidebar-navigation'); | |
| 1520 | + if (isSidebar) { | |
| 1521 | + this.isNavigatingToElementor = true; | |
| 1522 | + } | |
| 1523 | + }; | |
| 1524 | + const handleFormSubmit = event => { | |
| 1525 | + const form = event.target; | |
| 1526 | + if (form.action) { | |
| 1527 | + if (!this.sessionEnded && this.isNavigatingAwayFromElementor(form.action)) { | |
| 1528 | + this.trackSessionEnd('navigate_away'); | |
| 1529 | + } else if (this.isElementorPage(form.action)) { | |
| 1530 | + this.isNavigatingToElementor = true; | |
| 1531 | + } | |
| 1532 | + } | |
| 1533 | + }; | |
| 1534 | + document.addEventListener('click', handleLinkClick, true); | |
| 1535 | + document.addEventListener('submit', handleFormSubmit, true); | |
| 1536 | + this.navigationListeners.push({ | |
| 1537 | + type: 'click', | |
| 1538 | + handler: handleLinkClick | |
| 1539 | + }, { | |
| 1540 | + type: 'submit', | |
| 1541 | + handler: handleFormSubmit | |
| 1542 | + }); | |
| 1543 | + } | |
| 1544 | + static checkSessionTimeout() { | |
| 1545 | + const timeSinceLastActivity = Date.now() - this.lastActivityTime; | |
| 1546 | + if (timeSinceLastActivity > SESSION_TIMEOUT && !this.sessionEnded) { | |
| 1547 | + this.trackSessionEnd('timeout'); | |
| 1548 | + } | |
| 1549 | + } | |
| 1550 | + static attachActivityListeners() { | |
| 1551 | + const events = ['mousedown', 'keydown', 'scroll', 'touchstart', 'click']; | |
| 1552 | + events.forEach(event => { | |
| 1553 | + document.addEventListener(event, () => { | |
| 1554 | + this.updateActivity(); | |
| 1555 | + }, { | |
| 1556 | + capture: true, | |
| 1557 | + passive: true | |
| 1558 | + }); | |
| 1559 | + }); | |
| 1560 | + } | |
| 1561 | + static formatDuration(milliseconds) { | |
| 1562 | + const totalSeconds = Math.floor(milliseconds / 1000); | |
| 1563 | + return Number(totalSeconds.toFixed(2)); | |
| 1564 | + } | |
| 1565 | + static trackNavClicked(itemId, rootItem = null, area = NAV_AREAS.LEFT_MENU) { | |
| 1566 | + if (!this.initialized) { | |
| 1567 | + const pendingNav = { | |
| 1568 | + itemId, | |
| 1569 | + rootItem, | |
| 1570 | + area | |
| 1571 | + }; | |
| 1572 | + sessionStorage.setItem(PENDING_NAV_CLICK_KEY, JSON.stringify(pendingNav)); | |
| 1573 | + return; | |
| 1574 | + } | |
| 1575 | + this.updateActivity(); | |
| 1576 | + this.navItemsVisited.add(itemId); | |
| 1577 | + this.saveSessionToStorage(); | |
| 1578 | + const properties = { | |
| 1579 | + wpdash_nav_item_id: itemId, | |
| 1580 | + wpdash_nav_area: area | |
| 1581 | + }; | |
| 1582 | + if (rootItem) { | |
| 1583 | + properties.wpdash_nav_item_root = rootItem; | |
| 1584 | + } | |
| 1585 | + this.dispatchEvent('wpdash_nav_clicked', properties); | |
| 1586 | + } | |
| 1587 | + static trackScreenViewed(screenId, screenType = SCREEN_TYPES.TAB) { | |
| 1588 | + this.updateActivity(); | |
| 1589 | + const properties = { | |
| 1590 | + wpdash_screen_id: screenId, | |
| 1591 | + wpdash_screen_type: screenType | |
| 1592 | + }; | |
| 1593 | + this.dispatchEvent('wpdash_screen_viewed', properties); | |
| 1594 | + } | |
| 1595 | + static trackActionControl(controlIdentifier, controlType) { | |
| 1596 | + this.updateActivity(); | |
| 1597 | + const properties = { | |
| 1598 | + wpdash_action_control_interacted: controlIdentifier, | |
| 1599 | + wpdash_control_type: controlType | |
| 1600 | + }; | |
| 1601 | + this.dispatchEvent('wpdash_action_control', properties); | |
| 1602 | + } | |
| 1603 | + static trackPromoClicked(promoName, destination, clickPath) { | |
| 1604 | + this.updateActivity(); | |
| 1605 | + const properties = { | |
| 1606 | + wpdash_promo_name: promoName, | |
| 1607 | + wpdash_promo_destination: destination, | |
| 1608 | + wpdash_promo_clicked_path: clickPath | |
| 1609 | + }; | |
| 1610 | + this.dispatchEvent('wpdash_promo_clicked', properties); | |
| 1611 | + } | |
| 1612 | + static trackSessionEnd(reason = 'timeout') { | |
| 1613 | + if (this.sessionEnded) { | |
| 1614 | + return; | |
| 1615 | + } | |
| 1616 | + this.sessionEnded = true; | |
| 1617 | + if (this.activityCheckInterval) { | |
| 1618 | + clearInterval(this.activityCheckInterval); | |
| 1619 | + this.activityCheckInterval = null; | |
| 1620 | + } | |
| 1621 | + const duration = Date.now() - this.sessionStartTime; | |
| 1622 | + const properties = { | |
| 1623 | + wpdash_endstate_nav_summary: Array.from(this.navItemsVisited), | |
| 1624 | + wpdash_endstate_nav_count: this.navItemsVisited.size, | |
| 1625 | + wpdash_endstate_duration: this.formatDuration(duration), | |
| 1626 | + reason | |
| 1627 | + }; | |
| 1628 | + this.dispatchEvent('wpdash_session_end_state', properties); | |
| 1629 | + this.clearStoredSession(); | |
| 1630 | + } | |
| 1631 | + static destroy() { | |
| 1632 | + if (this.activityCheckInterval) { | |
| 1633 | + clearInterval(this.activityCheckInterval); | |
| 1634 | + } | |
| 1635 | + this.navigationListeners.forEach(({ | |
| 1636 | + type, | |
| 1637 | + handler | |
| 1638 | + }) => { | |
| 1639 | + document.removeEventListener(type, handler, true); | |
| 1640 | + }); | |
| 1641 | + this.navigationListeners = []; | |
| 1642 | + _screenView.default.destroy(); | |
| 1643 | + _promotion.default.destroy(); | |
| 1644 | + _menuPromotion.default.destroy(); | |
| 1645 | + _actionControls.default.destroy(); | |
| 1646 | + if (!WpDashboardTracking.isEditorOneActive()) { | |
| 1647 | + _topBar.default.destroy(); | |
| 1648 | + } | |
| 1649 | + this.initialized = false; | |
| 1650 | + } | |
| 1651 | +} | |
| 1652 | +exports["default"] = WpDashboardTracking; | |
| 1653 | +window.addEventListener('elementor/admin/init', () => { | |
| 1654 | + const currentUrl = window.location.href; | |
| 1655 | + const isPluginsPage = WpDashboardTracking.isPluginsPage(currentUrl); | |
| 1656 | + const isElementorPage = WpDashboardTracking.isElementorPage(currentUrl); | |
| 1657 | + if (isPluginsPage) { | |
| 1658 | + _pluginActions.default.init(); | |
| 1659 | + } | |
| 1660 | + _navigation.default.init(); | |
| 1661 | + if (isElementorPage) { | |
| 1662 | + WpDashboardTracking.init(); | |
| 1663 | + _screenView.default.init(); | |
| 1664 | + _promotion.default.init(); | |
| 1665 | + _menuPromotion.default.init(); | |
| 1666 | + _actionControls.default.init(); | |
| 1667 | + if (!WpDashboardTracking.isEditorOneActive()) { | |
| 1668 | + _topBar.default.init(); | |
| 1669 | + } | |
| 1670 | + } | |
| 1671 | +}); | |
| 1672 | +window.addEventListener('beforeunload', () => { | |
| 1673 | + _navigation.default.destroy(); | |
| 1674 | + _pluginActions.default.destroy(); | |
| 1675 | + WpDashboardTracking.destroy(); | |
| 1676 | +}); | |
| 1677 | + | |
| 1678 | +/***/ }), | |
| 1679 | + | |
| 3 | 1680 | /***/ "../app/modules/import-export-customization/assets/js/shared/registry/base.js": |
| 4 | 1681 | /*!************************************************************************************!*\ |
| 5 | 1682 | !*** ../app/modules/import-export-customization/assets/js/shared/registry/base.js ***! |
| 6 | 1683 | \************************************************************************************/ |
| @@ -1683,9 +3360,11 @@ | ||
| 1683 | 3360 | var _scroll = _interopRequireDefault(__webpack_require__(/*! ./imports/utils/scroll */ "../assets/dev/js/modules/imports/utils/scroll.js")); |
| 1684 | 3361 | var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ./imports/force-method-implementation */ "../assets/dev/js/modules/imports/force-method-implementation.js")); |
| 1685 | 3362 | var _templateRegistryHelpers = __webpack_require__(/*! ../../../../app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers */ "../app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers.js"); |
| 1686 | 3363 | var _customizationDialogs = __webpack_require__(/*! ../../../../app/modules/import-export-customization/assets/js/shared/registry/customization-dialogs */ "../app/modules/import-export-customization/assets/js/shared/registry/customization-dialogs.js"); |
| 1687 | -const baseModules = { | |
| 3364 | +var _appsEventTracking = __webpack_require__(/*! elementor-app/event-track/apps-event-tracking */ "../app/assets/js/event-track/apps-event-tracking.js"); | |
| 3365 | +var _wpDashboardTracking = _interopRequireDefault(__webpack_require__(/*! elementor-app/event-track/wp-dashboard-tracking */ "../app/assets/js/event-track/wp-dashboard-tracking.js")); | |
| 3366 | +var _default = exports["default"] = window.elementorModules = { | |
| 1688 | 3367 | Module: _module.default, |
| 1689 | 3368 | ViewModule: _viewModule.default, |
| 1690 | 3369 | ArgsObject: _argsObject.default, |
| 1691 | 3370 | ForceMethodImplementation: _forceMethodImplementation.default, |
| @@ -1695,19 +3374,242 @@ | ||
| 1695 | 3374 | }, |
| 1696 | 3375 | importExport: { |
| 1697 | 3376 | createGetInitialState: _templateRegistryHelpers.createGetInitialState, |
| 1698 | 3377 | customizationDialogsRegistry: _customizationDialogs.customizationDialogsRegistry |
| 3378 | + }, | |
| 3379 | + appsEventTracking: { | |
| 3380 | + AppsEventTracking: _appsEventTracking.AppsEventTracking | |
| 3381 | + }, | |
| 3382 | + wpDashboardTracking: { | |
| 3383 | + WpDashboardTracking: _wpDashboardTracking.default | |
| 1699 | 3384 | } |
| 1700 | 3385 | }; |
| 1701 | -if (!window.elementorModules) { | |
| 1702 | - window.elementorModules = baseModules; | |
| 1703 | -} else { | |
| 1704 | - Object.assign(window.elementorModules, baseModules); | |
| 1705 | -} | |
| 1706 | -var _default = exports["default"] = window.elementorModules; | |
| 1707 | 3386 | |
| 1708 | 3387 | /***/ }), |
| 1709 | 3388 | |
| 3389 | +/***/ "../core/common/modules/events-manager/assets/js/events-config.js": | |
| 3390 | +/*!************************************************************************!*\ | |
| 3391 | + !*** ../core/common/modules/events-manager/assets/js/events-config.js ***! | |
| 3392 | + \************************************************************************/ | |
| 3393 | +/***/ ((__unused_webpack_module, exports) => { | |
| 3394 | + | |
| 3395 | +"use strict"; | |
| 3396 | + | |
| 3397 | + | |
| 3398 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3399 | + value: true | |
| 3400 | +})); | |
| 3401 | +exports["default"] = void 0; | |
| 3402 | +const eventsConfig = { | |
| 3403 | + triggers: { | |
| 3404 | + click: 'Click', | |
| 3405 | + rightClick: 'Right Click', | |
| 3406 | + doubleClick: 'Double Click', | |
| 3407 | + accordionClick: 'Accordion Click', | |
| 3408 | + toggleClick: 'Toggle Click', | |
| 3409 | + dropdownClick: 'Click Dropdown', | |
| 3410 | + editorLoaded: 'Editor Loaded', | |
| 3411 | + visible: 'Visible', | |
| 3412 | + pageLoaded: 'Page Loaded' | |
| 3413 | + }, | |
| 3414 | + locations: { | |
| 3415 | + widgetPanel: 'Widget Panel', | |
| 3416 | + topBar: 'Top Bar', | |
| 3417 | + elementorEditor: 'Elementor Editor', | |
| 3418 | + templatesLibrary: { | |
| 3419 | + library: 'Templates Library' | |
| 3420 | + }, | |
| 3421 | + app: { | |
| 3422 | + import: 'Import Kit', | |
| 3423 | + export: 'Export Kit', | |
| 3424 | + kitLibrary: 'Kit Library', | |
| 3425 | + cloudKitLibrary: 'Cloud Kit Library' | |
| 3426 | + }, | |
| 3427 | + variables: 'Variables Panel', | |
| 3428 | + variablesManager: 'Variables Manager', | |
| 3429 | + admin: 'WP admin', | |
| 3430 | + structurePanel: 'Structure Panel', | |
| 3431 | + canvas: 'Canvas' | |
| 3432 | + }, | |
| 3433 | + secondaryLocations: { | |
| 3434 | + layout: 'Layout Section', | |
| 3435 | + basic: 'Basic Section', | |
| 3436 | + 'pro-elements': 'Pro Section', | |
| 3437 | + general: 'General Section', | |
| 3438 | + 'theme-elements': 'Site Section', | |
| 3439 | + 'theme-elements-single': 'Single Section', | |
| 3440 | + 'woocommerce-elements': 'WooCommerce Section', | |
| 3441 | + wordpress: 'WordPress Section', | |
| 3442 | + categories: 'Widgets Tab', | |
| 3443 | + global: 'Globals Tab', | |
| 3444 | + 'whats-new': 'What\'s New', | |
| 3445 | + 'document-settings': 'Document Settings icon', | |
| 3446 | + 'preview-page': 'Preview Page', | |
| 3447 | + 'publish-button': 'Publish Button', | |
| 3448 | + 'widget-panel': 'Widget Panel Icon', | |
| 3449 | + finder: 'Finder', | |
| 3450 | + help: 'Help', | |
| 3451 | + elementorLogoDropdown: 'top_bar_elementor_logo_dropdown', | |
| 3452 | + elementorLogo: 'Elementor Logo', | |
| 3453 | + eLogoMenu: 'E-logo Menu', | |
| 3454 | + notes: 'Notes', | |
| 3455 | + siteSettings: 'Site Settings', | |
| 3456 | + structure: 'Structure', | |
| 3457 | + documentNameDropdown: 'Document Name dropdown', | |
| 3458 | + responsiveControls: 'Responsive controls', | |
| 3459 | + launchpad: 'launchpad', | |
| 3460 | + checklistHeader: 'Checklist Header', | |
| 3461 | + checklistSteps: 'Checklist Steps', | |
| 3462 | + userPreferences: 'User Preferences', | |
| 3463 | + contextMenu: 'Context Menu', | |
| 3464 | + templateLibrary: { | |
| 3465 | + saveModal: 'Save to Modal', | |
| 3466 | + moveModal: 'Move to Modal', | |
| 3467 | + bulkMoveModal: 'Bulk Move to Modal', | |
| 3468 | + copyModal: 'Copy to Modal', | |
| 3469 | + bulkCopyModal: 'Bulk Copy to Modal', | |
| 3470 | + saveModalSelectFolder: 'Save to Modal - select folder', | |
| 3471 | + saveModalSelectConnect: 'Save to Modal - connect', | |
| 3472 | + saveModalSelectUpgrade: 'Save to Modal - upgrade', | |
| 3473 | + importModal: 'Import Modal', | |
| 3474 | + newFolderModal: 'New Folder Modal', | |
| 3475 | + deleteDialog: 'Delete Dialog', | |
| 3476 | + deleteFolderDialog: 'Delete Folder Dialog', | |
| 3477 | + renameDialog: 'Rename Dialog', | |
| 3478 | + createFolderDialog: 'Create Folder Dialog', | |
| 3479 | + applySettingsDialog: 'Apply Settings Dialog', | |
| 3480 | + cloudTab: 'Cloud Tab', | |
| 3481 | + siteTab: 'Site Tab', | |
| 3482 | + cloudTabFolder: 'Cloud Tab - Folder', | |
| 3483 | + cloudTabConnect: 'Cloud Tab - Connect', | |
| 3484 | + cloudTabUpgrade: 'Cloud Tab - Upgrade', | |
| 3485 | + morePopup: 'Context Menu', | |
| 3486 | + quotaBar: 'Quota Bar' | |
| 3487 | + }, | |
| 3488 | + kitLibrary: { | |
| 3489 | + cloudKitLibrary: 'kits_cloud_library', | |
| 3490 | + cloudKitLibraryConnect: 'kits_cloud_library_connect', | |
| 3491 | + cloudKitLibraryUpgrade: 'kits_cloud_library_upgrade', | |
| 3492 | + kitExportCustomization: 'kit_export_customization', | |
| 3493 | + kitExport: 'kit_export', | |
| 3494 | + kitExportCustomizationEdit: 'kit_export_customization_edit', | |
| 3495 | + kitExportSummary: 'kit_export_summary', | |
| 3496 | + kitImportUploadBox: 'kit_import_upload_box', | |
| 3497 | + kitImportCustomization: 'kit_import_customization', | |
| 3498 | + kitImportSummary: 'kit_import_summary' | |
| 3499 | + }, | |
| 3500 | + variablesPopover: 'Variables Popover', | |
| 3501 | + admin: { | |
| 3502 | + pluginToolsTab: 'plugin_tools_tab', | |
| 3503 | + pluginWebsiteTemplatesTab: 'plugin_website_templates_tab' | |
| 3504 | + }, | |
| 3505 | + componentsTab: 'Components Tab', | |
| 3506 | + canvasElement: 'Canvas Element' | |
| 3507 | + }, | |
| 3508 | + elements: { | |
| 3509 | + accordionSection: 'Accordion section', | |
| 3510 | + buttonIcon: 'Button Icon', | |
| 3511 | + mainCta: 'Main CTA', | |
| 3512 | + button: 'Button', | |
| 3513 | + link: 'Link', | |
| 3514 | + dropdown: 'Dropdown', | |
| 3515 | + toggle: 'Toggle', | |
| 3516 | + launchpadChecklist: 'Checklist popup' | |
| 3517 | + }, | |
| 3518 | + names: { | |
| 3519 | + v1: { | |
| 3520 | + layout: 'v1_widgets_tab_layout_section', | |
| 3521 | + basic: 'v1_widgets_tab_basic_section', | |
| 3522 | + 'pro-elements': 'v1_widgets_tab_pro_section', | |
| 3523 | + general: 'v1_widgets_tab_general_section', | |
| 3524 | + 'theme-elements': 'v1_widgets_tab_site_section', | |
| 3525 | + 'theme-elements-single': 'v1_widgets_tab_single_section', | |
| 3526 | + 'woocommerce-elements': 'v1_widgets_tab_woocommerce_section', | |
| 3527 | + wordpress: 'v1_widgets_tab_wordpress_section', | |
| 3528 | + categories: 'v1_widgets_tab', | |
| 3529 | + global: 'v1_globals_tab' | |
| 3530 | + }, | |
| 3531 | + topBar: { | |
| 3532 | + whatsNew: 'top_bar_whats_new', | |
| 3533 | + documentSettings: 'top_bar_document_settings_icon', | |
| 3534 | + previewPage: 'top_bar_preview_page', | |
| 3535 | + publishButton: 'top_bar_publish_button', | |
| 3536 | + widgetPanel: 'top_bar_widget_panel_icon', | |
| 3537 | + finder: 'top_bar_finder', | |
| 3538 | + help: 'top_bar_help', | |
| 3539 | + history: 'top_bar_elementor_logo_dropdown_history', | |
| 3540 | + userPreferences: 'top_bar_elementor_logo_dropdown_user_preferences', | |
| 3541 | + keyboardShortcuts: 'top_bar_elementor_logo_dropdown_keyboard_shortcuts', | |
| 3542 | + exitToWordpress: 'top_bar_elementor_logo_dropdown_exit_to_wordpress', | |
| 3543 | + themeBuilder: 'top_bar_elementor_logo_dropdown_theme_builder', | |
| 3544 | + notes: 'top_bar_notes', | |
| 3545 | + siteSettings: 'top_bar_site_setting', | |
| 3546 | + structure: 'top_bar_structure', | |
| 3547 | + documentNameDropdown: 'top_bar_document_name_dropdown', | |
| 3548 | + responsiveControls: 'top_bar_responsive_controls', | |
| 3549 | + launchpadOn: 'top_bar_checklist_icon_show', | |
| 3550 | + launchpadOff: 'top_bar_checklist_icon_hide', | |
| 3551 | + elementorLogoDropdown: 'open_e_menu', | |
| 3552 | + connectAccount: 'connect_account', | |
| 3553 | + accountConnected: 'account_connected' | |
| 3554 | + }, | |
| 3555 | + // ChecklistSteps event names are generated dynamically, based on stepId and action type taken: title, action, done, undone, upgrade | |
| 3556 | + elementorEditor: { | |
| 3557 | + checklist: { | |
| 3558 | + checklistHeaderClose: 'checklist_header_close_icon', | |
| 3559 | + checklistFirstPopup: 'checklist popup triggered' | |
| 3560 | + }, | |
| 3561 | + userPreferences: { | |
| 3562 | + checklistShow: 'checklist_userpreferences_toggle_show', | |
| 3563 | + checklistHide: 'checklist_userpreferences_toggle_hide' | |
| 3564 | + } | |
| 3565 | + }, | |
| 3566 | + variables: { | |
| 3567 | + open: 'open_variables_popover', | |
| 3568 | + add: 'add_new_variable', | |
| 3569 | + connect: 'connect_variable', | |
| 3570 | + save: 'save_new_variable', | |
| 3571 | + openManager: 'open_variables_manager', | |
| 3572 | + saveChanges: 'save_variables_changes', | |
| 3573 | + delete: 'delete_variable' | |
| 3574 | + }, | |
| 3575 | + components: { | |
| 3576 | + createClicked: 'component_create_clicked', | |
| 3577 | + createCancelled: 'component_creation_cancelled', | |
| 3578 | + created: 'component_created', | |
| 3579 | + instanceAdded: 'component_instance_added', | |
| 3580 | + edited: 'component_edited', | |
| 3581 | + propertiesPanelOpened: 'component_properties_panel_opened', | |
| 3582 | + propertiesGroupCreated: 'component_properties_group_created', | |
| 3583 | + propertyExposed: 'component_property_exposed', | |
| 3584 | + propertyRemoved: 'component_property_removed' | |
| 3585 | + }, | |
| 3586 | + global_classes: { | |
| 3587 | + classApplied: 'class_applied', | |
| 3588 | + classRemoved: 'class_removed', | |
| 3589 | + classManagerFilterCleared: 'class_manager_filter_cleared', | |
| 3590 | + classDeleted: 'class_deleted', | |
| 3591 | + classPublishConflict: 'class_publish_conflict', | |
| 3592 | + classRenamed: 'class_renamed', | |
| 3593 | + classCreated: 'class_created', | |
| 3594 | + classManagerSearched: 'class_manager_searched', | |
| 3595 | + classManagerFiltersOpened: 'class_manager_filters_opened', | |
| 3596 | + classManagerOpened: 'class_manager_opened', | |
| 3597 | + classManagerReorder: 'class_manager_reorder', | |
| 3598 | + classManagerFilterUsed: 'class_manager_filter_used', | |
| 3599 | + classUsageLocate: 'class_usage_locate', | |
| 3600 | + classUsageHovered: 'class_usage_hovered', | |
| 3601 | + classStyled: 'class_styled', | |
| 3602 | + classStateClicked: 'class_state_clicked', | |
| 3603 | + classUsageClicked: 'class_usage_clicked', | |
| 3604 | + classDuplicate: 'class_duplicate' | |
| 3605 | + } | |
| 3606 | + } | |
| 3607 | +}; | |
| 3608 | +var _default = exports["default"] = eventsConfig; | |
| 3609 | + | |
| 3610 | +/***/ }), | |
| 3611 | + | |
| 1710 | 3612 | /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": |
| 1711 | 3613 | /*!***********************************************************************!*\ |
| 1712 | 3614 | !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! |
| 1713 | 3615 | \***********************************************************************/ |
| @@ -4736,8 +6638,51 @@ | ||
| 4736 | 6638 | |
| 4737 | 6639 | |
| 4738 | 6640 | /***/ }), |
| 4739 | 6641 | |
| 6642 | +/***/ "../node_modules/core-js/modules/es.iterator.some.js": | |
| 6643 | +/*!***********************************************************!*\ | |
| 6644 | + !*** ../node_modules/core-js/modules/es.iterator.some.js ***! | |
| 6645 | + \***********************************************************/ | |
| 6646 | +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { | |
| 6647 | + | |
| 6648 | +"use strict"; | |
| 6649 | + | |
| 6650 | +var $ = __webpack_require__(/*! ../internals/export */ "../node_modules/core-js/internals/export.js"); | |
| 6651 | +var call = __webpack_require__(/*! ../internals/function-call */ "../node_modules/core-js/internals/function-call.js"); | |
| 6652 | +var iterate = __webpack_require__(/*! ../internals/iterate */ "../node_modules/core-js/internals/iterate.js"); | |
| 6653 | +var aCallable = __webpack_require__(/*! ../internals/a-callable */ "../node_modules/core-js/internals/a-callable.js"); | |
| 6654 | +var anObject = __webpack_require__(/*! ../internals/an-object */ "../node_modules/core-js/internals/an-object.js"); | |
| 6655 | +var getIteratorDirect = __webpack_require__(/*! ../internals/get-iterator-direct */ "../node_modules/core-js/internals/get-iterator-direct.js"); | |
| 6656 | +var iteratorClose = __webpack_require__(/*! ../internals/iterator-close */ "../node_modules/core-js/internals/iterator-close.js"); | |
| 6657 | +var iteratorHelperWithoutClosingOnEarlyError = __webpack_require__(/*! ../internals/iterator-helper-without-closing-on-early-error */ "../node_modules/core-js/internals/iterator-helper-without-closing-on-early-error.js"); | |
| 6658 | + | |
| 6659 | +var someWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('some', TypeError); | |
| 6660 | + | |
| 6661 | +// `Iterator.prototype.some` method | |
| 6662 | +// https://tc39.es/ecma262/#sec-iterator.prototype.some | |
| 6663 | +$({ target: 'Iterator', proto: true, real: true, forced: someWithoutClosingOnEarlyError }, { | |
| 6664 | + some: function some(predicate) { | |
| 6665 | + anObject(this); | |
| 6666 | + try { | |
| 6667 | + aCallable(predicate); | |
| 6668 | + } catch (error) { | |
| 6669 | + iteratorClose(this, 'throw', error); | |
| 6670 | + } | |
| 6671 | + | |
| 6672 | + if (someWithoutClosingOnEarlyError) return call(someWithoutClosingOnEarlyError, this, predicate); | |
| 6673 | + | |
| 6674 | + var record = getIteratorDirect(this); | |
| 6675 | + var counter = 0; | |
| 6676 | + return iterate(record, function (value, stop) { | |
| 6677 | + if (predicate(value, counter++)) return stop(); | |
| 6678 | + }, { IS_RECORD: true, INTERRUPTED: true }).stopped; | |
| 6679 | + } | |
| 6680 | +}); | |
| 6681 | + | |
| 6682 | + | |
| 6683 | +/***/ }), | |
| 6684 | + | |
| 4740 | 6685 | /***/ "../node_modules/core-js/modules/esnext.iterator.constructor.js": |
| 4741 | 6686 | /*!**********************************************************************!*\ |
| 4742 | 6687 | !*** ../node_modules/core-js/modules/esnext.iterator.constructor.js ***! |
| 4743 | 6688 | \**********************************************************************/ |
| @@ -4802,8 +6747,22 @@ | ||
| 4802 | 6747 | "use strict"; |
| 4803 | 6748 | |
| 4804 | 6749 | // TODO: Remove from `core-js@4` |
| 4805 | 6750 | __webpack_require__(/*! ../modules/es.iterator.map */ "../node_modules/core-js/modules/es.iterator.map.js"); |
| 6751 | + | |
| 6752 | + | |
| 6753 | +/***/ }), | |
| 6754 | + | |
| 6755 | +/***/ "../node_modules/core-js/modules/esnext.iterator.some.js": | |
| 6756 | +/*!***************************************************************!*\ | |
| 6757 | + !*** ../node_modules/core-js/modules/esnext.iterator.some.js ***! | |
| 6758 | + \***************************************************************/ | |
| 6759 | +/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { | |
| 6760 | + | |
| 6761 | +"use strict"; | |
| 6762 | + | |
| 6763 | +// TODO: Remove from `core-js@4` | |
| 6764 | +__webpack_require__(/*! ../modules/es.iterator.some */ "../node_modules/core-js/modules/es.iterator.some.js"); | |
| 4806 | 6765 | |
| 4807 | 6766 | |
| 4808 | 6767 | /***/ }) |
| 4809 | 6768 | |