jQuery(document).ready(function(e){let r=!1,a=null;e('span.trash a, input[name="bulk_action"]').click(function(a){if(!r){if("bulk_action"===e(this).attr("name")){if("delete"!==e('select[name="action"]').val()&&"delete"!==e('select[name="action2"]').val())return;result=confirm("Are you sure you want to delete these Keywords?")}else result=confirm("Are you sure you want to delete this Keyword?");if(!result)return a.preventDefault(),!1;r=!0}}),e('select[name="source"]').length>0&&(page_generator_pro_conditional_fields_initialize(),e('select[name="source"]').trigger("change")),e("textarea.wpzinc-codemirror").length>0&&e("textarea.wpzinc-codemirror").each(function(){wp.codeEditor.initialize(e(this),page_generator_pro_keywords)}),e("table.page-generator-pro-keywords-table").length&&(a=e("table.page-generator-pro-keywords-table").DataTable({ajax:{url:ajaxurl,type:"POST",data:{action:"page_generator_pro_keywords_get_terms",nonce:e('input[name="page-generator-pro_nonce"]').val(),id:e("table.page-generator-pro-keywords-table").data("keyword-id")}},processing:!0,serverSide:!0,responsive:!1,autoWidth:!0,ordering:!1,scrollX:!0,scrollY:500})),e("button.page-generator-pro-refresh-terms").on("click",function(r){r.preventDefault();const t=e(this);e("span.spinner",e(t).parent()).addClass("is-active"),e(t).prop("disabled","disabled"),e.post(ajaxurl,{action:"page_generator_pro_keywords_refresh_terms",nonce:e(t).data("nonce"),keyword:e(t).data("keyword")},function(r){e("span.spinner",e(t).parent()).removeClass("is-active"),e(t).prop("disabled",!1),r.success?a.ajax.reload():alert(r.data)})})});