import{i as w,Z as y,r as i,c as d,a as n,b as e,d as S,F as b,j as f,n as v,w as k,o as c,t as p,e as V}from"./app-CK3cEAAe.js";import{I as C}from"./moment-BywspGD9.js";import{L as T}from"./Layout-DIVdUaBZ.js";import{P as I}from"./Pagination-MejnxKj7.js";import{T as L}from"./TextInput-DDvOh0mT.js";import{S as N}from"./SelectInput-CJrVPIBV.js";import{L as U}from"./LoadingButton-DQHYFAIm.js";import{T as B}from"./TextareaInput-CYfXtUDA.js";import{_ as j}from"./FlashMessages-ByEdcHWZ.js";import"./v4-SoommWqA.js";const H={metaInfo:{title:"Contact"},components:{Icon:C,Link:w,Head:y,Pagination:I,TextInput:L,SelectInput:N,LoadingButton:U,TextareaInput:B},layout:T,props:{page:Object},remember:"form",data(){return{tabs:[{name:"Services",active:!0}],services:[{name:"",icon:"",details:""}],form:this.$inertia.form({title:"Services",slug:"services",is_active:this.page.is_active,html:JSON.parse(this.page.html)})}},methods:{update(){this.form.put(this.route("front_pages.update","services"))},activeTab(o){for(const s of this.tabs)s.active=!1;this.tabs[o].active=!0},newService(){this.form.html.services.push({name:"",icon:"",details:""})},removeService(o){this.form.html.services.splice(o,1)}}},D={class:"bg-white rounded-md shadow overflow-hidden mr-2"},F={class:"p-8 -mr-6 -mb-8 flex flex-wrap"},O={class:"w-full mx-auto"},P={class:"border-b border-gray-200 dark:border-gray-700 tab-head"},z={class:"flex flex-wrap -mb-px",id:"myTab","data-tabs-toggle":"#myTabContent",role:"tablist"},A=["onClick"],E={class:"tab-content"},J={class:"text-sm"},M=["onClick"],Z={class:"flex flex-col md:flex-row"},$={class:"px-8 py-4 bg-gray-50 border-t border-gray-100 flex items-center"};function q(o,s,G,K,m,r){const _=i("Head"),h=i("icon"),u=i("text-input"),g=i("textarea-input"),x=i("loading-button");return c(),d("div",null,[n(_,{title:"Services"}),e("div",D,[e("form",{onSubmit:s[1]||(s[1]=S((...t)=>r.update&&r.update(...t),["prevent"]))},[e("div",F,[e("div",O,[e("div",P,[e("ul",z,[(c(!0),d(b,null,f(m.tabs,(t,l)=>(c(),d("li",{class:"mr-2",role:"presentation",key:l},[e("div",{class:v(["inline-block text-gray-500 hover:text-gray-600 hover:border-gray-300 rounded-t-lg py-4 px-4 text-sm text-center border-transparent border-b-2 dark:text-gray-400 dark:hover:text-gray-300",{active:t.active}]),onClick:a=>r.activeTab(l)},p(t.name),11,A)]))),128))])]),e("div",E,[e("div",{class:v(["p-4 t-content",{active:m.tabs[0].active}])},[e("span",{class:"btn-indigo border-gray-200 float-right inline-block rounded-full mt-1 mb-1 cursor-pointer",onClick:s[0]||(s[0]=(...t)=>r.newService&&r.newService(...t))}," + Add New "),(c(!0),d(b,null,f(m.form.html.services,(t,l)=>(c(),d("fieldset",{class:"border border-solid border-gray-200 p-4 w-full mb-3 relative",key:l},[e("legend",J,"Service "+p(l+1),1),e("span",{class:"remove cursor-pointer items-center bg-red-700 rounded-full w-6 h-6 inline-flex justify-center absolute top-[-20px] right-[-10px] fill-white",onClick:a=>r.removeService(l)},[n(h,{name:"dash",class:"w-4 h-5"})],8,M),e("div",Z,[n(u,{modelValue:t.name,"onUpdate:modelValue":a=>t.name=a,class:"pr-6 w-full lg:w-2/3",label:o.$t("Name")},null,8,["modelValue","onUpdate:modelValue","label"]),n(u,{modelValue:t.icon,"onUpdate:modelValue":a=>t.icon=a,class:"w-full lg:w-1/3",label:o.$t("Icon")},null,8,["modelValue","onUpdate:modelValue","label"])]),n(g,{name:"content",modelValue:t.details,"onUpdate:modelValue":a=>t.details=a,class:"pt-3 w-full",rows:2,label:o.$t("Details")},null,8,["modelValue","onUpdate:modelValue","label"])]))),128))],2)])])]),e("div",$,[n(x,{loading:m.form.processing,class:"btn-indigo ml-auto",type:"submit"},{default:k(()=>[V(p(o.$t("Save")),1)]),_:1},8,["loading"])])],32)])])}const re=j(H,[["render",q]]);export{re as default};
