| @@ -360,62 +360,8 @@ | ||
| 360 | 360 | }; |
| 361 | 361 | } |
| 362 | 362 | return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload); |
| 363 | 363 | } |
| 364 | - }, { | |
| 365 | - key: "createWpDashPayload", | |
| 366 | - value: function createWpDashPayload() { | |
| 367 | - var _config$appTypes$wpDa, _config$appTypes5, _config$locations11; | |
| 368 | - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 369 | - var config = this.getConfig(); | |
| 370 | - return this.createBasePayload(_objectSpread({ | |
| 371 | - window_name: (_config$appTypes$wpDa = config === null || config === void 0 || (_config$appTypes5 = config.appTypes) === null || _config$appTypes5 === void 0 ? void 0 : _config$appTypes5.wpDash) !== null && _config$appTypes$wpDa !== void 0 ? _config$appTypes$wpDa : 'wpdash', | |
| 372 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin), | |
| 373 | - location_l2: '' | |
| 374 | - }, overrides)); | |
| 375 | - } | |
| 376 | - }, { | |
| 377 | - key: "sendWpDashElementorMenuClick", | |
| 378 | - value: function sendWpDashElementorMenuClick() { | |
| 379 | - var _config$names10, _config$triggers10, _config$targetTypes11, _config$interactionRe13, _config$secondaryLoca11; | |
| 380 | - var config = this.getConfig(); | |
| 381 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names10 = config.names) === null || _config$names10 === void 0 || (_config$names10 = _config$names10.editorOne) === null || _config$names10 === void 0 ? void 0 : _config$names10.wpDashElementorMenuClick, this.createWpDashPayload({ | |
| 382 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click), | |
| 383 | - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem, | |
| 384 | - target_name: 'elementor_menu_item', | |
| 385 | - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened, | |
| 386 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu), | |
| 387 | - interaction_description: 'core_user_clicked_elementor_menu_item' | |
| 388 | - })); | |
| 389 | - } | |
| 390 | - }, { | |
| 391 | - key: "sendWpDashEditorSubMenuHover", | |
| 392 | - value: function sendWpDashEditorSubMenuHover() { | |
| 393 | - var _config$names11, _config$triggers11, _config$targetTypes12, _config$interactionRe14, _config$secondaryLoca12; | |
| 394 | - var config = this.getConfig(); | |
| 395 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names11 = config.names) === null || _config$names11 === void 0 || (_config$names11 = _config$names11.editorOne) === null || _config$names11 === void 0 ? void 0 : _config$names11.wpDashEditorSubMenuHover, this.createWpDashPayload({ | |
| 396 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover), | |
| 397 | - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu, | |
| 398 | - target_name: 'wpdash_editor_sub_menu', | |
| 399 | - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened, | |
| 400 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu), | |
| 401 | - interaction_description: 'core_user_hovered_sub_menu' | |
| 402 | - })); | |
| 403 | - } | |
| 404 | - }, { | |
| 405 | - key: "sendWpDashThemeBuilderClick", | |
| 406 | - value: function sendWpDashThemeBuilderClick() { | |
| 407 | - var _config$names12, _config$triggers12, _config$targetTypes13, _config$interactionRe15, _config$secondaryLoca13; | |
| 408 | - var config = this.getConfig(); | |
| 409 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names12 = config.names) === null || _config$names12 === void 0 || (_config$names12 = _config$names12.editorOne) === null || _config$names12 === void 0 ? void 0 : _config$names12.wpDashThemeBuilderClick, this.createWpDashPayload({ | |
| 410 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click), | |
| 411 | - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem, | |
| 412 | - target_name: 'theme_builder_menu_item', | |
| 413 | - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow, | |
| 414 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder), | |
| 415 | - interaction_description: 'core_user_clicked_theme_builder_menu_item' | |
| 416 | - })); | |
| 417 | - } | |
| 418 | 364 | }]); |
| 419 | 365 | }(); |
| 420 | 366 | var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() { |
| 421 | 367 | var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300; |
| @@ -2186,10 +2132,9 @@ | ||
| 2186 | 2132 | exports["default"] = void 0; |
| 2187 | 2133 | var eventsConfig = { |
| 2188 | 2134 | appTypes: { |
| 2189 | 2135 | editor: 'editor', |
| 2190 | - wpAdmin: 'wpadmin', | |
| 2191 | - wpDash: 'wpdash' | |
| 2136 | + wpAdmin: 'wpadmin' | |
| 2192 | 2137 | }, |
| 2193 | 2138 | targetTypes: { |
| 2194 | 2139 | dropdownItem: 'dropdown_item', |
| 2195 | 2140 | button: 'button', |
| @@ -2197,12 +2142,9 @@ | ||
| 2197 | 2142 | toggle: 'toggle', |
| 2198 | 2143 | searchInput: 'search_input', |
| 2199 | 2144 | searchResult: 'search_result', |
| 2200 | 2145 | buttons: 'buttons', |
| 2201 | - searchWidget: 'search_widget', | |
| 2202 | - wpDashAdminMenuItem: 'wpdash_admin_menu_item', | |
| 2203 | - wpDashEditorMenu: 'wpdash_editor_menu', | |
| 2204 | - wpDashSubMenuItem: 'wpdash_sub_menu_item' | |
| 2146 | + searchWidget: 'search_widget' | |
| 2205 | 2147 | }, |
| 2206 | 2148 | interactionResults: { |
| 2207 | 2149 | actionSelected: 'action_selected', |
| 2208 | 2150 | navigate: 'navigate', |
| @@ -2215,12 +2157,9 @@ | ||
| 2215 | 2157 | resultsUpdated: 'results_updated', |
| 2216 | 2158 | noResults: 'no_results', |
| 2217 | 2159 | selected: 'selected', |
| 2218 | 2160 | promotionViewed: 'promotion_viewed', |
| 2219 | - upgradeNow: 'upgrade_now', | |
| 2220 | - elementorSideMenuOpened: 'elementor_side_menu_opened', | |
| 2221 | - editorSubMenuOpened: 'wpdash_editor_sub_menu_opened', | |
| 2222 | - themeBuilderPromotionWindow: 'theme_builder_promotion_window' | |
| 2161 | + upgradeNow: 'upgrade_now' | |
| 2223 | 2162 | }, |
| 2224 | 2163 | targetNames: { |
| 2225 | 2164 | publishDropdown: { |
| 2226 | 2165 | saveDraft: 'save_draft', |
| @@ -2243,10 +2182,9 @@ | ||
| 2243 | 2182 | visible: 'Visible', |
| 2244 | 2183 | pageLoaded: 'Page Loaded', |
| 2245 | 2184 | typing: 'Typing', |
| 2246 | 2185 | tabSelect: 'Tab Select', |
| 2247 | - insert: 'Insert', | |
| 2248 | - hover: 'Hover' | |
| 2186 | + insert: 'Insert' | |
| 2249 | 2187 | }, |
| 2250 | 2188 | locations: { |
| 2251 | 2189 | widgetPanel: 'Widget Panel', |
| 2252 | 2190 | topBar: 'Top Bar', |
| @@ -2263,9 +2201,8 @@ | ||
| 2263 | 2201 | }, |
| 2264 | 2202 | variables: 'Variables Panel', |
| 2265 | 2203 | variablesManager: 'Variables Manager', |
| 2266 | 2204 | admin: 'WP admin', |
| 2267 | - wpDashAdmin: 'wpdash_admin', | |
| 2268 | 2205 | structurePanel: 'Structure Panel', |
| 2269 | 2206 | canvas: 'Canvas', |
| 2270 | 2207 | leftPanel: 'Left Panel', |
| 2271 | 2208 | elementorLibrary: 'Elementor Library', |
| @@ -2352,12 +2289,9 @@ | ||
| 2352 | 2289 | emptyBox: 'Empty Box', |
| 2353 | 2290 | searchBar: 'Search Bar', |
| 2354 | 2291 | finderResults: 'Finder Results', |
| 2355 | 2292 | libraryTabs: 'Library Tabs', |
| 2356 | - assetCard: 'Asset Card', | |
| 2357 | - wpDashElementorCoreMenu: 'elementor_editor_core_menu', | |
| 2358 | - wpDashElementorCoreSubMenu: 'elementor_editor_core_sub_menu', | |
| 2359 | - wpDashThemeBuilder: 'wpdash_core_sub_menu_theme_builder' | |
| 2293 | + assetCard: 'Asset Card' | |
| 2360 | 2294 | }, |
| 2361 | 2295 | elements: { |
| 2362 | 2296 | accordionSection: 'Accordion section', |
| 2363 | 2297 | buttonIcon: 'Button Icon', |
| @@ -2481,12 +2415,9 @@ | ||
| 2481 | 2415 | eLibraryGenerateAi: 'e_library_generate_ai', |
| 2482 | 2416 | finderSearchInput: 'finder_search_input', |
| 2483 | 2417 | finderResultSelect: 'finder_result_select', |
| 2484 | 2418 | canvasEmptyBoxAction: 'canvas_empty_box_action', |
| 2485 | - widgetPanelSearch: 'widget_panel_search', | |
| 2486 | - wpDashElementorMenuClick: 'wpdash_elementor_menu_click', | |
| 2487 | - wpDashEditorSubMenuHover: 'wpdash_editor_sub_menu_hover', | |
| 2488 | - wpDashThemeBuilderClick: 'wpdash_theme_builder_click' | |
| 2419 | + widgetPanelSearch: 'widget_panel_search' | |
| 2489 | 2420 | }, |
| 2490 | 2421 | interactions: { |
| 2491 | 2422 | created: 'interactions_created' |
| 2492 | 2423 | }, |
| @@ -2525,8 +2456,9 @@ | ||
| 2525 | 2456 | var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); |
| 2526 | 2457 | var _eventsConfig = _interopRequireDefault(__webpack_require__(/*! ./events-config */ "../core/common/modules/events-manager/assets/js/events-config.js")); |
| 2527 | 2458 | var _mixpanelBrowser = _interopRequireWildcard(__webpack_require__(/*! mixpanel-browser */ "../node_modules/mixpanel-browser/dist/mixpanel.module.js")); |
| 2528 | 2459 | var _tiers = __webpack_require__(/*! elementor-utils/tiers */ "../assets/dev/js/utils/tiers.js"); |
| 2460 | +var _sessionRecording = __webpack_require__(/*! ./session-recording */ "../core/common/modules/events-manager/assets/js/session-recording.js"); | |
| 2529 | 2461 | function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(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 (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); } |
| 2530 | 2462 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } |
| 2531 | 2463 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } |
| 2532 | 2464 | function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } |
| @@ -2548,13 +2480,15 @@ | ||
| 2548 | 2480 | (0, _inherits2.default)(_default, _elementorModules$Mod); |
| 2549 | 2481 | return (0, _createClass2.default)(_default, [{ |
| 2550 | 2482 | key: "onInit", |
| 2551 | 2483 | value: function onInit() { |
| 2552 | - var _this2 = this; | |
| 2484 | + var _elementorCommon$conf, | |
| 2485 | + _this2 = this; | |
| 2553 | 2486 | this.config = _eventsConfig.default; |
| 2554 | 2487 | if (!this.canSendEvents()) { |
| 2555 | 2488 | return; |
| 2556 | 2489 | } |
| 2490 | + (0, _sessionRecording.configureSessionRecording)((_elementorCommon$conf = elementorCommon.config.editor_events) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.session_recording_events); | |
| 2557 | 2491 | this.initializeMixpanel(function () { |
| 2558 | 2492 | return _this2.enableTracking(); |
| 2559 | 2493 | }); |
| 2560 | 2494 | } |
| @@ -2563,23 +2497,25 @@ | ||
| 2563 | 2497 | value: function initializeMixpanel(onLoaded) { |
| 2564 | 2498 | if (mixpanelInstance && mixpanelInstance.isInitialized) { |
| 2565 | 2499 | onLoaded(mixpanelInstance); |
| 2566 | 2500 | } else { |
| 2567 | - var _elementorCommon$conf, _elementorCommon$conf2, _elementorCommon$conf3, _elementorCommon$conf4, _elementorCommon$conf5; | |
| 2568 | - mixpanelInstance = _mixpanelBrowser.default.init((_elementorCommon$conf = elementorCommon.config.editor_events) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.token, { | |
| 2501 | + var _elementorCommon$conf2; | |
| 2502 | + mixpanelInstance = _mixpanelBrowser.default.init((_elementorCommon$conf2 = elementorCommon.config.editor_events) === null || _elementorCommon$conf2 === void 0 ? void 0 : _elementorCommon$conf2.token, { | |
| 2569 | 2503 | persistence: 'localStorage', |
| 2570 | - debug: (_elementorCommon$conf2 = (_elementorCommon$conf3 = elementorCommon.config.editor_events) === null || _elementorCommon$conf3 === void 0 ? void 0 : _elementorCommon$conf3.debug) !== null && _elementorCommon$conf2 !== void 0 ? _elementorCommon$conf2 : false, | |
| 2571 | 2504 | autocapture: false, |
| 2572 | 2505 | flags: true, |
| 2573 | - api_host: 'https://api-eu.mixpanel.com', | |
| 2506 | + api_hosts: { | |
| 2507 | + flags: 'https://api-eu.mixpanel.com' | |
| 2508 | + }, | |
| 2574 | 2509 | loaded: onLoaded, |
| 2575 | - record_sessions_percent: (_elementorCommon$conf4 = (_elementorCommon$conf5 = elementorCommon.config.editor_events) === null || _elementorCommon$conf5 === void 0 ? void 0 : _elementorCommon$conf5.session_recording_percent) !== null && _elementorCommon$conf4 !== void 0 ? _elementorCommon$conf4 : 0, | |
| 2510 | + record_sessions_percent: 0, | |
| 2576 | 2511 | record_idle_timeout_ms: 60 * 1000, |
| 2577 | 2512 | // 60 Seconds |
| 2578 | 2513 | record_min_ms: 5 * 1000, |
| 2579 | 2514 | // 5 Seconds |
| 2580 | - record_mask_text_selector: '', | |
| 2581 | - remote_settings_mode: 'strict' | |
| 2515 | + record_max_ms: 30 * 1000, | |
| 2516 | + // 30 Seconds | |
| 2517 | + record_mask_text_selector: '' | |
| 2582 | 2518 | }, 'elementor-editor'); |
| 2583 | 2519 | } |
| 2584 | 2520 | elementorCommon.config.editor_events.mixpanelInstance = mixpanelInstance; |
| 2585 | 2521 | } |
| @@ -2585,23 +2521,23 @@ | ||
| 2585 | 2521 | } |
| 2586 | 2522 | }, { |
| 2587 | 2523 | key: "enableTracking", |
| 2588 | 2524 | value: function enableTracking() { |
| 2589 | - var _elementorCommon$conf6; | |
| 2525 | + var _elementorCommon$conf3; | |
| 2590 | 2526 | if (!this.isMixpanelReady()) { |
| 2591 | 2527 | return; |
| 2592 | 2528 | } |
| 2593 | - var userId = (_elementorCommon$conf6 = elementorCommon.config.editor_events) === null || _elementorCommon$conf6 === void 0 ? void 0 : _elementorCommon$conf6.user_id; | |
| 2529 | + var userId = (_elementorCommon$conf3 = elementorCommon.config.editor_events) === null || _elementorCommon$conf3 === void 0 ? void 0 : _elementorCommon$conf3.user_id; | |
| 2594 | 2530 | mixpanelInstance.register({ |
| 2595 | 2531 | appType: 'Editor' |
| 2596 | 2532 | }); |
| 2597 | 2533 | if (userId) { |
| 2598 | - var _elementorCommon$conf7; | |
| 2534 | + var _elementorCommon$conf4; | |
| 2599 | 2535 | mixpanelInstance.identify(userId); |
| 2600 | 2536 | mixpanelInstance.people.set_once({ |
| 2601 | 2537 | $user_id: userId, |
| 2602 | 2538 | $last_login: new Date().toISOString(), |
| 2603 | - $plan_type: ((_elementorCommon$conf7 = elementorCommon.config.library_connect) === null || _elementorCommon$conf7 === void 0 ? void 0 : _elementorCommon$conf7.plan_type) || _tiers.TIERS.free | |
| 2539 | + $plan_type: ((_elementorCommon$conf4 = elementorCommon.config.library_connect) === null || _elementorCommon$conf4 === void 0 ? void 0 : _elementorCommon$conf4.plan_type) || _tiers.TIERS.free | |
| 2604 | 2540 | }); |
| 2605 | 2541 | } |
| 2606 | 2542 | this.trackingEnabled = true; |
| 2607 | 2543 | this.availableExperiments = Object.keys(elementorCommon.config.experimentalFeatures || {}); |
| @@ -2608,9 +2544,9 @@ | ||
| 2608 | 2544 | } |
| 2609 | 2545 | }, { |
| 2610 | 2546 | key: "dispatchEvent", |
| 2611 | 2547 | value: function dispatchEvent(name, data) { |
| 2612 | - var _elementorCommon$conf8, _elementorCommon$conf9, _elementorCommon$conf0, _elementorCommon$conf1, _elementorCommon$conf10, _elementorCommon$conf11, _elementorCommon$conf12, _elementorCommon$conf13, _elementorCommon$conf14; | |
| 2548 | + var _elementorCommon$conf5, _elementorCommon$conf6, _elementorCommon$conf7, _elementorCommon$conf8, _elementorCommon$conf9, _elementorCommon$conf0, _elementorCommon$conf1, _elementorCommon$conf10, _elementorCommon$conf11; | |
| 2613 | 2549 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
| 2614 | 2550 | if (!this.canSendEvents()) { |
| 2615 | 2551 | return; |
| 2616 | 2552 | } |
| @@ -2617,20 +2553,24 @@ | ||
| 2617 | 2553 | if (!this.trackingEnabled) { |
| 2618 | 2554 | this.enableTracking(); |
| 2619 | 2555 | } |
| 2620 | 2556 | var eventData = _objectSpread({ |
| 2621 | - user_id: ((_elementorCommon$conf8 = elementorCommon.config.editor_events) === null || _elementorCommon$conf8 === void 0 ? void 0 : _elementorCommon$conf8.user_id) || null, | |
| 2622 | - user_roles: ((_elementorCommon$conf9 = elementorCommon.config.library_connect) === null || _elementorCommon$conf9 === void 0 ? void 0 : _elementorCommon$conf9.user_roles) || [], | |
| 2623 | - subscription_id: ((_elementorCommon$conf0 = elementorCommon.config.editor_events) === null || _elementorCommon$conf0 === void 0 ? void 0 : _elementorCommon$conf0.subscription_id) || null, | |
| 2624 | - user_tier: ((_elementorCommon$conf1 = elementorCommon.config.library_connect) === null || _elementorCommon$conf1 === void 0 ? void 0 : _elementorCommon$conf1.current_access_tier) || null, | |
| 2625 | - url: (_elementorCommon$conf10 = elementorCommon.config.editor_events) === null || _elementorCommon$conf10 === void 0 ? void 0 : _elementorCommon$conf10.site_url, | |
| 2626 | - wp_version: (_elementorCommon$conf11 = elementorCommon.config.editor_events) === null || _elementorCommon$conf11 === void 0 ? void 0 : _elementorCommon$conf11.wp_version, | |
| 2627 | - client_id: (_elementorCommon$conf12 = elementorCommon.config.editor_events) === null || _elementorCommon$conf12 === void 0 ? void 0 : _elementorCommon$conf12.site_key, | |
| 2628 | - app_version: (_elementorCommon$conf13 = elementorCommon.config.editor_events) === null || _elementorCommon$conf13 === void 0 ? void 0 : _elementorCommon$conf13.elementor_version, | |
| 2629 | - site_language: (_elementorCommon$conf14 = elementorCommon.config.editor_events) === null || _elementorCommon$conf14 === void 0 ? void 0 : _elementorCommon$conf14.site_language, | |
| 2557 | + user_id: ((_elementorCommon$conf5 = elementorCommon.config.editor_events) === null || _elementorCommon$conf5 === void 0 ? void 0 : _elementorCommon$conf5.user_id) || null, | |
| 2558 | + user_roles: ((_elementorCommon$conf6 = elementorCommon.config.library_connect) === null || _elementorCommon$conf6 === void 0 ? void 0 : _elementorCommon$conf6.user_roles) || [], | |
| 2559 | + subscription_id: ((_elementorCommon$conf7 = elementorCommon.config.editor_events) === null || _elementorCommon$conf7 === void 0 ? void 0 : _elementorCommon$conf7.subscription_id) || null, | |
| 2560 | + user_tier: ((_elementorCommon$conf8 = elementorCommon.config.library_connect) === null || _elementorCommon$conf8 === void 0 ? void 0 : _elementorCommon$conf8.current_access_tier) || null, | |
| 2561 | + url: (_elementorCommon$conf9 = elementorCommon.config.editor_events) === null || _elementorCommon$conf9 === void 0 ? void 0 : _elementorCommon$conf9.site_url, | |
| 2562 | + wp_version: (_elementorCommon$conf0 = elementorCommon.config.editor_events) === null || _elementorCommon$conf0 === void 0 ? void 0 : _elementorCommon$conf0.wp_version, | |
| 2563 | + client_id: (_elementorCommon$conf1 = elementorCommon.config.editor_events) === null || _elementorCommon$conf1 === void 0 ? void 0 : _elementorCommon$conf1.site_key, | |
| 2564 | + app_version: (_elementorCommon$conf10 = elementorCommon.config.editor_events) === null || _elementorCommon$conf10 === void 0 ? void 0 : _elementorCommon$conf10.elementor_version, | |
| 2565 | + site_language: (_elementorCommon$conf11 = elementorCommon.config.editor_events) === null || _elementorCommon$conf11 === void 0 ? void 0 : _elementorCommon$conf11.site_language, | |
| 2630 | 2566 | experiments: this.availableExperiments |
| 2631 | 2567 | }, data); |
| 2632 | 2568 | mixpanelInstance.track(name, eventData, options); |
| 2569 | + var recordingDecision = (0, _sessionRecording.handleSessionRecording)(name, mixpanelInstance); | |
| 2570 | + if (recordingDecision) { | |
| 2571 | + mixpanelInstance.track(recordingDecision, eventData); | |
| 2572 | + } | |
| 2633 | 2573 | } |
| 2634 | 2574 | }, { |
| 2635 | 2575 | key: "featureFlagIsActive", |
| 2636 | 2576 | value: function () { |
| @@ -2666,10 +2606,10 @@ | ||
| 2666 | 2606 | key: "getExperimentVariant", |
| 2667 | 2607 | value: function () { |
| 2668 | 2608 | var _getExperimentVariant = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(experimentName) { |
| 2669 | 2609 | var defaultValue, |
| 2670 | - _elementorCommon$conf15, | |
| 2671 | - _elementorCommon$conf16, | |
| 2610 | + _elementorCommon$conf12, | |
| 2611 | + _elementorCommon$conf13, | |
| 2672 | 2612 | isAbTestingEnabled, |
| 2673 | 2613 | variant, |
| 2674 | 2614 | _args2 = arguments, |
| 2675 | 2615 | _t; |
| @@ -2683,9 +2623,9 @@ | ||
| 2683 | 2623 | break; |
| 2684 | 2624 | } |
| 2685 | 2625 | return _context2.abrupt("return", defaultValue); |
| 2686 | 2626 | case 2: |
| 2687 | - isAbTestingEnabled = (_elementorCommon$conf15 = (_elementorCommon$conf16 = elementorCommon.config.editor_events) === null || _elementorCommon$conf16 === void 0 ? void 0 : _elementorCommon$conf16.flags_enabled) !== null && _elementorCommon$conf15 !== void 0 ? _elementorCommon$conf15 : false; | |
| 2627 | + isAbTestingEnabled = (_elementorCommon$conf12 = (_elementorCommon$conf13 = elementorCommon.config.editor_events) === null || _elementorCommon$conf13 === void 0 ? void 0 : _elementorCommon$conf13.flags_enabled) !== null && _elementorCommon$conf12 !== void 0 ? _elementorCommon$conf12 : false; | |
| 2688 | 2628 | if (isAbTestingEnabled) { |
| 2689 | 2629 | _context2.next = 3; |
| 2690 | 2630 | break; |
| 2691 | 2631 | } |
| @@ -2774,8 +2714,87 @@ | ||
| 2774 | 2714 | return this.isMixpanelReady() ? mixpanelInstance : undefined; |
| 2775 | 2715 | } |
| 2776 | 2716 | }]); |
| 2777 | 2717 | }(elementorModules.Module); |
| 2718 | + | |
| 2719 | +/***/ }), | |
| 2720 | + | |
| 2721 | +/***/ "../core/common/modules/events-manager/assets/js/session-recording.js": | |
| 2722 | +/*!****************************************************************************!*\ | |
| 2723 | + !*** ../core/common/modules/events-manager/assets/js/session-recording.js ***! | |
| 2724 | + \****************************************************************************/ | |
| 2725 | +/***/ ((__unused_webpack_module, exports) => { | |
| 2726 | + | |
| 2727 | +"use strict"; | |
| 2728 | + | |
| 2729 | + | |
| 2730 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2731 | + value: true | |
| 2732 | +})); | |
| 2733 | +exports.configureSessionRecording = configureSessionRecording; | |
| 2734 | +exports.getIsRecording = getIsRecording; | |
| 2735 | +exports.handleSessionRecording = handleSessionRecording; | |
| 2736 | +var RECORD_SESSION_PERCENT = 1; | |
| 2737 | +var sessionRecordingPairs = []; | |
| 2738 | +var activeEndEvent = null; | |
| 2739 | +var isRecording = false; | |
| 2740 | +function shouldRecordSession(distinctId, percent) { | |
| 2741 | + var fraction = Math.min(Math.max(percent / 100, 0), 1); | |
| 2742 | + var hash = 0; | |
| 2743 | + for (var i = 0; i < distinctId.length; i++) { | |
| 2744 | + // eslint-disable-next-line no-bitwise | |
| 2745 | + hash = hash * 31 + distinctId.charCodeAt(i) >>> 0; | |
| 2746 | + } | |
| 2747 | + return hash / 4294967295 < fraction; | |
| 2748 | +} | |
| 2749 | + | |
| 2750 | +/** | |
| 2751 | + * @param {Array<{start: string, end?: string|null}>} pairs | |
| 2752 | + */ | |
| 2753 | +function configureSessionRecording(pairs) { | |
| 2754 | + if (!Array.isArray(pairs)) { | |
| 2755 | + return; | |
| 2756 | + } | |
| 2757 | + sessionRecordingPairs = pairs.filter(function (pair) { | |
| 2758 | + return 'string' === typeof (pair === null || pair === void 0 ? void 0 : pair.start) && pair.start; | |
| 2759 | + }); | |
| 2760 | +} | |
| 2761 | + | |
| 2762 | +/** | |
| 2763 | + * Evaluates whether to start/stop recording based on the event name. | |
| 2764 | + * | |
| 2765 | + * @param {string} name | |
| 2766 | + * @param {import('mixpanel-browser').Mixpanel} mixpanelInstance | |
| 2767 | + * @return {'recording_started'|'recording_skipped'|'recording_stopped'|null} The recording decision, or null if no action taken. | |
| 2768 | + */ | |
| 2769 | +function handleSessionRecording(name, mixpanelInstance) { | |
| 2770 | + var matchedPair = sessionRecordingPairs.find(function (pair) { | |
| 2771 | + return pair.start === name; | |
| 2772 | + }); | |
| 2773 | + if (matchedPair) { | |
| 2774 | + var distinctId = mixpanelInstance.get_distinct_id(); | |
| 2775 | + if (shouldRecordSession(distinctId, RECORD_SESSION_PERCENT)) { | |
| 2776 | + var _matchedPair$end; | |
| 2777 | + mixpanelInstance.start_session_recording(); | |
| 2778 | + isRecording = true; | |
| 2779 | + activeEndEvent = (_matchedPair$end = matchedPair.end) !== null && _matchedPair$end !== void 0 ? _matchedPair$end : null; | |
| 2780 | + return 'recording_started'; | |
| 2781 | + } | |
| 2782 | + isRecording = false; | |
| 2783 | + activeEndEvent = null; | |
| 2784 | + return 'recording_skipped'; | |
| 2785 | + } | |
| 2786 | + if (activeEndEvent && name === activeEndEvent) { | |
| 2787 | + mixpanelInstance.stop_session_recording(); | |
| 2788 | + isRecording = false; | |
| 2789 | + activeEndEvent = null; | |
| 2790 | + return 'recording_stopped'; | |
| 2791 | + } | |
| 2792 | + return null; | |
| 2793 | +} | |
| 2794 | +function getIsRecording() { | |
| 2795 | + return isRecording; | |
| 2796 | +} | |
| 2778 | 2797 | |
| 2779 | 2798 | /***/ }), |
| 2780 | 2799 | |
| 2781 | 2800 | /***/ "../core/common/modules/finder/assets/js/commands/index.js": |