// source --> https://thearabianpost.com/wp-content/plugins/searchwp-live-ajax-search/assets/javascript/dist/script.min.js?ver=1.8.2 
!function(){"use strict";var e=window&&window.__assign||function(){return e=Object.assign||function(e){for(var t,s=1,i=arguments.length;s<i;s++)for(var r in t=arguments[s])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},e.apply(this,arguments)},t={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},s=function(){function s(s){void 0===s&&(s={}),this.opts=e(e({},t),s)}return s.prototype.spin=function(e){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),i(this.el,{position:this.opts.position,width:0,zIndex:this.opts.zIndex,left:this.opts.left,top:this.opts.top,transform:"scale("+this.opts.scale+")"}),e&&e.insertBefore(this.el,e.firstChild||null),function(e,t){var s=Math.round(t.corners*t.width*500)/1e3+"px",a="none";!0===t.shadow?a="0 2px 4px #000":"string"==typeof t.shadow&&(a=t.shadow);for(var o=function(e){for(var t=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,s=[],i=0,r=e.split(",");i<r.length;i++){var n=r[i].match(t);if(null!==n){var a=+n[2],o=+n[5],h=n[4],l=n[7];0!==a||h||(h=l),0!==o||l||(l=h),h===l&&s.push({prefix:n[1]||"",x:a,y:o,xUnits:h,yUnits:l,end:n[8]})}}return s}(a),h=0;h<t.lines;h++){var l=~~(360/t.lines*h+t.rotate),u=i(document.createElement("div"),{position:"absolute",top:-t.width/2+"px",width:t.length+t.width+"px",height:t.width+"px",background:r(t.fadeColor,h),borderRadius:s,transformOrigin:"left",transform:"rotate("+l+"deg) translateX("+t.radius+"px)"}),c=h*t.direction/t.lines/t.speed;c-=1/t.speed;var p=i(document.createElement("div"),{width:"100%",height:"100%",background:r(t.color,h),borderRadius:s,boxShadow:n(o,l),animation:1/t.speed+"s linear "+c+"s infinite "+t.animation});u.appendChild(p),e.appendChild(u)}}(this.el,this.opts),this},s.prototype.stop=function(){return this.el&&("undefined"!=typeof requestAnimationFrame?cancelAnimationFrame(this.animateId):clearTimeout(this.animateId),this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},s}();function i(e,t){for(var s in t)e.style[s]=t[s];return e}function r(e,t){return"string"==typeof e?e:e[t%e.length]}function n(e,t){for(var s=[],i=0,r=e;i<r.length;i++){var n=r[i],o=a(n.x,n.y,t);s.push(n.prefix+o[0]+n.xUnits+" "+o[1]+n.yUnits+n.end)}return s.join(", ")}function a(e,t,s){var i=s*Math.PI/180,r=Math.sin(i),n=Math.cos(i);return[Math.round(1e3*(e*n+t*r))/1e3,Math.round(1e3*(-e*r+t*n))/1e3]}!function(){var e="searchwp_live_search";function t(e){this.config=null,this.input_el=e,this.results_id=null,this.results_el=null,this.parent_el=null,this.results_showing=!1,this.form_el=null,this.timer=!1,this.last_string="",this.spinner=null,this.spinner_showing=!1,this.has_results=!1,this.current_request=!1,this.results_destroy_on_blur=!0,this.a11y_keys=[27,40,13,38,9],this.init()}t.prototype={init:function(){var e=this,t=this.input_el;this.form_el=t.parents("form:eq(0)"),this.results_id=this.uniqid("searchwp_live_search_results_");var i=!1,r=t.data("swpconfig");if(r&&void 0!==r)for(var n in searchwp_live_search_params.config)r===n&&(i=!0,this.config=searchwp_live_search_params.config[n]);else for(var a in searchwp_live_search_params.config)"default"===a&&(i=!0,this.config=searchwp_live_search_params.config[a]);if(i){var o=t.data("swpengine");o||(o=this.config.engine),t.data("swpengine",o),t.attr("autocomplete","off"),t.attr("aria-owns",this.results_id),t.attr("aria-autocomplete","both"),t.attr("aria-label",searchwp_live_search_params.aria_instructions);var h='<div aria-expanded="false" class="searchwp-live-search-results" id="'+this.results_id+'" role="listbox" tabindex="0"></div>',l=t.data("swpparentel");l?(this.parent_el=jQuery(l),this.parent_el.html(h)):this.config.parent_el?(this.parent_el=jQuery(this.config.parent_el),this.parent_el.html(h)):jQuery("body").append(jQuery(h)),this.results_el=jQuery("#"+this.results_id),this.position_results(),jQuery(window).resize((function(){e.position_results()})),this.config.spinner&&(void 0===this.config.spinner.scale&&(this.config.spinner.scale=1),void 0===this.config.spinner.fadeColor&&(this.config.spinner.fadeColor="transparent"),void 0===this.config.spinner.animation&&(this.config.spinner.animation="searchwp-spinner-line-fade-quick"),void 0===this.config.spinner.position&&(this.config.spinner.position="absolute"),this.spinner=new s(this.config.spinner)),void 0===this.config.abort_on_enter&&(this.config.abort_on_enter=!0),t.keyup((function(t){jQuery.inArray(t.keyCode,e.a11y_keys)>-1||(e.current_request&&e.config.abort_on_enter&&13===t.keyCode&&e.current_request.abort(),jQuery.trim(e.input_el.val()).length?e.results_showing||(e.position_results(),e.results_el.addClass("searchwp-live-search-results-showing"),e.show_spinner(),e.results_showing=!0):e.destroy_results(),e.has_results&&!e.spinner_showing&&e.last_string!==jQuery.trim(e.input_el.val())&&(e.results_el.empty(),e.show_spinner()),t.currentTarget.value.length>=e.config.input.min_chars?e.results_el.removeClass("searchwp-live-search-no-min-chars"):e.results_el.addClass("searchwp-live-search-no-min-chars"),e.position_results())})).keyup(jQuery.proxy(this.maybe_search,this)),(this.config.results_destroy_on_blur||void 0===this.config.results_destroy_on_blur)&&jQuery("html").click((function(t){jQuery(t.target).parents(".searchwp-live-search-results").length||e.destroy_results()})),t.click((function(e){e.stopPropagation()}))}else alert(searchwp_live_search_params.msg_no_config_found)},keyboard_navigation:function(){var e=this,t=this.input_el,s=this.results_el,i="searchwp-live-search-result--focused",r=".searchwp-live-search-result",n=this.a11y_keys;jQuery(document).off("keyup.searchwp_a11y").on("keyup.searchwp_a11y",(function(a){if(s.hasClass("searchwp-live-search-results-showing")){if(-1!==jQuery.inArray(a.keyCode,n)){if(a.preventDefault(),27===a.keyCode)return e.destroy_results(),jQuery(document).off("keyup.searchwp_a11y"),t.focus(),void jQuery(document).trigger("searchwp_live_escape_results");if(40===a.keyCode){var o=jQuery(s[0]).find("."+i);1===o.length&&1===o.next().length?o.removeClass(i).attr("aria-selected","false").next().addClass(i).attr("aria-selected","true").find("a").focus():(o.removeClass(i).attr("aria-selected","false"),s.find(r+":first").addClass(i).attr("aria-selected","true").find("a").focus()),jQuery(document).trigger("searchwp_live_key_arrowdown_pressed")}if(38===a.keyCode){var h=jQuery(s[0]).find("."+i);1===h.length&&1===h.prev().length?h.removeClass(i).attr("aria-selected","false").prev().addClass(i).attr("aria-selected","true").find("a").focus():(h.removeClass(i).attr("aria-selected","false"),s.find(r+":last").addClass(i).attr("aria-selected","true").find("a").focus()),jQuery(document).trigger("searchwp_live_key_arrowup_pressed")}13===a.keyCode&&jQuery(document).trigger("searchwp_live_key_enter_pressed"),9===a.keyCode&&jQuery(document).trigger("searchwp_live_key_tab_pressed")}}else jQuery(document).off("keyup.searchwp_a11y")})),jQuery(document).trigger("searchwp_live_keyboad_navigation")},aria_expanded:function(e){var t=this.results_el;e?t.attr("aria-expanded","true"):t.attr("aria-expanded","false"),jQuery(document).trigger("searchwp_live_aria_expanded")},position_results:function(){var e=this.input_el,t=e.offset(),s=this.results_el,i=0;if(!e.is(":hidden")){if(t.left+=parseInt(this.config.results.offset.x,10),t.top+=parseInt(this.config.results.offset.y,10),"top"===this.config.results.position)i=0-s.height();else i=e.outerHeight();s.css("left",t.left),s.css("top",t.top+i+"px"),"auto"===this.config.results.width&&s.width(e.outerWidth()-parseInt(s.css("paddingRight").replace("px",""),10)-parseInt(s.css("paddingLeft").replace("px",""),10)),jQuery(document).trigger("searchwp_live_position_results",[s.css("left"),s.css("top"),s.width()])}},destroy_results:function(e){this.hide_spinner(),this.aria_expanded(!1),this.results_el.empty().removeClass("searchwp-live-search-results-showing"),this.results_showing=!1,this.has_results=!1,jQuery(document).trigger("searchwp_live_destroy_results")},maybe_search:function(e){jQuery.inArray(e.keyCode,this.a11y_keys)>-1||(clearTimeout(this.timer),e.currentTarget.value.length>=this.config.input.min_chars&&(this.current_request&&this.current_request.abort(),this.timer=setTimeout(jQuery.proxy(this.search,this,e),this.config.input.delay)))},show_spinner:function(){this.config.spinner&&!this.spinner_showing&&(this.spinner.spin(document.getElementById(this.results_id)),this.spinner_showing=!0,jQuery(document).trigger("searchwp_live_show_spinner"))},hide_spinner:function(){this.config.spinner&&(this.spinner.stop(),this.spinner_showing=!1,jQuery(document).trigger("searchwp_live_hide_spinner"))},search:function(e){var t=this,s=this.form_el,i=s.serialize(),r=s.attr("action")?s.attr("action"):"",n=this.input_el,a=this.results_el;jQuery(document).trigger("searchwp_live_search_start",[n,a,s,r,i]),this.aria_expanded(!1),i+="&action=searchwp_live_search&swpengine="+n.data("swpengine"),i+="&swpquery="+encodeURIComponent(n.val()),i+="&origin_id="+parseInt(searchwp_live_search_params.origin_id,10),i+="&searchwp_live_search_client_nonce="+searchwp_live_search_params.searchwp_live_search_client_nonce,-1!==r.indexOf("?")&&(r=r.split("?"),i+="&"+r[1]),this.last_string=n.val(),this.has_results=!0,this.current_request=jQuery.ajax({url:searchwp_live_search_params.ajaxurl,type:"GET",data:i,complete:function(){jQuery(document).trigger("searchwp_live_search_complete",[n,a,s,r,i]),t.spinner_showing=!1,this.current_request=!1,jQuery(document).trigger("searchwp_live_search_shutdown",[n,a,s,r,i])},success:function(e){0===e&&(e=""),jQuery(document).trigger("searchwp_live_search_success",[n,a,s,r,i]),a.html(e),t.position_results(),t.aria_expanded(!0),t.keyboard_navigation(),jQuery(document).trigger("searchwp_live_search_shutdown",[n,a,s,r,i])}})},uniqid:function(e,t){var s;void 0===e&&(e="");var i=function(e,t){return t<(e=parseInt(e,10).toString(16)).length?e.slice(e.length-t):t>e.length?new Array(t-e.length+1).join("0")+e:e};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,s=e,s+=i(parseInt((new Date).getTime()/1e3,10),8),s+=i(this.php_js.uniqidSeed,5),t&&(s+=(10*Math.random()).toFixed(8).toString()),s}},jQuery.fn[e]=function(s){return this.each((function(){jQuery.data(this,"plugin_"+e)||jQuery.data(this,"plugin_"+e,new t(jQuery(this),s))})),this}}(),jQuery(document).ready((function(){"function"==typeof jQuery().searchwp_live_search&&(jQuery('input[data-swplive="true"]').searchwp_live_search(),"undefined"!=typeof _SEARCHWP_LIVE_AJAX_SEARCH_BLOCKS&&_SEARCHWP_LIVE_AJAX_SEARCH_BLOCKS&&jQuery("input.wp-block-search__input").each((function(){jQuery(this).attr("data-swpengine",_SEARCHWP_LIVE_AJAX_SEARCH_ENGINE),jQuery(this).attr("data-swpconfig",_SEARCHWP_LIVE_AJAX_SEARCH_CONFIG),jQuery(this).searchwp_live_search()})))}))}();
// source --> https://thearabianpost.com/wp-content/plugins/auto-prefetch-url-in-viewport/assets/js/auto-prefetch-url-in-viewport.min.js?ver=1773483709 
let auto_prefetched_urls=localStorage.getItem("auto_prefetched_urls");function url_can_be_prefetched(e){return 0!==e.length&&!e.startsWith("mailto:")}function url_in_viewport(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.right<=window.innerWidth&&t.bottom<=window.innerHeight}function auto_prefetch_urls(){let e=new RegExp(location.host.match(/([^.]+)\.\w{2,3}(?:\.\w{2})?$/)[0]);document.querySelectorAll("a").forEach(t=>{if(t.href){let r=t.href.split("#")[0];if(e.test(r)&&!1===auto_prefetched_urls.includes(r)&&url_can_be_prefetched(r)&&url_in_viewport(t)){auto_prefetched_urls.push(r);let e=document.createElement("link");e.rel="prefetch",e.href=r,document.getElementsByTagName("body")[0].appendChild(e)}}}),localStorage.setItem("auto_prefetched_urls",JSON.stringify(auto_prefetched_urls))}auto_prefetched_urls=auto_prefetched_urls?JSON.parse(auto_prefetched_urls):[],["load","scroll"].forEach(function(e){window.addEventListener(e,auto_prefetch_urls)});
// source --> https://thearabianpost.com/wp-content/plugins/ajax-loader-cache/loader-notmin.js?ver=1.7.07 
/*
WP Ajax-LOADER by: Mdesign Licenced Under GNU
Email: mdesign.fa@gmail.com
Telegram: @g_mdz
version: 1.7.07
All Rights Reserved by Author: Mdesign
Compressed by: www.toptal.com/developers/javascript-minifier
*/

var is_page_loaded_via_ajaxLoader = 'no';//To determine page loaded via ajax or not?

/*Prepare Loader-CSS Class*/
if (wpjsloadbymdz_loaderclass !== null && wpjsloadbymdz_loaderclass !== undefined && wpjsloadbymdz_loaderclass != "" && wpjsloadbymdz_loaderclass != " ") {

    var loader_css = wpjsloadbymdz_loaderclass;

} else if (wpjsloadbymdz_loadereff !== null && wpjsloadbymdz_loadereff !== undefined && wpjsloadbymdz_loadereff != "" && wpjsloadbymdz_loadereff != " ") {

    switch (wpjsloadbymdz_loadereff) {
        case 'simple':
            var loader_css = "waiting-for-ajx1";
            break;
        case 'glassy':
            var loader_css = "waiting-for-ajx2";
            break;
        case 'fantasy':
            var loader_css = "waiting-for-ajx3";
            break;
        case 'xray':
            var loader_css = "waiting-for-ajx4";
            break;
        case 'dark':
            var loader_css = "waiting-for-ajx5";
            break;
        case 'sepia':
            var loader_css = "waiting-for-ajx6";
            break;
        case 'black':
            var loader_css = "waiting-for-ajx7";
            break;
        case 'blackglass':
            var loader_css = "waiting-for-ajx8";
            break;
    }

} else var loader_css = "waiting-for-ajx1";
/**/



function wpjsloadbymdz_getfileext(url, mode = 1) {

    if (!url.includes(".")) {
        return '';
    }

    var url_split = url.split(".");
    var len = url_split.length;

    if (mode == 1) {
        return (url_split[len - 1])
    } else return (url_split[len - 2])

}
function wpjsloadermdz_timeConverter(unix, hours) {
    var date = new Date(unix);

    if (hours == '30') {

        hours = 30;
        data = date.setTime(date.getTime() + (hours * 60 * 1000));

    } else if (hours == '110') {

        hours = 10;
        data = date.setTime(date.getTime() + (hours * 60 * 1000));

    } else data = date.setTime(date.getTime() + (hours * 60 * 60 * 1000));

    date = Math.floor(date.getTime() / 1000);
    return date;
}
function wpjsloadermdz_getpage_ajax(url, loader_css, donsethist, a_tag = '', event = '') {

    if (event != '') {
        event.preventDefault();
    }

    /*Define Cache-Class*/
    class wpjsloadermdz_localcache {

        check_get(url) {

            if (wpjsloadbymdz_cachetime != 'ses') {

                var has = localStorage.getItem("" + url + "");
                var is_valid = localStorage.getItem("" + url + "(exp-date)");

            } else var has = sessionStorage.getItem("" + url + "");

            if (wpjsloadbymdz_cachetime != 'ses') {
                var now = Date.now();
                now = Math.floor(now / 1000);

                if (is_valid !== null && (now > is_valid)) {

                    //Cache is Expired
                    localStorage.removeItem("" + url + "");
                    localStorage.removeItem("" + url + "(exp-date)");
                    return null;

                }
            }

            return has;
        }
        set_storage(url, data, exp) {

            if (wpjsloadbymdz_cachetime != 'ses') {

                try {

                    localStorage.setItem("" + url + "", "" + data + "");
                    localStorage.setItem("" + url + "(exp-date)", "" + exp + "");

                }
                catch {
                    console.log("Ajax-Loader cache: could not set storage item!");
                }


            } else {
                try {

                    sessionStorage.setItem("" + url + "", "" + data + "");

                }
                catch {
                    console.log("Ajax-Loader cache: could not set storage item!");
                }

            }

        }
        set(url, data) {

            var exp = Date.now();

            if (wpjsloadbymdz_cachetime !== null && wpjsloadbymdz_cachetime !== undefined) {

                if (wpjsloadbymdz_cachetime != "ses") {

                    wpjsloadbymdz_cachetime = parseInt(wpjsloadbymdz_cachetime);
                    exp = wpjsloadermdz_timeConverter(exp, wpjsloadbymdz_cachetime);

                } else exp = "";



            } else exp = wpjsloadermdz_timeConverter(exp, 1);

            /*Check URLs*/
            var this_page_is_valid = true;

            if (wpjsloadbymdz_exc_cachepages !== null && wpjsloadbymdz_exc_cachepages !== undefined) {
                var exc_pages_arr = wpjsloadbymdz_exc_cachepages.split("|");

                exc_pages_arr.forEach(function (page) {

                    if (url == page) {
                        this_page_is_valid = false;
                        return;
                    }

                });


                if (this_page_is_valid) {
                    if (wpjsloadbymdz_doncache_q !== null && wpjsloadbymdz_doncache_q !== undefined && wpjsloadbymdz_doncache_q == '1') {

                        if (url.includes("?") || url.includes("&")) {
                            return;
                        }
                        this.set_storage(url, data, exp);


                    } else this.set_storage(url, data, exp);

                }

            } else {

                if (wpjsloadbymdz_doncache_q !== null && wpjsloadbymdz_doncache_q !== undefined && wpjsloadbymdz_doncache_q == '1') {

                    if (url.includes("?") || url.includes("&")) {
                        return;
                    }
                    this.set_storage(url, data, exp);

                } else this.set_storage(url, data, exp);

            }
            /**/
        }
    }
    /**/

    let page_html = document.querySelector("html");

    if (wpjsloadbymdz_ajaxcache !== null && wpjsloadbymdz_ajaxcache !== undefined && wpjsloadbymdz_ajaxcache == '1') {

        var jq_ajax_cache = true;

    } else var jq_ajax_cache = false;

    var ajaxTime = new Date().getTime();
    //Get page content
    jQuery.ajax({
        url: url,
        method: "get",
        cache: jq_ajax_cache,
        error: function () {
            console.log("GET Error: from Ajax-Loader plugin!");
            page_html.classList.remove(loader_css);
        },
        beforeSend: function () {

            if (loader_css !== null && loader_css !== undefined && loader_css != '') {
                page_html.classList.add(loader_css);
            } else page_html.classList.add('waiting-for-ajx1');



            if (wpjsloadbymdz_cache !== null && wpjsloadbymdz_cache !== undefined && wpjsloadbymdz_cache == '1') {

                if (wpjsloadbymdz_user_isin != '1' || wpjsloadbymdz_cache_uesrs == '1' || wpjsloadbymdz_cache_remover != '1') {

                    var urlcache = new wpjsloadermdz_localcache();
                    var has = urlcache.check_get(url);

                    if (has !== null && has !== undefined) {
                        wpjsloadermdz_doSomething(has, url, "cache", donsethist);
                        return false;
                    }
                }
            }

        },
        success: function (resp) {

            if (wpjsloadbymdz_cache !== null && wpjsloadbymdz_cache !== undefined && wpjsloadbymdz_cache == '1') {
                if (wpjsloadbymdz_user_isin != '1' || wpjsloadbymdz_cache_uesrs == '1' || wpjsloadbymdz_cache_remover) {

                    var urlcache = new wpjsloadermdz_localcache();
                    urlcache.set(url, resp);

                }
            }
            var totalTime = new Date().getTime() - ajaxTime;
            wpjsloadermdz_doSomething(resp, url, totalTime, donsethist);
        }
    });

}
function wpjsloadermdz_a_tags() {

    /*Prepare Options*/
    if (wpjsloadbymdz_exc_class !== null && wpjsloadbymdz_exc_class !== undefined) {
        var exc_class_arr = wpjsloadbymdz_exc_class.split("|");
    }

    if (wpjsloadbymdz_exc_attrs !== null && wpjsloadbymdz_exc_attrs !== undefined) {
        var exc_attrs_arr = wpjsloadbymdz_exc_attrs.split("|");
    }

    if (wpjsloadbymdz_exc_parclass !== null && wpjsloadbymdz_exc_parclass !== undefined) {
        var exc_class_par_arr = wpjsloadbymdz_exc_parclass.split("|");
    }

    if (wpjsloadbymdz_exc_parattr !== null && wpjsloadbymdz_exc_parattr !== undefined) {
        var exc_attrs_par_arr = wpjsloadbymdz_exc_parattr.split("|");
    }
    /**/

    //Helpers
    var normalize_url = (url) => {
        var url_arr = url.split('');
        var url_len = url_arr.length;

        if(url_arr[url_len-1] != '/'){
            url = url+'/';
        }

        return url;
    }
    /***/

    let curr_now_url = location.href;
    curr_now_url = curr_now_url.replaceAll("#", "");

    //var all_a_tags = document.getElementsByTagName("a");
    var all_a_tags = document.querySelectorAll("a");

    /*Loop on All A tags*/
    for (var mdz = 0; mdz < all_a_tags.length; mdz++) {

        //console.log(all_a_tags[mdz])

        //A tag Validation
        if (all_a_tags[mdz].hasAttribute("mdz-url-to-fetch")) {
            continue;
        }

        if (wpjsloadbymdz_onexts !== null && wpjsloadbymdz_onexts !== undefined && wpjsloadbymdz_onexts != '1') {
            if (all_a_tags[mdz].getAttribute("target") == "_blank") {
                continue;
            }
        }

        exc_class_arr.forEach(function (css) {

            if (all_a_tags[mdz].classList.contains(css)) {
                all_a_tags[mdz].setAttribute("wpjsloadbymdz-igonore", "1");
            }

        });

        exc_attrs_arr.forEach(function (attr) {

            if (attr.includes("=")) {

                var riz_arr = attr.split("=");

                riz_arr[1] = riz_arr[1].replaceAll('"', '');


                if (all_a_tags[mdz].getAttribute(riz_arr[0]) == riz_arr[1]) {
                    all_a_tags[mdz].setAttribute("wpjsloadbymdz-igonore", "1");
                }

            } else {

                if (all_a_tags[mdz].hasAttribute(attr)) {
                    all_a_tags[mdz].setAttribute("wpjsloadbymdz-igonore", "1");
                }

            }

        });

        exc_class_par_arr.forEach(function (css) {

            var tmp_par = all_a_tags[mdz].parentNode;
            if (tmp_par !== null && tmp_par !== undefined && tmp_par.classList.contains(css)) {
                all_a_tags[mdz].setAttribute("wpjsloadbymdz-igonore", "1");
            }

        });

        exc_attrs_par_arr.forEach(function (attr) {

            if (attr.includes("=")) {

                var riz_arr = attr.split("=");
                var tmp_par = all_a_tags[mdz].parentNode;

                if (tmp_par !== null && tmp_par !== undefined && tmp_par.getAttribute(riz_arr[0]) == riz_arr[1]) {
                    all_a_tags[mdz].setAttribute("wpjsloadbymdz-igonore", "1");
                }

            } else {

                var tmp_par = all_a_tags[mdz].parentNode;
                if (tmp_par !== null && tmp_par !== undefined && tmp_par.hasAttribute(attr)) {
                    all_a_tags[mdz].setAttribute("wpjsloadbymdz-igonore", "1");
                }

            }

        });

        if (!all_a_tags[mdz].hasAttribute("href")) {
            continue;
        }

        var this_a_href = all_a_tags[mdz].getAttribute("href");

        //Proccess Relative-like urls (/ OR /product/test)
        if (!this_a_href.includes(wpjsloadbymdz_url)) {
            if(this_a_href.includes('/') && !this_a_href.includes('http')){
                if(this_a_href == '/'){
                    all_a_tags[mdz].setAttribute('mdz-url-to-fetch', wpjsloadbymdz_url);
                }else {

                    var test_url_arr = this_a_href.split('');
                    if(test_url_arr[0] !== null && test_url_arr[0] !== undefined){
                        if(test_url_arr[0] == '/'){
                            test_url_arr[0] = normalize_url(wpjsloadbymdz_url);
                            all_a_tags[mdz].setAttribute('mdz-url-to-fetch', test_url_arr.join(''));
                        }
                    }
                }
                
            }else continue;
            //continue;//deprecated @Since 1.6.35
        }
        /***/

        /*Check URL file-extension*/
        var url_ext = wpjsloadbymdz_getfileext(this_a_href);
        url_ext = url_ext.toLowerCase();
        url_ext = url_ext.trim();
        if (url_ext != "html" && url_ext != "htm" && url_ext != "php" && url_ext != "" && !url_ext.includes("/") && !url_ext.includes("\\") && this_a_href != wpjsloadbymdz_url) {
            continue;
        }
        /**/

        if (all_a_tags[mdz].getAttribute("href") == "#") {
            continue;
        } else {
            var tmp_href = all_a_tags[mdz].getAttribute("href");
            var tmp_str = tmp_href.split("#");

            if (tmp_str[0].includes("#")) { continue; }
        }

        var tst_url = this_a_href.split(curr_now_url);
        if ((tst_url[1] !== null && tst_url[1] !== undefined) && (tst_url[1] == "#" || tst_url[1].includes("#"))) {
            continue;
        }

        if (all_a_tags[mdz].hasAttribute("wpjsloadbymdz-igonore")) {
            continue;
        }
        if (all_a_tags[mdz].hasAttribute("wpjsload-exc")) {
            continue;
        }
        if (all_a_tags[mdz].classList.contains("wpjsload-exc-class")) {
            continue;
        }

        var url_to_get = all_a_tags[mdz].getAttribute("href");
        if(!all_a_tags[mdz].hasAttribute('mdz-url-to-fetch')){
            all_a_tags[mdz].setAttribute("mdz-url-to-fetch", url_to_get);
        }
        
        /*all_a_tags[mdz].setAttribute("href", "#");*/

        //Drag Detect
        if (wpjsloadbymdz_isdragdetect === null || wpjsloadbymdz_isdragdetect === undefined) {
            wpjsloadbymdz_isdragdetect = 0;
        }

        if (wpjsloadbymdz_isdragdetect == 1) {

            if (wpjsloadbymdz_dragthreshold === null || wpjsloadbymdz_dragthreshold === undefined || wpjsloadbymdz_dragthreshold === '') {
                wpjsloadbymdz_dragthreshold = 115;
            }
            wpjsloadbymdz_dragthreshold = parseInt(wpjsloadbymdz_dragthreshold);

            all_a_tags[mdz].addEventListener("mousedown", function (event) {
                this.setAttribute('mdz-is-dragging', 1)
                this.setAttribute('mdz-drags-time', Date.now())
            })

            all_a_tags[mdz].addEventListener("mouseup", function (event) {
                this.setAttribute('mdz-is-dragging', 0)
                this.setAttribute('mdz-dragend-time', Date.now())
            })

        }
        /***/


        all_a_tags[mdz].addEventListener("click", function (event) {

            if (this.hasAttribute("mdz-url-to-fetch")) {

                //Final Vallidation
                if(this.hasAttribute('wpjsload-exc') || this.classList.contains('wpjsload-exc-class')){
                    return;//End of function execution
                }
                /***/

                var is_this_moved = 0;
                if (wpjsloadbymdz_isdragdetect == 1) {
                    is_this_moved = 1;
                    var start_time = this.getAttribute('mdz-drags-time');
                    var end_time = this.getAttribute('mdz-dragend-time');
                    var differenceInSeconds = Math.abs((end_time - start_time));//Milliseconds

                    if (differenceInSeconds < wpjsloadbymdz_dragthreshold) {
                        is_this_moved = 0;
                    }

                }
                if (is_this_moved == 0) {
                    event.preventDefault();
                    var url_to_get = this.getAttribute("mdz-url-to-fetch");
                    wpjsloadermdz_getpage_ajax(url_to_get, loader_css, 1);
                }

            }

        });
    }
    /**/
}



function wpjsloadermdz_doSomething(data, url, mtd, donsethist) {

    //Define custom events
    is_page_loaded_via_ajaxLoader = 'yes';

    const wpjsloadbymdz_event_ajax_loaded = new Event('ajxloaded')
    var use_doc_write = 1;
    var doc_write_mtd_txt = 'document.write(Deprecated)';

    
    if (use_doc_write == 0) { doc_write_mtd_txt = 'modern-method' }
    /***/


    console.clear();

    if (mtd == 'cache') {
        console.log("Page Loaded Form local-cache in 0 seconds by ajax-loader! ** Document-Writed with: " + doc_write_mtd_txt);
    } else console.log("Page Fetched from server in " + mtd + " milli-seconds by ajax-loader! ** Document-Writed with: " + doc_write_mtd_txt);


    //new Document();
    document.open();
    document.write(data);
    document.close();


    /*history.replaceState('data to be passed', 'Title of the page', url);*/
    if (donsethist == '1') {
        history.pushState(null, '', url);
    }

    if (wpjsloadbymdz_notopscroll != '1') {
        window.scrollTo(0, 0);
    }



    document.dispatchEvent(wpjsloadbymdz_event_ajax_loaded)


    if (wpjsloadbymdz_xmkrpg == 'yes') {
        wpjsloadermdz_a_tags();
    }




    //Scroll into view
    var curr_url = window.location.href
    var curr_url = curr_url.split(wpjsloadbymdz_url);
    if (curr_url[1].includes("#")) {

        var domid = curr_url[1].split("#");
        var dom = domid[1];

        setTimeout(function () {
            dom = document.querySelector("[id= '" + dom + "']");
            if (dom !== null && dom !== undefined) {
                dom.scrollIntoView();
            }

        }, 125)
    }



}

if (wpjsloadbymdz_xmkrpg !== null && wpjsloadbymdz_xmkrpg !== undefined && wpjsloadbymdz_xmkrpg != "" && wpjsloadbymdz_xmkrpg != " " && wpjsloadbymdz_xmkrpg == 'yes') {



    var ajxloader_displayMode = "";
    if (wpjsloadbymdz_disinpwa == '1') {

        ajxloader_displayMode = 'browser tab';

        if (window.matchMedia('(display-mode: standalone)').matches) {

            ajxloader_displayMode = 'standalone';

        } else {

            /*Check URL*/
            var urlParams = new URLSearchParams(window.location.search);

            if (wpjsloadbymdz_pwaparam == '' || wpjsloadbymdz_pwaparam == ' ') {
                wpjsloadbymdz_pwaparam = 'isPwa';
            }

            var is_pwa = urlParams.get(wpjsloadbymdz_pwaparam);

            if (is_pwa || is_pwa == 'true' || is_pwa == '1') {

                ajxloader_displayMode = 'standalone';

            } else {

                /*Check Cookies*/
                var all_page_cookies = document.cookie;
                all_page_cookies = all_page_cookies.split(";")
                for (var cook = 0; cook < all_page_cookies.length; cook++) {

                    var cook_test = all_page_cookies[cook].split('=');

                    if (cook_test[0] !== null && cook_test[0] !== undefined) {
                        cook_test[0] = cook_test[0].trim();
                    } else cook_test[0] = "";

                    if (cook_test[1] !== null && cook_test[1] !== undefined) {
                        cook_test[1] = cook_test[1].trim();
                    } else cook_test[1] = "";

                    if (cook_test[0] == wpjsloadbymdz_pwaparam && (cook_test[1] == '1' || cook_test[1] || cook_test[1] == 'true' || cook_test[1] === true)) {
                        ajxloader_displayMode = 'standalone';
                    }
                }
            }
        }
    } else ajxloader_displayMode = "normal";


    if (ajxloader_displayMode != 'standalone') {

        if (wpjsloadbymdz_active !== null && wpjsloadbymdz_active !== undefined && wpjsloadbymdz_active == "1") {

            var wpjsloadbymdz_adminbar = document.getElementById("wpadminbar");
            if (wpjsloadbymdz_adminbar === null || wpjsloadbymdz_adminbar === undefined || wpjsloadbymdz_runon_wpdashbar == 1) {

                jQuery(document).ready(function () {

                    /*Pro-Feature*/
                    if (typeof elementor !== 'undefined') {
                        var tst_elem = elementor.hooks
                        if (tst_elem !== null && tst_elem !== undefined) {
                            return;
                        }
                    }
                    /***/


                    wpjsloadermdz_a_tags();

                    if (wpjsloadbymdz_doonscroll == '1') {
                        window.addEventListener("scroll", wpjsloadermdz_a_tags);
                    }

                    if ((wpjsloadbymdz_cache_remover == '1') || (wpjsloadbymdz_user_isin == '1' && wpjsloadbymdz_cache_uesrs == '0')) {
                        localStorage.clear();
                    }

                });

                /*History-API*/
                if (window.history && history.pushState) {

                    let now_url = location.href;
                    now_url = now_url.replaceAll("#", "");

                    window.addEventListener('load', function () {

                        window.addEventListener('popstate', function () {

                            var curr_url = location.href;
                            var check_url = curr_url.split(now_url);

                            if (check_url[1] !== null && check_url[1] !== undefined) {

                                if (check_url[1] == "#") {
                                    return;
                                }

                                if (check_url[1].includes("#")) {
                                    return;
                                }

                            }

                            var curr_url = location.href;
                            wpjsloadermdz_getpage_ajax(curr_url, loader_css, 0);

                        }, false);


                    }, false);
                }


            }
        }

    }
};