1import{f as k,u as $,g as p,h as C,r as U,c as x,i as j,j as B,n as V,k as S,o as A,a as D,b as e,d as m,l as M,m as h,t as l,w as r,v as d,p as b}from"./app-CbgE8Ayp.js";import{i as P,f as N,_ as R,F as T}from"./footer-BhY4vGzD.js";const E={class:"bg-cfred text-font-gotham"},F={class:"px-5 text-right"},L=e("button",{type:"button",class:"relative inline-flex items-center rounded-full bg-white px-2.5 mt-3 py-1 text-sm font-semibold text-cfred shadow-sm hover:bg-gray-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"},[e("svg",{class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[e("path",{"fill-rule":"evenodd",d:"M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z","clip-rule":"evenodd"})]),h("Â Back ")],-1),Y={class:"max-w-2xl lg:max-w-4xl px-4 py-16 mx-auto text-center sm:py-20 sm:px-6 lg:px-8"},I=e("br",null,null,-1),z={class:"text-xl text-white"},q={class:"font-bold"},G=["src"],H=e("br",null,null,-1),J=e("div",{class:"relative"},[e("div",{class:"absolute inset-0 flex items-center","aria-hidden":"true"},[e("div",{class:"w-full border-t border-gray-300"})])],-1),K=e("br",null,null,-1),O={class:"grid grid-cols-1 gap-x-8 gap-y-6 sm:grid-cols-2 text-left"},Q=e("div",{class:"sm:col-span-2"},[e("span",{class:"text-gray-300"},[e("i",null,"Please enter your full name and address, otherwise your MP will not reply")])],-1),W=e("label",{for:"first-name",class:"block text-sm font-semibold leading-6 text-white"},"Your name",-1),X={class:"mt-2.5"},Z=e("label",{for:"last-name",class:"block text-sm font-semibold leading-6 text-white"},"Your surname",-1),ee={class:"mt-2.5"},te={class:"sm:col-span-2"},se=e("label",{for:"address",class:"block text-sm font-semibold leading-6 text-white"},"Your home address",-1),oe={class:"mt-2.5"},ne={class:"sm:col-span-2"},ae=e("label",{for:"message",class:"block text-sm font-semibold leading-6 text-white"},"Email Body (Please edit before sending)",-1),ie={class:"mt-2.5"},le=e("label",{for:"message",class:"block text-sm font-semibold leading-6 text-white"},"The following will be added to your email:",-1),re={readonly:"",class:"block w-full rounded-md border-0 px-3.5 pb-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"},de={class:"flex flex-col items-center justify-center py-5"},ce={class:"flex flex-row items-center justify-center"},me=["href"],ue={class:"text-white"},he={__name:"compose",setup(fe){const a=k(),_=$(),n=p({name:"Loading ...",image:"/person.png",email:"loading..."}),t=p({name:null,surname:null,address:null,postcode:"",body:"...",subject:"",bcc:"[email protected]"}),{text:ge,copy:y,copied:v,isSupported:pe}=C({}),u=U(null),f=x(()=>` 2${t.body} 3${t.name??"[Name]"}, ${t.surname??"[Surname]"} 4${t.address??"[Address]"}, ${t.postcode}`),w=x(()=>`mailto:${n.email}?subject=${encodeURIComponent(t.subject)}&bcc=${encodeURIComponent(t.bcc)}&body=${encodeURIComponent(f.value).replaceAll("%20%0A","%0D%0A")}`);function g(){a.loaded&&(t.body=a.content.template_body.replaceAll("[name]",n.name),t.subject=a.content.email_title??a.content.title)}return j(()=>a.loaded,()=>{g()},{immediate:!0}),B(async()=>{const i=(new URLSearchParams(document.location.search).get("pc")??"").trim();if(!P(i))_.push("/");else{t.postcode=i;const{name:s,email:c,image:o}=await N(i);n.name=s,n.email=c,n.image=o,g(),V(()=>u.value.focus())}}),(i,s)=>{const c=S("router-link");return A(),D("div",E,[e("div",F,[m(c,{class:"my-24 font-medium text-white cursor-pointer",to:"/"},{default:M(()=>[L]),_:1})]),e("div",Y,[m(R),I,e("h2",z,[h(" Your MP is: "),e("span",q,l(n.name),1)]),e("img",{class:"m-auto rounded-md",src:n.image},null,8,G),H,J,K,e("div",O,[Q,e("div",null,[W,e("div",X,[r(e("input",{ref_key:"nameField",ref:u,"onUpdate:modelValue":s[0]||(s[0]=o=>t.name=o),type:"text",autofocus:"",name:"first-name",id:"first-name",autocomplete:"given-name",class:"block w-full rounded-md border-0 px-3.5 py-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"},null,512),[[d,t.name,void 0,{trim:!0}]])])]),e("div",null,[Z,e("div",ee,[r(e("input",{"onUpdate:modelValue":s[1]||(s[1]=o=>t.surname=o),type:"text",name:"last-name",id:"last-name",autocomplete:"family-name",class:"block w-full rounded-md border-0 px-3.5 py-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"},null,512),[[d,t.surname,void 0,{trim:!0}]])])]),e("div",te,[se,e("div",oe,[r(e("input",{"onUpdate:modelValue":s[2]||(s[2]=o=>t.address=o),type:"text",name:"address",id:"address",autocomplete:"address",class:"block w-full rounded-md border-0 px-3.5 py-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"},null,512),[[d,t.address,void 0,{trim:!0}]])])]),e("div",ne,[ae,e("div",ie,[r(e("textarea",{"onUpdate:modelValue":s[3]||(s[3]=o=>t.body=o),name:"message",id:"message",rows:"28",class:"block w-full rounded-md border-0 px-3.5 pt-2 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6"},null,512),[[d,t.body]])]),le,e("textarea",re,l(`${t.name??"[Name]"} ${t.surname??"[Surname]"} 5${t.address??"[Address]"}, ${t.postcode}`),1)])]),e("div",de,[e("div",ce,[e("a",{href:w.value,class:"transition duration-150 transform hover:bg-gray-200 flex items-center justify-center px-5 py-3 mt-3 text-base font-bold bg-white border border-transparent roun
5ded-md text-cfred hover:text-red-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cfred focus:ring-offset-white sm:mt-0 sm:ml-3 w-auto flex-shrink-0"},"Send Email to",8,me),e("button",{class:"transition duration-150 transform hover:bg-gray-200 flex items-center justify-center px-5 py-3 mt-3 text-sm font-bold bg-white border border-transparent rounded-md text-cfred hover:text-red-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cfred focus:ring-offset-white sm:mt-0 ml-3 w-auto flex-shrink-0",onClick:s[4]||(s[4]=o=>b(y)(f.value))},l(b(v)?"Copied":"Copy Text"),1)]),e("span",ue,l(n.email),1)])]),m(T)])}}};export{he as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.