@cleartrip/ct-platform-login-module 3.5.2 → 3.5.4-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,716 @@
1
- import{__assign as e,__awaiter as o,__generator as t,__spreadArray as i,__rest as n}from"tslib";import{jsx as r,jsxs as l,Fragment as a}from"react/jsx-runtime";import{useRef as c,useState as d,useEffect as s,useCallback as u,useMemo as _}from"react";import{Toast as m}from"@cleartrip/ct-design-toast";import{Spacer as p}from"@cleartrip/ct-design-spacer";import{Drawer as g}from"@cleartrip/ct-platform-drawer";import{ThemeProvider as f}from"@cleartrip/ct-design-theme";import{LOGIN_CONSTANTS as h,NAVIGATION_ROUTES as v}from"@cleartrip/ct-platform-constants";import{getRavenEventProps as x,ravenSDKTrigger as A,isIOSApp as C,autoReadOtp as b,isEmpty as E,updateNativeOnLogin as N,validateOtp as w,isHTMLInputElement as T,isNumeric as y,isFKSSOEnabled as D,isAndroidApp as I,isPwa as P,handleFKSSO as k,MULTI_SPACE as F,isValidMobileNumber as O,showMobileNumberHint as B,getCurrentPathName as Q,getQueryParam as R,updateNativeAndroidOnSignIn as S,triggerOTPListener as U,sendLoginOtp as G,sendEventWithUserInsights as L}from"@cleartrip/ct-platform-utils";import{FieldV2 as X,PhoneField as z}from"@cleartrip/ct-design-field";import{Spinner as M}from"@cleartrip/ct-design-spinner";import{Typography as V,TypographyVariant as J}from"@cleartrip/ct-design-typography";import{AlertCallout as W}from"@cleartrip/ct-design-alert-callout";import{InfoIcon as Z,Edit as q,CheckCircle as j}from"@cleartrip/ct-design-icons";import H from"classnames";import{Button as K}from"@cleartrip/ct-design-button";import{Divider as Y}from"@cleartrip/ct-design-divider";import{FlipkartLogo as $}from"@cleartrip/ct-platform-assets";import{Swiper as ee,SwiperSlide as oe}from"swiper/react";import te,{Autoplay as ie,Navigation as ne,Pagination as re}from"swiper";function le(e,o){void 0===o&&(o={});var t=o.insertAt;if(e&&"undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&i.firstChild?i.insertBefore(n,i.firstChild):i.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}var ae={mobileinput_footertext:"index-module_mobileinput_footertext__jPQ-g","mobileinput-seperator":"index-module_mobileinput-seperator__7Ewok",mobileinput_seperatortext:"index-module_mobileinput_seperatortext__-KDOp",slider_carousel_wrapper:"index-module_slider_carousel_wrapper__0SuGB",login_form:"index-module_login_form__tpSDz",nonUtilsSelector_toast:"index-module_nonUtilsSelector_toast__lvWmB",login_otp_error:"index-module_login_otp_error__o3y2L",login_otp_input:"index-module_login_otp_input__L-3P8",footer_text:"index-module_footer_text__nkeJv","swiper-custom-pagination":"index-module_swiper-custom-pagination__Ma1gV",otp_box_wrapper:"index-module_otp_box_wrapper__sM2Ba",otp_container:"index-module_otp_container__1CE4N",swiper:"index-module_swiper__r5-8U","swiper-slide":"index-module_swiper-slide__Zchn0"};le(".index-module_mobileinput_footertext__jPQ-g a{color:#0f6bff;text-decoration:none}.index-module_mobileinput-seperator__7Ewok{position:relative}.index-module_mobileinput_seperatortext__-KDOp{background:#fff;left:0;margin:0 auto;position:absolute;right:0;text-align:center;top:-10px;width:40px}.index-module_slider_carousel_wrapper__0SuGB{border-top-left-radius:16px;border-top-right-radius:16px;width:100dvw}.index-module_login_form__tpSDz{background-color:#fff;padding-left:16px;padding-right:16px}.index-module_nonUtilsSelector_toast__lvWmB{bottom:12px!important;margin-bottom:12px;margin:0 auto!important;padding:12px 16px!important;width:calc(100% - 48px)!important;z-index:2000}.index-module_login_otp_error__o3y2L{padding-top:4px}.index-module_login_otp_input__L-3P8{font-size:24px!important;font-style:normal;font-weight:600!important;height:56px!important;line-height:28px;padding:auto;text-align:center;width:56px!important}.index-module_footer_text__nkeJv{color:grey!important;font-size:12px!important}.index-module_swiper-custom-pagination__Ma1gV{--swiper-theme-color:#fff;--swiper-pagination-color:#fff;--swiper-pagination-bullet-inactive-color:#999;--swiper-pagination-bullet-inactive-opacity:1}.index-module_swiper-custom-pagination__Ma1gV *>span{height:6px;width:6px}.index-module_otp_box_wrapper__sM2Ba{margin-right:8px}.index-module_otp_container__1CE4N{display:flex;flex-direction:column;margin-top:24px}.index-module_swiper__r5-8U{height:100%;width:100%}.index-module_swiper__r5-8U .index-module_swiper-slide__Zchn0{height:auto}.index-module_swiper-slide__Zchn0 img{display:block;height:100%;object-fit:fill;width:100%}");var ce="index-module_loader__container__VX-VO",de="index-module_three-dots-loader__i7R-R";le('.index-module_loader__container__VX-VO{align-items:center;background:#fff;border-radius:32px;box-shadow:0 8px 24px 0 rgba(26,26,26,.1);display:flex;height:34px;justify-content:center;left:50%;padding:12px;position:absolute;top:50%;transform:translate(-50%,-50%);width:66px}.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R{animation:index-module_three-dots-loader__i7R-R 1s linear infinite alternate;animation-delay:.5s;background-color:#1a1a1a;border-radius:5px;height:8px;position:relative;width:8px}.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R:after,.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R:before{content:"";display:inline-block;position:absolute;top:0}.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R:before{animation:index-module_three-dots-loader__i7R-R 1s infinite alternate;animation-delay:0s;background-color:#1a1a1a;border-radius:5px;height:8px;left:-15px;width:8px}.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R:after{animation:index-module_three-dots-loader__i7R-R 1s infinite alternate;animation-delay:1s;background-color:#1a1a1a;border-radius:5px;height:8px;left:15px;width:8px}@keyframes index-module_three-dots-loader__i7R-R{0%{background-color:#1a1a1a}50%,to{background-color:grey}}');var se,ue=function(){return r("div",e({className:ce},{children:r("div",{className:de})}))};!function(e){e[e.DETECTING=0]="DETECTING",e[e.FAILED=1]="FAILED",e[e.DETECTED=2]="DETECTED"}(se||(se={}));var _e=function(n){var _=n.mobileNumber,m=n.errorCallout,g=n.ravenPayload,f=n.otpInputHeight,D=n.skipProfileFlow,I=n.otpResendDisabled,P=n.hotelsLoyaltyFlow,k=n.getOTP,F=n.setCtaDisabled,O=n.setErrorCallout,B=n.setMobileNumber,Q=n.setShowMobilePage,R=n.handleLoginSuccess,S=n.handleLoginFailure,U=c(Array(4).fill(null)),G=d(se.DETECTING),L=G[0],z=G[1],J=d(h.OTP_COUNTDOWN),H=J[0],K=J[1],Y=d(""),$=Y[0],ee=Y[1],oe=d(!0),te=oe[0],ie=oe[1],ne=d(!1),re=ne[0],le=ne[1],ce=d(""),de=ce[0],_e=ce[1],me=d(!0),pe=me[0],ge=me[1],fe=d(!1),he=fe[0],ve=fe[1],xe=c(),Ae=c(),Ce="CT";s((function(){be();var o=x();A("u_login_click",e({action_name:"login_otp_screen_opened",login_form:null==o?void 0:o.loginForm,login_type:"native",vertical:null==o?void 0:o.vertical,page_name:null==o?void 0:o.pageName},g))}),[]),s((function(){C()&&ge(!1)}),[]),s((function(){be()}),[]),s((function(){he||(U.current[0].focus(),U.current[0].click())}),[he]),s((function(){0===H&&ie(!1)}),[H]),s((function(){var e;return te&&H>0&&(e=setInterval((function(){K((function(e){return e-1}))}),1e3)),function(){clearInterval(e)}}),[te,H]);var be=u((function(){return o(void 0,void 0,void 0,(function(){var e;return t(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,b()];case 1:return e=o.sent(),ee(e),z(se.DETECTED),(null==e?void 0:e.length)===h.OTP_LENGTH&&Ne&&Ne(e,!0),[3,3];case 2:return"NOT_SUPPORTED"===o.sent()&&ge(!1),[3,3];case 3:return[2]}}))}))}),[pe]),Ee=u((function(o){var t=x();A("u_login_error",e({action_name:"otp_incorrect",login_form:null==t?void 0:t.loginForm,login_type:"native",vertical:null==t?void 0:t.vertical,page_name:null==t?void 0:t.pageName},g));var i=null==o?void 0:o.message;"OTP_VALIDATE_LIMIT_EXCEEDED"!==i&&ee(""),U.current[0].focus(),U.current[0].click();var n=h[i],r="string"==typeof n?n:h.INVALID_OTP;_e(r)}),[U]),Ne=u((function(i,n){return o(void 0,void 0,void 0,(function(){var o,r,l,a,c;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),o=x(),A("u_login_click",e({action_name:"otp_entered",login_form:null==o?void 0:o.loginForm,login_type:"native",entry_type:n?"autodetected":"manual_entry",vertical:null==o?void 0:o.vertical,page_name:null==o?void 0:o.pageName},g)),i===xe.current&&Ae.current&&Ae.current-Date.now()<=100?[2]:(xe.current=i,Ae.current=Date.now(),P&&ve(!0),[4,w(_,i)]);case 1:return r=t.sent(),l=r.status,a=r.action,200!==Number(l)||E(a)?(P&&ve(!1),S(Ce)):(le(!0),_e(""),N(),"SIGNUP"===a?(D||(window.location.href=v.PERSONAL_DETAILS+"?onboardingFlow=true"),R(Ce,!0)):R(Ce)),[3,3];case 2:return c=t.sent(),P&&ve(!1),S(Ce),Ee(c),[3,3];case 3:return[2]}}))}))}),[xe,Ae,le,z,_e,Ee]),we=function(){return o(void 0,void 0,void 0,(function(){var e,o,i,n,r;return t(this,(function(t){switch(t.label){case 0:return[4,navigator.clipboard.readText()];case 1:return(e=t.sent())&&y(e)&&(o=e.slice(0,h.OTP_LENGTH).split(""),null===(n=U.current[h.OTP_LENGTH-1])||void 0===n||n.focus(),null===(r=U.current[h.OTP_LENGTH-1])||void 0===r||r.click(),i=o.join(""),ee(i),i.length===h.OTP_LENGTH&&Ne(i,!1)),[2]}}))}))},Te=u((function(e,o){var t,i;O(""),""!==e.target.value&&o<U.current.length-1&&(null===(t=U.current[o+1])||void 0===t||t.focus(),null===(i=U.current[o+1])||void 0===i||i.click());var n=U.current.map((function(e){return T(e)?e.value:""})).join("").slice(0,4);ee(n),n.length===h.OTP_LENGTH&&Ne(n,!1)}),[ee,Ne]),ye=u((function(e,o){var t,i,n;"Backspace"===e.key&&o>0&&""===(null===(t=U.current[o])||void 0===t?void 0:t.value)&&(e.preventDefault(),null===(i=U.current[o-1])||void 0===i||i.focus(),null===(n=U.current[o-1])||void 0===n||n.click())}),[U]),De=u((function(){K(h.OTP_COUNTDOWN),ie(!0),k(_);var o=x();A("u_login_error",e({action_name:"resend_otp_clicked",login_form:null==o?void 0:o.loginForm,login_type:"native",vertical:null==o?void 0:o.vertical,page_name:null==o?void 0:o.pageName},g))}),[K,ie]),Ie=u((function(){F(!0),Q(!0),B("")}),[Q]);return l("div",e({className:"flex flex-column bg-neutral-100",style:{height:f}},{children:[m&&r(W,{variant:"error",textNode:m,prefixIconNode:r(Z,{fill:"red"}),style:{color:"#ffff",backgroundColor:"#db201e"},className:"fs-12"}),l("div",e({className:"flex flex-bottom"},{children:[l(V,e({variant:"HM1",color:"heading"},{children:[h.OTP_TEXT," ",r("br",{}),_]})),r("div",e({className:"pl-2",onClick:Ie},{children:r(q,{})}))]})),l("div",e({className:ae.otp_container},{children:[l("div",e({className:"flex",style:P?{width:"max-content",position:"relative"}:{}},{children:[i([],Array(h.OTP_LENGTH),!0).map((function(o,t){return r("div",e({className:ae.otp_box_wrapper},{children:r(X,{prompt:{hasError:!!de},type:"number",placeholder:"",value:$[t],max:1,inputMode:"numeric",className:ae.login_otp_input,variant:"md",ref:function(e){e&&(U.current[t]=e)},onKeyDown:function(e){return ye(e,t)},onChange:function(e){return Te(e,t)},onPaste:we,autoFocus:0===t,disabled:!(!P||!he)})}),t)})),P&&he&&r(ue,{})]})),!!de&&r(V,e({variant:"P1",color:"warning",className:ae.login_otp_error},{children:de}))]})),r(p,{className:"pt-2"}),L===se.DETECTING&&!re&&pe&&H>h.RESEND_OTP_COUNTDOWN&&l("div",e({className:"flex flex-middle"},{children:[r(M,{width:"20px",height:"20px",borderColor:"#11a670",className:"bg-neutral-900 bc-black"}),r(V,e({variant:"B3",className:"fs-12 fw-500 ml-1 c-neutral-700"},{children:h.AUTO_DETECTING_TEXT}))]})),L===se.DETECTING&&H<=h.RESEND_OTP_COUNTDOWN&&pe&&!re&&r(a,{children:l("div",e({className:"flex"},{children:[r(V,e({variant:"B3",className:"fs-12 fw-500 c-neutral-700 "},{children:h.OTP_RESEND_TEXT})),r(p,{className:"ml-1"}),I?r(V,e({className:"color-neutral-200 fw-500",variant:"B3"},{children:h.RESEND_CTA})):l(a,{children:[0===H&&r(a,{children:r(V,e({isClickable:!0,variant:"B3",onClick:De,color:"link",className:"\n fs-12 fw-500 c-pointer"},{children:h.RESEND_CTA}))}),H>0&&r(V,e({color:"disabled",variant:"B3"},{children:" Resend ("+H+"s)"}))]})]}))}),!de&&re&&r(a,{children:l("div",e({className:"flex flex-middle"},{children:[r(j,{}),r(V,e({variant:"P1",color:"success",className:"fs-12"},{children:L===se.DETECTED?h.AUTO_DETECTED_TEXT:h.VERIFIED_MESSAGE}))]}))}),r(p,{className:"mt-24"})]}))},me={loader:"index-module_loader__63LeU","With-full-opacity":"index-module_With-full-opacity__ZSY-U",loader__content:"index-module_loader__content__Q6kJl",loader__spinner:"index-module_loader__spinner__6B3AR","loader-rotate":"index-module_loader-rotate__efcf3",loader__heading:"index-module_loader__heading__7YZ3N",loader__text:"index-module_loader__text__1QcLi"};le(".index-module_loader__63LeU{align-items:center;background-color:hsla(0,0%,100%,.95);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:0}.index-module_loader__63LeU.index-module_With-full-opacity__ZSY-U{background-color:#fff}.index-module_loader__content__Q6kJl{max-width:280px;text-align:center}.index-module_loader__spinner__6B3AR{animation:index-module_loader-rotate__efcf3 .8s linear infinite;border:2px solid rgba(51,102,204,.3);border-radius:50%;border-top-color:#36c;display:inline-block;height:30px;margin-bottom:10px;position:relative;width:30px}.index-module_loader__heading__7YZ3N{color:#000;font-size:18px;font-weight:600;margin-bottom:5px}.index-module_loader__text__1QcLi{color:rgba(0,0,0,.8);font-size:16px;line-height:1.5}");var pe=function(o){var t=o.title,i=o.message,n=o.className;return r("div",e({className:"".concat(me.utilswrapper," utilswrapper")},{children:r("div",e({className:H(me.loader,n)},{children:l("div",e({className:me.loader__content},{children:[r("div",{className:me.loader__spinner}),r("h5",e({className:me.loader__heading},{children:t})),r("p",e({className:me.loader__text},{children:i}))]}))}))}))},ge=function(i){var n=i.sendingOtp,_=i.ctaDisabled,m=i.getOTP,p=i.setErrorCallout,g=i.errorCallout,f=i.mobileNumber,C=i.setMobileInputHeight,b=i.setMobileNumber,E=i.fallbackUri,N=i.skipProfileFlow,w=i.currentPageUri,T=i.ravenPayload,y=i.hotelsLoyaltyFlow,Q=d(D)[0],R=d(!1),S=R[0],U=R[1],G=c(null),L=c(null);s((function(){if(L.current){var e=L.current.clientHeight;C(e)}}),[L.current]),s((function(){var e;return G.current&&(e=setTimeout((function(){var e;null===(e=G.current)||void 0===e||e.focus()}),100)),function(){clearTimeout(e)}}),[]),s((function(){I()&&J()}),[]);var X=u((function(){return o(void 0,void 0,void 0,(function(){var o,i;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),o=x(),A("u_login_click",e({action_name:"login_with_flipkart_clicked",login_form:null==o?void 0:o.loginForm,login_type:"fk_sso",vertical:null==o?void 0:o.vertical,page_name:null==o?void 0:o.pageName},T)),U(!0),[4,k(E,N?w:v.PERSONAL_DETAILS+"?onboardingFlow=true",w)];case 1:return i=t.sent(),y||U(!1),P()&&(window.location.href=i),[3,3];case 2:return t.sent(),U(!1),[3,3];case 3:return[2]}}))}))}),[]),M=u((function(o,t){void 0===t&&(t=!1),p("");var i=o.target.value||"";if(i=i.replace(F," ").trimStart(),b(i),O(o.target.value)){m(i);var n=x();A("u_login_click",e({action_name:"get_otp_clicked",login_form:null==n?void 0:n.loginForm,login_type:"native",entry_type:"auto_click",vertical:null==n?void 0:n.vertical,page_name:null==n?void 0:n.pageName},T)),A("u_login_click",e(t?{action_name:"phone_number_autodetected",login_form:null==n?void 0:n.loginForm,login_type:"native",entry_type:"autodetected",vertical:null==n?void 0:n.vertical,page_name:null==n?void 0:n.pageName}:{action_name:"phone_number_entered",login_form:null==n?void 0:n.loginForm,login_type:"native",entry_type:"manual_entry",vertical:null==n?void 0:n.vertical,page_name:null==n?void 0:n.pageName},T))}}),[b]),J=u((function(){return o(void 0,void 0,void 0,(function(){var e,o;return t(this,(function(t){switch(t.label){case 0:return[4,B()];case 1:return e=t.sent(),o={target:{value:e}},e&&M(o,!0),[2]}}))}))}),[M]),q=u((function(){var o=x();A("u_login_click",e({action_name:"policy_click",login_form:null==o?void 0:o.loginForm,login_type:"native",vertical:null==o?void 0:o.vertical,page_name:null==o?void 0:o.pageName},T)),window.location.href=v.PRIVACY_POLICY}),[]),j=u((function(){var o=x();A("u_login_click",e({action_name:"tnc_click",login_form:null==o?void 0:o.loginForm,login_type:"native",vertical:null==o?void 0:o.vertical,page_name:null==o?void 0:o.pageName},T)),window.location.href=v.TERMS}),[]);return l("div",e({className:"flex flex-column",ref:L},{children:[g&&r(W,{variant:"error",textNode:g,prefixIconNode:r(Z,{fill:"red"}),style:{color:"#ffff",backgroundColor:"#db201e"},className:"fs-12"}),r(V,e({variant:"HM1",color:"heading",className:"mb-4 fs-24"},{children:h.LOGIN_TO_CT})),r("label",e({style:{visibility:"hidden",width:"0.1px",height:"0.1px"},htmlFor:"phonenumber"},{children:"Phone number"})),r(z,{onChange:M,value:f,name:"phonenumber",placeholder:"",inputMode:"numeric",ref:G,min:0,max:10,autoFocus:!0,countryCode:h.COUNTRY_CODE}),r(K,e({color:"primary",size:"medium",minWidth:"160px",disabled:_,loading:n,className:"my-6",onClick:function(){return m(f)}},{children:h.GET_OTP})),Q&&l(a,{children:[l("div",e({className:"my-6 p-relative"},{children:[r(Y,{}),r("span",e({className:"".concat(ae.mobileinput_seperatortext)},{children:"or"}))]})),r(K,e({variant:"outline",size:"medium",className:"my-6",loading:S,onClick:X,showLeftIcon:!S,LeftIcon:r("img",{src:$})},{children:h.FK_LOGIN_CTA}))]}),l("div",e({className:"pt-8 pb-6"},{children:[r(Y,{}),l("div",e({className:"flex flex-middle \n flex-center flex-wrap pt-2"},{children:[r(V,e({variant:"P1",className:ae.footer_text},{children:h.FOOTER_TEXT})),r(V,e({variant:"P1",color:"link",className:"pl-1 fs-12",isClickable:!0,onClick:q},{children:h.PRIVACY_CTA})),r(V,e({className:"px-1 fs-12 c-neutral-700",variant:"P1"},{children:"& "})),r(V,e({variant:"P1",color:"link",isClickable:!0,onClick:j,className:"fs-12"},{children:h.TNC_CTA}))]}))]}))]}))};const fe="data:image/png;base64,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",he=[{src:"https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel1.png",placeholder:fe},{src:"https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel2.png",placeholder:fe},{src:"https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel3.png",placeholder:fe}];var ve=function(o){var t=o.src,i=o.placeholderSrc,l=o.onLoad,a=n(o,["src","placeholderSrc","onLoad"]),u=d(i||t),_=u[0],m=u[1],p=c(l);return s((function(){p.current=l}),[l]),s((function(){var e=new Image;e.onload=function(){m(t),p.current&&p.current()},e.src=t}),[t]),r("img",e({src:_},a))},xe="index-module_slides__container__9XVd4",Ae="index-module_slides__container--imageContainer__q0RuP";le(".index-module_slides__container__9XVd4{align-items:center;box-sizing:border-box;display:flex;gap:1.5rem;height:197px;justify-content:center;width:100%}.index-module_slides__container--imageContainer__q0RuP{align-self:flex-start;margin-top:2rem;width:128px}");var Ce=function(o){var t=o.textData,i=o.bgColor,n=o.imageUrl,a=o.altText;return l("div",e({className:xe,style:{backgroundColor:i}},{children:[r("div",e({className:Ae},{children:r(ve,{width:128,height:128,alt:a,src:n})})),r("div",{children:null==t?void 0:t.map((function(o,t){return r(V,e({variant:J.HM2,style:{color:o.textColor,lineHeight:"24px"}},{children:o.text}),t)}))})]}))},be=function(){return[r(Ce,{bgColor:"#4F8EF0",imageUrl:"https://fastui.cltpstatic.com/image/upload/f_auto,q_auto,w_128,h_128,dpr_2/offermgmt/images/banner/Login%20Frame.png",altText:"Dhonicampaign_icon",textData:[{text:"Use code CTMAHI",textColor:"#fff"},{text:"& get flat 777 off,",textColor:"#fff"},{text:"on your first",textColor:"#032529"},{text:"flight booking",textColor:"#032529"}]},1),r(Ce,{bgColor:"#FF8D71",imageUrl:"https://fastui.cltpstatic.com/image/upload/f_auto,w_128,h_128,dpr_2/offermgmt/images/loginSheetMyntra.webp",altText:"loyality_benefits_icon",textData:[{text:"Loyalty benefits",textColor:"#fff"},{text:"and discounts",textColor:"#fff"},{text:"for Flipkart and",textColor:"#331005"},{text:"Myntra members",textColor:"#331005"}]},2),r(Ce,{bgColor:"#FFC142",imageUrl:"https://fastui.cltpstatic.com/image/upload/f_auto,w_128,h_128,dpr_2/offermgmt/images/loginSheetCoupon.webp",altText:"CTLogin_icon",textData:[{text:"Flat 25% off",textColor:"#fff"},{text:"on your first",textColor:"#fff"},{text:"hotel booking",textColor:"#fff"},{text:"Code: CTMAHI",textColor:"#332504"}]},3),r(Ce,{bgColor:"#61C149",imageUrl:"https://fastui.cltpstatic.com/image/upload/f_auto,w_128,h_128,dpr_2/offermgmt/images/loginSheetWallet.webp",altText:"EarnAndRedeem_icon",textData:[{text:"Earn and",textColor:"#fff"},{text:"redeem up to",textColor:"#fff"},{text:"650 Flipkart",textColor:"#13270F"},{text:"Supercoins",textColor:"#13270F"}]},4)]};te.use([ie,ne,re]);var Ee=function(o){var t=o.customSlides,i=o.carouselImages,n=_((function(){return E(i)?he:i}),[i]);return r("div",e({className:" o-hidden p-relative ".concat(ae.slider_carousel_wrapper)},{children:r(ee,e({autoplay:!0,slidesPerView:1,navigation:!1,loop:!0,pagination:{clickable:!0},className:"".concat(ae.swiper," ").concat(ae["swiper-custom-pagination"]),lazy:{loadPrevNextAmount:1}},{children:i&&i.length>0?null==n?void 0:n.map((function(o,t){return r(oe,e({className:ae["swiper-slide"]},{children:r(a,{children:r(ve,t<1?{src:o.src,placeholderSrc:o.placeholder,alt:"Slide ".concat(t+1),rel:"preload",fetchPriority:"high"}:{src:o.src,placeholderSrc:o.placeholder,alt:"Slide ".concat(t+1),loading:"lazy",className:"lazy"})})}),t)})):t&&t.length>0?null==t?void 0:t.map((function(o,t){return r(oe,e({className:ae["swiper-slide"]},{children:o}),t)})):be().length&&be().map((function(o,t){return r(oe,e({className:ae["swiper-slide"]},{children:o}),t)}))}))}))},Ne=function(i){var n=i.fallbackUri,c=i.isDrawerOpen,_=i.skipProfileFlow,v=i.showCarousel,C=void 0===v||v,b=i.ravenPayload,E=void 0===b?{}:b,N=i.handleLoginClose,w=i.onAuthSuccess,T=i.onAuthFailure,y=i.customSlides,D=i.carouselImages,P=void 0===D?[]:D,k=i.hotelsLoyaltyFlow,F=void 0!==k&&k,O=i.closeOnOutsideClick,B=void 0!==O&&O,X=i.sendUserInsights,z=void 0===X||X,M=d(!0),V=M[0],J=M[1],W=d(!0),Z=W[0],q=W[1],j=d(!1),H=j[0],K=j[1],Y=d(c),$=Y[0],ee=Y[1],oe=d(""),te=oe[0],ie=oe[1],ne=d(0),re=ne[0],le=ne[1],ce=d(!1),de=ce[0],se=ce[1],ue=d(""),me=ue[0],fe=ue[1],he=d(!1),ve=he[0],xe=he[1],Ae=d(!1),Ce=Ae[0],be=Ae[1],Ne=d((function(){return Q()}))[0],we=function(){be(!0)};s((function(){window&&(window.showSigninLoaderScreen=we);var e=R("fkSSOstatus"),o="FK";"signin"===e&&(I()&&S(),ye(o)),"signup"===e&&(I()&&S(),ye(o,!0)),"failure"===e&&De(o)}),[]);var Te=u((function(e){return o(void 0,void 0,void 0,(function(){var o,i,n,r;return t(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),q(!1),K(!0),U(),[4,G(e)];case 1:return o=t.sent(),"SUCCESS"===(o||{}).status&&(J(!1),K(!1)),[3,3];case 2:return i=t.sent(),console.error(i),n=(i||{}).message,K(!1),r=n&&h[n],fe(String(r||h.GENERIC_ERROR_MESSAGE)),"OTP_SEND_LIMIT_EXCEEDED"===n&&se(!0),[3,3];case 3:return[2]}}))}))}),[V,J]),ye=u((function(o,t){var i=x(),n=e({action_name:"login_successful",login_form:null==i?void 0:i.loginForm,login_type:"native",login_new:t?"sign_up":"sign_in",vertical:null==i?void 0:i.vertical,page_name:null==i?void 0:i.pageName},E);z?L("u_login_success",n):A("u_login_success",n),F?w(Ie):(w(),t&&!_||(Ie(),xe(!0)))}),[E,_,F,z]),De=u((function(e){T(e)}),[]),Ie=function(o){null==o||o.stopPropagation(),ee(!1),ie(""),q(!0);var t=x();A("u_login_click",e({action_name:"login_prompt_dismissed",login_form:null==t?void 0:t.loginForm,login_type:"native",vertical:null==t?void 0:t.vertical,page_name:null==t?void 0:t.pageName},E)),N&&"function"==typeof N&&N()};return s((function(){if(c){J(!0),ee(!0);var o=x();A("u_login_popup",e({action_name:"login_prompt_opened",login_form:null==o?void 0:o.loginForm,login_type:"native",vertical:null==o?void 0:o.vertical,page_name:null==o?void 0:o.pageName},E))}else ee(!1)}),[c]),r(f,{children:l(a,{children:[r(g,e({direction:"bottom",isOpen:$,showClose:!0,overlay:!0,handleClose:Ie,onClose:function(){},closeOnOutsideClick:B},{children:r("div",e({className:"".concat(ae.utilswrapper," utilswrapper")},{children:l("div",e({style:{maxHeight:"calc(100dvh - 60px)",overflowY:"auto",borderRadius:"16px 16px 0 0"}},{children:[C&&r(Ee,{customSlides:y,carouselImages:P}),l("div",e({className:ae.login_form},{children:[r("div",{children:r(p,{className:"pt-6"})}),V?r(ge,{device:"PWA",ctaDisabled:Z,sendingOtp:H,getOTP:Te,mobileNumber:te,setMobileNumber:ie,setMobileInputHeight:le,fallbackUri:n,skipProfileFlow:_,currentPageUri:Ne,setErrorCallout:fe,errorCallout:me,ravenPayload:E,hotelsLoyaltyFlow:F}):r(_e,{mobileNumber:te,getOTP:Te,setCtaDisabled:q,setShowMobilePage:J,handleLoginSuccess:ye,handleLoginFailure:De,otpInputHeight:re,setMobileNumber:ie,setErrorCallout:fe,errorCallout:me,otpResendDisabled:de,ravenPayload:E,skipProfileFlow:_,hotelsLoyaltyFlow:F})]}))]}))}))})),ve&&r(m,{text:"Logged in successfully!",show:ve,className:"".concat(ae.nonUtilsSelector_toast),closeTimeout:2e3}),Ce&&r(pe,{title:"Please wait",message:"Signing in...",className:"z-10 bg-white"})]})})};export{Ne as LoginModule};
1
+ import { __assign, __awaiter, __generator, __spreadArray, __rest } from 'tslib';
2
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
3
+ import { useRef, useState, useEffect, useCallback, useMemo } from 'react';
4
+ import { Spacer } from '@cleartrip/ct-design-spacer';
5
+ import { Drawer } from '@cleartrip/ct-platform-drawer';
6
+ import { ThemeProvider } from '@cleartrip/ct-design-theme';
7
+ import { LOGIN_CONSTANTS, NAVIGATION_ROUTES } from '@cleartrip/ct-platform-constants';
8
+ import { getRavenEventProps, ravenSDKTrigger, isIOSApp, autoReadOtp, isEmpty, updateNativeOnLogin, validateOtp, isHTMLInputElement, isNumeric, isFKSSOEnabled, isAndroidApp, isPwa, handleFKSSO, MULTI_SPACE, isValidMobileNumber, showMobileNumberHint, getCurrentPathName, getQueryParam, updateNativeAndroidOnSignIn, triggerOTPListener, sendLoginOtp, sendEventWithUserInsights } from '@cleartrip/ct-platform-utils';
9
+ import { FieldV2, PhoneField } from '@cleartrip/ct-design-field';
10
+ import { Spinner } from '@cleartrip/ct-design-spinner';
11
+ import { Typography, TypographyVariant } from '@cleartrip/ct-design-typography';
12
+ import { AlertCallout } from '@cleartrip/ct-design-alert-callout';
13
+ import { InfoIcon, Edit, CheckCircle } from '@cleartrip/ct-design-icons';
14
+ import classNames from 'classnames';
15
+ import { Button } from '@cleartrip/ct-design-button';
16
+ import { Divider } from '@cleartrip/ct-design-divider';
17
+ import { FlipkartLogo } from '@cleartrip/ct-platform-assets';
18
+ import { Swiper, SwiperSlide } from 'swiper/react';
19
+ import SwiperCore, { Autoplay, Navigation, Pagination } from 'swiper';
20
+
21
+ function styleInject(css, ref) {
22
+ if (ref === void 0) ref = {};
23
+ var insertAt = ref.insertAt;
24
+ if (!css || typeof document === 'undefined') {
25
+ return;
26
+ }
27
+ var head = document.head || document.getElementsByTagName('head')[0];
28
+ var style = document.createElement('style');
29
+ style.type = 'text/css';
30
+ if (insertAt === 'top') {
31
+ if (head.firstChild) {
32
+ head.insertBefore(style, head.firstChild);
33
+ } else {
34
+ head.appendChild(style);
35
+ }
36
+ } else {
37
+ head.appendChild(style);
38
+ }
39
+ if (style.styleSheet) {
40
+ style.styleSheet.cssText = css;
41
+ } else {
42
+ style.appendChild(document.createTextNode(css));
43
+ }
44
+ }
45
+
46
+ var css_248z$3 = ".index-module_mobileinput_footertext__jPQ-g a{color:#0f6bff;text-decoration:none}.index-module_mobileinput-seperator__7Ewok{position:relative}.index-module_mobileinput_seperatortext__-KDOp{background:#fff;left:0;margin:0 auto;position:absolute;right:0;text-align:center;top:-10px;width:40px}.index-module_slider_carousel_wrapper__0SuGB{border-top-left-radius:16px;border-top-right-radius:16px;width:100dvw}.index-module_login_form__tpSDz{background-color:#fff;padding-left:16px;padding-right:16px}.index-module_nonUtilsSelector_toast__lvWmB{bottom:12px!important;margin-bottom:12px;margin:0 auto!important;padding:12px 16px!important;width:calc(100% - 48px)!important;z-index:2000}.index-module_login_otp_error__o3y2L{padding-top:4px}.index-module_login_otp_input__L-3P8{font-size:24px!important;font-style:normal;font-weight:600!important;height:56px!important;line-height:28px;padding:auto;text-align:center;width:56px!important}.index-module_footer_text__nkeJv{color:grey!important;font-size:12px!important}.index-module_swiper-custom-pagination__Ma1gV{--swiper-theme-color:#fff;--swiper-pagination-color:#fff;--swiper-pagination-bullet-inactive-color:#999;--swiper-pagination-bullet-inactive-opacity:1}.index-module_swiper-custom-pagination__Ma1gV *>span{height:6px;width:6px}.index-module_otp_box_wrapper__sM2Ba{margin-right:8px}.index-module_otp_container__1CE4N{display:flex;flex-direction:column;margin-top:24px}.index-module_swiper__r5-8U{height:100%;width:100%}.index-module_swiper__r5-8U .index-module_swiper-slide__Zchn0{height:auto}.index-module_swiper-slide__Zchn0 img{display:block;height:100%;object-fit:fill;width:100%}";
47
+ var styles$1 = {"mobileinput_footertext":"index-module_mobileinput_footertext__jPQ-g","mobileinput-seperator":"index-module_mobileinput-seperator__7Ewok","mobileinput_seperatortext":"index-module_mobileinput_seperatortext__-KDOp","slider_carousel_wrapper":"index-module_slider_carousel_wrapper__0SuGB","login_form":"index-module_login_form__tpSDz","nonUtilsSelector_toast":"index-module_nonUtilsSelector_toast__lvWmB","login_otp_error":"index-module_login_otp_error__o3y2L","login_otp_input":"index-module_login_otp_input__L-3P8","footer_text":"index-module_footer_text__nkeJv","swiper-custom-pagination":"index-module_swiper-custom-pagination__Ma1gV","otp_box_wrapper":"index-module_otp_box_wrapper__sM2Ba","otp_container":"index-module_otp_container__1CE4N","swiper":"index-module_swiper__r5-8U","swiper-slide":"index-module_swiper-slide__Zchn0"};
48
+ styleInject(css_248z$3);
49
+
50
+ var css_248z$2 = ".index-module_loader__container__VX-VO{align-items:center;background:#fff;border-radius:32px;box-shadow:0 8px 24px 0 rgba(26,26,26,.1);display:flex;height:34px;justify-content:center;left:50%;padding:12px;position:absolute;top:50%;transform:translate(-50%,-50%);width:66px}.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R{animation:index-module_three-dots-loader__i7R-R 1s linear infinite alternate;animation-delay:.5s;background-color:#1a1a1a;border-radius:5px;height:8px;position:relative;width:8px}.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R:after,.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R:before{content:\"\";display:inline-block;position:absolute;top:0}.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R:before{animation:index-module_three-dots-loader__i7R-R 1s infinite alternate;animation-delay:0s;background-color:#1a1a1a;border-radius:5px;height:8px;left:-15px;width:8px}.index-module_loader__container__VX-VO .index-module_three-dots-loader__i7R-R:after{animation:index-module_three-dots-loader__i7R-R 1s infinite alternate;animation-delay:1s;background-color:#1a1a1a;border-radius:5px;height:8px;left:15px;width:8px}@keyframes index-module_three-dots-loader__i7R-R{0%{background-color:#1a1a1a}50%,to{background-color:grey}}";
51
+ var Styles$1 = {"loader__container":"index-module_loader__container__VX-VO","three-dots-loader":"index-module_three-dots-loader__i7R-R"};
52
+ styleInject(css_248z$2);
53
+
54
+ var ThreeDotsLoader = function () {
55
+ return (jsx("div", __assign({ className: Styles$1['loader__container'] }, { children: jsx("div", { className: Styles$1['three-dots-loader'] }) })));
56
+ };
57
+
58
+ var AutoDetectState;
59
+ (function (AutoDetectState) {
60
+ AutoDetectState[AutoDetectState["DETECTING"] = 0] = "DETECTING";
61
+ AutoDetectState[AutoDetectState["FAILED"] = 1] = "FAILED";
62
+ AutoDetectState[AutoDetectState["DETECTED"] = 2] = "DETECTED";
63
+ })(AutoDetectState || (AutoDetectState = {}));
64
+ var OtpInput = function (_a) {
65
+ var mobileNumber = _a.mobileNumber, errorCallout = _a.errorCallout, ravenPayload = _a.ravenPayload, otpInputHeight = _a.otpInputHeight, skipProfileFlow = _a.skipProfileFlow, otpResendDisabled = _a.otpResendDisabled, hotelsLoyaltyFlow = _a.hotelsLoyaltyFlow, getOTP = _a.getOTP, setCtaDisabled = _a.setCtaDisabled, setErrorCallout = _a.setErrorCallout, setMobileNumber = _a.setMobileNumber, setShowMobilePage = _a.setShowMobilePage, handleLoginSuccess = _a.handleLoginSuccess, handleLoginFailure = _a.handleLoginFailure;
66
+ var inputRefs = useRef(Array(4).fill(null));
67
+ var _b = useState(AutoDetectState.DETECTING), autoDetecting = _b[0], setAutoDetecting = _b[1];
68
+ var _c = useState(LOGIN_CONSTANTS.OTP_COUNTDOWN), countdown = _c[0], setCountdown = _c[1];
69
+ var _d = useState(''), otp = _d[0], setOtp = _d[1];
70
+ var _f = useState(true), countdownEnabled = _f[0], setCountdownEnabled = _f[1];
71
+ var _g = useState(false), verifiedOtp = _g[0], setVerifiedOtp = _g[1];
72
+ var _h = useState(''), otpErrorMessage = _h[0], setOtpErrorMessage = _h[1];
73
+ var _j = useState(true), enableAutoDetect = _j[0], setEnableAutoDetect = _j[1];
74
+ var _k = useState(false), showOtpVerificationLoader = _k[0], setShowOtpVerificationLoader = _k[1];
75
+ var lastOtpRequest = useRef();
76
+ var lastOtpRequestTimeStamp = useRef();
77
+ var loginMethod = 'CT';
78
+ useEffect(function () {
79
+ autoDetect();
80
+ var eventProps = getRavenEventProps();
81
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'login_otp_screen_opened', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
82
+ }, []);
83
+ useEffect(function () {
84
+ if (isIOSApp()) {
85
+ setEnableAutoDetect(false);
86
+ }
87
+ }, []);
88
+ useEffect(function () {
89
+ autoDetect();
90
+ }, []);
91
+ useEffect(function () {
92
+ if (!showOtpVerificationLoader) {
93
+ inputRefs.current[0].focus();
94
+ inputRefs.current[0].click();
95
+ }
96
+ }, [showOtpVerificationLoader]);
97
+ useEffect(function () {
98
+ if (countdown === 0) {
99
+ setCountdownEnabled(false);
100
+ }
101
+ }, [countdown]);
102
+ useEffect(function () {
103
+ var interval;
104
+ if (countdownEnabled && countdown > 0) {
105
+ interval = setInterval(function () {
106
+ setCountdown(function (prevCountdown) { return prevCountdown - 1; });
107
+ }, 1000);
108
+ }
109
+ return function () {
110
+ clearInterval(interval);
111
+ };
112
+ }, [countdownEnabled, countdown]);
113
+ var autoDetect = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
114
+ var otp_1, _e_1;
115
+ return __generator(this, function (_a) {
116
+ switch (_a.label) {
117
+ case 0:
118
+ _a.trys.push([0, 2, , 3]);
119
+ return [4, autoReadOtp()];
120
+ case 1:
121
+ otp_1 = _a.sent();
122
+ setOtp(otp_1);
123
+ setAutoDetecting(AutoDetectState.DETECTED);
124
+ if ((otp_1 === null || otp_1 === void 0 ? void 0 : otp_1.length) === LOGIN_CONSTANTS.OTP_LENGTH &&
125
+ handleOtpComplete) {
126
+ handleOtpComplete(otp_1, true);
127
+ }
128
+ return [3, 3];
129
+ case 2:
130
+ _e_1 = _a.sent();
131
+ if (_e_1 === 'NOT_SUPPORTED') {
132
+ setEnableAutoDetect(false);
133
+ }
134
+ return [3, 3];
135
+ case 3: return [2];
136
+ }
137
+ });
138
+ }); }, [enableAutoDetect]);
139
+ var handleOtpValidationError = useCallback(function (e) {
140
+ var eventProps = getRavenEventProps();
141
+ ravenSDKTrigger('u_login_error', __assign({ action_name: 'otp_incorrect', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
142
+ var message = e === null || e === void 0 ? void 0 : e.message;
143
+ if (message !== 'OTP_VALIDATE_LIMIT_EXCEEDED') {
144
+ setOtp('');
145
+ }
146
+ inputRefs.current[0].focus();
147
+ inputRefs.current[0].click();
148
+ var messageValue = LOGIN_CONSTANTS[message];
149
+ var toastMessage = typeof messageValue === 'string'
150
+ ? messageValue
151
+ : LOGIN_CONSTANTS.INVALID_OTP;
152
+ setOtpErrorMessage(toastMessage);
153
+ }, [inputRefs]);
154
+ var handleOtpComplete = useCallback(function (otp, autodetected) { return __awaiter(void 0, void 0, void 0, function () {
155
+ var eventProps, response, status_1, action, e_1;
156
+ return __generator(this, function (_a) {
157
+ switch (_a.label) {
158
+ case 0:
159
+ _a.trys.push([0, 2, , 3]);
160
+ eventProps = getRavenEventProps();
161
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'otp_entered', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', entry_type: !autodetected ? 'manual_entry' : 'autodetected', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
162
+ if (otp === lastOtpRequest.current &&
163
+ lastOtpRequestTimeStamp.current &&
164
+ lastOtpRequestTimeStamp.current - Date.now() <= 100) {
165
+ return [2];
166
+ }
167
+ lastOtpRequest.current = otp;
168
+ lastOtpRequestTimeStamp.current = Date.now();
169
+ if (hotelsLoyaltyFlow) {
170
+ setShowOtpVerificationLoader(true);
171
+ }
172
+ return [4, validateOtp(mobileNumber, otp)];
173
+ case 1:
174
+ response = _a.sent();
175
+ status_1 = response.status, action = response.action;
176
+ if (Number(status_1) === 200 && !isEmpty(action)) {
177
+ setVerifiedOtp(true);
178
+ setOtpErrorMessage('');
179
+ updateNativeOnLogin();
180
+ if (action === 'SIGNUP') {
181
+ if (!skipProfileFlow) {
182
+ window.location.href =
183
+ NAVIGATION_ROUTES.PERSONAL_DETAILS +
184
+ '?onboardingFlow=true';
185
+ }
186
+ handleLoginSuccess(loginMethod, true);
187
+ }
188
+ else {
189
+ handleLoginSuccess(loginMethod);
190
+ }
191
+ }
192
+ else {
193
+ if (hotelsLoyaltyFlow) {
194
+ setShowOtpVerificationLoader(false);
195
+ }
196
+ handleLoginFailure(loginMethod);
197
+ }
198
+ return [3, 3];
199
+ case 2:
200
+ e_1 = _a.sent();
201
+ if (hotelsLoyaltyFlow) {
202
+ setShowOtpVerificationLoader(false);
203
+ }
204
+ handleLoginFailure(loginMethod);
205
+ handleOtpValidationError(e_1);
206
+ return [3, 3];
207
+ case 3: return [2];
208
+ }
209
+ });
210
+ }); }, [
211
+ lastOtpRequest,
212
+ lastOtpRequestTimeStamp,
213
+ setVerifiedOtp,
214
+ setAutoDetecting,
215
+ setOtpErrorMessage,
216
+ handleOtpValidationError,
217
+ ]);
218
+ var handleOnPaste = function () { return __awaiter(void 0, void 0, void 0, function () {
219
+ var clipboardData, pastedArr, pastedString;
220
+ var _a, _b;
221
+ return __generator(this, function (_c) {
222
+ switch (_c.label) {
223
+ case 0: return [4, navigator.clipboard.readText()];
224
+ case 1:
225
+ clipboardData = _c.sent();
226
+ if (clipboardData && isNumeric(clipboardData)) {
227
+ pastedArr = clipboardData
228
+ .slice(0, LOGIN_CONSTANTS.OTP_LENGTH)
229
+ .split('');
230
+ (_a = inputRefs.current[LOGIN_CONSTANTS.OTP_LENGTH - 1]) === null || _a === void 0 ? void 0 : _a.focus();
231
+ (_b = inputRefs.current[LOGIN_CONSTANTS.OTP_LENGTH - 1]) === null || _b === void 0 ? void 0 : _b.click();
232
+ pastedString = pastedArr.join('');
233
+ setOtp(pastedString);
234
+ if (pastedString.length === LOGIN_CONSTANTS.OTP_LENGTH) {
235
+ handleOtpComplete(pastedString, false);
236
+ }
237
+ }
238
+ return [2];
239
+ }
240
+ });
241
+ }); };
242
+ var handleInput = useCallback(function (event, index) {
243
+ var _a, _b;
244
+ setErrorCallout('');
245
+ var value = event.target.value;
246
+ if (value !== '' && index < inputRefs.current.length - 1) {
247
+ (_a = inputRefs.current[index + 1]) === null || _a === void 0 ? void 0 : _a.focus();
248
+ (_b = inputRefs.current[index + 1]) === null || _b === void 0 ? void 0 : _b.click();
249
+ }
250
+ var inputValues = inputRefs.current.map(function (ref) {
251
+ if (isHTMLInputElement(ref)) {
252
+ return ref.value;
253
+ }
254
+ return '';
255
+ });
256
+ var otpValue = inputValues.join('').slice(0, 4);
257
+ setOtp(otpValue);
258
+ if (otpValue.length === LOGIN_CONSTANTS.OTP_LENGTH) {
259
+ handleOtpComplete(otpValue, false);
260
+ }
261
+ }, [setOtp, handleOtpComplete]);
262
+ var handleKeyDown = useCallback(function (e, index) {
263
+ var _a, _b, _c;
264
+ if (e.key === 'Backspace' &&
265
+ index > 0 &&
266
+ ((_a = inputRefs.current[index]) === null || _a === void 0 ? void 0 : _a.value) === '') {
267
+ e.preventDefault();
268
+ (_b = inputRefs.current[index - 1]) === null || _b === void 0 ? void 0 : _b.focus();
269
+ (_c = inputRefs.current[index - 1]) === null || _c === void 0 ? void 0 : _c.click();
270
+ }
271
+ }, [inputRefs]);
272
+ var onResendOtpClick = useCallback(function () {
273
+ setCountdown(LOGIN_CONSTANTS.OTP_COUNTDOWN);
274
+ setCountdownEnabled(true);
275
+ getOTP(mobileNumber);
276
+ var eventProps = getRavenEventProps();
277
+ ravenSDKTrigger('u_login_error', __assign({ action_name: 'resend_otp_clicked', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
278
+ }, [setCountdown, setCountdownEnabled]);
279
+ var onEditCLick = useCallback(function () {
280
+ setCtaDisabled(true);
281
+ setShowMobilePage(true);
282
+ setMobileNumber('');
283
+ }, [setShowMobilePage]);
284
+ return (jsxs("div", __assign({ className: 'flex flex-column bg-neutral-100', style: { height: otpInputHeight } }, { children: [errorCallout && (jsx(AlertCallout, { variant: 'error', textNode: errorCallout, prefixIconNode: jsx(InfoIcon, { fill: 'red' }), style: {
285
+ color: '#ffff',
286
+ backgroundColor: '#db201e',
287
+ }, className: 'fs-12' })), jsxs("div", __assign({ className: 'flex flex-bottom' }, { children: [jsxs(Typography, __assign({ variant: 'HM1', color: 'heading' }, { children: [LOGIN_CONSTANTS.OTP_TEXT, " ", jsx("br", {}), mobileNumber] })), jsx("div", __assign({ className: 'pl-2', onClick: onEditCLick }, { children: jsx(Edit, {}) }))] })), jsxs("div", __assign({ className: styles$1.otp_container }, { children: [jsxs("div", __assign({ className: 'flex', style: hotelsLoyaltyFlow
288
+ ? { width: 'max-content', position: 'relative' }
289
+ : {} }, { children: [__spreadArray([], Array(LOGIN_CONSTANTS.OTP_LENGTH), true).map(function (_, i) { return (jsx("div", __assign({ className: styles$1.otp_box_wrapper }, { children: jsx(FieldV2, { prompt: {
290
+ hasError: !!otpErrorMessage,
291
+ }, type: 'number', placeholder: '', value: otp[i], max: 1, inputMode: 'numeric', className: styles$1.login_otp_input, variant: 'md', ref: function (ref) {
292
+ if (ref) {
293
+ inputRefs.current[i] = ref;
294
+ }
295
+ }, onKeyDown: function (e) { return handleKeyDown(e, i); }, onChange: function (e) { return handleInput(e, i); }, onPaste: handleOnPaste, autoFocus: i === 0, disabled: hotelsLoyaltyFlow &&
296
+ showOtpVerificationLoader
297
+ ? true
298
+ : false }) }), i)); }), hotelsLoyaltyFlow && showOtpVerificationLoader && (jsx(ThreeDotsLoader, {}))] })), !!otpErrorMessage && (jsx(Typography, __assign({ variant: 'P1', color: 'warning', className: styles$1.login_otp_error }, { children: otpErrorMessage })))] })), jsx(Spacer, { className: 'pt-2' }), autoDetecting === AutoDetectState.DETECTING &&
299
+ !verifiedOtp &&
300
+ enableAutoDetect &&
301
+ countdown >
302
+ LOGIN_CONSTANTS.RESEND_OTP_COUNTDOWN && (jsxs("div", __assign({ className: 'flex flex-middle' }, { children: [jsx(Spinner, { width: '20px', height: '20px', borderColor: '#11a670', className: 'bg-neutral-900 bc-black' }), jsx(Typography, __assign({ variant: 'B3', className: 'fs-12 fw-500 ml-1 c-neutral-700' }, { children: LOGIN_CONSTANTS.AUTO_DETECTING_TEXT }))] }))), autoDetecting === AutoDetectState.DETECTING &&
303
+ countdown <= LOGIN_CONSTANTS.RESEND_OTP_COUNTDOWN &&
304
+ enableAutoDetect &&
305
+ !verifiedOtp && (jsx(Fragment, { children: jsxs("div", __assign({ className: 'flex' }, { children: [jsx(Typography, __assign({ variant: 'B3', className: 'fs-12 fw-500 c-neutral-700 ' }, { children: LOGIN_CONSTANTS.OTP_RESEND_TEXT })), jsx(Spacer, { className: 'ml-1' }), otpResendDisabled ? (jsx(Typography, __assign({ className: 'color-neutral-200 fw-500', variant: 'B3' }, { children: LOGIN_CONSTANTS.RESEND_CTA }))) : (jsxs(Fragment, { children: [countdown === 0 && (jsx(Fragment, { children: jsx(Typography, __assign({ isClickable: true, variant: 'B3', onClick: onResendOtpClick, color: 'link', className: '\n fs-12 fw-500 c-pointer' }, { children: LOGIN_CONSTANTS.RESEND_CTA })) })), countdown > 0 && (jsx(Typography, __assign({ color: 'disabled', variant: 'B3' }, { children: ' Resend (' + countdown + 's)' })))] }))] })) })), !otpErrorMessage && verifiedOtp && (jsx(Fragment, { children: jsxs("div", __assign({ className: 'flex flex-middle' }, { children: [jsx(CheckCircle, {}), jsx(Typography, __assign({ variant: 'P1', color: 'success', className: 'fs-12' }, { children: autoDetecting === AutoDetectState.DETECTED
306
+ ? LOGIN_CONSTANTS.AUTO_DETECTED_TEXT
307
+ : LOGIN_CONSTANTS.VERIFIED_MESSAGE }))] })) })), jsx(Spacer, { className: 'mt-24' })] })));
308
+ };
309
+
310
+ var css_248z$1 = ".index-module_loader__63LeU{align-items:center;background-color:hsla(0,0%,100%,.95);bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:0}.index-module_loader__63LeU.index-module_With-full-opacity__ZSY-U{background-color:#fff}.index-module_loader__content__Q6kJl{max-width:280px;text-align:center}.index-module_loader__spinner__6B3AR{animation:index-module_loader-rotate__efcf3 .8s linear infinite;border:2px solid rgba(51,102,204,.3);border-radius:50%;border-top-color:#36c;display:inline-block;height:30px;margin-bottom:10px;position:relative;width:30px}.index-module_loader__heading__7YZ3N{color:#000;font-size:18px;font-weight:600;margin-bottom:5px}.index-module_loader__text__1QcLi{color:rgba(0,0,0,.8);font-size:16px;line-height:1.5}";
311
+ var Styles = {"loader":"index-module_loader__63LeU","With-full-opacity":"index-module_With-full-opacity__ZSY-U","loader__content":"index-module_loader__content__Q6kJl","loader__spinner":"index-module_loader__spinner__6B3AR","loader-rotate":"index-module_loader-rotate__efcf3","loader__heading":"index-module_loader__heading__7YZ3N","loader__text":"index-module_loader__text__1QcLi"};
312
+ styleInject(css_248z$1);
313
+
314
+ var Loader = function (_a) {
315
+ var title = _a.title, message = _a.message, className = _a.className;
316
+ return (jsx("div", __assign({ className: "".concat(Styles['utilswrapper'], " utilswrapper") }, { children: jsx("div", __assign({ className: classNames(Styles['loader'], className) }, { children: jsxs("div", __assign({ className: Styles['loader__content'] }, { children: [jsx("div", { className: Styles['loader__spinner'] }), jsx("h5", __assign({ className: Styles['loader__heading'] }, { children: title })), jsx("p", __assign({ className: Styles['loader__text'] }, { children: message }))] })) })) })));
317
+ };
318
+
319
+ var MobileInput = function (_a) {
320
+ var sendingOtp = _a.sendingOtp, ctaDisabled = _a.ctaDisabled, getOTP = _a.getOTP, setErrorCallout = _a.setErrorCallout, errorCallout = _a.errorCallout, mobileNumber = _a.mobileNumber, setMobileInputHeight = _a.setMobileInputHeight, setMobileNumber = _a.setMobileNumber, fallbackUri = _a.fallbackUri, skipProfileFlow = _a.skipProfileFlow, currentPageUri = _a.currentPageUri, ravenPayload = _a.ravenPayload, hotelsLoyaltyFlow = _a.hotelsLoyaltyFlow;
321
+ var fkSSOEnabled = useState(isFKSSOEnabled)[0];
322
+ var _b = useState(false), fkButtonLoading = _b[0], setFkButtonLoading = _b[1];
323
+ var inputRef = useRef(null);
324
+ var mobileViewRef = useRef(null);
325
+ useEffect(function () {
326
+ if (mobileViewRef.current) {
327
+ var height = mobileViewRef.current.clientHeight;
328
+ setMobileInputHeight(height);
329
+ }
330
+ }, [mobileViewRef.current]);
331
+ useEffect(function () {
332
+ var timeout;
333
+ if (inputRef.current) {
334
+ timeout = setTimeout(function () {
335
+ var _a;
336
+ (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
337
+ }, 100);
338
+ }
339
+ return function () {
340
+ clearTimeout(timeout);
341
+ };
342
+ }, []);
343
+ useEffect(function () {
344
+ if (isAndroidApp()) {
345
+ autoDetectMobileNumber();
346
+ }
347
+ }, []);
348
+ var handleFKSSOClick = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
349
+ var eventProps, redirectUrl;
350
+ return __generator(this, function (_a) {
351
+ switch (_a.label) {
352
+ case 0:
353
+ _a.trys.push([0, 2, , 3]);
354
+ eventProps = getRavenEventProps();
355
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'login_with_flipkart_clicked', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'fk_sso', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
356
+ setFkButtonLoading(true);
357
+ return [4, handleFKSSO(fallbackUri, skipProfileFlow
358
+ ? currentPageUri
359
+ : NAVIGATION_ROUTES.PERSONAL_DETAILS +
360
+ '?onboardingFlow=true', currentPageUri)];
361
+ case 1:
362
+ redirectUrl = _a.sent();
363
+ if (!hotelsLoyaltyFlow) {
364
+ setFkButtonLoading(false);
365
+ }
366
+ if (isPwa()) {
367
+ window.location.href = redirectUrl;
368
+ }
369
+ return [3, 3];
370
+ case 2:
371
+ _a.sent();
372
+ setFkButtonLoading(false);
373
+ return [3, 3];
374
+ case 3: return [2];
375
+ }
376
+ });
377
+ }); }, []);
378
+ var handleInputChange = useCallback(function (event, autoDetected) {
379
+ if (autoDetected === void 0) { autoDetected = false; }
380
+ setErrorCallout('');
381
+ var value = event.target.value || '';
382
+ value = value.replace(MULTI_SPACE, ' ').trimStart();
383
+ setMobileNumber(value);
384
+ var validMobileNo = isValidMobileNumber(event.target.value);
385
+ if (validMobileNo) {
386
+ getOTP(value);
387
+ var eventProps = getRavenEventProps();
388
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'get_otp_clicked', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', entry_type: 'auto_click', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
389
+ if (!autoDetected) {
390
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'phone_number_entered', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', entry_type: 'manual_entry', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
391
+ }
392
+ else {
393
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'phone_number_autodetected', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', entry_type: 'autodetected', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
394
+ }
395
+ }
396
+ }, [setMobileNumber]);
397
+ var autoDetectMobileNumber = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
398
+ var autoDetectedNumber, simulatedEvent;
399
+ return __generator(this, function (_a) {
400
+ switch (_a.label) {
401
+ case 0: return [4, showMobileNumberHint()];
402
+ case 1:
403
+ autoDetectedNumber = _a.sent();
404
+ simulatedEvent = {
405
+ target: {
406
+ value: autoDetectedNumber,
407
+ },
408
+ };
409
+ if (autoDetectedNumber) {
410
+ handleInputChange(simulatedEvent, true);
411
+ }
412
+ return [2];
413
+ }
414
+ });
415
+ }); }, [handleInputChange]);
416
+ var handlePrivacyPolicyClick = useCallback(function () {
417
+ var eventProps = getRavenEventProps();
418
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'policy_click', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
419
+ window.location.href = NAVIGATION_ROUTES.PRIVACY_POLICY;
420
+ }, []);
421
+ var handleTermsOfUseClick = useCallback(function () {
422
+ var eventProps = getRavenEventProps();
423
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'tnc_click', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
424
+ window.location.href = NAVIGATION_ROUTES.TERMS;
425
+ }, []);
426
+ return (jsxs("div", __assign({ className: 'flex flex-column', ref: mobileViewRef }, { children: [errorCallout && (jsx(AlertCallout, { variant: 'error', textNode: errorCallout, prefixIconNode: jsx(InfoIcon, { fill: 'red' }), style: {
427
+ color: '#ffff',
428
+ backgroundColor: '#db201e',
429
+ }, className: 'fs-12' })), jsx(Typography, __assign({ variant: 'HM1', color: 'heading', className: 'mb-4 fs-24' }, { children: LOGIN_CONSTANTS.LOGIN_TO_CT })), jsx("label", __assign({ style: {
430
+ visibility: 'hidden',
431
+ width: '0.1px',
432
+ height: '0.1px',
433
+ }, htmlFor: 'phonenumber' }, { children: "Phone number" })), jsx(PhoneField, { onChange: handleInputChange, value: mobileNumber, name: 'phonenumber', placeholder: '', inputMode: 'numeric', ref: inputRef, min: 0, max: 10, autoFocus: true, countryCode: LOGIN_CONSTANTS.COUNTRY_CODE }), jsx(Button, __assign({ color: 'primary', size: 'medium', minWidth: '160px', disabled: ctaDisabled, loading: sendingOtp, className: 'my-6', onClick: function () { return getOTP(mobileNumber); } }, { children: LOGIN_CONSTANTS.GET_OTP })), fkSSOEnabled && (jsxs(Fragment, { children: [jsxs("div", __assign({ className: 'my-6 p-relative' }, { children: [jsx(Divider, {}), jsx("span", __assign({ className: "".concat(styles$1.mobileinput_seperatortext) }, { children: "or" }))] })), jsx(Button, __assign({ variant: 'outline', size: 'medium', className: 'my-6', loading: fkButtonLoading, onClick: handleFKSSOClick, showLeftIcon: !fkButtonLoading, LeftIcon: jsx("img", { src: FlipkartLogo }) }, { children: LOGIN_CONSTANTS.FK_LOGIN_CTA }))] })), jsxs("div", __assign({ className: 'pt-8 pb-6' }, { children: [jsx(Divider, {}), jsxs("div", __assign({ className: 'flex flex-middle \n flex-center flex-wrap pt-2' }, { children: [jsx(Typography, __assign({ variant: 'P1', className: styles$1.footer_text }, { children: LOGIN_CONSTANTS.FOOTER_TEXT })), jsx(Typography, __assign({ variant: 'P1', color: 'link', className: 'pl-1 fs-12', isClickable: true, onClick: handlePrivacyPolicyClick }, { children: LOGIN_CONSTANTS.PRIVACY_CTA })), jsx(Typography, __assign({ className: 'px-1 fs-12 c-neutral-700', variant: 'P1' }, { children: '& ' })), jsx(Typography, __assign({ variant: 'P1', color: 'link', isClickable: true, onClick: handleTermsOfUseClick, className: 'fs-12' }, { children: LOGIN_CONSTANTS.TNC_CTA }))] }))] }))] })));
434
+ };
435
+
436
+ const imagePlaceHolderURI =
437
+ // eslint-disable-next-line max-len
438
+ 'data:image/png;base64,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';
439
+ const ImageUrls = [{
440
+ src: 'https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel1.png',
441
+ placeholder: imagePlaceHolderURI
442
+ }, {
443
+ src: 'https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel2.png',
444
+ placeholder: imagePlaceHolderURI
445
+ }, {
446
+ src: 'https://fastui.cltpstatic.com/image/upload/offermgmt/images/carousel3.png',
447
+ placeholder: imagePlaceHolderURI
448
+ }];
449
+
450
+ var ImageWithPlaceholder = function (_a) {
451
+ var src = _a.src, placeholderSrc = _a.placeholderSrc, onLoad = _a.onLoad, props = __rest(_a, ["src", "placeholderSrc", "onLoad"]);
452
+ var _b = useState(placeholderSrc || src), imgSrc = _b[0], setImgSrc = _b[1];
453
+ var onLoadRef = useRef(onLoad);
454
+ useEffect(function () {
455
+ onLoadRef.current = onLoad;
456
+ }, [onLoad]);
457
+ useEffect(function () {
458
+ var img = new Image();
459
+ img.onload = function () {
460
+ setImgSrc(src);
461
+ if (onLoadRef.current) {
462
+ onLoadRef.current();
463
+ }
464
+ };
465
+ img.src = src;
466
+ }, [src]);
467
+ return jsx("img", __assign({ src: imgSrc }, props));
468
+ };
469
+
470
+ var css_248z = ".index-module_slides__container__9XVd4{align-items:center;box-sizing:border-box;display:flex;gap:1.5rem;height:197px;justify-content:center;width:100%}.index-module_slides__container--imageContainer__q0RuP{align-self:flex-start;margin-top:2rem;width:128px}";
471
+ var styles = {"slides__container":"index-module_slides__container__9XVd4","slides__container--imageContainer":"index-module_slides__container--imageContainer__q0RuP"};
472
+ styleInject(css_248z);
473
+
474
+ var Slide = function (_a) {
475
+ var textData = _a.textData, bgColor = _a.bgColor, imageUrl = _a.imageUrl, altText = _a.altText;
476
+ return (jsxs("div", __assign({ className: styles['slides__container'], style: {
477
+ backgroundColor: bgColor,
478
+ } }, { children: [jsx("div", __assign({ className: styles['slides__container--imageContainer'] }, { children: jsx(ImageWithPlaceholder, { width: 128, height: 128, alt: altText, src: imageUrl }) })), jsx("div", { children: textData === null || textData === void 0 ? void 0 : textData.map(function (item, index) {
479
+ return (jsx(Typography, __assign({ variant: TypographyVariant.HM2, style: {
480
+ color: item.textColor,
481
+ lineHeight: '24px',
482
+ } }, { children: item.text }), index));
483
+ }) })] })));
484
+ };
485
+ var getSlides = function () {
486
+ return [
487
+ jsx(Slide, { bgColor: '#4F8EF0', imageUrl: 'https://fastui.cltpstatic.com/image/upload/f_auto,q_auto,w_128,h_128,dpr_2/offermgmt/images/banner/Login%20Frame.png', altText: 'Dhonicampaign_icon', textData: [
488
+ {
489
+ text: 'Use code CTMAHI',
490
+ textColor: '#fff',
491
+ },
492
+ {
493
+ text: '& get flat 777 off,',
494
+ textColor: '#fff',
495
+ },
496
+ {
497
+ text: 'on your first',
498
+ textColor: '#032529',
499
+ },
500
+ {
501
+ text: 'flight booking',
502
+ textColor: '#032529',
503
+ },
504
+ ] }, 1),
505
+ jsx(Slide, { bgColor: '#FF8D71', imageUrl: 'https://fastui.cltpstatic.com/image/upload/f_auto,w_128,h_128,dpr_2/offermgmt/images/loginSheetMyntra.webp', altText: 'loyality_benefits_icon', textData: [
506
+ {
507
+ text: 'Loyalty benefits',
508
+ textColor: '#fff',
509
+ },
510
+ {
511
+ text: 'and discounts',
512
+ textColor: '#fff',
513
+ },
514
+ {
515
+ text: 'for Flipkart and',
516
+ textColor: '#331005',
517
+ },
518
+ {
519
+ text: 'Myntra members',
520
+ textColor: '#331005',
521
+ },
522
+ ] }, 2),
523
+ jsx(Slide, { bgColor: '#FFC142', imageUrl: 'https://fastui.cltpstatic.com/image/upload/f_auto,w_128,h_128,dpr_2/offermgmt/images/loginSheetCoupon.webp', altText: 'CTLogin_icon', textData: [
524
+ {
525
+ text: 'Flat 25% off',
526
+ textColor: '#fff',
527
+ },
528
+ {
529
+ text: 'on your first',
530
+ textColor: '#fff',
531
+ },
532
+ {
533
+ text: 'hotel booking',
534
+ textColor: '#fff',
535
+ },
536
+ {
537
+ text: 'Code: CTMAHI',
538
+ textColor: '#332504',
539
+ },
540
+ ] }, 3),
541
+ jsx(Slide, { bgColor: '#61C149', imageUrl: 'https://fastui.cltpstatic.com/image/upload/f_auto,w_128,h_128,dpr_2/offermgmt/images/loginSheetWallet.webp', altText: 'EarnAndRedeem_icon', textData: [
542
+ {
543
+ text: 'Earn and',
544
+ textColor: '#fff',
545
+ },
546
+ {
547
+ text: 'redeem up to',
548
+ textColor: '#fff',
549
+ },
550
+ {
551
+ text: '650 Flipkart',
552
+ textColor: '#13270F',
553
+ },
554
+ {
555
+ text: 'Supercoins',
556
+ textColor: '#13270F',
557
+ },
558
+ ] }, 4),
559
+ ];
560
+ };
561
+
562
+ SwiperCore.use([Autoplay, Navigation, Pagination]);
563
+ var CarouselWrapper = function (_a) {
564
+ var customSlides = _a.customSlides, carouselImages = _a.carouselImages;
565
+ var imageUrls = useMemo(function () {
566
+ if (!isEmpty(carouselImages))
567
+ return carouselImages;
568
+ return ImageUrls;
569
+ }, [carouselImages]);
570
+ return (jsx("div", __assign({ className: " o-hidden p-relative ".concat(styles$1.slider_carousel_wrapper) }, { children: jsx(Swiper, __assign({ autoplay: true, slidesPerView: 1, navigation: false, loop: true, pagination: { clickable: true }, className: "".concat(styles$1['swiper'], " ").concat(styles$1['swiper-custom-pagination']), lazy: {
571
+ loadPrevNextAmount: 1,
572
+ } }, { children: carouselImages && carouselImages.length > 0
573
+ ? imageUrls === null || imageUrls === void 0 ? void 0 : imageUrls.map(function (item, index) {
574
+ return (jsx(SwiperSlide, __assign({ className: styles$1['swiper-slide'] }, { children: jsx(Fragment, { children: index < 1 ? (jsx(ImageWithPlaceholder, { src: item.src, placeholderSrc: item.placeholder, alt: "Slide ".concat(index + 1), rel: 'preload', fetchPriority: 'high' })) : (jsx(ImageWithPlaceholder, { src: item.src, placeholderSrc: item.placeholder, alt: "Slide ".concat(index + 1), loading: 'lazy', className: 'lazy' })) }) }), index));
575
+ })
576
+ : customSlides && customSlides.length > 0
577
+ ? customSlides === null || customSlides === void 0 ? void 0 : customSlides.map(function (item, index) {
578
+ return (jsx(SwiperSlide, __assign({ className: styles$1['swiper-slide'] }, { children: item }), index));
579
+ })
580
+ : getSlides().length &&
581
+ getSlides().map(function (item, index) {
582
+ return (jsx(SwiperSlide, __assign({ className: styles$1['swiper-slide'] }, { children: item }), index));
583
+ }) })) })));
584
+ };
585
+
586
+ var LoginModule = function (_a) {
587
+ var fallbackUri = _a.fallbackUri, isDrawerOpen = _a.isDrawerOpen, skipProfileFlow = _a.skipProfileFlow, _b = _a.showCarousel, showCarousel = _b === void 0 ? true : _b, _c = _a.ravenPayload, ravenPayload = _c === void 0 ? {} : _c, handleLoginClose = _a.handleLoginClose, onAuthSuccess = _a.onAuthSuccess, onAuthFailure = _a.onAuthFailure, customSlides = _a.customSlides, _d = _a.carouselImages, carouselImages = _d === void 0 ? [] : _d, _e = _a.hotelsLoyaltyFlow, hotelsLoyaltyFlow = _e === void 0 ? false : _e, _f = _a.closeOnOutsideClick, closeOnOutsideClick = _f === void 0 ? false : _f, _g = _a.sendUserInsights, sendUserInsights = _g === void 0 ? true : _g;
588
+ var _h = useState(true), showMobilePage = _h[0], setShowMobilePage = _h[1];
589
+ var _j = useState(true), ctaDisabled = _j[0], setCtaDisabled = _j[1];
590
+ var _k = useState(false), sendingOtp = _k[0], setSendingOtp = _k[1];
591
+ var _l = useState(isDrawerOpen), showLoginForm = _l[0], setShowLoginForm = _l[1];
592
+ var _m = useState(''), mobileNumber = _m[0], setMobileNumber = _m[1];
593
+ var _o = useState(0), mobileInputHeight = _o[0], setMobileInputHeight = _o[1];
594
+ var _p = useState(false), otpResendDisabled = _p[0], setOtpResendDisabled = _p[1];
595
+ var _q = useState(''), errorCallout = _q[0], setErrorCallout = _q[1];
596
+ var _r = useState(false); _r[0]; var setShowSuccess = _r[1];
597
+ var _s = useState(false), showSigninLoader = _s[0], setShowSigninLoader = _s[1];
598
+ var currentPageUri = useState(function () { return getCurrentPathName(); })[0];
599
+ var showSigninLoaderScreen = function () {
600
+ setShowSigninLoader(true);
601
+ };
602
+ useEffect(function () {
603
+ if (window) {
604
+ window['showSigninLoaderScreen'] = showSigninLoaderScreen;
605
+ }
606
+ var queryValue = getQueryParam('fkSSOstatus');
607
+ var loginMethod = 'FK';
608
+ if (queryValue === 'signin') {
609
+ if (isAndroidApp()) {
610
+ updateNativeAndroidOnSignIn();
611
+ }
612
+ handleLoginSuccess(loginMethod);
613
+ }
614
+ if (queryValue === 'signup') {
615
+ if (isAndroidApp()) {
616
+ updateNativeAndroidOnSignIn();
617
+ }
618
+ handleLoginSuccess(loginMethod, true);
619
+ }
620
+ if (queryValue === 'failure') {
621
+ handleLoginFailure(loginMethod);
622
+ }
623
+ }, []);
624
+ var getOTP = useCallback(function (mobileNumber) { return __awaiter(void 0, void 0, void 0, function () {
625
+ var res, status_1, err_1, message, errorMessage;
626
+ return __generator(this, function (_a) {
627
+ switch (_a.label) {
628
+ case 0:
629
+ _a.trys.push([0, 2, , 3]);
630
+ setCtaDisabled(false);
631
+ setSendingOtp(true);
632
+ triggerOTPListener();
633
+ return [4, sendLoginOtp(mobileNumber)];
634
+ case 1:
635
+ res = _a.sent();
636
+ status_1 = (res || {}).status;
637
+ if (status_1 === 'SUCCESS') {
638
+ setShowMobilePage(false);
639
+ setSendingOtp(false);
640
+ }
641
+ return [3, 3];
642
+ case 2:
643
+ err_1 = _a.sent();
644
+ console.error(err_1);
645
+ message = (err_1 || {}).message;
646
+ setSendingOtp(false);
647
+ errorMessage = message && LOGIN_CONSTANTS[message];
648
+ if (errorMessage) {
649
+ setErrorCallout(String(errorMessage));
650
+ }
651
+ else {
652
+ setErrorCallout(String(LOGIN_CONSTANTS.GENERIC_ERROR_MESSAGE));
653
+ }
654
+ if (message === 'OTP_SEND_LIMIT_EXCEEDED') {
655
+ setOtpResendDisabled(true);
656
+ }
657
+ return [3, 3];
658
+ case 3: return [2];
659
+ }
660
+ });
661
+ }); }, [showMobilePage, setShowMobilePage]);
662
+ var handleLoginSuccess = useCallback(function (loginMethod, action) {
663
+ var eventProps = getRavenEventProps();
664
+ var payload = __assign({ action_name: 'login_successful', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', login_new: action ? 'sign_up' : 'sign_in', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload);
665
+ if (sendUserInsights) {
666
+ sendEventWithUserInsights('u_login_success', payload);
667
+ }
668
+ else {
669
+ ravenSDKTrigger('u_login_success', payload);
670
+ }
671
+ if (hotelsLoyaltyFlow) {
672
+ onAuthSuccess(handleDrawerClose);
673
+ }
674
+ else {
675
+ onAuthSuccess();
676
+ if (action && !skipProfileFlow) ;
677
+ else {
678
+ handleDrawerClose();
679
+ setShowSuccess(true);
680
+ }
681
+ }
682
+ }, [ravenPayload, skipProfileFlow, hotelsLoyaltyFlow, sendUserInsights]);
683
+ var handleLoginFailure = useCallback(function (loginMethod) {
684
+ onAuthFailure(loginMethod);
685
+ }, []);
686
+ var handleDrawerClose = function (evt) {
687
+ evt === null || evt === void 0 ? void 0 : evt.stopPropagation();
688
+ setShowLoginForm(false);
689
+ setMobileNumber('');
690
+ setCtaDisabled(true);
691
+ var eventProps = getRavenEventProps();
692
+ ravenSDKTrigger('u_login_click', __assign({ action_name: 'login_prompt_dismissed', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
693
+ if (handleLoginClose && typeof handleLoginClose === 'function') {
694
+ handleLoginClose();
695
+ }
696
+ };
697
+ useEffect(function () {
698
+ if (isDrawerOpen) {
699
+ setShowMobilePage(true);
700
+ setShowLoginForm(true);
701
+ var eventProps = getRavenEventProps();
702
+ ravenSDKTrigger('u_login_popup', __assign({ action_name: 'login_prompt_opened', login_form: eventProps === null || eventProps === void 0 ? void 0 : eventProps.loginForm, login_type: 'native', vertical: eventProps === null || eventProps === void 0 ? void 0 : eventProps.vertical, page_name: eventProps === null || eventProps === void 0 ? void 0 : eventProps.pageName }, ravenPayload));
703
+ }
704
+ else {
705
+ setShowLoginForm(false);
706
+ }
707
+ }, [isDrawerOpen]);
708
+ return (jsx(ThemeProvider, { children: jsxs(Fragment, { children: [jsx(Drawer, __assign({ direction: 'bottom', isOpen: showLoginForm, showClose: true, overlay: true, handleClose: handleDrawerClose, onClose: function () { }, closeOnOutsideClick: closeOnOutsideClick }, { children: jsx("div", __assign({ className: "".concat(styles$1['utilswrapper'], " utilswrapper") }, { children: jsxs("div", __assign({ style: {
709
+ maxHeight: 'calc(100dvh - 60px)',
710
+ overflowY: 'auto',
711
+ borderRadius: '16px 16px 0 0',
712
+ } }, { children: [showCarousel && (jsx(CarouselWrapper, { customSlides: customSlides, carouselImages: carouselImages })), jsxs("div", __assign({ className: styles$1['login_form'] }, { children: [jsx("div", { children: jsx(Spacer, { className: 'pt-6' }) }), showMobilePage ? (jsx(MobileInput, { device: 'PWA', ctaDisabled: ctaDisabled, sendingOtp: sendingOtp, getOTP: getOTP, mobileNumber: mobileNumber, setMobileNumber: setMobileNumber, setMobileInputHeight: setMobileInputHeight, fallbackUri: fallbackUri, skipProfileFlow: skipProfileFlow, currentPageUri: currentPageUri, setErrorCallout: setErrorCallout, errorCallout: errorCallout, ravenPayload: ravenPayload, hotelsLoyaltyFlow: hotelsLoyaltyFlow })) : (jsx(OtpInput, { mobileNumber: mobileNumber, getOTP: getOTP, setCtaDisabled: setCtaDisabled, setShowMobilePage: setShowMobilePage, handleLoginSuccess: handleLoginSuccess, handleLoginFailure: handleLoginFailure, otpInputHeight: mobileInputHeight, setMobileNumber: setMobileNumber, setErrorCallout: setErrorCallout, errorCallout: errorCallout, otpResendDisabled: otpResendDisabled, ravenPayload: ravenPayload, skipProfileFlow: skipProfileFlow, hotelsLoyaltyFlow: hotelsLoyaltyFlow }))] }))] })) })) })), showSigninLoader && (jsx(Loader, { title: 'Please wait', message: 'Signing in...', className: 'z-10 bg-white' }))] }) }));
713
+ };
714
+
715
+ export { LoginModule };
2
716
  //# sourceMappingURL=ct-platform-login-module.esm.js.map