import{L as w}from"./Layout-DIVdUaBZ.js";import{T as V}from"./TextInput-DDvOh0mT.js";import{S as k}from"./SelectInput-CJrVPIBV.js";import{T as C}from"./TextareaInput-CYfXtUDA.js";import{L as v}from"./LoadingButton-DQHYFAIm.js";import{F as L}from"./FileInput-D8MC2ke3.js";import{i as T,Z as I,r as i,c as m,a as s,b as l,d as h,w as u,t as n,o as d,F as U,j as x,e as B}from"./app-CK3cEAAe.js";import{_ as E,C as F,B as S,E as H,I as M,M as P,P as D,U as N,H as j,a as A,L as Q,b as R,T as q,c as Z,d as z,e as G,f as J,g as K}from"./UploadAdapter-DaiRSwB-.js";import{_ as O}from"./FlashMessages-ByEdcHWZ.js";import"./moment-BywspGD9.js";import"./v4-SoommWqA.js";const W={metaInfo:{title:"Create a new post"},components:{LoadingButton:v,SelectInput:k,TextareaInput:C,TextInput:V,FileInput:L,Link:T,Head:I,Ckeditor:E},layout:w,props:{title:String,types:Array},remember:"form",data(){return{editor:F,editorConfig:{plugins:[S,H,M,P,D,N,j,A,Q,R,q,Z,z,G,J],toolbar:["heading","|","bold","italic","link","bulletedList","numberedList","|","outdent","indent","|","insertTable","blockQuote","|","imageUpload","mediaEmbed","|","undo","redo"],table:{toolbar:["tableColumn","tableRow","mergeTableCells"]},extraPlugins:[function(o){o.plugins.get("FileRepository").createUploadAdapter=a=>new K(a)}]},form:this.$inertia.form({title:null,type_id:null,image:null,details:""})}},methods:{store(){this.form.post(this.route("posts.store"))}}},X={class:"bg-white rounded-md shadow overflow-hidden max-w-full"},Y={class:"p-8 -mr-6 -mb-8 flex flex-wrap"},$={value:null},ee=["value"],te={class:"pr-6 pb-8 w-full"},oe={class:"form-label"},re={class:"px-8 py-4 bg-gray-50 border-t border-gray-100 flex justify-end items-center"};function le(r,o,a,ie,e,p){const f=i("Head"),c=i("text-input"),b=i("select-input"),g=i("ckeditor"),_=i("file-input"),y=i("loading-button");return d(),m("div",null,[s(f,{title:r.$t(a.title)},null,8,["title"]),l("div",X,[l("form",{onSubmit:o[4]||(o[4]=h((...t)=>p.store&&p.store(...t),["prevent"]))},[l("div",Y,[s(c,{modelValue:e.form.title,"onUpdate:modelValue":o[0]||(o[0]=t=>e.form.title=t),error:e.form.errors.title,class:"pr-6 pb-8 w-full lg:w-2/3",label:r.$t("Title")},null,8,["modelValue","error","label"]),s(b,{modelValue:e.form.type_id,"onUpdate:modelValue":o[1]||(o[1]=t=>e.form.type_id=t),error:e.form.errors.type_id,class:"pr-6 pb-8 w-full lg:w-1/3",label:r.$t("Type"),required:!0},{default:u(()=>[l("option",$,n(r.$t("Select type")),1),(d(!0),m(U,null,x(a.types,t=>(d(),m("option",{key:t.id,value:t.id},n(t.name),9,ee))),128))]),_:1},8,["modelValue","error","label"]),l("div",te,[l("label",oe,n(r.$t("Details"))+":",1),s(g,{id:"ticketDetails",editor:e.editor,modelValue:e.form.details,"onUpdate:modelValue":o[2]||(o[2]=t=>e.form.details=t),error:e.form.errors.details,config:e.editorConfig},null,8,["editor","modelValue","error","config"])]),s(_,{modelValue:e.form.image,"onUpdate:modelValue":o[3]||(o[3]=t=>e.form.image=t),error:e.form.errors.image,class:"pb-8 pr-6 w-full lg:w-1/3",type:"file",accept:"image/*",label:r.$t("Feature image")},null,8,["modelValue","error","label"])]),l("div",re,[s(y,{loading:e.form.processing,class:"btn-indigo",type:"submit"},{default:u(()=>[B(n(r.$t("Create Post")),1)]),_:1},8,["loading"])])],32)])])}const _e=O(W,[["render",le]]);export{_e as default};
