PageSourceSearch

https://gfpublicidad.es/wp-content/plugins/dynamic-content-for-elementor/assets/js/settings.js?ver=3.4.16

js gfpublicidad.es collected 2026-10-07 04:26:47 UTC 5,879 bytes, 205 lines download raw bytes

1function dceGetElementSettings($element) {
2	var elementSettings = [];
3	var modelCID = $element.data("model-cid");
4	if (elementorFrontend.isEditMode() && modelCID) {
5		var settings = elementorFrontend.config.elements.data[modelCID];
6		var type = settings.attributes.widgetType || settings.attributes.elType;
7		var settingsKeys = elementorFrontend.config.elements.keys[type];
8		if (!settingsKeys) {
9			settingsKeys = [];
10			jQuery.each(settings.controls, function (name, control) {
11				if (control.frontend_available) {
12					settingsKeys.push(name);
13				}
14			});
15		}
16		jQuery.each(settings.getActiveControls(), function (controlKey) {
17			if (-1 !== settingsKeys.indexOf(controlKey)) {
18				elementSettings[controlKey] = settings.attributes[controlKey];
19			}
20		});
21	} else {
22		elementSettings = $element.data("settings") || {};
23	}
24	return elementSettings;
25}
26
27function dceObserveElement($target, $function_callback) {
28	if (!elementorFrontend.isEditMode()) {
29		return;
30	}
31
32	const config = {
33		attributes: true,
34		childList: false,
35		characterData: true,
36	};
37
38	const MutationObserver =
39		window.MutationObserver ||
40		window.WebKitMutationObserver ||
41		window.MozMutationObserver;
42	const observer = new MutationObserver($function_callback);
43
44	observer.observe($target, config);
45}
46
47window.dynamicooo = {};
48
49/**
50 * SPDX-SnippetBegin
51 * SPDX-FileCopyrightText: Elementor
52 * SPDX-License-Identifier: GPL-3.0-or-later
53 */
54dynamicooo.getActiveBreakpointsMinPointAndPostfix = () => {
55	let breakpoints = elementorFrontend.config.responsive.activeBreakpoints;
56	let ret = {};
57	for (let key in breakpoints) {
58		ret[key] = {
59			// Elementor widescreen value is actually the min breakpoint:
60			min_point:
61				elementorFrontend.breakpoints.getDeviceMinBreakpoint(key),
62			postfix: `_${key}`,
63		};
64	}
65	ret.desktop = {
66		min_point:
67			elementorFrontend.breakpoints.getDeviceMinBreakpoint("desktop"),
68		postfix: "",
69	};
70	return ret;
71};
72/**
73 * SPDX-SnippetEnd
74 */
75
76/**
77 * Resolve the effective value of a responsive control for the current device,
78 * honoring Elementor's active breakpoints (custom ones included) and inheritance.
79 *
80 * @param {Object} elementorSettings The element settings object.
81 * @param {string} key The base control key (e.g. 'size_honeycombs').
82 * @param {*} defaultValue Fallback used when nothing is set.
83 * @return {*} The value that applies on the current device mode.
84 */
85dynamicooo.getResponsiveValue = (elementorSettings, key, defaultValue) => {
86	const breakpoints = dynamicooo.getActiveBreakpointsMinPointAndPostfix();
87	const currentMode = elementorFrontend.getCurrentDeviceMode();
88	const currentMin = breakpoints[currentMode]
89		? breakpoints[currentMode].min_point
90		: 0;
91	let value =
92		elementorSettings[key] !== undefined &&
93		elementorSettings[key] !== null &&
94		elementorSettings[key] !== ""
95			? elementorSettings[key]
96			: defaultValue;
97	Object.keys(breakpoints)
98		.sort((a, b) => breakpoints[b].min_point - breakpoints[a].min_point)
99		.forEach((name) => {
100			if (breakpoints[name].min_point < currentMin) {
101				return;
102			}
103			const v = elementorSettings[key + breakpoints[name].postfix];
104			if (v !== undefined && v !== null && v !== "") {
105				value = v;
106			}
107		});
108	return value;
109};
110
111/**
112 * Create a Swiper settings breakpoints object
113 *
114 * swiperSettings: An object with with Swiper settings keys as keys, and as values
115 *  an object contains:
116 * - elementor_key: The Elementor Settings Key from where the value of the
117 *    Swiper Key should be fetched.
118 * - default_value
119 *
120 *
121 *  Returns the breakpoints object as defined by Swiper, value are
122 *  automatically fetched from the Elementor settings.
123 */
124dynamicooo.makeSwiperBreakpoints = (
125	swiperSettings,
126	elementorSettings,
127	prefix = "",
128) => {
129	const elementorBreakpoints =
130		dynamicooo.getActiveBreakpointsMinPointAndPostfix();
131	const breakpoints = {};
132	const lastBreakpointValues = {};
133
134	Object.keys(elementorBreakpoints)
135		.reverse()
136		.forEach((breakpointName) => {
137			let min_point = elementorBreakpoints[breakpointName].min_point;
138
139			if (elementorBreakpoints[breakpointName].postfix === "_mobile") {
140				min_point = 0;
141			}
142
143			let breakpointSettings = {};
144
145			for (let swiperSettingsKey in swiperSettings) {
146				const setting = swiperSettings[swiperSettingsKey];
147				const defaultValue = setting.default_value;
148				const elementorKeyWithPostfix =
149					prefix +
150					setting.elementor_key +
151					elementorBreakpoints[breakpointName].postfix;
152				let value = elementorSettings[elementorKeyWithPostfix];
153
154				// When 'spaceBetween' control is set as slider, the value is an object with 'size' and 'unit' keys
155				if (
156					swiperSettingsKey === "spaceBetween" &&
157					typeof value === "object"
158				) {
159					value = value.size || defaultValue;
160				}
161
162				value =
163					value ||
164					dceGetParentValue(
165						lastBreakpointValues[swiperSettingsKey],
166					) ||
167					defaultValue;
168				value = value === "auto" ? value : Number(value);
169
170				if (!lastBreakpointValues[swiperSettingsKey]) {
171					lastBreakpointValues[swiperSettingsKey] = [];
172				}
173				lastBreakpointValues[swiperSettingsKey].push(value);
174
175				// Ensure that `slidesPerGroup` is set to 1 if `slidesPerView` is 1 so that scrolling will not bypass any slides
176				// This forcing is not passed into lastBreakpointValues
177				if (
178					swiperSettingsKey === "slidesPerGroup" &&
179					breakpointSettings["slidesPerView"] === 1
180				) {
181					value = 1;
182				}
183
184				breakpointSettings[swiperSettingsKey] = value;
185			}
186
187			breakpoints[min_point] = breakpointSettings;
188		});
189	return breakpoints;
190};
191
192function dceGetParentValue(lastBreakpointValue) {
193	const lastIndex = lastBreakpointValue
194		? lastBreakpointValue.findLastIndex((el) => el !== 0)
195		: -1;
196	if (lastIndex !== -1) {
197		return lastBreakpointValue[lastIndex];
198	}
199	return false;
200}
201
202window.initMap = () => {
203	const event = new Event("dce-google-maps-api-loaded");
204	window.dispatchEvent(event);
205};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.