function page_generator_pro_research_get_status(e,a){page_generator_pro_research_timeout=setInterval((function(){console.log("Fired"),jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"page_generator_pro_research_get_status",id:e},success:function(e){return console.log(e),e.success?e.data.completed?(clearTimeout(page_generator_pro_research_timeout),tinyMCE.activeEditor.selection.setContent("<p>"+e.data.content.join("</p><p>")+"</p>"),wpzinc_modal_show_success_and_exit("Done!","")):void wpzinc_modal_update_message(e.data.message):(clearTimeout(page_generator_pro_research_timeout),wpzinc_modal_show_error_message(e.data))}})}),5e3)}var page_generator_pro_research_timeout;tinymce.PluginManager.add("page_generator_pro_research",(function(e,a){e.addButton("page_generator_pro_research",{title:"Research Content for a given Topic",image:a+"../../../../_modules/dashboard/feather/book.svg",cmd:"page_generator_pro_research"}),e.addCommand("page_generator_pro_research",(function(){var e=prompt("Enter the topic to research content for e.g. plumbing");null!==e&&(wpzinc_modal_open("Researching..."),jQuery.post(ajaxurl,{action:"page_generator_pro_research",topic:e},(function(e){if(!e.success)return wpzinc_modal_show_error_message(e.data);wpzinc_modal_update_message(e.data.message),page_generator_pro_research_get_status(e.data.id,e.data.estimated_time)})))}))}));