(function() {



	var d_id_for_bot = _sensfrx("getRequestString");











	// Function to get an existing cookie value





	function getCookie(cookieName) {





		const name = cookieName + "=";





		const decodedCookie = decodeURIComponent(document.cookie);





		const cookieArray = decodedCookie.split(';');





		for (let i = 0; i < cookieArray.length; i++) {





			let cookie = cookieArray[i].trim();





			if (cookie.indexOf(name) === 0) {





				return cookie.substring(name.length, cookie.length);





			}





		}





		return null;





	}











	// Function to set or update a cookie if needed





	function setOrUpdateCookie(cookieName, cookieValue, daysToExpire) {





		if (getCookie(cookieName) !== cookieValue) {





			let expires = '';





			if (daysToExpire) {





				const date = new Date();





				date.setTime(date.getTime() + (daysToExpire * 24 * 60 * 60 * 1000));





				expires = '; expires=' + date.toUTCString();





			}





			document.cookie = `${cookieName}=${cookieValue}${expires}; path=/`;





		} else {





			// Optional action if the cookie already exists with the same value





		}





	}











	// Splitting the device ID





	const half = Math.ceil(d_id_for_bot.length / 2);











	const device_id_0 = d_id_for_bot.slice(0, half);





	const device_id_1 = d_id_for_bot.slice(half);











	const mid_0 = Math.ceil(device_id_0.length / 2);





	const mid_1 = Math.ceil(device_id_1.length / 2);











	const device_id_0_1 = device_id_0.slice(0, mid_0);





	const device_id_0_2 = device_id_0.slice(mid_0);





	const device_id_1_1 = device_id_1.slice(0, mid_1);





	const device_id_1_2 = device_id_1.slice(mid_1);











	// Set or update cookies





	setOrUpdateCookie('device0', device_id_0_1, 7);





	setOrUpdateCookie('device1', device_id_0_2, 7);





	setOrUpdateCookie('device2', device_id_1_1, 7);





	setOrUpdateCookie('device3', device_id_1_2, 7);





	





})();

