!function(e,a,o,t){function n(e){return e.replace(/\\(.)/gm,"$1")}e.imp_editor_storage_get_saves_list=function(a){e.post(ajaxurl,{action:"image_map_pro_get_saves_list"}).done(function(e){var o=0;try{e=(e=n(e)).replace(/\\'/g,"'"),o=JSON.parse(e),a(o)}catch(o){e=(e=n(e)).replace(/\\'/g,"'"),console.log(o),console.log("Failed to load saves list."),console.log(e),a(!1)}})},e.imp_editor_storage_get_save=function(a,o){var t={action:"image_map_pro_get_save",saveID:a};e.ajax({type:"POST",url:ajaxurl,data:t}).done(function(e){var a=0;try{a=JSON.parse(n(e));o(a)}catch(a){console.log(a),console.log("Failed to verify loaded image map."),console.log("Original JSON: "),console.log(n(e)),o(!1)}})},e.imp_editor_storage_store_save=function(a,o){var t={action:"image_map_pro_store_save",json:JSON.stringify(a),saveID:a.id,name:a.general.name,shortcode:a.general.shortcode};e.ajax({type:"POST",url:ajaxurl,data:t}).done(function(e){try{JSON.parse(n(e));o(!0)}catch(a){console.log(a),console.log("Failed to verify saved image map."),console.log("Original JSON: "),console.log(n(e)),o(!1)}})},e.imp_editor_storage_delete_save=function(a,o){var t={action:"image_map_pro_delete_save",saveID:a};e.post(ajaxurl,t).done(function(e){o()})},e.imp_editor_storage_get_last_save=function(a){e.post(ajaxurl,{action:"image_map_pro_get_last_save"}).done(function(e){e.length>0?a(e):a(!1)})},e.imp_editor_storage_set_last_save=function(a,o){var t={action:"image_map_pro_set_last_save",saveID:a};e.post(ajaxurl,t).done(function(){o()})}}(jQuery,window,document);