import{_ as N,a as S,b as V,c as k}from"./BfPjfeWt.js";import{u as B,c as p,b as c,a as e,t,e as r,f as $,g as b,h as f,n as C,i as D,k as E,l as d,o as v}from"./BKiFavna.js";import{u as H}from"./BZ7f31ti.js";import{u as I}from"./DKzHUNYh.js";import{u as M}from"./BOqT4ZDK.js";import{_ as U}from"./DlAUqK2U.js";import"./DxB0DKYp.js";const q={"data-theme":"light"},z={id:"main-content",role:"main"},A={class:"form-wrap"},F={class:"form-container narrow"},G={class:"lead"},j={class:"form-group"},J={class:"form-group"},K=["disabled"],L={__name:"subscribe",setup(O){const{lang:a}=B(),{api:g}=H(),m=I(),o=E({name:"",email:""}),i=d(!1),n=d(""),u=d("success"),h=async()=>{i.value=!0,n.value="";try{const s=await g.post("/newsletter/subscribe",o);n.value=s.data.message,u.value="success",m.success(s.data.message)}catch(s){n.value=s.message,u.value="error",m.error(s.message),m.error(s.message)}finally{i.value=!1}};return M({title:a.value==="bn"?"সাবস্ক্রাইব":"Subscribe"}),(s,l)=>{const w=N,y=S,T=V,x=k;return v(),p("div",q,[c(w),c(y),c(T),e("main",z,[e("div",A,[e("div",F,[e("h1",null,t(r(a)==="bn"?"সাবস্ক্রাইব করুন":"Subscribe"),1),e("p",G,t(r(a)==="bn"?"সর্বশেষ সংবাদ ইমেইলে পেতে সাবস্ক্রাইব করুন।":"Get latest news in your inbox."),1),e("form",{onSubmit:$(h,["prevent"])},[e("div",j,[e("label",null,t(r(a)==="bn"?"নাম":"Name"),1),b(e("input",{"onUpdate:modelValue":l[0]||(l[0]=_=>o.name=_)},null,512),[[f,o.name]])]),e("div",J,[e("label",null,t(r(a)==="bn"?"ইমেইল":"Email")+" *",1),b(e("input",{"onUpdate:modelValue":l[1]||(l[1]=_=>o.email=_),type:"email",required:""},null,512),[[f,o.email]])]),n.value?(v(),p("p",{key:0,class:C(["msg",u.value])},t(n.value),3)):D("",!0),e("button",{disabled:i.value,class:"submit-btn"},t(i.value?"Subscribing...":r(a)==="bn"?"সাবস্ক্রাইব":"Subscribe"),9,K)],32)])])]),c(x)])}}},ee=U(L,[["__scopeId","data-v-b56b0792"]]);export{ee as default};
