var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
jQuery(document).ready(function($) {

    'use strict';

    $(document.body).on('mousedown', 'a[data-ail]' , function(){

        'use strict';

        const link_type = 'ail';
        
        //save the click with an ajax request
        track_link(link_type, $(this));
        
    });

    $(document.body).on('mousedown', 'a[data-mil]' , function(){

        'use strict';

        const link_type = 'mil';
        
        //save the click with an ajax request
        track_link(link_type, $(this));
        
    });
    
    //track the link with an ajax request
    function track_link(link_type, caller_element){

        'use strict';

        //set source
        const source_post_id = caller_element.attr('data-' + link_type);

        //set target
        const target_url = caller_element.attr('href');
        
        //prepare ajax request
        const data = {
            "action": "track_internal_link",
            "security": window.DAIM_PARAMETERS.nonce,
            "link_type": link_type,
            "source_post_id": source_post_id,
            "target_url": target_url
        };

        //send the ajax request
        $.post(window.DAIM_PARAMETERS.ajax_url, data, function(data) {});
        
    }

});
}