1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./DKO_kLf3.js","./m6h8_Rrz.js","./entry.DpOxG58J.css"])))=>i.map(i=>d[i]); 2import{r as m,k as te,n as oe,p as ne,z as ae,e as se,o as b,c as h,a as t,f as o,F as N,d as E,t as re,g as B,b as l,E as V,aO as q,w as x,_ as le,N as k,O as ie,h as z,y as s,P as de,Q as ue,A as F,V as $}from"./m6h8_Rrz.js";import{_ as pe}from"./oIsv4qHt.js";import{t as R,c as L,a as _,b as I,E as U,F as H}from"./NAJdwfbZ.js";import{M as ce}from"./BLDnKh19.js";import{I as j}from"./CYOy8010.js";import{u as fe}from"./QsGfvOYf.js";const me={id:"otp-modal",tabindex:"-1","aria-hidden":"true",class:"fixed top-0 left-0 right-0 z-50 hidden w-full p-4 overflow-x-hidden overflow-y-auto md:inset-0 h-full sm:h-[calc(100%-1rem)] max-h-full","data-modal-placement":"center-center"},be={class:"absolute sm:relative w-full max-w-md max-h-full max-sm:bottom-0"},xe={class:"relative bg-white sm:rounded-[40px] shadow p-8 max-sm:rounded-t-[24px]"},ge={class:"flex"},we={class:"basis-11/12 text-lg sm:text-2xl"},ve={class:"font-semibold text-[#001973]"},ye={class:"relative"},he={class:"absolute inset-y-0 left-0 flex items-center pl-3.5 pointer-events-none"},Ce=["disabled"],Ee={class:"grid grid-cols-6 gap-4"},ke=["disabled"],Pe={__name:"OtpModal",emits:["success"],async setup(Fe,{emit:Q}){let w,S;const G=Q,J=de(()=>ue(()=>import("./DKO_kLf3.js"),__vite__mapDeps([0,1,2]),import.meta.url)),K=R(L().shape({mobile:_().required().test("phone","Please enter a valid mobile number",()=>!!f.value?.instance?.isValidNumber()),referralCode:_().optional()})),W=R(L().shape({otp:_().length(6).required()})),u=m(1),v=m(null),y=m(null),f=m(null),p=m(!1),g=te(),d=oe(),{trackEvent:A}=fe(),{update:O}=([w,S]=ne(()=>ae({fetchSessionOnInitialization:!1})),w=await w,S(),w),C=m(!!d.referralCode);se(()=>{const n=document.getElementById("otp-modal");n&&(window.otpModal=new ce(n,{backdrop:"static",onShow:()=>{f.value?.input.focus()},onHide:()=>{u.value=1,y.value?.resetForm()}}),document.querySelectorAll("[data-focus-input-init]").forEach(function(e){e.addEventListener("keyup",function(){const a=this.getAttribute("data-focus-input-prev"),r=this.getAttribute("data-focus-input-next");Y(this,a,r)}),e.addEventListener("paste",function(a){a.preventDefault();const i=(a.clipboardData||window.clipboardData).getData("text").replace(/\D/g,"");document.querySelectorAll("[data-focus-input-init]").forEach((M,P)=>{if(i[P]){const T=M.getAttribute("data-focus-input-next");M.value=i[P],T&&document.getElementById(T).focus()}}),c()})}),g.query.login==="1"&&window.otpModal.show())});async function X(n){try{p.value=!0;const e=f.value?.instance?.getSelectedCountryData()?.dialCode;await F("/api/leads",{method:"POST",body:{mobile:{code:e?`+${e}`:"+971",number:n.mobile},tracking:{...d.tracking,utmSource:d.tracking.utmSource||g.name,utmMedium:d.tracking.utmMedium||"otp"},assignedTo:d.affiliateUser}},!0);const a=await F("/api/auth/otp/send",{method:"POST",body:{mobile:{code:e?`+${e}`:"+971",number:n.mobile},referralCode:n.referralCode||void 0}},!0,null,y);a.data.isNew&&A("SignUp",{content_name:g.fullPath,source_page:g.name}),await O(a.data),await $(500),await d.$patch({authorization:a.data.authorization}),++u.value,window.requestAnimationFrame(()=>{document.getElementById("code-1")?.focus()})}catch(e){console.error(e);const a=e.response?._data?.data?.message||e.response?._data?.data?.error||"Something went wrong! Please try again.";y.value.setErrors({mobile:a})}finally{p.value=!1}}function Y(n,e,a){let r=null;n.value.length===0?e&&(r=document.getElementById(e)):a&&(r=document.getElementById(a)),r&&(r.focus(),r.value&&r.select())}function Z(){u.value=1,window.requestAnimationFrame(()=>{f.value?.input.focus()})}async function c(){let n="";document.querySelectorAll(".otp").forEach(e=>{n+=e.value.replace(/\D/g,"")}),await v.value?.setFieldValue("otp",n,!1),n.length===6&&document.getElementById("otp-submit-btn")?.click()}async function ee(n){try{p.value=!0;const e=await F("/api/auth/otp/verify",{method:"POST",body:n},!0,null,v);await O(e.data),await $(500),await d.$patch({user:e.data.customer,authorization:e.data.authorization}),A("OTPVerified",{source_page:g.name}),D(),G("success")}catch(e){e.response?._data?.data?.message&&v.value?.setErrors({otp:e.response._data.data.message})}finally{p.value=!1}}function D(){window.otpModal?.hide()}return(n,e)=>{const a=le,r=pe;return b(),h("div",me,[t("div",be,[t("div",xe,[t("div",ge,[t("h3",we,[o(u)===1?(b(),h(N,{key:0},[e[7]||(e[7]=E(" Let's verify your ",-1)),e[8]||(e[8]=t("span",{class:"font-semibold text-[#001973]"},"number",-1))],64)):o(u)===2?(b(),h(N,{key:1},[e[9]||(e[9]=E(" Enter verification code sent to ",-1)),t("span",ve,re(o(f)?.instance?.getNumber()),1)],64)):B("",!0)]),t("button",{type:"button",class:"basis-1/12 text-gray-400 bg-transparent hover:bg-blue-100 hover:text-blue-900 rounded-lg text-sm w-8 h-8 ml-auto inline-flex justify-center items-center",onClick:D},[l(o(j),{icon:"ion:close-circle-outline",class:"w-6 h-6 text-[#001973]"}),e[10]||(e[10]=t("span",{class:"sr-only"},"Close modal",-1))])]),V(t("div",null,[l(o(H),{ref_key:"mobileForm",ref:y,class:"space-y-4 mt
2-6","validation-schema":o(K),"initial-values":{mobile:"",referralCode:o(d).referralCode||""},onSubmit:X},{default:x(()=>[l(o(I),{name:"mobile",as:"div",class:"flex flex-col w-full text-xs sm:text-sm"},{default:x(({field:i})=>[e[11]||(e[11]=t("label",{for:"phone",class:"gap-2 self-start text-center whitespace-nowrap text-neutral-800 mb-2"}," Mobile Number ",-1)),l(a,null,{default:x(()=>[l(o(J),k({ref_key:"phoneInput",ref:f},{...i,..."telInputOptions"in n?n.telInputOptions:o(ie)},{"input-props":{class:"p-3 w-full bg-white rounded-lg border border-[#CECECE] focus:ring-[#001973] focus:border-[#001973] max-md:max-w-full"}}),null,16)]),_:2},1024),l(o(U),{name:"mobile",class:"mt-1 text-[10px] text-xs text-red-600"})]),_:1}),o(C)?(b(),z(o(I),{key:0,name:"referralCode",as:"div",class:"flex flex-col w-full text-xs sm:text-sm"},{default:x(({field:i})=>[e[12]||(e[12]=t("label",{for:"referral-code",class:"gap-2 self-start text-center whitespace-nowrap text-neutral-800 mb-2"}," Referral Code ",-1)),t("div",ye,[t("div",he,[l(r,{src:"/svg/profile.svg",alt:"Referral Code",class:"w-6 h-6",loading:"lazy",placeholder:""})]),t("input",k(i,{id:"referral-code",type:"text",class:"p-2.5 sm:p-4 lg:p-2.5 xl:p-4 pl-12 sm:pl-12 lg:pl-12 xl:pl-12 w-full border border-[#CECECE] focus:ring-[#001973] focus:border-[#001973] rounded-xl text-base",placeholder:"Referral Code (Optional)"}),null,16)])]),_:1})):(b(),h("a",{key:1,href:"#",class:"block text-[#001973] text-right font-semibold",onClick:e[0]||(e[0]=s(i=>C.value=!o(C),["prevent"]))}," Have a referral code? ")),t("button",{type:"submit",class:"w-full text-[#8DE971] bg-[#001973] hover:bg-[#001973]/80 disabled:bg-[#EFEFF1] disabled:border-[#EFEFF1] disabled:text-[#A1A0A9] focus:ring-blue-400 focus:ring-4 focus:outline-hidden font-medium rounded-lg text-sm px-5 py-3 text-center",disabled:o(p)},[o(p)?(b(),z(o(j),{key:0,icon:"eos-icons:loading",class:"inline w-4 h-4 me-1 mb-1 text-[#001973]"})):B("",!0),e[13]||(e[13]=E(" Continue ",-1))],8,Ce)]),_:1},8,["validation-schema","initial-values"])],512),[[q,o(u)===1]]),V(t("div",null,[l(o(H),{ref_key:"otpForm",ref:v,class:"space-y-4 mt-6","validation-schema":o(W),"initial-values":{otp:""},onSubmit:ee},{default:x(()=>[l(o(I),{name:"otp",as:"div",class:"flex flex-col w-full text-xs sm:text-sm mb-2"},{default:x(({field:i})=>[t("input",k(i,{type:"hidden"}),null,16),e[20]||(e[20]=t("label",{for:"code-1",class:"gap-2 self-start text-center whitespace-nowrap text-neutral-800 mb-2"}," One Time Password (OTP) ",-1)),t("div",Ee,[t("div",null,[e[14]||(e[14]=t("label",{for:"code-1",class:"sr-only"},"First code",-1)),t("input",{id:"code-1",type:"number","data-focus-input-init":"","data-focus-input-next":"code-2",class:"otp w-full text-center text-base border border-[#CECECE] focus:ring-[#001973] focus:border-[#001973] rounded-xl [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none py-3",onInput:s(c,["stop"]),onChange:e[1]||(e[1]=s(()=>{},["stop"]))},null,32)]),t("div",null,[e[15]||(e[15]=t("label",{for:"code-2",class:"sr-only"},"Second code",-1)),t("input",{id:"code-2",type:"number","data-focus-input-init":"","data-focus-input-prev":"code-1","data-focus-input-next":"code-3",class:"otp w-full text-center text-base border border-[#CECECE] focus:ring-[#001973] focus:border-[#001973] rounded-xl [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none py-3",onInput:s(c,["stop"]),onChange:e[2]||(e[2]=s(()=>{},["stop"]))},null,32)]),t("div",null,[e[16]||(e[16]=t("label",{for:"code-3",class:"sr-only"},"Third code",-1)),t("input",{id:"code-3",type:"number","data-focus-input-init":"","data-focus-input-prev":"code-2","data-focus-input-next":"code-4",class:"otp w-full text-center text-base border border-[#CECECE] focus:ring-[#001973] focus:border-[#001973] rounded-xl [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none py-3",onInput:s(c,["stop"]),onChange:e[3]||(e[3]=s(()=>{},["stop"]))},null,32)]),t("div",null,[e[17]||(e[17]=t("label",{for:"code-4",class:"sr-only"},"Fourth code",-1)),t("input",{id:"code-4",type:"number","data-focus-input-init":"","data-focus-input-prev":"code-3","data-focus-input-next":"code-5",class:"otp w-full text-center text-base border border-[#CECECE
2] focus:ring-[#001973] focus:border-[#001973] rounded-xl [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none py-3",onInput:s(c,["stop"]),onChange:e[4]||(e[4]=s(()=>{},["stop"]))},null,32)]),t("div",null,[e[18]||(e[18]=t("label",{for:"code-5",class:"sr-only"},"Fifth code",-1)),t("input",{id:"code-5",type:"number","data-focus-input-init":"","data-focus-input-prev":"code-4","data-focus-input-next":"code-6",class:"otp w-full text-center text-base border border-[#CECECE] focus:ring-[#001973] focus:border-[#001973] rounded-xl [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none py-3",onInput:s(c,["stop"]),onChange:e[5]||(e[5]=s(()=>{},["stop"]))},null,32)]),t("div",null,[e[19]||(e[19]=t("label",{for:"code-6",class:"sr-only"},"Sixth code",-1)),t("input",{id:"code-6",type:"number","data-focus-input-init":"","data-focus-input-prev":"code-5",class:"otp w-full text-center text-base border border-[#CECECE] focus:ring-[#001973] focus:border-[#001973] rounded-xl [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none py-3",onInput:s(c,["stop"]),onChange:e[6]||(e[6]=s(()=>{},["stop"]))},null,32)])]),l(o(U),{name:"otp",class:"mt-1 text-[10px] text-xs text-red-600"})]),_:1}),t("button",{type:"button",class:"w-full border text-[#001973] border-[#001973] hover:bg-[#001973] hover:text-[#8DE971] disabled:bg-[#EFEFF1] disabled:border-[#EFEFF1] disabled:text-[#A1A0A9] focus:ring-blue-400 focus:ring-4 focus:outline-hidden font-medium rounded-lg text-sm px-5 py-3 text-center",disabled:o(p),onClick:Z}," Change Number ",8,ke),e[21]||(e[21]=t("button",{id:"otp-submit-btn",type:"submit",class:"hidden"},null,-1))]),_:1},8,["validation-schema"])],512),[[q,o(u)===2]])])])])}}};export{Pe 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.