PageSourceSearch

https://www.premierholidays.co.uk/_nuxt/R7epaDw0.js

js premierholidays.co.uk collected 2026-09-24 23:36:02 UTC 4,782 bytes, 1 lines download raw bytes

1import{_ as h,c as v}from"./lTr7RkzU.js";import{m as k}from"./VssDMSj1.js";import{A as V}from"./Do0WmMcc.js";import{M as T,I as b,V as u,X as o,a0 as i,a1 as g,Q as D,a9 as y,W as _,U as A,d}from"./BfJgI-1u.js";const N={__name:"FormsSignUp",emits:["submit"],setup(w,{expose:t}){t();const c=d(),e=d(!1),r=d(),x=d(!1),s=d({isTrade:!1,firstName:null,surname:null,ABTA:null,email:null}),a={message:c,loading:e,errorMsg:r,success:x,formData:s,submit:()=>{e.value=!0,console.log(s.value),c.value=null,r.value=null,fetch("/api/thirdparty/mailchimp",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s.value)}).then(async f=>{if(!f.ok){try{const m=await f.json();let l=m?.detail||m?.title;if(!l&&typeof m?.message=="string")try{l=JSON.parse(m.message)?.title||l}catch{}l=="Member Exists"?r.value="You are already a subscriber":r.value=l||"There was a problem submitting the form"}catch{const l=await f.text();try{const p=JSON.parse(l);r.value=p?.title||l||"There was a problem submitting the form"}catch{r.value=l||"There was a problem submitting the form"}}e.value=!1;return}await f.json(),c.value=" ",x.value=!0,s.value={},e.value=!1,useGtm().trackEvent({event:"newsletter_subscription",formName:"sign_up_model"})}).catch(()=>{r.value="Network error. Please try again.",e.value=!1})},get motion(){return k},get AnimatePresence(){return V}};return Object.defineProperty(a,"__isScriptSetup",{enumerable:!1,value:!0}),a}},S={class:"flex flex-col gap-4"},B={key:0,class:"flex flex-col items-center text-center gap-3 py-6"},U={class:"text-sm text-gray-600"},j={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},O={class:"flex flex-wrap gap-4"},P=["disabled"],C={key:0,class:"flex items-center gap-2 bg-red-50 border border-red-200 text-red-700 rounded-lg px-4 py-2 text-sm"};function F(w,t,c,e,r,x){const s=v,n=T("FormKit");return u(),b("div",S,[e.success?(u(),b("div",B,[o(s,{name:"material-symbols:check-circle-rounded",class:"text-5xl text-green-600"}),t[6]||(t[6]=i("p",{class:"text-lg font-bold text-ph-blue"},"You're signed up!",-1)),i("p",U,g(e.message),1)])):(u(),b(D,{key:1},[i("div",j,[o(n,{type:"text",label:"First name",modelValue:e.formData.firstName,"onUpdate:modelValue":t[0]||(t[0]=a=>e.formData.firstName=a),"aria-required":"false","outer-class":"w-full min-w-0 !max-w-full","input-class":"w-full max-w-full"},null,8,["modelValue"]),o(n,{type:"text",label:"Surname",modelValue:e.formData.surname,"onUpdate:modelValue":t[1]||(t[1]=a=>e.formData.surname=a),"aria-required":"false","outer-class":"w-full min-w-0 !max-w-full","input-class":"w-full max-w-full"},null,8,["modelValue"]),o(n,{type:"email",label:"Email address",validation:"required|email","validation-visibility":"live",modelValue:e.formData.email,"onUpdate:modelValue":t[2]||(t[2]=a=>e.formData.email=a),"outer-class":"w-full min-w-0 !max-w-full sm:col-span-2","input-class":"w-full max-w-full"},null,8,["modelValue"])]),i("div",O,[o(n,{type:"checkbox","decorator-icon":"check",label:"Are you a travel agent?",name:"isTrade",modelValue:e.formData.isTrade,"onUpdate:modelValue":t[3]||(t[3]=a=>e.formData.isTrade=a),classes:{outer:"mb-0",wrapper:"flex items-center",inner:"flex items-center",decorator:"block w-5 h-5 border border-gray-300 rounded mr-2 bg-white peer-checked:bg-ph-blue peer-checked:border-ph-blue relative flex items-center justify-center",decoratorIcon:"w-3 h-3 text-white absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",input:"appearance-none absolute opacity-0 w-0 h-0 peer focus-visible:outline-none",label:"text-sm text-gray-700 font-medium cursor-pointer mb-0"}},null,8,["modelValue"])]),o(e.AnimatePresence,null,{default:_(()=>[e.formData.isTrade?(u(),A(e.motion.div,{key:"abta",class:"overflow-hidden",initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.18,ease:"easeInOut"}},{default:_(()=>[o(n,{type:"text",label:"ABTA",modelValue:e.formData.ABTA,"onUpdate:modelValue":t[4]||(t[4]=a=>e.formData.ABTA=a),"aria-required":"true","outer-class":"w-full min-w-0 !max-w-full","input-class":"w-full max-w-full"},null,8,["modelValue"])]),_:1})):y("",!0)]),_:1}),i("button",{type:"button",onClick:t[5]||(t[5]=a=>e.submit()),disabled:!e.formData.email||e.loading,class:"w-fit bg-ph-yellow text-black rounded-full px-5 py-2 flex justify-center items-center transition-colors hover:bg-ph-blue hover:text-white cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-ph-yellow disabled:hover:text-black"},g(e.loading?"Submitting…":"Submit"),9,P),e.errorMsg?(u(),b("div",C,[o(s,{name:"material-symbols:error-outline-rounded",class:"text-lg shrink-0"}
1),i("span",null,g(e.errorMsg),1)])):y("",!0)],64))])}const J=h(N,[["render",F],["__file","signUp.vue"]]);export{J as _};

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.