/* empty css                            */function d(){import.meta.url,import("_").catch(()=>1),async function*(){}().next()}function l(){const a=jQuery;a(document).on("change",".saai-ai-memory-toggle",function(){const i=a(this),c=i.closest(".saai-ai-memory-control"),n=i.data("post-id"),o=i.is(":checked")?"yes":"no";i.prop("disabled",!0),a.ajax({url:saaiObj.ajaxUrl,type:"POST",headers:{"X-WP-Nonce":saaiObj.nonce},data:{post_id:n,enabled:o},success:function(t){var s;if(t.success){const e=c.find(".saai-status-indicator");if(t.status_icon)if(e.length>0)e.html(t.status_icon),e.attr("data-saai-tooltip",t.hover_text);else{const r=a('<span class="saai-status-indicator" data-saai-tooltip="'+t.hover_text+'">'+t.status_icon+"</span>");c.append(r)}else e.remove()}else{const e=a('<div class="notice notice-error is-dismissible saai-ajax-notice" style="margin: 5px 0;"><p>'+(((s=t.data)==null?void 0:s.message)||(t==null?void 0:t.message)||"Unknown error occurred")+"</p></div>");a(".wrap h1").after(e),setTimeout(function(){e.fadeOut(function(){a(this).remove()})},5e3),i.prop("checked",!o)}},error:function(){const t=a('<div class="notice notice-error is-dismissible saai-ajax-notice" style="margin: 5px 0;"><p>Network error occurred. Please try again.</p></div>');a(".wrap h1").after(t),setTimeout(function(){t.fadeOut(function(){this.remove()})},5e3),i.prop("checked",!o)},complete:function(){i.prop("disabled",!1)}})})}export{d as __vite_legacy_guard,l as r};
