import Z from"./BAF3-NvC.js";import{d as q,N as V,a9 as J,X as H,aa as ee,b as W,w as X,e as te,p as _,m as s,t as R,n,i as N,j as t,k as se,x as K,_ as oe,l,s as x,h as w,a1 as ne,E as P,ab as ae,ac as le,ad as ie,a4 as ce,B as re,D as me,G as z,H as pe,a2 as _e,v as de}from"./C8f13W7F.js";import{_ as ue}from"./iGalTc-U.js";import{_ as fe}from"./CZN4PVT9.js";import{_ as ge}from"./Dn4JAinj.js";import{_ as he}from"./DADRQt2Y.js";import{_ as xe}from"./ceHpQxOH.js";import{g as ve}from"./CzfpFqmb.js";import{i as G}from"./CK3E5Q7y.js";import"./Dg4l_M5U.js";import"./vvDeIB6B.js";import"./DRuiAZCF.js";import"./B8obR31q.js";import"./8-ARhfJj.js";import"./cH9aa7CT.js";const ye={class:"bg-white mt-8 p-5 rounded-10px"},ke={class:"min-w-90px flex"},be={class:"mt-8"},De={key:0},we={class:"grid grid-cols-2 gap-4 mt-6 mb-8"},Te={key:2,class:"h-4"},$e=q({__name:"LifeInsuranceForm",props:{title:{},poptavkaText:{},submitButton:{}},async setup(Q){var j,M;let i,u;const T=V(),r=J(),o=ve(),v=H(""),p=H({}),{phone:$}=ee(),F=W(),f=([i,u]=X(()=>F.getForm("/life-insurance-form")),i=await i,u(),i),y=(j=f.fields.find(e=>e.name==="callTimeOptionsSunday"))==null?void 0:j.options,g=(M=f.fields.find(e=>e.name==="callTimeOptions"))==null?void 0:M.options;function k(e){const a=new Date,d=G(new Date(e))?y:g;let c=[];return new Date(e||new Date).getDate()===a.getDate()?c=d.filter(m=>Number.parseInt(m.label.substring(0,2).replace(":",""))>a.getHours()+4):e?c=d:c=[],{disabledDates:[new Date().getHours()>13?new Date:""],maxDate:new Date(a.setDate(a.getDate()+9)),times:c}}const h=te(()=>{var e,a;return k((a=(e=p==null?void 0:p.value)==null?void 0:e.values)==null?void 0:a.callDate)});async function S(e){var D;const d=((D=(G(new Date(e.callDate))?y:g).find(C=>C.code===e.callTime))==null?void 0:D.label)||null,c={FullName:e.fullName,Phone:e.phone.replace(/\s/g,""),CallMode:e.call,ContactDate:e.callDate||"",ContactTime:d||"",Message:e.message,IsBrandEpojisteni:T.platformName==="epojisteni"},m=await se("/einsurance/life-insurance",{method:"GET",params:{body:JSON.stringify(c)}}),b=async()=>{r.successEvent({step:"data-entry"}),r.addCustomEvent({event:"enhanced_conversion_data",email:null,phone_number:`${e.phonePrefix}${e.phone}`}),await ae("/zivotni-pojisteni/dekujeme")},B=()=>{r.errorEvent({event_label:m.errorMessage}),v.value=m.errorMessage};m.errorMessage?B():await b()}return(e,a)=>{var E;const d=K,c=le,m=fe,b=ge,B=he,D=xe,C=ie,U=ce,Y=oe;return l(),_("div",ye,[s("h3",null,R(e.title),1),n(d,{class:"mt-3",document:e.poptavkaText},null,8,["document"]),n(Y,{ref_key:"form",ref:p,class:"mt-6",fields:(E=t(f))==null?void 0:E.fields,onSubmit:S},{default:N(()=>{var A,O,I,L;return[n(c,{class:"mt-8",name:"fullName",rules:t(o).fullName},null,8,["rules"]),n(c,{class:"mt-8",name:"phone",rules:t(o).phone,mask:t($),inputmode:"tel"},{start:N(()=>[s("div",ke,[n(m,{name:"phonePrefix","hide-border":"",class:"text-black"}),a[0]||(a[0]=s("div",{class:"flex items-center"},[s("div",{class:"border-r-1 border-gray h-3/6"})],-1))])]),_:1},8,["rules","mask"]),s("div",be,[n(b,{name:"call",class:"flex flex-col gap-2"})]),((O=(A=t(p))==null?void 0:A.values)==null?void 0:O.call)==="2"?(l(),_("div",De,[s("div",we,[s("div",null,[n(B,{name:"callDate","min-date":new Date,"max-date":t(h).maxDate,transitions:""},null,8,["min-date","max-date"])]),s("div",null,[n(m,{name:"callTime",options:t(h).times,disabled:!((L=(I=t(p))==null?void 0:I.values)!=null&&L.callDate)||!t(h).times.length},null,8,["options","disabled"])])])])):x("",!0),n(D,{name:"message",class:"mt-8"}),t(v)?(l(),w(C,{key:1,class:"mt-2 w-full"},{default:N(()=>[ne(R(t(v)),1)]),_:1})):(l(),_("div",Te)),e.submitButton?(l(),w(U,P({key:3,"test-id":"submit"},e.submitButton,{submit:""}),null,16)):x("",!0)]}),_:1},8,["fields"])])}}}),Fe={class:"bg-background pb-20"},Se={class:"content-container md:flex md:justify-center md:gap-10"},Be={class:"<md:pt-1"},Ce={class:"mt-5 flex max-w-500px"},Ne={class:"mb-2 text-gray-dark text-sm"},Pe={class:"max-w-400px"},je={class:"content-container grid grid-cols-[100px,100px] gap-2 justify-center mt-8"},Me={class:"max-w-100px inline-flex justify-center"},Ee={key:0,class:"col-span-2 inline-flex justify-center"},Ye=q({__name:"demand",async setup(Q){let i,u;const T=W(),r=([i,u]=X(()=>T.getPage()),i=await i,u(),i),o=r.customPage[0];return re(r),J({event:"calculator-form",event_type:"calculator"}),(v,p)=>{var k;const $=Z,F=de,f=K,y=ue,g=_e;return l(),_(z,null,[(k=t(r))!=null&&k.header[0]?(l(),w($,me(P({key:0},t(r).header[0])),null,16)):x("",!0),s("div",Fe,[s("div",Se,[s("div",Be,[n($e,{title:t(o).poptavkaTitle,"poptavka-text":t(o).poptavkaText,"submit-button":t(o).submitButton[0],class:"max-w-600px"},null,8,["title","poptavka-text","submit-button"]),s("div",Ce,[n(F,{class:"mr-3 mt-1 text-primary",icon:"far-lock",size:"18"}),s("div",Ne,[n(f,{document:t(o).gdprAgreement,class:"text-sm"},null,8,["document"])])])]),s("div",Pe,[n(y,P(t(o).infoBanner[0],{class:"mt-8"}),null,16),s("div",je,[(l(!0),_(z,null,pe(t(o).logos,(h,S)=>(l(),_("div",Me,[t(o).logos.length%2!==0&&t(o).logos.length-1!==S?(l(),w(g,{key:0,src:h,height:"40",class:"rounded-xl"},null,8,["src"])):x("",!0)]))),256)),t(o).logos.length%2!==0?(l(),_("div",Ee,[n(g,{src:t(o).logos[t(o).logos.length-1],height:"40",class:"rounded-xl"},null,8,["src"])])):x("",!0)])])])])],64)}}});export{Ye as default};