| 1 |
(function(_wordpress_i18n) { |
| 2 |
|
| 3 |
//#region \0rolldown/runtime.js |
| 4 |
var __create = Object.create; |
| 5 |
var __defProp = Object.defineProperty; |
| 6 |
var __name = (target, value) => __defProp(target, "name", { |
| 7 |
value, |
| 8 |
configurable: true |
| 9 |
}); |
| 10 |
var __getOwnPropDesc = Object.getOwnPropertyDescriptor; |
| 11 |
var __getOwnPropNames = Object.getOwnPropertyNames; |
| 12 |
var __getProtoOf = Object.getPrototypeOf; |
| 13 |
var __hasOwnProp = Object.prototype.hasOwnProperty; |
| 14 |
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); |
| 15 |
var __copyProps = (to, from, except, desc) => { |
| 16 |
if (from && typeof from === "object" || typeof from === "function") { |
| 17 |
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { |
| 18 |
key = keys[i]; |
| 19 |
if (!__hasOwnProp.call(to, key) && key !== except) { |
| 20 |
__defProp(to, key, { |
| 21 |
get: ((k) => from[k]).bind(null, key), |
| 22 |
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable |
| 23 |
}); |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
return to; |
| 28 |
}; |
| 29 |
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { |
| 30 |
value: mod, |
| 31 |
enumerable: true |
| 32 |
}) : target, mod)); |
| 33 |
|
| 34 |
//#endregion |
| 35 |
|
| 36 |
//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js |
| 37 |
function asyncGeneratorStep(n, t, e, r, o, a, c) { |
| 38 |
try { |
| 39 |
var i = n[a](c); |
| 40 |
var u = i.value; |
| 41 |
} catch (n) { |
| 42 |
e(n); |
| 43 |
return; |
| 44 |
} |
| 45 |
i.done ? t(u) : Promise.resolve(u).then(r, o); |
| 46 |
} |
| 47 |
function _asyncToGenerator(n) { |
| 48 |
return function() { |
| 49 |
var t = this; |
| 50 |
var e = arguments; |
| 51 |
return new Promise(function(r, o) { |
| 52 |
var a = n.apply(t, e); |
| 53 |
function _next(n) { |
| 54 |
asyncGeneratorStep(a, r, o, _next, _throw, "next", n); |
| 55 |
} |
| 56 |
function _throw(n) { |
| 57 |
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); |
| 58 |
} |
| 59 |
_next(void 0); |
| 60 |
}); |
| 61 |
}; |
| 62 |
} |
| 63 |
|
| 64 |
//#endregion |
| 65 |
//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js |
| 66 |
function _arrayWithHoles(r) { |
| 67 |
if (Array.isArray(r)) return r; |
| 68 |
} |
| 69 |
|
| 70 |
//#endregion |
| 71 |
//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js |
| 72 |
function _iterableToArrayLimit(r, l) { |
| 73 |
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 74 |
if (null != t) { |
| 75 |
var e; |
| 76 |
var n; |
| 77 |
var i; |
| 78 |
var u; |
| 79 |
var a = []; |
| 80 |
var f = !0; |
| 81 |
var o = !1; |
| 82 |
try { |
| 83 |
if (i = (t = t.call(r)).next, 0 === l) { |
| 84 |
if (Object(t) !== t) return; |
| 85 |
f = !1; |
| 86 |
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); |
| 87 |
} catch (r) { |
| 88 |
o = !0, n = r; |
| 89 |
} finally { |
| 90 |
try { |
| 91 |
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; |
| 92 |
} finally { |
| 93 |
if (o) throw n; |
| 94 |
} |
| 95 |
} |
| 96 |
return a; |
| 97 |
} |
| 98 |
} |
| 99 |
|
| 100 |
//#endregion |
| 101 |
//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js |
| 102 |
function _arrayLikeToArray$2(r, a) { |
| 103 |
(null == a || a > r.length) && (a = r.length); |
| 104 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 105 |
return n; |
| 106 |
} |
| 107 |
__name(_arrayLikeToArray$2, "_arrayLikeToArray"); |
| 108 |
|
| 109 |
//#endregion |
| 110 |
//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js |
| 111 |
function _unsupportedIterableToArray$2(r, a) { |
| 112 |
if (r) { |
| 113 |
if ("string" == typeof r) return _arrayLikeToArray$2(r, a); |
| 114 |
var t = {}.toString.call(r).slice(8, -1); |
| 115 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; |
| 116 |
} |
| 117 |
} |
| 118 |
__name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray"); |
| 119 |
|
| 120 |
//#endregion |
| 121 |
//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js |
| 122 |
function _nonIterableRest() { |
| 123 |
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 124 |
} |
| 125 |
|
| 126 |
//#endregion |
| 127 |
//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js |
| 128 |
function _slicedToArray(r, e) { |
| 129 |
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest(); |
| 130 |
} |
| 131 |
|
| 132 |
//#endregion |
| 133 |
//#region node_modules/@babel/runtime/helpers/OverloadYield.js |
| 134 |
var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 135 |
function _OverloadYield(e, d) { |
| 136 |
this.v = e, this.k = d; |
| 137 |
} |
| 138 |
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 139 |
})); |
| 140 |
|
| 141 |
//#endregion |
| 142 |
//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js |
| 143 |
var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 144 |
function _regeneratorDefine(e, r, n, t) { |
| 145 |
var i = Object.defineProperty; |
| 146 |
try { |
| 147 |
i({}, "", {}); |
| 148 |
} catch (e) { |
| 149 |
i = 0; |
| 150 |
} |
| 151 |
module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { |
| 152 |
function o(r, n) { |
| 153 |
_regeneratorDefine(e, r, function(e) { |
| 154 |
return this._invoke(r, n, e); |
| 155 |
}); |
| 156 |
} |
| 157 |
r ? i ? i(e, r, { |
| 158 |
value: n, |
| 159 |
enumerable: !t, |
| 160 |
configurable: !t, |
| 161 |
writable: !t |
| 162 |
}) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); |
| 163 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); |
| 164 |
} |
| 165 |
module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 166 |
})); |
| 167 |
|
| 168 |
//#endregion |
| 169 |
//#region node_modules/@babel/runtime/helpers/regenerator.js |
| 170 |
var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 171 |
var regeneratorDefine = require_regeneratorDefine(); |
| 172 |
function _regenerator() { |
| 173 |
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ |
| 174 |
var e; |
| 175 |
var t; |
| 176 |
var r = "function" == typeof Symbol ? Symbol : {}; |
| 177 |
var n = r.iterator || "@@iterator"; |
| 178 |
var o = r.toStringTag || "@@toStringTag"; |
| 179 |
function i(r, n, o, i) { |
| 180 |
var c = n && n.prototype instanceof Generator ? n : Generator; |
| 181 |
var u = Object.create(c.prototype); |
| 182 |
return regeneratorDefine(u, "_invoke", function(r, n, o) { |
| 183 |
var i; |
| 184 |
var c; |
| 185 |
var u; |
| 186 |
var f = 0; |
| 187 |
var p = o || []; |
| 188 |
var y = !1; |
| 189 |
var G = { |
| 190 |
p: 0, |
| 191 |
n: 0, |
| 192 |
v: e, |
| 193 |
a: d, |
| 194 |
f: d.bind(e, 4), |
| 195 |
d: function d(t, r) { |
| 196 |
return i = t, c = 0, u = e, G.n = r, a; |
| 197 |
} |
| 198 |
}; |
| 199 |
function d(r, n) { |
| 200 |
for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { |
| 201 |
var o; |
| 202 |
var i = p[t]; |
| 203 |
var d = G.p; |
| 204 |
var l = i[2]; |
| 205 |
r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); |
| 206 |
} |
| 207 |
if (o || r > 1) return a; |
| 208 |
throw y = !0, n; |
| 209 |
} |
| 210 |
return function(o, p, l) { |
| 211 |
if (f > 1) throw TypeError("Generator is already running"); |
| 212 |
for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { |
| 213 |
i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); |
| 214 |
try { |
| 215 |
if (f = 2, i) { |
| 216 |
if (c || (o = "next"), t = i[o]) { |
| 217 |
if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); |
| 218 |
if (!t.done) return t; |
| 219 |
u = t.value, c < 2 && (c = 0); |
| 220 |
} else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); |
| 221 |
i = e; |
| 222 |
} else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; |
| 223 |
} catch (t) { |
| 224 |
i = e, c = 1, u = t; |
| 225 |
} finally { |
| 226 |
f = 1; |
| 227 |
} |
| 228 |
} |
| 229 |
return { |
| 230 |
value: t, |
| 231 |
done: y |
| 232 |
}; |
| 233 |
}; |
| 234 |
}(r, o, i), !0), u; |
| 235 |
} |
| 236 |
var a = {}; |
| 237 |
function Generator() {} |
| 238 |
function GeneratorFunction() {} |
| 239 |
function GeneratorFunctionPrototype() {} |
| 240 |
t = Object.getPrototypeOf; |
| 241 |
var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() { |
| 242 |
return this; |
| 243 |
}), t); |
| 244 |
var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); |
| 245 |
function f(e) { |
| 246 |
return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; |
| 247 |
} |
| 248 |
return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function() { |
| 249 |
return this; |
| 250 |
}), regeneratorDefine(u, "toString", function() { |
| 251 |
return "[object Generator]"; |
| 252 |
}), (module.exports = _regenerator = function _regenerator() { |
| 253 |
return { |
| 254 |
w: i, |
| 255 |
m: f |
| 256 |
}; |
| 257 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports)(); |
| 258 |
} |
| 259 |
module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 260 |
})); |
| 261 |
|
| 262 |
//#endregion |
| 263 |
//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js |
| 264 |
var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 265 |
var OverloadYield = require_OverloadYield(); |
| 266 |
var regeneratorDefine = require_regeneratorDefine(); |
| 267 |
function AsyncIterator(t, e) { |
| 268 |
function n(r, o, i, f) { |
| 269 |
try { |
| 270 |
var c = t[r](o); |
| 271 |
var u = c.value; |
| 272 |
return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) { |
| 273 |
n("next", t, i, f); |
| 274 |
}, function(t) { |
| 275 |
n("throw", t, i, f); |
| 276 |
}) : e.resolve(u).then(function(t) { |
| 277 |
c.value = t, i(c); |
| 278 |
}, function(t) { |
| 279 |
return n("throw", t, i, f); |
| 280 |
}); |
| 281 |
} catch (t) { |
| 282 |
f(t); |
| 283 |
} |
| 284 |
} |
| 285 |
var r; |
| 286 |
this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() { |
| 287 |
return this; |
| 288 |
})), regeneratorDefine(this, "_invoke", function(t, o, i) { |
| 289 |
function f() { |
| 290 |
return new e(function(e, r) { |
| 291 |
n(t, i, e, r); |
| 292 |
}); |
| 293 |
} |
| 294 |
return r = r ? r.then(f, f) : f(); |
| 295 |
}, !0); |
| 296 |
} |
| 297 |
module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 298 |
})); |
| 299 |
|
| 300 |
//#endregion |
| 301 |
//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js |
| 302 |
var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 303 |
var regenerator = require_regenerator$1(); |
| 304 |
var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); |
| 305 |
function _regeneratorAsyncGen(r, e, t, o, n) { |
| 306 |
return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); |
| 307 |
} |
| 308 |
module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 309 |
})); |
| 310 |
|
| 311 |
//#endregion |
| 312 |
//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js |
| 313 |
var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 314 |
var regeneratorAsyncGen = require_regeneratorAsyncGen(); |
| 315 |
function _regeneratorAsync(n, e, r, t, o) { |
| 316 |
var a = regeneratorAsyncGen(n, e, r, t, o); |
| 317 |
return a.next().then(function(n) { |
| 318 |
return n.done ? n.value : a.next(); |
| 319 |
}); |
| 320 |
} |
| 321 |
module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 322 |
})); |
| 323 |
|
| 324 |
//#endregion |
| 325 |
//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js |
| 326 |
var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 327 |
function _regeneratorKeys(e) { |
| 328 |
var n = Object(e); |
| 329 |
var r = []; |
| 330 |
for (var t in n) r.unshift(t); |
| 331 |
return function e() { |
| 332 |
for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; |
| 333 |
return e.done = !0, e; |
| 334 |
}; |
| 335 |
} |
| 336 |
module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 337 |
})); |
| 338 |
|
| 339 |
//#endregion |
| 340 |
//#region node_modules/@babel/runtime/helpers/typeof.js |
| 341 |
var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 342 |
function _typeof(o) { |
| 343 |
"@babel/helpers - typeof"; |
| 344 |
return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { |
| 345 |
return typeof o; |
| 346 |
} : function(o) { |
| 347 |
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 348 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); |
| 349 |
} |
| 350 |
module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 351 |
})); |
| 352 |
|
| 353 |
//#endregion |
| 354 |
//#region node_modules/@babel/runtime/helpers/regeneratorValues.js |
| 355 |
var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 356 |
var _typeof = require_typeof()["default"]; |
| 357 |
function _regeneratorValues(e) { |
| 358 |
if (null != e) { |
| 359 |
var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"]; |
| 360 |
var r = 0; |
| 361 |
if (t) return t.call(e); |
| 362 |
if ("function" == typeof e.next) return e; |
| 363 |
if (!isNaN(e.length)) return { next: function next() { |
| 364 |
return e && r >= e.length && (e = void 0), { |
| 365 |
value: e && e[r++], |
| 366 |
done: !e |
| 367 |
}; |
| 368 |
} }; |
| 369 |
} |
| 370 |
throw new TypeError(_typeof(e) + " is not iterable"); |
| 371 |
} |
| 372 |
module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 373 |
})); |
| 374 |
|
| 375 |
//#endregion |
| 376 |
//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js |
| 377 |
var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 378 |
var OverloadYield = require_OverloadYield(); |
| 379 |
var regenerator = require_regenerator$1(); |
| 380 |
var regeneratorAsync = require_regeneratorAsync(); |
| 381 |
var regeneratorAsyncGen = require_regeneratorAsyncGen(); |
| 382 |
var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); |
| 383 |
var regeneratorKeys = require_regeneratorKeys(); |
| 384 |
var regeneratorValues = require_regeneratorValues(); |
| 385 |
function _regeneratorRuntime() { |
| 386 |
"use strict"; |
| 387 |
var r = regenerator(); |
| 388 |
var e = r.m(_regeneratorRuntime); |
| 389 |
var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; |
| 390 |
function n(r) { |
| 391 |
var e = "function" == typeof r && r.constructor; |
| 392 |
return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); |
| 393 |
} |
| 394 |
var o = { |
| 395 |
"throw": 1, |
| 396 |
"return": 2, |
| 397 |
"break": 3, |
| 398 |
"continue": 3 |
| 399 |
}; |
| 400 |
function a(r) { |
| 401 |
var e; |
| 402 |
var t; |
| 403 |
return function(n) { |
| 404 |
e || (e = { |
| 405 |
stop: function stop() { |
| 406 |
return t(n.a, 2); |
| 407 |
}, |
| 408 |
"catch": function _catch() { |
| 409 |
return n.v; |
| 410 |
}, |
| 411 |
abrupt: function abrupt(r, e) { |
| 412 |
return t(n.a, o[r], e); |
| 413 |
}, |
| 414 |
delegateYield: function delegateYield(r, o, a) { |
| 415 |
return e.resultName = o, t(n.d, regeneratorValues(r), a); |
| 416 |
}, |
| 417 |
finish: function finish(r) { |
| 418 |
return t(n.f, r); |
| 419 |
} |
| 420 |
}, t = function t(r, _t, o) { |
| 421 |
n.p = e.prev, n.n = e.next; |
| 422 |
try { |
| 423 |
return r(_t, o); |
| 424 |
} finally { |
| 425 |
e.next = n.n; |
| 426 |
} |
| 427 |
}), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; |
| 428 |
try { |
| 429 |
return r.call(this, e); |
| 430 |
} finally { |
| 431 |
n.p = e.prev, n.n = e.next; |
| 432 |
} |
| 433 |
}; |
| 434 |
} |
| 435 |
return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { |
| 436 |
return { |
| 437 |
wrap: function wrap(e, t, n, o) { |
| 438 |
return r.w(a(e), t, n, o && o.reverse()); |
| 439 |
}, |
| 440 |
isGeneratorFunction: n, |
| 441 |
mark: r.m, |
| 442 |
awrap: function awrap(r, e) { |
| 443 |
return new OverloadYield(r, e); |
| 444 |
}, |
| 445 |
AsyncIterator: regeneratorAsyncIterator, |
| 446 |
async: function async(r, e, t, o, u) { |
| 447 |
return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); |
| 448 |
}, |
| 449 |
keys: regeneratorKeys, |
| 450 |
values: regeneratorValues |
| 451 |
}; |
| 452 |
}, module.exports.__esModule = true, module.exports["default"] = module.exports)(); |
| 453 |
} |
| 454 |
module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 455 |
})); |
| 456 |
|
| 457 |
//#endregion |
| 458 |
//#region node_modules/@babel/runtime/regenerator/index.js |
| 459 |
var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 460 |
var runtime = require_regeneratorRuntime()(); |
| 461 |
module.exports = runtime; |
| 462 |
try { |
| 463 |
regeneratorRuntime = runtime; |
| 464 |
} catch (accidentalStrictMode) { |
| 465 |
if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime; |
| 466 |
else Function("r", "regeneratorRuntime = r")(runtime); |
| 467 |
} |
| 468 |
})); |
| 469 |
|
| 470 |
//#endregion |
| 471 |
//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js |
| 472 |
var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator()); |
| 473 |
function _classCallCheck(a, n) { |
| 474 |
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); |
| 475 |
} |
| 476 |
|
| 477 |
//#endregion |
| 478 |
//#region node_modules/@babel/runtime/helpers/esm/typeof.js |
| 479 |
function _typeof(o) { |
| 480 |
"@babel/helpers - typeof"; |
| 481 |
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { |
| 482 |
return typeof o; |
| 483 |
} : function(o) { |
| 484 |
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 485 |
}, _typeof(o); |
| 486 |
} |
| 487 |
|
| 488 |
//#endregion |
| 489 |
//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js |
| 490 |
function toPrimitive(t, r) { |
| 491 |
if ("object" != _typeof(t) || !t) return t; |
| 492 |
var e = t[Symbol.toPrimitive]; |
| 493 |
if (void 0 !== e) { |
| 494 |
var i = e.call(t, r || "default"); |
| 495 |
if ("object" != _typeof(i)) return i; |
| 496 |
throw new TypeError("@@toPrimitive must return a primitive value."); |
| 497 |
} |
| 498 |
return ("string" === r ? String : Number)(t); |
| 499 |
} |
| 500 |
|
| 501 |
//#endregion |
| 502 |
//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js |
| 503 |
function toPropertyKey(t) { |
| 504 |
var i = toPrimitive(t, "string"); |
| 505 |
return "symbol" == _typeof(i) ? i : i + ""; |
| 506 |
} |
| 507 |
|
| 508 |
//#endregion |
| 509 |
//#region node_modules/@babel/runtime/helpers/esm/createClass.js |
| 510 |
function _defineProperties(e, r) { |
| 511 |
for (var t = 0; t < r.length; t++) { |
| 512 |
var o = r[t]; |
| 513 |
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); |
| 514 |
} |
| 515 |
} |
| 516 |
function _createClass(e, r, t) { |
| 517 |
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; |
| 518 |
} |
| 519 |
|
| 520 |
//#endregion |
| 521 |
//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js |
| 522 |
function _assertThisInitialized(e) { |
| 523 |
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 524 |
return e; |
| 525 |
} |
| 526 |
|
| 527 |
//#endregion |
| 528 |
//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js |
| 529 |
function _possibleConstructorReturn(t, e) { |
| 530 |
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; |
| 531 |
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); |
| 532 |
return _assertThisInitialized(t); |
| 533 |
} |
| 534 |
|
| 535 |
//#endregion |
| 536 |
//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js |
| 537 |
function _getPrototypeOf(t) { |
| 538 |
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { |
| 539 |
return t.__proto__ || Object.getPrototypeOf(t); |
| 540 |
}, _getPrototypeOf(t); |
| 541 |
} |
| 542 |
|
| 543 |
//#endregion |
| 544 |
//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js |
| 545 |
function _setPrototypeOf(t, e) { |
| 546 |
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { |
| 547 |
return t.__proto__ = e, t; |
| 548 |
}, _setPrototypeOf(t, e); |
| 549 |
} |
| 550 |
|
| 551 |
//#endregion |
| 552 |
//#region node_modules/@babel/runtime/helpers/esm/inherits.js |
| 553 |
function _inherits(t, e) { |
| 554 |
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); |
| 555 |
t.prototype = Object.create(e && e.prototype, { constructor: { |
| 556 |
value: t, |
| 557 |
writable: !0, |
| 558 |
configurable: !0 |
| 559 |
} }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); |
| 560 |
} |
| 561 |
|
| 562 |
//#endregion |
| 563 |
//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js |
| 564 |
function _superPropBase(t, o) { |
| 565 |
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); |
| 566 |
return t; |
| 567 |
} |
| 568 |
|
| 569 |
//#endregion |
| 570 |
//#region node_modules/@babel/runtime/helpers/esm/get.js |
| 571 |
function _get() { |
| 572 |
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { |
| 573 |
var p = _superPropBase(e, t); |
| 574 |
if (p) { |
| 575 |
var n = Object.getOwnPropertyDescriptor(p, t); |
| 576 |
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; |
| 577 |
} |
| 578 |
}, _get.apply(null, arguments); |
| 579 |
} |
| 580 |
|
| 581 |
//#endregion |
| 582 |
//#region assets/dev/js/admin/menu-handler.js |
| 583 |
function _callSuper$11(t, o, e) { |
| 584 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$11() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 585 |
} |
| 586 |
__name(_callSuper$11, "_callSuper"); |
| 587 |
function _isNativeReflectConstruct$11() { |
| 588 |
try { |
| 589 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 590 |
} catch (t) {} |
| 591 |
return (_isNativeReflectConstruct$11 = function _isNativeReflectConstruct() { |
| 592 |
return !!t; |
| 593 |
})(); |
| 594 |
} |
| 595 |
__name(_isNativeReflectConstruct$11, "_isNativeReflectConstruct"); |
| 596 |
function _superPropGet$4(t, o, e, r) { |
| 597 |
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); |
| 598 |
return 2 & r && "function" == typeof p ? function(t) { |
| 599 |
return p.apply(e, t); |
| 600 |
} : p; |
| 601 |
} |
| 602 |
__name(_superPropGet$4, "_superPropGet"); |
| 603 |
var MenuHandler = /*#__PURE__*/ function(_elementorModules$Vie) { |
| 604 |
function MenuHandler() { |
| 605 |
_classCallCheck(this, MenuHandler); |
| 606 |
return _callSuper$11(this, MenuHandler, arguments); |
| 607 |
} |
| 608 |
_inherits(MenuHandler, _elementorModules$Vie); |
| 609 |
return _createClass(MenuHandler, [ |
| 610 |
{ |
| 611 |
key: "getDefaultSettings", |
| 612 |
value: function getDefaultSettings() { |
| 613 |
return { selectors: { currentSubmenuItems: "#adminmenu .current" } }; |
| 614 |
} |
| 615 |
}, |
| 616 |
{ |
| 617 |
key: "getDefaultElements", |
| 618 |
value: function getDefaultElements() { |
| 619 |
var settings = this.getSettings(); |
| 620 |
return { |
| 621 |
$currentSubmenuItems: jQuery(settings.selectors.currentSubmenuItems), |
| 622 |
$adminPageMenuLink: jQuery("a[href=\"".concat(settings.path, "\"]")) |
| 623 |
}; |
| 624 |
} |
| 625 |
}, |
| 626 |
{ |
| 627 |
key: "highlightSubMenuItem", |
| 628 |
value: function highlightSubMenuItem() { |
| 629 |
var $submenuItem = (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null) || this.elements.$adminPageMenuLink; |
| 630 |
if (this.elements.$currentSubmenuItems.length) this.elements.$currentSubmenuItems.removeClass("current"); |
| 631 |
$submenuItem.addClass("current"); |
| 632 |
$submenuItem.parent().addClass("current"); |
| 633 |
} |
| 634 |
}, |
| 635 |
{ |
| 636 |
key: "highlightTopLevelMenuItem", |
| 637 |
value: function highlightTopLevelMenuItem($elementToHighlight) { |
| 638 |
var $elementToRemove = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 639 |
var activeClasses = "wp-has-current-submenu wp-menu-open current"; |
| 640 |
$elementToHighlight.parent().addClass(activeClasses).removeClass("wp-not-current-submenu"); |
| 641 |
if ($elementToRemove) $elementToRemove.removeClass(activeClasses); |
| 642 |
} |
| 643 |
}, |
| 644 |
{ |
| 645 |
key: "onInit", |
| 646 |
value: function onInit() { |
| 647 |
_superPropGet$4(MenuHandler, "onInit", this, 3)([]); |
| 648 |
var settings = this.getSettings(); |
| 649 |
if (window.location.href.includes(settings.path)) this.highlightSubMenuItem(); |
| 650 |
} |
| 651 |
} |
| 652 |
]); |
| 653 |
}(elementorModules.ViewModule); |
| 654 |
|
| 655 |
//#endregion |
| 656 |
//#region modules/landing-pages/assets/js/admin/landing-pages.js |
| 657 |
function _callSuper$10(t, o, e) { |
| 658 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 659 |
} |
| 660 |
__name(_callSuper$10, "_callSuper"); |
| 661 |
function _isNativeReflectConstruct$10() { |
| 662 |
try { |
| 663 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 664 |
} catch (t) {} |
| 665 |
return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() { |
| 666 |
return !!t; |
| 667 |
})(); |
| 668 |
} |
| 669 |
__name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct"); |
| 670 |
function _superPropGet$3(t, o, e, r) { |
| 671 |
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); |
| 672 |
return 2 & r && "function" == typeof p ? function(t) { |
| 673 |
return p.apply(e, t); |
| 674 |
} : p; |
| 675 |
} |
| 676 |
__name(_superPropGet$3, "_superPropGet"); |
| 677 |
var LandingPagesHandler = /*#__PURE__*/ function(_AdminMenuHandler) { |
| 678 |
function LandingPagesHandler() { |
| 679 |
_classCallCheck(this, LandingPagesHandler); |
| 680 |
return _callSuper$10(this, LandingPagesHandler, arguments); |
| 681 |
} |
| 682 |
_inherits(LandingPagesHandler, _AdminMenuHandler); |
| 683 |
return _createClass(LandingPagesHandler, [ |
| 684 |
{ |
| 685 |
key: "getDefaultSettings", |
| 686 |
value: function getDefaultSettings() { |
| 687 |
var pageName = "e-landing-page"; |
| 688 |
var adminMenuSelectors = { |
| 689 |
landingPagesTablePage: "a[href=\"edit.php?post_type=" + pageName + "\"]", |
| 690 |
landingPagesAddNewPage: "a[href=\"edit.php?post_type=elementor_library&page=" + pageName + "\"]" |
| 691 |
}; |
| 692 |
return { selectors: { |
| 693 |
addButton: ".page-title-action:first", |
| 694 |
pagesMenuItemAndLink: "#menu-pages, #menu-pages > a", |
| 695 |
landingPagesMenuItem: "".concat(adminMenuSelectors.landingPagesTablePage, ", ").concat(adminMenuSelectors.landingPagesAddNewPage), |
| 696 |
templatesMenuItem: ".menu-icon-elementor_library" |
| 697 |
} }; |
| 698 |
} |
| 699 |
}, |
| 700 |
{ |
| 701 |
key: "getDefaultElements", |
| 702 |
value: function getDefaultElements() { |
| 703 |
var selectors = this.getSettings("selectors"); |
| 704 |
var elements = _superPropGet$3(LandingPagesHandler, "getDefaultElements", this, 3)([]); |
| 705 |
elements.$landingPagesMenuItem = jQuery(selectors.landingPagesMenuItem); |
| 706 |
elements.$templatesMenuItem = jQuery(selectors.templatesMenuItem); |
| 707 |
elements.$pagesMenuItemAndLink = jQuery(selectors.pagesMenuItemAndLink); |
| 708 |
return elements; |
| 709 |
} |
| 710 |
}, |
| 711 |
{ |
| 712 |
key: "onInit", |
| 713 |
value: function onInit() { |
| 714 |
_superPropGet$3(LandingPagesHandler, "onInit", this, 3)([]); |
| 715 |
var settings = this.getSettings(); |
| 716 |
var isLandingPagesTablePage = !!window.location.href.includes(settings.paths.landingPagesTablePage); |
| 717 |
var isLandingPagesTrashPage = !!window.location.href.includes(settings.paths.landingPagesTrashPage); |
| 718 |
var isLandingPagesCreateYourFirstPage = !!window.location.href.includes(settings.paths.landingPagesAddNewPage); |
| 719 |
if (isLandingPagesTablePage || isLandingPagesTrashPage || isLandingPagesCreateYourFirstPage || settings.isLandingPageAdminEdit) { |
| 720 |
this.highlightTopLevelMenuItem(this.elements.$templatesMenuItem, this.elements.$pagesMenuItemAndLink); |
| 721 |
this.highlightSubMenuItem(this.elements.$landingPagesMenuItem); |
| 722 |
jQuery(settings.selectors.addButton).attr("href", elementorAdminConfig.urls.addNewLandingPageUrl); |
| 723 |
} |
| 724 |
} |
| 725 |
} |
| 726 |
]); |
| 727 |
}(MenuHandler); |
| 728 |
|
| 729 |
//#endregion |
| 730 |
//#region modules/landing-pages/assets/js/admin/module.js |
| 731 |
function _callSuper$9(t, o, e) { |
| 732 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 733 |
} |
| 734 |
__name(_callSuper$9, "_callSuper"); |
| 735 |
function _isNativeReflectConstruct$9() { |
| 736 |
try { |
| 737 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 738 |
} catch (t) {} |
| 739 |
return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() { |
| 740 |
return !!t; |
| 741 |
})(); |
| 742 |
} |
| 743 |
__name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct"); |
| 744 |
var _default$1 = /*#__PURE__*/ function(_elementorModules$Mod) { |
| 745 |
function _default() { |
| 746 |
var _this; |
| 747 |
_classCallCheck(this, _default); |
| 748 |
_this = _callSuper$9(this, _default); |
| 749 |
elementorCommon.elements.$window.on("elementor/admin/init", function() { |
| 750 |
_this.runHandler(); |
| 751 |
}); |
| 752 |
return _this; |
| 753 |
} |
| 754 |
_inherits(_default, _elementorModules$Mod); |
| 755 |
return _createClass(_default, [{ |
| 756 |
key: "runHandler", |
| 757 |
value: function runHandler() { |
| 758 |
var _elementorAdmin$confi; |
| 759 |
var _elementorAdmin$confi2; |
| 760 |
var pageName = "e-landing-page"; |
| 761 |
var paths = { |
| 762 |
landingPagesTablePage: "edit.php?post_type=" + pageName, |
| 763 |
landingPagesAddNewPage: "edit.php?post_type=elementor_library&page=" + pageName, |
| 764 |
landingPagesTrashPage: "edit.php?post_status=trash&post_type=" + pageName |
| 765 |
}; |
| 766 |
new LandingPagesHandler({ |
| 767 |
path: (_elementorAdmin$confi = elementorAdmin.config.landingPages) !== null && _elementorAdmin$confi !== void 0 && _elementorAdmin$confi.landingPagesHasPages ? paths.landingPagesTablePage : paths.landingPagesAddNewPage, |
| 768 |
isLandingPageAdminEdit: (_elementorAdmin$confi2 = elementorAdmin.config.landingPages) === null || _elementorAdmin$confi2 === void 0 ? void 0 : _elementorAdmin$confi2.isLandingPageAdminEdit, |
| 769 |
paths |
| 770 |
}); |
| 771 |
} |
| 772 |
}]); |
| 773 |
}(elementorModules.Module); |
| 774 |
|
| 775 |
//#endregion |
| 776 |
//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js |
| 777 |
function _defineProperty(e, r, t) { |
| 778 |
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { |
| 779 |
value: t, |
| 780 |
enumerable: !0, |
| 781 |
configurable: !0, |
| 782 |
writable: !0 |
| 783 |
}) : e[r] = t, e; |
| 784 |
} |
| 785 |
|
| 786 |
//#endregion |
| 787 |
//#region core/experiments/assets/js/admin/behaviors/experiments-messages.js |
| 788 |
var STATE_ACTIVE = "active"; |
| 789 |
var STATE_INACTIVE = "inactive"; |
| 790 |
var STATE_DEFAULT = "default"; |
| 791 |
var ExperimentsMessages = /*#__PURE__*/ function() { |
| 792 |
function ExperimentsMessages(_ref) { |
| 793 |
var selects = _ref.selects; |
| 794 |
var submit = _ref.submit; |
| 795 |
_classCallCheck(this, ExperimentsMessages); |
| 796 |
_defineProperty(this, "elements", {}); |
| 797 |
this.elements = { |
| 798 |
/** |
| 799 |
* @type {HTMLSelectElement[]} |
| 800 |
*/ |
| 801 |
selects, |
| 802 |
/** |
| 803 |
* @type {HTMLInputElement} |
| 804 |
*/ |
| 805 |
submit |
| 806 |
}; |
| 807 |
} |
| 808 |
return _createClass(ExperimentsMessages, [ |
| 809 |
{ |
| 810 |
key: "bindEvents", |
| 811 |
value: function bindEvents() { |
| 812 |
var _this = this; |
| 813 |
this.elements.selects.forEach(function(select) { |
| 814 |
select.addEventListener("change", function(e) { |
| 815 |
return _this.onExperimentStateChange(e); |
| 816 |
}); |
| 817 |
}); |
| 818 |
} |
| 819 |
}, |
| 820 |
{ |
| 821 |
key: "onExperimentStateChange", |
| 822 |
value: function onExperimentStateChange(e) { |
| 823 |
var experimentId = e.currentTarget.dataset.experimentId; |
| 824 |
switch (this.getExperimentActualState(experimentId)) { |
| 825 |
case STATE_ACTIVE: |
| 826 |
if (this.shouldShowDependenciesDialog(experimentId)) this.showDependenciesDialog(experimentId); |
| 827 |
break; |
| 828 |
case STATE_INACTIVE: |
| 829 |
if (this.shouldShowDeactivationDialog(experimentId)) this.showDeactivationDialog(experimentId); |
| 830 |
else this.deactivateDependantExperiments(experimentId); |
| 831 |
break; |
| 832 |
default: break; |
| 833 |
} |
| 834 |
} |
| 835 |
}, |
| 836 |
{ |
| 837 |
key: "getExperimentData", |
| 838 |
value: function getExperimentData(experimentId) { |
| 839 |
return elementorAdminConfig.experiments[experimentId]; |
| 840 |
} |
| 841 |
}, |
| 842 |
{ |
| 843 |
key: "getExperimentDependencies", |
| 844 |
value: function getExperimentDependencies(experimentId) { |
| 845 |
var _this2 = this; |
| 846 |
return this.getExperimentData(experimentId).dependencies.map(function(dependencyId) { |
| 847 |
return _this2.getExperimentData(dependencyId); |
| 848 |
}); |
| 849 |
} |
| 850 |
}, |
| 851 |
{ |
| 852 |
key: "getExperimentSelect", |
| 853 |
value: function getExperimentSelect(experimentId) { |
| 854 |
return this.elements.selects.find(function(select) { |
| 855 |
return select.matches("[data-experiment-id=\"".concat(experimentId, "\"]")); |
| 856 |
}); |
| 857 |
} |
| 858 |
}, |
| 859 |
{ |
| 860 |
key: "setExperimentState", |
| 861 |
value: function setExperimentState(experimentId, state) { |
| 862 |
this.getExperimentSelect(experimentId).value = state; |
| 863 |
} |
| 864 |
}, |
| 865 |
{ |
| 866 |
key: "getExperimentActualState", |
| 867 |
value: function getExperimentActualState(experimentId) { |
| 868 |
var _this$getExperimentSe; |
| 869 |
var state = (_this$getExperimentSe = this.getExperimentSelect(experimentId)) === null || _this$getExperimentSe === void 0 ? void 0 : _this$getExperimentSe.value; |
| 870 |
if (!state) return this.getExperimentData(experimentId).state; |
| 871 |
if (state !== STATE_DEFAULT) return state; |
| 872 |
return this.isExperimentActiveByDefault(experimentId) ? STATE_ACTIVE : STATE_INACTIVE; |
| 873 |
} |
| 874 |
}, |
| 875 |
{ |
| 876 |
key: "isExperimentActive", |
| 877 |
value: function isExperimentActive(experimentId) { |
| 878 |
return this.getExperimentActualState(experimentId) === STATE_ACTIVE; |
| 879 |
} |
| 880 |
}, |
| 881 |
{ |
| 882 |
key: "isExperimentActiveByDefault", |
| 883 |
value: function isExperimentActiveByDefault(experimentId) { |
| 884 |
return this.getExperimentData(experimentId).default === STATE_ACTIVE; |
| 885 |
} |
| 886 |
}, |
| 887 |
{ |
| 888 |
key: "areAllDependenciesActive", |
| 889 |
value: function areAllDependenciesActive(dependencies) { |
| 890 |
var _this3 = this; |
| 891 |
return dependencies.every(function(dependency) { |
| 892 |
return _this3.isExperimentActive(dependency.name); |
| 893 |
}); |
| 894 |
} |
| 895 |
}, |
| 896 |
{ |
| 897 |
key: "deactivateDependantExperiments", |
| 898 |
value: function deactivateDependantExperiments(experimentId) { |
| 899 |
var _this4 = this; |
| 900 |
Object.entries(elementorAdminConfig.experiments).forEach(function(_ref2) { |
| 901 |
var _ref3 = _slicedToArray(_ref2, 2); |
| 902 |
var id = _ref3[0]; |
| 903 |
var isDependant = _ref3[1].dependencies.includes(experimentId); |
| 904 |
var isActive = _this4.getExperimentActualState(id) === STATE_ACTIVE; |
| 905 |
if (isDependant && isActive) _this4.setExperimentState(id, STATE_INACTIVE); |
| 906 |
}); |
| 907 |
} |
| 908 |
}, |
| 909 |
{ |
| 910 |
key: "shouldShowDependenciesDialog", |
| 911 |
value: function shouldShowDependenciesDialog(experimentId) { |
| 912 |
var dependencies = this.getExperimentDependencies(experimentId); |
| 913 |
return !this.areAllDependenciesActive(dependencies); |
| 914 |
} |
| 915 |
}, |
| 916 |
{ |
| 917 |
key: "shouldShowDeactivationDialog", |
| 918 |
value: function shouldShowDeactivationDialog(experimentId) { |
| 919 |
var getExperimentData = this.getExperimentData(experimentId); |
| 920 |
var isInitialStateActive = getExperimentData.state === STATE_ACTIVE || getExperimentData.state === STATE_DEFAULT && getExperimentData.default === STATE_ACTIVE; |
| 921 |
return !!this.getMessage(experimentId, "on_deactivate") && isInitialStateActive; |
| 922 |
} |
| 923 |
}, |
| 924 |
{ |
| 925 |
key: "showDialog", |
| 926 |
value: function showDialog(dialog) { |
| 927 |
return elementorCommon.dialogsManager.createWidget("confirm", { |
| 928 |
id: "e-experiments-messages-dialog", |
| 929 |
headerMessage: dialog.headerMessage, |
| 930 |
message: dialog.message, |
| 931 |
position: { |
| 932 |
my: "center center", |
| 933 |
at: "center center" |
| 934 |
}, |
| 935 |
strings: { |
| 936 |
confirm: dialog.strings.confirm, |
| 937 |
cancel: dialog.strings.cancel |
| 938 |
}, |
| 939 |
hide: { |
| 940 |
onOutsideClick: false, |
| 941 |
onBackgroundClick: false, |
| 942 |
onEscKeyPress: false |
| 943 |
}, |
| 944 |
onConfirm: dialog.onConfirm, |
| 945 |
onCancel: dialog.onCancel |
| 946 |
}).show(); |
| 947 |
} |
| 948 |
}, |
| 949 |
{ |
| 950 |
key: "getSiteLanguageCode", |
| 951 |
value: function getSiteLanguageCode() { |
| 952 |
var languageCode = document.querySelector("html").getAttribute("lang"); |
| 953 |
return languageCode !== null && languageCode !== void 0 ? languageCode : "en"; |
| 954 |
} |
| 955 |
}, |
| 956 |
{ |
| 957 |
key: "formatDependenciesList", |
| 958 |
value: function formatDependenciesList(dependencies) { |
| 959 |
var dependenciesTitles = dependencies.map(function(d) { |
| 960 |
return d.title; |
| 961 |
}); |
| 962 |
var languageCode = this.getSiteLanguageCode(); |
| 963 |
return new Intl.ListFormat(languageCode).format(dependenciesTitles); |
| 964 |
} |
| 965 |
}, |
| 966 |
{ |
| 967 |
key: "showDependenciesDialog", |
| 968 |
value: function showDependenciesDialog(experimentId) { |
| 969 |
var _this5 = this; |
| 970 |
var experimentName = this.getExperimentData(experimentId).title; |
| 971 |
var dependenciesList = this.formatDependenciesList(this.getExperimentDependencies(experimentId)); |
| 972 |
var message = (0, _wordpress_i18n.__)("In order to use %1$s, first you need to activate %2$s.", "elementor").replace("%1$s", "<strong>".concat(experimentName, "</strong>")).replace("%2$s", dependenciesList); |
| 973 |
this.showDialog({ |
| 974 |
message, |
| 975 |
headerMessage: (0, _wordpress_i18n.__)("First, activate another experiment.", "elementor"), |
| 976 |
strings: { |
| 977 |
confirm: (0, _wordpress_i18n.__)("Activate", "elementor"), |
| 978 |
cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") |
| 979 |
}, |
| 980 |
onConfirm: function onConfirm() { |
| 981 |
_this5.getExperimentDependencies(experimentId).forEach(function(dependency) { |
| 982 |
_this5.setExperimentState(dependency.name, STATE_ACTIVE); |
| 983 |
}); |
| 984 |
_this5.elements.submit.click(); |
| 985 |
}, |
| 986 |
onCancel: function onCancel() { |
| 987 |
_this5.setExperimentState(experimentId, STATE_INACTIVE); |
| 988 |
} |
| 989 |
}); |
| 990 |
} |
| 991 |
}, |
| 992 |
{ |
| 993 |
key: "showDeactivationDialog", |
| 994 |
value: function showDeactivationDialog(experimentId) { |
| 995 |
var _this6 = this; |
| 996 |
this.showDialog({ |
| 997 |
message: this.getMessage(experimentId, "on_deactivate"), |
| 998 |
headerMessage: (0, _wordpress_i18n.__)("Are you sure?", "elementor"), |
| 999 |
strings: { |
| 1000 |
confirm: (0, _wordpress_i18n.__)("Deactivate", "elementor"), |
| 1001 |
cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") |
| 1002 |
}, |
| 1003 |
onConfirm: function onConfirm() { |
| 1004 |
_this6.setExperimentState(experimentId, STATE_INACTIVE); |
| 1005 |
_this6.deactivateDependantExperiments(experimentId); |
| 1006 |
_this6.elements.submit.click(); |
| 1007 |
}, |
| 1008 |
onCancel: function onCancel() { |
| 1009 |
_this6.setExperimentState(experimentId, STATE_ACTIVE); |
| 1010 |
} |
| 1011 |
}); |
| 1012 |
} |
| 1013 |
}, |
| 1014 |
{ |
| 1015 |
key: "getMessage", |
| 1016 |
value: function getMessage(experimentId, messageId) { |
| 1017 |
var _this$getExperimentDa; |
| 1018 |
return (_this$getExperimentDa = this.getExperimentData(experimentId)) === null || _this$getExperimentDa === void 0 ? void 0 : _this$getExperimentDa.messages[messageId]; |
| 1019 |
} |
| 1020 |
} |
| 1021 |
]); |
| 1022 |
}(); |
| 1023 |
|
| 1024 |
//#endregion |
| 1025 |
//#region \0vite/preload-helper.js |
| 1026 |
var scriptRel = "modulepreload"; |
| 1027 |
var assetsURL = function(dep) { |
| 1028 |
return "/" + dep; |
| 1029 |
}; |
| 1030 |
var seen = {}; |
| 1031 |
var __vitePreload = function preload(baseModule, deps, importerUrl) { |
| 1032 |
let promise = Promise.resolve(); |
| 1033 |
if (false && deps && deps.length > 0) { |
| 1034 |
const links = document.getElementsByTagName("link"); |
| 1035 |
const cspNonceMeta = document.querySelector("meta[property=csp-nonce]"); |
| 1036 |
const cspNonce = (cspNonceMeta === null || cspNonceMeta === void 0 ? void 0 : cspNonceMeta.nonce) || (cspNonceMeta === null || cspNonceMeta === void 0 ? void 0 : cspNonceMeta.getAttribute("nonce")); |
| 1037 |
function allSettled(promises) { |
| 1038 |
return Promise.all(promises.map((p) => Promise.resolve(p).then((value) => ({ |
| 1039 |
status: "fulfilled", |
| 1040 |
value |
| 1041 |
}), (reason) => ({ |
| 1042 |
status: "rejected", |
| 1043 |
reason |
| 1044 |
})))); |
| 1045 |
} |
| 1046 |
function importMetaResolve(specifier) { |
| 1047 |
if ({}.resolve) return {}.resolve(specifier); |
| 1048 |
return new URL( |
| 1049 |
specifier, |
| 1050 |
/** #__KEEP__ */ |
| 1051 |
{}.url |
| 1052 |
).href; |
| 1053 |
} |
| 1054 |
promise = allSettled(deps.map((dep) => { |
| 1055 |
dep = assetsURL(dep, importerUrl); |
| 1056 |
dep = importMetaResolve(dep); |
| 1057 |
if (dep in seen) return; |
| 1058 |
seen[dep] = true; |
| 1059 |
const isCss = dep.endsWith(".css"); |
| 1060 |
for (let i = links.length - 1; i >= 0; i--) { |
| 1061 |
const link = links[i]; |
| 1062 |
if (link.href === dep && (!isCss || link.rel === "stylesheet")) return; |
| 1063 |
} |
| 1064 |
const link = document.createElement("link"); |
| 1065 |
link.rel = isCss ? "stylesheet" : scriptRel; |
| 1066 |
if (!isCss) link.as = "script"; |
| 1067 |
link.crossOrigin = ""; |
| 1068 |
link.href = dep; |
| 1069 |
if (cspNonce) link.setAttribute("nonce", cspNonce); |
| 1070 |
document.head.appendChild(link); |
| 1071 |
if (isCss) return new Promise((res, rej) => { |
| 1072 |
link.addEventListener("load", res); |
| 1073 |
link.addEventListener("error", () => rej(/* @__PURE__ */ new Error(`Unable to preload CSS for ${dep}`))); |
| 1074 |
}); |
| 1075 |
})); |
| 1076 |
} |
| 1077 |
function handlePreloadError(err) { |
| 1078 |
const e = new Event("vite:preloadError", { cancelable: true }); |
| 1079 |
e.payload = err; |
| 1080 |
window.dispatchEvent(e); |
| 1081 |
if (!e.defaultPrevented) throw err; |
| 1082 |
} |
| 1083 |
return promise.then((res) => { |
| 1084 |
for (const item of res || []) { |
| 1085 |
if (item.status !== "rejected") continue; |
| 1086 |
handlePreloadError(item.reason); |
| 1087 |
} |
| 1088 |
return baseModule().catch(handlePreloadError); |
| 1089 |
}); |
| 1090 |
}; |
| 1091 |
|
| 1092 |
//#endregion |
| 1093 |
//#region core/experiments/assets/js/admin/module.js |
| 1094 |
function _callSuper$8(t, o, e) { |
| 1095 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 1096 |
} |
| 1097 |
__name(_callSuper$8, "_callSuper"); |
| 1098 |
function _isNativeReflectConstruct$8() { |
| 1099 |
try { |
| 1100 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 1101 |
} catch (t) {} |
| 1102 |
return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() { |
| 1103 |
return !!t; |
| 1104 |
})(); |
| 1105 |
} |
| 1106 |
__name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct"); |
| 1107 |
function _superPropGet$2(t, o, e, r) { |
| 1108 |
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); |
| 1109 |
return 2 & r && "function" == typeof p ? function(t) { |
| 1110 |
return p.apply(e, t); |
| 1111 |
} : p; |
| 1112 |
} |
| 1113 |
__name(_superPropGet$2, "_superPropGet"); |
| 1114 |
var ExperimentsModule = /*#__PURE__*/ function(_elementorModules$Vie) { |
| 1115 |
function ExperimentsModule() { |
| 1116 |
_classCallCheck(this, ExperimentsModule); |
| 1117 |
return _callSuper$8(this, ExperimentsModule, arguments); |
| 1118 |
} |
| 1119 |
_inherits(ExperimentsModule, _elementorModules$Vie); |
| 1120 |
return _createClass(ExperimentsModule, [ |
| 1121 |
{ |
| 1122 |
key: "getDefaultSettings", |
| 1123 |
value: function getDefaultSettings() { |
| 1124 |
return { selectors: { |
| 1125 |
experimentIndicators: ".e-experiment__title__indicator", |
| 1126 |
experimentForm: "#elementor-settings-form", |
| 1127 |
experimentSelects: ".e-experiment__select", |
| 1128 |
experimentsButtons: ".e-experiment__button" |
| 1129 |
} }; |
| 1130 |
} |
| 1131 |
}, |
| 1132 |
{ |
| 1133 |
key: "getDefaultElements", |
| 1134 |
value: function getDefaultElements() { |
| 1135 |
var selectors = this.getSettings().selectors; |
| 1136 |
return { |
| 1137 |
$experimentIndicators: jQuery(selectors.experimentIndicators), |
| 1138 |
$experimentForm: jQuery(selectors.experimentForm), |
| 1139 |
$experimentSelects: jQuery(selectors.experimentSelects), |
| 1140 |
$experimentsButtons: jQuery(selectors.experimentsButtons) |
| 1141 |
}; |
| 1142 |
} |
| 1143 |
}, |
| 1144 |
{ |
| 1145 |
key: "bindEvents", |
| 1146 |
value: function bindEvents() { |
| 1147 |
var _this = this; |
| 1148 |
this.elements.$experimentsButtons.on("click", function(event) { |
| 1149 |
return _this.onExperimentsButtonsClick(event); |
| 1150 |
}); |
| 1151 |
} |
| 1152 |
}, |
| 1153 |
{ |
| 1154 |
key: "onExperimentsButtonsClick", |
| 1155 |
value: function onExperimentsButtonsClick(event) { |
| 1156 |
var submitButton = jQuery(event.currentTarget); |
| 1157 |
this.elements.$experimentSelects.val(submitButton.val()); |
| 1158 |
this.elements.$experimentForm.find("#submit").trigger("click"); |
| 1159 |
} |
| 1160 |
}, |
| 1161 |
{ |
| 1162 |
key: "addTipsy", |
| 1163 |
value: function addTipsy($element) { |
| 1164 |
$element.tipsy({ |
| 1165 |
gravity: "s", |
| 1166 |
offset: 8, |
| 1167 |
title: function title() { |
| 1168 |
return this.getAttribute("data-tooltip"); |
| 1169 |
} |
| 1170 |
}); |
| 1171 |
} |
| 1172 |
}, |
| 1173 |
{ |
| 1174 |
key: "addIndicatorsTooltips", |
| 1175 |
value: function addIndicatorsTooltips() { |
| 1176 |
var _this2 = this; |
| 1177 |
this.elements.$experimentIndicators.each(function(index, experimentIndicator) { |
| 1178 |
return _this2.addTipsy(jQuery(experimentIndicator)); |
| 1179 |
}); |
| 1180 |
} |
| 1181 |
}, |
| 1182 |
{ |
| 1183 |
key: "onInit", |
| 1184 |
value: function onInit() { |
| 1185 |
var _this3 = this; |
| 1186 |
_superPropGet$2(ExperimentsModule, "onInit", this, 3)([]); |
| 1187 |
this.experimentsDependency = new ExperimentsMessages({ |
| 1188 |
selects: this.elements.$experimentSelects.toArray(), |
| 1189 |
submit: this.elements.$experimentForm.find("#submit").get(0) |
| 1190 |
}); |
| 1191 |
this.experimentsDependency.bindEvents(); |
| 1192 |
if (this.elements.$experimentIndicators.length) __vitePreload(() => import( |
| 1193 |
/* webpackIgnore: true */ |
| 1194 |
"".concat(elementorCommon.config.urls.assets, "lib/tipsy/tipsy.min.js?ver=1.0.0") |
| 1195 |
).then(function() { |
| 1196 |
return _this3.addIndicatorsTooltips(); |
| 1197 |
}), void 0); |
| 1198 |
} |
| 1199 |
} |
| 1200 |
]); |
| 1201 |
}(elementorModules.ViewModule); |
| 1202 |
|
| 1203 |
//#endregion |
| 1204 |
//#region core/common/assets/js/utils/environment.js |
| 1205 |
var matchUserAgent = function matchUserAgent(UserAgentStr) { |
| 1206 |
return userAgent.indexOf(UserAgentStr) >= 0; |
| 1207 |
}; |
| 1208 |
var userAgent = navigator.userAgent; |
| 1209 |
var isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(" OPR/"); |
| 1210 |
var isFirefox = matchUserAgent("Firefox"); |
| 1211 |
var isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function(p) { |
| 1212 |
return "[object SafariRemoteNotification]" === p.toString(); |
| 1213 |
}(!window.safari || typeof safari !== "undefined" && safari.pushNotification); |
| 1214 |
var isIE = /Trident|MSIE/.test(userAgent) && !!document.documentMode; |
| 1215 |
var isEdge = !isIE && !!window.StyleMedia || matchUserAgent("Edg"); |
| 1216 |
var isChrome = !!window.chrome && matchUserAgent("Chrome") && !(isEdge || isOpera); |
| 1217 |
var isBlink = matchUserAgent("Chrome") && !!window.CSS; |
| 1218 |
var isAppleWebkit = matchUserAgent("AppleWebKit") && !isBlink; |
| 1219 |
var environment = { |
| 1220 |
isTouchDevice: "ontouchstart" in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0, |
| 1221 |
appleWebkit: isAppleWebkit, |
| 1222 |
blink: isBlink, |
| 1223 |
chrome: isChrome, |
| 1224 |
edge: isEdge, |
| 1225 |
firefox: isFirefox, |
| 1226 |
ie: isIE, |
| 1227 |
mac: matchUserAgent("Macintosh"), |
| 1228 |
opera: isOpera, |
| 1229 |
safari: isSafari, |
| 1230 |
webkit: matchUserAgent("AppleWebKit") |
| 1231 |
}; |
| 1232 |
|
| 1233 |
//#endregion |
| 1234 |
//#region assets/dev/js/utils/events.js |
| 1235 |
var Events = /*#__PURE__*/ function() { |
| 1236 |
function Events() { |
| 1237 |
_classCallCheck(this, Events); |
| 1238 |
} |
| 1239 |
return _createClass(Events, null, [{ |
| 1240 |
key: "dispatch", |
| 1241 |
value: function dispatch(context, event) { |
| 1242 |
var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; |
| 1243 |
var bcEvent = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null; |
| 1244 |
context = context instanceof jQuery ? context[0] : context; |
| 1245 |
if (bcEvent) context.dispatchEvent(new CustomEvent(bcEvent, { detail: data })); |
| 1246 |
context.dispatchEvent(new CustomEvent(event, { detail: data })); |
| 1247 |
} |
| 1248 |
}]); |
| 1249 |
}(); |
| 1250 |
|
| 1251 |
//#endregion |
| 1252 |
//#region assets/dev/js/editor/utils/files-upload-handler.js |
| 1253 |
var FilesUploadHandler = /*#__PURE__*/ function() { |
| 1254 |
function FilesUploadHandler() { |
| 1255 |
_classCallCheck(this, FilesUploadHandler); |
| 1256 |
} |
| 1257 |
return _createClass(FilesUploadHandler, null, [ |
| 1258 |
{ |
| 1259 |
key: "isUploadEnabled", |
| 1260 |
value: function isUploadEnabled(mediaType) { |
| 1261 |
if (!["svg", "application/json"].includes(mediaType)) return true; |
| 1262 |
return elementorCommon.config.filesUpload.unfilteredFiles; |
| 1263 |
} |
| 1264 |
}, |
| 1265 |
{ |
| 1266 |
key: "setUploadTypeCaller", |
| 1267 |
value: function setUploadTypeCaller(frame) { |
| 1268 |
frame.uploader.uploader.param("uploadTypeCaller", "elementor-wp-media-upload"); |
| 1269 |
} |
| 1270 |
}, |
| 1271 |
{ |
| 1272 |
key: "getUnfilteredFilesNonAdminDialog", |
| 1273 |
value: function getUnfilteredFilesNonAdminDialog() { |
| 1274 |
return elementorCommon.dialogsManager.createWidget("alert", { |
| 1275 |
id: "e-unfiltered-files-disabled-dialog", |
| 1276 |
headerMessage: (0, _wordpress_i18n.__)("Sorry, you can't upload that file yet", "elementor"), |
| 1277 |
message: (0, _wordpress_i18n.__)("This is because JSON files may pose a security risk.", "elementor") + "<br><br>" + (0, _wordpress_i18n.__)("To upload them anyway, ask the site administrator to enable unfiltered file uploads.", "elementor"), |
| 1278 |
strings: { confirm: (0, _wordpress_i18n.__)("Got it", "elementor") } |
| 1279 |
}); |
| 1280 |
} |
| 1281 |
}, |
| 1282 |
{ |
| 1283 |
key: "getUnfilteredFilesNotEnabledDialog", |
| 1284 |
value: function getUnfilteredFilesNotEnabledDialog(callback) { |
| 1285 |
var elementorInstance = window.elementorAdmin || window.elementor; |
| 1286 |
if (!elementorInstance.config.user.is_administrator) return this.getUnfilteredFilesNonAdminDialog(); |
| 1287 |
return elementorInstance.helpers.getSimpleDialog("e-enable-unfiltered-files-dialog", (0, _wordpress_i18n.__)("Enable Unfiltered File Uploads", "elementor"), (0, _wordpress_i18n.__)("Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.", "elementor"), (0, _wordpress_i18n.__)("Enable", "elementor"), function onConfirm() { |
| 1288 |
elementorCommon.ajax.addRequest("enable_unfiltered_files_upload", {}, true); |
| 1289 |
elementorCommon.config.filesUpload.unfilteredFiles = true; |
| 1290 |
callback(); |
| 1291 |
}); |
| 1292 |
} |
| 1293 |
}, |
| 1294 |
{ |
| 1295 |
key: "getUnfilteredFilesNotEnabledImportTemplateDialog", |
| 1296 |
value: function getUnfilteredFilesNotEnabledImportTemplateDialog(callback) { |
| 1297 |
if (!(window.elementorAdmin || window.elementor).config.user.is_administrator) return this.getUnfilteredFilesNonAdminDialog(); |
| 1298 |
return elementorCommon.dialogsManager.createWidget("confirm", { |
| 1299 |
id: "e-enable-unfiltered-files-dialog-import-template", |
| 1300 |
headerMessage: (0, _wordpress_i18n.__)("Enable Unfiltered File Uploads", "elementor"), |
| 1301 |
message: (0, _wordpress_i18n.__)("Before you enable unfiltered files upload, note that such files include a security risk. Elementor does run a process to remove possible malicious code, but there is still risk involved when using such files.", "elementor") + "<br /><br />" + (0, _wordpress_i18n.__)("If you do not enable uploading unfiltered files, any SVG or JSON (including lottie) files used in the uploaded template will not be imported.", "elementor"), |
| 1302 |
position: { |
| 1303 |
my: "center center", |
| 1304 |
at: "center center" |
| 1305 |
}, |
| 1306 |
strings: { |
| 1307 |
confirm: (0, _wordpress_i18n.__)("Enable and Import", "elementor"), |
| 1308 |
cancel: (0, _wordpress_i18n.__)("Import Without Enabling", "elementor") |
| 1309 |
}, |
| 1310 |
onConfirm: function onConfirm() { |
| 1311 |
elementorCommon.ajax.addRequest("enable_unfiltered_files_upload", { success: function success() { |
| 1312 |
elementorCommon.config.filesUpload.unfilteredFiles = true; |
| 1313 |
callback(); |
| 1314 |
} }, true); |
| 1315 |
}, |
| 1316 |
onCancel: function onCancel() { |
| 1317 |
return callback(); |
| 1318 |
} |
| 1319 |
}); |
| 1320 |
} |
| 1321 |
} |
| 1322 |
]); |
| 1323 |
}(); |
| 1324 |
|
| 1325 |
//#endregion |
| 1326 |
//#region assets/dev/js/admin/new-template/template-controls.js |
| 1327 |
var TemplateControls = /*#__PURE__*/ function() { |
| 1328 |
function TemplateControls() { |
| 1329 |
_classCallCheck(this, TemplateControls); |
| 1330 |
} |
| 1331 |
return _createClass(TemplateControls, [ |
| 1332 |
{ |
| 1333 |
key: "setDynamicControlsVisibility", |
| 1334 |
value: function setDynamicControlsVisibility(lookupControlIdPrefix, controls) { |
| 1335 |
if (void 0 === controls) return; |
| 1336 |
var controlsArray = Object.entries(controls); |
| 1337 |
for (var _i = 0, _controlsArray = controlsArray; _i < _controlsArray.length; _i++) { |
| 1338 |
var _controlsArray$_i = _slicedToArray(_controlsArray[_i], 2); |
| 1339 |
var controlId = _controlsArray$_i[0]; |
| 1340 |
var controlSettings = _controlsArray$_i[1]; |
| 1341 |
this.setVisibilityForControl(lookupControlIdPrefix, controlSettings, controlId); |
| 1342 |
} |
| 1343 |
} |
| 1344 |
}, |
| 1345 |
{ |
| 1346 |
key: "setVisibilityForControl", |
| 1347 |
value: function setVisibilityForControl(lookupControlIdPrefix, controlSettings, controlId) { |
| 1348 |
var _controlSettings$cond; |
| 1349 |
var _this = this; |
| 1350 |
Object.entries((_controlSettings$cond = controlSettings.conditions) !== null && _controlSettings$cond !== void 0 ? _controlSettings$cond : {}).forEach(function(condition) { |
| 1351 |
_this.changeVisibilityBasedOnCondition(lookupControlIdPrefix, condition, controlId); |
| 1352 |
}); |
| 1353 |
} |
| 1354 |
}, |
| 1355 |
{ |
| 1356 |
key: "changeVisibilityBasedOnCondition", |
| 1357 |
value: function changeVisibilityBasedOnCondition(lookupControlIdPrefix, condition, controlId) { |
| 1358 |
var _condition = _slicedToArray(condition, 2); |
| 1359 |
var conditionKey = _condition[0]; |
| 1360 |
var conditionValue = _condition[1]; |
| 1361 |
var targetControlWrapper = document.getElementById(lookupControlIdPrefix + controlId + "__wrapper"); |
| 1362 |
var lookupControl = document.getElementById(lookupControlIdPrefix + conditionKey); |
| 1363 |
targetControlWrapper.classList.toggle("elementor-hidden", !lookupControl || conditionValue !== lookupControl.value); |
| 1364 |
} |
| 1365 |
} |
| 1366 |
]); |
| 1367 |
}(); |
| 1368 |
|
| 1369 |
//#endregion |
| 1370 |
//#region assets/dev/js/utils/json-upload-warning-message.js |
| 1371 |
var genericMessageIntroductionKey = "upload_json_warning_generic_message"; |
| 1372 |
/** |
| 1373 |
* @type {import('../utils/introduction').default | null} |
| 1374 |
*/ |
| 1375 |
var genericWarningModal = null; |
| 1376 |
function showJsonUploadWarningMessageIfNeeded(_ref) { |
| 1377 |
var introductionMap = _ref.introductionMap; |
| 1378 |
var IntroductionClass = _ref.IntroductionClass; |
| 1379 |
var _ref$waitForSetViewed = _ref.waitForSetViewed; |
| 1380 |
var waitForSetViewed = _ref$waitForSetViewed === void 0 ? false : _ref$waitForSetViewed; |
| 1381 |
if (!genericWarningModal) genericWarningModal = createGenericWarningModal(IntroductionClass); |
| 1382 |
genericWarningModal.setIntroductionMap(introductionMap); |
| 1383 |
if (genericWarningModal.introductionViewed) return Promise.resolve(); |
| 1384 |
var dialog = genericWarningModal.getDialog(); |
| 1385 |
return new Promise(function(resolve, reject) { |
| 1386 |
dialog.onHide = function() { |
| 1387 |
reject(); |
| 1388 |
}; |
| 1389 |
dialog.onConfirm = /*#__PURE__*/ _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() { |
| 1390 |
return import_regenerator.default.wrap(function(_context) { |
| 1391 |
while (1) switch (_context.prev = _context.next) { |
| 1392 |
case 0: |
| 1393 |
if (!dialog.getElements("checkbox-dont-show-again").prop("checked")) { |
| 1394 |
_context.next = 3; |
| 1395 |
break; |
| 1396 |
} |
| 1397 |
if (!waitForSetViewed) { |
| 1398 |
_context.next = 2; |
| 1399 |
break; |
| 1400 |
} |
| 1401 |
_context.next = 1; |
| 1402 |
return genericWarningModal.setViewed(); |
| 1403 |
case 1: |
| 1404 |
_context.next = 3; |
| 1405 |
break; |
| 1406 |
case 2: genericWarningModal.setViewed(); |
| 1407 |
case 3: |
| 1408 |
resolve(); |
| 1409 |
dialog.hide(); |
| 1410 |
case 4: |
| 1411 |
case "end": return _context.stop(); |
| 1412 |
} |
| 1413 |
}, _callee); |
| 1414 |
})); |
| 1415 |
dialog.onCancel = function() { |
| 1416 |
dialog.hide(); |
| 1417 |
}; |
| 1418 |
genericWarningModal.show(); |
| 1419 |
}); |
| 1420 |
} |
| 1421 |
/** |
| 1422 |
* @param {import('../utils/introduction').default.prototype.constructor} IntroductionClass |
| 1423 |
* |
| 1424 |
* @return {import('../utils/introduction').default} |
| 1425 |
*/ |
| 1426 |
function createGenericWarningModal(IntroductionClass) { |
| 1427 |
var _introduction$getDial; |
| 1428 |
var _introduction$getDial2; |
| 1429 |
var dialogId = "e-generic-warning-modal-for-json-upload"; |
| 1430 |
var introduction = new IntroductionClass({ |
| 1431 |
introductionKey: genericMessageIntroductionKey, |
| 1432 |
dialogType: "confirm", |
| 1433 |
dialogOptions: { |
| 1434 |
id: dialogId, |
| 1435 |
headerMessage: (0, _wordpress_i18n.__)("Warning: JSON files may be unsafe", "elementor"), |
| 1436 |
message: (0, _wordpress_i18n.__)("Uploading JSON files from unknown sources can be harmful and put your site at risk. For maximum safety, only install JSON files from trusted sources.", "elementor"), |
| 1437 |
effects: { |
| 1438 |
show: "fadeIn", |
| 1439 |
hide: "fadeOut" |
| 1440 |
}, |
| 1441 |
hide: { |
| 1442 |
onBackgroundClick: true, |
| 1443 |
onButtonClick: false |
| 1444 |
}, |
| 1445 |
strings: { |
| 1446 |
confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), |
| 1447 |
cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") |
| 1448 |
} |
| 1449 |
} |
| 1450 |
}); |
| 1451 |
var _createCheckboxAndLab = createCheckboxAndLabel(dialogId); |
| 1452 |
var checkbox = _createCheckboxAndLab.checkbox; |
| 1453 |
var label = _createCheckboxAndLab.label; |
| 1454 |
introduction.getDialog().addElement("checkbox-dont-show-again", checkbox); |
| 1455 |
(_introduction$getDial = introduction.getDialog().getElements("message")) === null || _introduction$getDial === void 0 || (_introduction$getDial2 = _introduction$getDial.append) === null || _introduction$getDial2 === void 0 || _introduction$getDial2.call(_introduction$getDial, label); |
| 1456 |
return introduction; |
| 1457 |
} |
| 1458 |
function createCheckboxAndLabel(dialogId) { |
| 1459 |
var checkboxId = "".concat(dialogId, "-dont-show-again"); |
| 1460 |
var checkbox = document.createElement("input"); |
| 1461 |
checkbox.type = "checkbox"; |
| 1462 |
checkbox.name = checkboxId; |
| 1463 |
checkbox.id = checkboxId; |
| 1464 |
var label = document.createElement("label"); |
| 1465 |
label.htmlFor = checkboxId; |
| 1466 |
label.textContent = (0, _wordpress_i18n.__)("Do not show this message again", "elementor"); |
| 1467 |
label.style.display = "block"; |
| 1468 |
label.style.marginTop = "20px"; |
| 1469 |
label.style.marginBottom = "20px"; |
| 1470 |
label.prepend(checkbox); |
| 1471 |
return { |
| 1472 |
checkbox, |
| 1473 |
label |
| 1474 |
}; |
| 1475 |
} |
| 1476 |
|
| 1477 |
//#endregion |
| 1478 |
//#region modules/floating-buttons/assets/js/floating-buttons/admin/floating-buttons.js |
| 1479 |
function _callSuper$7(t, o, e) { |
| 1480 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 1481 |
} |
| 1482 |
__name(_callSuper$7, "_callSuper"); |
| 1483 |
function _isNativeReflectConstruct$7() { |
| 1484 |
try { |
| 1485 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 1486 |
} catch (t) {} |
| 1487 |
return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() { |
| 1488 |
return !!t; |
| 1489 |
})(); |
| 1490 |
} |
| 1491 |
__name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct"); |
| 1492 |
function _superPropGet$1(t, o, e, r) { |
| 1493 |
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); |
| 1494 |
return 2 & r && "function" == typeof p ? function(t) { |
| 1495 |
return p.apply(e, t); |
| 1496 |
} : p; |
| 1497 |
} |
| 1498 |
__name(_superPropGet$1, "_superPropGet"); |
| 1499 |
var FloatingButtonsHandler = /*#__PURE__*/ function(_AdminMenuHandler) { |
| 1500 |
function FloatingButtonsHandler() { |
| 1501 |
_classCallCheck(this, FloatingButtonsHandler); |
| 1502 |
return _callSuper$7(this, FloatingButtonsHandler, arguments); |
| 1503 |
} |
| 1504 |
_inherits(FloatingButtonsHandler, _AdminMenuHandler); |
| 1505 |
return _createClass(FloatingButtonsHandler, [ |
| 1506 |
{ |
| 1507 |
key: "getDefaultSettings", |
| 1508 |
value: function getDefaultSettings() { |
| 1509 |
var pageName = "e-floating-buttons"; |
| 1510 |
var adminMenuSelectors = { |
| 1511 |
contactPagesTablePage: "a[href=\"edit.php?post_type=" + pageName + "\"]", |
| 1512 |
contactPagesAddNewPage: "a[href=\"edit.php?post_type=elementor_library&page=" + pageName + "\"]" |
| 1513 |
}; |
| 1514 |
return { selectors: { |
| 1515 |
addButton: ".page-title-action:first", |
| 1516 |
templatesMenuItem: ".menu-icon-elementor_library", |
| 1517 |
contactPagesMenuItem: "".concat(adminMenuSelectors.contactPagesTablePage, ", ").concat(adminMenuSelectors.contactPagesAddNewPage) |
| 1518 |
} }; |
| 1519 |
} |
| 1520 |
}, |
| 1521 |
{ |
| 1522 |
key: "getDefaultElements", |
| 1523 |
value: function getDefaultElements() { |
| 1524 |
var selectors = this.getSettings("selectors"); |
| 1525 |
var elements = _superPropGet$1(FloatingButtonsHandler, "getDefaultElements", this, 3)([]); |
| 1526 |
elements.$templatesMenuItem = jQuery(selectors.templatesMenuItem); |
| 1527 |
elements.$contactPagesMenuItem = jQuery(selectors.contactPagesMenuItem); |
| 1528 |
return elements; |
| 1529 |
} |
| 1530 |
}, |
| 1531 |
{ |
| 1532 |
key: "onInit", |
| 1533 |
value: function onInit() { |
| 1534 |
var _elementorAdminConfig; |
| 1535 |
_superPropGet$1(FloatingButtonsHandler, "onInit", this, 3)([]); |
| 1536 |
var settings = this.getSettings(); |
| 1537 |
var isContactPagesTablePage = !!window.location.href.includes(settings.paths.contactPagesTablePage); |
| 1538 |
var isContactPagesTrashPage = !!window.location.href.includes(settings.paths.contactPagesTrashPage); |
| 1539 |
var isLContactPagesCreateYourFirstPage = !!window.location.href.includes(settings.paths.contactPagesAddNewPage); |
| 1540 |
if ((_elementorAdminConfig = elementorAdminConfig.urls) !== null && _elementorAdminConfig !== void 0 && _elementorAdminConfig.viewContactPageUrl) this.elements.$templatesMenuItem.find("li.submenu-e-contact a").attr("href", elementorAdminConfig.urls.viewContactPageUrl); |
| 1541 |
if (isContactPagesTablePage || isContactPagesTrashPage || isLContactPagesCreateYourFirstPage) { |
| 1542 |
this.highlightTopLevelMenuItem(this.elements.$templatesMenuItem, this.elements.$pagesMenuItemAndLink); |
| 1543 |
this.highlightSubMenuItem(this.elements.$contactPagesMenuItem); |
| 1544 |
jQuery(settings.selectors.addButton).attr("href", elementorAdminConfig.urls.addNewLinkUrlContact); |
| 1545 |
} |
| 1546 |
} |
| 1547 |
} |
| 1548 |
]); |
| 1549 |
}(MenuHandler); |
| 1550 |
|
| 1551 |
//#endregion |
| 1552 |
//#region modules/floating-buttons/assets/js/floating-buttons/admin/module.js |
| 1553 |
function _callSuper$6(t, o, e) { |
| 1554 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 1555 |
} |
| 1556 |
__name(_callSuper$6, "_callSuper"); |
| 1557 |
function _isNativeReflectConstruct$6() { |
| 1558 |
try { |
| 1559 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 1560 |
} catch (t) {} |
| 1561 |
return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() { |
| 1562 |
return !!t; |
| 1563 |
})(); |
| 1564 |
} |
| 1565 |
__name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct"); |
| 1566 |
var _default = /*#__PURE__*/ function(_elementorModules$Mod) { |
| 1567 |
function _default() { |
| 1568 |
var _this; |
| 1569 |
_classCallCheck(this, _default); |
| 1570 |
_this = _callSuper$6(this, _default); |
| 1571 |
elementorCommon.elements.$window.on("elementor/admin/init", function() { |
| 1572 |
_this.runHandler(); |
| 1573 |
}); |
| 1574 |
return _this; |
| 1575 |
} |
| 1576 |
_inherits(_default, _elementorModules$Mod); |
| 1577 |
return _createClass(_default, [{ |
| 1578 |
key: "runHandler", |
| 1579 |
value: function runHandler() { |
| 1580 |
var pageNameContact = "e-floating-buttons"; |
| 1581 |
new FloatingButtonsHandler({ paths: { |
| 1582 |
contactPagesTablePage: "edit.php?post_type=" + pageNameContact, |
| 1583 |
contactPagesAddNewPage: "edit.php?post_type=elementor_library&page=" + pageNameContact, |
| 1584 |
contactPagesTrashPage: "edit.php?post_status=trash&post_type=" + pageNameContact |
| 1585 |
} }); |
| 1586 |
} |
| 1587 |
}]); |
| 1588 |
}(elementorModules.Module); |
| 1589 |
|
| 1590 |
//#endregion |
| 1591 |
//#region app/assets/js/event-track/dashboard/base-tracking.js |
| 1592 |
var BaseTracking = /*#__PURE__*/ function() { |
| 1593 |
function BaseTracking() { |
| 1594 |
_classCallCheck(this, BaseTracking); |
| 1595 |
} |
| 1596 |
return _createClass(BaseTracking, null, [ |
| 1597 |
{ |
| 1598 |
key: "ensureOwnArrays", |
| 1599 |
value: function ensureOwnArrays() { |
| 1600 |
if (!Object.prototype.hasOwnProperty.call(this, "observers")) this.observers = []; |
| 1601 |
if (!Object.prototype.hasOwnProperty.call(this, "eventListeners")) this.eventListeners = []; |
| 1602 |
} |
| 1603 |
}, |
| 1604 |
{ |
| 1605 |
key: "destroy", |
| 1606 |
value: function destroy() { |
| 1607 |
this.ensureOwnArrays(); |
| 1608 |
this.observers.forEach(function(observer) { |
| 1609 |
return observer.disconnect(); |
| 1610 |
}); |
| 1611 |
this.observers = []; |
| 1612 |
this.eventListeners.forEach(function(_ref) { |
| 1613 |
var target = _ref.target; |
| 1614 |
var type = _ref.type; |
| 1615 |
var handler = _ref.handler; |
| 1616 |
var options = _ref.options; |
| 1617 |
target.removeEventListener(type, handler, options); |
| 1618 |
}); |
| 1619 |
this.eventListeners = []; |
| 1620 |
} |
| 1621 |
}, |
| 1622 |
{ |
| 1623 |
key: "addObserver", |
| 1624 |
value: function addObserver(target, options, callback) { |
| 1625 |
this.ensureOwnArrays(); |
| 1626 |
var observer = new MutationObserver(callback); |
| 1627 |
observer.observe(target, options); |
| 1628 |
this.observers.push(observer); |
| 1629 |
return observer; |
| 1630 |
} |
| 1631 |
}, |
| 1632 |
{ |
| 1633 |
key: "addEventListenerTracked", |
| 1634 |
value: function addEventListenerTracked(target, type, handler) { |
| 1635 |
var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; |
| 1636 |
this.ensureOwnArrays(); |
| 1637 |
target.addEventListener(type, handler, options); |
| 1638 |
this.eventListeners.push({ |
| 1639 |
target, |
| 1640 |
type, |
| 1641 |
handler, |
| 1642 |
options |
| 1643 |
}); |
| 1644 |
} |
| 1645 |
} |
| 1646 |
]); |
| 1647 |
}(); |
| 1648 |
|
| 1649 |
//#endregion |
| 1650 |
//#region app/assets/js/event-track/dashboard/navigation.js |
| 1651 |
function _callSuper$5(t, o, e) { |
| 1652 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 1653 |
} |
| 1654 |
__name(_callSuper$5, "_callSuper"); |
| 1655 |
function _isNativeReflectConstruct$5() { |
| 1656 |
try { |
| 1657 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 1658 |
} catch (t) {} |
| 1659 |
return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() { |
| 1660 |
return !!t; |
| 1661 |
})(); |
| 1662 |
} |
| 1663 |
__name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct"); |
| 1664 |
var ELEMENTOR_MENU_SELECTORS = { |
| 1665 |
ELEMENTOR_TOP_LEVEL: "li#toplevel_page_elementor", |
| 1666 |
TEMPLATES_TOP_LEVEL: "li#menu-posts-elementor_library", |
| 1667 |
ELEMENTOR_HOME_TOP_LEVEL: "li#toplevel_page_elementor-home", |
| 1668 |
ADMIN_MENU: "#adminmenu", |
| 1669 |
TOP_LEVEL_LINK: ".wp-menu-name", |
| 1670 |
SUBMENU_CONTAINER: ".wp-submenu", |
| 1671 |
SUBMENU_ITEM: ".wp-submenu li a", |
| 1672 |
SUBMENU_ITEM_TOP_LEVEL: ".wp-has-submenu", |
| 1673 |
SIDEBAR_NAVIGATION: "#editor-one-sidebar-navigation" |
| 1674 |
}; |
| 1675 |
var NavigationTracking = /*#__PURE__*/ function(_BaseTracking) { |
| 1676 |
function NavigationTracking() { |
| 1677 |
_classCallCheck(this, NavigationTracking); |
| 1678 |
return _callSuper$5(this, NavigationTracking, arguments); |
| 1679 |
} |
| 1680 |
_inherits(NavigationTracking, _BaseTracking); |
| 1681 |
return _createClass(NavigationTracking, null, [ |
| 1682 |
{ |
| 1683 |
key: "init", |
| 1684 |
value: function init() { |
| 1685 |
if (WpDashboardTracking.isEditorOneActive()) { |
| 1686 |
this.attachSidebarNavigationTracking(); |
| 1687 |
this.attachElementorHomeMenuTracking(); |
| 1688 |
} else { |
| 1689 |
this.attachElementorMenuTracking(); |
| 1690 |
this.attachTemplatesMenuTracking(); |
| 1691 |
} |
| 1692 |
} |
| 1693 |
}, |
| 1694 |
{ |
| 1695 |
key: "attachTemplatesMenuTracking", |
| 1696 |
value: function attachTemplatesMenuTracking() { |
| 1697 |
var templatesMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.TEMPLATES_TOP_LEVEL); |
| 1698 |
if (!templatesMenu) return; |
| 1699 |
this.attachMenuTracking(templatesMenu, "Templates"); |
| 1700 |
} |
| 1701 |
}, |
| 1702 |
{ |
| 1703 |
key: "attachElementorHomeMenuTracking", |
| 1704 |
value: function attachElementorHomeMenuTracking() { |
| 1705 |
var elementorHomeMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_HOME_TOP_LEVEL); |
| 1706 |
if (!elementorHomeMenu) return; |
| 1707 |
this.attachMenuTracking(elementorHomeMenu, "Elementor"); |
| 1708 |
} |
| 1709 |
}, |
| 1710 |
{ |
| 1711 |
key: "attachElementorMenuTracking", |
| 1712 |
value: function attachElementorMenuTracking() { |
| 1713 |
var elementorMenu = document.querySelector(ELEMENTOR_MENU_SELECTORS.ELEMENTOR_TOP_LEVEL); |
| 1714 |
if (!elementorMenu) return; |
| 1715 |
this.attachMenuTracking(elementorMenu, "Elementor"); |
| 1716 |
} |
| 1717 |
}, |
| 1718 |
{ |
| 1719 |
key: "attachSidebarNavigationTracking", |
| 1720 |
value: function attachSidebarNavigationTracking() { |
| 1721 |
var sidebar = document.querySelector(ELEMENTOR_MENU_SELECTORS.SIDEBAR_NAVIGATION); |
| 1722 |
if (sidebar) this.attachSidebarClickListener(sidebar); |
| 1723 |
} |
| 1724 |
}, |
| 1725 |
{ |
| 1726 |
key: "attachSidebarClickListener", |
| 1727 |
value: function attachSidebarClickListener(sidebar) { |
| 1728 |
var _this = this; |
| 1729 |
this.addEventListenerTracked(sidebar, "click", function(event) { |
| 1730 |
_this.handleSidebarClick(event); |
| 1731 |
}, { capture: true }); |
| 1732 |
} |
| 1733 |
}, |
| 1734 |
{ |
| 1735 |
key: "attachMenuTracking", |
| 1736 |
value: function attachMenuTracking(menuElement, menuName) { |
| 1737 |
var _this2 = this; |
| 1738 |
this.addEventListenerTracked(menuElement, "click", function(event) { |
| 1739 |
_this2.handleMenuClick(event, menuName); |
| 1740 |
}); |
| 1741 |
} |
| 1742 |
}, |
| 1743 |
{ |
| 1744 |
key: "handleMenuClick", |
| 1745 |
value: function handleMenuClick(event, menuName) { |
| 1746 |
var link = event.target.closest("a"); |
| 1747 |
if (!link) return; |
| 1748 |
var isTopLevel = link.classList.contains("menu-top"); |
| 1749 |
var itemId = this.extractItemId(link); |
| 1750 |
var area = this.determineNavArea(link); |
| 1751 |
WpDashboardTracking.trackNavClicked(itemId, isTopLevel ? null : menuName, area); |
| 1752 |
} |
| 1753 |
}, |
| 1754 |
{ |
| 1755 |
key: "handleSidebarClick", |
| 1756 |
value: function handleSidebarClick(event) { |
| 1757 |
var clickedElement = event.target.closest("a, button, [role=\"button\"]"); |
| 1758 |
if (!clickedElement) return; |
| 1759 |
var itemId = this.extractSidebarItemId(clickedElement); |
| 1760 |
WpDashboardTracking.trackNavClicked(itemId, null, NAV_AREAS.SIDEBAR_MENU); |
| 1761 |
} |
| 1762 |
}, |
| 1763 |
{ |
| 1764 |
key: "extractSidebarItemId", |
| 1765 |
value: function extractSidebarItemId(element) { |
| 1766 |
var paragraph = element.querySelector("p"); |
| 1767 |
if (paragraph) return paragraph.textContent.trim(); |
| 1768 |
var textContent = element.textContent.trim(); |
| 1769 |
if (textContent) return textContent; |
| 1770 |
return "unknown"; |
| 1771 |
} |
| 1772 |
}, |
| 1773 |
{ |
| 1774 |
key: "extractPageFromUrl", |
| 1775 |
value: function extractPageFromUrl(href) { |
| 1776 |
var urlParams = new URLSearchParams(href.split("?")[1] || ""); |
| 1777 |
var page = urlParams.get("page"); |
| 1778 |
if (page) return page; |
| 1779 |
var postType = urlParams.get("post_type"); |
| 1780 |
if (postType) return postType; |
| 1781 |
return "unknown"; |
| 1782 |
} |
| 1783 |
}, |
| 1784 |
{ |
| 1785 |
key: "extractItemId", |
| 1786 |
value: function extractItemId(link) { |
| 1787 |
var textContent = link.textContent.trim(); |
| 1788 |
if (textContent) return textContent; |
| 1789 |
var href = link.getAttribute("href"); |
| 1790 |
if (href) return this.extractPageFromUrl(href); |
| 1791 |
var linkId = link.getAttribute("id"); |
| 1792 |
if (linkId) return linkId; |
| 1793 |
return "unknown"; |
| 1794 |
} |
| 1795 |
}, |
| 1796 |
{ |
| 1797 |
key: "determineNavArea", |
| 1798 |
value: function determineNavArea(link) { |
| 1799 |
if (link.closest("li.menu-top")) { |
| 1800 |
if (link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_CONTAINER)) { |
| 1801 |
if (link.closest(ELEMENTOR_MENU_SELECTORS.SUBMENU_ITEM_TOP_LEVEL).classList.contains("wp-not-current-submenu")) return NAV_AREAS.HOVER_MENU; |
| 1802 |
return NAV_AREAS.SUBMENU; |
| 1803 |
} |
| 1804 |
return NAV_AREAS.LEFT_MENU; |
| 1805 |
} |
| 1806 |
return NAV_AREAS.LEFT_MENU; |
| 1807 |
} |
| 1808 |
} |
| 1809 |
]); |
| 1810 |
}(BaseTracking); |
| 1811 |
|
| 1812 |
//#endregion |
| 1813 |
//#region app/assets/js/event-track/dashboard/plugin-actions.js |
| 1814 |
function _callSuper$4(t, o, e) { |
| 1815 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 1816 |
} |
| 1817 |
__name(_callSuper$4, "_callSuper"); |
| 1818 |
function _isNativeReflectConstruct$4() { |
| 1819 |
try { |
| 1820 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 1821 |
} catch (t) {} |
| 1822 |
return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { |
| 1823 |
return !!t; |
| 1824 |
})(); |
| 1825 |
} |
| 1826 |
__name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct"); |
| 1827 |
var PLUGIN_TYPE = { |
| 1828 |
ELEMENTOR: "core", |
| 1829 |
ELEMENTOR_PRO: "pro" |
| 1830 |
}; |
| 1831 |
var PluginActions = /*#__PURE__*/ function(_BaseTracking) { |
| 1832 |
function PluginActions() { |
| 1833 |
_classCallCheck(this, PluginActions); |
| 1834 |
return _callSuper$4(this, PluginActions, arguments); |
| 1835 |
} |
| 1836 |
_inherits(PluginActions, _BaseTracking); |
| 1837 |
return _createClass(PluginActions, null, [ |
| 1838 |
{ |
| 1839 |
key: "init", |
| 1840 |
value: function init() { |
| 1841 |
this.attachCoreDeactivationTracking(); |
| 1842 |
this.attachProDeactivationTracking(); |
| 1843 |
this.attachProDeletionTracking(); |
| 1844 |
} |
| 1845 |
}, |
| 1846 |
{ |
| 1847 |
key: "attachCoreDeactivationTracking", |
| 1848 |
value: function attachCoreDeactivationTracking() { |
| 1849 |
var _this = this; |
| 1850 |
var dialogForm = document.querySelector("#elementor-deactivate-feedback-dialog-form"); |
| 1851 |
if (!dialogForm) return; |
| 1852 |
this.addEventListenerTracked(dialogForm, "change", function(event) { |
| 1853 |
var target = event.target; |
| 1854 |
if (target.classList.contains("elementor-deactivate-feedback-dialog-input")) _this.selectedReason = target.value; |
| 1855 |
}); |
| 1856 |
this.observeModalButtons(); |
| 1857 |
} |
| 1858 |
}, |
| 1859 |
{ |
| 1860 |
key: "attachProDeactivationTracking", |
| 1861 |
value: function attachProDeactivationTracking() { |
| 1862 |
var _this2 = this; |
| 1863 |
var pluginsTable = document.querySelector(".plugins"); |
| 1864 |
if (!pluginsTable) return; |
| 1865 |
this.addEventListenerTracked(pluginsTable, "click", function(event) { |
| 1866 |
var link = event.target.closest("a"); |
| 1867 |
if (link && "deactivate-elementor-pro" === link.id) _this2.trackProDeactivation(); |
| 1868 |
}, { capture: true }); |
| 1869 |
} |
| 1870 |
}, |
| 1871 |
{ |
| 1872 |
key: "observeModalButtons", |
| 1873 |
value: function observeModalButtons() { |
| 1874 |
var _this3 = this; |
| 1875 |
var checkAndAttachDelegation = function checkAndAttachDelegation() { |
| 1876 |
var modal = document.querySelector("#elementor-deactivate-feedback-modal"); |
| 1877 |
if (!modal) return false; |
| 1878 |
_this3.addEventListenerTracked(modal, "click", function(event) { |
| 1879 |
var submitButton = event.target.closest(".dialog-submit"); |
| 1880 |
var skipButton = event.target.closest(".dialog-skip"); |
| 1881 |
if (submitButton) _this3.trackCoreDeactivation("submit&deactivate"); |
| 1882 |
else if (skipButton) _this3.trackCoreDeactivation("skip&deactivate"); |
| 1883 |
}, { capture: true }); |
| 1884 |
return true; |
| 1885 |
}; |
| 1886 |
if (checkAndAttachDelegation()) return; |
| 1887 |
this.addObserver(document.body, { |
| 1888 |
childList: true, |
| 1889 |
subtree: true |
| 1890 |
}, function(mutations, observer) { |
| 1891 |
if (checkAndAttachDelegation()) observer.disconnect(); |
| 1892 |
}); |
| 1893 |
} |
| 1894 |
}, |
| 1895 |
{ |
| 1896 |
key: "getUserInput", |
| 1897 |
value: function getUserInput() { |
| 1898 |
if (!this.selectedReason || !["found_a_better_plugin", "other"].includes(this.selectedReason)) return null; |
| 1899 |
var inputField = document.querySelector("input[name=\"reason_".concat(this.selectedReason, "\"]")); |
| 1900 |
if (inputField && inputField.value) return inputField.value; |
| 1901 |
return null; |
| 1902 |
} |
| 1903 |
}, |
| 1904 |
{ |
| 1905 |
key: "trackCoreDeactivation", |
| 1906 |
value: function trackCoreDeactivation(action) { |
| 1907 |
var properties = { |
| 1908 |
deactivate_form_submit: action, |
| 1909 |
deactivate_plugin_type: PLUGIN_TYPE.ELEMENTOR |
| 1910 |
}; |
| 1911 |
if (this.selectedReason) properties.deactivate_feedback_reason = this.selectedReason; |
| 1912 |
var userInput = this.getUserInput(); |
| 1913 |
if (userInput) properties.deactivate_feedback_reason += "/".concat(userInput); |
| 1914 |
WpDashboardTracking.dispatchEvent("wpdash_deactivate_plugin", properties, { send_immediately: true }); |
| 1915 |
} |
| 1916 |
}, |
| 1917 |
{ |
| 1918 |
key: "trackProDeactivation", |
| 1919 |
value: function trackProDeactivation() { |
| 1920 |
this.trackProAction("deactivate"); |
| 1921 |
} |
| 1922 |
}, |
| 1923 |
{ |
| 1924 |
key: "attachProDeletionTracking", |
| 1925 |
value: function attachProDeletionTracking() { |
| 1926 |
var _this4 = this; |
| 1927 |
if ("undefined" === typeof jQuery) return; |
| 1928 |
jQuery(document).on("wp-plugin-deleting", function(event, args) { |
| 1929 |
if ("elementor-pro" === (args === null || args === void 0 ? void 0 : args.slug)) _this4.trackProAction("delete"); |
| 1930 |
}); |
| 1931 |
} |
| 1932 |
}, |
| 1933 |
{ |
| 1934 |
key: "destroy", |
| 1935 |
value: function destroy() { |
| 1936 |
if ("undefined" !== typeof jQuery) jQuery(document).off("wp-plugin-deleting"); |
| 1937 |
BaseTracking.destroy.call(this); |
| 1938 |
} |
| 1939 |
}, |
| 1940 |
{ |
| 1941 |
key: "trackProAction", |
| 1942 |
value: function trackProAction(action) { |
| 1943 |
var config = { |
| 1944 |
deactivate: { |
| 1945 |
eventName: "wpdash_deactivate_plugin", |
| 1946 |
propertyKey: "deactivate_plugin_type" |
| 1947 |
}, |
| 1948 |
delete: { |
| 1949 |
eventName: "wpdash_delete_plugin", |
| 1950 |
propertyKey: "plugin_delete" |
| 1951 |
} |
| 1952 |
}[action]; |
| 1953 |
if (!config) return; |
| 1954 |
var properties = _defineProperty({}, config.propertyKey, PLUGIN_TYPE.ELEMENTOR_PRO); |
| 1955 |
WpDashboardTracking.dispatchEvent(config.eventName, properties, { send_immediately: true }); |
| 1956 |
} |
| 1957 |
} |
| 1958 |
]); |
| 1959 |
}(BaseTracking); |
| 1960 |
_defineProperty(PluginActions, "selectedReason", null); |
| 1961 |
|
| 1962 |
//#endregion |
| 1963 |
//#region app/assets/js/event-track/dashboard/promotion.js |
| 1964 |
function _callSuper$3(t, o, e) { |
| 1965 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 1966 |
} |
| 1967 |
__name(_callSuper$3, "_callSuper"); |
| 1968 |
function _isNativeReflectConstruct$3() { |
| 1969 |
try { |
| 1970 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 1971 |
} catch (t) {} |
| 1972 |
return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { |
| 1973 |
return !!t; |
| 1974 |
})(); |
| 1975 |
} |
| 1976 |
__name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct"); |
| 1977 |
var PROMO_SELECTORS = { |
| 1978 |
PROMO_PAGE: ".e-feature-promotion, .elementor-settings-form-page, #elementor-element-manager-wrap", |
| 1979 |
PROMO_BLANK_STATE: ".elementor-blank_state", |
| 1980 |
CTA_BUTTON: ".go-pro", |
| 1981 |
TITLE: "h3" |
| 1982 |
}; |
| 1983 |
var PromotionTracking = /*#__PURE__*/ function(_BaseTracking) { |
| 1984 |
function PromotionTracking() { |
| 1985 |
_classCallCheck(this, PromotionTracking); |
| 1986 |
return _callSuper$3(this, PromotionTracking, arguments); |
| 1987 |
} |
| 1988 |
_inherits(PromotionTracking, _BaseTracking); |
| 1989 |
return _createClass(PromotionTracking, null, [ |
| 1990 |
{ |
| 1991 |
key: "init", |
| 1992 |
value: function init() { |
| 1993 |
this.attachDelegatedTracking(); |
| 1994 |
} |
| 1995 |
}, |
| 1996 |
{ |
| 1997 |
key: "attachDelegatedTracking", |
| 1998 |
value: function attachDelegatedTracking() { |
| 1999 |
var _this = this; |
| 2000 |
this.addEventListenerTracked(document, "click", function(event) { |
| 2001 |
var target = event.target; |
| 2002 |
if (!target) return; |
| 2003 |
var button = target.closest("a".concat(PROMO_SELECTORS.CTA_BUTTON)); |
| 2004 |
if (!button) return; |
| 2005 |
var promoPage = button.closest("".concat(PROMO_SELECTORS.PROMO_PAGE, ", ").concat(PROMO_SELECTORS.PROMO_BLANK_STATE)); |
| 2006 |
if (!promoPage) return; |
| 2007 |
_this.handlePromoClick(button, promoPage); |
| 2008 |
}, { capture: true }); |
| 2009 |
} |
| 2010 |
}, |
| 2011 |
{ |
| 2012 |
key: "handlePromoClick", |
| 2013 |
value: function handlePromoClick(button, promoPage) { |
| 2014 |
var promoTitle = this.extractPromoTitle(promoPage, button); |
| 2015 |
var destination = button.getAttribute("href"); |
| 2016 |
var path = this.extractPromoPath(); |
| 2017 |
WpDashboardTracking.trackPromoClicked(promoTitle, destination, path); |
| 2018 |
} |
| 2019 |
}, |
| 2020 |
{ |
| 2021 |
key: "extractPromoTitle", |
| 2022 |
value: function extractPromoTitle(promoPage, button) { |
| 2023 |
var titleElement = promoPage.querySelector(PROMO_SELECTORS.TITLE); |
| 2024 |
return titleElement ? titleElement.textContent.trim() : button.textContent.trim(); |
| 2025 |
} |
| 2026 |
}, |
| 2027 |
{ |
| 2028 |
key: "extractPromoPath", |
| 2029 |
value: function extractPromoPath() { |
| 2030 |
var page = new URLSearchParams(window.location.search).get("page"); |
| 2031 |
if (!page) return "elementor"; |
| 2032 |
return page.replace("elementor_", "").replace(/_/g, "/"); |
| 2033 |
} |
| 2034 |
} |
| 2035 |
]); |
| 2036 |
}(BaseTracking); |
| 2037 |
|
| 2038 |
//#endregion |
| 2039 |
//#region app/assets/js/event-track/dashboard/utils.js |
| 2040 |
var DashboardUtils = { isElementorPage: function isElementorPage() { |
| 2041 |
var urlParams = new URLSearchParams(window.location.search); |
| 2042 |
var page = urlParams.get("page"); |
| 2043 |
if (page && WpDashboardTracking.elementorPages.some(function(p) { |
| 2044 |
return page.includes(p); |
| 2045 |
})) return true; |
| 2046 |
var postType = urlParams.get("post_type"); |
| 2047 |
if (WpDashboardTracking.elementorPostTypes.includes(postType)) return true; |
| 2048 |
return document.body.className.split(" ").some(function(cls) { |
| 2049 |
return cls.includes("elementor") && (cls.includes("page") || cls.includes("post-type")); |
| 2050 |
}); |
| 2051 |
} }; |
| 2052 |
|
| 2053 |
//#endregion |
| 2054 |
//#region app/assets/js/event-track/dashboard/screen-view.js |
| 2055 |
function _createForOfIteratorHelper$1(r, e) { |
| 2056 |
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 2057 |
if (!t) { |
| 2058 |
if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { |
| 2059 |
t && (r = t); |
| 2060 |
var _n = 0; |
| 2061 |
var F = function F() {}; |
| 2062 |
return { |
| 2063 |
s: F, |
| 2064 |
n: function n() { |
| 2065 |
return _n >= r.length ? { done: !0 } : { |
| 2066 |
done: !1, |
| 2067 |
value: r[_n++] |
| 2068 |
}; |
| 2069 |
}, |
| 2070 |
e: function e(r) { |
| 2071 |
throw r; |
| 2072 |
}, |
| 2073 |
f: F |
| 2074 |
}; |
| 2075 |
} |
| 2076 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 2077 |
} |
| 2078 |
var o; |
| 2079 |
var a = !0; |
| 2080 |
var u = !1; |
| 2081 |
return { |
| 2082 |
s: function s() { |
| 2083 |
t = t.call(r); |
| 2084 |
}, |
| 2085 |
n: function n() { |
| 2086 |
var r = t.next(); |
| 2087 |
return a = r.done, r; |
| 2088 |
}, |
| 2089 |
e: function e(r) { |
| 2090 |
u = !0, o = r; |
| 2091 |
}, |
| 2092 |
f: function f() { |
| 2093 |
try { |
| 2094 |
a || null == t.return || t.return(); |
| 2095 |
} finally { |
| 2096 |
if (u) throw o; |
| 2097 |
} |
| 2098 |
} |
| 2099 |
}; |
| 2100 |
} |
| 2101 |
__name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper"); |
| 2102 |
function _unsupportedIterableToArray$1(r, a) { |
| 2103 |
if (r) { |
| 2104 |
if ("string" == typeof r) return _arrayLikeToArray$1(r, a); |
| 2105 |
var t = {}.toString.call(r).slice(8, -1); |
| 2106 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; |
| 2107 |
} |
| 2108 |
} |
| 2109 |
__name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray"); |
| 2110 |
function _arrayLikeToArray$1(r, a) { |
| 2111 |
(null == a || a > r.length) && (a = r.length); |
| 2112 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 2113 |
return n; |
| 2114 |
} |
| 2115 |
__name(_arrayLikeToArray$1, "_arrayLikeToArray"); |
| 2116 |
function _callSuper$2(t, o, e) { |
| 2117 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 2118 |
} |
| 2119 |
__name(_callSuper$2, "_callSuper"); |
| 2120 |
function _isNativeReflectConstruct$2() { |
| 2121 |
try { |
| 2122 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 2123 |
} catch (t) {} |
| 2124 |
return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { |
| 2125 |
return !!t; |
| 2126 |
})(); |
| 2127 |
} |
| 2128 |
__name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct"); |
| 2129 |
function _superPropGet(t, o, e, r) { |
| 2130 |
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); |
| 2131 |
return 2 & r && "function" == typeof p ? function(t) { |
| 2132 |
return p.apply(e, t); |
| 2133 |
} : p; |
| 2134 |
} |
| 2135 |
var SCREEN_SELECTORS = { |
| 2136 |
NAV_TAB_WRAPPER: ".nav-tab-wrapper", |
| 2137 |
NAV_TAB: ".nav-tab", |
| 2138 |
NAV_TAB_ACTIVE: ".nav-tab-active", |
| 2139 |
SETTINGS_FORM_PAGE: ".elementor-settings-form-page", |
| 2140 |
SETTINGS_FORM_PAGE_ACTIVE: ".elementor-settings-form-page.elementor-active", |
| 2141 |
FLOATING_ELEMENTS_MODAL: "#elementor-new-floating-elements-modal", |
| 2142 |
TEMPLATE_DIALOG_MODAL: "#elementor-new-template-dialog-content" |
| 2143 |
}; |
| 2144 |
var TRACKED_MODALS = [SCREEN_SELECTORS.FLOATING_ELEMENTS_MODAL, SCREEN_SELECTORS.TEMPLATE_DIALOG_MODAL]; |
| 2145 |
var ScreenViewTracking = /*#__PURE__*/ function(_BaseTracking) { |
| 2146 |
function ScreenViewTracking() { |
| 2147 |
_classCallCheck(this, ScreenViewTracking); |
| 2148 |
return _callSuper$2(this, ScreenViewTracking, arguments); |
| 2149 |
} |
| 2150 |
_inherits(ScreenViewTracking, _BaseTracking); |
| 2151 |
return _createClass(ScreenViewTracking, null, [ |
| 2152 |
{ |
| 2153 |
key: "init", |
| 2154 |
value: function init() { |
| 2155 |
if (!DashboardUtils.isElementorPage()) return; |
| 2156 |
var screenData = this.getScreenData(); |
| 2157 |
if (screenData) this.trackScreen(screenData.screenId, screenData.screenType); |
| 2158 |
this.attachTabChangeTracking(); |
| 2159 |
} |
| 2160 |
}, |
| 2161 |
{ |
| 2162 |
key: "destroy", |
| 2163 |
value: function destroy() { |
| 2164 |
_superPropGet(ScreenViewTracking, "destroy", this, 2)([]); |
| 2165 |
this.trackedScreens.clear(); |
| 2166 |
} |
| 2167 |
}, |
| 2168 |
{ |
| 2169 |
key: "getScreenData", |
| 2170 |
value: function getScreenData() { |
| 2171 |
var urlParams = new URLSearchParams(window.location.search); |
| 2172 |
var page = urlParams.get("page"); |
| 2173 |
var postType = urlParams.get("post_type"); |
| 2174 |
var hash = window.location.hash; |
| 2175 |
var screenId = ""; |
| 2176 |
var screenType = ""; |
| 2177 |
if (page) screenId = page; |
| 2178 |
else if (postType) screenId = postType; |
| 2179 |
else screenId = this.getScreenIdFromBody(); |
| 2180 |
if (this.isElementorAppPage()) { |
| 2181 |
var appScreenData = this.getAppScreenData(hash); |
| 2182 |
if (appScreenData) return appScreenData; |
| 2183 |
} |
| 2184 |
var hasNavTabs = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); |
| 2185 |
var hasSettingsTabs = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE).length > 1; |
| 2186 |
if (hasNavTabs || hasSettingsTabs || hash && !this.isElementorAppPage()) { |
| 2187 |
screenType = SCREEN_TYPES.TAB; |
| 2188 |
if (hash) { |
| 2189 |
var tabId = hash.replace(/^#(tab-)?/, ""); |
| 2190 |
screenId = "".concat(screenId, "-").concat(tabId); |
| 2191 |
} else if (hasNavTabs) { |
| 2192 |
var activeTab = document.querySelector(SCREEN_SELECTORS.NAV_TAB_ACTIVE); |
| 2193 |
if (activeTab) { |
| 2194 |
var tabText = activeTab.textContent.trim(); |
| 2195 |
var tabHref = activeTab.getAttribute("href"); |
| 2196 |
if (tabText) screenId = "".concat(screenId, "-").concat(this.sanitizeScreenId(tabText)); |
| 2197 |
else if (tabHref && tabHref.includes("#")) { |
| 2198 |
var _tabId = tabHref.split("#")[1]; |
| 2199 |
screenId = "".concat(screenId, "-").concat(_tabId); |
| 2200 |
} |
| 2201 |
} |
| 2202 |
} else if (hasSettingsTabs) { |
| 2203 |
var activeSettingsTab = document.querySelector(SCREEN_SELECTORS.SETTINGS_FORM_PAGE_ACTIVE); |
| 2204 |
if (activeSettingsTab) { |
| 2205 |
var _tabId2 = activeSettingsTab.id; |
| 2206 |
if (_tabId2) screenId = "".concat(screenId, "-").concat(_tabId2); |
| 2207 |
} |
| 2208 |
} |
| 2209 |
} |
| 2210 |
return { |
| 2211 |
screenId, |
| 2212 |
screenType |
| 2213 |
}; |
| 2214 |
} |
| 2215 |
}, |
| 2216 |
{ |
| 2217 |
key: "isElementorAppPage", |
| 2218 |
value: function isElementorAppPage() { |
| 2219 |
return "elementor-app" === new URLSearchParams(window.location.search).get("page"); |
| 2220 |
} |
| 2221 |
}, |
| 2222 |
{ |
| 2223 |
key: "getAppScreenData", |
| 2224 |
value: function getAppScreenData(hash) { |
| 2225 |
if (!hash) return null; |
| 2226 |
var cleanHash = hash.replace(/^#/, ""); |
| 2227 |
if (!cleanHash.startsWith("/")) return null; |
| 2228 |
var pathParts = cleanHash.split("/").filter(Boolean); |
| 2229 |
if (0 === pathParts.length) return null; |
| 2230 |
return { |
| 2231 |
screenId: pathParts.join("/"), |
| 2232 |
screenType: SCREEN_TYPES.APP_SCREEN |
| 2233 |
}; |
| 2234 |
} |
| 2235 |
}, |
| 2236 |
{ |
| 2237 |
key: "getScreenIdFromBody", |
| 2238 |
value: function getScreenIdFromBody() { |
| 2239 |
var _iterator = _createForOfIteratorHelper$1(document.body.className.split(" ")); |
| 2240 |
var _step; |
| 2241 |
try { |
| 2242 |
for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 2243 |
var cls = _step.value; |
| 2244 |
if (cls.startsWith("elementor") && (cls.includes("page") || cls.includes("post-type"))) return cls; |
| 2245 |
} |
| 2246 |
} catch (err) { |
| 2247 |
_iterator.e(err); |
| 2248 |
} finally { |
| 2249 |
_iterator.f(); |
| 2250 |
} |
| 2251 |
return "elementor-unknown"; |
| 2252 |
} |
| 2253 |
}, |
| 2254 |
{ |
| 2255 |
key: "sanitizeScreenId", |
| 2256 |
value: function sanitizeScreenId(text) { |
| 2257 |
return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, ""); |
| 2258 |
} |
| 2259 |
}, |
| 2260 |
{ |
| 2261 |
key: "attachTabChangeTracking", |
| 2262 |
value: function attachTabChangeTracking() { |
| 2263 |
this.attachNavTabTracking(); |
| 2264 |
this.attachHashChangeTracking(); |
| 2265 |
this.attachSettingsTabTracking(); |
| 2266 |
this.attachModalTracking(); |
| 2267 |
} |
| 2268 |
}, |
| 2269 |
{ |
| 2270 |
key: "attachNavTabTracking", |
| 2271 |
value: function attachNavTabTracking() { |
| 2272 |
var _this = this; |
| 2273 |
var wrapper = document.querySelector(SCREEN_SELECTORS.NAV_TAB_WRAPPER); |
| 2274 |
if (!wrapper) return; |
| 2275 |
this.addEventListenerTracked(wrapper, "click", function(event) { |
| 2276 |
var navTab = event.target.closest(SCREEN_SELECTORS.NAV_TAB); |
| 2277 |
if (navTab && !navTab.classList.contains("nav-tab-active")) { |
| 2278 |
var screenData = _this.getScreenData(); |
| 2279 |
if (screenData) _this.trackScreen(screenData.screenId, screenData.screenType); |
| 2280 |
} |
| 2281 |
}); |
| 2282 |
} |
| 2283 |
}, |
| 2284 |
{ |
| 2285 |
key: "attachHashChangeTracking", |
| 2286 |
value: function attachHashChangeTracking() { |
| 2287 |
var _this2 = this; |
| 2288 |
this.addEventListenerTracked(window, "hashchange", function() { |
| 2289 |
var screenData = _this2.getScreenData(); |
| 2290 |
if (screenData) _this2.trackScreen(screenData.screenId, screenData.screenType); |
| 2291 |
}); |
| 2292 |
} |
| 2293 |
}, |
| 2294 |
{ |
| 2295 |
key: "attachSettingsTabTracking", |
| 2296 |
value: function attachSettingsTabTracking() { |
| 2297 |
var _this3 = this; |
| 2298 |
var settingsPages = document.querySelectorAll(SCREEN_SELECTORS.SETTINGS_FORM_PAGE); |
| 2299 |
if (0 === settingsPages.length) return; |
| 2300 |
settingsPages.forEach(function(page) { |
| 2301 |
_this3.addObserver(page, { |
| 2302 |
attributes: true, |
| 2303 |
attributeFilter: ["class"] |
| 2304 |
}, function() { |
| 2305 |
var screenData = _this3.getScreenData(); |
| 2306 |
if (screenData) _this3.trackScreen(screenData.screenId, screenData.screenType); |
| 2307 |
}); |
| 2308 |
}); |
| 2309 |
} |
| 2310 |
}, |
| 2311 |
{ |
| 2312 |
key: "attachModalTracking", |
| 2313 |
value: function attachModalTracking() { |
| 2314 |
var _this4 = this; |
| 2315 |
this.addObserver(document.body, { |
| 2316 |
childList: true, |
| 2317 |
subtree: true |
| 2318 |
}, function(mutations) { |
| 2319 |
var _iterator2 = _createForOfIteratorHelper$1(mutations); |
| 2320 |
var _step2; |
| 2321 |
try { |
| 2322 |
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) if ("childList" === _step2.value.type) TRACKED_MODALS.forEach(function(modalSelector) { |
| 2323 |
var modal = document.querySelector(modalSelector); |
| 2324 |
if (modal && _this4.isModalVisible(modal)) { |
| 2325 |
var modalId = modalSelector.replace("#", ""); |
| 2326 |
_this4.trackScreen(modalId, SCREEN_TYPES.POPUP); |
| 2327 |
} |
| 2328 |
}); |
| 2329 |
} catch (err) { |
| 2330 |
_iterator2.e(err); |
| 2331 |
} finally { |
| 2332 |
_iterator2.f(); |
| 2333 |
} |
| 2334 |
}); |
| 2335 |
} |
| 2336 |
}, |
| 2337 |
{ |
| 2338 |
key: "isModalVisible", |
| 2339 |
value: function isModalVisible(element) { |
| 2340 |
if (!element) return false; |
| 2341 |
var style = window.getComputedStyle(element); |
| 2342 |
return "none" !== style.display && 0 !== parseFloat(style.opacity); |
| 2343 |
} |
| 2344 |
}, |
| 2345 |
{ |
| 2346 |
key: "trackScreen", |
| 2347 |
value: function trackScreen(screenId) { |
| 2348 |
var screenType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : SCREEN_TYPES.TOP_LEVEL_PAGE; |
| 2349 |
var trackingKey = "".concat(screenId, "-").concat(screenType); |
| 2350 |
if (this.trackedScreens.has(trackingKey)) return; |
| 2351 |
this.trackedScreens.add(trackingKey); |
| 2352 |
WpDashboardTracking.trackScreenViewed(screenId, screenType); |
| 2353 |
} |
| 2354 |
} |
| 2355 |
]); |
| 2356 |
}(BaseTracking); |
| 2357 |
_defineProperty(ScreenViewTracking, "trackedScreens", /* @__PURE__ */ new Set()); |
| 2358 |
|
| 2359 |
//#endregion |
| 2360 |
//#region app/assets/js/event-track/dashboard/menu-promotion.js |
| 2361 |
function _callSuper$1(t, o, e) { |
| 2362 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 2363 |
} |
| 2364 |
__name(_callSuper$1, "_callSuper"); |
| 2365 |
function _isNativeReflectConstruct$1() { |
| 2366 |
try { |
| 2367 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 2368 |
} catch (t) {} |
| 2369 |
return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { |
| 2370 |
return !!t; |
| 2371 |
})(); |
| 2372 |
} |
| 2373 |
__name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct"); |
| 2374 |
var PROMO_MENU_ITEMS = { |
| 2375 |
go_elementor_pro: "Upgrade", |
| 2376 |
"elementor-one-upgrade": "Upgrade" |
| 2377 |
}; |
| 2378 |
var MenuPromotionTracking = /*#__PURE__*/ function(_BaseTracking) { |
| 2379 |
function MenuPromotionTracking() { |
| 2380 |
_classCallCheck(this, MenuPromotionTracking); |
| 2381 |
return _callSuper$1(this, MenuPromotionTracking, arguments); |
| 2382 |
} |
| 2383 |
_inherits(MenuPromotionTracking, _BaseTracking); |
| 2384 |
return _createClass(MenuPromotionTracking, null, [ |
| 2385 |
{ |
| 2386 |
key: "init", |
| 2387 |
value: function init() { |
| 2388 |
this.attachDelegatedTracking(); |
| 2389 |
} |
| 2390 |
}, |
| 2391 |
{ |
| 2392 |
key: "attachDelegatedTracking", |
| 2393 |
value: function attachDelegatedTracking() { |
| 2394 |
var _this = this; |
| 2395 |
this.addEventListenerTracked(document, "click", function(event) { |
| 2396 |
var target = event.target; |
| 2397 |
if (!target) return; |
| 2398 |
var link = target.closest("a"); |
| 2399 |
if (!link) return; |
| 2400 |
var href = link.getAttribute("href"); |
| 2401 |
if (!href) return; |
| 2402 |
var menuItemKey = _this.extractPromoMenuKey(href); |
| 2403 |
if (!menuItemKey) return; |
| 2404 |
_this.handleMenuPromoClick(link, menuItemKey); |
| 2405 |
}, { capture: true }); |
| 2406 |
} |
| 2407 |
}, |
| 2408 |
{ |
| 2409 |
key: "extractPromoMenuKey", |
| 2410 |
value: function extractPromoMenuKey(href) { |
| 2411 |
for (var _i = 0, _Object$keys = Object.keys(PROMO_MENU_ITEMS); _i < _Object$keys.length; _i++) { |
| 2412 |
var menuItemKey = _Object$keys[_i]; |
| 2413 |
if (href.includes("page=".concat(menuItemKey))) return menuItemKey; |
| 2414 |
} |
| 2415 |
return null; |
| 2416 |
} |
| 2417 |
}, |
| 2418 |
{ |
| 2419 |
key: "handleMenuPromoClick", |
| 2420 |
value: function handleMenuPromoClick(menuItem, menuItemKey) { |
| 2421 |
var destination = menuItem.getAttribute("href"); |
| 2422 |
var promoName = PROMO_MENU_ITEMS[menuItemKey]; |
| 2423 |
var path = menuItemKey.replace("elementor_", "").replace(/_/g, "/"); |
| 2424 |
WpDashboardTracking.trackPromoClicked(promoName, destination, path); |
| 2425 |
} |
| 2426 |
} |
| 2427 |
]); |
| 2428 |
}(BaseTracking); |
| 2429 |
|
| 2430 |
//#endregion |
| 2431 |
//#region app/assets/js/event-track/dashboard/action-controls.js |
| 2432 |
function _createForOfIteratorHelper(r, e) { |
| 2433 |
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; |
| 2434 |
if (!t) { |
| 2435 |
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { |
| 2436 |
t && (r = t); |
| 2437 |
var _n = 0; |
| 2438 |
var F = function F() {}; |
| 2439 |
return { |
| 2440 |
s: F, |
| 2441 |
n: function n() { |
| 2442 |
return _n >= r.length ? { done: !0 } : { |
| 2443 |
done: !1, |
| 2444 |
value: r[_n++] |
| 2445 |
}; |
| 2446 |
}, |
| 2447 |
e: function e(r) { |
| 2448 |
throw r; |
| 2449 |
}, |
| 2450 |
f: F |
| 2451 |
}; |
| 2452 |
} |
| 2453 |
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); |
| 2454 |
} |
| 2455 |
var o; |
| 2456 |
var a = !0; |
| 2457 |
var u = !1; |
| 2458 |
return { |
| 2459 |
s: function s() { |
| 2460 |
t = t.call(r); |
| 2461 |
}, |
| 2462 |
n: function n() { |
| 2463 |
var r = t.next(); |
| 2464 |
return a = r.done, r; |
| 2465 |
}, |
| 2466 |
e: function e(r) { |
| 2467 |
u = !0, o = r; |
| 2468 |
}, |
| 2469 |
f: function f() { |
| 2470 |
try { |
| 2471 |
a || null == t.return || t.return(); |
| 2472 |
} finally { |
| 2473 |
if (u) throw o; |
| 2474 |
} |
| 2475 |
} |
| 2476 |
}; |
| 2477 |
} |
| 2478 |
function _unsupportedIterableToArray(r, a) { |
| 2479 |
if (r) { |
| 2480 |
if ("string" == typeof r) return _arrayLikeToArray(r, a); |
| 2481 |
var t = {}.toString.call(r).slice(8, -1); |
| 2482 |
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; |
| 2483 |
} |
| 2484 |
} |
| 2485 |
function _arrayLikeToArray(r, a) { |
| 2486 |
(null == a || a > r.length) && (a = r.length); |
| 2487 |
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; |
| 2488 |
return n; |
| 2489 |
} |
| 2490 |
function _callSuper(t, o, e) { |
| 2491 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 2492 |
} |
| 2493 |
function _isNativeReflectConstruct() { |
| 2494 |
try { |
| 2495 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 2496 |
} catch (t) {} |
| 2497 |
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { |
| 2498 |
return !!t; |
| 2499 |
})(); |
| 2500 |
} |
| 2501 |
var EXCLUDED_SELECTORS = { |
| 2502 |
ADMIN_MENU: "#adminmenu", |
| 2503 |
TOP_BAR: ".e-admin-top-bar", |
| 2504 |
TOP_BAR_EDITOR_ONE: "#editor-one-top-bar", |
| 2505 |
WP_ADMIN_BAR: "#wpadminbar", |
| 2506 |
SUBMENU: ".wp-submenu", |
| 2507 |
PROMO_PAGE: ".e-feature-promotion", |
| 2508 |
PROMO_BLANK_STATE: ".elementor-blank_state", |
| 2509 |
APP: ".e-app", |
| 2510 |
SIDEBAR_NAVIGATION: "#editor-one-sidebar-navigation", |
| 2511 |
FLYOUT_MENU: ".elementor-submenu-flyout" |
| 2512 |
}; |
| 2513 |
var ActionControlTracking = /*#__PURE__*/ function(_BaseTracking) { |
| 2514 |
function ActionControlTracking() { |
| 2515 |
_classCallCheck(this, ActionControlTracking); |
| 2516 |
return _callSuper(this, ActionControlTracking, arguments); |
| 2517 |
} |
| 2518 |
_inherits(ActionControlTracking, _BaseTracking); |
| 2519 |
return _createClass(ActionControlTracking, null, [ |
| 2520 |
{ |
| 2521 |
key: "init", |
| 2522 |
value: function init() { |
| 2523 |
if (!DashboardUtils.isElementorPage()) return; |
| 2524 |
this.attachDelegatedHandlers(); |
| 2525 |
this.addTrackingAttributesToFilterButtons(); |
| 2526 |
this.initializeLinkDataIds(); |
| 2527 |
} |
| 2528 |
}, |
| 2529 |
{ |
| 2530 |
key: "initializeLinkDataIds", |
| 2531 |
value: function initializeLinkDataIds() { |
| 2532 |
var _this = this; |
| 2533 |
var initializeLinks = function initializeLinks() { |
| 2534 |
document.querySelectorAll("a[href]").forEach(function(link) { |
| 2535 |
if (_this.isExcludedElement(link) || _this.isNavigationLink(link) || link.hasAttribute("data-id")) return; |
| 2536 |
var href = link.getAttribute("href"); |
| 2537 |
if (!href) return; |
| 2538 |
var cleanedHref = _this.removeNonceFromUrl(href); |
| 2539 |
if (cleanedHref) link.setAttribute("data-id", cleanedHref); |
| 2540 |
}); |
| 2541 |
}; |
| 2542 |
if ("loading" === document.readyState) document.addEventListener("DOMContentLoaded", initializeLinks); |
| 2543 |
else initializeLinks(); |
| 2544 |
} |
| 2545 |
}, |
| 2546 |
{ |
| 2547 |
key: "addTrackingAttributesToFilterButtons", |
| 2548 |
value: function addTrackingAttributesToFilterButtons() { |
| 2549 |
var body = document.body; |
| 2550 |
if (!body) return; |
| 2551 |
var screenPrefix = ""; |
| 2552 |
switch (true) { |
| 2553 |
case body.classList.contains("post-type-elementor_library"): |
| 2554 |
screenPrefix = "elementor_library-library"; |
| 2555 |
break; |
| 2556 |
case body.classList.contains("post-type-e-floating-buttons"): |
| 2557 |
screenPrefix = "e-floating-buttons"; |
| 2558 |
break; |
| 2559 |
default: return; |
| 2560 |
} |
| 2561 |
var addDataIdToListTableButtons = function addDataIdToListTableButtons() { |
| 2562 |
[ |
| 2563 |
{ |
| 2564 |
id: "post-query-submit", |
| 2565 |
suffix: "filter" |
| 2566 |
}, |
| 2567 |
{ |
| 2568 |
id: "search-submit", |
| 2569 |
suffix: "search" |
| 2570 |
}, |
| 2571 |
{ |
| 2572 |
id: "doaction", |
| 2573 |
suffix: "apply" |
| 2574 |
}, |
| 2575 |
{ |
| 2576 |
id: "doaction2", |
| 2577 |
suffix: "apply-bottom" |
| 2578 |
} |
| 2579 |
].forEach(function(config) { |
| 2580 |
var button = document.getElementById(config.id); |
| 2581 |
if (!button || button.hasAttribute("data-id")) return; |
| 2582 |
button.setAttribute("data-id", "".concat(screenPrefix, "-button-").concat(config.suffix)); |
| 2583 |
}); |
| 2584 |
}; |
| 2585 |
if ("loading" === document.readyState) document.addEventListener("DOMContentLoaded", addDataIdToListTableButtons); |
| 2586 |
else addDataIdToListTableButtons(); |
| 2587 |
} |
| 2588 |
}, |
| 2589 |
{ |
| 2590 |
key: "isExcludedElement", |
| 2591 |
value: function isExcludedElement(element) { |
| 2592 |
for (var _i = 0, _Object$values = Object.values(EXCLUDED_SELECTORS); _i < _Object$values.length; _i++) { |
| 2593 |
var selector = _Object$values[_i]; |
| 2594 |
if (element.closest(selector)) return true; |
| 2595 |
} |
| 2596 |
if (element.classList.contains("go-pro")) return true; |
| 2597 |
return false; |
| 2598 |
} |
| 2599 |
}, |
| 2600 |
{ |
| 2601 |
key: "attachDelegatedHandlers", |
| 2602 |
value: function attachDelegatedHandlers() { |
| 2603 |
var _this2 = this; |
| 2604 |
var FILTER_BUTTON_IDS = ["search-submit", "post-query-submit"]; |
| 2605 |
this.addEventListenerTracked(document, "click", function(event) { |
| 2606 |
var _event$target; |
| 2607 |
var base = event.target && 1 === event.target.nodeType ? event.target : (_event$target = event.target) === null || _event$target === void 0 ? void 0 : _event$target.parentElement; |
| 2608 |
if (!base) return; |
| 2609 |
var toggle = base.closest(".elementor-role-toggle"); |
| 2610 |
if (toggle && !_this2.isExcludedElement(toggle)) { |
| 2611 |
_this2.trackControl(toggle, CONTROL_TYPES.TOGGLE); |
| 2612 |
return; |
| 2613 |
} |
| 2614 |
var button = base.closest("button, input[type=\"submit\"], input[type=\"button\"], .button, .e-btn"); |
| 2615 |
if (button && !_this2.isExcludedElement(button)) { |
| 2616 |
if (FILTER_BUTTON_IDS.includes(button.id)) { |
| 2617 |
_this2.trackControl(button, CONTROL_TYPES.FILTER); |
| 2618 |
return; |
| 2619 |
} |
| 2620 |
_this2.trackControl(button, CONTROL_TYPES.BUTTON); |
| 2621 |
return; |
| 2622 |
} |
| 2623 |
var link = base.closest("a"); |
| 2624 |
if (link && !_this2.isExcludedElement(link) && !_this2.isNavigationLink(link)) _this2.trackControl(link, CONTROL_TYPES.LINK); |
| 2625 |
}, { capture: false }); |
| 2626 |
this.addEventListenerTracked(document, "change", function(event) { |
| 2627 |
var _event$target2; |
| 2628 |
var base = event.target && 1 === event.target.nodeType ? event.target : (_event$target2 = event.target) === null || _event$target2 === void 0 ? void 0 : _event$target2.parentElement; |
| 2629 |
if (!base) return; |
| 2630 |
var toggle = null; |
| 2631 |
if (WpDashboardTracking.isEditorOneActive()) toggle = base.closest(".MuiSwitch-switchBase"); |
| 2632 |
else toggle = base.closest(".components-toggle-control"); |
| 2633 |
if (toggle && !_this2.isExcludedElement(toggle)) { |
| 2634 |
_this2.trackControl(toggle, CONTROL_TYPES.TOGGLE); |
| 2635 |
return; |
| 2636 |
} |
| 2637 |
var checkbox = base.closest("input[type=\"checkbox\"]"); |
| 2638 |
if (checkbox && !_this2.isExcludedElement(checkbox)) { |
| 2639 |
_this2.trackControl(checkbox, CONTROL_TYPES.CHECKBOX); |
| 2640 |
return; |
| 2641 |
} |
| 2642 |
var radio = base.closest("input[type=\"radio\"]"); |
| 2643 |
if (radio && !_this2.isExcludedElement(radio)) { |
| 2644 |
_this2.trackControl(radio, CONTROL_TYPES.RADIO); |
| 2645 |
return; |
| 2646 |
} |
| 2647 |
var select = base.closest("select"); |
| 2648 |
if (select && !_this2.isExcludedElement(select)) _this2.trackControl(select, CONTROL_TYPES.SELECT); |
| 2649 |
}); |
| 2650 |
} |
| 2651 |
}, |
| 2652 |
{ |
| 2653 |
key: "isNavigationLink", |
| 2654 |
value: function isNavigationLink(link) { |
| 2655 |
var href = link.getAttribute("href"); |
| 2656 |
if (!href) return false; |
| 2657 |
if (href.startsWith("#") && href.includes("tab")) return true; |
| 2658 |
if (link.classList.contains("nav-tab")) return true; |
| 2659 |
return !!link.closest(".wp-submenu, #adminmenu, .e-admin-top-bar, #wpadminbar"); |
| 2660 |
} |
| 2661 |
}, |
| 2662 |
{ |
| 2663 |
key: "trackControl", |
| 2664 |
value: function trackControl(element, controlType) { |
| 2665 |
var controlIdentifier = this.extractControlIdentifier(element, controlType); |
| 2666 |
if (!controlIdentifier) return; |
| 2667 |
WpDashboardTracking.trackActionControl(controlIdentifier, controlType); |
| 2668 |
} |
| 2669 |
}, |
| 2670 |
{ |
| 2671 |
key: "extractControlIdentifier", |
| 2672 |
value: function extractControlIdentifier(element, controlType) { |
| 2673 |
if (CONTROL_TYPES.RADIO === controlType) { |
| 2674 |
var name = element.getAttribute("name"); |
| 2675 |
var value = element.value || element.getAttribute("value"); |
| 2676 |
if (name && value) return "".concat(name, "-").concat(value); |
| 2677 |
if (name) return name; |
| 2678 |
} |
| 2679 |
if (CONTROL_TYPES.SELECT === controlType) { |
| 2680 |
var _name = element.getAttribute("name"); |
| 2681 |
if (_name) return _name; |
| 2682 |
} |
| 2683 |
if (CONTROL_TYPES.CHECKBOX === controlType) { |
| 2684 |
var _name2 = element.getAttribute("name"); |
| 2685 |
if (_name2) { |
| 2686 |
if (document.querySelectorAll("input[type=\"checkbox\"][name=\"".concat(CSS.escape(_name2), "\"]")).length > 1) { |
| 2687 |
var _value = element.value || element.getAttribute("value"); |
| 2688 |
if (_value) return "".concat(_name2, "-").concat(_value); |
| 2689 |
} |
| 2690 |
return _name2; |
| 2691 |
} |
| 2692 |
} |
| 2693 |
if (CONTROL_TYPES.LINK === controlType) { |
| 2694 |
var dataId = element.getAttribute("data-id"); |
| 2695 |
if (dataId) return dataId; |
| 2696 |
var href = element.getAttribute("href"); |
| 2697 |
if (href) return this.removeNonceFromUrl(href); |
| 2698 |
} |
| 2699 |
if (CONTROL_TYPES.BUTTON === controlType || CONTROL_TYPES.TOGGLE === controlType || CONTROL_TYPES.FILTER === controlType) { |
| 2700 |
var _dataId = element.getAttribute("data-id"); |
| 2701 |
if (_dataId) return _dataId; |
| 2702 |
var classIdMatch = this.extractClassId(element); |
| 2703 |
if (classIdMatch) return classIdMatch; |
| 2704 |
} |
| 2705 |
return ""; |
| 2706 |
} |
| 2707 |
}, |
| 2708 |
{ |
| 2709 |
key: "extractClassId", |
| 2710 |
value: function extractClassId(element) { |
| 2711 |
var classes = element.className; |
| 2712 |
if (!classes || "string" !== typeof classes) return ""; |
| 2713 |
var _iterator = _createForOfIteratorHelper(classes.split(" ")); |
| 2714 |
var _step; |
| 2715 |
try { |
| 2716 |
for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 2717 |
var cls = _step.value; |
| 2718 |
if (cls.startsWith("e-id-")) return cls.substring(5); |
| 2719 |
} |
| 2720 |
} catch (err) { |
| 2721 |
_iterator.e(err); |
| 2722 |
} finally { |
| 2723 |
_iterator.f(); |
| 2724 |
} |
| 2725 |
return ""; |
| 2726 |
} |
| 2727 |
}, |
| 2728 |
{ |
| 2729 |
key: "removeNonceFromUrl", |
| 2730 |
value: function removeNonceFromUrl(url) { |
| 2731 |
try { |
| 2732 |
var urlObj = new URL(url, window.location.origin); |
| 2733 |
urlObj.searchParams.delete("_wpnonce"); |
| 2734 |
var postParam = urlObj.searchParams.get("post"); |
| 2735 |
if (postParam !== null && /^[0-9]+$/.test(postParam)) urlObj.searchParams.delete("post"); |
| 2736 |
return urlObj.pathname + urlObj.search + urlObj.hash; |
| 2737 |
} catch (e) { |
| 2738 |
return url; |
| 2739 |
} |
| 2740 |
} |
| 2741 |
} |
| 2742 |
]); |
| 2743 |
}(BaseTracking); |
| 2744 |
|
| 2745 |
//#endregion |
| 2746 |
//#region app/assets/js/event-track/wp-dashboard-tracking.js |
| 2747 |
var _WpDashboardTracking; |
| 2748 |
var SESSION_TIMEOUT_MINUTES = 30; |
| 2749 |
var MINUTE_MS = 60 * 1e3; |
| 2750 |
var SESSION_TIMEOUT = SESSION_TIMEOUT_MINUTES * MINUTE_MS; |
| 2751 |
var ACTIVITY_CHECK_INTERVAL = 1 * MINUTE_MS; |
| 2752 |
var SESSION_STORAGE_KEY = "elementor_wpdash_session"; |
| 2753 |
var PENDING_NAV_CLICK_KEY = "elementor_wpdash_pending_nav"; |
| 2754 |
var CONTROL_TYPES = { |
| 2755 |
BUTTON: "button", |
| 2756 |
CHECKBOX: "checkbox", |
| 2757 |
RADIO: "radio", |
| 2758 |
LINK: "link", |
| 2759 |
SELECT: "select", |
| 2760 |
TOGGLE: "toggle", |
| 2761 |
FILTER: "filter" |
| 2762 |
}; |
| 2763 |
var NAV_AREAS = { |
| 2764 |
LEFT_MENU: "left_menu", |
| 2765 |
SUBMENU: "submenu", |
| 2766 |
HOVER_MENU: "hover_menu", |
| 2767 |
TOP_BAR: "top_bar", |
| 2768 |
SIDEBAR_MENU: "sidebar" |
| 2769 |
}; |
| 2770 |
var SCREEN_TYPES = { |
| 2771 |
TAB: "tab", |
| 2772 |
POPUP: "popup", |
| 2773 |
APP_SCREEN: "app_screen" |
| 2774 |
}; |
| 2775 |
var WpDashboardTracking = /*#__PURE__*/ function() { |
| 2776 |
function WpDashboardTracking() { |
| 2777 |
_classCallCheck(this, WpDashboardTracking); |
| 2778 |
} |
| 2779 |
return _createClass(WpDashboardTracking, null, [ |
| 2780 |
{ |
| 2781 |
key: "getElementorCommon", |
| 2782 |
value: function getElementorCommon() { |
| 2783 |
return window.elementorCommon; |
| 2784 |
} |
| 2785 |
}, |
| 2786 |
{ |
| 2787 |
key: "init", |
| 2788 |
value: function init() { |
| 2789 |
if (this.initialized) return; |
| 2790 |
this.restoreOrCreateSession(); |
| 2791 |
if (this.isEventsManagerAvailable()) { |
| 2792 |
this.startSessionMonitoring(); |
| 2793 |
this.attachActivityListeners(); |
| 2794 |
this.attachNavigationListener(); |
| 2795 |
this.initialized = true; |
| 2796 |
} |
| 2797 |
} |
| 2798 |
}, |
| 2799 |
{ |
| 2800 |
key: "restoreOrCreateSession", |
| 2801 |
value: function restoreOrCreateSession() { |
| 2802 |
var storedSession = this.getStoredSession(); |
| 2803 |
if (storedSession) { |
| 2804 |
this.sessionStartTime = storedSession.sessionStartTime; |
| 2805 |
this.navItemsVisited = new Set(storedSession.navItemsVisited); |
| 2806 |
this.lastActivityTime = Date.now(); |
| 2807 |
this.sessionEnded = false; |
| 2808 |
} else { |
| 2809 |
this.sessionStartTime = Date.now(); |
| 2810 |
this.lastActivityTime = Date.now(); |
| 2811 |
this.sessionEnded = false; |
| 2812 |
this.navItemsVisited = /* @__PURE__ */ new Set(); |
| 2813 |
} |
| 2814 |
this.processPendingNavClick(); |
| 2815 |
this.saveSessionToStorage(); |
| 2816 |
} |
| 2817 |
}, |
| 2818 |
{ |
| 2819 |
key: "isEditorOneActive", |
| 2820 |
value: function isEditorOneActive() { |
| 2821 |
var _elementorCommon$conf; |
| 2822 |
var _elementorCommon$conf2; |
| 2823 |
var elementorCommon = this.getElementorCommon(); |
| 2824 |
return (_elementorCommon$conf = elementorCommon === null || elementorCommon === void 0 || (_elementorCommon$conf2 = elementorCommon.config) === null || _elementorCommon$conf2 === void 0 || (_elementorCommon$conf2 = _elementorCommon$conf2.editor_events) === null || _elementorCommon$conf2 === void 0 ? void 0 : _elementorCommon$conf2.isEditorOneActive) !== null && _elementorCommon$conf !== void 0 ? _elementorCommon$conf : false; |
| 2825 |
} |
| 2826 |
}, |
| 2827 |
{ |
| 2828 |
key: "processPendingNavClick", |
| 2829 |
value: function processPendingNavClick() { |
| 2830 |
try { |
| 2831 |
var pendingNav = sessionStorage.getItem(PENDING_NAV_CLICK_KEY); |
| 2832 |
if (pendingNav) { |
| 2833 |
var _JSON$parse = JSON.parse(pendingNav); |
| 2834 |
var itemId = _JSON$parse.itemId; |
| 2835 |
var rootItem = _JSON$parse.rootItem; |
| 2836 |
var area = _JSON$parse.area; |
| 2837 |
this.navItemsVisited.add(itemId); |
| 2838 |
var properties = { |
| 2839 |
wpdash_nav_item_id: itemId, |
| 2840 |
wpdash_nav_area: area |
| 2841 |
}; |
| 2842 |
if (rootItem) properties.wpdash_nav_item_root = rootItem; |
| 2843 |
this.dispatchEvent("wpdash_nav_clicked", properties, { send_immediately: true }); |
| 2844 |
sessionStorage.removeItem(PENDING_NAV_CLICK_KEY); |
| 2845 |
} |
| 2846 |
} catch (error) { |
| 2847 |
sessionStorage.removeItem(PENDING_NAV_CLICK_KEY); |
| 2848 |
} |
| 2849 |
} |
| 2850 |
}, |
| 2851 |
{ |
| 2852 |
key: "getStoredSession", |
| 2853 |
value: function getStoredSession() { |
| 2854 |
try { |
| 2855 |
var stored = sessionStorage.getItem(SESSION_STORAGE_KEY); |
| 2856 |
return stored ? JSON.parse(stored) : null; |
| 2857 |
} catch (error) { |
| 2858 |
return null; |
| 2859 |
} |
| 2860 |
} |
| 2861 |
}, |
| 2862 |
{ |
| 2863 |
key: "saveSessionToStorage", |
| 2864 |
value: function saveSessionToStorage() { |
| 2865 |
var sessionData = { |
| 2866 |
sessionStartTime: this.sessionStartTime, |
| 2867 |
navItemsVisited: Array.from(this.navItemsVisited) |
| 2868 |
}; |
| 2869 |
sessionStorage.setItem(SESSION_STORAGE_KEY, JSON.stringify(sessionData)); |
| 2870 |
} |
| 2871 |
}, |
| 2872 |
{ |
| 2873 |
key: "clearStoredSession", |
| 2874 |
value: function clearStoredSession() { |
| 2875 |
sessionStorage.removeItem(SESSION_STORAGE_KEY); |
| 2876 |
} |
| 2877 |
}, |
| 2878 |
{ |
| 2879 |
key: "isEventsManagerAvailable", |
| 2880 |
value: function isEventsManagerAvailable() { |
| 2881 |
var elementorCommon = this.getElementorCommon(); |
| 2882 |
return (elementorCommon === null || elementorCommon === void 0 ? void 0 : elementorCommon.eventsManager) && "function" === typeof elementorCommon.eventsManager.dispatchEvent; |
| 2883 |
} |
| 2884 |
}, |
| 2885 |
{ |
| 2886 |
key: "canSendEvents", |
| 2887 |
value: function canSendEvents() { |
| 2888 |
var _elementorCommon$conf3; |
| 2889 |
var _elementorCommon$conf4; |
| 2890 |
var elementorCommon = this.getElementorCommon(); |
| 2891 |
return (_elementorCommon$conf3 = elementorCommon === null || elementorCommon === void 0 || (_elementorCommon$conf4 = elementorCommon.config) === null || _elementorCommon$conf4 === void 0 || (_elementorCommon$conf4 = _elementorCommon$conf4.editor_events) === null || _elementorCommon$conf4 === void 0 ? void 0 : _elementorCommon$conf4.can_send_events) !== null && _elementorCommon$conf3 !== void 0 ? _elementorCommon$conf3 : false; |
| 2892 |
} |
| 2893 |
}, |
| 2894 |
{ |
| 2895 |
key: "dispatchEvent", |
| 2896 |
value: function dispatchEvent(eventName) { |
| 2897 |
var _elementorCommon$even; |
| 2898 |
var properties = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; |
| 2899 |
var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; |
| 2900 |
if (!this.isEventsManagerAvailable() || !this.canSendEvents()) return; |
| 2901 |
var elementorCommon = this.getElementorCommon(); |
| 2902 |
elementorCommon === null || elementorCommon === void 0 || (_elementorCommon$even = elementorCommon.eventsManager) === null || _elementorCommon$even === void 0 || _elementorCommon$even.dispatchEvent(eventName, properties, options); |
| 2903 |
} |
| 2904 |
}, |
| 2905 |
{ |
| 2906 |
key: "updateActivity", |
| 2907 |
value: function updateActivity() { |
| 2908 |
this.lastActivityTime = Date.now(); |
| 2909 |
} |
| 2910 |
}, |
| 2911 |
{ |
| 2912 |
key: "startSessionMonitoring", |
| 2913 |
value: function startSessionMonitoring() { |
| 2914 |
var _this = this; |
| 2915 |
this.activityCheckInterval = setInterval(function() { |
| 2916 |
_this.checkSessionTimeout(); |
| 2917 |
}, ACTIVITY_CHECK_INTERVAL); |
| 2918 |
window.addEventListener("beforeunload", function() { |
| 2919 |
if (!_this.sessionEnded && !_this.isNavigatingToElementor) _this.trackSessionEnd("tab_closed"); |
| 2920 |
}); |
| 2921 |
document.addEventListener("visibilitychange", function() { |
| 2922 |
if (!_this.sessionEnded && document.hidden) { |
| 2923 |
if (Date.now() - _this.lastActivityTime > SESSION_TIMEOUT) _this.trackSessionEnd("tab_inactive"); |
| 2924 |
} |
| 2925 |
}); |
| 2926 |
} |
| 2927 |
}, |
| 2928 |
{ |
| 2929 |
key: "isElementorPage", |
| 2930 |
value: function isElementorPage(url) { |
| 2931 |
try { |
| 2932 |
var params = new URL(url, window.location.origin).searchParams; |
| 2933 |
var page = params.get("page"); |
| 2934 |
var postType = params.get("post_type"); |
| 2935 |
var action = params.get("action"); |
| 2936 |
return !!(page && this.elementorPages.some(function(p) { |
| 2937 |
return page.includes(p); |
| 2938 |
}) || postType && this.elementorPostTypes.includes(postType) || action && action.includes(this.anyPageWithElementorString)); |
| 2939 |
} catch (error) { |
| 2940 |
return false; |
| 2941 |
} |
| 2942 |
} |
| 2943 |
}, |
| 2944 |
{ |
| 2945 |
key: "isPluginsPage", |
| 2946 |
value: function isPluginsPage(url) { |
| 2947 |
try { |
| 2948 |
return new URL(url, window.location.origin).pathname.includes("plugins.php"); |
| 2949 |
} catch (error) { |
| 2950 |
return false; |
| 2951 |
} |
| 2952 |
} |
| 2953 |
}, |
| 2954 |
{ |
| 2955 |
key: "isNavigatingAwayFromElementor", |
| 2956 |
value: function isNavigatingAwayFromElementor(targetUrl) { |
| 2957 |
if (!targetUrl) return false; |
| 2958 |
if (targetUrl.startsWith("#")) return false; |
| 2959 |
return !this.isElementorPage(targetUrl); |
| 2960 |
} |
| 2961 |
}, |
| 2962 |
{ |
| 2963 |
key: "isLinkOpeningInNewTab", |
| 2964 |
value: function isLinkOpeningInNewTab(link) { |
| 2965 |
var target = link.getAttribute("target"); |
| 2966 |
return "_blank" === target || "_new" === target; |
| 2967 |
} |
| 2968 |
}, |
| 2969 |
{ |
| 2970 |
key: "attachNavigationListener", |
| 2971 |
value: function attachNavigationListener() { |
| 2972 |
var _this2 = this; |
| 2973 |
var handleLinkClick = function handleLinkClick(event) { |
| 2974 |
var link = event.target.closest("a"); |
| 2975 |
if (link && link.href) { |
| 2976 |
if (_this2.isLinkOpeningInNewTab(link)) return; |
| 2977 |
if (!_this2.sessionEnded && _this2.isNavigatingAwayFromElementor(link.href)) _this2.trackSessionEnd("navigate_away"); |
| 2978 |
else if (_this2.isElementorPage(link.href)) _this2.isNavigatingToElementor = true; |
| 2979 |
} |
| 2980 |
if (event.target.closest("#editor-one-sidebar-navigation")) _this2.isNavigatingToElementor = true; |
| 2981 |
}; |
| 2982 |
var handleFormSubmit = function handleFormSubmit(event) { |
| 2983 |
var form = event.target; |
| 2984 |
if (form.action) { |
| 2985 |
if (!_this2.sessionEnded && _this2.isNavigatingAwayFromElementor(form.action)) _this2.trackSessionEnd("navigate_away"); |
| 2986 |
else if (_this2.isElementorPage(form.action)) _this2.isNavigatingToElementor = true; |
| 2987 |
} |
| 2988 |
}; |
| 2989 |
document.addEventListener("click", handleLinkClick, true); |
| 2990 |
document.addEventListener("submit", handleFormSubmit, true); |
| 2991 |
this.navigationListeners.push({ |
| 2992 |
type: "click", |
| 2993 |
handler: handleLinkClick |
| 2994 |
}, { |
| 2995 |
type: "submit", |
| 2996 |
handler: handleFormSubmit |
| 2997 |
}); |
| 2998 |
} |
| 2999 |
}, |
| 3000 |
{ |
| 3001 |
key: "checkSessionTimeout", |
| 3002 |
value: function checkSessionTimeout() { |
| 3003 |
if (Date.now() - this.lastActivityTime > SESSION_TIMEOUT && !this.sessionEnded) this.trackSessionEnd("timeout"); |
| 3004 |
} |
| 3005 |
}, |
| 3006 |
{ |
| 3007 |
key: "attachActivityListeners", |
| 3008 |
value: function attachActivityListeners() { |
| 3009 |
var _this3 = this; |
| 3010 |
[ |
| 3011 |
"mousedown", |
| 3012 |
"keydown", |
| 3013 |
"scroll", |
| 3014 |
"touchstart", |
| 3015 |
"click" |
| 3016 |
].forEach(function(event) { |
| 3017 |
document.addEventListener(event, function() { |
| 3018 |
_this3.updateActivity(); |
| 3019 |
}, { |
| 3020 |
capture: true, |
| 3021 |
passive: true |
| 3022 |
}); |
| 3023 |
}); |
| 3024 |
} |
| 3025 |
}, |
| 3026 |
{ |
| 3027 |
key: "formatDuration", |
| 3028 |
value: function formatDuration(milliseconds) { |
| 3029 |
var totalSeconds = Math.floor(milliseconds / 1e3); |
| 3030 |
return Number(totalSeconds.toFixed(2)); |
| 3031 |
} |
| 3032 |
}, |
| 3033 |
{ |
| 3034 |
key: "trackNavClicked", |
| 3035 |
value: function trackNavClicked(itemId) { |
| 3036 |
var rootItem = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; |
| 3037 |
var area = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : NAV_AREAS.LEFT_MENU; |
| 3038 |
if (!this.initialized) { |
| 3039 |
var pendingNav = { |
| 3040 |
itemId, |
| 3041 |
rootItem, |
| 3042 |
area |
| 3043 |
}; |
| 3044 |
sessionStorage.setItem(PENDING_NAV_CLICK_KEY, JSON.stringify(pendingNav)); |
| 3045 |
return; |
| 3046 |
} |
| 3047 |
this.updateActivity(); |
| 3048 |
this.navItemsVisited.add(itemId); |
| 3049 |
this.saveSessionToStorage(); |
| 3050 |
var properties = { |
| 3051 |
wpdash_nav_item_id: itemId, |
| 3052 |
wpdash_nav_area: area |
| 3053 |
}; |
| 3054 |
if (rootItem) properties.wpdash_nav_item_root = rootItem; |
| 3055 |
this.dispatchEvent("wpdash_nav_clicked", properties); |
| 3056 |
} |
| 3057 |
}, |
| 3058 |
{ |
| 3059 |
key: "trackScreenViewed", |
| 3060 |
value: function trackScreenViewed(screenId) { |
| 3061 |
var screenType = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : SCREEN_TYPES.TAB; |
| 3062 |
this.updateActivity(); |
| 3063 |
var properties = { |
| 3064 |
wpdash_screen_id: screenId, |
| 3065 |
wpdash_screen_type: screenType |
| 3066 |
}; |
| 3067 |
this.dispatchEvent("wpdash_screen_viewed", properties); |
| 3068 |
} |
| 3069 |
}, |
| 3070 |
{ |
| 3071 |
key: "trackActionControl", |
| 3072 |
value: function trackActionControl(controlIdentifier, controlType) { |
| 3073 |
this.updateActivity(); |
| 3074 |
var properties = { |
| 3075 |
wpdash_action_control_interacted: controlIdentifier, |
| 3076 |
wpdash_control_type: controlType |
| 3077 |
}; |
| 3078 |
this.dispatchEvent("wpdash_action_control", properties); |
| 3079 |
} |
| 3080 |
}, |
| 3081 |
{ |
| 3082 |
key: "trackPromoClicked", |
| 3083 |
value: function trackPromoClicked(promoName, destination, clickPath) { |
| 3084 |
this.updateActivity(); |
| 3085 |
var properties = { |
| 3086 |
wpdash_promo_name: promoName, |
| 3087 |
wpdash_promo_destination: destination, |
| 3088 |
wpdash_promo_clicked_path: clickPath |
| 3089 |
}; |
| 3090 |
this.dispatchEvent("wpdash_promo_clicked", properties); |
| 3091 |
} |
| 3092 |
}, |
| 3093 |
{ |
| 3094 |
key: "trackSessionEnd", |
| 3095 |
value: function trackSessionEnd() { |
| 3096 |
var reason = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "timeout"; |
| 3097 |
if (this.sessionEnded) return; |
| 3098 |
this.sessionEnded = true; |
| 3099 |
if (this.activityCheckInterval) { |
| 3100 |
clearInterval(this.activityCheckInterval); |
| 3101 |
this.activityCheckInterval = null; |
| 3102 |
} |
| 3103 |
var duration = Date.now() - this.sessionStartTime; |
| 3104 |
var properties = { |
| 3105 |
wpdash_endstate_nav_summary: Array.from(this.navItemsVisited), |
| 3106 |
wpdash_endstate_nav_count: this.navItemsVisited.size, |
| 3107 |
wpdash_endstate_duration: this.formatDuration(duration), |
| 3108 |
reason |
| 3109 |
}; |
| 3110 |
this.dispatchEvent("wpdash_session_end_state", properties); |
| 3111 |
this.clearStoredSession(); |
| 3112 |
} |
| 3113 |
}, |
| 3114 |
{ |
| 3115 |
key: "destroy", |
| 3116 |
value: function destroy() { |
| 3117 |
if (this.activityCheckInterval) clearInterval(this.activityCheckInterval); |
| 3118 |
this.navigationListeners.forEach(function(_ref) { |
| 3119 |
var type = _ref.type; |
| 3120 |
var handler = _ref.handler; |
| 3121 |
document.removeEventListener(type, handler, true); |
| 3122 |
}); |
| 3123 |
this.navigationListeners = []; |
| 3124 |
ScreenViewTracking.destroy(); |
| 3125 |
PromotionTracking.destroy(); |
| 3126 |
MenuPromotionTracking.destroy(); |
| 3127 |
ActionControlTracking.destroy(); |
| 3128 |
this.initialized = false; |
| 3129 |
} |
| 3130 |
} |
| 3131 |
]); |
| 3132 |
}(); |
| 3133 |
_WpDashboardTracking = WpDashboardTracking; |
| 3134 |
_defineProperty(WpDashboardTracking, "anyPageWithElementorString", "elementor"); |
| 3135 |
_defineProperty(WpDashboardTracking, "elementorPages", [ |
| 3136 |
_WpDashboardTracking.anyPageWithElementorString, |
| 3137 |
"e-form-submissions", |
| 3138 |
"popup_templates" |
| 3139 |
]); |
| 3140 |
_defineProperty(WpDashboardTracking, "elementorPostTypes", [ |
| 3141 |
"elementor_library", |
| 3142 |
"e-floating-buttons", |
| 3143 |
"elementor_snippet", |
| 3144 |
"elementor_font", |
| 3145 |
"elementor_icons" |
| 3146 |
]); |
| 3147 |
_defineProperty(WpDashboardTracking, "sessionStartTime", Date.now()); |
| 3148 |
_defineProperty(WpDashboardTracking, "lastActivityTime", Date.now()); |
| 3149 |
_defineProperty(WpDashboardTracking, "sessionEnded", false); |
| 3150 |
_defineProperty(WpDashboardTracking, "navItemsVisited", /* @__PURE__ */ new Set()); |
| 3151 |
_defineProperty(WpDashboardTracking, "activityCheckInterval", null); |
| 3152 |
_defineProperty(WpDashboardTracking, "initialized", false); |
| 3153 |
_defineProperty(WpDashboardTracking, "navigationListeners", []); |
| 3154 |
_defineProperty(WpDashboardTracking, "isNavigatingToElementor", false); |
| 3155 |
window.addEventListener("elementor/admin/init", function() { |
| 3156 |
var currentUrl = window.location.href; |
| 3157 |
var isPluginsPage = WpDashboardTracking.isPluginsPage(currentUrl); |
| 3158 |
var isElementorPage = WpDashboardTracking.isElementorPage(currentUrl); |
| 3159 |
if (isPluginsPage) PluginActions.init(); |
| 3160 |
NavigationTracking.init(); |
| 3161 |
if (isElementorPage) { |
| 3162 |
WpDashboardTracking.init(); |
| 3163 |
ScreenViewTracking.init(); |
| 3164 |
PromotionTracking.init(); |
| 3165 |
MenuPromotionTracking.init(); |
| 3166 |
ActionControlTracking.init(); |
| 3167 |
} |
| 3168 |
}); |
| 3169 |
window.addEventListener("beforeunload", function() { |
| 3170 |
NavigationTracking.destroy(); |
| 3171 |
PluginActions.destroy(); |
| 3172 |
WpDashboardTracking.destroy(); |
| 3173 |
}); |
| 3174 |
|
| 3175 |
//#endregion |
| 3176 |
//#region assets/dev/js/admin/maintenance-mode.js |
| 3177 |
var require_maintenance_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => { |
| 3178 |
module.exports = elementorModules.ViewModule.extend({ |
| 3179 |
getDefaultSettings: function getDefaultSettings() { |
| 3180 |
return { |
| 3181 |
selectors: { |
| 3182 |
modeSelect: ".elementor_maintenance_mode_mode select", |
| 3183 |
maintenanceModeTable: "#tab-maintenance_mode table", |
| 3184 |
maintenanceModeDescriptions: ".elementor-maintenance-mode-description", |
| 3185 |
excludeModeSelect: ".elementor_maintenance_mode_exclude_mode select", |
| 3186 |
excludeRolesArea: ".elementor_maintenance_mode_exclude_roles", |
| 3187 |
templateSelect: ".elementor_maintenance_mode_template_id select", |
| 3188 |
editTemplateButton: ".elementor-edit-template", |
| 3189 |
maintenanceModeError: ".elementor-maintenance-mode-error" |
| 3190 |
}, |
| 3191 |
classes: { isEnabled: "elementor-maintenance-mode-is-enabled" } |
| 3192 |
}; |
| 3193 |
}, |
| 3194 |
getDefaultElements: function getDefaultElements() { |
| 3195 |
var elements = {}; |
| 3196 |
var selectors = this.getSettings("selectors"); |
| 3197 |
elements.$modeSelect = jQuery(selectors.modeSelect); |
| 3198 |
elements.$maintenanceModeTable = elements.$modeSelect.parents(selectors.maintenanceModeTable); |
| 3199 |
elements.$excludeModeSelect = elements.$maintenanceModeTable.find(selectors.excludeModeSelect); |
| 3200 |
elements.$excludeRolesArea = elements.$maintenanceModeTable.find(selectors.excludeRolesArea); |
| 3201 |
elements.$templateSelect = elements.$maintenanceModeTable.find(selectors.templateSelect); |
| 3202 |
elements.$editTemplateButton = elements.$maintenanceModeTable.find(selectors.editTemplateButton); |
| 3203 |
elements.$maintenanceModeDescriptions = elements.$maintenanceModeTable.find(selectors.maintenanceModeDescriptions); |
| 3204 |
elements.$maintenanceModeError = elements.$maintenanceModeTable.find(selectors.maintenanceModeError); |
| 3205 |
return elements; |
| 3206 |
}, |
| 3207 |
handleModeSelectChange: function handleModeSelectChange() { |
| 3208 |
var settings = this.getSettings(); |
| 3209 |
var elements = this.elements; |
| 3210 |
elements.$maintenanceModeTable.toggleClass(settings.classes.isEnabled, !!elements.$modeSelect.val()); |
| 3211 |
elements.$maintenanceModeDescriptions.hide(); |
| 3212 |
elements.$maintenanceModeDescriptions.filter("[data-value=\"" + elements.$modeSelect.val() + "\"]").show(); |
| 3213 |
}, |
| 3214 |
handleExcludeModeSelectChange: function handleExcludeModeSelectChange() { |
| 3215 |
var elements = this.elements; |
| 3216 |
elements.$excludeRolesArea.toggle("custom" === elements.$excludeModeSelect.val()); |
| 3217 |
}, |
| 3218 |
handleTemplateSelectChange: function handleTemplateSelectChange() { |
| 3219 |
var elements = this.elements; |
| 3220 |
var templateID = elements.$templateSelect.val(); |
| 3221 |
if (!templateID) { |
| 3222 |
elements.$editTemplateButton.hide(); |
| 3223 |
elements.$maintenanceModeError.show(); |
| 3224 |
return; |
| 3225 |
} |
| 3226 |
var editUrl = elementorAdmin.config.home_url + "?p=" + templateID + "&elementor"; |
| 3227 |
elements.$editTemplateButton.prop("href", editUrl).show(); |
| 3228 |
elements.$maintenanceModeError.hide(); |
| 3229 |
}, |
| 3230 |
bindEvents: function bindEvents() { |
| 3231 |
var elements = this.elements; |
| 3232 |
elements.$modeSelect.on("change", this.handleModeSelectChange.bind(this)); |
| 3233 |
elements.$excludeModeSelect.on("change", this.handleExcludeModeSelectChange.bind(this)); |
| 3234 |
elements.$templateSelect.on("change", this.handleTemplateSelectChange.bind(this)); |
| 3235 |
}, |
| 3236 |
onAdminInit: function onAdminInit() { |
| 3237 |
this.handleModeSelectChange(); |
| 3238 |
this.handleExcludeModeSelectChange(); |
| 3239 |
this.handleTemplateSelectChange(); |
| 3240 |
}, |
| 3241 |
onInit: function onInit() { |
| 3242 |
elementorModules.ViewModule.prototype.onInit.apply(this, arguments); |
| 3243 |
elementorCommon.elements.$window.on("elementor/admin/init", this.onAdminInit); |
| 3244 |
} |
| 3245 |
}); |
| 3246 |
})); |
| 3247 |
|
| 3248 |
//#endregion |
| 3249 |
//#region assets/dev/js/admin/admin.js |
| 3250 |
(function($) { |
| 3251 |
var ElementorAdmin = elementorModules.ViewModule.extend({ |
| 3252 |
maintenanceMode: null, |
| 3253 |
config: elementorAdminConfig, |
| 3254 |
getDefaultElements: function getDefaultElements() { |
| 3255 |
var elements = { |
| 3256 |
$switchMode: $("#elementor-switch-mode"), |
| 3257 |
$goToEditLink: $("#elementor-go-to-edit-page-link"), |
| 3258 |
$switchModeInput: $("#elementor-switch-mode-input"), |
| 3259 |
$switchModeButton: $("#elementor-switch-mode-button"), |
| 3260 |
$elementorLoader: $(".elementor-loader"), |
| 3261 |
$builderEditor: $("#elementor-editor"), |
| 3262 |
$importButton: $("#elementor-import-template-trigger"), |
| 3263 |
$importNowButton: $("#e-import-template-action"), |
| 3264 |
$importArea: $("#elementor-import-template-area"), |
| 3265 |
$importForm: $("#elementor-import-template-form"), |
| 3266 |
$importFormFileInput: $("#elementor-import-template-form input[type=\"file\"]"), |
| 3267 |
$settingsForm: $("#elementor-settings-form"), |
| 3268 |
$settingsTabsWrapper: $("#elementor-settings-tabs-wrapper"), |
| 3269 |
$menuGoProLink: $("a[href=\"admin.php?page=go_elementor_pro\"], a[href*=\"admin.php?page=elementor-one-upgrade\"]"), |
| 3270 |
$reMigrateGlobalsButton: $(".elementor-re-migrate-globals-button") |
| 3271 |
}; |
| 3272 |
elements.$settingsFormPages = elements.$settingsForm.find(".elementor-settings-form-page"); |
| 3273 |
elements.$activeSettingsPage = elements.$settingsFormPages.filter(".elementor-active"); |
| 3274 |
elements.$settingsTabs = elements.$settingsTabsWrapper.children(); |
| 3275 |
elements.$activeSettingsTab = elements.$settingsTabs.filter(".nav-tab-active"); |
| 3276 |
return elements; |
| 3277 |
}, |
| 3278 |
toggleStatus: function toggleStatus() { |
| 3279 |
var isElementorMode = this.isElementorMode(); |
| 3280 |
elementorCommon.elements.$body.toggleClass("elementor-editor-active", isElementorMode).toggleClass("elementor-editor-inactive", !isElementorMode); |
| 3281 |
}, |
| 3282 |
bindEvents: function bindEvents() { |
| 3283 |
var self = this; |
| 3284 |
self.elements.$switchModeButton.on("click", function(event) { |
| 3285 |
event.preventDefault(); |
| 3286 |
if (self.isElementorMode()) elementorCommon.dialogsManager.createWidget("confirm", { |
| 3287 |
message: (0, _wordpress_i18n.__)("Please note that you are switching to WordPress default editor. Your current layout, design and content might break.", "elementor"), |
| 3288 |
headerMessage: (0, _wordpress_i18n.__)("Back to WordPress Editor", "elementor"), |
| 3289 |
strings: { |
| 3290 |
confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), |
| 3291 |
cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") |
| 3292 |
}, |
| 3293 |
defaultOption: "confirm", |
| 3294 |
onConfirm: function onConfirm() { |
| 3295 |
self.elements.$switchModeInput.val(""); |
| 3296 |
self.toggleStatus(); |
| 3297 |
} |
| 3298 |
}).show(); |
| 3299 |
else { |
| 3300 |
self.elements.$switchModeInput.val(true); |
| 3301 |
var $wpTitle = $("#title"); |
| 3302 |
if (!$wpTitle.val()) $wpTitle.val("Elementor #" + $("#post_ID").val()); |
| 3303 |
if (wp.autosave) wp.autosave.server.triggerSave(); |
| 3304 |
self.animateLoader(); |
| 3305 |
$(document).on("heartbeat-tick.autosave", function() { |
| 3306 |
elementorCommon.elements.$window.off("beforeunload.edit-post"); |
| 3307 |
location.href = self.elements.$goToEditLink.attr("href"); |
| 3308 |
}); |
| 3309 |
self.toggleStatus(); |
| 3310 |
} |
| 3311 |
}); |
| 3312 |
self.elements.$goToEditLink.on("click", function() { |
| 3313 |
self.animateLoader(); |
| 3314 |
}); |
| 3315 |
$(".e-notice--dismissible").on("click", ".e-notice__dismiss, .e-notice-dismiss", function(event) { |
| 3316 |
event.preventDefault(); |
| 3317 |
var $wrapperElm = $(this).closest(".e-notice--dismissible"); |
| 3318 |
$.post(ajaxurl, { |
| 3319 |
action: "elementor_set_admin_notice_viewed", |
| 3320 |
notice_id: $wrapperElm.data("notice_id"), |
| 3321 |
_wpnonce: $wrapperElm.data("nonce") |
| 3322 |
}); |
| 3323 |
$wrapperElm.fadeTo(100, 0, function() { |
| 3324 |
$wrapperElm.slideUp(100, function() { |
| 3325 |
$wrapperElm.remove(); |
| 3326 |
}); |
| 3327 |
}); |
| 3328 |
}); |
| 3329 |
var campaignNotices = { plugin_image_optimization: "elementor_image_optimization_campaign" }; |
| 3330 |
Object.keys(campaignNotices).forEach(function(noticeId) { |
| 3331 |
$(".e-notice--cta.e-notice--dismissible[data-notice_id=\"".concat(noticeId, "\"] a.e-button--cta")).on("click", function() { |
| 3332 |
var $button = $(this); |
| 3333 |
elementorCommon.ajax.addRequest(campaignNotices[noticeId], { data: { |
| 3334 |
campaign: ($button === null || $button === void 0 ? void 0 : $button.data("campaign")) || "", |
| 3335 |
source: ($button === null || $button === void 0 ? void 0 : $button.data("source")) || "", |
| 3336 |
medium: ($button === null || $button === void 0 ? void 0 : $button.data("medium")) || "" |
| 3337 |
} }); |
| 3338 |
}); |
| 3339 |
}); |
| 3340 |
$(".e-a-apps .e-a-item[data-plugin=\"image-optimization/image-optimization.php\"] a.e-btn").on("click", function() { |
| 3341 |
var $button = $(this); |
| 3342 |
elementorCommon.ajax.addRequest("elementor_image_optimization_campaign", { data: { |
| 3343 |
campaign: ($button === null || $button === void 0 ? void 0 : $button.data("campaign")) || "", |
| 3344 |
source: ($button === null || $button === void 0 ? void 0 : $button.data("source")) || "", |
| 3345 |
medium: ($button === null || $button === void 0 ? void 0 : $button.data("medium")) || "" |
| 3346 |
} }); |
| 3347 |
}); |
| 3348 |
$("#elementor-clear-cache-button").on("click", function(event) { |
| 3349 |
event.preventDefault(); |
| 3350 |
var $thisButton = $(this); |
| 3351 |
$thisButton.removeClass("success").addClass("loading"); |
| 3352 |
$.post(ajaxurl, { |
| 3353 |
action: "elementor_clear_cache", |
| 3354 |
_nonce: $thisButton.data("nonce") |
| 3355 |
}).done(function() { |
| 3356 |
$thisButton.removeClass("loading").addClass("success"); |
| 3357 |
}); |
| 3358 |
}); |
| 3359 |
$("#elementor-library-sync-button").on("click", function(event) { |
| 3360 |
event.preventDefault(); |
| 3361 |
var $thisButton = $(this); |
| 3362 |
$thisButton.removeClass("success").addClass("loading"); |
| 3363 |
$.post(ajaxurl, { |
| 3364 |
action: "elementor_reset_library", |
| 3365 |
_nonce: $thisButton.data("nonce") |
| 3366 |
}).done(function() { |
| 3367 |
$thisButton.removeClass("loading").addClass("success"); |
| 3368 |
}); |
| 3369 |
}); |
| 3370 |
$("#elementor-recreate-kit-button").on("click", function(event) { |
| 3371 |
event.preventDefault(); |
| 3372 |
var $thisButton = $(this); |
| 3373 |
$thisButton.removeClass("success error").addClass("loading").next(".e-recreate-kit-error-message").remove(); |
| 3374 |
$.post(ajaxurl, { |
| 3375 |
action: "elementor_recreate_kit", |
| 3376 |
_nonce: $thisButton.data("nonce") |
| 3377 |
}).done(function() { |
| 3378 |
$thisButton.removeClass("loading").addClass("success"); |
| 3379 |
}).fail(function(_ref) { |
| 3380 |
var _responseJSON$data; |
| 3381 |
var responseJSON = _ref.responseJSON; |
| 3382 |
$thisButton.removeClass("loading").addClass("error"); |
| 3383 |
if ((_responseJSON$data = responseJSON.data) !== null && _responseJSON$data !== void 0 && _responseJSON$data.message) $thisButton.after("<div class=\"e-recreate-kit-error-message\">".concat(responseJSON.data.message, "</div>")); |
| 3384 |
}); |
| 3385 |
}); |
| 3386 |
$("#elementor-replace-url-button").on("click", function(event) { |
| 3387 |
event.preventDefault(); |
| 3388 |
var $this = $(this); |
| 3389 |
var $tr = $this.parents("tr"); |
| 3390 |
var $from = $tr.find("[name=\"from\"]"); |
| 3391 |
var $to = $tr.find("[name=\"to\"]"); |
| 3392 |
$this.removeClass("success").addClass("loading"); |
| 3393 |
$.post(ajaxurl, { |
| 3394 |
action: "elementor_replace_url", |
| 3395 |
from: $from.val(), |
| 3396 |
to: $to.val(), |
| 3397 |
_nonce: $this.data("nonce") |
| 3398 |
}).done(function(response) { |
| 3399 |
$this.removeClass("loading"); |
| 3400 |
if (response.success) $this.addClass("success"); |
| 3401 |
elementorCommon.dialogsManager.createWidget("alert", { message: response.data }).show(); |
| 3402 |
}); |
| 3403 |
}); |
| 3404 |
$("#elementor_upgrade_fa_button").on("click", function(event) { |
| 3405 |
event.preventDefault(); |
| 3406 |
var $updateButton = $(this); |
| 3407 |
$updateButton.addClass("loading"); |
| 3408 |
elementorCommon.dialogsManager.createWidget("confirm", { |
| 3409 |
id: "confirm_fa_migration_admin_modal", |
| 3410 |
message: (0, _wordpress_i18n.__)("I understand that by upgrading to Font Awesome 5,", "elementor") + "<br>" + (0, _wordpress_i18n.__)("I acknowledge that some changes may affect my website and that this action cannot be undone.", "elementor"), |
| 3411 |
headerMessage: (0, _wordpress_i18n.__)("Font Awesome 5 Migration", "elementor"), |
| 3412 |
strings: { |
| 3413 |
confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), |
| 3414 |
cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") |
| 3415 |
}, |
| 3416 |
defaultOption: "confirm", |
| 3417 |
onConfirm: function onConfirm() { |
| 3418 |
$updateButton.removeClass("error").addClass("loading"); |
| 3419 |
var _$updateButton$data = $updateButton.data(); |
| 3420 |
var _nonce = _$updateButton$data._nonce; |
| 3421 |
var action = _$updateButton$data.action; |
| 3422 |
var redirectUrl = _$updateButton$data.redirectUrl; |
| 3423 |
$.post(ajaxurl, { |
| 3424 |
action, |
| 3425 |
_nonce |
| 3426 |
}).done(function(response) { |
| 3427 |
$updateButton.removeClass("loading").addClass("success"); |
| 3428 |
var messageElement = document.createElement("p"); |
| 3429 |
messageElement.appendChild(document.createTextNode(response.data.message)); |
| 3430 |
$("#elementor_upgrade_fa_button").parent().append(messageElement); |
| 3431 |
if (redirectUrl) { |
| 3432 |
location.href = decodeURIComponent(redirectUrl); |
| 3433 |
return; |
| 3434 |
} |
| 3435 |
history.go(-1); |
| 3436 |
}).fail(function() { |
| 3437 |
$updateButton.removeClass("loading").addClass("error"); |
| 3438 |
}); |
| 3439 |
}, |
| 3440 |
onCancel: function onCancel() { |
| 3441 |
$updateButton.removeClass("loading").addClass("error"); |
| 3442 |
} |
| 3443 |
}).show(); |
| 3444 |
}); |
| 3445 |
self.elements.$settingsTabs.on({ |
| 3446 |
click: function click(event) { |
| 3447 |
event.preventDefault(); |
| 3448 |
self.activateSettingsTab(event.currentTarget); |
| 3449 |
event.currentTarget.focus(); |
| 3450 |
}, |
| 3451 |
focus: function focus() { |
| 3452 |
self.activateSettingsTab(this); |
| 3453 |
} |
| 3454 |
}); |
| 3455 |
$("select.elementor-rollback-select").on("change", function() { |
| 3456 |
var $this = $(this); |
| 3457 |
var $rollbackButton = $this.next(".elementor-rollback-button"); |
| 3458 |
var placeholderText = $rollbackButton.data("placeholder-text"); |
| 3459 |
var placeholderUrl = $rollbackButton.data("placeholder-url"); |
| 3460 |
$rollbackButton.html(placeholderText.replace("{VERSION}", $this.val())); |
| 3461 |
$rollbackButton.data("href", placeholderUrl.replace("VERSION", $this.val())); |
| 3462 |
}).trigger("change"); |
| 3463 |
$(".elementor-rollback-button").on("click", function(event) { |
| 3464 |
event.preventDefault(); |
| 3465 |
var $this = $(this); |
| 3466 |
elementorCommon.dialogsManager.createWidget("confirm", { |
| 3467 |
headerMessage: (0, _wordpress_i18n.__)("Rollback to Previous Version", "elementor"), |
| 3468 |
message: (0, _wordpress_i18n.__)("Are you sure you want to reinstall previous version?", "elementor"), |
| 3469 |
strings: { |
| 3470 |
confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), |
| 3471 |
cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") |
| 3472 |
}, |
| 3473 |
onConfirm: function onConfirm() { |
| 3474 |
$this.addClass("loading"); |
| 3475 |
location.href = $this.data("href"); |
| 3476 |
} |
| 3477 |
}).show(); |
| 3478 |
}); |
| 3479 |
self.elements.$reMigrateGlobalsButton.on("click", function(event) { |
| 3480 |
event.preventDefault(); |
| 3481 |
var $this = $(event.currentTarget); |
| 3482 |
elementorCommon.dialogsManager.createWidget("confirm", { |
| 3483 |
headerMessage: (0, _wordpress_i18n.__)("Migrate to v3.0", "elementor"), |
| 3484 |
message: (0, _wordpress_i18n.__)("Please note that this process will revert all changes made to Global Colors and Fonts since upgrading to v3.x.", "elementor"), |
| 3485 |
strings: { |
| 3486 |
confirm: (0, _wordpress_i18n.__)("Continue", "elementor"), |
| 3487 |
cancel: (0, _wordpress_i18n.__)("Cancel", "elementor") |
| 3488 |
}, |
| 3489 |
onConfirm: function onConfirm() { |
| 3490 |
$this.removeClass("success").addClass("loading"); |
| 3491 |
elementorCommon.ajax.addRequest("re_migrate_globals", { success: function success() { |
| 3492 |
return $this.removeClass("loading").addClass("success"); |
| 3493 |
} }); |
| 3494 |
} |
| 3495 |
}).show(); |
| 3496 |
}); |
| 3497 |
$(".elementor_google_font select").on("change", function() { |
| 3498 |
$(".elementor_font_display").toggle("1" === $(this).val()); |
| 3499 |
}).trigger("change"); |
| 3500 |
}, |
| 3501 |
onInit: function onInit() { |
| 3502 |
elementorModules.ViewModule.prototype.onInit.apply(this, arguments); |
| 3503 |
this.initTemplatesImport(); |
| 3504 |
this.initMaintenanceMode(); |
| 3505 |
this.goToSettingsTabFromHash(); |
| 3506 |
this.openLinksInNewTab(); |
| 3507 |
this.addUserAgentClasses(); |
| 3508 |
this.roleManager.init(); |
| 3509 |
if (elementorCommon.config.experimentalFeatures["landing-pages"]) new _default$1(); |
| 3510 |
if (elementorCommon.config.experimentalFeatures.container) new _default(); |
| 3511 |
this.templateControls = new TemplateControls(); |
| 3512 |
new ExperimentsModule(); |
| 3513 |
}, |
| 3514 |
addUserAgentClasses: function addUserAgentClasses() { |
| 3515 |
var body = document.querySelector("body"); |
| 3516 |
Object.entries(environment).forEach(function(_ref2) { |
| 3517 |
var _ref3 = _slicedToArray(_ref2, 2); |
| 3518 |
var key = _ref3[0]; |
| 3519 |
if (!_ref3[1]) return; |
| 3520 |
body.classList.add("e--ua-" + key); |
| 3521 |
}); |
| 3522 |
}, |
| 3523 |
/** |
| 3524 |
* Open Links in New Tab |
| 3525 |
* |
| 3526 |
* Adds a `target="_blank"` attribute to the Admin Dashboard menu items specified in the `elements` array, |
| 3527 |
* if the elements are found in the DOM. The items in the `elements` array should be jQuery instances. |
| 3528 |
* |
| 3529 |
* @since 3.6.0 |
| 3530 |
*/ |
| 3531 |
openLinksInNewTab: function openLinksInNewTab() { |
| 3532 |
[this.elements.$menuGoProLink].forEach(function($element) { |
| 3533 |
if ($element.length) $element.attr("target", "_blank"); |
| 3534 |
}); |
| 3535 |
}, |
| 3536 |
initTemplatesImport: function initTemplatesImport() { |
| 3537 |
var _elementorAdminConfig; |
| 3538 |
var _elementorAdminConfig2; |
| 3539 |
if (!(elementorAdminConfig.user.is_administrator || ((_elementorAdminConfig = (_elementorAdminConfig2 = elementorAdminConfig.user.restrictions) === null || _elementorAdminConfig2 === void 0 ? void 0 : _elementorAdminConfig2.includes("json-upload")) !== null && _elementorAdminConfig !== void 0 ? _elementorAdminConfig : false)) || !elementorCommon.elements.$body.hasClass("post-type-elementor_library")) return; |
| 3540 |
if (0 === this.elements.$importNowButton.length) return; |
| 3541 |
var self = this; |
| 3542 |
var $importForm = self.elements.$importForm; |
| 3543 |
var $importButton = self.elements.$importButton; |
| 3544 |
var $importArea = self.elements.$importArea; |
| 3545 |
var $importNowButton = self.elements.$importNowButton; |
| 3546 |
var $importFormFileInput = self.elements.$importFormFileInput; |
| 3547 |
self.elements.$formAnchor = $(".wp-header-end"); |
| 3548 |
$("#wpbody-content").find(".page-title-action").first().before($importButton); |
| 3549 |
self.elements.$formAnchor.after($importArea); |
| 3550 |
$importButton.on("click", function() { |
| 3551 |
$("#elementor-import-template-area").toggle(); |
| 3552 |
}); |
| 3553 |
var messages = { |
| 3554 |
jsonUploadWarning: { shown: false }, |
| 3555 |
enableUnfilteredFiles: { shown: false } |
| 3556 |
}; |
| 3557 |
var originalButtonValue = $importNowButton[0].value; |
| 3558 |
$importForm.on("submit", /*#__PURE__*/ function() { |
| 3559 |
var _ref4 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee(event) { |
| 3560 |
var hasImportedFiles; |
| 3561 |
var areUnfilteredFilesEnabled; |
| 3562 |
var enableUnfilteredFilesModal; |
| 3563 |
return import_regenerator.default.wrap(function(_context) { |
| 3564 |
while (1) switch (_context.prev = _context.next) { |
| 3565 |
case 0: |
| 3566 |
$importNowButton[0].disabled = true; |
| 3567 |
$importNowButton[0].value = (0, _wordpress_i18n.__)("Importing...", "elementor"); |
| 3568 |
if (messages.jsonUploadWarning.shown) { |
| 3569 |
_context.next = 5; |
| 3570 |
break; |
| 3571 |
} |
| 3572 |
event.preventDefault(); |
| 3573 |
_context.prev = 1; |
| 3574 |
_context.next = 2; |
| 3575 |
return showJsonUploadWarningMessageIfNeeded({ |
| 3576 |
IntroductionClass: window.elementorModules.admin.utils.Introduction, |
| 3577 |
introductionMap: window.elementorAdmin.config.user.introduction, |
| 3578 |
waitForSetViewed: true |
| 3579 |
}); |
| 3580 |
case 2: |
| 3581 |
messages.jsonUploadWarning.shown = true; |
| 3582 |
$importForm.trigger("submit"); |
| 3583 |
_context.next = 4; |
| 3584 |
break; |
| 3585 |
case 3: |
| 3586 |
_context.prev = 3; |
| 3587 |
_context["catch"](1); |
| 3588 |
$importNowButton[0].disabled = false; |
| 3589 |
$importNowButton[0].value = originalButtonValue; |
| 3590 |
case 4: return _context.abrupt("return"); |
| 3591 |
case 5: |
| 3592 |
hasImportedFiles = $importFormFileInput[0].files.length; |
| 3593 |
areUnfilteredFilesEnabled = elementorCommon.config.filesUpload.unfilteredFiles; |
| 3594 |
if (!(hasImportedFiles && !areUnfilteredFilesEnabled && !messages.enableUnfilteredFiles.shown)) { |
| 3595 |
_context.next = 6; |
| 3596 |
break; |
| 3597 |
} |
| 3598 |
event.preventDefault(); |
| 3599 |
enableUnfilteredFilesModal = FilesUploadHandler.getUnfilteredFilesNotEnabledImportTemplateDialog(function() { |
| 3600 |
messages.enableUnfilteredFiles.shown = true; |
| 3601 |
$importForm.trigger("submit"); |
| 3602 |
}); |
| 3603 |
enableUnfilteredFilesModal.show(); |
| 3604 |
return _context.abrupt("return"); |
| 3605 |
case 6: |
| 3606 |
messages.jsonUploadWarning.shown = false; |
| 3607 |
messages.enableUnfilteredFiles.shown = false; |
| 3608 |
case 7: |
| 3609 |
case "end": return _context.stop(); |
| 3610 |
} |
| 3611 |
}, _callee, null, [[1, 3]]); |
| 3612 |
})); |
| 3613 |
return function(_x) { |
| 3614 |
return _ref4.apply(this, arguments); |
| 3615 |
}; |
| 3616 |
}()); |
| 3617 |
}, |
| 3618 |
initMaintenanceMode: function initMaintenanceMode() { |
| 3619 |
var MaintenanceMode = require_maintenance_mode(); |
| 3620 |
this.maintenanceMode = new MaintenanceMode(); |
| 3621 |
}, |
| 3622 |
isElementorMode: function isElementorMode() { |
| 3623 |
return !!this.elements.$switchModeInput.val(); |
| 3624 |
}, |
| 3625 |
animateLoader: function animateLoader() { |
| 3626 |
this.elements.$goToEditLink.addClass("elementor-animate"); |
| 3627 |
}, |
| 3628 |
activateSettingsTab: function activateSettingsTab(tabElement) { |
| 3629 |
if (!(tabElement !== null && tabElement !== void 0 && tabElement.hash)) return; |
| 3630 |
var hrefWithoutHash = location.href.replace(/#.*/, ""); |
| 3631 |
history.pushState({}, "", hrefWithoutHash + tabElement.hash); |
| 3632 |
this.goToSettingsTabFromHash(); |
| 3633 |
}, |
| 3634 |
goToSettingsTabFromHash: function goToSettingsTabFromHash() { |
| 3635 |
var hash = location.hash.slice(1); |
| 3636 |
if (hash) this.goToSettingsTab(hash); |
| 3637 |
}, |
| 3638 |
goToSettingsTab: function goToSettingsTab(tabName) { |
| 3639 |
var $pages = this.elements.$settingsFormPages; |
| 3640 |
if (!$pages.length) return; |
| 3641 |
var $activePage = $pages.filter("#" + tabName); |
| 3642 |
this.elements.$activeSettingsPage.removeClass("elementor-active"); |
| 3643 |
this.elements.$activeSettingsTab.removeClass("nav-tab-active"); |
| 3644 |
var $activeTab = this.elements.$settingsTabs.filter("#elementor-settings-" + tabName); |
| 3645 |
$activePage.addClass("elementor-active"); |
| 3646 |
$activeTab.addClass("nav-tab-active"); |
| 3647 |
this.elements.$settingsForm.attr("action", "options.php#" + tabName); |
| 3648 |
this.elements.$activeSettingsPage = $activePage; |
| 3649 |
this.elements.$activeSettingsTab = $activeTab; |
| 3650 |
}, |
| 3651 |
translate: function translate(stringKey, templateArgs) { |
| 3652 |
return elementorCommon.translate(stringKey, null, templateArgs, this.config.i18n); |
| 3653 |
}, |
| 3654 |
roleManager: { |
| 3655 |
selectors: { |
| 3656 |
body: "elementor-role-manager", |
| 3657 |
row: ".elementor-role-row", |
| 3658 |
label: ".elementor-role-label", |
| 3659 |
excludedIndicator: ".elementor-role-excluded-indicator", |
| 3660 |
excludedField: "input[name=\"elementor_exclude_user_roles[]\"]", |
| 3661 |
controlsContainer: ".elementor-role-controls", |
| 3662 |
toggleHandle: ".elementor-role-toggle", |
| 3663 |
arrowUp: "dashicons-arrow-up", |
| 3664 |
arrowDown: "dashicons-arrow-down" |
| 3665 |
}, |
| 3666 |
toggle: function toggle($trigger) { |
| 3667 |
var self = this; |
| 3668 |
var $row = $trigger.closest(self.selectors.row); |
| 3669 |
var $toggleHandleIcon = $row.find(self.selectors.toggleHandle).find(".dashicons"); |
| 3670 |
var $controls = $row.find(self.selectors.controlsContainer); |
| 3671 |
$controls.toggleClass("hidden"); |
| 3672 |
if ($controls.hasClass("hidden")) $toggleHandleIcon.removeClass(self.selectors.arrowUp).addClass(self.selectors.arrowDown); |
| 3673 |
else $toggleHandleIcon.removeClass(self.selectors.arrowDown).addClass(self.selectors.arrowUp); |
| 3674 |
self.updateLabel($row); |
| 3675 |
}, |
| 3676 |
updateLabel: function updateLabel($row) { |
| 3677 |
var self = this; |
| 3678 |
var $indicator = $row.find(self.selectors.excludedIndicator); |
| 3679 |
var excluded = $row.find(self.selectors.excludedField).is(":checked"); |
| 3680 |
if (excluded) $indicator.html($indicator.data("excluded-label")); |
| 3681 |
else $indicator.html(""); |
| 3682 |
self.setAdvancedState($row, excluded); |
| 3683 |
}, |
| 3684 |
setAdvancedState: function setAdvancedState($row, state) { |
| 3685 |
var self = this; |
| 3686 |
$row.find("input[type=\"checkbox\"]").not(self.selectors.excludedField).each(function(index, input) { |
| 3687 |
$(input).prop("disabled", state); |
| 3688 |
}); |
| 3689 |
}, |
| 3690 |
bind: function bind() { |
| 3691 |
var self = this; |
| 3692 |
$(document).on("click", self.selectors.label + "," + self.selectors.toggleHandle, function(event) { |
| 3693 |
event.stopPropagation(); |
| 3694 |
event.preventDefault(); |
| 3695 |
self.toggle($(this)); |
| 3696 |
}).on("change", self.selectors.excludedField, function() { |
| 3697 |
self.updateLabel($(this).closest(self.selectors.row)); |
| 3698 |
}); |
| 3699 |
}, |
| 3700 |
init: function init() { |
| 3701 |
var self = this; |
| 3702 |
if (!$("body[class*=\"" + self.selectors.body + "\"]").length) return; |
| 3703 |
self.bind(); |
| 3704 |
$(self.selectors.row).each(function(index, row) { |
| 3705 |
self.updateLabel($(row)); |
| 3706 |
}); |
| 3707 |
} |
| 3708 |
} |
| 3709 |
}); |
| 3710 |
$(function() { |
| 3711 |
window.elementorAdmin = new ElementorAdmin(); |
| 3712 |
Events.dispatch(elementorCommon.elements.$window, "elementor/admin/init"); |
| 3713 |
}); |
| 3714 |
})(jQuery); |
| 3715 |
|
| 3716 |
//#endregion |
| 3717 |
})(wp.i18n); |
| 3718 |
//# sourceMappingURL=admin.js.map |