// source --> https://mconfidential.ma/wp-content/plugins/image-watermark/js/no-right-click.js?ver=2.0.12 
(function(){"use strict";(function(){"use strict";const i=window.iwArgsNoRightClick||{},c=i.rightclick==="Y",d=i.draganddrop==="Y",f=i.devtools==="Y",m=i.enableToast==="Y",u=i.toastMessage||"This content is protected";if(!c&&!d&&!f)return;const l=r=>{if(!m)return;if(!document.getElementById("iw-toast-styles")){const a=document.createElement("style");a.id="iw-toast-styles",a.textContent=`
				@keyframes iwSlideIn { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
				@keyframes iwFadeOut { to { opacity: 0; transform: translateX(400px); } }
				.iw-toast { position: fixed; top: 20px; right: 20px; background: #f44336; color: #fff; padding: 16px 24px; border-radius: 4px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; box-shadow: 0 4px 6px rgba(0,0,0,0.2); z-index: 999999; animation: iwSlideIn 0.3s ease-out, iwFadeOut 0.3s ease-out 2.7s; }
			`,document.head.appendChild(a)}const e=document.querySelector(".iw-toast");e&&e.remove();const o=document.createElement("div");o.className="iw-toast",o.textContent=r,document.body.appendChild(o),setTimeout(()=>o.remove(),3e3)};if(c||d){const r=t=>t.target||t.srcElement||null,e=t=>t&&t.nodeType===1&&t.tagName==="IMG",o=t=>{if(!t||t.nodeType!==1)return!1;const n=window.getComputedStyle(t).backgroundImage;return typeof n=="string"&&n!=="none"},a=t=>t&&t.nodeType===1&&t.tagName==="A"&&t.querySelector("img"),s=t=>e(t)||o(t)||a(t),g=t=>{const n=r(t);s(n)&&(t.preventDefault(),l(u))},y=t=>{const n=r(t);s(n)&&(t.preventDefault(),l(u))};c&&(document.addEventListener("contextmenu",g,!0),document.addEventListener("copy",g,!0)),d&&document.addEventListener("dragstart",y,!0)}if(f){const r=e=>{const o=e.target||e.srcElement,a=o&&o.tagName?o.tagName.toLowerCase():"";if(a==="input"||a==="textarea"||o.isContentEditable)return;let s=!1;if(e.keyCode===123&&(s=!0),(e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===73&&(s=!0),(e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===74&&(s=!0),(e.ctrlKey||e.metaKey)&&e.shiftKey&&e.keyCode===67&&(s=!0),(e.ctrlKey||e.metaKey)&&e.keyCode===85&&(s=!0),s)return e.preventDefault(),l(u),!1};document.addEventListener("keydown",r,!0)}})();
})();
// source --> https://mconfidential.ma/wp-content/plugins/realhomes-currency-switcher/public/js/realhomes-currency-switcher-public.js?ver=1.0.13 
/**
 * All of the code for public-facing JavaScript source
 * resides in this file. 
 */
(function( $ ) {

	'use strict';

	$(document).ready(function(){
		
		var currencySwitcherList = $('ul#currency-switcher-list');
		if (currencySwitcherList.length > 0) {     // if currency switcher exists

			// Ajax request data and response handling options.
			var currencySwitcherForm = $('#currency-switcher-form');
			var currencySwitcherOptions = {
				success: function (ajax_response, statusText, xhr, $form) {
					var response = $.parseJSON(ajax_response);
					if (response.success) {
						// create a URL that clears the cache as cookies not works fine with cache.
						var clearCachedURL = '';
						var randNumber = Math.round( Math.random() * 1000000 );
						var baseURL = window.location.origin + window.location.pathname;
						// If query string exists then handle it
						if ( window.location.search ) {
							var queryString = window.location.search;
							var parameters = new URLSearchParams(queryString);
							if ( parameters.get('switch-currency') ) {
								parameters.set('switch-currency', randNumber );
								clearCachedURL = baseURL + '?' + parameters.toString();
							} else {
								clearCachedURL = baseURL + window.location.search  + '&switch-currency=' + randNumber;
							}
						} else {
							clearCachedURL = baseURL + '?switch-currency=' + randNumber;
						}
						window.location.replace( clearCachedURL );
					} else {
						console.log(response);
					}
				}
			};

			// Making an Ajax request upon selecting a currency from the list.
			$('#currency-switcher-list > li').on('click', function (event) {
				currencySwitcherList.fadeOut(200);
				$('.rh_wrapper_currency_switcher').removeClass('open');
				$('#currency-switcher').removeClass('parent_open');
				// get selected currency code
				var selectedCurrencyCode = $(this).data('currency-code');

				if (selectedCurrencyCode) {
					$('#selected-currency .currency_text').html(selectedCurrencyCode);
					$('#selected-currency i').attr('class','currency-flag currency-flag-'+ selectedCurrencyCode.toLowerCase());
					$('#switch-to-currency').val(selectedCurrencyCode);           // set new currency code
					currencySwitcherForm.ajaxSubmit(currencySwitcherOptions);    // submit ajax form to update currency code cookie
				}
			});
				
			// Currency switcher show/hide.
			$('body').on('click','#currency-switcher' ,function (e) {
				$('.rh_wrapper_currency_switcher').toggleClass('parent_open');
				$(this).toggleClass('open');
				if($(this).hasClass('open')){
					currencySwitcherList.fadeIn(200);
				}else{
					currencySwitcherList.fadeOut(200);
				}

				e.stopPropagation();
			});

			// Hidding currency switcher on outside click.
			$('html').on('click',function () {
				$('.rh_wrapper_currency_switcher').removeClass('parent_open');
				$('html #currency-switcher').removeClass('open');
				currencySwitcherList.fadeOut(200);
			});
		}
	});
})( jQuery );