import{d as b,s as f,T as x,k as _,c as v,o as y,a as e,t as g,u as n,l as w,v as k,b as r,x as U,E as V}from"./app-Do7K7VDV.js";import{_ as $}from"./RichEditor-CXkSpnD_.js";import{_ as C}from"./InputFieldError-0BmYlL24.js";import{_ as L}from"./AdminLayout-DeT_GLTC.js";import{_ as S}from"./SpinnerBtn-C-rqKjUt.js";import"./AssetModal-C18ToIEK.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ToastrContainer-CtYDvNPN.js";const T={class:"text-xl"},B={class:"flex"},E={class:"ai-ck-section"},R=b({layout:L}),H=Object.assign(R,{__name:"Edit",props:["aiGenerated"],setup(u){const{copyToClipboard:d}=f(),c=u,s=x({...c.aiGenerated}),a=_(""),m=()=>{s.patch(route("admin.ai-generated-history.update",c.aiGenerated.uuid),{onSuccess:()=>{s.reset(),V.success("Submitted Successfully")}})};function p(l,t){const o=new Blob([l],{type:"text/html"}),i=document.createElement("a");i.href=URL.createObjectURL(o),i.download=t?t.replace(" ","-"):"untitled.html",i.click(),URL.revokeObjectURL(url)}return(l,t)=>(y(),v("form",{onSubmit:U(m,["prevent"]),class:"card card-body mx-auto mt-5 w-11/12 space-y-4 lg:w-8/12"},[e("p",T,g(l.trans("Template")),1),e("div",B,[e("button",{class:"me-1",type:"button",onClick:t[0]||(t[0]=o=>n(d)(n(s).content))},t[4]||(t[4]=[e("i",{class:"bx bx-file text-2xl"},null,-1)])),e("button",{class:"ms-1",type:"button",onClick:t[1]||(t[1]=o=>p(n(s).content,a.value))},t[5]||(t[5]=[e("i",{class:"bx bx-download text-2xl"},null,-1)]))]),e("div",null,[w(e("input",{"onUpdate:modelValue":t[2]||(t[2]=o=>a.value=o),type:"text",class:"input w-full",placeholder:"Untitled Document..."},null,512),[[k,a.value]])]),e("div",E,[r($,{modelValue:n(s).content,"onUpdate:modelValue":t[3]||(t[3]=o=>n(s).content=o)},null,8,["modelValue"]),r(C,{class:"mb-5",message:n(s).errors.content},null,8,["message"])]),e("div",null,[r(S,{processing:n(s).processing,classes:"btn btn-primary","btn-text":"Update"},null,8,["processing"])])],32))}});export{H as default};
