import{m as S,a3 as x,c as u,b as e,t as o,d as p,v as m,a as v,F as h,r as y,u as V,w as C,k as w,o as b}from"./app-13978987.js";import{_ as g}from"./ImageInput.vue_vue_type_script_setup_true_lang-4a03e2f5.js";import{_ as B}from"./SpinnerBtn-cb152833.js";import{u as R}from"./optionUpdate-b5f61f3c.js";const O={class:"mb-10 mt-2 rounded border p-3 dark:border-gray-600"},$={class:"mb-2"},j={class:"mb-10 mt-2 rounded border p-3 dark:border-gray-600"},N={class:"mb-2"},F={class:"mb-2"},M={class:"mb-10 mt-2 rounded border p-3 dark:border-gray-600"},D={class:"mb-2"},E={class:"mb-2"},L=e("small",null,[w("Note: use "),e("code",null,"<span>text</span>"),w(" to make text italic and "),e("code",null,"<br/>"),w(" to line break ")],-1),X={class:"mr-2"},A={class:"grid grid-cols-2 gap-2"},P={class:"mb-2 flex items-center justify-between"},Y={class:"rounded-full bg-indigo-600 p-2 py-1 text-center text-white"},q={class:"flex w-full gap-2"},z=["onClick"],G={class:"mb-2 flex items-center justify-between"},H={class:"rounded-full bg-indigo-600 p-2 py-1 text-center text-white"},J={class:"flex w-full gap-2"},K=["onClick"],Q={class:"mb-2"},le={__name:"Integration",props:["data"],setup(d){const r=d,a=S({...r.data}),f=R();x(()=>{var l,t,n,i;["hero","list","slider"].forEach(_=>a.value[_]=a.value[_]||{}),(t=(l=r.data.slider)==null?void 0:l.row_one)!=null&&t.length||(r.data.slider.row_one=[{...c}]),(i=(n=r.data.slider)==null?void 0:n.row_two)!=null&&i.length||(r.data.slider.row_two=[{...c}])});const c={preview:""},k=()=>{var s,l,t;(t=(l=(s=r.data)==null?void 0:s.slider)==null?void 0:l.row_one)==null||t.push({...c})},I=s=>{var l,t,n;(n=(t=(l=r.data)==null?void 0:l.slider)==null?void 0:t.row_one)==null||n.splice(s,1)},T=()=>{var s,l,t;(t=(l=(s=r.data)==null?void 0:s.slider)==null?void 0:l.row_two)==null||t.push({...c})},U=s=>{var l,t,n;(n=(t=(l=r.data)==null?void 0:l.slider)==null?void 0:t.row_two)==null||n.splice(s,1)};return(s,l)=>(b(),u("form",{method:"POST",onSubmit:l[6]||(l[6]=C(t=>V(f).submit("integration_page",a.value),["prevent"])),enctype:"multipart/form-data"},[e("h6",null,o(s.trans("Banner Section")),1),e("div",O,[e("div",$,[e("label",null,o(s.trans("Title")),1),p(e("input",{type:"text",class:"input","onUpdate:modelValue":l[0]||(l[0]=t=>a.value.hero.title=t)},null,512),[[m,a.value.hero.title]])]),v(g,{label:s.trans("Banner Image"),modelValue:a.value.hero.banner_img,"onUpdate:modelValue":l[1]||(l[1]=t=>a.value.hero.banner_img=t),class:"mb-2"},null,8,["label","modelValue"])]),e("h6",null,o(s.trans("List Section")),1),e("div",j,[e("div",N,[e("label",null,o(s.trans("Title")),1),p(e("input",{type:"text",class:"input","onUpdate:modelValue":l[2]||(l[2]=t=>a.value.list.title=t)},null,512),[[m,a.value.list.title]])]),e("div",F,[e("label",null,o(s.trans("Sub Title")),1),p(e("input",{type:"text",class:"input","onUpdate:modelValue":l[3]||(l[3]=t=>a.value.list.sub_title=t)},null,512),[[m,a.value.list.sub_title]])])]),e("h6",null,o(s.trans("Integrated with Your Favorite Apps")),1),e("div",M,[e("div",D,[e("label",null,o(s.trans("Top Title")),1),p(e("input",{type:"text",class:"input","onUpdate:modelValue":l[4]||(l[4]=t=>d.data.slider.top_title=t)},null,512),[[m,d.data.slider.top_title]])]),e("div",E,[e("label",null,o(s.trans("Title")),1),p(e("input",{type:"text",class:"input mb-1","onUpdate:modelValue":l[5]||(l[5]=t=>d.data.slider.title=t)},null,512),[[m,d.data.slider.title]]),L]),e("label",X,o(s.trans("Slider Items")),1),e("div",A,[e("div",null,[e("div",P,[e("p",null,o(s.trans("Row One")),1),e("button",{type:"button",onClick:k,class:"btn btn-primary me-2"}," + ")]),(b(!0),u(h,null,y(d.data.slider.row_one,(t,n)=>(b(),u("div",{class:"mb-2 flex items-center justify-between gap-x-2 border p-2 dark:border-gray-600",key:n},[e("span",Y,o(n+1),1),e("div",q,[v(g,{modelValue:t.preview,"onUpdate:modelValue":i=>t.preview=i,class:"w-full"},null,8,["modelValue","onUpdate:modelValue"]),e("button",{type:"button",onClick:i=>I(n),class:"btn btn-danger"}," X ",8,z)])]))),128))]),e("div",null,[e("div",G,[e("p",null,o(s.trans("Row Two")),1),e("button",{type:"button",onClick:T,class:"btn btn-primary me-2"}," + ")]),(b(!0),u(h,null,y(d.data.slider.row_two,(t,n)=>(b(),u("div",{class:"mb-2 flex items-center justify-between gap-x-2 border p-2 dark:border-gray-600",key:n},[e("span",H,o(n+1),1),e("div",J,[v(g,{modelValue:t.preview,"onUpdate:modelValue":i=>t.preview=i,class:"w-full"},null,8,["modelValue","onUpdate:modelValue"]),e("button",{type:"button",onClick:i=>U(n),class:"btn btn-danger"}," X ",8,K)])]))),128))])])]),e("div",Q,[v(B,{processing:V(f).processing,"btn-text":s.trans("Save Changes")},null,8,["processing","btn-text"])])],32))}};export{le as default};
