| 1 |
(function() { |
| 2 |
|
| 3 |
//#region \0rolldown/runtime.js |
| 4 |
var __defProp = Object.defineProperty; |
| 5 |
var __name = (target, value) => __defProp(target, "name", { |
| 6 |
value, |
| 7 |
configurable: true |
| 8 |
}); |
| 9 |
|
| 10 |
//#endregion |
| 11 |
|
| 12 |
//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js |
| 13 |
function _classCallCheck(a, n) { |
| 14 |
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); |
| 15 |
} |
| 16 |
|
| 17 |
//#endregion |
| 18 |
//#region node_modules/@babel/runtime/helpers/esm/typeof.js |
| 19 |
function _typeof(o) { |
| 20 |
"@babel/helpers - typeof"; |
| 21 |
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { |
| 22 |
return typeof o; |
| 23 |
} : function(o) { |
| 24 |
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 25 |
}, _typeof(o); |
| 26 |
} |
| 27 |
|
| 28 |
//#endregion |
| 29 |
//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js |
| 30 |
function toPrimitive(t, r) { |
| 31 |
if ("object" != _typeof(t) || !t) return t; |
| 32 |
var e = t[Symbol.toPrimitive]; |
| 33 |
if (void 0 !== e) { |
| 34 |
var i = e.call(t, r || "default"); |
| 35 |
if ("object" != _typeof(i)) return i; |
| 36 |
throw new TypeError("@@toPrimitive must return a primitive value."); |
| 37 |
} |
| 38 |
return ("string" === r ? String : Number)(t); |
| 39 |
} |
| 40 |
|
| 41 |
//#endregion |
| 42 |
//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js |
| 43 |
function toPropertyKey(t) { |
| 44 |
var i = toPrimitive(t, "string"); |
| 45 |
return "symbol" == _typeof(i) ? i : i + ""; |
| 46 |
} |
| 47 |
|
| 48 |
//#endregion |
| 49 |
//#region node_modules/@babel/runtime/helpers/esm/createClass.js |
| 50 |
function _defineProperties(e, r) { |
| 51 |
for (var t = 0; t < r.length; t++) { |
| 52 |
var o = r[t]; |
| 53 |
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); |
| 54 |
} |
| 55 |
} |
| 56 |
function _createClass(e, r, t) { |
| 57 |
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; |
| 58 |
} |
| 59 |
|
| 60 |
//#endregion |
| 61 |
//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js |
| 62 |
function _assertThisInitialized(e) { |
| 63 |
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); |
| 64 |
return e; |
| 65 |
} |
| 66 |
|
| 67 |
//#endregion |
| 68 |
//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js |
| 69 |
function _possibleConstructorReturn(t, e) { |
| 70 |
if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; |
| 71 |
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); |
| 72 |
return _assertThisInitialized(t); |
| 73 |
} |
| 74 |
|
| 75 |
//#endregion |
| 76 |
//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js |
| 77 |
function _getPrototypeOf(t) { |
| 78 |
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { |
| 79 |
return t.__proto__ || Object.getPrototypeOf(t); |
| 80 |
}, _getPrototypeOf(t); |
| 81 |
} |
| 82 |
|
| 83 |
//#endregion |
| 84 |
//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js |
| 85 |
function _superPropBase(t, o) { |
| 86 |
for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); |
| 87 |
return t; |
| 88 |
} |
| 89 |
|
| 90 |
//#endregion |
| 91 |
//#region node_modules/@babel/runtime/helpers/esm/get.js |
| 92 |
function _get() { |
| 93 |
return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { |
| 94 |
var p = _superPropBase(e, t); |
| 95 |
if (p) { |
| 96 |
var n = Object.getOwnPropertyDescriptor(p, t); |
| 97 |
return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; |
| 98 |
} |
| 99 |
}, _get.apply(null, arguments); |
| 100 |
} |
| 101 |
|
| 102 |
//#endregion |
| 103 |
//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js |
| 104 |
function _setPrototypeOf(t, e) { |
| 105 |
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { |
| 106 |
return t.__proto__ = e, t; |
| 107 |
}, _setPrototypeOf(t, e); |
| 108 |
} |
| 109 |
|
| 110 |
//#endregion |
| 111 |
//#region node_modules/@babel/runtime/helpers/esm/inherits.js |
| 112 |
function _inherits(t, e) { |
| 113 |
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); |
| 114 |
t.prototype = Object.create(e && e.prototype, { constructor: { |
| 115 |
value: t, |
| 116 |
writable: !0, |
| 117 |
configurable: !0 |
| 118 |
} }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); |
| 119 |
} |
| 120 |
|
| 121 |
//#endregion |
| 122 |
//#region modules/admin-bar/assets/js/frontend/module.js |
| 123 |
function _callSuper(t, o, e) { |
| 124 |
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); |
| 125 |
} |
| 126 |
function _isNativeReflectConstruct() { |
| 127 |
try { |
| 128 |
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); |
| 129 |
} catch (t) {} |
| 130 |
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { |
| 131 |
return !!t; |
| 132 |
})(); |
| 133 |
} |
| 134 |
function _superPropGet(t, o, e, r) { |
| 135 |
var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); |
| 136 |
return 2 & r && "function" == typeof p ? function(t) { |
| 137 |
return p.apply(e, t); |
| 138 |
} : p; |
| 139 |
} |
| 140 |
var AdminBar = /*#__PURE__*/ function(_elementorModules$Vie) { |
| 141 |
function AdminBar() { |
| 142 |
_classCallCheck(this, AdminBar); |
| 143 |
return _callSuper(this, AdminBar, arguments); |
| 144 |
} |
| 145 |
_inherits(AdminBar, _elementorModules$Vie); |
| 146 |
return _createClass(AdminBar, [ |
| 147 |
{ |
| 148 |
key: "getDefaultSettings", |
| 149 |
value: function getDefaultSettings() { |
| 150 |
return { |
| 151 |
prefixes: { adminBarId: "wp-admin-bar-" }, |
| 152 |
classes: { |
| 153 |
adminBarItem: "ab-item", |
| 154 |
adminBarItemTitle: "elementor-edit-link-title", |
| 155 |
adminBarItemSubTitle: "elementor-edit-link-type", |
| 156 |
adminBarNonLinkItem: "ab-empty-item", |
| 157 |
adminBarSubItemsWrapper: "ab-sub-wrapper", |
| 158 |
adminBarSubItems: "ab-submenu" |
| 159 |
}, |
| 160 |
selectors: { |
| 161 |
adminBar: "#wp-admin-bar-root-default", |
| 162 |
editMenuItem: "#wp-admin-bar-edit", |
| 163 |
newMenuItem: "#wp-admin-bar-new-content" |
| 164 |
} |
| 165 |
}; |
| 166 |
} |
| 167 |
}, |
| 168 |
{ |
| 169 |
key: "getDefaultElements", |
| 170 |
value: function getDefaultElements() { |
| 171 |
var _this$getSettings = this.getSettings("selectors"); |
| 172 |
var adminBar = _this$getSettings.adminBar; |
| 173 |
var editMenuItem = _this$getSettings.editMenuItem; |
| 174 |
var newMenuItem = _this$getSettings.newMenuItem; |
| 175 |
return { |
| 176 |
$adminBar: jQuery(adminBar), |
| 177 |
$editMenuItem: jQuery(editMenuItem), |
| 178 |
$newMenuItem: jQuery(newMenuItem) |
| 179 |
}; |
| 180 |
} |
| 181 |
}, |
| 182 |
{ |
| 183 |
key: "onInit", |
| 184 |
value: function onInit() { |
| 185 |
_superPropGet(AdminBar, "onInit", this, 3)([]); |
| 186 |
this.createMenu(elementorAdminBarConfig); |
| 187 |
} |
| 188 |
}, |
| 189 |
{ |
| 190 |
key: "createMenu", |
| 191 |
value: function createMenu(adminBarConfig) { |
| 192 |
var $items = this.createMenuItems(Object.values(adminBarConfig)); |
| 193 |
if (this.elements.$editMenuItem.length) this.elements.$editMenuItem.after($items); |
| 194 |
else if (this.elements.$newMenuItem.length) this.elements.$newMenuItem.after($items); |
| 195 |
else this.elements.$adminBar.append($items); |
| 196 |
} |
| 197 |
}, |
| 198 |
{ |
| 199 |
key: "createMenuItems", |
| 200 |
value: function createMenuItems(items) { |
| 201 |
var _this = this; |
| 202 |
return items.map(function(item) { |
| 203 |
return _this.createMenuItem(item); |
| 204 |
}); |
| 205 |
} |
| 206 |
}, |
| 207 |
{ |
| 208 |
key: "createMenuItem", |
| 209 |
value: function createMenuItem(item) { |
| 210 |
var children = item.children ? Object.values(item.children) : []; |
| 211 |
var id = "".concat(this.getSettings("prefixes.adminBarId")).concat(item.id); |
| 212 |
var $title = jQuery("<span>", { |
| 213 |
class: this.getSettings("classes.adminBarItemTitle"), |
| 214 |
html: item.title |
| 215 |
}); |
| 216 |
var $subTitle = item.sub_title ? jQuery("<span>", { |
| 217 |
class: this.getSettings("classes.adminBarItemSubTitle"), |
| 218 |
html: item.sub_title |
| 219 |
}) : null; |
| 220 |
var $item = jQuery(item.href ? "<a>" : "<div>", { |
| 221 |
"aria-haspopup": children.length ? true : null, |
| 222 |
class: [ |
| 223 |
this.getSettings("classes.adminBarItem"), |
| 224 |
item.href ? "" : this.getSettings("classes.adminBarNonLinkItem"), |
| 225 |
item.class |
| 226 |
].join(" "), |
| 227 |
href: item.href |
| 228 |
}).append([$title, $subTitle]); |
| 229 |
return jQuery("<li>", { |
| 230 |
id, |
| 231 |
class: children.length ? "menupop" : "" + (item.parent_class || "elementor-general-section") |
| 232 |
}).append([$item, children.length ? this.createSubMenuItems(id, children) : null]); |
| 233 |
} |
| 234 |
}, |
| 235 |
{ |
| 236 |
key: "createSubMenuItems", |
| 237 |
value: function createSubMenuItems(parentId, children) { |
| 238 |
var $list = jQuery("<ul>", { |
| 239 |
class: this.getSettings("classes.adminBarSubItems"), |
| 240 |
id: "".concat(parentId, "-default") |
| 241 |
}).append(this.createMenuItems(children)); |
| 242 |
return jQuery("<div>", { class: this.getSettings("classes.adminBarSubItemsWrapper") }).append($list); |
| 243 |
} |
| 244 |
} |
| 245 |
]); |
| 246 |
}(elementorModules.ViewModule); |
| 247 |
document.addEventListener("DOMContentLoaded", function() { |
| 248 |
return new AdminBar(); |
| 249 |
}); |
| 250 |
|
| 251 |
//#endregion |
| 252 |
})(); |
| 253 |
//# sourceMappingURL=elementor-admin-bar.js.map |