1"use strict";(self.webpackChunktataplay_getconnection=self.webpackChunktataplay_getconnection||[]).push([[6915,7990],{30188(e,t,s){s.d(t,{A:()=>c});var a=s(91249);const r="This field is required",i="Password can't be less than 8 characters",n="Password must be alpha-numeric, must have upper and lower case, and at least one special character.",o="Password should be alpha-numeric",l="New password and Confirm new password do not match",c={validateName:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>24?(t="Enter max 24 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateOrganization:e=>{let t="",s=!1;let a=e;return a=a.trim(),a?a.length>100?(t="Enter max 100 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateTextarea:e=>{let t="",s=!1;let a=e;return a=a.trim(),a?a.length>500?(t="Enter max 500 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateUrl:e=>{let t="",s=!1;let a=e;return a=a.trim(),a?a.length>100?(t="Enter max 100 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateEmail:(e,t=50)=>{const s=t;let a="",r=!1;return e?/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())?e.length>s?(a=`Maximum Length should be ${s}`,r=!0):a="":(a="Not a valid email",r=!0):(a="This field is required",r=!0),{error:a,hasError:r}},validatePhoneNumber:(e,t)=>{let s="",a=!1;return e?t&&(!/^\d{10}$/.test(e)||e.charAt(0)<6)?(s="Invalid RMN",a=!0):t||/^\d{10}$/.test(e)&&!(e.charAt(0)<6)?s="":(s="Not a valid Phone number",a=!0):(s="This field is required",a=!0),{error:s,hasError:a}},validateSUBID:e=>{let t="",s=!1;return e?t="":(t="* This field is required",s=!0),{error:t,hasError:s}},validatePinCode:e=>{let t="",s=!1;return e?/^[0-9]+$/.test(e)&&0!=e.charAt(0)?e.length<6?(t="Minimum Length should be 6",s=!0):e.length>6?(t="Maximum Length should be 6",s=!0):t="":(t="Not a valid pin code",s=!0):(t="This field is required",s=!0),{error:t,hasError:s}},validateAddress:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>72?(t="Maximum Length should be 72",s=!0):t="":(t="Enter a valid address",s=!0),{error:t,hasError:s}},validateAddressHA:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>75?(t="Maximum Length should be 75",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateAddressLine2HA:e=>{let t="",s=!1,a=e;return a=a.trim(),a.length>50?(t="Maximum Length should be 50",s=!0):t="",{error:t,hasError:s}},validateLandmarkHA:e=>{let t="",s=!1,a=e;return a=a.trim(),a.length>25?(t="Maximum Length should be 25",s=!0):t="",{error:t,hasError:s}},validateLandmark:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>72?(t="Maximum Length should be 72",s=!0):t="":(t="Add a landmark",s=!0),{error:t,hasError:s}},validateConnectionFor:e=>{let t="",s=!1,a=e;return a=a.toString().trim(),a?t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateConnectionNo:e=>{let t="",s=!1,a=e;return a=a.toString().trim(),a?t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateByArray:(e,t)=>{let s="",a=!1,r=e;if(r=r.toString().trim(),Array.isArray(t)&&t.length>0)for(let e=0;e<t.length;e+=1){if("required"===t[e].validation&&!r){s="Choose your area",a=!0;break}}return{error:s,hasError:a}},validateGST:e=>{let t="",s=!1,r=e;r=r.toString().trim();const i=(0,a.A)("gstNo");return r?i.test(String(r).toLowerCase())?r.length>15&&(t="Enter max 15 characters",s=!0):(t="Not a valid GST Number",s=!0):t="",{error:t,hasError:s}},validateOptionalField:e=>{let t="",s=!1,a=e;return a=a.trim(),a.length>240?(t="Enter max 240 characters",s=!0):a&&0===a.indexOf(" ")?(t="Invalid Name",s=!0):t="",{error:t,hasError:s}},validateDob:e=>{let t="",s=!1;return e?t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateFavouriteGames:e=>{let t="",s=!1;return 0===e.length?(t="This field is required",s=!0):t="",{error:t,hasError:s}},validateUserProfileField1:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>40?(t="Enter max 40 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateUserProfileField2:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>240?(t="Enter max 240 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validatePhoneOrSubid:e=>{let t="",s=!1;return e?/^\d{10}$/.test(e)?t="":0===e.charAt(0)?(t="* Not a valid input",s=!0):e.charAt(0)>5?(t="* Not a valid Phone number",s=!0):(t="* Not a valid subscriber id",s=!0):(t="* This field is required",s=!0),{error:t,hasError:s}},validateVerifyRmnOrSubsId:e=>{let t="",s=!1;return e?/^\d{10}$/.test(e)&&0!=e.charAt(0)?t="":e.charAt(0)>5?(t="Please enter a valid Tata Play Subscriber ID or Registered Mobile number",s=!0):(e.charAt(0),t="Please enter a valid Tata Play Subscriber ID or Registered Mobile number",s=!0):(t="Please enter your Tata Play Subscriber ID or Registered Mobile number",s=!0),{error:t,hasError:s}},validateSaveTvVerifyRmnOrSubsId:e=>{let t="",s=!1;return e&&/^\d{10}$/.test(e)&&0!=e.charAt(0)?e.charAt(0)<6&&(t="Please enter a valid Tata Play Registered Mobile number",s=!0):(t="Please enter a valid Tata Play Registered Mobile number",s=!0),{error:t,hasError:s}},validateOtp:e=>{let t="",s=!1;return e?/^[0-9]+$/.test(e)?e.length<6?(t="Minimum Length should be 6",s=!0):e.length>6?(t="Maximum Length should be 6",s=!0):t="":(t="Not a valid OTP",s=!0):(t="This field is required",s=!0),{error:t,hasError:s}},validatePin:e=>{let t="",s=!1;return e?/^[0-9]+$/.test(e)?e.length<4?(t="Minimum Length should be 4",s=!0):e.length>4?(t="Maximum Length should be 4",s=!0):t="":(t="Not a valid Pin",s=!0):(t="This field is required",s=!0),{error:t,hasError:s}},validateSubscriberId:e=>{let t="",s=!1;return e?!/^\d{10}$/.test(e)||e.charAt(0)>5||0==e.charAt(0)?(t="Not a valid subscriber id",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validatePassword:(e,t,s)=>{let o="",c=!1;const d=(0,a.A)("passwordRegex");return e?e.length<8?(o=i,c=!0):e.length>32?(o="Password can't be greater than 32 characters",c=!0):d.test(e)?t&&t!==e?(o=l,s&&s.passwordDoNotMatch&&(o=s.passwordDoNotMatch),c=!0):o="":(o=n,c=!0):(o=r,c=!0),{error:o,hasError:c}},validateCommentTextarea:e=>{let t="",s=!1;let a=e;return a=a.trim(),a?a.length>800?(t="Enter max 800 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateLoginPassword:(e,t)=>{let s="",n=!1;const c=(0,a.A)("newPasswordRegex");return e?e.length<8?(s=i,n=!0):e.length>32?(s="Password can't be greater than 32 characters",n=!0):c.test(e)?t&&t!==e?(s=l,n=!0):s="":(s=o,n=!0):(s=r,n=!0),{error:s,hasError:n}},validateSubId:e=>{let t="",s=!1;return e?/^[0-9]+$/.test(e)?e.length<10?(t="Minimum Length should be 10",s=!0):e.length>10?(t="Maximum Length should be 10",s=!0):e.charAt(0)>5?(t="* Not a valid subId",s=!0):t="":(t="Not a valid subId",s=!0):(t="This field is required",s=!0),{error:t,hasError:s}},validateRequired:e=>{let t="",s=!1;return e||(t="This field is required",s=!0),{error:t,hasError:s}},validateRequiredMaxLength:e=>{let t="",s=!1;return e?e.length>72&&(t="Maximum length should be 72 characters",s=!0):(t="This field is required",s=!0),{error:t,hasError:s}},validateAccHolderName:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>24?(t="Enter max 24 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateAccNumber:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>18?(t="Enter max 18 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateConfirmAccNumber:(e,t)=>{let s="",a=!1,r=e;return r=r.trim(),r?r.length>18?(s="Enter max 18 characters",a=!0):r!==t?(s="Account number do not match",a=!0):s="":(s="This field is required",a=!0),{error:s,hasError:a}},validateBankName:e=>{let t="",s=!1,a=e;return a=a.trim(),a?t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateOtherBankName:(e,t)=>
1{let s="",a=!1,r=e;return r=r.trim(),"other"!==t.toLowerCase()||r?s="":(s="This field is required",a=!0),{error:s,hasError:a}},validateIfsc:e=>{let t="",s=!1,a=e;return a=a.trim(),a?a.length>11?(t="Enter max 11 characters",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateConfirmIfsc:(e,t)=>{let s="",a=!1,r=e;return r=r.trim(),r?r.length>11?(s="Enter max 11 characters",a=!0):r!==t?(s="IFSC code do not match",a=!0):s="":(s="This field is required",a=!0),{error:s,hasError:a}},validateCheque:e=>{let t="",s=!1,a=e;return a?(a.size/1024).toFixed(4)>500?(t="File should not be greater than 500 KB",s=!0):"image/jpeg"!==a.type&&"application/pdf"!==a.type?(t="Upload valid file format",s=!0):t="":(t="This field is required",s=!0),{error:t,hasError:s}},validateBugUrl:(e,t=2048)=>{let s="",a=!1;return e?/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?\/[a-zA-Z0-9]{2,}|((https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z]{2,}(\.[a-zA-Z]{2,})(\.[a-zA-Z]{2,})?)|(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)?[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}\.[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})?/.test(String(e).toLowerCase())?e.length>t?(s=`Maximum Length should be ${t}`,a=!0):s="":(s="Not a valid url",a=!0):(s="This field is required",a=!0),{error:s,hasError:a}},validateImage:e=>{var t=["image/jpeg","application/pdf","image/png","video/mp4"],s=e.type;let a="",r=!1,i=e,n=!1;for(var o in t)if(s===t[o]){n=!0;break}return i?(i.size/1024).toFixed(4)>25e3?(a="File should not be greater than 25 MB",r=!0):n?a="":(a="Allowed Extensions are : *."+t.join(", *."),r=!0):(a="This field is required",r=!0),{error:a,hasError:r}},validateCustomLength:(e,t)=>{let s="",a=!1,r=e.trim();return r?r.length>t?(s=`Enter max ${t} characters`,a=!0):s="":(s="This field is required",a=!0),{error:s,hasError:a}}}},34674(e,t,s){var a=s(30188);const r={validatePinCodeForm:({pinCode:e})=>{let t={};const s=a.A.validatePinCode(e||"");return t={pinCodeMessage:s.error,hasErrors:s.hasError},t},validateLeadPinCodeForm:({firstName:e,lastName:t,phone:s,email:r,pinCode:i})=>{let n={};const o=a.A.validateName(e||""),l=a.A.validateName(t||""),c=a.A.validatePhoneNumber(s||""),d=a.A.validateEmail(r||""),m=a.A.validatePinCode(i||"");return n={firstNameMessage:o.error,lastNameMessage:l.error,phoneMessage:c.error,emailMessage:d.error,pinCodeMessage:m.error,hasErrors:o.hasError||l.hasError||c.hasError||d.hasError||m.hasError},n},validateRcConnectionForm:({firstName:e,phone:t,pinCode:s})=>{let r={};const i=a.A.validateName(e||""),n=a.A.validatePhoneNumber(t||""),o=a.A.validatePinCode(s||"");return r={firstNameMessage:i.error,phoneMessage:n.error,pinCodeMessage:o.error,hasErrors:i.hasError||n.hasError||o.hasError},r},validateExpressConnectionForm:({firstName:e,lastName:t,phone:s,pinCode:r,email:i})=>{let n={};const o=a.A.validateName(e||""),l=a.A.validatePhoneNumber(s||""),c=a.A.validatePinCode(r||""),d=a.A.validateEmail(i||"");return n={firstNameMessage:o.error,phoneMessage:l.error,pinCodeMessage:c.error,emailMessage:d.error,hasErrors:o.hasError||l.hasError||c.hasError||d.hasError},n},validateUserInfoForm:({connection:e,numberConnections:t,firstName:s,lastName:r,mobile:i,email:n,pincode:o})=>{let l={};const c=a.A.validateConnectionFor(e||""),d=a.A.validateConnectionNo(t||""),m=a.A.validateName(s||""),u=a.A.validateName(r||""),h=a.A.validatePhoneNumber(i||""),p=a.A.validateEmail(n||""),g=a.A.validatePinCode(o||"");return l={connectionMessage:c.error,numberConnectionsMessage:d.error,firstNameMessage:m.error,lastNameMessage:u.error,mobileMessage:h.error,emailMessage:p.error,pincodeMessage:g.error,hasErrors:c.hasError||d.hasError||m.hasError||u.hasError||h.hasError||p.hasError||g.hasError},l},validateSaveDetailsForm:({firstName:e,lastName:t,phone:s,email:r,gstNo:i})=>{let n={};const o=a.A.validateName(e||""),l=a.A.validateName(t||""),c=a.A.validatePhoneNumber(s||""),d=a.A.validateEmail(r||""),m=a.A.validateGST(i||"");return n={firstNameMessage:o.error,lastNameMessage:l.error,phoneMessage:c.error,emailMessage:d.error,gstNoMessage:m.error,hasErrors:o.hasError||l.hasError||c.hasError||d.hasError||m.hasError},n},validateAgentCustomerInfoForm:({firstName:e,lastName:t,phone:s,email:r,pinCode:i,area:n,address:o,landmark:l})=>{let c={};const d=a.A.validateByArray(n||""),m=a.A.validateAddress(o||""),u=a.A.validateLandmark(l||""),h=a.A.validateName(e||""),p=a.A.validateName(t||""),g=a.A.validatePhoneNumber(s||""),f=a.A.validateEmail(r||""),x=a.A.validatePinCode(i||"");return c={areaMessage:d.error,addressMessage:m.error,landmarkMessage:u.error,firstNameMessage:h.error,lastNameMessage:p.error,phoneMessage:g.error,emailMessage:f.error,pinCodeMessage:x.error,hasErrors:d.hasError||m.hasError||u.hasError||h.hasError||p.hasError||g.hasError||f.hasError||x.hasError},c},validateUserAddressForm:({area:e,address:t,landmark:s})=>{let r={};const i=a.A.validateByArray(e||""),n=a.A.validateAddress(t||""),o=a.A.validateLandmark(s||"");return r={areaMessage:i.error,addressMessage:n.error,landmarkMessage:o.error,hasErrors:i.hasError||n.hasError||o.hasError},r},validateUserProfileForm:({subscriberName:e,playerName:t,mobileNumber:s,mostPlayedGame:r,option1:i,option2:n,option3:o,option4:l,userDob:c,favouriteGames:d})=>{let m={};const u=a.A.validateUserProfileField1(e||""),h=a.A.validateUserProfileField1(t||""),p=a.A.validatePhoneNumber(s||""),g=a.A.validateUserProfileField2(r||""),f=a.A.validateUserProfileField2(i||""),x=a.A.validateOptionalField(n||""),b=a.A.validateOptionalField(o||""),v=a.A.validateOptionalField(l||""),y=a.A.validateDob(c||""),S=a.A.validateFavouriteGames(d||"");return m={subscriberNameMessage:u.error,playerNameMessage:h.error,mobileNumberMessage:p.error,mostPlayedGameMessage:g.error,userDobStatus:y.error,favouriteGamesStatus:S.error,option1Message:f.error,option2Message:x.error,option3Message:b.error,option4Message:v.error,hasErrors:u.hasError||h.hasError||p.hasError||g.hasError||y.hasError||S.hasError||f.hasError||x.hasError||b.hasError||v.hasError},m},validateLeadGenerationForm:({firstName:e,phone:t,pinCode:s})=>{let r={};const i=a.A.validateName(e||""),n=a.A.validatePhoneNumber(t||""),o=a.A.validatePinCode(s||"");return r={firstNameMessage:i.error,phoneMessage:n.error,pinCodeMessage:o.error,hasErrors:i.hasError||n.hasError||o.hasError},r},validatePhoneOrSubsid:({rmnOrSubId:e,pin:t})=>{let s={};const r=a.A.validatePhoneOrSubid(e||"");let i;return t&&(i=a.A.validatePin(t||"")),s={rmnOrSubIdMessage:r.error,pinMessage:i?i.error:"",hasErrors:r.hasError||i&&i.hasError},s},validateVerifyRmnOrSubscriberid:({subscriberId:e})=>{let t={};const s=a.A.validateVerifyRmnOrSubsId(e||"");return t={subscriberIdMessage:s.error,hasErrors:s.hasError},t},validateSaveTvVerifyRmnOrSubsId:({subscriberId:e})=>{let t={};const s=a.A.validateSaveTvVerifyRmnOrSubsId(e||"");return t={subscriberIdMessage:s.error,hasErrors:s.hasError},t}
1,validateCallBackDetailsForm:({firstName:e,lastName:t,phone:s})=>{let r={};const i=a.A.validateName(e||""),n=a.A.validateName(t||""),o=a.A.validatePhoneNumber(s||"");return r={firstNameMessage:i.error,lastNameMessage:n.error,phoneMessage:o.error,hasErrors:i.hasError||n.hasError||o.hasError},r},validateOTP:({validateOTP:e})=>{let t={};const s=a.A.validateOtp(e||"");return t={validateOTPMessage:s.error,hasErrors:s.hasError},t},validateSubsid:({SubsId:e})=>{let t={};const s=a.A.validateSUBID(e||"");return t={SubsIdMessage:s.error,hasErrors:s.hasError},t},validateUpdateRmnForm:({subId:e,rmn:t,pin:s})=>{let r={};const i=a.A.validateSubscriberId(e||""),n=a.A.validatePhoneNumber(t||""),o=a.A.validatePin(s||"");return r={subIdMessage:i.error,rmnMessage:n.error,pinMessage:o.error,hasErrors:i.hasError||n.hasError||o.hasError},r},validateAddressLoginForm:({subId:e,pin:t})=>{let s={};const r=a.A.validateSubscriberId(e||""),i=a.A.validatePin(t||"");return s={subIdMessage:r.error,pinMessage:i.error,hasErrors:r.hasError||i.hasError},s},validateRegisterUserForm:e=>{const{subscriberId:t,password:s,confirmPassword:r,email:i,rmn:n}=e;let o={};const l=a.A.validateSubId(t||""),c=a.A.validatePassword(s||""),d=a.A.validatePassword(r||"",s||"",{passwordDoNotMatch:"Password and Confirm password do not match"}),m=a.A.validateEmail(i||""),u=a.A.validatePhoneNumber(n||"");return o={subscriberIdMessage:l.error,passwordMessage:c.error,confirmPasswordMessage:d.error,emailMessage:m.error,rmnMessage:u.error,hasErrors:l.hasError||c.hasError||d.hasError||m.hasError||u.hasError},o},validateResetPwdForm:e=>{const{verificationCode:t,newPassword:s,confirmPassword:r}=e;let i={};const n=a.A.validateRequired(t||""),o=a.A.validatePassword(s||""),l=a.A.validatePassword(r||"",s||"");return i={verificationCodeMessage:n.error,newPasswordMessage:o.error,confirmPasswordMessage:l.error,hasErrors:n.hasError||o.hasError||l.hasError},i},validateChangePwdForm:e=>{const{password:t,newPassword:s,confirmPassword:r}=e;let i={};const n=a.A.validateRequired(t||""),o=a.A.validatePassword(s||""),l=a.A.validatePassword(r||"",s||"");return i={passwordMessage:n.error,newPasswordMessage:o.error,confirmPasswordMessage:l.error,hasErrors:n.hasError||o.hasError||l.hasError},i},validatePasswordForm:e=>{const{password:t}=e;let s={};const r=a.A.validatePassword(t||"");return s={passwordMessage:r.error,hasErrors:r.hasError},s},validateLoginPasswordForm:e=>{const{password:t}=e;let s={};const r=a.A.validateLoginPassword(t||"");return s={passwordMessage:r.error,hasErrors:r.hasError},s},validateWoSrNewReqForm:({nature:e,type:t,comments:s})=>{let r={};const i=a.A.validateConnectionFor(e||""),n=a.A.validateConnectionNo(t||""),o=a.A.validateCommentTextarea(s||"");return r={natureMessage:i.error,typeMessage:n.error,commentsMessage:o.error,hasErrors:i.hasError||n.hasError||o.hasError},r},validateEmailForm:({email:e})=>{let t={};const s=a.A.validateEmail(e||"");return t={emailMessage:s.error,hasErrors:s.hasError},t},validateRewardsEmailForm:({emailId:e})=>{let t={};const s=a.A.validateEmail(e||"");return t={emailIdMessage:s.error,hasErrors:s.hasError},t},validateGSTForm:({gstNo:e})=>{let t={};const s=a.A.validateGST(e||"");return t={gstNoMessage:s.error,hasErrors:s.hasError},t},validateUpdateAddressForm:({location:e,addressLine1:t,addressLine2:s,pincode:r})=>{let i={};const n=a.A.validateRequired(e||""),o=a.A.validateRequiredMaxLength(t||""),l=a.A.validateRequiredMaxLength(s||""),c=a.A.validatePinCode(r||"");return i={locationMessage:n.error,addressLine1Message:o.error,addressLine2Message:l.error,pincodeMessage:c.error,hasErrors:n.hasError||o.hasError||l.hasError||c.hasError},i},validateUserPhoneNumber:({rmn:e},t)=>{let s={};const r=a.A.validatePhoneNumber(e||"",t);return s={rmnMessage:r.error,hasErrors:r.hasError},s},validateRefundForm:({accHolderName:e,accNumber:t,confirmAccNumber:s,bankName:r,otherBankName:i,ifsc:n,ifscConfirm:o,cheque:l})=>{let c={};const d=a.A.validateAccHolderName(e||""),m=a.A.validateAccNumber(t||""),u=a.A.validateConfirmAccNumber(s||"",t),h=a.A.validateBankName(r||""),p=a.A.validateOtherBankName(i||"",r),g=a.A.validateIfsc(n||""),f=a.A.validateConfirmIfsc(o||"",n),x=a.A.validateCheque(l||null);return c={accHolderNameMessage:d.error,accNumberMessage:m.error,confirmAccNumberMessage:u.error,bankNameMessage:h.error,otherBankNameMessage:p.error,
1ifscMessage:g.error,ifscConfirmMessage:f.error,chequeMessage:x.error,hasErrors:d.hasError||u.hasError||m.hasError||h.hasError||p.hasError||g.hasError||f.hasError||x.hasError},c},validateBugDetailsForm:({vulnerabilityName:e,vulnerabilityDescription:t,affectedUrl:s,reproduceVulnerability:r,uploadPhoto:i,impact:n,recommendation:o})=>{let l={};const c=a.A.validateCustomLength(e||"",70),d=a.A.validateCustomLength(t||"",3e3),m=a.A.validateBugUrl(s||"",2048),u=a.A.validateCustomLength(r||"",3e3),h=a.A.validateImage(i||""),p=a.A.validateCustomLength(n||"",1500),g=a.A.validateCustomLength(o||"",1500);return l={vulnerabilityNameMessage:c.error,vulnerabilityDescriptionMessage:d.error,affectedUrlMessage:m.error,reproduceVulnerabilityMessage:u.error,uploadPhotoMessage:h.error,impactMessage:p.error,recommendationMessage:g.error,hasErrors:c.hasError||d.hasError||m.hasError||u.hasError||h.hasError||p.hasError||g.hasError},l},validatePersonalDetailsForm:({vulnerabilityName:e})=>{let t={};const s=a.A.validateName(e||"");return t={vulnerabilityNameMessage:s.error,hasErrors:s.hasError},t}};s.d(t,["A",0,r])},48016(e,t,s){const a=()=>{try{const t=document.getElementById("confettiAnimate"),s=document.getElementById("canvas"),a=s.getContext("2d");s.width=window.innerWidth,s.height=window.innerHeight;let r=a.canvas.width/2,i=a.canvas.height/2;const n=[],o=[],l=20,c=10,d=.3,m=.55,u=.075,h=.02,p=3,g=[{front:"#220046",back:"#6B00DD"},{front:"#6B00DD",back:"#E10092"},{front:"#E10092",back:"#220046"}],f=(e,t)=>Math.random()*(t-e)+e,x=(e,t)=>{const s=f(e[0],e[1]),a=t[1]-t[0]+1;let r=t[1]-Math.abs(f(0,a)+f(0,a)-a);return r>=t[1]-1&&(r+=Math.random()<.25?f(1,3):0),{x:s,y:-r}};function b(){this.randomModifier=f(0,99),this.color=g[Math.floor(f(0,g.length))],this.dimensions={x:f(5,9),y:f(8,15)},this.position={x:f(s.width/2-t.offsetWidth/4,s.width/2+t.offsetWidth/4),y:f(s.height/2+t.offsetHeight/2+8,s.height/2+1.5*t.offsetHeight-8)},this.rotation=f(0,2*Math.PI),this.scale={x:1,y:1},this.velocity=x([-9,9],[6,11])}function v(){this.color=g[Math.floor(f(0,g.length))].back,this.radius=f(1,2),this.position={x:f(s.width/2-t.offsetWidth/3,s.width/2+t.offsetWidth/3),y:f(s.height/2+t.offsetHeight/2+0,s.height/2+1.5*t.offsetHeight-8)},this.velocity={x:f(-6,6),y:f(-8,-12)}}b.prototype.update=function(){this.velocity.x-=this.velocity.x*u,this.velocity.y=Math.min(this.velocity.y+d,p),this.velocity.x+=Math.random()>.5?Math.random():-Math.random(),this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.scale.y=Math.cos(.09*(this.position.y+this.randomModifier))},v.prototype.update=function(){this.velocity.x-=this.velocity.x*h,this.velocity.y=this.velocity.y+m,this.position.x+=this.velocity.x,this.position.y+=this.velocity.y},window.initBurst=()=>{for(let e=0;e<l;e++)n.push(new b);for(let e=0;e<c;e++)o.push(new v)},setTimeout(()=>{window.initBurst()},1e3);var e=()=>{a.clearRect(0,0,s.width,s.height),n.forEach((e,t)=>{const s=e.dimensions.x*e.scale.x,r=e.dimensions.y*e.scale.y;a.translate(e.position.x,e.position.y),a.rotate(e.rotation),e.update(),a.fillStyle=e.scale.y>0?e.color.front:e.color.back,a.fillRect(-s/2,-r/2,s,r),a.setTransform(1,0,0,1,0,0)}),window.requestAnimationFrame(e)};const y=()=>{s.width=window.innerWidth,s.height=window.innerHeight,r=a.canvas.width/2,i=a.canvas.height/2};window.addEventListener("resize",()=>{y()}),e()}catch(S){console.log(S)}};s.d(t,["A",0,a])},12555(e,t,s){var a=s(64467),r=s(96540),i=s(67475),n=s(39789),o=s(25614),l=s(25242),c=s(49862),d=s(97965),m=s(21439),u=s(74191),h=s(70581),p=s(74848);function g(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function f(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?g(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):g(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const x=e=>{const{closeDrawerModal:t,modalParameters:s,modalParameters:{payload:a,pauseResumeData:g,activeBingePack:x,paidFtv:b,unpaidFtv:v,comboEndDate:y,isMulti:S,modalId:j}}=e,A=(0,d.wA)(),[N,C]=(0,r.useState)(!1),[w,_]=(0,r.useState)(g&&g.loaderTimer),[E,T]=(0,r.useState)(0),[D,O]=(0,r.useState)(!1),k=()=>{let e="";return"OTT"===a.suspensionType?(a.comboEndDate=y,e="ottCombo"):"FULL"===a.suspensionType&&(e=x||v?"bingePack":b&&!v?"ftvStick":"default"),e},P=k()&&g&&g[k()]&&g[k()][S?"multi":"single"],I=e=>{A((0,i.qf)(n.lx.COMMON_MODAL,{Component:o.A,modalId:j?`${j}
1-result`:"managepack-account-pause-result",parentClass:"drawer-popup success-fail",backDropClass:"bottom-sheet",type:"pause",errMsg:e,isMulti:S,pauseResumeData:g,ottCombo:"ottCombo"===k()}))};(0,r.useEffect)(()=>{0===w&&(O(!0),M())},[w]);const M=async()=>{try{const e=await l.T.pauseResumeTransactionResponse({transactionId:E});e.data.status===c.A.MESSAGES_TYPES.SUCCESS?((0,m.Yl)({eventName:"MANAGE_PACK_PAUSE_STATUS"}),"SUCCESS"===e.data.message?(O(!1),I("")):(O(!1),I(e.data.message))):e.data.status===c.A.MESSAGES_TYPES.FAIL?(O(!1),I("fail")):"FAILURE"===e.data.status?(O(!1),I(e.data.message)):(O(!1),I("inProgress"))}catch(e){console.log(e)}},$=async()=>{C(!0),(()=>{let e;e=setInterval(()=>{let t;_(e=>(t=e-1,t)),0===t&&(clearInterval(e),_(g&&g.loaderTimer),C(!1))},1e3)})(),A((0,i.NB)(n.lx.COMMON_MODAL,f(f({},s),{},{hideCross:!0,noOverlayClose:!0,hidePopUpLine:!0,noDrawerClose:!0})));try{const e=await l.T.resumeBox(a);e.data.status===c.A.MESSAGES_TYPES.SUCCESS&&T(e.data.data.transactionId)}catch(e){console.log(e)}};return D?(0,p.jsx)(u.A,{}):(0,p.jsx)(r.Fragment,{children:N?(0,p.jsxs)("div",{className:"spinnertimer-main",children:[(0,p.jsx)("div",{className:"spinnertimer"}),(0,p.jsxs)("div",{className:"timer-circle gradient1",style:{color:"red"},children:[" ",w]})]}):(0,p.jsxs)(r.Fragment,{children:[(0,p.jsxs)("div",{className:"details-container",children:[(0,p.jsx)("div",{className:"heading-sm text-center",children:(0,p.jsx)("h2",{id:j?`t-${j}`:void 0,className:"heading1 gradient",children:P&&P.heading})}),(0,p.jsxs)("div",{className:"modal-details",children:[(0,p.jsx)(h.A,{htmlContent:`${"ottCombo"===k()&&y?P&&P.details1.replace("!date!",(0,m.po)((0,m.ej)(y),"mpack")):P&&P.details1}`}),P&&P.details2&&(0,p.jsx)("p",{children:P.details2}),P&&P.details3&&(0,p.jsx)("p",{children:P.details3}),(0,p.jsx)(h.A,{htmlContent:P&&P.confirmTxt})]})]}),(0,p.jsxs)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:[(0,p.jsx)("button",{className:"btn btn-primary waves-effect waves-light",onClick:()=>$(),children:P&&P.cta1}),(0,p.jsx)("button",{className:"btn btn-link waves-effect waves-light cancel-cta",onClick:()=>t(),children:P&&P.cta2})]})]})})};s.d(t,["A",0,x])},26304(e,t,s){var a=s(64467),r=s(96540),i=s(97965),n=s(25242),o=s(49862),l=s(67475),c=s(39789),d=s(25614),m=s(74191),u=s(21439),h=s(74848);function p(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function g(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?p(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):p(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const f=e=>{const{closeDrawerModal:t,modalParameters:s,modalParameters:{stbNumber:a,stbType:p,actionType:f,vcSubStatus:x,isPartialPause:b,resumeAll:v,pauseResumeData:y,suspensionType:S,modalId:j}}=e,A=(0,i.wA)(),[N,C]=(0,r.useState)(!1),[w,_]=(0,r.useState)(y&&y.loaderTimer),[E,T]=(0,r.useState)(0),[D,O]=(0,r.useState)(!1),k=e=>{A((0,l.qf)(c.lx.COMMON_MODAL,{Component:d.A,modalId:j?`${j}-result`:"managepack-confirm-resume-result",parentClass:"drawer-popup success-fail",backDropClass:"bottom-sheet",type:"resume",errMsg:e,resumeAll:v,pauseResumeData:y}))};(0,r.useEffect)(()=>{0===w&&(O(!0),P())},[w]);const P=async()=>{try{const e=await n.T.pauseResumeTransactionResponse({transactionId:E});e.data.status===o.A.MESSAGES_TYPES.SUCCESS?((0,u.Yl)({eventName:"MANAGE_PACK_RESUME_STATUS"}),"SUCCESS"===e.data.message?(O(!1),k("")):(O(!1),k(e.data.message))):e.data.status===o.A.MESSAGES_TYPES.FAIL?(O(!1),k("fail")):"FAILURE"===e.data.status?(O(!1),k(e.data.message)):(O(!1),k("inProgress"))}catch(e){console.log(e)}},I=async()=>{C(!0),(()=>{let e;e=setInterval(()=>{let t;_(e=>(t=e-1,t)),0===t&&(clearInterval(e),_(y&&y.loaderTimer),C(!1))},1e3)})(),A((0,l.NB)(c.lx.COMMON_MODAL,g(g({},s),{},{hideCross:!0,noOverlayClose:!0,hidePopUpLine:!0,noDrawerClose:!0})));try{const e={stbNumber:a,stbType:p,actionType:f,isPartialPause:b,vcSubStatus:x};S&&(e.suspensionType=S);const t=await n.T.resumeBox(e);t.data.status===o.A.MESSAGES_TYPES.SUCCESS&&((0,u.Yl)({eventName:"MANAGE_PACK_RESUME_STATUS"}),T(t.data.data.transactionId))}catch(e){console.log(e)}},M=y&&y.confirmResume&&y.confirmResume[v?"resumeAll":"resume"];return D?(0,h.jsx)(m.A,{}):(0,h.jsx)(r.Fragment,{children:N?(0,h.jsxs)("div",{className:"spinnertimer-main",children:[(0,h.jsx)("div",{className:"spinnertimer"}),(0,h.jsxs)("div",{className:"timer-circle gradient1",style:{color:"red"},children:[" ",w]})]}):(0,h.jsxs)(r.Fragment,{children:[(0,h.jsx)("div",{className:"details-container",children:(0,h.jsxs)("div",{className:"heading-sm text-center",children:[(0,h.jsx)("h2",{id:j?`t-${j}`:void 0,className:"heading1 gradient",children:M&&M.heading}
1),(0,h.jsx)("div",{className:"para-details",children:(0,h.jsx)("p",{children:M&&M.details})})]})}),(0,h.jsxs)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:[(0,h.jsx)("button",{className:"btn btn-primary waves-effect waves-light",onClick:()=>I(),children:M&&M.cta1}),(0,h.jsx)("button",{className:"btn btn-link waves-effect waves-light cancel-cta",onClick:()=>{(0,u.Yl)({eventName:"MANAGE_PACK_RESUME_CANCEL"}),t()},children:M&&M.cta2})]})]})})};s.d(t,["A",0,f])},92568(e,t,s){var a=s(96540),r=s(21439),i=s(70581),n=s(74848);const o=e=>{const{closeDrawerModal:t,modalParameters:{responseData:s,pauseResumeData:o,isMulti:l,type:c,modalId:d}}=e,m=()=>s.firstActivationStatus?"activationDate":s.pending?s.pastSuspensionDate?"pastSuspension":"accLevel"===c?"accFutureDated":"boxFutureDated":"secondaryPaused";if("accFutureDated"===m()||"boxFutureDated"===m()){const e=m()&&o&&o[m()]&&o[m()][s.showAccountLevelMsg?"accLevelMsg":"boxLevelMsg"][l?"multi":"single"];return(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)("div",{className:"details-container",children:[(0,n.jsx)("div",{className:"heading-sm text-center",children:(0,n.jsx)("h1",{id:d?`t-${d}`:void 0,className:"heading1 gradient",children:e&&e.heading})}),(0,n.jsx)(i.A,{className:"para-details text-center",htmlContent:(e&&e.details1).replace("!date!",s&&s.suspensionDate&&(0,r.po)(s.suspensionDate,"mpack"))}),e&&e.details2&&(0,n.jsx)(i.A,{className:"text-center para-details details",htmlContent:e.details2})]}),(0,n.jsx)("div",{className:"fixed-btn btn-contr text-center mT20 show d-flex",children:(0,n.jsx)("button",{type:"button",className:"btn btn-primary waves-effect waves-light d-flex",onClick:()=>t(),children:e&&e.cta1})})]})}{const e=m()&&o&&o[m()]&&o[m()][l?"multi":"single"];return(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)("div",{className:"details-container",children:[(0,n.jsx)("div",{className:"heading-sm text-center",children:(0,n.jsx)("h1",{id:d?`t-${d}`:void 0,className:"heading1 gradient",children:e&&e.heading})}),(0,n.jsx)(i.A,{className:"para-details text-center",htmlContent:"activationDate"===m()?(e&&e.details1).replace("!activationDate!",s&&s.futureSuspendDate):e&&e.details1}),e&&e.details2&&(0,n.jsx)(i.A,{className:"text-center para-details details",htmlContent:e.details2})]}),(0,n.jsx)("div",{className:"fixed-btn btn-contr text-center mT20 show d-flex",children:(0,n.jsx)("button",{type:"button",className:"btn btn-primary waves-effect waves-light d-flex",onClick:()=>t(),children:e&&e.cta1})})]})}};s.d(t,["A",0,o])},25614(e,t,s){var a=s(96540),r=s(2543),i=s(70581),n=s(74848);const o=e=>{const{closeDrawerModal:t,modalParameters:{pauseResumeData:s,type:o,errMsg:l,isMulti:c,resumeAll:d,ottCombo:m,modalId:u}}=e,h=s&&s.pauseSuccess&&s.pauseSuccess[c?"multi":"single"],p=s&&s.resumeSuccess&&s.resumeSuccess[d?"resumeAll":"resume"],g="inProgress"===l||s.pauseResumeFail[l]?l:"fail"===l?"fail":"default",f="pause"===o?h.details:p.details;return(0,n.jsx)(a.Fragment,{children:(0,r.isEmpty)(l)?(0,n.jsxs)(a.Fragment,{children:[(0,n.jsxs)("div",{className:"details-container",children:[(0,n.jsx)("div",{className:"heading-sm text-center",children:(0,n.jsx)("div",{id:u?`t-${u}`:void 0,className:"heading1 gradient",children:"pause"===o?m?h.comboHeading:h.heading:p.heading})}),(0,n.jsx)("div",{className:"para-details text-center",children:"pause"===o&&c?(0,n.jsx)(i.A,{Tag:"p",htmlContent:f}):(0,n.jsx)("p",{children:f})})]}),(0,n.jsx)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:(0,n.jsx)("button",{className:"btn btn-primary waves-effect waves-light",onClick:()=>t(),children:"pause"===o?h.cta:p.cta})})]}):"fail"===g?(0,n.jsx)("div",{className:"details-container",children:(0,n.jsx)("div",{className:"heading-sm text-center",children:(0,n.jsx)("div",{id:u?`t-${u}`:void 0,className:"heading1 gradient",children:"FAIL"})})}):(0,n.jsxs)("div",{className:"details-container",children:[s.pauseResumeFail[g].heading&&(0,n.jsx)("div",{className:"heading-sm text-center",children:(0,n.jsx)("div",{id:u?`t-${u}`:void 0,className:"heading1 gradient",children:s.pauseResumeFail[g].heading})}
1),(0,n.jsxs)("div",{className:"para-details text-center",children:[(0,n.jsx)("p",{children:s.pauseResumeFail[g].details1}),s.pauseResumeFail[g].details2&&(0,n.jsx)("p",{children:s.pauseResumeFail[g].details2})]}),(0,n.jsx)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:(0,n.jsx)("button",{className:"btn btn-primary waves-effect waves-light",onClick:()=>t(),children:s.pauseResumeFail[g].cta})})]})})};s.d(t,["A",0,o])},88827(e,t,s){var a=s(64467),r=s(80045),i=(s(96540),s(5556)),n=s.n(i),o=s(51891),l=s(74848);const c=["content","config","disabled","redBorder"];function d(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function m(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?d(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):d(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const u=e=>{const{content:t,config:s,disabled:a=!1,redBorder:i}=e,n=(0,r.A)(e,c),d=["animated1","fadeIn1","btn"];switch(i&&d.push("redBorder"),s.class){case"blue":d.push("btn-primary btn-lg");break;case"white":d.push("btn-secondary btn-lg");break;case"smallBlue":d.push("btn-primary mT10");break;case"mediumBlue":d.push("btn-primary btn-medium");break;case"smallWhite":d.push("btn-secondary");break;case"innerBlue":default:d.push("btn-primary");break;case"wAutoBlue":d.push("btn-primary w-auto");break;case"wAutoWhite":d.push("btn-secondary w-auto");break;case"wAutoLgBlue":d.push("btn-primary w-auto btn-lg");break;case"wAutoLgWhite":d.push("btn-secondary w-auto btn-lg");break;case"wAutoBtnLink":d.push("btn-link continue-btn w-auto btn-lg");break;case"wAutoBtnContinue":d.push("btn btn-lg w-auto btn-link continue-btn");break;case"wSmallBlue":d.push("btn btn-primary w-auto add-offer-btn waves-effect waves-light");break;case"btnLink":d.push("btn-secondary btn-link");break;case"availOffer":d.push("waves-effect waves-light btn-lh-h");break;case"removeBtn":d.push("btn-remove")}return(0,l.jsx)(o.A,m(m({type:s.type,disabled:a,className:d.join(" "),id:s.id?s.id:null},n),{},{children:(0,l.jsx)("span",{children:t})}))},h=u;u.propTypes={config:n().object.isRequired,content:n().string.isRequired},s.d(t,["A",0,h])},71693(e,t,s){var a=s(96540),r=s(5556),i=s.n(r),n=s(91700),o=s(74848);class l extends a.Component{constructor(e){super(e),this.loadRecaptcha=this.loadRecaptcha.bind(this),this.handleChange=this.handleChange.bind(this)}componentDidMount(){"complete"===document.readyState?this.loadRecaptcha():window.addEventListener("load",this.loadRecaptcha)}loadRecaptcha(){const{id:e,theme:t,getRef:s,resetId:a}=this.props;if(void 0===window.grecaptcha)return this.handleChange(null),void("function"==typeof s&&s(null));const r=(0,n.HA)().includes("https://www.tataplay.com")||(0,n.HA)().includes("beta-portal")?atob("NkxjeVEtc1VBQUFBQUdiNW55Vlk5Q25aSmlUWUlBUmRya1diZTNFQQ=="):"6LcHQ-sUAAAAADAsbgB-bTaKWa0xz8gaGKLMwfey",i=()=>{try{this.recatchaElt=window.grecaptcha.render(e,{sitekey:r||"6Lf-sekUAAAAADzj63JVNFqHc-vSefMn8sBAohbl",theme:t,callback:this.handleChange,"expired-callback":this.handleChange,"error-callback":this.handleChange,size:"invisible",render:"explicit"}),"function"==typeof s&&s(window.grecaptcha),"function"==typeof a&&a(this.recatchaElt)}catch(e){0,this.handleChange(null),"function"==typeof s&&s(null)}};window.grecaptcha.ready?window.grecaptcha.ready(i):i()}handleChange(e){const{onChange:t}=this.props;t(e)}render(){const{id:e,customClass:t}=this.props;return(0,o.jsx)("div",{id:e,className:t})}}l.propTypes={id:i().string.isRequired,onChange:i().func.isRequired,theme:i().oneOf(["dark","light"])},l.defaultProps={theme:"light"};const c=l;s.d(t,["A",0,c])},56480(e,t,s){s.d(t,{A:()=>N});var a=s(64467),r=s(96540),i=s(1501),n=s(74848);function o(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function l(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?o(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):o(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const c=(0,i.A)({loader:()=>Promise.all([s.e(7437),s.e(1941),s.e(3392)]).then(()=>s(31941)),loading:()=>(0,n.jsx)("div",{children:"Loading..."})}),d=e=>{const{elementConfig:t,value:s,valid:a,changed:i,customProps:o}=e,d=[];let m=null;""!==s&&(m=t.options.find(e=>e.value===s)),a||d.push("is-invalid");const u={option:e=>l(l({},e),{},{color:"#A9A0A2",fontSize:"15px",backgroundColor:"#FFF",textAlign:"left",marginBottom:"5px","&:hover":{color:"#FFF",backgroundColor:"#e940ad"}})};return(0,n.jsx)(r.Fragment,{children:(0,n.jsx)(c,l({styles:u,value:m,placeholder:t.placeholder,onChange:e=>{i(e.value)},options:t.options,className:d.join(" "),classNamePrefix:"custom-select",isSearchable:!1},o))})};function m(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function u(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?m(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):m(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const h=(0,i.A)({loader:()=>Promise.all([s.e(7437),s.e(1941),s.e(3392)]).then(()=>s(31941)),loading:()=>(0,n.jsx)("div",{children:"Loading..."})}),p=e=>{const{elementConfig:t,value:s,valid:a,changed:i,customProps:o}=e,l=[];let c=null;""!==s&&(c=t.options.find(e=>e.value===s)),a||l.push("is-invalid");const d={option:e=>u(u({},e),{},{color:"#A9A0A2",fontSize:"15px",backgroundColor:"#FFF",textAlign:"left",marginBottom:"5px","&:hover":{color:"#FFF",backgroundColor:"#e940ad"}})};return(0,n.jsx)(r.Fragment,{children:(0,n.jsx)(h,u({styles:d,value:c,placeholder:t.placeholder,onChange:e=>{i(e.value)},options:t.options,className:l.join(" "),classNamePrefix:"custom-select",isSearchable:!0},o))})};var g=s(5556),f=s.n(g);function x(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function b(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?x(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):x(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const v=e=>{const{elementConfig:t,value:s,valid:a,changed:i,disabled:o}=e,l=["falseinput","clearfix","mob-no"];return a||l.push("is-invalid"),(0,n.jsx)(r.Fragment,{children:(0,n.jsxs)("div",{className:l.join(" "),children:[(0,n.jsx)("div",{className:"mobileextn",children:(0,n.jsx)("span",{children:"+91"})}),(0,n.jsx)("div",{className:"mobileno",children:(0,n.jsx)("input",b(b({className:["form-control"].join(" ")},t),{},{placeholder:t.placeholder,value:s,onChange:e=>i(e.target.value)}))})]})})};v.propTypes={errorMessage:f().string,changed:f().func};const y=v;var S=s(88290);function j(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function A(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?j(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):j(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const N=e=>{const{labelConfig:t,elementConfig:s,elementType:a,value:r,valid:i,idName:o,changed:l,blurHandler:c,wrapperClasses:m,errorMessage:u,nested:h=null}=e;let g=null,f=null,x=null;const b=m?m.join(" "):"";let v=["form-control"];switch(t&&(f=(0,n.jsxs)("label",{id:o||"",className:t.classes?t.classes.join(" "):"",htmlFor:s.id?s.id:"",children:[t.label," ",t.tooltip&&""!==t.tooltip&&(0,n.jsx)(S.A,{align:t.tooltipDir?"right":"",content:t.tooltip})]})),i||(v.push("is-invalid"),x=(0,n.jsx)("span",{className:"validate invalid-text",id:`${s.id}Error`,children:u})),a){case"input":g=(0,n.jsx)("input",A(A({className:v.join(" ")},s),{},{placeholder:s.placeholder,value:r,onChange:e=>l(e.target.value),onBlur:c?e=>c(e.target.value):null}));break;case"textarea":case"radio":g=(0,n.jsx)("textarea",A(A({className:v.join(" ")},s),{},{placeholder:s.placeholder,value:r,onChange:e=>l(e.target.value)}));break;case"select":g=(0,n.jsx)("select",{className:v.join(" "),value:r,placeholder:s.placeholder,onChange:e=>l(e.target.value),children:s.options.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))});break;case"customSelect":g=(0,n.jsx)(d,A({},e));break;case"customSelect2":g=(0,n.jsx)(p,A({},e));break;case"customPhone":g=(0,n.jsx)(y,A({},e));break;case"securePin":g=(0,n.jsxs)("div",{children:[(0,n.jsx)("input",A(A({className:v.join(" ")},s),{},{placeholder:s.placeholder,value:r,onChange:e=>l(e.target.value)})),(0,n.jsxs)("div",{className:"updateRmn-tooltip",children:[(0,n.jsx)("img",{src:"/assets/images/icons/info_icon.png",alt:"info"}),(0,n.jsx)("span",{className:"tooltiptext",children:t.tooltipText})]})]});break;default:v=(0,n.jsx)("input",A(A({className:v.join(" ")},s),{},{value:r,onChange:e=>l(e.target.value)}))}return(0,n.jsxs)("div",{className:b,children:[f,g,h&&(0,n.jsx)("a",{className:h.classes,onClick:()=>h.action(),children:h.text}),x]})}},1181(e,t,s){var a=s(96540),r=s(21439),i=s(74848);const n=new RegExp(/^\d+$/);const o=function({value:e,valueLength:t,onChange:s,validateForm:o,setIosInputArray:l,fromIOS:c}){const d=(0,a.useRef)(null),m=(0,a.useMemo)(()=>{const s=e?e.split(""):[],a=[];for(let e=0;e<t;e++){const t=s[e];n.test(t)?a.push(t):a.push("")}return a},[e,t]);(0,a.useEffect)(()=>{d.current.parentNode.firstChild.focus()},[]);const u=["one","two","three","four","five","six"];return(0,i.jsx)("div",{children:(0,i.jsx)("div",{id:"otp",className:"inputs d-flex flex-row justify-content-center",children:m.map((a,h)=>(0,i.jsx)("input",{type:"text",inputMode:"numeric",autoComplete:"one-time-code",tabIndex:h+1,name:h+1,pattern:"\\d{1}",maxLength:t,className:"text-center form-control rounded",value:a,onChange:a=>((a,i)=>{const d=a.target;let m=d.value.trim();(0,r.Xb)()&&!c&&l&&l(m);const u=n.test(m);if(!u&&""!==m)return;m=u?m:" ";const h=m.length;if(1===h){const r=(e&&e.substring(0,i))+m+(e&&e.substring(i+1)),n=r&&r.replace(/\s/g,"").length;if(s(r),n===t&&setTimeout(()=>{"function"==typeof o&&o(a)},100),!u)return}else if(h===t){const r=e&&e.substring(0,i)+m+e.substring(i+1),n=r&&r.replace(/\s/g,"").length;s(m),n===t&&setTimeout(()=>{"function"==typeof o&&o(a)},100),d.blur()}})(a,h),onKeyUp:t=>((t,a)=>{t.preventDefault();const r=["1","2","3","4","5","6","7","8","9","0"];if("Delete"===t.key||"Backspace"===t.key){if("Delete"===t.key){const r=e.substring(0,a)+" "+e.substring(a+1);s(r),(e=>{const t=e.previousElementSibling;t&&t.focus()})(t.target)}const r=t.target.tabIndex-2;r>-1&&t.target.form.elements[r].focus()}else{const e=t.target.tabIndex;e<6&&""!=t.target.value&&r.includes(t.key)&&t.target.form.elements[e].focus()}})(t,h),onKeyPress:e=>(e=>{13===e.which&&"function"==typeof o&&o(e)})(e),ref:d,onBlur:e=>((e,t)=>{e.preventDefault();const s=m.some(e=>{if(""!==e)return!0});0!==t||""!==e.target.value||s||d.current.parentNode.firstChild.focus()})(e,h),style:{marginRight:"5px",padding:"2px",width:"45%",height:"auto",textAlign:"center"},onInput:e=>{},"aria-label":`OTP input field ${u[h]}`}))})})};s.d(t,["A",0,o])},6915(e,t,s){s.r(t);var a=s(96540),r=s(79168),i=s(49862),n=s(8776),o=s(21439),l=s(97437),c=s(74848);const d=({staticContext:e={}})=>{e.notFound=!0;return(0,c.jsx)(l.A,{metatags:{title:"Page not Found - Tata Play",description:"The page you're looking doesn't exists. Please use the links below to navigate through the website"},children:(0,c.jsxs)(a.Fragment,{children:[(0,c.jsx)(r.A,{isLogo:!0,isShadow:!1}),(0,c.jsx)("div",{id:"error404",children:(0,c.jsx)("div",{className:"content-container text-center",children:(0,c.jsxs)("div",{className:"container",children:[(0,c.jsxs)("div",{className:"img-contr",children:[(0,c.jsx)("img",{src:"/assets/images/404_desktop.png",className:"img-fluid for-desktop",alt:"desktop"}),(0,c.jsx)("img",{src:"/assets/images/404_mobile.png",className:"img-fluid for-mobile",alt:"mobile"})]}),(0,c.jsxs)("p",{className:"error-message",children:["The page you are looking for is not available"," ",(0,c.jsx)("br",{}),"or has been moved."]}),(0,c.jsxs)("div",{className:"imp-links mT20",children:[(0,c.jsxs)("div",{className:"heading-sm mB10",children:[(0,c.jsx)("h1",{className:"heading1",children:"Try these linksâ¦"}),(0,c.jsx)("h2",{className:"heading2",children:"you may find what you are looking for"})]}),!i.A.isServer()&&!(0,o.WF)()&&(0,c.jsx)(n.A,{})]})]})})})]})})};s.d(t,["default",0,d])},31692(e,t,s){s(96540);var a=s(5556),r=s.n(a),i=s(49862),n=s(74848);const o=e=>{const{stepperList:t=[],activeStepper:s="",isSticky:a=!1,stepperId:r=""}=e,o=!i.A.isServer()&&localStorage.getItem("SOURCE")||"",l=["stepper"];let c;return a&&l.push("fix"),c=Array.isArray(t)?t:t[o]?t[o]:t.default,(0,n.jsx)("div",{className:l.join(" "),id:r,children:(0,n.jsx)("ol",{className:"list-unstyled multi-steps",children:(c||[]).map(e=>
1(0,n.jsx)("li",{className:e.step===parseInt(s,10)?"is-active":"","aria-label":e.step===parseInt(s,10)?"is-active":"","aria-current":e.step===parseInt(s,10)?"step":"",children:(0,n.jsx)("span",{children:e.text})},e.step))})})},l=o;o.propTypes={stepperList:r().instanceOf(Object),activeStepper:r().string,isSticky:r().bool,stepperId:r().string},o.defaultProps={stepperList:[],activeStepper:"",isSticky:!1,stepperId:""},s.d(t,["A",0,l])},88290(e,t,s){s.d(t,{A:()=>d});var a=s(96540),r=s(40961),i=s(5556),n=s.n(i),o=s(21439),l=s(70581),c=s(74848);class d extends a.Component{constructor(...e){super(...e),this.state={tooltipClass:{}},this.iconRef=a.createRef(),this.showTooltip=()=>{const{align:e}=this.props,t={display:"block",right:"30px",top:"5px",left:"inherit"};"right"===e&&(t.left="30px",t.right="inherit"),this.setState({tooltipClass:t})},this.hideTooltip=()=>{this.setState({tooltipClass:{display:"none"}})},this.closeTooltopHandler=()=>{this.setState({tooltipClass:{display:"none"}})}}componentDidMount(){const e=window.innerWidth,t=this.iconRef.current;e>991?(t.addEventListener("mouseover",()=>{this.showTooltip()}),t.addEventListener("mouseout",()=>{this.hideTooltip()})):t.addEventListener("click",()=>{this.setState({tooltipClass:{display:"block"}})})}componentWillUnmount(){const e=window.innerWidth,t=this.iconRef.current,s=function(){};e>991?(t.removeEventListener("mouseover",s),t.removeEventListener("mouseout",s)):t.removeEventListener("click",s)}render(){const{content:e,align:t,journey:s,parentElement:a}=this.props;if(null==e||""===e)return null;const{tooltipClass:i}=this.state,n=(0,o.d2)(),d=(0,c.jsxs)("span",{className:"right"!==t?"custom-tooltip watch-show leftarrow":"custom-tooltip watch-show",style:i,children:[(0,c.jsx)("i",{className:"icon-close-1",onClick:this.closeTooltopHandler}),(0,c.jsx)(l.A,{htmlContent:e})]});return(0,c.jsxs)("span",{className:"tooltip-position",children:[s&&"combos"===s?(0,c.jsx)("img",{src:"/assets/images/combos/information-gray.svg",ref:this.iconRef,className:"information-icon",alt:"Info"}):(0,c.jsx)("button",{type:"button",className:"link",children:(0,c.jsx)("img",{src:"/assets/images/icons/info_icon.png",ref:this.iconRef,className:"icon-info hd-info",alt:"Info"})}),a&&"block"===i.display&&n?r.createPortal((0,c.jsx)("div",{className:"combos",children:d}),a):d]})}}d.propTypes={content:n().string,align:n().string},d.defaultProps={align:"left"}},60272(e,t,s){s.r(t),s.d(t,{default:()=>bi});var a=s(96540),r=s(45853),i=s(57900),n=s(6915),o=s(3304),l=s(97965),c=s(49862),d=s(58156),m=s.n(d),u=s(74191),h=s(79168),p=s(69792),g=s(44979),f=s(98906),x=s(21439),b=s(70581),v=s(74848);const y=(0,r.y)(e=>{const{pageData:t,history:s,index:a}=e,r=(e,t,a)=>{const r=e.substring(e.indexOf(":")+1);(0,x.Sw)({event:"ctaClick",clickText:t,featureName:a,"Sub ID":(0,x.Xo)().id||null,section:"B"}),"/tata-play-secure-plus/bundle"!==r&&"/tata-play-secure/bundle"!==r||(0,x.Sw)({clickText:t,"Sub ID":(0,x.Xo)().id||null,pageSection:"B","Type of Journey":"/tata-play-secure-plus/bundle"===r?"HA-Secure Plus -Buy Journey":"HA-Secure -Buy Journey",event:"productClick",ecommerce:{click:{actionField:"",products:[{name:"/tata-play-secure-plus/bundle"===r?"Tata Play Secure Plus":"Tata Play Secure",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"/tata-play-secure-plus/bundle"===r?"Google":"Hualai",position:1}]}}}),s.push(`/${c.A.home_automation}${r}`)};return(0,v.jsx)("div",{className:"card",children:(0,v.jsxs)("div",{className:"card-body",children:[(0,v.jsx)("div",{className:"tatasky-secure-logo",style:1===a?{width:"70px",marginBottom:"20px"}:{},children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${m()(t,"field_banner_logo.url","")}`,alt:"",className:"img-fluid informative-image"})}),""!==t.field_banner_logosub&&(0,v.jsx)("div",{className:"powered-by",children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${m()(t,"field_banner_logosub.url","")}`,alt:"",className:"img-fluid informative-image"})}),(0,v.jsx)("div",{className:"subscription-img",children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${m()(t,"field_image.url","")}`,height:"110",alt:"",className:"informative-image"})}),(0,v.jsx)("h3",{className:"heading1",children:m()(t,"field_title","")}),(0,v.jsx)("div",{className:"save-blk",children:(0,v.jsx)("span",{className:"gradient",children:m()(t,"field_save_info","")})}),(0,v.jsx)(b.A,{className:"free-blk text-center",htmlContent:m()(t,"field_body","")}
1),(0,v.jsxs)("div",{className:"btn-blk",children:[(0,v.jsx)("div",{className:"btn-cont",children:(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light",href:"javascript:void(0)",onClick:()=>r(m()(t,"field_button[0].uri"),m()(t,"field_button[0].title"),m()(t,"field_title","")),children:m()(t,"field_button[0].title")})}),(0,v.jsx)("a",{href:"javascript:void(0)",onClick:()=>r(m()(t,"field_link[0].uri"),m()(t,"field_link[0].title"),m()(t,"field_title","")),className:"sub-link",children:m()(t,"field_link[0].title")})]})]})})});var S=s(43350),j=s(4798),A=s(97437),N=s(34054),C=s(62193),w=s.n(C);const _=({descData:e,showVideoModal:t,pageMetaText:s,isLastElement:a,vidUrl:r,journey:i,showDemo:n})=>{let o=`/${c.A.home_automation}/system/tata-play-secure/buy-journey-subscription`,l=`/${c.A.home_automation}/system/tata-play-secure/request-demo-brief`;const d=!c.A.isServer()&&(0,x.Xb)();"Google"===i&&(o=`/${c.A.home_automation}/system/tata-play-secure-plus/smart-alert`,l=`/${c.A.home_automation}/system/tata-play-secure-plus/demo`);const m=(e,t=null)=>{t&&(0,x.Sw)({event:"ctaClick",clickText:t.clickText,featureName:t.featureName,"Sub ID":(0,x.Xo)().id||null,pageSection:"C"}),(0,x.Fc)(e)};return(0,v.jsx)("div",{className:"clearfix con-servicewrapp check-planwrapp nex-gencamera",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("div",{className:"lrcom1",children:(0,v.jsxs)("div",{className:"lead-section unique-lrcom1",children:["ha-common"===i?(0,v.jsxs)("div",{className:"heading-blk res-heading",children:[(0,v.jsx)("div",{className:"heading-icon",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+e.field_left_right_mobile.url,alt:"",className:"img-fluid decorative-image"})}),(0,v.jsxs)("div",{className:"heading-textwrapp",children:[(0,v.jsx)("div",{className:"heading",children:e.field_title}),(0,v.jsx)("div",{className:"heading-subtext",children:e.field_subtitle})]})]}):d&&(0,v.jsx)("div",{className:"heading-sm res-heading",children:(0,v.jsx)("h2",{className:"gradient ha-heading1",children:e.field_title})}),(0,v.jsx)(N.q7,{direction:"left",triggerOnce:!0,children:(0,v.jsxs)("div",{className:"panel panel-img ",children:[e&&""!==r&&(0,v.jsx)("div",{className:"secure-video-placeholder",children:(0,v.jsx)("iframe",{width:"100%",src:r})}),e&&""===r&&(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+e.field_image.url,alt:e.field_image.alt,className:"img-fluid imgwidth informative-image"})]})}),(0,v.jsx)(N.q7,{direction:"right",triggerOnce:!0,children:(0,v.jsxs)("div",{className:"panel panel-text ",children:["ha-common"===i?null:(0,v.jsx)("div",{className:"heading-sm desk-heading",children:(0,v.jsx)("h2",{className:"gradient ha-heading1",children:e.field_title})}),(0,v.jsx)(b.A,{htmlContent:e.field_body}),a&&!0===a&&(0,v.jsxs)("div",{className:"mT20",children:[s&&s.knowmore_text&&(0,v.jsx)(b.A,{Tag:"a",className:"d-block mT10 linktext mB20",href:"javascript:void(0)",onClick:()=>m(o,{clickText:s.knowmore_text,featureName:e.field_title}),htmlContent:s.knowmore_text}),s&&s.demo_text&&n&&(0,v.jsx)("button",{className:"btn42 btn-secondary waves-effect waves-light",type:"button",style:{fontSize:"15px"},children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:()=>m(l,{clickText:s.demo_text,featureName:""+("Google"===i?"Tata Play Secure Plus Demo":"Tata play Secure Demo")}),children:s.demo_text})})]})]})})]})})})})},E=({descData:e,showVideoModal:t,pageMetaText:s,isLastElement:a,vidUrl:r,journey:i,showDemo:n})=>{let o=`/${c.A.home_automation}/system/tata-play-secure/buy-journey-subscription`,l=`/${c.A.home_automation}/system/tata-play-secure/request-demo-brief`;const d=!c.A.isServer()&&(0,x.Xb)();"Google"===i&&(o=`/${c.A.home_automation}/system/tata-play-secure-plus/smart-alert`,l=`/${c.A.home_automation}/system/tata-play-secure-plus/demo`);const m=(e,t=null)=>{t&&(0,x.Sw)({event:"ctaClick",clickText:t.clickText,featureName:t.featureName,"Sub ID":(0,x.Xo)().id||null,pageSection:"C"}),(0,x.Fc)(e)};return(0,v.jsx)("div",{className:"clearfix con-servicewrapp check-planwrapp nex-gencamera back-change",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("div",{className:"lrcom1",children:(0,v.jsxs)("div",{className:"lead-section unique-lrcom1 change-div",children:["ha-common"===i?(0,v.jsxs)("div",{className:"heading-blk res-heading",children:[(0,v.jsx)("div",{className:"heading-icon",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+e.field_left_r
1ight_mobile.url,alt:"",className:"img-fluid decorative-image"})}),(0,v.jsxs)("div",{className:"heading-textwrapp",children:[(0,v.jsx)("div",{className:"heading",children:e.field_title}),(0,v.jsx)("div",{className:"heading-subtext",children:e.field_subtitle})]})]}):d&&(0,v.jsx)("div",{className:"heading-sm res-heading",children:(0,v.jsx)("h2",{className:"gradient ha-heading1",children:e.field_title})}),(0,v.jsx)(N.q7,{direction:"right",triggerOnce:!0,children:(0,v.jsxs)("div",{className:"panel panel-img",children:[e&&""!==r&&(0,v.jsx)("div",{className:"secure-video-placeholder",children:(0,v.jsx)("iframe",{width:"100%",src:r})}),e&&""===r&&(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+e.field_image.url,alt:e.field_image.alt,className:"img-fluid imgwidth informative-image"})]})}),(0,v.jsx)(N.q7,{direction:"left",triggerOnce:!0,children:(0,v.jsxs)("div",{className:"panel panel-text ",children:["ha-common"===i?null:(0,v.jsx)("div",{className:"heading-sm desk-heading",children:(0,v.jsx)("h2",{className:"gradient ha-heading1",children:e.field_title})}),(0,v.jsx)(b.A,{htmlContent:e.field_body}),a&&!0===a&&(0,v.jsxs)("div",{className:"mT20",children:[s&&s.knowmore_text&&(0,v.jsx)(b.A,{Tag:"a",className:"d-block mT10 linktext mB20",href:"javascript:void(0)",onClick:()=>m(o,{clickText:s.knowmore_text,featureName:e.field_title}),htmlContent:s.knowmore_text}),s&&s.demo_text&&n&&(0,v.jsx)("button",{className:"btn42 btn-secondary waves-effect waves-light demo-btn",type:"button",style:{fontSize:"15px"},children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:()=>m(l,{clickText:s.demo_text,featureName:""+("Google"===i?"Tata Play Secure Plus Demo":"Tata play Secure Demo")}),children:s.demo_text})})]})]})})]})})})})};var T=s(55215),D=s(21247),O=s(41464);const k=e=>{const{iconInfo:t,descText:s}=e;return(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{className:"wifi-contr wifi-desc",children:[(0,v.jsx)("span",{className:"icon-contr mR10",children:t.url&&(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${t.url}`,alt:t.alt,className:"img-fluid decorative-image",style:{display:"flex"},id:"wifi"})}),(0,v.jsx)(b.A,{Tag:"span",className:"text-contr",htmlContent:s})]})})},P=(0,l.Ng)(e=>({pageData:e.commonReducer.currentPageMetaData,footerSsrData:e.commonReducer.footerSsrData,footerStaticSsrData:e.commonReducer.footerStaticSsrData}),null)(e=>{const{pageData:t,location:{search:s},footerSsrData:r,footerStaticSsrData:i}=e,[n,o]=(0,a.useState)(!1),[d,g]=(0,a.useState)("");(0,a.useEffect)(()=>{if(s){const e=(0,x.vA)(s),t={};e&&e.utm_campaign&&(t.utmCampaign=e.utm_campaign),e&&e.utm_source&&(t.utmSource=e.utm_source),e&&e.a&&(t.a=e.a),(0,x.ec)("utmParam",t)}(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey, HA-Secure -Buy Journey",event:"productImpression",ecommerce:{currencyCode:"INR",impressions:[{name:"Tata Play Secure Plus",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Google",list:"",position:"A"},{name:"Tata Play Secure ",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Hualai",list:"",position:"A"}]}})},[]);const{history:f}=e,N=((0,l.wA)(),e=>{const t=e.substring(e.indexOf(":")+1);f.push(`/${c.A.home_automation}${t}`)});(0,a.useEffect)(()=>{!t&&(async()=>{await(0,T.bk)(`${j.dV}/s3-api/v1/assets/pages/common-page.json`,{},!0)})()},[]);return t?t?(0,v.jsxs)(A.A,{isSecure:!0,metatags:t?t.metatag:{},showBreadCrumb:!0,breadCrumbSchema:t.breadcrumb,children:[(0,v.jsxs)("div",{className:"ha-common google-camera",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)(S.A,{type:"ha-common-banner",arrayElement:m()(t,"field_common_banner",""),deviceData:m()(t,"field_common_banner","")}),(0,v.jsx)("section",{className:"subscription-plans back-change pB40",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)("div",{className:"heading-sm text-center",children:(0,v.jsx)("h2",{className:"heading1",children:m()(t,"field_title_alert","")})}),(0,v.jsx)("div",{className:"direct-contact contact",children:(0,v.jsxs)("div",{className:"body-container subscription-blk",children:[(0,v.jsx)("div",{className:"box-contr justify-content-center",children:m()(t,"field_common_blocks",[]).map((e,t)=>(0,v.jsx)(y,{pageData:e,index:t},t))}),t.field_wifi_description&&(0,v.jsx)("div",{className:"wifi-container-common",children:(0,v.jsx)(k,{iconInfo:t.field_wifi_icon||"",descText:t.field_wifi_description})})]})})]})}),(0,v.jsxs)("section",{className:"mB40",children:[(0,v.jsx)("div",{className:"desc-slide-heading text-center",children:(0,v.jsx)("h2",{className:"heading1",children:"With each subscription plan, you getâ¦"})}
1),m()(t,"field_left_right_overview",[]).map((e,t)=>"left"===e.field_allignment?(0,v.jsx)(_,{descData:e,vidUrl:"",journey:"ha-common"},t):(0,v.jsx)(E,{descData:e,vidUrl:"",journey:"ha-common"},t))]}),(!w()(t.field_faq)||!w()(t.field_faq_main))&&(0,v.jsxs)("div",{className:"innercontainer-md ha-faq",style:{marginBottom:"60px"},children:[!w()(t.field_faq_main)&&(0,v.jsx)(b.A,{htmlContent:t.field_faq_main}),!w()(t.field_faq)&&(0,v.jsx)("div",{id:"accordion",className:"accordion-main "+(n?"":"dis-none"),children:t.field_faq.map((e,t)=>(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("h3",{className:d===`id${t}`?"accordion-toggle acc-expanded":"accordion-toggle acc-collapsed",onClick:()=>{return e=`id${t}`,void(d&&e===d?d===e&&g(!1):g(e));var e},children:e.question}),(0,v.jsx)(D.A,{isOpen:d===`id${t}`,children:(0,v.jsx)("div",{className:"accordion-content gc-acc",children:(0,v.jsx)("div",{className:"card-body",children:(0,v.jsx)("div",{className:"accordion-text",children:(0,v.jsx)(b.A,{htmlContent:e.answer})})})})})]}))}),(0,v.jsx)("div",{className:"mT20",children:(0,v.jsx)("div",{onClick:e=>(e=>{e.preventDefault(),o(!n)})(e),className:"gc-anchor",children:n?"Less":"More"})})]}),t&&(0,x.Xb)()&&(0,v.jsx)("div",{className:"fixed-btn sticky-btn pB10",children:(0,v.jsxs)("div",{className:"dflex-sb innercontainer-sm",children:[(0,v.jsxs)("div",{className:"left-btn-wrapp",style:{borderRight:"1px solid #eaeaea"},children:[(0,v.jsx)("div",{className:"tatasky-secure-logo",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+m()(t,"field_common_blocks[0].field_banner_logo.url",""),alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"powered-by mB5",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+m()(t,"field_common_blocks[0].field_banner_logosub.url",""),alt:"",className:"img-fluid "})}),(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light",href:"javascript:void(0)",onClick:()=>N(m()(t,"field_common_blocks[0].field_link[0].uri","")),tabIndex:"0",children:m()(t,"field_common_blocks[0].field_link[0].title","")})]}),(0,v.jsxs)("div",{className:"left-btn-wrapp",children:[(0,v.jsx)("div",{className:"tatasky-secure-logo",style:{width:"70px",marginBottom:"10px"},children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+m()(t,"field_common_blocks[1].field_banner_logo.url",""),alt:"",className:"img-fluid"})}),(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light",href:"javascript:void(0)",onClick:()=>N(m()(t,"field_common_blocks[1].field_link[0].uri","")),tabIndex:"0",children:m()(t,"field_common_blocks[1].field_link[0].title","")})]})]})}),(0,v.jsx)(p.A,{footerStaticSsrData:i,footerSsrData:r,showBreadCrumb:!0,breadCrumbData:t.breadcrumb})]}),!w()(t.field_faq)&&(0,v.jsx)(b.A,{Tag:"script",type:"application/ld+json",htmlContent:JSON.stringify((0,O.S)(t.field_faq))})]}):void 0:(0,v.jsx)(u.A,{})});var I=s(80045),M=s(64467),$=s(56480),R=s(88827),L=s(39789),F=s(14644),U=s(67475),B=s(30188);const H=e=>{const{pinCode:t,location:s,building:a,adrLine1:r,city:i,state:n,email:o,adrLine2:l,landmark:c}=e;let d={};
1const m=B.A.validatePinCode(t||""),u=B.A.validateRequired(s||""),h=B.A.validateAddressHA(r||""),p=B.A.validateAddressLine2HA(l||""),g=B.A.validateLandmarkHA(c||""),f=B.A.validateName(i||""),x=B.A.validateName(n||""),b=B.A.validateEmail(o||"");return d={pinCodeMessage:m.error,locationMessage:u.error,adrLine1Message:h.error,adrLine2Message:p.error,landmarkMessage:g.error,cityMessage:f.error,stateMessage:x.error,emailMessage:b.error,hasErrors:m.hasError||u.hasError||h.hasError||p.hasError||g.hasError||f.hasError||x.hasError||b.hasError},d},Y=e=>{const{pinCode:t,location:s,building:a,adrLine1:r,city:i,state:n,email:o,adrLine2:l,landmark:c,firstName:d,lastName:m,mobileNumber:u}=e;let h={};const p=B.A.validateName(d||""),g=B.A.validateName(m||""),f=B.A.validatePhoneNumber(u||""),x=B.A.validatePinCode(t||""),b=B.A.validateRequired(s||""),v=B.A.validateAddressHA(r||""),y=B.A.validateAddressLine2HA(l||""),S=B.A.validateName(i||""),j=B.A.validateName(n||""),A=B.A.validateEmail(o||"");return h={pinCodeMessage:x.error,locationMessage:b.error,adrLine1Message:v.error,adrLine2Message:y.error,cityMessage:S.error,stateMessage:j.error,emailMessage:A.error,firstNameMessage:p.error,lastNameMessage:g.error,mobileNumberMessage:f.error,hasErrors:x.hasError||b.hasError||v.hasError||y.hasError||S.hasError||j.hasError||A.hasError||p.hasError||g.hasError||f.hasError},h},G=e=>{const{classes:t,history:s,destination:a,excludeHa:r,isAnchor:i,type:n,backIndex:o,isReferer:l}=e;return"history_back"===n?(0,v.jsx)("div",{className:(t&&""!==t?`${t} `:"")+"back-button",children:(0,v.jsxs)("button",{type:"button",onClick:e=>{e.preventDefault(),s.go(o||-1)},className:"link back-btn-arrow a-link",children:[(0,v.jsx)("i",{className:"icon-left-arrow",title:"Back"}),(0,v.jsx)("span",{children:"Back"})]})}):l?(0,v.jsx)("div",{className:(t&&""!==t?`${t} `:"")+"back-button",children:(0,v.jsxs)("button",{type:"button",onClick:()=>(()=>{const{referrer:e}=document;e?window.location.href=e:s.push(`/${c.A.home_automation}/${j.oh}`)})(),className:"link back-btn-arrow a-link",children:[(0,v.jsx)("i",{className:"icon-left-arrow",title:"Back"}),(0,v.jsx)("span",{children:"Back"})]})}):(0,v.jsxs)("div",{className:(t&&""!==t?`${t} `:"")+"back-button",children:[i&&(0,v.jsxs)("a",{href:r?`/${a}`:`/${c.A.home_automation}/${a}`,className:"back-btn-arrow",children:[(0,v.jsx)("i",{className:"icon-left-arrow",title:"Back"}),(0,v.jsx)("span",{children:"Back"})]}),!i&&(0,v.jsxs)("button",{type:"button",onClick:e=>{e.preventDefault(),r?s.push(`/${a}`):s.push(`/${c.A.home_automation}/${a}`)},className:"link back-btn-arrow a-link",children:[(0,v.jsx)("i",{className:"icon-left-arrow",title:"Back"}),(0,v.jsx)("span",{children:"Back"})]})]})};var J=s(34674),q=s(52852),V=s(1181);s(52278);const z=["hasErrors"];function W(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function X(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?W(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):W(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Z extends a.Component{constructor(...e){super(...e),this.state={render:!0,showSuccess:!0,otpForm:{validateOTP:{wrapperClasses:["form-group"],labelConfig:{label:"",classes:["sel","active"]},elementType:"input",elementConfig:{type:"tel",placeholder:"",maxLength:6,tabIndex:0,autoComplete:"off"},value:" ".repeat(6),errorMessage:"",valid:!0,touched:!1}},formErrorMessage:"",resendOtpMessage:"",registrationError:"",validateOtpMEssage:"",waitingOtp:null,button:{buttonConfig:{type:"submit",class:"wAutoLgBlue"},text:"Submit",url:"select-language",disabled:!1},pageTitle:"",fieldJsonData:{},phone:null,isWrittenOffError:!1},this.componentDidMount=async()=>{const{setApiError:e,clearOtpData:t,modalParameters:s,armnModal:a}=this.props;this.setState({phone:s&&s.data&&s.data.formData&&s.data.formData.mobileNo}),t();try{const t=await q.n.getPageTitle("atl_otp_validate");t.data.status===c.A.MESSAGES_TYPES.S3_SUCCESS?this.setState({pageTitle:t.data.data?t.data.data.title:"",fieldJsonData:t.data&&t.data.data&&t.data.data.field_json_data,waitingOtp:(0,v.jsx)("span",{className:"lds-hourglass"})},()=>this.otpErrorHandler()):(this.setState({render:!0}),e(c.A.serverError,!0))}catch(t){this.setState({render:!0}),e(c.A.serverError,!0)}},this.onChangeOTP=e=>{this.setState({otpForm:{validateOTP:{value:e}},formErrorMessage:""})},this.startOtpTimer=()=>{let e=30;
1const t=document.querySelector("#timer_div"),s=document.querySelector(".link-contr"),a=document.querySelector(".res-otp");s.style.display="none",setInterval(()=>{0===e&&s&&a?(clearTimeout(),s.style.display="flex",a.style.display="none"):(e=e<10?`0${e}`:e,t&&(a.style.display="flex",t.innerHTML=e),e--)},1e3)},this.inputChangedHandler=(e,t)=>{this.setState({registrationError:"",formErrorMessage:""});const{otpForm:s}=this.state,a=X({},s),r=X({},a[t]);"validateOTP"===t&&(e=e.replace(/[^0-9]/g,"")).length>6&&(e=e.slice(0,6)),r.value=e,r.touched=!0,r.valid=!0,r.errorMessage="",a[t]=r,this.setState({otpForm:a,validateOtpMEssage:"",resendOtpMessage:""})},this.resendOTP=async()=>{const{haMobileSecureOtp:e,setOtpAlert:t}=this.props,{phone:s}=this.state;t("none"),(0,x.Sw)({event:"Resend OTP - Secure","Sub ID":"null"}),this.setState({formErrorMessage:"",resendOtpMessage:(0,v.jsx)("span",{className:"lds-hourglass",children:" Sending..."}),validateOtpMEssage:"",showSuccess:!0}),e({mobileNumber:s})},this.otpErrorHandler=()=>{const{otpData:e,haMobileSecureOtp:t,modalParameters:s}=this.props;if(w()(e)){t({mobileNumber:s&&s.data&&s.data.formData&&s.data.formData.mobileNo})}else this.setState({formErrorMessage:e.message,waitingOtp:null})},this.validateForm=async()=>{const{otpForm:e}=this.state,{modalParameters:t,setApiError:s,verifyArmnAfterOtp:a}=this.props,r={};for(const t in e)r[t]=e[t].value.trim();const i=J.A.validateOTP(r),{hasErrors:n}=i,o=(0,I.A)(i,z);if(n){const t=X({},e);for(const s in e){const e=o[`${s}Message`];e&&""!==e&&(t[s].valid=!1,t[s].errorMessage=e)}this.setState({otpForm:t,formErrorMessage:o.validateOTPMessage})}else{const e=t&&t.data&&t.data.formData,s=t&&t.data&&t.data.saveData,i=t&&t.data&&t.data.validateFromServer,n=X({},e);n.otp=r.validateOTP,(0,x.Sw)({event:"Submit OTP - Secure","Sub ID":"null"}),s?s(r.validateOTP):i?i(n):a&&a(r.validateOTP)}},this.handleBackToHome=()=>{const{history:e}=this.props;c.A.isServer()||(sessionStorage.removeItem("hatpfD"),sessionStorage.removeItem("utmParam"),sessionStorage.removeItem("ha")),e.push(`/${c.A.home_automation}/login`)}}componentDidUpdate(e){const{resendOTPData:{status:t,message:s},otpData:a,setOtpAlert:r,isOtpModal:i}=this.props,{formErrorMessage:n}=this.state;a!==e.otpData&&""===n&&(this.setState({formErrorMessage:a.message,showSuccess:!1}),a&&a.data&&a.data.writtenOffError&&this.setState({isWrittenOffError:!0})),void 0!==t&&e.resendOTPData.status!==t&&(t?this.setState({render:!0,waitingOtp:null,showSuccess:!1,buttonResendOTP:{buttonConfig:{class:"white"},disabled:!1,text:"Resend OTP"},resendOtpMessage:(0,v.jsxs)("span",{className:"lds-hourglass-g classgreen",children:[" ","OTP sent successfully"]}),validateOtpMEssage:""},()=>{i(!1),r("resend"),this.startOtpTimer()}):this.setState({render:!0,waitingOtp:null,showSuccess:!1,buttonResendOTP:{buttonConfig:{class:"white"},disabled:!1,text:"Resend OTP"},resendOtpMessage:(0,v.jsxs)("span",{className:"lds-hourglass-w",children:[" ",s]}),validateOtpMEssage:""},()=>r("none")))}render(){const{button:e,otpForm:t,render:s,formErrorMessage:r,resendOtpMessage:i,validateOtpMEssage:n,pageTitle:o,registrationError:l,waitingOtp:c,phone:d,isWrittenOffError:m,showSuccess:h,fieldJsonData:p}=this.state,{resendOTPData:g,otpData:f}=this.props,x=[];return Object.keys(t).forEach(e=>{x.push({id:e,config:t[e]})}),(0,v.jsx)(a.Fragment,{children:s?(0,v.jsx)("div",{className:"content-container",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{style:{fontSize:"35px"},className:"heading1 gradient",children:m?p&&p.linkedTXt:o}),m&&(0,v.jsx)("h1",{className:"heading2 gradient",children:p&&p.linkedDesc})]}),m&&(0,v.jsxs)("div",{className:"text-center",children:[" ",(0,v.jsx)("button",{style:{fontFamily:"VoltePlay-SemiBold",color:"#fff"},onClick:this.handleBackToHome,className:"a-link btn-primary w-auto btn-lg",children:p&&p.linkedLoginCta})]}),!m&&(0,v.jsxs)("form",{action:"javascript:void(0)",children:[(0,v.jsxs)("div",{className:"innercontainer-xxs",children:[(0,v.jsxs)("span",{children:[(0,v.jsx)("b",{children:"Enter OTP sent to "})," ","+91"," ",d||""]}),x&&x.map(e=>(0,v.jsx)("div",{className:"form-group",children:(0,v.jsx)(V.A,{onChange:this.onChangeOTP,value:this.state.otpForm.validateOTP.value,valueLength:6})})),(0,v.jsx)("span",{className:"validate invalid-text",children:r}),h?(0,v.jsx)("span",{className:"lds-hourglass",children:" Sending"}):(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("div",{className:"link-contr field-info-wrapper mT5",children:(0,v.jsx)("p",{className:"resend-text",children:(0,v.jsx)("a",{className:"resend",onClick:()=>this.resendOTP(),children:"Resend OTP"})})}),(0,v.jsxs)("div",{className:"fs12 res-otp field-info-otp mT5",style:{display:"none"},children:["Resend OTP in 00:",(0,v.jsx)("span",{id:"timer_div"})]})]})]}),(0,v.jsxs)("div",{className:"btn-contr text-center",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",style:{margin:"5px auto",width:"320px"},children:l}),(0,v.jsx)(R.A,{disabled:e.disabled,config:e.buttonConfig,content:e.text,onClick:this.validateForm})]})]})]})})}):(0,v.jsx)(u.A,{})})}}const Q={setApiError:g.x8,openModal:U.qf,resendSecureOtp:g.Mp,clearOtpData:g.VF,haMobileSecureOtp:g._h},K=(0,l.Ng)(e=>({resendOTPData:e.commonReducer.resendOTPData,otpData:e.commonReducer.otpData}),Q)(Z),ee=["hasErrors"];function te(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function se(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?te(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):te(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class ae extends a.Component{constructor(e){super(e),this.fetchPageData=async()=>{const{manifest:e,setApiError:t}=this.props,s=(0,x.th)("ha_intent_form",e);this.setState({render:!1});const a={apiPath:s};try{const e=(await f.n.fetchData(a)).data;e.status===c.A.MESSAGES_TYPES.S3_SUCCESS?e.data&&this.setState({pageData:e.data&&e.data.field_json_data,render:!0}):t(c.A.serverError,!0)}catch(e){t(c.A.serverError,!0)}},this.getPinCodeData=async(e,t)=>{if(!e)return;const{setApiError:s}=this.props;try{const{data:t}=await f.n.getData(`payment/pincode/getPinDetailsByZipCode/${e}/Hualai`),{infoForm:a,pageJsonData:r}=this.state,i=se({},a),{city:n,pinCode:o,state:l,location:d}=i;if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data;if(e&&Array.isArray(e)&&e.length>0){o.value=e[0].zipcode,o.valid=!0,n.value=e[0].city.trim(),n.touched=!0,n.valid=!0,n.errorMessage="",l.value=e[0].state.trim(),l.touched=!0,l.valid=!0,l.errorMessage="";const t=e&&e.map(e=>({label:e.location,value:e.location}));d.elementConfig.options=[{label:"select",value:""},...t]}else o.valid=!1,o.errorMessage=r&&r.pincode_err||"Apologies, currently we are unavailable in your city. We will be launching soon!";this.setState({infoForm:i})}else s(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}},this.inputChangedHandler=(e,t)=>{const{infoForm:s}=this.state,a=se({},s),{location:r,city:i,state:n}=a,o=se({},a[t]);let l=e;if("pinCode"===t&&(l=l.replace(/[^0-9]/g,""),l.length>6&&(l=l.slice(0,6)),6===l.length&&this.getPinCodeData(l,!0),l.length<6&&(r.elementConfig.options=[{label:"select",value:""}],r.value=null,i.value="",n.value="",this.setState({infoForm:a}))),"mobileNumber"===t&&(l=l.replace(/[^0-9]/g,""),l.length>10&&(l=l.slice(0,10))),"firstName"===t||"lastName"===t){l=l.replace(/[^a-zA-Z]/g,"");const{maxLength:e}=a[t].elementConfig;e&&l.length>e&&(l=l.slice(0,e))}o.value=l,o.touched=!0,o.valid=!0,o.errorMessage="",a[t]=o,this.setState({infoForm:a})},this.validateForm=async e=>{const{setApiError:t,openModal:s,history:a}=this.props;e.preventDefault();const{infoForm:r,termsChecked:i,calcPayload:n}=this.state,o={},l=Object.keys(r);l.forEach(e=>{o[e]=r[e].value});const c=Y(o),{hasErrors:d}=c,m=(0,I.A)(c,ee);if(d){const e=se({},r);let t=null;l.forEach((s,a)=>{0===a&&(t=s);const r=m[`${s}Message`];r&&""!==r&&(e[s].valid=!1,e[s].errorMessage=r)}),this.setState({infoForm:e,formErrorMessage:"",render:!0}),t&&document.getElementById(t).scrollIntoView()}else{let e=!0;if(l.forEach(t=>{r[t].valid||(e=!1)}),e){if(!i)return void this.setState({showCheckError:!0,render:!0});const e=se({addressLine1:r.adrLine1.value.trim(),addressLine2:r.adrLine2.value.trim(),buildingName:r.building.value.trim(),city:r.city.value.trim(),state:r.state.value.trim(),emailId:r.email.value.trim(),firstName:r.firstName.value.trim(),landmark:r.landmark.value.trim(),lastName:r.lastName.value.trim(),location:r.location.value.trim(),mobileNo:r.mobileNumber.value.trim(),pincode:r.pinCode.value.trim()},n);(0,x.Sw)({event:"Submit Intent Form - Secure","Sub ID":"null"}),s(L.lx.COMMON_MODAL,{Component:K,data:{formData:e,validateFromServer:this.createAddress},parentClass:"secureOtpmodal"})}}},this.createAddress=async e=>{const{pageData:t}=this.state,{history:s,validateOTPFromServerResponseHandler:a,setApiError:r}=this.props;try{const{data:r}=await f.n.postData("order/intent-form",e);r.status?(c.A.isServer()||(sessionStorage.removeItem("hatpfD"),sessionStorage.removeItem("utmParam"),sessionStorage.removeItem("ha")),s.push(`/${c.A.home_automation}/thank-you`,{thankYouText:t&&t.callBckThnks,thankYouDesc:t&&t.callBckTxt})):a(r)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}},this.inputCheckHandler=()=>{const{termsChecked:e,showCheckError:t}=this.state;this.setState({termsChecked:!e},()=>{const{termsChecked:e}=this.state;e&&t&&this.setState({showCheckError:!1})})},this.initialForm={firstName:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"First Name",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"firstName",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},lastName:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Last Name",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"lastName",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},mobileNumber:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Mobile Number",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"mobileNumber",type:"text",placeholder:"",maxLength:10,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine1:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Address Line 1",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"adrLine1",type:"text",placeholder:"",maxLength:75,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine2:{wrapperClasses:["form-group","addr2-field"],labelConfig:{label:"Address Line 2",classes:["sel","active"]},elementType:"input",elementConfig:{id:"adrLine2",type:"text",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},pinCode:{wrapperClasses:["form-group","pincode-field","more-connection-pincode"],labelConfig:{label:"Pin code",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"pinCode",type:"tel",placeholder:"",maxLength:6,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},city:{wrapperClasses:["form-group","city-field"],labelConfig:{label:"City",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"city",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},location:{wrapperClasses:["form-group","location-field"],labelConfig:{label:"Location",classes:["sel","active","mendate"]},elementType:"select",elementConfig:{id:"location",placeholder:"",options:[{label:"select",value:""}]},value:"",errorMessage:"",valid:!0,touched:!1},building:{wrapperClasses:["form-group","building-field"],labelConfig:{label:"Building Name",classes:["sel","active"]},elementType:"input",elementConfig:{id:"building",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},landmark:{wrapperClasses:["form-group","landmark-field"],labelConfig:{label:"Landmark",classes:["sel","active"]},elementType:"input",elementConfig:{id:"landmark",type:"text",placeholder:"",maxLength:25,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},state:{wrapperClasses:["form-group","state-field"],labelConfig:{label:"State",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"state",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},email:{wrapperClasses:["form-group","email-field"],labelConfig:{label:"Email",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"email",type:"email",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}}
1,this.state={title:null,pageJsonData:null,pageData:{},termsText:"I agree to terms & conditions",termsChecked:!0,showCheckError:!1,render:!0,infoForm:se({},this.initialForm),formErrorMessage:null,button:{buttonConfig:{type:"submit",class:"wAutoLgBlue"},text:"Proceed to Summary",url:"select-language",disabled:!1},calcPayload:{},isRefId:!1},this.bodyRef=a.createRef()}componentDidMount(){const e=(0,x.Ht)("hatpfD"),{history:t}=this.props;if(this.fetchPageData(),e){w()(e.refId)?this.setState({isRefId:!1}):this.setState({isRefId:!0});const t={serviceProvider:e.serviceProvider,source:"nondth",totalAmount:e.totalAmout,refId:e.refId};Array.isArray(e.product)&&e.product.forEach((e,s)=>{t[`product${s+1}`]=e.product,t[`productType${s+1}`]=e.productType,t[`count${s+1}`]=e.count}),Array.isArray(e.subscription)&&e.subscription.forEach((e,s)=>{t.subscriptionUuid=e.subscriptionUuid}),this.setState({calcPayload:t})}else t.push(`/${c.A.home_automation}/home`);this.bodyRef.current&&this.bodyRef.current.scrollTo(0,0)}render(){const{button:e,infoForm:t,render:s,formErrorMessage:r,termsChecked:i,showCheckError:n,termsText:o,pageJsonData:l,pageData:d,title:m,isRefId:p}=this.state,g=(0,x.Ht)("hatpfD"),{history:f}=this.props;if(!s)return(0,v.jsx)(u.A,{});const y=[];return Object.keys(t).forEach(e=>{y.push({id:e,config:t[e]})}),(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{className:"inner-page",ref:this.bodyRef,children:[!s&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{isShadow:!1,isLogo:!0}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap wyze-secure",children:(0,v.jsx)("div",{className:"container",children:p?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(G,{history:f,destination:`${g&&"Hualai"===g.serviceProvider?j.oh:j.dY}/bundle`}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:d&&d.newSecureTxt})}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(l&&l.multi_disclaimer&&l.multi_disclaimer.sub_title||l&&l.multi_disclaimer&&l.multi_disclaimer.title)&&haSession.cartCount>1&&(0,v.jsxs)("div",{className:"Installation-info",children:[l.multi_disclaimer.title&&(0,v.jsxs)("p",{className:"txt-medium mB5 main-text",children:[(0,v.jsx)("span",{className:"icon-contr",children:l.multi_disclaimer.icon&&(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${l.multi_disclaimer.icon}`,width:"14"})}),l.multi_disclaimer.title]}),l.multi_disclaimer.sub_title&&(0,v.jsx)(b.A,{Tag:"p",className:"small mT0",htmlContent:l.multi_disclaimer.sub_title})]}),(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"innercontainer-xs install-wrapp order-addr-form",children:[y&&y.map(e=>(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)},e.id)),d&&d.termAndCond&&(0,v.jsxs)("div",{className:"mT32 text-center",children:[(0,v.jsx)("input",{type:"checkbox",className:"filled-in form-check-input",id:"checkbox1",checked:i?"checked":"",onClick:()=>this.inputCheckHandler()}),(0,v.jsx)(b.A,{Tag:"label",className:"form-check-label fs12",htmlFor:"checkbox1",htmlContent:d&&d.termAndCond})]}),n&&(0,v.jsx)("span",{className:"validate invalid-text",style:{marginTop:"10px"},children:"This field is required"})]}),(0,v.jsxs)("div",{className:"btn-contr text-center more-connection-btn",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",children:r}),(0,v.jsx)(R.A,{disabled:e.disabled,config:e.buttonConfig,content:"Submit",onClick:e=>this.validateForm(e)})]})]}),(0,v.jsx)("div",{className:"text-center order-note",children:l&&l.bottom_txt})]})]})]}):(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:d&&d.retryTxt}),(0,v.jsx)("h1",{className:"ha-heading2 gradient",children:d&&d.retryDesc})]}),(0,v.jsxs)("div",{className:"btn-contr text-center more-connection-btn",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",children:r}),(0,v.jsx)(R.A,{disabled:e.disabled,config:e.buttonConfig,content:d&&d.retryCta,onClick:()=>window.location.href=d&&d.retryCtaLink})]})]})})})})]})})}}const re=(0,l.Ng)(e=>({manifest:e.commonReducer.manifest,errorCode:e.commonReducer.errorCode}),e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e),validateOTPFromServerResponseHandler:(0,F.zH)(g.OY,e)}))(ae);var ie=s(95093),ne=s.n(ie),oe=s(81106);const le={method:"GET",url:`${c.A.NODE_API_ROOT}/${c.A.home_automation}`,headers:c.A.getHeaders(["JSON"])},ce={method:"POST",url:`${c.A.NODE_API_ROOT}/${c.A.home_automation}`,headers:c.A.getHeaders(["JSON"])};function de(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function me(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?de(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):de(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const ue=new class{getData(e,t){const s=me({},le);s.url=`${s.url}/${e}`,s.params=t;return new oe.I(s).doAjax()}postData(e,t){const s=me({},ce);s.url=`${s.url}/${e}`,s.params=t;return new oe.I(s).doAjax()}campaignRecordUpdate(e){const t=me({},ce);t.url=`${t.url}/package/campaignRecord/update`,t.params=e;return new oe.I(t).doAjax()}createOrder(e){const t=me({},ce);t.url=`${t.url}/order/create`,t.params=e;return new oe.I(t).doAjax()}};var he=s(7375);class pe extends a.Component{constructor(...e){super(...e),this.state={height:"0px"},this.componentDidMount=()=>{window.scrollTo(0,0),setTimeout(()=>{this.setState({height:"200px"})},1e3)}}render(){const{height:e}=this.state,{closeAlert:t,cartMaxCount:s,btn:a,history:r,text:i}=this.props,n=s||99;return(0,v.jsx)("div",{className:"recharge-offers ha-snack",style:{maxHeight:e},children:(0,v.jsx)("div",{className:"toast-message ",children:(0,v.jsxs)("div",{className:"desc-txt",children:[(0,v.jsx)("span",{children:(0,v.jsx)("img",{src:"/assets/images/toast-info.svg",alt:"alert",title:"alert",className:"img-fluid mR10"})}),(0,v.jsxs)("div",{className:"toast-text",children:[(0,v.jsx)("div",{className:"txt",children:i?`${i}.`:`The maximum limit number could be ${n}.`}),a&&(0,v.jsx)("span",{className:"link",onClick:()=>r.push(a.url),children:a.label})]}),(0,v.jsx)("span",{className:"toast-close",onClick:e=>t(e),children:(0,v.jsx)("img",{src:"/assets/images/toast-close.svg",alt:"close",title:"close"})})]})})})}}const ge=pe,fe=({body:e,url:t})=>(0,v.jsxs)("div",{className:"fb-blk",style:{padding:"15px 0 0"},children:[(0,v.jsx)("div",{className:"fb-img",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+t,alt:"",className:"img-fluid"})}),(0,v.jsx)(b.A,{className:"fb-text",htmlContent:e})]});var xe=s(85734),be=s(31636),ve=s(49822),ye=s(82290);const Se=e=>{const{history:t,title:s,jsonUrl:r,classes:i,includeCurrent:n}=e,[o,l]=(0,a.useState)(!1),[d,m]=(0,a.useState)(null);(0,a.useEffect)(()=>{(async()=>{const e=r||"s3-api/v1/assets/pages/dropdown.json";try{const{data:t}=await f.n.getJsonData(e);t.message===c.A.MESSAGES_TYPES.SUCCESS&&m(t.data.field_json)}catch(e){}})()},[]);const u=(e,s="R",a)=>{(0,x.Sw)({event:"secureDropDown","Main Menu Selected":a}),"R"===s?t.push(`/${c.A.home_automation}/${e}`):"D"===s&&(window.location.href=`/${c.A.home_automation}/${e}`)};return(0,v.jsx)("div",{className:(i?`${i} `:"")+"dropdownwrapp",children:(0,v.jsxs)(xe.A,{isOpen:o,toggle:e=>{e.preventDefault(),l(!o)},children:[(0,v.jsx)(be.A,{caret:!0,title:s,children:s}),(0,v.jsxs)(ve.A,{children:[n&&d&&d.map((e,t)=>(0,v.jsx)(ye.A,{className:""+(e.name.toLowerCase().replace(/[^a-zA-Z0-9 ]/g,"")===s.toLowerCase().replace(/[^a-zA-Z0-9 ]/g,"")?"active":""),onClick:()=>u(e.url,e.source,e.name),children:e.name},t)),!n&&d&&d.map((e,t)=>{if(e.name.toLowerCase()!==s.toLowerCase()){if("D"===e.source)return(0,v.jsx)("a",{className:"dropdown-item",onClick:()=>u(`/${c.A.home_automation}/${e.url}`,e.source,e.name),href:"javascript:void(0)",children:e.name},t);if("R"===e.source)return(0,v.jsx)(ye.A,{onClick:()=>u(e.url,e.source,e.name),children:e.name},t)}})]})]})})};class je extends a.Component{constructor(...e){super(...e),this.state={cartCount:1,miniCount:1,isBundled:!0,cameraPrice:"",subscriptionPrice:"",subscriptionSellingPrice:"",miniPrice:"",dropdownOpen:!1,isOpenCamera:!1,isOpenSubscription:!1,isOpenMini:!1,isSubsFeatureOpen:!1,isMiniFeatureOpen:!1,isCamFeatureOpen:!1,productData:null,subscriptionData:[],selectedSubscription:{},pageTitle:"",showSnack:!1,cartMaxCount:4,pageData:null,isMsales:null,snackText:null,isOTT:null,render:!1,utmSource:null,a:null},this.productDetailGA=()=>{const{pageProduct:{productData:e}}=this.props,{cartCount:t,miniCount:s,subscriptionData:a,isMsales:r}=this.state,{pageData:i}=this.props,n=(e&&e.camera&&e.camera.field_actualprice,e&&e.camera&&e.camera.field_discountprice),o=(e&&e["home mini"]&&e["home mini"].field_actualprice,e&&e["home mini"]&&e["home mini"].field_discountprice);let l={};
1a.forEach(e=>{t>=e.deviceCountMin&&"base"===e.packTypeEbr.toLowerCase()&&"monthly"===e.packUom.toLowerCase()&&(l=e)});const c=parseInt(n,10)+parseInt(o,10)+parseInt(l.discountedPrice,10);(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"productDetailView",ecommerce:{detail:{actionField:"",products:[{name:"Tata Play Secure Plus",id:l.id,price:c,brand:"Tata Play",category:"Home Automation",variant:"Google",productName:e&&e.camera&&`${w()(e.camera.title)?"Google Nest Cam (battery)":e.camera.title}, ${e&&e["home mini"]&&!w()(e["home mini"].title)?e["home mini"].title:"Google Nest Mini (2nd Gen)"}, ${l.friendlyName}`}]}}})},this.updateCampaignRecord=async()=>{try{const{salesLeadParams:e}=(0,he.u6)("ha_plus");if(!e)return;const{data:t}=await ue.campaignRecordUpdate({campaignId:e.campaignId||"",plan:e.plan||""})}catch(e){console.log(e)}},this.getPageData=async()=>{await(0,T.bk)(`${j.dV}/s3-api/v1/assets/pages/product-buy.json`,{},!0)},this.getProductsData=async()=>{(0,he.j3)().then(e=>{this.saveProductData()})},this.saveProductData=()=>{const{pageProduct:{productData:e}}=this.props,{cartCount:t}=this.state;if(e&&e.camera&&this.setState({cameraPrice:parseInt(e.camera.field_actualprice,10)*t,cameraSellPrice:parseInt(e.camera.field_discountprice,10)*t}),e["home mini"]){let s=t;e["home mini"].field_quantity&&"false"===e["home mini"].field_is_bundeled&&(s=parseInt(e["home mini"].field_quantity,10)),this.setState({miniPrice:parseInt(e["home mini"].field_actualprice,10)*s,miniSellPrice:parseInt(e["home mini"].field_discountprice,10)*s,miniCount:s,isBundled:e["home mini"].field_is_bundeled})}}
1,this.getSubscriptionData=async()=>{(0,he.qS)().then(e=>{this.saveSubData()})},this.saveSubData=()=>{new Date;const e=(0,x.Bd)(),{pageProduct:{subscriptionData:t}}=this.props;try{if(Array.isArray(t)&&t.length>0){let s="google";e&&(s="google_msales");const a=t.filter(e=>e.meta.field_journey&&e.meta.field_journey.includes(s));if(a.length>0){const e=a.sort((e,t)=>e.deviceCountMin-t.deviceCountMin);this.setState({subscriptionData:e,cartMaxCount:a[0].maxCount})}}this.productDetailGA(),this.addRemoveCartGaEvent("plus",!0)}catch(e){console.log(e)}},this.toggle=e=>{e.preventDefault();const{dropdownOpen:t}=this.state;this.setState({dropdownOpen:!t})},this.toggleAccordion=(e,t)=>{e.preventDefault(),this.setState({[t]:!this.state[t]})},this.checkPaymentStatus=async()=>{const{setApiError:e}=this.props,t=(0,he.u6)("ha_plus");if(t&&t.orderUuid)try{const{data:s}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${t.orderUuid}`);if(s.status&&s.message===c.A.MESSAGES_TYPES.SUCCESS){const t=s.data;if(!t&&!Object.isArray(t)&&t.length<=0)return void e(c.A.serverError,!0);const a=t[0].paymentStatus;let r=null;"SUCCESS"===a?r=j.QZ.SUCCESS:"INPROGRESS"===a?r=j.QZ.AWAITED:"FAILED"===a&&(r=j.QZ.FAILURE),(0,he.VJ)(r,"HA","ha_plus")}else e(c.A.serverError,!0)}catch(t){console.log(t),t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.handleSubmit=async e=>{await this.checkPaymentStatus();const{pageProduct:{productData:t}}=this.props,{cartCount:s,miniCount:a,utmSource:r,a:i}=this.state,{history:n}=this.props,o=[],l=JSON.parse(t&&t.camera&&t.camera.field_json).summary_text,d=JSON.parse(t&&t["home mini"]&&t["home mini"].field_json).summary_text,m=JSON.parse(e&&e.meta&&e.meta.field_json).summary_text;o.push({subscriptionUuid:e.uuid,description:m||"",id:e.id});const u=[];u.push({productUuid:t&&t.camera&&t.camera.field_uuid,count:s,description:l||""}),u.push({productUuid:t&&t["home mini"]&&t["home mini"].field_uuid,count:a,description:d||""});const h=this.getCartInfoGA(),p={addedProductData:u,addedsubscriptionData:o,totalPrice:h.price};
1if(!c.A.isServer()){const e=(0,he.u6)("ha_plus");e?(e.productData=p,e.gaInfo=h,(0,he.e)("ha_plus",e)):(0,he.e)("ha_plus",{productData:p,gaInfo:h}),this.setSessionCartCount()}if((0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"checkout",ecommerce:{checkout:{actionField:{step:1,option:"Cart view"},products:[{name:"Tata Play Secure plus",id:h.id,price:h.price,brand:"Tata Play",category:"Home Automation",variant:"Google",quantity:s,productName:`${h.ProductName}, ${h.packName}`}]}}}),"tp-fiberndth"===r){const e=[];e.push({product:l||"",count:s,productType:t&&t.camera&&t.camera.field_type}),e.push({product:d||"",count:a,productType:t&&t["home mini"]&&t["home mini"].field_type});const r={product:e,subscription:o,totalAmout:h&&h.price,source:"haportal",serviceProvider:"Google",refId:i};(0,x.Nq)("hatpfD",r),n.push(`/${c.A.home_automation}/intent`)}else n.push(`/${c.A.home_automation}/${j.dY}/order-address`)},this.setSessionCartCount=()=>{const{cartCount:e,miniCount:t}=this.state;if(!c.A.isServer()){const s=(0,he.u6)("ha_plus");s?(s.cartCount=e,s.miniCount=t,s.prevCartCount=s.prevCartCount?s.prevCartCount:e,(0,he.e)("ha_plus",s)):(0,he.e)("ha_plus",{cartCount:e,miniCount:t,prevCartCount:e})}},this.handleCartItemCount=(e,t)=>{const{cartCount:s,miniCount:a,isBundled:r,cartMaxCount:i}=this.state,{pageData:n}=this.props;let o=0,l=a;if("minus"===e?(o=parseInt(s,10)-1,a&&"true"===r&&(l=parseInt(a,10)-1)):"plus"===e&&(o=parseInt(s,10)+1,a&&"true"===r&&(l=parseInt(a,10)+1)),o>i){const e=n?`${n&&n.snack_text} ${i}`:null;return void this.setState({showSnack:!0,snackText:e})}o<1||this.setState({cartCount:o,miniCount:l},()=>{this.handleCartPrice(t),this.addRemoveCartGaEvent(e)})},this.addRemoveCartGaEvent=(e,t)=>{const s=this.getCartInfoGA(t),{cartCount:a}=this.state;"minus"===e&&(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"removeFromCart",ecommerce:{remove:{products:[{name:"Tata Play Secure Plus",id:s.id,price:s.singlePrice,brand:"Tata Play",category:"Home Automation",variant:"Google",list:"NA",quantity:1,productName:`${s.ProductName}, ${s.packName}`}]}}}),"plus"===e&&(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"addToCart",ecommerce:{currencyCode:"INR",add:{products:[{name:"Tata Play Secure Plus",id:s.id,price:t?s.price:s.singlePrice,brand:"Tata Play",category:"Home Automation",variant:"Google",list:"NA",quantity:t?a:"1",productName:`${s.ProductName}, ${s.packName}`}]}}})},this.getCartInfoGA=(e=!1)=>{const{cartCount:t,productData:s,miniCount:a,subscriptionData:r,isMsales:i}=this.state,{pageData:n}=this.props,o=s&&s.camera&&s.camera.field_discountprice,l=s&&s["home mini"]&&s["home mini"].field_discountprice;let c={};r.forEach(e=>{t>=e.deviceCountMin&&"base"===e.packTypeEbr.toLowerCase()&&"monthly"===e.packUom.toLowerCase()&&(c=e)});const d=parseInt(o,10)*t+parseInt(l,10)*a+parseInt(c.discountedPrice,10);let m=0;return m=e?parseInt(o,10)+parseInt(l,10)+parseInt(c.discountedPrice,10):parseInt(o,10)+parseInt(l,10),{id:c.id,price:d,singlePrice:m,packName:c.friendlyName,ProductName:`${s&&s.camera&&!w()(s.camera.title)?s.camera.title:"Google Nest Cam (battery)"}, ${s&&s["home mini"]&&!w()(s["home mini"].title)?s["home mini"].title:"Google Nest Mini (2nd Gen)"}`}},this.closeAlert=e=>{e.stopPropagation(),this.setState({showSnack:!1})},this.handleCartPrice=e=>{const{pageProduct:{productData:t}}=this.props,{cartCount:s,miniCount:a,subscriptionData:r,isMsales:i}=this.state,{pageData:n}=this.props,o=t&&t.camera&&t.camera.field_actualprice,l=t&&t.camera&&t.camera.field_discountprice,c=t&&t["home mini"]&&t["home mini"].field_actualprice,d=t&&t["home mini"]&&t["home mini"].field_discountprice;let m={};r.forEach(e=>{s>=e.deviceCountMin&&"base"===e.packTypeEbr.toLowerCase()&&"monthly"===e.packUom.toLowerCase()&&(m=e)});const u=parseInt(l,10)*s+parseInt(d,10)*a+parseInt(m.discountedPrice,10);if(i&&u>t.camera.field_msales_transamt){const e=n?`${n.snack_msales_transtext} ${t.camera.field_msales_transamt}`:null;return void this.setState({snackText:e,showSnack:!0,cartCount:s-1,miniCount:a-1},()=>{this.setSessionCartCount()})}this.setState({cameraPrice:parseInt(o,10)*s,cameraSellPrice:parseInt(l,10)*s,subscriptionPrice:parseInt(e.packMrp,10),subscriptionSellingPrice:parseInt(e.packMrp,10),miniPrice:parseInt(c,10)*a,miniSellPrice:parseInt(d,10)*a},()=>{this.setSessionCartCount()})},this.redirectToDestination=e=>{const{history:t}=this.props;t.push(`/${c.A.home_automation}/${j.dY}/${e}`)}}componentDidMount(){const{pageData:e,pageProduct:t,location:{search:s}}=this.props,a=(0,x.GY)("utmParam")||"";if(this.setState({utmSource:a?a.utmSource:null}),this.setState({a:a?a.a:null}),s&&!a){const e=(0,x.vA)(s),t={};e&&e.utm_campaign&&(t.utmCampaign=e.utm_campaign),e&&e.utm_source&&(t.utmSource=e.utm_source),e&&e.a&&(t.a=e.a),(0,x.ec)("utmParam",t)}if(!c.A.isServer()){const e=(0,he.u6)("ha_plus")||"";if(e){const t=e.cartCount?e.cartCount:1,s=e.miniCount?e.miniCount:1;this.setState({cartCount:t,miniCount:s},()=>{})}else(0,he.e)("ha_plus",{salesLeadParams:{campaignId:"",plan:""}})}const r=(0,x.Bd)(),i=(0,x.jv)(),n=(0,x.dl)();(r||i)&&this.setState({isMsales:!0}),n&&this.setState({isOTT:!0}
1),!e&&this.getPageData(),this.getProductsData(),this.getSubscriptionData(),this.updateCampaignRecord()}render(){const{history:e,pageData:t,breadCrumb:s,pageMetaData:r,pageTitle:i,pageProduct:{productData:n,subscriptionData:o},footerStaticSsrData:l,footerSsrData:d}=this.props,{dropdownOpen:g,cartCount:f,cameraPrice:x,cameraSellPrice:y,isOpenCamera:S,isOpenSubscription:j,isOpenMini:N,miniPrice:C,miniSellPrice:_,showSnack:E,miniCount:T,isSubsFeatureOpen:O,isMiniFeatureOpen:k,isCamFeatureOpen:P,cartMaxCount:I,isMsales:M,snackText:$,isOTT:R}=this.state;if(!t||!n||w()(o)||!(o.length>0))return(0,v.jsx)(u.A,{});let L={};o.forEach(e=>{f>=e.deviceCountMin&&"base"===e.packTypeEbr.toLowerCase()&&"monthly"===e.packUom.toLowerCase()&&(L=e)});const F=C+x+parseInt(L.packMrp,10),U=y+_+parseInt(L.discountedPrice,10),B=F-U;return(0,v.jsx)(A.A,{isSecure:!0,metatags:r||{},showBreadCrumb:!0,breadCrumbSchema:s,children:(0,v.jsxs)("div",{className:"ipl_event",children:[E&&$&&(0,v.jsx)(ge,{text:$,closeAlert:this.closeAlert,cartMaxCount:I}),M||R?(0,v.jsx)(h.A,{isLogo:!0,journeyType:"HA_PLUS"}):(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsxs)("div",{className:"content-container pay-succes gs-alert",children:[(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[M||R?null:(0,v.jsx)(G,{history:e,destination:"tata-play-secure-plus"}),i&&(0,v.jsx)("div",{className:"heading-md "+(M||R?"msale-ott":""),style:{marginBottom:"24px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:i})}),!M&&t&&(0,v.jsx)("div",{className:"bundle",children:(0,v.jsx)(Se,{classes:"wyze-drop",history:e,title:t&&t.dropdown_title,includeCurrent:!0})}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsx)("div",{className:"features-wrapp",children:(0,v.jsxs)("div",{id:"accordion",className:"accordion-packchange",children:[(0,v.jsxs)("div",{className:"acc-cont",children:[(0,v.jsx)("div",{children:(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsxs)("div",{className:"feat-accor-img",children:[" ",n&&n.camera&&(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+n.camera.field_image.url,alt:n&&n.camera&&n.camera.field_image.alt})," "]}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[(0,v.jsx)("span",{children:n&&n.camera&&n.camera.title}),n&&n.camera&&n.camera.field_wifi_description&&(0,v.jsxs)("div",{className:"wifi-contr",children:[(0,v.jsx)("span",{className:"icon-contr",style:{marginRight:"5px"},children:n.camera.field_wifi_icon&&n.camera.field_wifi_icon.url&&(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${n.camera.field_wifi_icon.url}`,alt:"",style:{display:"flex",width:"14px"}})}),(0,v.jsx)(b.A,{Tag:"span",className:"wifi-desclaimer-text",htmlContent:n.camera.field_wifi_description})]}),n&&n.camera&&n.camera.field_subtitle]}),(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsxs)("div",{className:"qty",children:[(0,v.jsx)("span",{className:"minus",onClick:()=>this.handleCartItemCount("minus",L),children:"-"}),(0,v.jsx)("input",{type:"text",className:"count",name:"qty",value:f}),(0,v.jsx)("span",{className:"plus",onClick:()=>this.handleCartItemCount("plus",L),children:"+"})]}),(0,v.jsxs)("div",{className:"price",children:[x!==y&&(0,v.jsxs)("div",{className:"label cutprice cam-price",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:x})]}),0!==y?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:y})]}),(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"annual-sub-price offer-text",children:t&&t.inclusive_text})})]}):(0,v.jsx)("div",{className:"label",children:"Free"})]})]})]})}),(0,v.jsxs)("div",{className:"fea-bene-text-outer",children:[(0,v.jsx)("div",{onClick:e=>this.toggleAccordion(e,"isOpenCamera"),className:"fea-bene-text accordion-toggle "+(S?"acc-expanded":"acc-collapsed"),children:"Features and benefits"}),(0,v.jsx)(D.A,{isOpen:S,children:n&&n.camera&&n.camera.field_features.map((e,t)=>{if(t<=4)return(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t);if(5===t){const e=n&&n.camera.field_features.slice(5,n.camera.field_features.length);return(0,v.jsxs)("div",{children:[(0,v.jsx)(D.A,{isOpen:P,style:{border:"0",paddingBottom:"0"},children:e.map((e,t)=>(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t))}),(0,v.jsx)("div",{className:"fb-blk d-block",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:e=>this.toggleAccordion(e,"isCamFeatureOpen"),className:"viewmore less ha-hover",children:P?"View Less":"View More"})})]})}})})]})]}),L&&Object.keys(L).length>0&&(0,v.jsxs)("div",{className:"acc-cont",children:[(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsxs)("div",{className:"feat-accor-img",children:[" ",L.meta.field_image&&(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+L.meta.field_image.url,alt:L.meta.field_image.alt,style:{width:"45px"}})," "]}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[" ",(0,v.jsx)("span",{children:L.friendlyName})," ",L.meta.field_subtitle," "]}),(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsxs)("div",{className:"price",children:[L.discountedPrice!==L.packMrp&&(0,v.jsxs)("div",{className:"label cutprice cam-price",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"annual-sub-cut-price",children:L&&L.packMrp})]}),(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsxs)("span",{className:"annual-sub-price",children:[(0,v.jsx)("span",{className:"bold",children:L&&L.discountedPrice}),(0,v.jsx)("span",{className:"small",children:L&&"monthly"===L.packUom.toLowerCase()?"/month":null})]})]})]}),(0,v.jsx)(b.A,{Tag:"span",htmlContent:L.meta.field_offer_label})]})]}),f>4&&(0,v.jsx)("div",{className:"annual-sub-contr",children:`Subscription charges vary when you purchase more than ${parseInt(L.deviceCountMin,10)-1} cameras`}),(0,v.jsxs)("div",{className:"fea-bene-text-outer",children:[(0,v.jsx)("div",{onClick:e=>this.toggleAccordion(e,"isOpenSubscription"),className:"fea-bene-text accordion-toggle "+(j?"acc-expanded":"acc-collapsed"),children:"Features and benefits"}),(0,v.jsx)(D.A,{isOpen:j,children:L.meta.field_sub_features&&L.meta.field_sub_features.map((e,t)=>{if(t<=4)return(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t);if(5===t){const e=L.meta.field_sub_features.slice(5,L.meta.field_sub_features.length);return(0,v.jsxs)("div",{children:[(0,v.jsx)(D.A,{isOpen:O,style:{border:"0",paddingBottom:"0"},children:e.map((e,t)=>(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t))}),(0,v.jsx)("div",{className:"fb-blk d-block",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:e=>this.toggleAccordion(e,"isSubsFeatureOpen"),className:"viewmore less ha-hover",children:O?"View Less":"View More"})})]})}})})]})]}),(0,v.jsxs)("div",{className:"acc-cont",children:[(0,v.jsx)("div",{children:(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsx)("div",{className:"feat-accor-img",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+m()(n,'["home mini"].field_image.url',""),alt:m()(n,'["home mini"].field_image.alt',"")})}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[(0,v.jsx)("span",{children:n&&n["home mini"]&&n["home mini"].title}),n&&n["home mini"]&&n["home mini"].field_subtitle]}),(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsx)("div",{className:"feat-accor-text",children:(0,v.jsxs)("span",{children:["Qty.",(0,v.jsx)("span",{className:"gmini-qnt d-inline",children:T})]})}),(0,v.jsxs)("div",{className:"price",children:[C!==_&&(0,v.jsxs)("div",{className:"label cutprice",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:C})]}),0!==_?(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:_})]}):(0,v.jsx)("div",{className:"label free-text",children:"Free"})]}),(0,v.jsx)("div",{className:"offer-text",children:n&&n["home mini"]&&(0,v.jsx)(b.A,{Tag:"span",htmlContent:n["home mini"].field_offer_label})})]})]})}),(0,v.jsxs)("div",{className:"fea-bene-text-outer",children:[(0,v.jsx)("div",{onClick:e=>this.toggleAccordion(e,"isOpenMini"),className:"fea-bene-text accordion-toggle "+(N?"acc-expanded":"acc-collapsed"),children:"Features and benefits"}),(0,v.jsx)(D.A,{isOpen:N,children:n&&n["home mini"]&&n["home mini"].field_features&&n["home mini"].field_features.map((e,t)=>{if(t<=4)return(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t);if(5===t){const e=n&&n["home mini"].field_features.slice(5,n["home mini"].field_features.length);return(0,v.jsxs)("div",{children:[(0,v.jsx)(D.A,{isOpen:k,style:{border:"0",paddingBottom:"0"},children:e.map((e,t)=>(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t))}),(0,v.jsx)("div",{className:"fb-blk d-block",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:e=>this.toggleAccordion(e,"isMiniFeatureOpen"),className:"viewmore less ha-hover",children:k?"View Less":"View More"})})]})}})})]})]})]})}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show",children:(0,v.jsxs)("div",{className:"dflex-sb innercontainer-sm",children:[(0,v.jsxs)("div",{className:"cart-wrapp dflex-sb",children:[(0,v.jsxs)("div",{className:"cart-icon mR10",children:[" ",(0,v.jsx)("img",{src:"/assets/images/home-automation/cart.svg",alt:"cart"}),(0,v.jsx)("div",{className:"cart-items",children:f})]}),(0,v.jsxs)("div",{className:"carttext ",children:[" ",(0,v.jsxs)("span",{className:"d-block",children:[(0,v.jsxs)("div",{className:"label text-stroke",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"total-discount-price",children:F})]}),(0,v.jsxs)("div",{className:"label mL5 bigfont",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"total-price1",children:U})]})]})," ",B>0&&(0,v.jsxs)("span",{className:"gradient",children:["Benefits worth ",(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"you-save-price",children:B})]})]})," "]})]}),(0,v.jsx)("button",{type:"button",className:"btn42 btn-primary waves-effect waves-light share-summary",onClick:()=>this.handleSubmit(L,U,B),children:"Buy Now"})]})})]})]})}),M||R?null:(0,v.jsx)(p.A,{footerStaticSsrData:l,footerSsrData:d,showBreadCrumb:!0,breadCrumbData:s})]})]})})}}(0,l.Ng)(e=>({pageData:e.commonReducer.currentPageMetaData&&e.commonReducer.currentPageMetaData.field_json,breadCrumb:e.commonReducer.currentPageMetaData&&e.commonReducer.currentPageMetaData.breadcrumb,pageMetaData:e.commonReducer.currentPageMetaData&&e.commonReducer.currentPageMetaData.metatag,pageTitle:e.commonReducer.currentPageMetaData&&e.commonReducer.currentPageMetaData.title,pageProduct:e.commonReducer.pageData,footerSsrData:e.commonReducer.footerSsrData,footerStaticSsrData:e.commonReducer.footerStaticSsrData}),e=>({setApiError:(0,F.zH)(g.x8,e)}))(je);var Ae=s(31692);const Ne=e=>{const{modalParameters:{data:{title:t,body:s,showRecharge:a,encSubId:r,redirectUrl:i,rechargeHandler:n,btnTxt:o,excludeHa:c,fieldSource:d,subHeading2:u,gaInfo:h},history:p},closeModal:g}=e,{manifest:f}=(0,l.d4)(e=>e.commonReducer),b={buttonConfig:{type:"button",class:"wAutoLgBlue okButton"},text:a?o||"Recharge":o||"Ok"};return(0,v.jsxs)("div",{className:"text-center",children:[(0,v.jsxs)("div",{className:"heading-sm",children:[(0,v.jsx)("h2",{className:"ha-heading1 gradient",children:t}),(0,v.jsx)("h3",{className:"heading2",children:s}),u&&(0,v.jsx)("h3",{className:"heading2",children:u})]}),(0,v.jsx)("div",{className:"btn-contr text-center",children:(0,v.jsx)(R.A,{config:b.buttonConfig,content:b.text,onClick:()=>(()=>
1{if(h&&(0,x.Sw)(h),a)if(n)n();else{const e=m()(f,"redirectionPath.myaccount_quick_recharge","");(0,x.JA)(e,{isNewTab:!0,rechargeOthers:!0,otherSubId:r})}else g(),i&&(c||"D"===d?window.location.href=i:p.push(i))})()})})]})},Ce=["hasErrors"];function we(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function _e(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?we(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):we(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Ee extends a.Component{constructor(e){super(e),this.checkWoStatus=async()=>{this.setState({render:!1});const{setApiError:e,openModal:t,history:s}=this.props;try{const{userAuth:a}=localStorage,{subId:r}=JSON.parse(a),i={subscriberId:r.id},{data:n}=await f.n.postData("order/workorder/getWoPendingStatus",i);if(n.status)return!0;if("FAILURE"!==n.message){const e=!0;return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Oops! Your previous order is pending",body:"To perform any action, we need to close your previous order. Please contact our call centre to get an update on your work order status.",btnTxt:"Ok",redirectUrl:"/",onClose:e},redirectRoute:!0,onCloseEvent:()=>{e&&(window.location.href="/")},history:s}),this.setState({showBlank:!0,render:!0}),!1}e(c.A.serverError,!0)}catch(t){e(c.A.serverError,!0)}},this.checkOrderStatus=async e=>{const{history:t,setApiError:s}=this.props;let a=_e({},e);const r={orderType:"NEW",subId:JSON.parse(localStorage.userAuth).subId.id,provider:"Google"};try{const{data:e}=await f.n.postData("package/getOrderStatusBySubId",r);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const s=e.data;s.address&&(0,he.PS)(s.address,"ha","ha_plus");const r=s.subId||localStorage.userAuth&&JSON.parse(localStorage.userAuth).subId;a=(0,he.u6)("ha_plus"),a.orderChecked=!0,a.siebelPackName=s.siebelPackName,"Initiated"!==s.orderStatus&&"Completed"!==s.orderStatus||(a.paymentStatus=j.QZ.SUCCESS),"Completed"!==s.orderStatus?(a.orderCreated=!!m()(s,"address.orderUuid",!1),a.prevCartCount=a.cartCount):a.prevCartCount=1,a.subId=r,a.page=s.page,(0,he.e)("ha_plus",a);const i=j.MC.orderStatusList[s.page];i?"CREATE ADDRESS"!==s.page&&"BUNDLE"!==s.page&&("ACCOUNT LINK"===s.page||"INSTALLATION"===s.page?t.push(`/${c.A.home_automation}/${j.dY}/${i}`):this.createOrder().then(e=>{t.push(`/${c.A.home_automation}/${j.dY}/${i}`)})):t.push(`/${c.A.home_automation}/${j.dY}`)}else s(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}return a},this.setSubscriptionData=async e=>{const{setApiError:t}=this.props,s=new Date,a=(0,x.Bd)();let r={};try{const{data:i}=await f.n.getJsonData(`read/core-api/subscription/search/${ne()(s).format("YYYYMMDD")}`);if(i.status===c.A.MESSAGES_TYPES.SUCCESS){if(Array.isArray(i.data)&&i.data.length>0){let t="google";a&&(t="google_msales");i.data.filter(e=>e.meta.field_journey&&e.meta.field_journey.includes(t)).forEach(t=>{e>=t.deviceCountMin&&"base"===t.packTypeEbr.toLowerCase()&&"annual"===t.packUom.toLowerCase()&&(r=t)})}}else t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}return r},this.getModalData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/google-order-address-page.json.json");t.message===c.A.MESSAGES_TYPES.SUCCESS?this.setState({modalData:t.data.field_json.popup_config,pageJsonData:t.data.field_json,termsText:t.data.body}):e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.checkSubscriberStatus=()=>{const{selectedSubId:e,subscribersStatus:t,modalData:s,encSubIdList:a}=this.state,r="object"==typeof e?e.id:e,i=a[r];if("Active"===t[r])return!0;const{openModal:n,history:o}=this.props;let l,c,d="",m="",u=null,h="",p=!1;if(s&&Array.isArray(s)&&s.length>0){if("Temp Suspension"===t[r]){const e=s.filter(e=>"TEMP_SUSPEND"===e.status);d=e[0].heading,m=e[0].subHeading1,u=e[0].subHeading2,h=e[0].button_text,l=e[0].button_link,c=e[0].field_url_source}if("Deactivated"===t[r]||"Deactive"===t[r]){const e=s.filter(e=>"DEACTIVATED"===e.status);d=e[0].heading,m=e[0].subHeading,h=e[0].button_text,p=!0}}return n(L.lx.COMMON_MODAL,{Component:Ne,data:{title:d,body:m,subHeading2:u,showRecharge:p,encSubId:i,btnTxt:h,redirectUrl:l,fieldSource:c},history:o}),!1},this.createOrder=async()=>{const e=(0,he.u6)("ha_plus"),t=(0,x.Bd)(),s=(0,x.jv)(),{history:a}=this.props,r=(0,x.GY)("utmParam");if(e){const a=_e({},e),i=m()(a,"salesLeadParams",""),n=m()(a,"productData",""),o=m()(a,"subId",""),l={campaignId:i?i.campaignId:"",name:o.name,orderType:"NEW",plan:i?i.plan:"",subId:(0,he.HW)().id,product:n.addedProductData,subscription:n.addedsubscriptionData,provider:"Google",utmParam:r||null};t&&(l.dealerId=t.HaDealerId,l.source="hamsales"),s&&(l.dealerId=s.HaDealerId,l.source="TPF");try{const{data:e}=await ue.createOrder(l);if(e&&!0===e.status)return this.setState({orderUuid:e.data.orderUuid}),a.orderUuid=e.data.orderUuid,a.prevCartCount=a.cartCount,a.orderCreated=!0,a.paymentStatus=null,a.mismatch=!1,(0,he.e)("ha_plus",a),Promise.resolve(!0)}catch(e){const{setApiError:t}=this.props;e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}}}
1,this.getSubsciberDetails=async e=>{const{setApiError:t}=this.props,s={subscriberId:"object"==typeof e?e.id:e,source:"WEB"};try{const{data:e}=await f.n.postData("order/address/getAddress",s);e.message===c.A.MESSAGES_TYPES.SUCCESS?this.setInfoForm(e.data):t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.setInfoForm=(e,t)=>{const{infoForm:s}=this.state,a=_e({},s),{adrLine1:r,adrLine2:i,city:n,email:o,pinCode:l,state:c,building:d,landmark:m,location:u}=a;r.value=e.address||"",i.value=e.addressline2||"",u.value=e.location||"",n.value=e.city||"",o.value=e.emailId||"",l.value=e.areaPincode||"",c.value=e.state||"",d.value=e.building||"",m.value=e.landmark||"",e.termsChecked&&this.setState({termsChecked:e.termsChecked}),this.setState({infoForm:a,selectedSubName:e.subscriberName,render:!0},()=>this.getPinCodeData(e.areaPincode,t))},this.getPinCodeData=async(e,t)=>{if(e)try{const{data:t}=await f.n.getData(`payment/pincode/getPinDetailsByZipCode/${e}/Google`),{infoForm:s,pageJsonData:a}=this.state,r=_e({},s),{city:i,pinCode:n,state:o,location:l}=r,c=t.data;if(c&&Array.isArray(c)&&c.length>0){if(o.value&&o.value!==c[0].state.trim())return n.valid=!1,n.errorMessage=a&&a.state_err||"State is different",void this.setState({infoForm:r});i.value=c[0].city.trim(),n.value=c[0].zipcode,n.valid=!0,o.value=c[0].state.trim();const e=c&&c.map(e=>({label:e.location,value:e.location}));l.elementConfig.options=[{label:"select",value:""},...e]}else n.valid=!1,n.errorMessage=a&&a.pincode_err||"Apologies, currently we are unavailable in your city. We will be launching soon!";this.setState({infoForm:r})}catch(e){const{setApiError:t}=this.props;e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.inputChangedHandler=(e,t)=>{const{infoForm:s}=this.state,a=_e({},s),{location:r}=a,i=_e({},a[t]);let n=e;"pinCode"===t&&(n=n.replace(/[^0-9]/g,""),n.length>6&&(n=n.slice(0,6)),6===n.length&&this.getPinCodeData(n,!0),n.length<6&&(r.elementConfig.options=[{label:"select",value:""}],r.value=null,this.setState({infoForm:a}))),i.value=n,i.touched=!0,i.valid=!0,i.errorMessage="",a[t]=i,this.setState({infoForm:a})},this.validateForm=async e=>{this.setState({render:!1}),e.preventDefault();const{infoForm:t,selectedSubId:s,selectedSubName:a,orderUuid:r,termsChecked:i}=this.state;if(!this.checkSubscriberStatus())return void this.setState({render:!0});const{history:n}=this.props,o={},l=Object.keys(t);l.forEach(e=>{o[e]=t[e].value});const c=H(o),{hasErrors:d}=c,m=(0,I.A)(c,Ce);if(d){const e=_e({},t);let s=null;l.forEach((t,a)=>{0===a&&(s=t);const r=m[`${t}Message`];r&&""!==r&&(e[t].valid=!1,e[t].errorMessage=r)}),this.setState({infoForm:e,formErrorMessage:"",render:!0}),s&&document.getElementById(s).scrollIntoView()}else{let e=!0;if(l.forEach(s=>{t[s].valid||(e=!1)}),e){if(!i)return void this.setState({showCheckError:!0,render:!0});const e={areaPincode:t.pinCode.value.trim(),address:t.adrLine1.value.trim(),addressline2:t.adrLine2.value.trim(),city:t.city.value.trim(),landmark:t.landmark.value.trim(),location:t.location.value.trim(),emailId:t.email.value.trim(),state:t.state.value.trim(),building:t.building.value.trim(),subId:s,subscriberName:a,termsChecked:i},r=(0,he.u6)("ha_plus");r.infoForm=e,(0,he.e)("ha_plus",r);const n={building:t.building.value.trim(),city:t.city.value.trim(),landmark:t.landmark.value.trim(),location:t.location.value.trim(),orderUuid:r.orderUuid,postalCode:t.pinCode.value.trim(),state:t.state.value.trim(),streetAddress:t.adrLine1.value.trim(),streetAddress2:t.adrLine2.value.trim(),email:t.email.value.trim(),subId:"object"==typeof s?s.id:s};this.createAddress(n);const o=(0,he.u6)("ha_plus");(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"checkout",ecommerce:{checkout:{actionField:{step:2,option:"Customer Details"},products:[{name:"Tata Play Secure Plus",id:o.productData.addedsubscriptionData[0].id,price:o.productData.totalPrice,brand:"Tata Play",category:"Home Automation",variant:"Google",quantity:o.cartCount,productName:`${o.productData.addedProductData[0].description},\n ${o.productData.addedProductData[1].description},\n ${o.productData.addedsubscriptionData[0].subscriptionUuid}`}]}}})}}},this.createAddress=async e=>{const{history:t,setApiError:s}=this.props;try{const{data:s}=await f.n.postData("order/address/create",e);if(s.status&&null===s.data){const{infoForm:e}=this.state,t=s.message.charAt(0).toUpperCase()+s.message.slice(1).toLowerCase();e.pinCode.valid=!1,this.setState({infoForm:e,formErrorMessage:t,render:!0})}else t.push(`/${c.A.home_automation}/${j.dY}/payment-summary`)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}},this.handleSubscriberIDSelect=e=>{this.setState({render:!1}),this.setState({selectedSubId:e.target.value},()=>{const{selectedSubId:e}=this.state;
1this.getSubsciberDetails(e)})},this.inputCheckHandler=()=>{const{termsChecked:e,showCheckError:t}=this.state;this.setState({termsChecked:!e},()=>{const{termsChecked:e}=this.state;e&&t&&this.setState({showCheckError:!1})})},this.initialForm={pinCode:{wrapperClasses:["form-group","pincode-field","more-connection-pincode"],labelConfig:{label:"Pin code",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"pinCode",type:"tel",placeholder:"",maxLength:6,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},location:{wrapperClasses:["form-group","location-field"],labelConfig:{label:"Location",classes:["sel","active","mendate"]},elementType:"select",elementConfig:{id:"location",placeholder:"",options:[{label:"select",value:""}]},value:"",errorMessage:"",valid:!0,touched:!1},building:{wrapperClasses:["form-group","building-field"],labelConfig:{label:"Building Name",classes:["sel","active"]},elementType:"input",elementConfig:{id:"building",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine1:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Address Line 1",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"adrLine1",type:"text",placeholder:"",maxLength:75,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine2:{wrapperClasses:["form-group","addr2-field"],labelConfig:{label:"Address Line 2",classes:["sel","active"]},elementType:"input",elementConfig:{id:"adrLine2",type:"text",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},landmark:{wrapperClasses:["form-group","landmark-field"],labelConfig:{label:"Landmark",classes:["sel","active"]},elementType:"input",elementConfig:{id:"landmark",type:"text",placeholder:"",maxLength:25,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},city:{wrapperClasses:["form-group","city-field"],labelConfig:{label:"City",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"city",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},state:{wrapperClasses:["form-group","state-field"],labelConfig:{label:"State",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"state",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},email:{wrapperClasses:["form-group","email-field"],labelConfig:{label:"Email",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"email",type:"email",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}},this.state={showBlank:!1,termsChecked:!0,showCheckError:!1,render:!0,infoForm:_e({},this.initialForm),subIdList:[],encSubIdList:[],selectedSubId:null,selectedSubName:null,formErrorMessage:null,button:{buttonConfig:{type:"submit",class:"wAutoLgBlue"},text:"Proceed to Summary",url:"select-language",disabled:!1},orderUuid:null,subscribersStatus:null,modalData:null,pageJsonData:null,termsText:null,isMsales:null,subscriptionData:null},this.bodyRef=a.createRef()}async componentDidMount(){this.bodyRef.current&&this.bodyRef.current.scrollTo(0,0);const{history:e}=this.props;if(!await this.checkWoStatus())return;const t=(0,x.Bd)(),s=(0,x.jv)();(t||s)&&this.setState({isMsales:!0,termsChecked:!0});const a=(0,he.u6)("ha_plus");let r;if(a||e.push(`/${c.A.home_automation}/${j.dY}/`),a.orderType=null,(0,he.e)("ha_plus",a),a.orderChecked||t||(r=await this.checkOrderStatus(a)),localStorage.getItem("userAuth")){this.setState({render:!1});const e=JSON.parse(localStorage.getItem("userAuth")),{subscriberIds:t,accountStatus:s,encSubscriberId:i}=e,n=[],o={},l={};t.forEach((e,t)=>{n.push({label:e,value:e}),o[e]=s[t],l[e]=i[t]}),this.setState({subIdList:[...n],subscribersStatus:o,encSubIdList:l},()=>{const t=r||a;if(t&&t.infoForm){const e=t.infoForm;this.setState({selectedSubId:e.subId}),this.setInfoForm(e,!1)}else{const s=e.subId.name;let a=e.subId.id;t&&t.subId&&(a=t.subId),this.setState({selectedSubId:a,selectedSubName:s},()=>
1{this.getSubsciberDetails(a)})}})}const i=(0,he.u6)("ha_plus"),n=[j.QZ.SUCCESS,j.QZ.AWAITED,j.QZ.FAILURE],{cartCount:o,prevCartCount:l,paymentStatus:d,mismatch:m,productData:{addedsubscriptionData:u},siebelPackName:h}=i;i.orderCreated&&o===l&&!d&&!m&&h&&h.toLowerCase().trim()===u[0].subscriptionUuid.toLowerCase().trim()||(o&&l||d&&n.includes(d)||m||t)&&this.createOrder(),this.getModalData()}render(){const{button:e,infoForm:t,render:s,formErrorMessage:r,subIdList:i,selectedSubName:n,selectedSubId:o,modalData:l,termsChecked:d,showCheckError:m,pageJsonData:p,termsText:g,isMsales:f,showBlank:x}=this.state,y=(0,he.u6)("ha_plus"),{history:S}=this.props;if(x)return null;if(!(l&&n&&o&&i.length>0&&s))return(0,v.jsx)(u.A,{});const A=[];return Object.keys(t).forEach(e=>{A.push({id:e,config:t[e]})}),(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{className:"inner-page",ref:this.bodyRef,children:[!s&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:f?j.CB.HA_ADD_CAM_SUBSCRIPTION:j.CB.HA_SUBSCRIPTION,activeStepper:"2"}),(0,v.jsx)(G,{classes:"",history:S,destination:`${j.dY}/bundle`}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:"Next, let's check if your details are correct"})}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("div",{className:"details-wrapp",children:[(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"sel",children:"Name"}),(0,v.jsx)("div",{className:"forminfo",children:n})]}),(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"sel",children:"Subscriber ID"}),i&&i.length>1&&(0,v.jsx)("div",{className:"forminfo",children:(0,v.jsx)("select",{className:"form-control",style:{padding:"0 6px"},value:o,onChange:e=>{this.handleSubscriberIDSelect(e)},children:i&&i.map(e=>(0,v.jsx)("option",{value:e.value,children:e.label}))})}),i&&1===i.length&&(0,v.jsx)("div",{className:"forminfo",children:i[0].label})]})]}),(p&&p.multi_disclaimer&&p.multi_disclaimer.sub_title||p&&p.multi_disclaimer&&p.multi_disclaimer.title)&&y.cartCount>1&&(0,v.jsxs)("div",{className:"Installation-info",children:[p.multi_disclaimer.title&&(0,v.jsxs)("p",{className:"txt-medium mB5 main-text",children:[(0,v.jsx)("span",{className:"icon-contr",children:p.multi_disclaimer.icon&&(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${p.multi_disclaimer.icon}`,width:"14"})}),p.multi_disclaimer.title]}),p.multi_disclaimer.sub_title&&(0,v.jsx)(b.A,{Tag:"p",className:"small mT0",htmlContent:p.multi_disclaimer.sub_title})]}),(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"innercontainer-xs install-wrapp order-addr-form",children:[(0,v.jsx)("div",{className:"orderttl",children:"Installation Address"}),A&&A.map(e=>(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)},e.id)),g&&!f&&(0,v.jsxs)("div",{className:"mT32 text-center ha-plus-tnc",children:[(0,v.jsx)("input",{type:"checkbox",className:"filled-in form-check-input",id:"checkbox1",checked:d?"checked":"",onClick:()=>this.inputCheckHandler()}),(0,v.jsx)(b.A,{Tag:"label",className:"form-check-label fs12",htmlFor:"checkbox1",htmlContent:g})]}),m&&(0,v.jsx)("span",{className:"validate invalid-text",style:{marginTop:"10px"},children:"This field is required"})]}),(0,v.jsxs)("div",{className:"btn-contr text-center more-connection-btn",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",children:r}),(0,v.jsx)(R.A,{disabled:e.disabled,config:e.buttonConfig,content:e.text,onClick:e=>this.validateForm(e)})]})]}),(0,v.jsx)("div",{className:"text-center order-note",children:p&&p.bottom_txt})]})]})]})})]})})}}(0,l.Ng)(null,e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))(Ee);var Te=s(66410);function De(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Oe(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?De(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):De(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const ke=new class{getSubscriberIdList(e){const t=Oe({},Te.d_);t.url=`${c.A.NODE_API_ROOT}/inception-auth/user/subscriberId/list`,t.params=e;return new oe.I(t).doAjax()}HaUserPasswordLogin(e){const t=Oe({},Te.d_);t.params=e,t.url=`${c.A.NODE_API_ROOT}/inception-auth/user/authSubIdLogin`;return new oe.I(t).doAjax()}HaGenerateOtp(e){const t=Oe({},Te.d_);t.params=e,t.url=`${c.A.NODE_API_ROOT}/inception-auth/user/otp-login`;return new oe.I(t).doAjax()}HaForgetPassWord(e){const t=Oe({},Te.d_);t.params=e,t.url=`${c.A.NODE_API_ROOT}/inception-auth/user/forgot-password`;return new oe.I(t).doAjax()}HaResetPassWord(e){const t=Oe({},Te.d_);t.params=e,t.url=`${c.A.NODE_API_ROOT}/inception-auth/user/forgot/password/success`;return new oe.I(t).doAjax()}},Pe=["hasErrors"];function Ie(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Me(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ie(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ie(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const $e={setApiError:g.x8,openModal:U.qf,closeModal:U.Oo};class Re extends a.Component{constructor(...e){super(...e),this.state={render:!0,button:{buttonConfig:{type:"button",class:"blue"},text:"Continue"},formErrorMessage:"",subMessage:"",verifyRmnForm:{subscriberId:{wrapperClasses:["form-group","phone-field"],labelConfig:{label:"Subscriber ID / Registered Mobile Number",classes:["sel","active"]},elementType:"input",elementConfig:{type:"tel",placeholder:"",maxLength:10,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}},pageData:{title:null,subtitle:null},backUrl:{url:"bundle",excludeHa:!1,isAnchor:!1}},this.componentDidMount=async()=>{this.getPageData();const{history:e,pageMetaData:t,location:{search:s}}=this.props,{dest:a}=(0,x.vA)(s);if(a&&this.getBackPath(a),(0,x.wR)(!0)&&(c.A.isServer()?e.push(`/${c.A.home_automation}/${j.oh}`):a?a.includes(c.A.drupal_path)||a.includes(c.A.ha_drupal_path)?location.href=a:e.push(a):(0,x.wR)()?e.push(`/${c.A.home_automation}/${j.oh}`):e.push(`/${c.A.home_automation}/authentication`)),!t)try{await(0,T.bk)("myaccount_login")}catch(e){(0,g.x8)(c.A.serverError,!0)}},this.getBackPath=e=>{const t={"system/tata-play-secure/buy-journey-subscription":{url:"system/tata-play-secure/buy-journey-subscription",excludeHa:!1,isAnchor:!0},"system/tata-play-secure/gethelp":{url:"system/tata-play-secure/gethelp",excludeHa:!1,isAnchor:!0},"secure/tata-play-secure/demo-installation":{url:"system/tata-play-secure/request-demo-brief",excludeHa:!1,isAnchor:!0},"system/tata-play-secure/request-demo-brief":{url:"system/tata-play-secure/request-demo-brief",excludeHa:!1,isAnchor:!0},"add-camera":{url:"my-account",excludeHa:!0,isAnchor:!1},subscription:{url:"my-account",excludeHa:!0,isAnchor:!1},relocation:{url:"system/gethelp-homeautomation",excludeHa:!1,isAnchor:!0},demo:{url:"system/demo",excludeHa:!1,isAnchor:!0},"tata-play-secure":{url:`${j.oh}/bundle`,excludeHa:!1,isAnchor:!1}};e&&Object.keys(t).some(s=>!!e.includes(s)&&(this.setState({backUrl:t[s]}),!0))},this.getPageData=async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/subid-rmn.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data.field_json,{location:{search:s}}=this.props,{dest:a}=(0,x.vA)(s);let r=t.filter(e=>"default"===e.type.toLowerCase())[0];const i=["add-camera","relocation","renew-subscription"];a&&(a.includes(`${j.oh}/demo-installation`)?r=t.filter(e=>"hualai-demo"===e.type.toLowerCase())[0]:a.includes(`${j.dY}/demo-installation`)?r=t.filter(e=>"demo"===e.type.toLowerCase())[0]:a.includes(j.dY)?r=t.filter(e=>"default"===e.type.toLowerCase())[0]:a.includes(j.oh)?r=t.filter(e=>"hualai"===e.type.toLowerCase())[0]:i.some(e=>a.includes(e))&&(r=t.filter(e=>"general"===e.type.toLowerCase())[0])),this.setState({pageData:{title:r.title,subTitle:r.subtitle}}
1)}}catch(e){console.log(e)}},this.inputChangedHandler=(e,t)=>{this.setState({subMessage:""});const{verifyRmnForm:s}=this.state,a=Me({},s),r=Me({},a[t]);let i=e;"subscriberId"===t&&(i=i.replace(/[^0-9]/g,""),i.length>10&&(i=i.slice(0,10))),r.value=i,r.touched=!0,r.valid=!0,r.errorMessage="",a[t]=r,this.setState({verifyRmnForm:a,formErrorMessage:""})},this.authRedirection=e=>{const{history:t,location:{search:s}}=this.props,{dest:a}=(0,x.vA)(s),r=Me({},JSON.parse(sessionStorage.getItem("ha")));r.user={subId:e},sessionStorage.setItem("ha",JSON.stringify(r)),a?t.push(`/${c.A.home_automation}/authentication?dest=${a}`):t.push(`/${c.A.home_automation}/authentication`)},this.subscriberIdList=async e=>{const{setApiError:t,openModal:s}=this.props;try{const{data:t}=await ke.getSubscriberIdList({rmn:e});t.status===c.A.MESSAGES_TYPES.SUCCESS?t.data&&t.data.maskId&&t.data.maskId.length<2?this.authRedirection(t.data.encSubscriberId[0]):(this.setState({render:!0}),s(L.lx.CHOOSE_SUBSCRIBERID_MODAL,{data:t.data})):this.setState({render:!0,formErrorMessage:t.message||"Oops! Something went wrong",subMessage:t.data&&t.data.subMessage||""})}catch(e){console.log("check HA user error",e),t(c.A.serverError,!0)}},this.validateForm=async()=>{if(!c.A.isServer()){const{verifyRmnForm:e}=this.state,t={},s=Object.keys(e);s.forEach(s=>{t[s]=e[s].value});const a=J.A.validateVerifyRmnOrSubscriberid(t),{hasErrors:r}=a,i=(0,I.A)(a,Pe),n=Me({},e);if(r)s.forEach(e=>{const t=i[`${e}Message`];t&&""!==t&&(n[e].valid=!1,n[e].errorMessage=t)}),this.setState({verifyRmnForm:n,formErrorMessage:""});else try{this.setState({render:!1}),this.setRmnToSession(t.subscriberId),t.subscriberId.charAt(0)<6?this.authRedirection(t.subscriberId):this.subscriberIdList(t.subscriberId)}catch(e){n.subscriberId.valid=!1,n.subscriberId.errorMessage=c.A.serverError,this.setState({render:!0,verifyRmnForm:n})}}},this.redirectBack=e=>{const{history:t}=this.props;e.preventDefault(),t.go(-1)},this.redirectToPage=e=>{const{history:t}=this.props;t.push(e)},this.setRmnToSession=e=>{if(sessionStorage.ha){const t=JSON.parse(sessionStorage.ha);e.toString()[0]>6?t.rmn=e:t.rmn="",sessionStorage.ha=JSON.stringify(t)}},this.handleClickHere=()=>{(0,x.Sw)({event:"Click Here - Login"}),this.redirectToPage(`/${c.A.my_account_path}/register-user`)}}render(){const{verifyRmnForm:e,formErrorMessage:t,render:s,button:r,subMessage:i,pageData:n,backUrl:o}=this.state,{pageMetaData:l,history:c}=this.props;if(!l)return(0,v.jsx)(u.A,{});const d=[];return Object.keys(e).forEach(t=>{d.push({id:t,config:e[t]})}),(0,v.jsx)(a.Fragment,{children:s?(0,v.jsx)(a.Fragment,{children:(0,v.jsx)(A.A,{isSecure:!0,metatags:l?l.metatag:{},children:(0,v.jsxs)("div",{id:"user-auth",className:o.url.includes(j.oh)?"wyze-login":"",children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{classes:"login-back",history:c,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:n.title}),(0,v.jsx)("h2",{className:"heading2",children:n.subTitle})]}),(0,v.jsxs)("form",{onSubmit:this.validateForm,action:"javascript:void(0)",children:[(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-xs save-user-details",children:[d&&d.map(e=>(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)}),(0,v.jsxs)("span",{className:"validate invalid-text",children:[" ",t]})," "]},e.id)),i&&""!==i&&(0,v.jsx)(b.A,{className:"mT10 fs14",htmlContent:i})]})}),(0,v.jsxs)("div",{className:"footer-contr text-center",children:[(0,v.jsx)("div",{className:"footer-contr btn-contr text-center",children:(0,v.jsx)(R.A,{config:r.buttonConfig,content:r.text,onClick:()=>this.validateForm()})}),(0,v.jsxs)("p",{className:""+(o.url.includes(j.oh)?"mT20 wyze-link":"mT10"),children:["Not registered yet?"," ",(0,v.jsxs)("a",{href:"javascript:void(0)",onClick:()=>this.handleClickHere(),children:[" ","Click here"]})]})]})]})]})]})})]})})}):(0,v.jsx)(u.A,{})})}}const Le=(0,l.Ng)(e=>({pageMetaData:e.commonReducer.currentPageMetaData}),$e)(Re);var Fe=s(63651),Ue=s(92598);const Be=["hasErrors"];function He(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}const Ye={generateOtp:Fe.dv,resendOtp:Fe.Ty,closeModal:U.Oo};class Ge extends a.Component{constructor(...e){super(...e),this.state={render:!0,showSendingMessage:!0,button:{buttonConfig:{type:"button",class:"blue"},text:"Continue"},formErrorMessage:"",messageClass:"",otpRmn:"",otpForm:{validateOTP:{wrapperClasses:["form-group"],labelConfig:{label:"",classes:["sel","active"]},elementType:"input",elementConfig:{type:"tel",placeholder:"",maxLength:6,tabIndex:0,autoComplete:"off"},value:" ".repeat(6),errorMessage:"",valid:!0,touched:!1}}},this.generateOtp=async()=>{const{source:e,setOtpAlert:t}=this.props,s=JSON.parse(sessionStorage.getItem("ha"))||"",a={source:e,subscriberId:s&&s.user&&s.user.subId?s.user.subId:(0,x.Xo)().id},r=(await ke.HaGenerateOtp(a)).data;r.status===c.A.MESSAGES_TYPES.S3_SUCCESS?this.setState({render:!0,showSendingMessage:!1,otpRmn:r.data,formErrorMessage:"",messageClass:""},()=>{this.startOtpTimer(),t("resend")}):this.setState({render:!0,showSendingMessage:!1,otpRmn:"",formErrorMessage:r.message||"Oops! Something went wrong",messageClass:""})},this.startOtpTimer=()=>{let e=30;
1const t=document.querySelector("#timer_div"),s=document.querySelector(".link-contr"),a=document.querySelector(".res-otp");s.style.display="none",setInterval(()=>{0===e&&s&&a?(clearTimeout(),s.style.display="flex",a.style.display="none"):(e=e<10?`0${e}`:e,t&&(a.style.display="flex",t.innerHTML=e),e--)},1e3)},this.validateForm=async e=>{e.preventDefault();const{otpForm:t}=this.state;this.setState({render:!1});const s={};for(const e in t)s[e]=t[e].value.trim();const a=J.A.validateOTP(s),{hasErrors:r}=a,i=(0,I.A)(a,Be);if(r){const e=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?He(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):He(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},t);for(const s in t){const t=i[`${s}Message`];t&&""!==t&&(e[s].valid=!1,e[s].errorMessage=t)}this.setState({otpForm:e,formErrorMessage:i.validateOTPMessage,render:!0})}else{const{history:e,closeModal:t,pagePath:a,popUpFunction:r,params:{eventId:i,eventType:n},noModal:o,source:l}=this.props;if(!c.A.isServer()){const d=JSON.parse(sessionStorage.getItem("ha"))||"",m={otp:s.validateOTP,source:l};if(d&&d.user)m.subscriberId=d&&d.user&&d.user.subId;else if(localStorage.userAuth){const{subId:e}=JSON.parse(localStorage.userAuth);m.subscriberId=e.id}const u=await ke.HaUserPasswordLogin(m),h=u&&u.data;if(h.status===c.A.MESSAGES_TYPES.S3_SUCCESS){const s=JSON.parse(sessionStorage.getItem("ha"))||"",l=s&&s.user&&s.user.subId?s.user.subId:(0,x.Xo)().id;(0,x.Sw)({event:"Submit New","Sub ID":l||null}),(0,x.fy)(h),localStorage.setItem("token",h.data.token),r?r(i,n):a.includes(`${c.A.drupal_path}`)||a.includes(`${c.A.ha_drupal_path}`)?window.location.href=`${a}`:(e.push(a),o||t())}else this.setState({render:!0,formErrorMessage:h.message,messageClass:""})}}},this.ResendOTP=async()=>{const{source:e,setOtpAlert:t}=this.props;t("none"),this.setState({render:!1,showSendingMessage:!0});const s=JSON.parse(sessionStorage.getItem("ha")),a={source:e,subscriberId:s&&s.user&&s.user.subId?s.user.subId:(0,x.Xo)().id},r=(await ke.HaGenerateOtp(a)).data;if(r.status===c.A.MESSAGES_TYPES.S3_SUCCESS){this.setState({render:!0,formErrorMessage:"",messageClass:"classgreen",showSendingMessage:!1},()=>{this.startOtpTimer(),t("resend")});const e=JSON.parse(sessionStorage.getItem("ha"))||"",s=e&&e.user&&e.user.subId?e.user.subId:(0,x.Xo)().id;(0,x.Sw)({event:"Resend OTP New","Sub ID":s||null})}else this.setState({render:!0,formErrorMessage:r.message,messageClass:"",showSendingMessage:!1})},this.onChangeOTP=e=>{this.setState({otpForm:{validateOTP:{value:e}},formErrorMessage:""})}}componentDidMount(){(0,x.NP)("robots","noindex, nofollow"),this.generateOtp()}render(){const{otpForm:e,formErrorMessage:t,button:s,resendOtpMessage:r,validateOtpMessage:i,messageClass:n,render:o,showSendingMessage:l,otpRmn:d}=this.state,m=[];Object.keys(e).forEach(t=>{m.push({id:t,config:e[t]})});const h=!c.A.isServer()&&JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||"";(0,x.IB)(h&&h.rmn||"");return(0,v.jsx)(a.Fragment,{children:o?(0,v.jsx)("div",{className:"content-container",id:"login-password",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("div",{className:"main-container",children:(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-xs save-user-details",children:[d&&(0,v.jsxs)("span",{children:[(0,v.jsx)("b",{children:"Enter OTP sent to "})," ","+91"," ",d||""]}),m&&m.map(e=>(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)(V.A,{onChange:this.onChangeOTP,value:this.state.otpForm.validateOTP.value,valueLength:6,validateForm:this.validateForm}),(0,v.jsxs)("span",{className:`validate invalid-text ${n}`,children:[" ",t]})," "]},e.id)),l?(0,v.jsx)("span",{className:"lds-hourglass",children:" Sending"}):(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("div",{className:"link-contr field-info-wrapper mT5",children:(0,v.jsx)("p",{className:"resend-text",children:(0,v.jsx)("a",{className:"field-info show-cursor",onClick:()=>this.ResendOTP(),children:"Resend OTP"})})}),(0,v.jsxs)("div",{className:"fs12 res-otp field-info-otp mT5",style:{display:"none"},children:["Resend OTP in 00:",(0,v.jsx)("span",{id:"timer_div"})]})]}),(0,v.jsxs)("p",{className:" text-center",children:[r,i]})]})}),(0,v.jsx)("div",{className:"footer-contr text-center",id:"login-password-footer",children:(0,v.jsx)("div",{className:"footer-contr btn-contr text-center",children:(0,v.jsx)(R.A,{config:s.buttonConfig,content:s.text,onClick:e=>this.validateForm(e)})})})]})})})}):(0,v.jsx)(u.A,{})})}}const Je=(0,l.Ng)(e=>({resendOTPData:e.commonReducer.resendOTPData,otpData:e.commonReducer.otpData}),Ye)(Ge);var qe=s(71693);const Ve=["hasErrors"];function ze(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function We(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?ze(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ze(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const Xe={closeModal:U.Oo};class Ze extends a.Component{constructor(...e){super(...e),this.state={render:!0,button:{buttonConfig:{type:"submit",class:"blue"},text:"Continue"},formErrorMessage:"",verifyPasswordForm:{password:{wrapperClasses:["form-group"],labelConfig:{label:"Password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",maxLength:32,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1}}},this.captchaElement=a.createRef(),this.captchaElementPass=a.createRef(),this.inputChangedHandler=(e,t)=>{const{verifyPasswordForm:s}=this.state,a=We({},s),r=We({},a[t]),i=e;r.value=i,r.touched=!0,r.valid=!0,r.errorMessage="",a[t]=r,this.setState({verifyPasswordForm:a,formErrorMessage:""})},this.forgotPassword=async e=>{const{forgotPasswordHandler:t,source:s}=this.props;try{this.setState({render:!1});const a=JSON.parse(sessionStorage.getItem("ha")),r={captchaToken:e,source:s,subscriberId:a&&a.user&&a.user.subId?a.user.subId:(0,x.Xo)().id},i=(await ke.HaForgetPassWord(r)).data;this.setState({render:!0},()=>t(i))}catch(e){console.log("Error occuered in Forget Password",e)}},this.validateForm=e=>{e.preventDefault();const{verifyPasswordForm:t}=this.state,s={},a=Object.keys(t);a.forEach(e=>{s[e]=t[e].value});const r=J.A.validateLoginPasswordForm(s),{hasErrors:i}=r,n=(0,I.A)(r,Ve);if(i){const e=We({},t);a.forEach(t=>{const s=n[`${t}Message`];s&&""!==s&&(e[t].valid=!1,e[t].errorMessage=s)}),this.setState({verifyPasswordForm:e,formErrorMessage:""})}else this.onValidateCaptchaPass()},this.validateFromServer=async e=>
1{if(!c.A.isServer()){this.setState({render:!1});const{verifyPasswordForm:t}=this.state,s={};Object.keys(t).forEach(e=>{s[e]=t[e].value});const{history:a,closeModal:r,pagePath:i,popUpFunction:n,params:{eventId:o,eventType:l},noModal:d,source:m}=this.props,u=JSON.parse(sessionStorage.getItem("ha"))||"",h={captchaToken:e,pwd:s.password,source:m};if(u&&u.user)h.subscriberId=u&&u.user.subId;else if(localStorage.userAuth){const{subId:e}=JSON.parse(localStorage.userAuth);h.subscriberId=e.id}const p=await ke.HaUserPasswordLogin(h),g=p&&p.data;if(g&&g.status===c.A.MESSAGES_TYPES.S3_SUCCESS)(0,x.Sw)({event:"Password-Continue"}),(0,x.fy)(g),localStorage.setItem("token",g.data.token),n?n(o,l):i.includes(`${c.A.drupal_path}`)||i.includes(`${c.A.ha_drupal_path}`)?window.location.href=`${i}`:(a.push(i),d||r());else{const{data:e,message:t}=g;if(e&&!0===e.isRegisterationNeeded){const{history:e}=this.props;e.push({pathname:`/${c.A.my_account_path}/register-user`,state:{showALert:!0,displayMsg:t||""}})}else this.setState({render:!0,formErrorMessage:g.message||c.A.serverError})}}},this.onCaptchaResolved=e=>{e&&this.forgotPassword(e)},this.onCaptchaResolvedPass=e=>{e&&this.validateFromServer(e)},this.onValidateCaptcha=()=>{this.captchaElement.execute(this.captchaElementResetId)},this.onValidateCaptchaPass=()=>{this.captchaElementPass.execute(this.captchaElementPassResetId)}}render(){const{verifyPasswordForm:e,formErrorMessage:t,button:s,render:r}=this.state,{manifest:i}=this.props,n=[];return Object.keys(e).forEach(t=>{n.push({id:t,config:e[t]})}),(0,v.jsx)(a.Fragment,{children:r?(0,v.jsx)("div",{className:"content-container",id:"login-password",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("div",{className:"main-container",children:(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"body-container",children:[(0,v.jsxs)("div",{className:"innercontainer-xs save-user-details",children:[n&&n.map(e=>(0,v.jsxs)("div",{className:"form-group mT20",children:[(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)}),(0,v.jsxs)("span",{className:"validate invalid-text",children:[" ",t]})," "]},e.id)),(0,v.jsx)("a",{href:"javascript:void(0)",className:"field-info show-cursor",onClick:()=>this.onValidateCaptcha(),children:"Forgot password?"})]}),(0,v.jsx)(qe.A,{ref:this.captchaElement,id:"login-recaptcha",customClass:"customRecaptcha",getRef:e=>{this.captchaElement=e},onChange:this.onCaptchaResolved,resetId:e=>{this.captchaElementResetId=e}}),(0,v.jsx)(qe.A,{ref:this.captchaElementPass,id:"password-recaptcha",customClass:"customRecaptcha",getRef:e=>{this.captchaElementPass=e},onChange:this.onCaptchaResolvedPass,resetId:e=>{this.captchaElementPassResetId=e}})]}),(0,v.jsx)("div",{className:"footer-contr text-center",id:"login-password-footer",children:(0,v.jsx)("div",{className:"footer-contr btn-contr text-center",children:(0,v.jsx)(R.A,{config:s.buttonConfig,content:s.text,onClick:e=>this.validateForm(e)})})})]})})})}):(0,v.jsx)(u.A,{})})}}(0,l.Ng)(e=>({errorCode:e.commonReducer.errorCode,manifest:e.commonReducer.manifest}),Xe)(Ze);const Qe=["hasErrors"];function Ke(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function et(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ke(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ke(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const tt={setApiError:g.x8};class st extends a.Component{constructor(...e){super(...e),this.state={render:!1,noEmail:!1,emailSuccess:!1,pageTitle:"",subTitle:"",formErrorMessage:"",resetPwdForm:{verificationCode:{wrapperClasses:["form-group"],labelConfig:{label:"Verification code",classes:["sel","active"]},elementType:"input",elementConfig:{type:"text",placeholder:"",maxLength:4,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1},newPassword:{wrapperClasses:["form-group"],labelConfig:{label:"New password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",minLength:8,tabIndex:0,autoComplete:"new-password"},value:"",helpText:"Password must contain One Capital, One Small, One Number, One Special Character with minimum 8 characters",errorMessage:"",valid:!0,touched:!1},confirmPassword:{wrapperClasses:["form-group"],labelConfig:{label:"Confirm new password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",minLength:8,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1}},confirmButton:{buttonConfig:{type:"submit",class:"blue"}},email:null,phone:null},this.captchaElement=a.createRef(),this.componentDidMount=async()=>
1{if(!c.A.isServer()){const{setApiError:e,forgotPassData:t}=this.props;try{const e=await q.n.getPageTitle("myaccount_reset_password");if(e.data.status===c.A.MESSAGES_TYPES.S3_SUCCESS){const s=t.rmn||"",a=t.email||"";if(s&&""!==s||a&&""!==a&&"null"!==a){const t=a||"-",r=s||"-";this.setState({email:t||"",phone:r,render:!0,pageTitle:e.data.data?e.data.data.title:"",subTitle:e.data.data?e.data.data.field_sub_title:""})}else s&&""===s&&a&&(""===a||null===a)&&this.setState({noEmail:!0,render:!0})}}catch(t){e(c.A.serverError,!0)}}},this.inputChangedHandler=(e,t)=>{this.setState({formErrorMessage:""});const{resetPwdForm:s}=this.state,a=et({},s),r=et({},a[t]);let i=e;"verificationCode"===t&&(i=i.replace(/[^0-9]/g,""),i.length>4&&(i=i.slice(0,4))),"newPassword"!==t&&"confirmPassword"!==t||(i=i.replace(/\s/g,"")),r.value=i,r.touched=!0,r.valid=!0,r.errorMessage="",a[t]=r,this.setState({resetPwdForm:a})},this.validateForm=e=>{e.preventDefault();const{resetPwdForm:t}=this.state,s={};for(const e in t)s[e]=t[e].value;const a=J.A.validateResetPwdForm(s),{hasErrors:r}=a,i=(0,I.A)(a,Qe);if(r){const e=et({},t);for(const s in t){const t=i[`${s}Message`];t&&""!==t&&(e[s].valid=!1,e[s].errorMessage=t)}this.setState({resetPwdForm:e})}else this.onValidateCaptcha()},this.validateFromServer=async(e,t)=>{const{source:s}=this.props;this.setState({render:!1});try{const a=JSON.parse(sessionStorage.getItem("ha"))||"",r=a&&a.user&&a.user.subId?a.user.subId:(0,x.Xo)().id,i=et(et({},e),{},{subscriberId:r,source:s,captchaToken:t}),n=await ke.HaResetPassWord(i),o=await n.data;if(o.status===c.A.MESSAGES_TYPES.S3_SUCCESS)this.setState({render:!0,emailSuccess:!0});else{const{data:e,message:t}=o;if(e&&!0===e.isRegisterationNeeded){const{history:e}=this.props;e.push({pathname:`/${c.A.my_account_path}/register-user`,state:{showALert:!0,displayMsg:t||""}})}else this.setState({render:!0,formErrorMessage:o.message||c.A.serverError})}}catch(e){this.setState({render:!0,formErrorMessage:c.A.serverError})}},this.onCaptchaResolved=e=>{const{resetPwdForm:t}=this.state,s={};for(const e in t)s[e]=t[e].value;e&&this.validateFromServer(s,e)},this.onValidateCaptcha=()=>{this.captchaElement.execute(this.captchaElementResetId)}}render(){const{render:e,pageTitle:t,subTitle:s,resetPwdForm:r,confirmButton:i,formErrorMessage:n,noEmail:o,emailSuccess:l,email:c,phone:d}=this.state,{manifest:m}=this.props,h=[];return Object.keys(r).forEach(e=>{h.push({id:e,config:r[e]})}),o?(0,v.jsx)(a.Fragment,{children:(0,v.jsx)("div",{className:"main-container",children:(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"heading1 gradient",style:{fontSize:"32px"},children:"Your Email Id and Registered Mobile Number are not registered. Kindly contact customer support!"})})})}):l?(0,v.jsx)(a.Fragment,{children:(0,v.jsx)("div",{className:"main-container",children:(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"heading1 gradient",style:{fontSize:"40px"},children:"Your Password has been reset Successfully!"})})})}):e?(0,v.jsx)(a.Fragment,{children:(0,v.jsx)("div",{id:"static-reset-pwd",className:"reset-pwd",style:{position:"relative"},children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"heading1 gradient",children:t}),s?(0,v.jsx)("h2",{className:"heading2",children:s}):null]}),(0,v.jsxs)("ul",{className:"email-phone",children:[c?(0,v.jsxs)("li",{style:{display:"flex"},children:[(0,v.jsx)("span",{children:"Email:"})," ",(0,v.jsx)("span",{className:"reset-pwd-credential",children:c})]}):null,d?(0,v.jsxs)("li",{style:{display:"flex"},children:[(0,v.jsx)("span",{children:"Registered Mobile Number:"}),(0,v.jsx)("span",{className:"reset-pwd-credential",children:d})]}):null]}),(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),autoComplete:"off",children:[(0,v.jsx)("div",{className:"body-container",children:(0,v.jsx)("div",{className:"innercontainer-xs save-user-details",children:h&&h.map(e=>(0,v.jsx)("div",{className:"form-group",children:(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,helpText:e.config.helpText,changed:t=>this.inputChangedHandler(t,e.id)})},e.id))})}),(0,v.jsx)(qe.A,{ref:this.captchaElement,id:"login-recaptcha",customClass:"resetPwdRecaptcha",getRef:e=>{this.captchaElement=e},onChange:this.onCaptchaResolved,resetId:e=>{this.captchaElementResetId=e}}),(0,v.jsxs)("div",{className:"footer-contr text-center",id:"verify-footer",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text form-error",children:n}),(0,v.jsx)(R.A,{config:i.buttonConfig,content:"Confirm",onClick:e=>this.validateForm(e)})]})]})]})})})}):(0,v.jsx)(u.A,{})}}const at=(0,l.Ng)(e=>({manifest:e.commonReducer.manifest}),tt)(st),rt={closeModal:U.Oo,userPasswordLogin:Fe.eS,setApiError:g.x8};class it extends a.Component{constructor(...e){super(...e),this.state={render:!1,pageData:{title:null,subtitle:null},pageTitle:"",subTitle:"",isPassword:!1,isChecked:"otp",forgotPasswordMessage:"",tokenExpire:!1,receiveOtpMsg:"",forgotPassRes:"",button:{buttonConfig:{type:"button",class:"smallblue "}},backUrl:{url:"bundle",excludeHa:!1,isAnchor:!1}},this.componentDidMount=async()=>{await this.getPageMetaData();((0,x.Ht)("tokenExpired")||"")&&this.setState({tokenExpire:!0});const{history:e,location:{search:t}}=this.props,{dest:s}=(0,x.vA)(t);s&&this.getBackPath(s),!c.A.isServer()&&(0,x.wR)()&&s&&(s.includes(c.A.drupal_path)||s.includes(c.A.ha_drupal_path)?location.href=s:e.push(s))},this.getBackPath=e=>{const t={"system/tata-play-secure/buy-journey-subscription":{url:"system/tata-play-secure/buy-journey-subscription",excludeHa:!1,isAnchor:!0},"system/tata-play-secure/gethelp":{url:"system/tata-play-secure/gethelp",excludeHa:!1,isAnchor:!0},"secure/tata-play-secure/demo-installation":{url:"system/tata-play-secure/request-demo-brief",excludeHa:!1,isAnchor:!0},"system/tata-play-secure/request-demo-brief":{url:"system/tata-play-secure/request-demo-brief",excludeHa:!1,isAnchor:!0},"add-camera":{url:"my-account",excludeHa:!0,isAnchor:!1},subscription:{url:"my-account",excludeHa:!0,isAnchor:!1},relocation:{url:"system/gethelp-homeautomation",excludeHa:!1,isAnchor:!0},demo:{url:"system/demo",excludeHa:!1,isAnchor:!0},"tata-play-secure":{url:`${j.oh}/bundle`,excludeHa:!1,isAnchor:!1}};e&&Object.keys(t).some(s=>!!e.includes(s)&&(this.setState({backUrl:t[s]}),!0))},this.getPageMetaData=async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/authentication.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data.field_json,{location:{search:s}}=this.props,{dest:a}=(0,x.vA)(s);let r=t.filter(e=>"default"===e.type.toLowerCase())[0];const i=["add-camera","relocation","renew-subscription"];a&&(a.includes(`${j.oh}/demo-installation`)?r=t.filter(e=>"hualai-demo"===e.type.toLowerCase())[0]:a.includes(`${j.dY}/demo-installation`)?r=t.filter(e=>"demo"===e.type.toLowerCase())[0]:a.includes(j.dY)?r=t.filter(e=>"default"===e.type.toLowerCase())[0]:a.includes(j.oh)?r=t.filter(e=>"hualai"===e.type.toLowerCase())[0]:i.some(e=>a.includes(e))&&(r=t.filter(e=>"general"===e.type.toLowerCase())[0])),this.setState({pageData:{title:r.title,subTitle:r.subtitle},render:!0})}}catch(e){console.log("page data error",e)}},this.setOtpAlert=e=>
1{this.setState({receiveOtpMsg:"resend"===e?"OTP sent successfully":"We will be calling you shortly on your Registered Mobile Number"}),"none"===e&&this.setState({receiveOtpMsg:""})},this.handleForgotPassword=e=>{if(e.status===c.A.MESSAGES_TYPES.S3_SUCCESS)this.setState({forgotPassword:!0,forgotPassRes:e.data});else{const{data:t,message:s}=e;if(t&&!0===t.isRegisterationNeeded){const{history:e}=this.props;e.push({pathname:`/${c.A.my_account_path}/register-user`,state:{showALert:!0,displayMsg:s||""}})}else this.setState({forgotPasswordMessage:e.message})}},this.setTokenExpire=()=>{c.A.isServer()||(sessionStorage.removeItem("tokenExpired"),this.setState({tokenExpire:!1}))},this.redirectToHome=()=>{const{history:e}=this.props;c.A.isServer()||(sessionStorage.removeItem("tokenExpired"),e.push(`/${c.A.home_automation}`))}}componentWillUnmount(){(0,x.Ht)("tokenExpired")&&sessionStorage.removeItem("tokenExpired")}onChangeHandler(e){this.setState({isPassword:!this.state.isPassword,isChecked:e})}render(){const{render:e,isPassword:t,isChecked:s,forgotPassword:r,forgotPasswordMessage:i,tokenExpire:n,button:o,pageData:l,forgotPassRes:d,receiveOtpMsg:m,backUrl:p}=this.state,g=(0,x.WF)(),{history:f,location:{search:b}}=this.props,{dest:y}=(0,x.vA)(b),S=y||`/${c.A.home_automation}/${j.oh}`;return r?(0,v.jsx)("div",{className:"main-container",children:(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)(at,{source:"HA",forgotPassData:d,history:f})})}):""!==i?(0,v.jsx)("div",{className:"main-container",children:(0,v.jsx)("div",{className:"heading-md",children:i})}):n?(0,v.jsx)("div",{className:"main-container p-modal",children:(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:"Another Log in detected"}),(0,v.jsx)("h2",{className:"heading2",children:"This account has been logged in from another device. For security reasons, we have logged you out from this device."}),(0,v.jsx)("h2",{className:"heading3",children:"Log in again to continue"}),g?null:(0,v.jsxs)("div",{className:"btn-contr text-center",children:[(0,v.jsx)(R.A,{config:o.buttonConfig,content:"YES",onClick:()=>this.setTokenExpire()}),(0,v.jsx)(R.A,{config:o.buttonConfig,content:"NO",onClick:()=>this.redirectToHome()})]})]})}):(0,v.jsx)(a.Fragment,{children:e?(0,v.jsxs)(a.Fragment,{children:[m&&(0,v.jsx)(Ue.A,{receiveOtpMsg:m,isHaAuth:!0}),(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:p.url.includes(j.oh)?" content-container wyze-login wyze-auth":"content-container",id:"Authentication",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{classes:"login-back",history:f,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container ha-auth",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:l.title}),(0,v.jsx)("h2",{className:"heading2",children:l.subTitle})]}),(0,v.jsx)("div",{className:"radio-button password-otp"}),(0,v.jsx)("div",{className:"mT20",children:(0,v.jsx)(Je,{pagePath:S,history:f,params:{},setOtpAlert:this.setOtpAlert,source:"HA",noModal:!0})})]})]})})]}):(0,v.jsx)(u.A,{})})}}const nt=(0,l.Ng)(null,rt)((0,r.y)(it));var ot=s(74758),lt=s(55606),ct=s(9693),dt=s(67358);const mt=(0,l.Ng)(null,e=>({openModal:(0,F.zH)(U.qf,e)}))(e=>{const{priceData:t,qty:s,showIcon:r,infoModalText:i,source:n,infoModalTitle:o,isDrawer:l,hideStrike:c}=e,{name:d,desc:m,actualPrice:u,sellPrice:h,packUom:p}=t;return(0,v.jsxs)("section",{className:"v-start-top",children:[(0,v.jsxs)("h3",{className:"ha-heading2 mT0",children:[d,r&&(0,v.jsx)("div",{className:"custom-tooltip-parent popinfo",id:"newpopup",style:{display:"inline"},children:(0,v.jsxs)("a",{href:"javascript:void(0)",onClick:()=>(()=>{const{openModal:t}=e;t(L.lx.INFO_MODAL_COMMON,l?{data:{title:o,body:i},parentClass:"new-summary wyze-subs-desc",backDropClass:"bottom-sheet"}:{data:{title:o,body:i}})})(),children:[" ",(0,v.jsx)("img",{src:"/assets/images/info-icon.svg",className:"information-icon ",alt:""})]})}),m&&"Annual"===p||"Annual"===p?(0,v.jsx)("span",{className:(n?"fs12 ":"")+"label-text d-block mB0",children:"Annual Subscription"}):m&&"Monthly"===p||"Monthly"===p?(0,v.jsx)("span",{className:(n?"fs12 ":"")+"label-text d-block mB0",children:"Monthly Subscription"}):(0,v.jsx)("span",{className:(n?"fs12 ":"")+"label-text d-block mB0",children:`${m}${s&&!n||"wyze"===n?`-Qty. ${s}`:""}`})]}),!n&&(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsxs)("div",{className:"price",children:[u&&u!==h&&(0,v.jsxs)("div",{className:"label cutprice",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"annual-sub-cut-price",children:u})]}),(0,v.jsx)("div",{className:"label",children:(0,v.jsx)("span",{className:"annual-sub-price",children:"FREE"!==h?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"bold",children:h}),(0,v.jsx)("span",{className:"small",children:"Monthly"===p?"/month":null})]}):(0,v.jsx)("span",{className:"bold",style:{color:"#009e35"},children:h})})})]}
1),"Monthly"===p&&(0,v.jsx)("span",{children:(0,v.jsx)("div",{className:"mT5 offer-text",style:{color:"#009e35"},children:m})})]}),"google-add-cam-subs"===n&&(0,v.jsxs)("div",{children:[c&&(0,v.jsx)("p",{style:{margin:"0px",fontSize:"14px"},children:"Upgrade at just"}),(0,v.jsxs)("span",{className:"payment-left-amount",style:{float:"right"},children:[u&&u!==h&&!c&&(0,v.jsxs)("span",{className:"price-xs stroke old-price fs12 mR5",children:[(0,v.jsx)("span",{className:"rupee",children:" â¹ "}),u]}),"FREE"!==h?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"bold",children:h}),(0,v.jsx)("span",{className:"small",children:"Monthly"===p?"/month":null})]}):(0,v.jsx)("span",{className:"free-text",children:h})]})]}),"wyze"===n&&(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"payment-left-amount",children:0!==h?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),h]}):h})}),"wyze-sub"===n&&(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsx)("div",{className:"price",children:(0,v.jsx)("div",{className:"label",children:(0,v.jsxs)("span",{className:"annual-sub-price",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"bold",children:u}),(0,v.jsx)("span",{className:"small",children:"annual"===p.toLowerCase()?"/year":null})]})})}),(0,v.jsx)("span",{children:(0,v.jsx)("div",{className:"mT5 offer-text",style:{color:"#009e35"},children:m})})]}),"wyze-sub-add"===n&&(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsx)("div",{className:"price",children:h>0&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("div",{className:"label",children:(0,v.jsxs)("span",{className:"annual-sub-price",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"bold",children:h}),(0,v.jsx)("span",{className:"small",children:"annual"===p.toLowerCase()?"/year":null})]})}),(0,v.jsx)("br",{})]})}),(0,v.jsx)("span",{children:(0,v.jsx)("div",{className:"mT5 offer-text",style:{color:"#009e35"},children:"including 2 months FREE"})})]})]})});class ut extends a.Component{constructor(...e){super(...e),this.state={render:!0,productsData:null,subscriptions:[],address:[],transactionAmount:null,formErrorMessage:null,pageData:null,isMsales:null,isHaTPFiber:null},this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/payment-summary-google.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS&&t.status===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,subtitle:e.field_subtitle,fieldData:e.field_json};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.handleMSalesModal=()=>{const{openModal:e,history:t}=this.props,{pageData:s}=this.state;e(L.lx.HA_MSALES_PIN_MODAL,{modalId:"ha-secure-paymentsummary-pin",source:"ha_plus",title:s.fieldData.evd_title,history:t,closePopup:!0})},this.payNowHandler=async()=>{this.gaPayNowEvent();const{orderUuid:e}=(0,he.u6)("ha_plus"),{history:t,setStepAndUuidForPayment:s,updateS3Data:a}=this.props,{isMsales:r}=this.state;if(r)this.handleMSalesModal();else try{const{data:r}=await f.n.postData(`payment/authPayment/${e}`,{});if(!0===r.status){const{uuid:e}=r.data;a("isCOD",!1),s(e),localStorage.setItem("SOURCE",c.A.sourcetype.HA),t.push("/secure/home")}else this.setState({render:!0,formErrorMessage:r.message||c.A.serverError})}catch(e){this.setState({render:!0,formErrorMessage:c.A.serverError})}},this.gaPayNowEvent=()=>{const{productsData:e,subscriptions:t,transactionAmount:s}=this.state,a=(0,he.u6)("ha_plus");(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"checkout",ecommerce:{checkout:{actionField:{step:3,option:"Order Summary"},products:[{name:"Tata Play Secure Plus",id:a.productData.addedsubscriptionData[0].id,price:s,brand:"Tata Play",category:"Home Automation",variant:"Google",quantity:e.camera[0].count,productName:`${e.camera[0].name||""},\n ${e.hub[0].name||""},\n ${t[0].description||""}`}]}}})}
1,this.getSummaryData=async()=>{const{orderUuid:e}=(0,he.u6)("ha_plus")||{},{history:t,setApiError:s}=this.props;try{const{data:a}=await f.n.getData(`package/getSummaryByUuid/${e}`);if(a.message===c.A.MESSAGES_TYPES.SUCCESS){if(a.data.page&&"bundle"===a.data.page.toLowerCase())return void t.push(`/${c.A.home_automation}/${j.dY}/bundle`);const e=a.data.products.filter(e=>e.type&&"camera"===e.type.toLowerCase()),s=a.data.products.filter(e=>e.type&&"home mini"===e.type.toLowerCase());this.setState({productsData:{camera:e,hub:s},subscriptions:[...a.data.subscriptions],address:[...a.data.addresses],transactionAmount:a.data.transactionAmount})}else{if(a.message===j.qO){const e=(0,he.u6)("ha_plus");return e.mismatch=!0,(0,he.e)("ha_plus",e),void t.push(`/${c.A.home_automation}/${j.dY}/bundle`)}s(c.A.serverError,!0)}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}}}componentDidMount(){const e=(0,he.u6)("ha_plus"),{history:t}=this.props,s=(0,x.Bd)(),a=(0,x.jv)();if(s&&this.setState({isMsales:s}),a&&this.setState({isHaTPFiber:a}),!e)return void t.push(`/${c.A.home_automation}/${j.dY}/bundle`);const{journey:r,orderUuid:i}=e;i?(this.getPageData(),"Hualai"===r&&e.orderType&&"ADD_CAM"===e.orderType?t.push(`/${c.A.home_automation}/${j.oh}/add-camera-payment-summary`):"Hualai"!==r||e.orderType&&"ADD_CAM"===e.orderType?this.getSummaryData():t.push(`/${c.A.home_automation}/${j.oh}/payment-summary`)):t.push(`/${c.A.home_automation}/${j.dY}/bundle`)}render(){const{render:e,address:t,productsData:s,subscriptions:r,transactionAmount:i,formErrorMessage:n,pageData:o,isMsales:l,isHaTPFiber:c}=this.state;if(!(s&&t.length>0&&r.length>0&&i))return(0,v.jsx)(u.A,{});let d={},m={},p=0;s.camera&&Array.isArray(s.camera)&&s.camera.length>0&&(d={name:s.camera[0].name||"",desc:"null"!==s.camera[0].description?s.camera[0].description:null,actualPrice:0!==s.camera[0].actualPrice?s.camera[0].actualPrice:null,sellPrice:0!==s.camera[0].sellingPrice?s.camera[0].sellingPrice:"FREE",count:s.camera[0].count},p+=s.camera[0].actualPrice),s.hub&&Array.isArray(s.hub)&&s.hub.length>0&&(m={name:s.hub[0].name||"",desc:"null"!==s.hub[0].description?s.hub[0].description:null,actualPrice:0!==s.hub[0].actualPrice?s.hub[0].actualPrice:null,sellPrice:0!==s.hub[0].sellingPrice?s.hub[0].sellingPrice:"FREE",count:s.hub[0].count},p+=s.hub[0].actualPrice);const g=[];r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{g.push({name:e.friendlyName||"",desc:"null"!==e.description?e.description:null,actualPrice:e.actualPrice,packUom:e.packUom,sellPrice:0!==e.sellingPrice?e.sellingPrice:"FREE"}),p+=e.actualPrice});const f=p-i,x=i,{history:b}=this.props;return(0,v.jsxs)(a.Fragment,{children:[!e&&(0,v.jsx)(u.A,{}),(0,v.jsx)("div",{className:"payment-summary-page inner-page",children:(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1})}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert inner-page",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:l||c?j.CB.HA_ADD_CAM_SUBSCRIPTION:j.CB.HA_SUBSCRIPTION,activeStepper:"3"}),(0,v.jsx)(G,{classes:"",history:b,destination:`${j.dY}/order-address`}),(0,v.jsxs)("div",{className:"main-container",children:[o&&(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:o.title}),(0,v.jsx)("h2",{className:"ha-heading2",children:o.subtitle})]}),(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-sm-xs summary summary-page posR",children:[(0,v.jsxs)(ot.A,{children:[(0,v.jsxs)(lt.A,{children:[(0,v.jsx)(mt,{priceData:d,qty:d.count}),g.length>0&&g.map((e,t)=>(0,v.jsx)(mt,{priceData:e})),(0,v.jsx)(mt,{priceData:m,qty:m.count})]}),(0,v.jsxs)(ct.A,{className:"card-footer",children:[(0,v.jsxs)("h2",{className:"ha-heading2 bold total-heading",children:[o&&o.fieldData.amt,(0,v.jsx)("span",{className:"d-block mB0 small",children:o&&o.fieldData.amt_text})]}),(0,v.jsxs)("span",{className:"mB0 text-right",children:[(0,v.jsxs)("span",{className:"price-lg mR0",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"count",children:(0,he.Px)(x)||"00"})]}),(0,v.jsxs)("span",{className:"gradient gradient-text",children:["Benefits worth ",(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,he.Px)(f)||"00"]})]})]})]}),t.length>0&&(0,v.jsxs)("div",{className:"form-group field dateContr mT20",children:[(0,v.jsx)("label",{className:"sel",children:o&&o.fieldData.addr_title}),(0,v.jsx)("div",{className:"add-text",children:(0,he.FR)(t[0])}),(0,v.jsx)("span",{className:"validate",children:" "})," "]}),o&&o.fieldData.note&&(0,v.jsxs)("p",{className:"mT20 fs14",children:[(0,v.jsxs)("span",{className:"bold",children:[o.fieldData.note,":"," "]}),o&&o.fieldData.note_text]}),(0,v.jsxs)("div",{className:"fixed-btn cart-wrapper mT20 show text-center",children:[(0,v.jsx)("div",{className:"heading3 invalid-text text-center",children:n}),(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",style:{display:"inline-flex;"},href:"javascript:void(0)",onClick:()=>this.payNowHandler(),children:o&&o.fieldData.button_text})]})]})})]})]})})]})}}const ht={setStepAndUuidForPayment:dt.Cn,updateS3Data:dt.WX,setApiError:g.x8,openModal:U.qf},pt=(0,l.Ng)(null,ht)(ut);var gt=s(48016);
1const ft=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),setPaymentAwaitedData:(0,F.zH)(dt.Qm,e)}))(e=>{const[t,s]=(0,a.useState)(!1),[r,i]=(0,a.useState)(""),[n,o]=(0,a.useState)(1),[d,p]=(0,a.useState)(null),[b,y]=(0,a.useState)(null),S=(0,l.wA)(),[A,N]=(0,a.useState)(null),{history:C,match:{params:{encSubId:w}}}=e;let _;w||(_=(0,he.u6)("ha_plus"));const E=!1,T=()=>{""!==r&&clearInterval(r)},D=async()=>{const t=setInterval((async()=>{const{setPaymentAwaitedData:t}=e;try{let e;o(n+1);let a={INPROGRESS:"payment-awaited",FAIL:"payment-failure",INITIATE:"bundle"};if(_.orderType&&"ADD_CAM"===_.orderType){const{addCameraSession:{orderUuid:t}}=_;a={INPROGRESS:"payment-awaited",FAIL:"payment-failure",INITIATE:"add-camera"},e=t}else e=_.orderUuid;const{data:r}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${e}`);if(r.message===c.A.MESSAGES_TYPES.SUCCESS){const e=r.data;if(!e&&!Object.isArray(e)&&e.length<=0)return void(0,g.x8)(c.A.serverError,!0);const t=e[0].paymentStatus;t||S((0,g.x8)(c.A.serverError,!0)),"INPROGRESS"===t?C.push(`/${c.A.home_automation}/${j.dY}/${a.INPROGRESS}`):"FAIL"===t?(T(),C.push(`/${c.A.home_automation}/${j.dY}/${a.FAIL}`)):"INITIATE"===t?(T(),C.push(`/${c.A.home_automation}/${j.dY}/${a.INITIATE}`)):(T(),N(e[0]),s(!0),(0,gt.A)(),k(e[0]),_.orderType&&"ADD_CAM"===_.orderType?(0,he.VJ)(j.QZ.SUCCESS,"ADD_CAM","ha_plus"):(0,he.VJ)(j.QZ.SUCCESS,"HA","ha_plus"))}else S((0,g.x8)(c.A.serverError,!0));3===n&&(T(),t(r.data[0]))}catch(e){console.log(e,"err"),S((0,g.x8)(c.A.serverError,!0))}})(),2e3);i(t)},O=e=>{const t=(0,he.u6)("ha_plus");t.orderType=null,(0,he.e)("ha_plus",t),C.push(`/${c.A.home_automation}/${j.dY}/${e}`)};(0,a.useEffect)(()=>{(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/payment-success-google.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS&&e.status===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,s={title:t.title,subtitle:t.field_subtitle,fieldData:t.field_json,fieldImgs:t.field_images};p(s)}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}})(),w?s(!0):D();const e=(0,x.Bd)(),t=(0,x.jv)();return(e||t)&&y(!0),()=>{T()}},[]);const k=e=>{const t=(0,he.u6)("ha_plus");(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"ADD_CAM"===t.orderType?"HA-Secure Plus -Add Camera":"HA-Secure Plus -Buy Journey",transactionID:e.haId,PaymentType:e.paymentMethod,event:"purchaseSuccess",ecommerce:{purchase:{actionField:{id:e.haId,affiliation:" ",revenue:e.discountPrice,tax:"",shipping:"",coupon:""},products:[{name:e.name,id:"ADD_CAM"===t.orderType?t.addCameraSession.gaInfo.id:t.gaInfo.id,price:"ADD_CAM"===t.orderType?t.addCameraSession.gaInfo.price:t.gaInfo.price,brand:"Tata Play",category:"Home Automation",variant:"Google",quantity:"ADD_CAM"===t.orderType?t.addCameraSession.camCount:t.cartCount,productName:e.name,coupon:""}]}}})};if(!t)return(0,v.jsx)(u.A,{});const P=m()(_,"infoForm.subId",""),{orderType:I}=_;return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container google-linking order-detail gs-alert bottompadd",children:(0,v.jsxs)("div",{className:"container",children:[!w&&!I&&(0,v.jsx)(Ae.A,{isSticky:E,stepperList:b?j.CB.HA_ADD_CAM_SUBSCRIPTION:j.CB.HA_SUBSCRIPTION,activeStepper:"3"}),I&&"ADD_CAM"===I&&(0,v.jsx)(Ae.A,{isSticky:E,stepperList:j.CB.HA_ADD_CAM_SUBSCRIPTION,activeStepper:"3"}),(0,v.jsxs)("div",{className:"main-container",children:[!w&&(0,v.jsx)(a.Fragment,{children:d&&(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:"SUCCESS"===A.paymentStatus?d.title:"Your Payment is in Progress"}),!I&&(0,v.jsx)("h2",{className:"ha-heading2",children:d.subtitle})]})}),(0,v.jsxs)("div",{className:"body-container innercontainer-xs text-center pB0",children:[A&&A.haId&&d&&(0,v.jsx)("div",{className:"id-text mB20",children:`${d.fieldData.order_text} ${A.haId}`}),A&&"SUCCESS"===A.paymentStatus&&d&&(0,v.jsxs)(a.Fragment,{children:[!I&&!b&&(0,v.jsxs)("div",{className:"linked-acc-contr",children:[(0,v.jsxs)("div",{className:"smart-alert",children:[(0,v.jsx)("div",{className:"bold steps-title",children:"Next Steps"}),d&&d.fieldData&&d.fieldData.acc_link_text&&(0,v.jsxs)("ul",{className:"numbering",children:[d.fieldData.acc_link_text.text_1&&(0,v.jsx)("li",{children:d.fieldData.acc_link_text.text_1}),d.fieldData.acc_link_text.text_2&&(0,v.jsx)("li",{children:d.fieldData.acc_link_text.text_2})]})]}),d.fieldImgs.map((e,t)=>(0,v.jsx)("div",{className:"tata-sky-logo",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+e.url,alt:"",title:"",height:"30"})},t)),!I&&!b&&(0,v.jsx)("a",{className:"btn btn-primary btn-lg waves-effect waves-light mT20 linking-button",href:`/${c.A.home_automation}/user/linkAccount/${w||("object"==typeof P?P.id:P)}`,children:d&&d.fieldData.button_text})]}),!I&&!b&&d&&d.fieldData&&d.fieldData.disclaimer&&(0,v.jsx)("p",{class:"small mT20",children:d.fieldData.disclaimer}),b&&(0,v.jsx)("div",{className:"text-center mT32 block",children:(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light",href:"javascript:void(0)",onClick:()=>O("schedule-installation"),children:"Schedule Installation"})}),I&&"ADD_CAM"===I&&!b&&(0,v.jsx)("div",{className:"text-center mT32 block",children:(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light",href:"javascript:void(0)",onClick:()=>O("add-camera-schedule-installation"),children:"Schedule Installation"})})]})]})]})]})})]})});class xt extends a.Component{constructor(e){super(e),this.redirectToDestination=()=>{const{history:e}=this.props;e.push(`/${c.A.home_automation}/${j.dY}/schedule-installation`)},this.state={render:!0}}componentDidMount(){const e=(0,he.u6)("ha_plus"),{history:t}=this.props;e||t.push(`/${c.A.home_automation}/${j.dY}`),e.orderType=null,(0,he.e)("ha_plus",e)}render(){const{render:e}=this.state,{isLoading:t,history:s}=this.props,r=(0,he.u6)("ha_plus"),i=m()(r,"isSms",!1);return(0,v.jsxs)(a.Fragment,{children:[(!e||t)&&(0,v.jsx)(PreLoader,{}),(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[!i&&(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_SUBSCRIPTION,activeStepper:"4"}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:"Your accounts are linked successfully"})}),(0,v.jsxs)("div",{className:"body-container text-center pB0",children:[(0,v.jsx)("div",{className:"tata-sky-logo",children:(0,v.jsx)("img",{src:"/assets/images/home-automation/link-tatasky-logo.png",alt:"",title:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"link-img",children:(0,v.jsx)("img",{src:"/assets/images/home-automation/link-icon.png",alt:"",title:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"google-img mB20",children:(0,v.jsx)("img",{src:"/assets/images/home-automation/google-logo.png",alt:"",title:"",className:"img-fluid"})}),!i&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("div",{className:"smart-alert",children:"We can now schedule the installation of your Battery-powered Google Nest Cam"}),(0,v.jsx)("div",{className:"footer-contr text-center block mT32",children:(0,v.jsx)("button",{className:"btn btn-primary btn-lg waves-effect waves-light",onClick:()=>this.redirectToDestination(),children:"Schedule Installation"})})]})]})]})]})})]})}}const bt=xt;var vt=s(59386),yt=s.n(vt);s(43924);const St={setApiError:g.x8},jt=(0,l.Ng)(null,St)(e=>{const{source:t}=e,s=t||"Demo",[r,i]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(async()=>{const{setApiError:t}=e;try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/safety-block.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t={img:e.data.field_image,text:"Demo"===s?e.data.field_json.text_demo:e.data.field_json.text_installation};i(t)}else t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}})()},[]),(0,v.jsxs)("div",{className:"certified-wrapp newcertifi-blk",children:[" ",r&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("span",{children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+r.img.url,alt:r.img.alt,className:"img-fluid"})}),r.text]})]})});function At(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Nt(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?At(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):At(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Ct extends a.Component{constructor(...e){super(...e),this.state={render:!0,startDate:null,startTime:ne()((new Date).getTime()),slotTime:{wrapperClasses:["form-group","custom-Select-Arrow","slot-field"],labelConfig:{label:"Time",classes:["sel","active"]},elementType:"customSelect",elementConfig:{options:[],placeholder:"Select time",maxLength:null,tabIndex:0,readonly:"readonly"},value:null,errorMessage:null,valid:!0,touched:!1},slotList:null,teamId:null,taskId:null,address:null,allowedDays:2,disableSubmit:!1,isMsales:null},this.checkIfAlreadyScheduled=async()=>{const{setApiError:e}=this.props,t=(0,he.u6)("ha_plus");if(t)if(t.orderUuid){const s={orderUuid:t.orderUuid,slotStartDate:ne()().format("DD-MM-YYYY")};try{const{data:t}=await f.n.postData("order/workorder/checkAlreadyScheduled",s);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const{data:e}=t,{alreadyScheduled:s,paymentDone:a}=e;s&&this.redirectToDestination("booking-success"),a||this.redirectToDestination("payment-summary")}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}else e(c.A.serverError,!0);else e(c.A.serverError,!0)},this.redirectToDestination=e=>{const{history:t}=this.props;t.push(`/${c.A.home_automation}/${j.dY}/${e}`)},this.createAddress=()=>{const{infoForm:e}=(0,he.u6)("ha_plus"),t=e.building&&(""!==e.building?`${e.building}, `:""),s=e.address&&(""!==e.address?`${e.address}, `:""),a=e.addressline2&&(""!==e.addressline2?`${e.addressline2}, `:""),r=e.city&&(""!==e.city?`${e.city}, `:""),i=e.state&&(""!==e.state?`${e.state}-`:""),n=e.areaPincode&&(""!==e.areaPincode?`${e.areaPincode}`:""),o=`${t}${s}${a}${e.landmark&&(""!==e.landmark?`${e.landmark}, `:"")}${e.location&&(""!==e.location?`${e.location}, `:"")}${r}${i}${n}`;this.setState({address:o})},this.handleDateChange=e=>{const{slotTime:t}=this.state,s=t;s.value=null,this.setState({startDate:e,render:!1,disableSubmit:!1,slotTime:s},()=>this.getSlots())},this.getSlots=async e=>{const{startDate:t,slotTime:s}=this.state,{orderUuid:a}=(0,he.u6)("ha_plus"),r=e?new Date:t,i={orderUuid:a,slotStartDate:ne()(r).format("DD-MM-YYYY"),provider:"Google"};try{const{data:t}=await f.n.postData("order/get-slots/",i);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const a=[],{slotSuggestions:r,ocsFlag:i}=t.data;let n=0;if("N"===i||""===i?n=2:"Y"===i&&(n=29),e)this.setState({allowedDays:n,render:!0});else{r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{const t=ne()(e.start).format("LT"),s=ne()(e.end).format("LT");a.push({label:`${t} - ${s}`,value:`${ne()(e.start).format("HH:mm:ss")}-${ne()(e.end).format("HH:mm:ss")}`})});const e=Nt({},s);e.elementConfig.options=a,e.errorMessage="",e.valid=!0,this.setState({slotList:a,slotTime:e,teamId:t.data.teamId,taskId:t.data.taskId,allowedDays:n,render:!0})}}else{let a=2;if(t.data){const{ocsFlag:e}=t.data;"N"===e||""===e?a=2:"Y"===e&&(a=29)}if(e)this.setState({allowedDays:a,render:!0});else{const e=Nt({},s);e.elementConfig.options=[],e.value=null,e.errorMessage="No slots available! Please select another date.",e.valid=!1,this.setState({slotList:null,slotTime:e,teamId:null,taskId:null,allowedDays:a,render:!0})}}}catch(e){const{setApiError:t}=this.props;e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.handleTimeChange=e=>{const{slotTime:t}=Nt({},this.state),s=Nt({},t);s.value=e,s.touched=!0,s.valid=!0,s.errorMessage=null,this.setState({slotTime:s,formError:""})},this.handleSubmit=async()=>{this.setState({render:!1,disableSubmit:!0});const{slotTime:e,teamId:t,taskId:s,startDate:a}=this.state,{history:r}=this.props;if(null===e.value){const t=Nt({},e);return t.valid=!1,t.errorMessage="Please select a slot.",void this.setState({slotTime:t,formError:"",render:!0,disableSubmit:!1})}const{orderUuid:i}=(0,he.u6)("ha_plus"),n=ne()(a).format("DD-MM-YYYY"),o={teamId:t,taskId:s,orderUuid:i,slot:{start:`${n} ${e.value.split("-")[0]}`,end:`${n} ${e.value.split("-")[1]}`}};try{const{data:e}=await f.n.postData("order/confirm-slots/",o);!0===e.status&&e.message===c.A.MESSAGES_TYPES.SUCCESS?r.push(`/${c.A.home_automation}/${j.dY}/booking-success`):!0===e.status&&"FAILURE"===e.message?r.push(`/${c.A.home_automation}/${j.dY}/booking-failure`):(0,g.x8)(c.A.serverError,!0)}catch(e){const{setApiError:t}=this.props;e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.handleDateChangeRaw=e=>{e.preventDefault()}}componentDidMount(){const e=(0,x.Bd)(),t=(0,x.jv)();(e||t)&&this.setState({isMsales:!0}
1),this.checkIfAlreadyScheduled(),this.getSlots(!0),this.createAddress()}render(){const{startDate:e,slotTime:t,address:s,allowedDays:r,disableSubmit:i,render:n,isMsales:o}=this.state;if(!s||!n)return(0,v.jsx)(u.A,{});const{history:l}=this.props;return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container schedul-install bottompadd gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:o?j.CB.HA_ADD_CAM_SUBSCRIPTION:j.CB.HA_SUBSCRIPTION,activeStepper:o?"4":"5"}),!o&&(0,v.jsx)(G,{classes:"",history:l,destination:`${j.dY}/user/account-link-success`}),(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:"Almost done!"}),(0,v.jsx)("h2",{className:"ha-heading2",children:"Pick a date and time for our technician to visit you for installation"})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-xs pB0",children:[(0,v.jsxs)("div",{className:"fullwidth mT30 text-left",children:[(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Date"}),(0,v.jsx)(yt(),{dateFormat:"DD MMMM YYYY",selected:e,placeholderText:"Select date",onChange:e=>this.handleDateChange(e),minDate:ne()(),maxDate:ne()().add(r,"days"),onChangeRaw:e=>this.handleDateChangeRaw(e)}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsx)("div",{className:"form-group field-time",children:(0,v.jsx)($.A,{labelConfig:t.labelConfig,elementType:t.elementType,elementConfig:t.elementConfig,value:t.value,valid:t.valid,errorMessage:t.errorMessage,touched:t.touched,wrapperClasses:t.wrapperClasses,changed:e=>this.handleTimeChange(e)},"slot")}),(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Address"}),(0,v.jsx)("div",{className:"add-text",children:s}),(0,v.jsx)("span",{className:"validate",children:"Â "})]})]}),(0,v.jsx)("div",{className:"wyze-wrap",children:(0,v.jsx)(jt,{source:"Installation"})}),(0,v.jsxs)("p",{className:"mT20 fs14 bottom-text",children:[(0,v.jsx)("span",{className:"bold",children:"Note: "}),"All required electricals (e.g., wiring, switches, points) at installation site must be arranged for by the customer. Our technicians cannot provide the same."]}),(0,v.jsx)("div",{className:"footer-contr fixed-btn text-center block mT32",children:(0,v.jsx)("button",{type:"button",className:"btn btn-primary btn-lg waves-effect waves-light btn-resfull",onClick:()=>this.handleSubmit(),disabled:i,children:"Confirm"})})]})]})]})})]})}}const wt=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(Ct);s(11465);const _t=e=>{const{bannerUrl:t,body:s,bannerResUrl:a,btnText:r,knowMoreTxt:i,title:n,history:o,classes:l,knowMoreUrl:d,btnUrl:m,journey:u}=e,h=d||`${j.dY}/next-gen-camera`,p=m||`${j.dY}/bundle`,g=(e,t=null)=>{t&&((0,x.Sw)({event:"ctaClick",clickText:t.clickText,featureName:t.featureName,"Sub ID":(0,x.Xo)().id||null,pageSection:"A"}),t.bundle&&(0,x.Sw)({clickText:t.clickText,"Sub ID":(0,x.Xo)().id||null,pageSection:"A","Type of Journey":`${t.journeyType} -Buy Journey`,event:"productClick",ecommerce:{click:{actionField:"",products:[{name:t.featureName,id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:t.variant,position:1}]}}})),o.push(`/${c.A.home_automation}/${e}`)};return(0,v.jsxs)("div",{className:(l?`${l} `:"")+"hero-banner-static unique-banner service2 gs-alertbanner",children:[(0,v.jsx)("div",{className:"hero-image",style:{backgroundImage:`url(${c.A.NODE_API_ROOT+t})`,zIndex:-9}}),(0,v.jsx)("div",{className:"google-camera hero-text",children:(0,v.jsxs)("div",{className:"contr",children:[(0,v.jsxs)("div",{className:"heading-md ",style:{marginBottom:"18px"},children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:n}),(0,v.jsx)(b.A,{Tag:"h2",className:"ha-heading2",htmlContent:s})]}),(0,v.jsx)("div",{className:"responsive",children:(0,v.jsx)("img",{src:a,className:"img-fluid informative-image"})}),(0,v.jsxs)("div",{className:"banner-btnwrapp",children:[(0,v.jsx)("div",{className:"banner-btn mR10",children:(0,v.jsx)("a",{className:""+("Google"===u?"btn btn-primary waves-effect waves-light btn-block ha-btn":"btn42 btn-primary waves-effect waves-light"),onClick:()=>g(p,{clickText:r,featureName:"Google"===u?"Tata Play Secure Plus":"Tata Play Secure",journeyType:"Google"===u?"HA-Secure Plus":"HA-Secure",variant:"Google"===u?"Google":"Hualai",bundle:!0}),href:"javascript:void(0)",children:r})}),(0,v.jsx)("div",{className:"banner-link",children:(0,v.jsx)("a",{className:"mT20 linktext2",href:"javascript:void(0)",onClick:()=>g(h,{clickText:i,featureName:"Google"===u?"Google Next Gen Camera":"Hualai Camera",journeyType:"Google"===u?"HA-Secure Plus":"HA-Secure",variant:"Google"===u?"Google":"Hualai",bundle:!1}),children:i})})]})]})})]})},Et=e=>{const{title:t,vidData:s,imgData:a,body:r,anchorTxt:i,showVideoModal:n,anchorUrl:o}=e,l=o||"system/tata-play-secure-plus/smart-alert",d=!c.A.isServer()&&(0,x.Xb)();return(0,v.jsxs)("div",{className:"lead-section unique-lrcom1 lll",children:[d&&(0,v.jsx)("div",{className:"heading-sm text-center mB10 checkplan-restext",children:(0,v.jsx)("h2",{className:"gradient ha-heading1 text-left",children:t})}),(0,v.jsxs)("div",{className:"panel panel-img ",children:[s&&""!==s[0].uri&&(0,v.jsx)("div",{className:"secure-video-placeholder",children:(0,v.jsx)("iframe",{width:"100%",height:"300px",src:s[0].uri})}),s&&""===s[0].uri&&(0,v.jsx)("img",{src:a&&c.A.NODE_API_ROOT+a.url,alt:a&&a.alt,className:"img-fluid imgwidth"})]}),(0,v.jsxs)("div",{className:"panel panel-text ",children:[(0,v.jsx)("div",{className:"heading-sm mB10 checkplan-desktext",children:(0,v.jsx)("h2",{className:"gradient ha-heading1 text-left",children:t})}),(0,v.jsx)(b.A,{htmlContent:r}),(0,v.jsx)("div",{className:"mT20",children:(0,v.jsx)("a",{className:"linktext2",onClick:()=>{return e={clickText:i,featureName:t},(0,x.Sw)({event:"ctaClick",clickText:e.clickText,featureName:e.featureName,"Sub ID":(0,x.Xo)().id||null,pageSection:"B"}),void(window.location.href=`/${c.A.home_automation}/${l}`);var e},href:"javascript:void(0)",children:i})})]})]})},Tt=e=>{const{title:t,imgUrl:s,plan:a,anchorTxt:r,handleModal:i,modalData:n}=e;return(0,v.jsx)("div",{className:"col-md-4 col-sm-12 why-dth-offers planblk",children:(0,v.jsx)("div",{className:"card h-100-percent",children:(0,v.jsxs)("div",{className:"card-body subscri-body",children:[(0,v.jsx)("div",{className:"subscrip-img",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+s,className:"be-serv-img decorative-image",alt:""})}),(0,v.jsxs)("div",{className:"subscrip-text",children:[(0,v.jsx)(b.A,{Tag:"p",className:"bold d-block",htmlContent:t}),(0,v.jsx)(b.A,{Tag:"p",className:"mB0 ben-servtext",htmlContent:a}),r&&n&&(0,v.jsx)("div",{className:"showmor-blk",children:(0,v.jsx)("a",{href:"javascript:void(0)",className:"linktext2 mT10 viewmore",onClick:()=>i(n.title,n.body,{clickText:r,featureName:n.title}),children:r})})]})]})})})};function Dt(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}class Ot extends a.Component{constructor(...e){super(...e),this.state={pageData:null,isMsales:null,isOTT:null,isToggle:!1,collapse:""},this.handleCampaignUpdate=async()=>{const{setApiError:e}=this.props,{salesLeadParams:t}=(0,he.u6)("ha_plus");if(t)try{const{data:e}=await f.n.postData("package/campaignRecord/update",{campaignId:t.campaignId,plan:t.plan})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getPageData=async()=>{await(0,T.bk)(`${j.dV}/s3-api/v1/assets/pages/homepage.json`,{},!0)},this.redirectToDestination=e=>{const{pageMetaData:t}=this.props;(0,x.Sw)({clickText:t.field_json&&t.field_json.button_text||"","Sub ID":(0,x.Xo)().id||null,pageSection:"","Type of Journey":"HA-Secure Plus -Buy Journey ",event:"productClick",ecommerce:{click:{actionField:"",products:[{name:"\tTata Play Secure Plus",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Google",position:1}]}}}),(0,x.Sw)({event:"ctaClick",clickText:t.field_json&&t.field_json.button_text||"",featureName:"Tata Play Secure Plus","Sub ID":(0,x.Xo)().id||null,pageSection:""});const{history:s}=this.props;s.push(`/${c.A.home_automation}/${j.dY}/${e}`)},this.showVideoModal=(e,t)=>{e.preventDefault();const{openModal:s}=this.props;s(L.lx.HA_VIDEO_MODAL,{data:t,showVideoPopup:!0,parentClass:"wyze-vid-modal",backDropClass:"wyze-vid-backdrop",closePopup:!0})},this.handleModal=(e,t,s=null)=>{const{openModal:a}=this.props;if(s)try{(0,x.Sw)({event:"ctaClick",clickText:s.clickText,featureName:s.featureName,"Sub ID":(0,x.Xo)().id||null,pageSection:"D"})}catch(e){}a(L.lx.HA_COMMON_MODAL,{parentClass:"wyze-modal",backDropClass:"faded-backdrop",data:{title:e,body:t},closePopup:!0})},this.handleRedirectExtUrl=(e,t=null)=>{if(t)try{(0,x.Sw)({event:"ctaClick",clickText:t.clickText,featureName:t.featureName,"Sub ID":(0,x.Xo)().id||null,pageSection:"C"})}catch(e){}(0,x.Fc)(e)},this.toggle=e=>{e.preventDefault();const{isToggle:t}=this.state;this.setState({isToggle:!t})},this.toggleFooter=e=>{const{collapse:t}=this.state;t&&e===t?t===e&&this.setState({collapse:!1}):this.setState({collapse:e})}}componentDidMount(){const{pageMetaData:e,location:t,location:{search:s}}=this.props;if(s){const e=(0,x.vA)(s),t={};e&&e.utm_campaign&&(t.utmCampaign=e.utm_campaign),e&&e.utm_source&&(t.utmSource=e.utm_source),e&&e.a&&(t.a=e.a),(0,x.ec)("utmParam",t)}const a=(0,x.Bd)(),r=(0,x.jv)();if(a||r)return void this.redirectToDestination("bundle");const i=(0,x.dl)();if((a||r)&&this.setState({isMsales:!0}),i&&this.setState({isOTT:!0}),!e&&this.getPageData(),!c.A.isServer()){const{campaignId:e,plan:s}=(0,x.vA)(t.search),a=(0,he.u6)("ha_plus"),r={campaignId:e||"",plan:s||""};if(a){if(e||s){const e=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Dt(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Dt(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},a);e.salesLeadParams=r,(0,he.e)("ha_plus",e)}}else(0,he.e)("ha_plus",{salesLeadParams:r})}this.handleCampaignUpdate();try{(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"productImpression",ecommerce:{currencyCode:"INR",impressions:[{name:"Tata Play Secure Plus",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Google",list:"",position:" A"}]}})}catch(e){}}render(){const{isMsales:e,isOTT:t,isToggle:s,collapse:r}=this.state,{history:i,pageMetaData:n,footerSsrData:o,footerStaticSsrData:l}=this.props;return n?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)(A.A,{isSecure:!0,metatags:n?n.metatag:{},showBreadCrumb:!0,breadCrumbSchema:n.breadcrumb,children:[e||t?(0,v.jsx)(h.A,{isLogo:!0,journeyType:"HA_PLUS"}):(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)(_t,{bannerUrl:n.field_header_image&&n.field_header_image.url,body:n.field_subtitle,bannerResUrl:n.field_json&&n.field_json.field_responsive_image,btnText:n.field_json&&n.field_json.button_text,knowMoreTxt:n.field_json&&n.field_json.know_more,title:n.title,history:i,journey:"Google"}),(0,v.jsx)("section",{className:"clearfix con-servicewrapp check-planwrapp wyze-wrap google-wrap",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Et,{title:n.field_title_alert&&n.field_title_alert,vidData:n.field_home_video,imgData:n.field_image,body:n.field_body_alert,anchorTxt:n.field_json&&n.field_json.smart_alert,showVideoModal:this.showVideoModal}),(0,v.jsxs)("div",{className:"alert-packwrapp",children:[(0,v.jsxs)("div",{className:"heading-sm text-center",children:[(0,v.jsx)(b.A,{className:"heading-sm text-center",htmlContent:n.field_package_title_body}),(0,v.jsx)("h2",{className:"gradient ha-heading1",children:n.field_package_title})]}),(0,v.jsx)("div",{className:"alert-packcontainer secure-plus-block",children:(0,v.jsx)("div",{className:"alert-pack-left alert-pack",children:n.field_smart_features&&n.field_smart_features.map((e,t)=>(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"gencamera",children:[(0,v.jsxs)("div",{className:"camera-section",children:[(0,v.jsx)("div",{className:`genimg setimg ${n.field_smart_features.length-1===t&&"last-img"}`,children:(0,v.jsx)("img",{src:e.field_image&&c.A.NODE_API_ROOT+e.field_image.url,className:"img-fluid decorative-image"})}),(0,v.jsxs)("div",{className:"gentext",children:[n.field_json.free_text&&(0,v.jsx)("span",{className:"bold",children:n.field_smart_features.length-1===t&&n.field_json.free_text}),e.field_label,e.field_body&&(0,v.jsx)(b.A,{className:"camera-small-text",htmlContent:e.field_body})]}),(0,v.jsx)("div",{className:"sky-securewrapp",children:(0,v.jsx)("div",{className:"sky-secure-price mT5",children:(0,v.jsxs)("span",{className:"tata-secureamount",children:[e.field_features_price>0&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("span",{className:"rupee fs12",children:"â¹"}),(0,v.jsxs)("span",{className:"price",children:[e&&e.field_features_price,e&&e.field_feature_duration&&(0,v.jsxs)("span",{className:"price-duration",children:["/",e.field_feature_duration]})]})]}),(""===e.field_features_price||0===parseInt(e.field_features_price,10))&&n&&n.field_json.free_text,e.field_features_price_text&&(0,v.jsx)(b.A,{Tag:"p",htmlContent:e.field_features_price_text})]})})})]}),(0,v.jsxs)("div",{className:"knowmore-txt",children:[1!==t&&(0,v.jsx)("a",{onClick:()=>this.handleRedirectExtUrl(`/${c.A.home_automation}/${j.dY}/${e.field_link[0].uri.split(":/")[1]||""}`,{clickText:e.field_link[0].title,featureName:e.field_label}),href:"javascript:void(0)",className:"linktext ha-hover",children:e.field_link[0].title}),1===t&&(0,v.jsx)("a",{onClick:()=>this.handleRedirectExtUrl(`/${c.A.home_automation}/${e.field_link[0].uri.split(":/")[1]}`,{clickText:e.field_link[0].title,featureName:e.field_label}),href:"javascript:void(0)",className:"linktext ha-hover",children:e.field_link[0].title})]})]}),n.field_smart_features.length-1!==t&&(0,v.jsx)("div",{className:`pluse-icon ${n.field_smart_features.length-2===t&&" last-pluse-icon"}`,children:(0,v.jsx)("img",{src:"/assets/images/home-automation/pluse-icon.png",className:"img-fluid decorative-image"})})]}))})}),n.field_wifi_description&&(0,v.jsx)("div",{className:"wifi-container-home",children:(0,v.jsx)(k,{iconInfo:n.field_wifi_icon||"",descText:n.field_wifi_description})})]})]})}),(0,v.jsx)("section",{className:"benifit-service sub-planwrapp subscriptionwrapp buy-journey-wrapp unique-page",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)("div",{className:"heading-sm text-center",children:(0,v.jsx)("h2",{className:"ha-heading1 gradient",children:n.field_plans&&n.field_plans})}),(0,v.jsx)("div",{className:"row dth-offers-contr wyze-wrap",children:n.field_subplans&&n.field_subplans.map((e,t)=>(0,v.jsx)(Tt,{title:e.field_title,imgUrl:e.field_image.url,plan:e.field_plan,anch
1orTxt:e.field_label,handleModal:this.handleModal,modalData:{title:e.field_link_popup,body:e.field_features_popup}},t))})]})}),(!w()(n.field_faq)||!w()(n.field_faq_main))&&(0,v.jsxs)("div",{className:"innercontainer-md ha-faq",style:{marginBottom:"60px",marginTop:"60px"},children:[!w()(n.field_faq_main)&&(0,v.jsx)(b.A,{htmlContent:n.field_faq_main}),!w()(n.field_faq)&&(0,v.jsx)("div",{id:"accordion",className:"accordion-main "+(s?"":"dis-none"),children:n.field_faq.map((e,t)=>(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("h3",{className:r===`id${t}`?"accordion-toggle acc-expanded":"accordion-toggle acc-collapsed",onClick:()=>this.toggleFooter(`id${t}`),children:e.question}),(0,v.jsx)(D.A,{isOpen:r===`id${t}`,children:(0,v.jsx)("div",{className:"accordion-content gc-acc",children:(0,v.jsx)("div",{className:"card-body",children:(0,v.jsx)("div",{className:"accordion-text",children:(0,v.jsx)(b.A,{htmlContent:e.answer})})})})})]}))}),(0,v.jsx)("div",{className:"mT20",children:(0,v.jsx)("div",{onClick:e=>this.toggle(e),className:"gc-anchor",children:s?"Less":"More"})})]}),!w()(n.field_json.footNote)&&(0,v.jsx)(b.A,{className:"footnote-section",htmlContent:n.field_json.footNote}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show text-center home",children:(0,v.jsx)("button",{className:"btn42 btn-primary btn-lg waves-effect waves-light btn-resfull",type:"button",onClick:()=>this.redirectToDestination("bundle"),children:n.field_json&&n.field_json.button_text})}),e||t?null:(0,v.jsx)(p.A,{footerStaticSsrData:l,footerSsrData:o,showBreadCrumb:!0,breadCrumbData:n.breadcrumb})]}),!w()(n.field_faq)&&(0,v.jsx)(b.A,{Tag:"script",type:"application/ld+json",htmlContent:JSON.stringify((0,O.S)(n.field_faq))})]}):(0,v.jsx)(u.A,{})}}const kt=(0,l.Ng)(e=>({pageMetaData:e.commonReducer.currentPageMetaData,footerSsrData:e.commonReducer.footerSsrData,footerStaticSsrData:e.commonReducer.footerStaticSsrData}),e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))(Ot);var Pt=s(94035),It=s(20432),Mt=s(68547),$t=s(61336),Rt=s(48995);const Lt=({pageData:e})=>{const t=e.map(e=>{const t=e.field_content_techspecs.split(";");return{status:e.status,field_content_techspecs:[...t],field_label_techspecs:e.field_label_techspecs}});return(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("div",{className:"tech-spec",children:!w()(t)&&t.map((e,t)=>(0,v.jsxs)("div",{className:"tech-specs-blk",children:[(0,v.jsx)("div",{className:"tech-specs-ttl",children:e.field_label_techspecs}),(0,v.jsx)("ul",{className:("Languages"===e.field_label_techspecs?"lang ":"")+"spc-list",children:e.field_content_techspecs.map((e,t)=>(0,v.jsx)("li",{children:e.trim()},t))})]},t))})})};class Ft extends a.Component{constructor(...e){super(...e),this.state={pageData:null,activeTab:"1",pageTitle:null,pageMetaText:null,showDemo:!0},this.getProductId=async()=>{const{setApiError:e}=this.props;await(0,T.bk)(`${j.dV}/read/core-api/product/search/%20eyJmaWVsZF9qb3VybmV5IjoiZ29vZ2xlIn0=`,{},!0)},this.checkHaUser=async()=>{const{setApiError:e}=this.props,{subId:t}=JSON.parse(localStorage.userAuth),s={subscriberId:t.id,source:"HA",provider:"Google"};try{const{data:e}=await f.n.checkHaUser(s);e.message===c.A.MESSAGES_TYPES.SUCCESS&&!0===e.status&&this.setState({showDemo:!1})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.toggleTab=e=>{const{activeTab:t}=this.state;t!==e&&this.setState({activeTab:e})},this.showVideoModal=(e,t)=>{e.preventDefault();const{openModal:s}=this.props;s(L.lx.HA_VIDEO_MODAL,{data:t,showVideoPopup:!0,parentClass:"wyze-vid-modal",backDropClass:"wyze-vid-backdrop",closePopup:!0})},this.redirectToDestination=(e,t)=>{(0,x.Sw)({event:"ctaClick",clickText:t,featureName:"","Sub ID":(0,x.Xo)().id||null,pageSection:""}),(0,x.Sw)({clickText:t,"Sub ID":(0,x.Xo)().id||null,pageSection:"","Type of Journey":"HA-secure Plus -Buy Journey",event:"productClick",ecommerce:{click:{actionField:"",products:[{name:"Tata Play Secure Plus",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Google",position:1}]}}});const{history:s}=this.props;s.push(`/${c.A.home_automation}/${j.dY}/${e}`)}}componentDidMount(){const{pageMetaData:e}=this.props;(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"productImpression",ecommerce:{currencyCode:"INR",impressions:[{name:"Tata Play Secure Plus",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Google",list:"",position:" A"}]}}),!e&&this.getProductId(),this.checkHaUser()}render(){const{activeTab:e,showDemo:t}=this.state,{pageMetaData:s,footerStaticSsrData:r,footerSsrData:i}=this.props,n=s&&s.filter(e=>"google"===e.field_vendor.toLowerCase()&&"camera"===e.field_type.toLowerCase())[0],o=n&&n.field_json&&JSON.parse(n.field_json),{history:l}=this.props;return n?(0,v.jsx)(A.A,{isSecure:!0,metatags:n?n.metatag:{},showBreadCrumb:!0,breadCrumbSchema:n.breadcrumb,children:(0,v.jsxs)("div",{className:"ipl_event google-camera",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",className:"on-top",journeyType:"HA_PLUS"}),(0,v.jsxs)("div",{className:"content-container pay-succes gs-alert",children:[(0,v.jsx)("div",{className:"gen-heading-wrapper",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:l,type:"history_back"}),(0,v.jsx)("div",{className:"heading-sm text-center ",children:(0,v.jsx)("h1",{className:"ha-heading1 movieTitle gradient",children:n.title})}),(0,v.jsx)("div",{className:"adon-tabs offer-tab gentab-wrapper",children:(0,v.jsx)("div",{className:"tabs-section",children:(0,v.jsxs)(Pt.A,{tabs:!0,className:"tabs style2",children:[(0,v.jsx)(It.A,{className:"1"===e?"active":"",children:(0,v.jsx)(Mt.A,{onClick:()=>{this.toggleTab("1")},children:"Overview"})}),(0,v.jsx)(It.A,{className:"2"===e?"active":"",children:(0,v.jsx)(Mt.A,{onClick:()=>{this.toggleTab("2")},children:"Tech Specs"})})]})})}),o.dropdown_title&&(0,v.jsx)(Se,{classes:"wyze-drop",history:l,title:o.dropdown_title,includeCurrent:!0})]})}),(0,v.jsxs)($t.A,{activeTab:e,children:[(0,v.jsx)(Rt.A,{tabId:"1",children:(0,v.jsx)("div",{className:"nextgen-camwrapp mB0 google-overview",children:n&&n.field_overview&&(0,v.jsx)(a.Fragment,{children:n.field_overview.map((e,s)=>"left"===e.field_allignment?(0,v.jsx)(_,{showDemo:t,pageMetaText:o,showVideoModal:this.showVideoModal,vidUrl:""!==e.field_link?e.field_link[0].uri:"",descData:e,isLastElement:s===n.field_overview.length-1,journey:"Google"},s):(0,v.jsx)(E,{showDemo:t,pageMetaText:o,showVideoModal:this.showVideoModal,vidUrl:""!==e.field_link?e.field_link[0].uri:"",descData:e,isLastElement:s===n.field_overview.length-1,journey:"Google"},s))})})}),(0,v.jsx)(Rt.A,{tabId:"2",children:(0,v.jsx)("div",{className:"tech-specs-wrapp",children:n&&n.field_tech_specs&&(0,v.jsx)(Lt,{pageData:n.field_tech_specs})})})]}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show text-center",children:(0,v.jsx)(b.A,{Tag:"button",className:"btn42 btn-primary btn-lg waves-effect waves-light btn-resfull",type:"button",htmlContent:o&&o.button_text,onClick:()=>this.redirectToDestination("bundle",o.button_text)})})]}),(0,v.jsx)(p.A,{footerStaticSsrData:r,footerSsrData:i,showBreadCrumb:!0,breadCrumbData:n.breadcrumb})]})}):(0,v.jsx)(u.A,{})}}const Ut=(0,l.Ng)(e=>({pageMetaData:e.commonReducer.currentPageMetaData,footerSsrData:e.commonReducer.footerSsrData,footerStaticSsrData:e.commonReducer.footerStaticSsrData}),e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))(Ft);function Bt(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Ht(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Bt(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Bt(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Yt extends a.Component{constructor(...e){super(...e),this.state={dropdownOpen:!1,pageData:null,activeTab:"1",pageHeadingData:{},pageTitle:null,pageMetaText:null},this.getPageTitle=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/google-home-mini.json");if(t.status===c.A.MESSAGES_TYPES.SUCCESS){const e={title:t.data.title,head_info:t.data.field_json.mini_heading,head_img:t.data.field_json.heading_image};this.setState({pageHeadingData:Ht({},e)})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getProductId=async()=>{await(0,T.bk)(`${j.dV}/read/core-api/product/search/%20eyJmaWVsZF9qb3VybmV5IjoiZ29vZ2xlIn0=`,{},!0)},this.toggle=e=>{e.preventDefault();const{dropdownOpen:t}=this.state;this.setState({dropdownOpen:!t})},this.toggleTab=e=>{const{activeTab:t}=this.state;t!==e&&this.setState({activeTab:e})},this.showVideoModal=(e,t)=>{e.preventDefault();const{openModal:s}=this.props;s(L.lx.HA_VIDEO_MODAL,{data:t,showVideoPopup:!0,parentClass:"wyze-vid-modal",backDropClass:"wyze-vid-backdrop",closePopup:!0})},this.redirectToDestination=(e,t)=>{(0,x.Sw)({event:"ctaClick",clickText:t,featureName:"","Sub ID":(0,x.Xo)().id||null,pageSection:""}),(0,x.Sw)({clickText:t,"Sub ID":(0,x.Xo)().id||null,pageSection:"","Type of Journey":"HA-secure Plus -Buy Journey",event:"productClick",ecommerce:{click:{actionField:"",products:[{name:"Tata Play Secure Plus",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Google",position:1}]}}});const{history:s}=this.props;s.push(`/${c.A.home_automation}/${j.dY}/${e}`)}}componentDidMount(){const{pageMetaData:e}=this.props;(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Buy Journey",event:"productImpression",ecommerce:{currencyCode:"INR",impressions:[{name:"Tata Play Secure Plus",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Google",list:"",position:""}]}}),!e&&this.getProductId(),this.getPageTitle()}render(){const{dropdownOpen:e,activeTab:t,pageHeadingData:s}=this.state,{pageMetaData:r,history:i,footerStaticSsrData:n,footerSsrData:o}=this.props,l=r&&r.filter(e=>"home mini"===e.field_type.toLowerCase())[0],c=l&&l.field_json&&JSON.parse(l.field_json);return l?(0,v.jsx)(A.A,{isSecure:!0,metatags:l?l.metatag:{},showBreadCrumb:!0,breadCrumbSchema:l.breadcrumb,children:(0,v.jsxs)("div",{className:"ipl_event google-camera home-mini",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsxs)("div",{className:"content-container pay-succes gs-alert",children:[(0,v.jsx)("div",{className:"gen-heading-wrapper",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:i,type:"history_back"}),l&&l.title&&(0,v.jsx)("div",{className:"heading-sm text-center ",children:(0,v.jsx)("h1",{className:"ha-heading1 movieTitle gradient",children:l.title})}),(0,v.jsx)("div",{className:"smart-tips-wrapp text-center google-tip",children:(0,v.jsxs)("div",{className:"dflex",children:[(0,v.jsx)("span",{className:"small mR10",children:(0,v.jsx)("img",{src:s.head_img&&s.head_img,alt:"",className:"informative-image"})}),(0,v.jsx)("span",{className:"small",children:s.head_info&&s.head_info})]})}),(0,v.jsx)("div",{className:"adon-tabs offer-tab gentab-wrapper",children:(0,v.jsx)("div",{className:"tabs-section",children:(0,v.jsxs)(Pt.A,{tabs:!0,className:"tabs style2",children:[(0,v.jsx)(It.A,{className:"1"===t?"active":"",children:(0,v.jsx)(Mt.A,{onClick:()=>{this.toggleTab("1")},children:"Overview"})}),(0,v.jsx)(It.A,{className:"2"===t?"active":"",children:(0,v.jsx)(Mt.A,{onClick:()=>{this.toggleTab("2")},children:"Tech Specs"})})]})})}),c.dropdown_title&&(0,v.jsx)(Se,{classes:"wyze-drop",history:i,title:c.dropdown_title,includeCurrent:!0})]})}),(0,v.jsxs)($t.A,{activeTab:t,children:[(0,v.jsx)(Rt.A,{tabId:"1",children:(0,v.jsx)("div",{className:"nextgen-camwrapp mB0",children:l&&l.field_overview&&(0,v.jsx)(a.Fragment,{children:l.field_overview.map((e,t)=>"left"===e.field_allignment?(0,v.jsx)(_,{pageMetaText:c,showVideoModal:this.showVideoModal,vidUrl:""!==e.field_link?e.field_link[0].uri:"",descData:e,isLastElement:t===l.field_overview.length-1}):(0,v.jsx)(E,{pageMetaText:c,showVideoModal:this.showVideoModal,vidUrl:""!==e.field_link?e.field_link[0].uri:"",descData:e,isLastElement:t===l.field_overview.length-1}))})})}),(0,v.jsx)(Rt.A,{tabId:"2",children:(0,v.jsx)("div",{className:"tech-specs-wrapp",children:l&&l.field_tech_specs&&(0,v.jsx)(Lt,{pageData:l.field_tech_specs})})})]}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show text-center",children:(0,v.jsx)(b.A,{Tag:"button",className:"btn btn-primary btn-lg waves-effect waves-light btn-resfull",type:"button",onClick:()=>this.redirectToDestination("bundle",c.button_text),htmlContent:c&&c.button_text})})]}),(0,v.jsx)(p.A,{footerStaticSsrData:n,footerSsrData:o,showBreadCrumb:!0,breadCrumbData:l.breadcrumb})]})}):(0,v.jsx)(u.A,{})}}const Gt=(0,l.Ng)(e=>({pageMetaData:e.commonReducer.currentPageMetaData,footerSsrData:e.commonReducer.footerSsrData,footerStaticSsrData:e.commonReducer.footerStaticSsrData}),e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))(Yt),Jt=()=>{const[e,t]=(0,a.useState)({address:null,date:null,time:null,haId:null}),[s,r]=(0,a.useState)(null),i=(0,l.wA)(),n=(0,he.u6)("ha_plus");n||i((0,g.x8)(c.A.serverError,!0));const{orderUuid:o}=n;return(0,a.useEffect)(()=>{const e=(0,x.Bd)(),s=(0,x.jv)();(e||s)&&r(!0),(async()=>{try{const{data:e}=await f.n.getData(`payment/workorder/getDetailsByUuid/${o}`);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const s=e.data,{workOrderDTOS:a}=s;(!a||0===Object.keys(a).length&&a.constructor===Object)&&i((0,g.x8)(c.A.serverError,!0));const r=(0,he.FR)(s.addresses),n=ne()(a.woSlotEndTime).format("MMMM DD, YYYY"),o=`${ne()(a.woSlotStartTime).format("LT")}
1 - ${ne()(a.woSlotEndTime).format("LT")}`;t({address:r,date:n,time:o,haId:s.haId})}else i((0,g.x8)(c.A.serverError,!0))}catch(e){i((0,g.x8)(c.A.serverError,!0))}})()},[]),e.haId&&e.address&&e.date&&e.time?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:s?j.CB.HA_ADD_CAM_SUBSCRIPTION:j.CB.HA_SUBSCRIPTION,activeStepper:s?"5":"6"}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:"Installation appointment is booked"}),(0,v.jsx)("div",{className:"id-text bold",children:`Your Order ID is: ${e.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("div",{className:"insta-blk-wrapp",children:[(0,v.jsx)("div",{className:"insta-blk-text bold",children:" Installation appointment scheduled"}),(0,v.jsxs)("div",{className:"insta-blk",children:[(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/date-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:e.date})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("span",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/time-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:e.time})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp mB0 mR0",style:{width:"100%"},children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/address-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"inst-add-contr fs14",children:e.address})]})]})]}),(0,v.jsxs)("div",{className:"certified-wrapp",children:[(0,v.jsx)("span",{children:(0,v.jsx)("img",{src:"/assets/images/confirm-appointment.png",alt:"",className:"img-fluid"})}),"Our Tata Play installation expert will call you to confirm the installation"]}),!s&&(0,v.jsx)("div",{className:"footer-contr text-center mT20 block",children:(0,v.jsx)("a",{className:"btn btn-primary btn-lg waves-effect waves-light",href:`/${c.A.home_automation}/${j.dY}`,children:"Back to Home"})})]})]})]})})]}):(0,v.jsx)(u.A,{})},qt={userSoftLogin:Fe.Jj,setApiError:g.x8,openModal:U.qf},Vt=(0,l.Ng)(null,qt)(e=>{const[t,s]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),[n,o]=(0,a.useState)(!0),[d,p]=(0,a.useState)(null),g=(0,l.wA)(),{history:b,match:{params:{encSubId:y}},userSoftLogin:S,setApiError:A}=e;y||g(A(c.A.serverError,!0));const N=async()=>{o(!1);try{const{data:e}=await f.n.getData(`user/getAccountLinkingStatus/${y}`);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data;if(t)if(i(t.haId),!0===t.accountLink)b.push({pathname:`/${c.A.home_automation}/${j.dY}/sms/account-link-success`,state:{alreadyLinked:!0}});else{let e=(0,he.u6)("ha_plus");e?e.isSms=!0:e={isSms:!0},(0,he.e)("ha_plus",e),p(t.subId);(0,x.wR)(!0)||(async e=>{o(!1);const t={rmnOrSubscriberId:e},s=await S(t,"HA");s.status===c.A.MESSAGES_TYPES.S3_SUCCESS?((0,x.Sw)({event:"Successful Login",SubscriberID:e||""}),(0,x.uO)(s),b.push(`/${c.A.home_automation}/authentication?dest=/${c.A.home_automation}/sms/account-link/${y}`)):g(A(c.A.serverError,!0))})(t.subId)}else g(A(c.A.serverError,!0));o(!0)}else g(A(c.A.serverError,!0))}catch(e){e&&e.response&&[401,409].includes(e.response.status)||g(A(c.A.serverError,!0))}},C=()=>{N(),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/account-link-landing.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const{field_json:t,field_image:a,field_images:r}=e.data;s({field_json:t,field_image:a,field_images:r}),o(!0)}else g(A(c.A.serverError,!0))}catch(e){g(A(c.A.serverError,!0))}})()};return(0,a.useEffect)(()=>{const e=JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||"";e&&e.subId&&e.subId.encryptId!==y?(()=>{o(!0);const e={subId:y,redirectFunction:C};g((0,U.qf)(L.lx.PASSWORD_MODAL,{history:b,haEncSubid:e,parentClass:"passwordModal"}))})():C()},[]),n?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:m()(t,"field_json.Title","")}),(0,v.jsx)("h2",{className:"ha-heading2",children:m()(t,"field_json.SubHeading","")})]}),(0,v.jsxs)("div",{className:"innercontainer-sm text-center",children:[(0,v.jsx)("div",{className:"fs16 bold mB20",children:`Order ID: ${r}`}),(0,v.jsxs)("div",{className:"innercontainer-xs",children:[(0,v.jsx)("div",{className:"ts-google-contr",children:t&&t.field_images&&t.field_images.map((e,t)=>(0,v.jsx)("img",{src:e.url,alt:e.alt},t))}),t&&t.field_image&&(0,v.jsx)("div",{children:(0,v.jsx)("img",{src:t.field_image.url,className:"img-fluid w100pcnt mT20"})}),(0,v.jsx)("div",{className:"footer-contr text-center block mT20",children:(0,v.jsx)("a",{className:"btn btn-primary btn-lg waves-effect waves-light",href:`/${c.A.home_automation}/user/linkAccount/${d}`,children:m()(t,"field_json.Button_text","")})})]})]})]})})})]}):(0,v.jsx)(u.A,{})}),zt={userSoftLogin:Fe.Jj,setApiError:g.x8,openModal:U.qf},Wt=(0,l.Ng)(null,zt)(e=>{const{location:{state:t}}=e,s=t&&t.alreadyLinked||!1,[r,i]=(0,a.useState)(null),n=(0,l.wA)();return(0,a.useEffect)(()=>{(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/success-page.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const{field_json:t,field_images:s}=e.data;i({field_json:t,field_images:s})}else n((0,g.x8)(c.A.serverError,!0))}catch(e){n((0,g.x8)(c.A.serverError,!0))}})()},[]),r?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container succ",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:s?m()(r,"field_json.Already_link_title",""):m()(r,"field_json.Title","")}),(0,v.jsx)("h2",{className:"ha-heading2",children:m()(r,"field_json.SubHeading","")})]}),(0,v.jsxs)("div",{className:"body-container text-center pB0",children:[r.field_images&&r.field_images.map((e,t)=>(0,v.jsx)("div",{className:"tata-sky-logo",children:(0,v.jsx)("img",{src:e.url,alt:e.alt,className:"img-fluid"})},t)),(0,v.jsx)("div",{className:"footer-contr text-center block mT32",children:(0,v.jsx)("a",{className:"btn btn-primary btn-lg waves-effect waves-light",href:`/${c.A.home_automation}/${j.dY}`,children:m()(r,"field_json.Button_text","")})})]})]})})})]}):(0,v.jsx)(u.A,{})});function Xt(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Zt(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Xt(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Xt(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Qt extends a.Component{constructor(...e){super(...e),this.state={render:!0,subIdList:[],selectedSubId:null,selectedSubName:null,startDate:null,startTime:ne()((new Date).getTime()),slotTime:{wrapperClasses:["form-group","custom-Select-Arrow","slot-field"],labelConfig:{label:"Time",classes:["sel","active"]},elementType:"customSelect",elementConfig:{options:[],placeholder:"Select time",maxLength:null,tabIndex:0,readonly:"readonly"},value:null,errorMessage:null,valid:!0,touched:!1},slotList:null,teamId:null,taskId:null,address:null,allowedDays:2,errorMessage:null,disableSubmit:!1,pageData:null},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/google-schedule-demo-screen.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=Zt({},t.data);this.setState({pageData:e},()=>{this.prepareSubIdList()})}else e(c.A.serverError,!0),this.setState({render:!0})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.prepareSubIdList=()=>{const{openModal:e,history:t}=this.props,{pageData:s}=this.state,a=(0,he.HW)().id,r=JSON.parse(localStorage.getItem("userAuth")),{subscriberIds:i,accountStatus:n,encSubscriberId:o}=r;let l,d,m="",u="",h=null,p="",g=!1;const f=[],x={};i.forEach((e,t)=>{if(x[e]=o[t],"Active"===n[t]&&f.push({label:e,value:e}),"Temp Suspension"===n[t]){const e=s.field_json.popup_config.filter(e=>"TEMP_SUSPEND"===e.status);m=e[0].heading,u=e[0].subHeading1,h=e[0].subHeading2,p=e[0].button_text,l=e[0].button_link,d=e[0].field_url_source}if("Deactivated"===n[t]){const e=s.field_json.popup_config.filter(e=>"DEACTIVATED"===e.status);m=e[0].heading,u=e[0].subHeading,p=e[0].button_text,g=!0}});const b=f.length>0?f[0].value:null;null!==b?(b&&this.checkIfAlreadyScheduled(b),this.setState({subIdList:[...f]},()=>{this.setState({selectedSubId:b},()=>{this.getSubsciberDetails(b),this.getSlots(b,!0)})})):e(L.lx.COMMON_MODAL,{Component:Ne,data:{title:m,body:u,subHeading2:h,showRecharge:g,encSubId:x[a],btnTxt:p,redirectUrl:l,fieldSource:d},onCloseEvent:()=>{t.push(`/${c.A.home_automation}/${j.dY}`)},history:t})},this.showModal=e=>{const{openModal:t,history:s}=this.props,{pageData:a}=this.state,r=a.field_json.popup_config.filter(t=>t.type===e)[0],i={title:r.title,body:r.subTitle,btnTxt:r.button_text,showRecharge:!1};let n=null;if("DEMO_PLACED"===e&&(n=`/${c.A.home_automation}/${j.dY}`,i.gaInfo={event:"Okay Got It"}),"PINCODE_NOT_SERVICABLE"===e&&(n=`/${c.A.home_automation}/${j.dY}${r.url}`),"PINCODE_NOT_SERVICABLE"===e||"DEMO_PLACED"===e)return i.redirectUrl=n,void t(L.lx.HA_COMMON_MODAL,{Component:Ne,data:i,onCloseEvent:()=>{s.push(n)},history:s,closePopup:!0});t(L.lx.HA_COMMON_MODAL,{Component:Ne,data:i})},this.checkIfAlreadyScheduled=async e=>{const{openModal:t,setApiError:s,history:a}=this.props,r={subId:e,provider:"Google"};let i=!1;try{const{data:e}=await f.n.postData("order/workorder/checkAlreadyScheduledDemo",r);e.message===c.A.MESSAGES_TYPES.SUCCESS&&e.data.alreadyScheduled&&(this.showModal("DEMO_PLACED"),i=!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}return i&&this.setState({render:!0}),i}
1,this.getSubsciberDetails=async e=>{const{setApiError:t}=this.props,s={subscriberId:"object"==typeof e?e.id:e,source:"WEB"};try{const{data:e}=await f.n.postData("order/address/getAddress",s);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data;this.createAddress(e.data),t.serviceEnable||(this.setState({isServicable:!1,disableSubmit:!0}),this.showModal("PINCODE_NOT_SERVICABLE"))}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.createAddress=e=>{const t=e.subscriberName||"",s=e.building&&""!==e.building?`${e.building}, `:"",a=e.address&&""!==e.address?`${e.address}, `:"",r=e.addressline2&&""!==e.addressline2?`${e.addressline2}, `:"",i=e.city&&""!==e.city?`${e.city}, `:"",n=e.state&&""!==e.state?`${e.state}-`:"",o=e.areaPincode&&""!==e.areaPincode?`${e.areaPincode}`:"",l=`${s}${a}${r}${e.landmark&&""!==e.landmark?`${e.landmark}, `:""}${e.location&&""!==e.location?`${e.location}, `:""}${i}${n}${o}`;this.setState({address:l,selectedSubName:t,render:!0})},this.handleDateChange=e=>{const{selectedSubId:t,slotTime:s}=this.state,a=s;a.value=null,this.setState({startDate:e,render:!1,slotTime:a,disableSubmit:!1},()=>this.getSlots(t))}
1,this.getSlots=async(e,t)=>{const{startDate:s,slotTime:a}=this.state,{setApiError:r}=this.props,i=t?new Date:s,n={subId:e,slotStartDate:ne()(i).format("DD-MM-YYYY"),provider:"Google"};try{const{data:e}=await f.n.postData("order/get-slots/",n);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const s=[],{slotSuggestions:r,ocsFlag:i}=e.data;let n=0;if("N"===i||""===i?n=2:"Y"===i&&(n=29),t)this.setState({allowedDays:n,render:!0});else{r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{const t=ne()(e.start).format("LT"),a=ne()(e.end).format("LT");s.push({label:`${t} - ${a}`,value:`${ne()(e.start).format("HH:mm:ss")}-${ne()(e.end).format("HH:mm:ss")}`})});const t=Zt({},a);t.elementConfig.options=s,t.errorMessage="",t.valid=!0,this.setState({slotList:s,slotTime:t,teamId:e.data.teamId,taskId:e.data.taskId,allowedDays:n,render:!0})}}else{let s=2;if(e.data){const{ocsFlag:t}=e.data;"N"===t||""===t?s=2:"Y"===t&&(s=29)}if(t)this.setState({allowedDays:s,render:!0});else{const e=Zt({},a);e.elementConfig.options=[],e.value=null,e.errorMessage="No slots available! Please select another date.",e.valid=!1,this.setState({slotList:null,slotTime:e,teamId:null,taskId:null,allowedDays:s,render:!0})}}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}},this.handleTimeChange=e=>{const{slotTime:t}=Zt({},this.state),s=Zt({},t);s.value=e,s.touched=!0,s.valid=!0,s.errorMessage=null,this.setState({slotTime:s,formError:""})},this.handleSubmit=async()=>{this.setState({render:!1,disableSubmit:!0});const{slotTime:e,startDate:t,selectedSubId:s}=this.state,{history:a,setApiError:r}=this.props;if(await this.checkIfAlreadyScheduled(s))return;if(null===e.value){const t=Zt({},e);return t.valid=!1,t.errorMessage="Please select a slot.",void this.setState({slotTime:t,formError:"",render:!0,disableSubmit:!1})}const i=ne()(t).format("DD-MM-YYYY"),n=e.value.split("-")[0],o={subId:s,woSlotEndTime:`${i} ${e.value.split("-")[1]}`,woSlotStartTime:`${i} ${n}`,provider:"Google"};try{const{data:e}=await f.n.postData("order/createDemoOrder/",o);if(!0===e.status)if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const{orderUuid:t}=e.data;let s=(0,he.u6)("ha_plus");s||(s={}),s.demoUuid=t,(0,he.e)("ha_plus",s),a.push(`/${c.A.home_automation}/${j.dY}/demo-booking-success`)}else a.push(`/${c.A.home_automation}/${j.dY}/demo-booking-failure`);else a.push(`/${c.A.home_automation}/${j.dY}/demo-booking-failure`)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}},this.handleDateChangeRaw=e=>{e.preventDefault()},this.handleSubscriberIDSelect=e=>{this.setState({render:!1}),this.setState({selectedSubId:e.target.value},()=>{const{selectedSubId:e}=this.state;this.checkIfAlreadyScheduled(e),this.getSubsciberDetails(e)})}}componentDidMount(){this.getPageMetaData()}render(){const{startDate:e,slotTime:t,address:s,allowedDays:r,subIdList:i,selectedSubId:n,selectedSubName:o,render:l,disableSubmit:c}=this.state;if(!l)return(0,v.jsx)(u.A,{});const{history:d}=this.props,m={option:e=>Zt(Zt({},e),{},{fontSize:"14px"})};return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container schedul-install bottompadd gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:d,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:"Let's fix up the appointment"}),(0,v.jsx)("h2",{className:"ha-heading2",children:"Pick a convenient date and time for our expert to visit you for the demo"})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-xs pB0",children:[(0,v.jsxs)("div",{className:"details-wrapp text-left",children:[(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"sel",children:"Name"}),(0,v.jsx)("div",{className:"forminfo",children:o})]}),(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"sel",children:"Subscriber ID"}),i&&i.length>1&&(0,v.jsx)("div",{className:"forminfo",children:(0,v.jsx)("select",{className:"form-control",style:{padding:"0 6px"},value:n,onChange:e=>{this.handleSubscriberIDSelect(e)},children:i&&i.map(e=>(0,v.jsx)("option",{value:e.value,children:e.label}))})}),i&&1===i.length&&(0,v.jsx)("div",{className:"forminfo",children:i[0].label})]})]}),(0,v.jsxs)("div",{className:"fullwidth mT30 text-left",children:[s&&(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Address"}),(0,v.jsx)("div",{className:"add-text",children:s}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Date"}),(0,v.jsx)(yt(),{dateFormat:"DD MMMM YYYY",selected:e,placeholderText:"Select date",onCh
1ange:e=>this.handleDateChange(e),minDate:ne()(),maxDate:ne()().add(r,"days"),onChangeRaw:e=>this.handleDateChangeRaw(e)}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsx)("div",{className:"form-group field-time",children:(0,v.jsx)($.A,{labelConfig:t.labelConfig,elementType:t.elementType,elementConfig:t.elementConfig,value:t.value,valid:t.valid,errorMessage:t.errorMessage,touched:t.touched,wrapperClasses:t.wrapperClasses,changed:e=>this.handleTimeChange(e),customProps:{menuPortalTarget:document.body,menuPosition:"absolute",styles:m}},"slot")})]}),(0,v.jsx)("div",{className:"wyze-wrap",children:(0,v.jsx)(jt,{})}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show",children:(0,v.jsx)("button",{type:"button",className:"btn btn-primary btn-lg waves-effect waves-light btn-resfull",onClick:()=>this.handleSubmit(),disabled:c,children:"Confirm"})})]})]})]})})]})}}const Kt=(0,l.Ng)(null,e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))(Qt),es={setApiError:g.x8},ts=(0,l.Ng)(null,es)(()=>{const[e,t]=(0,a.useState)({address:null,date:null,time:null,haId:null,rmn:null}),{demoUuid:s}=(0,he.u6)("ha_plus");return(0,a.useEffect)(()=>{(async()=>{try{const{data:e}=await f.n.getData(`payment/workorder/getDetailsByUuid/${s}`);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const s=e.data,{workOrderDTOS:a}=s,r=(0,he.FR)(s.addresses),i=ne()(a.woSlotEndTime).format("MMMM DD, YYYY"),n=`${ne()(a.woSlotStartTime).format("LT")} - ${ne()(a.woSlotEndTime).format("LT")}`;t({address:r,date:i,time:n,haId:s.haId,rmn:s.rmn})}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}})()},[]),e.haId&&e.address&&e.date&&e.time?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:"Demo scheduled successfully"}),(0,v.jsx)("h2",{className:"ha-heading2",children:`A confirmation SMS is sent to ${e.rmn}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsx)("div",{className:"fs16 bold mB20 text-center",children:`Order ID: ${e.haId}`}),(0,v.jsxs)("div",{className:"insta-blk-wrapp",children:[(0,v.jsx)("div",{className:"insta-blk-text bold",children:"Demo is scheduled for:"}),(0,v.jsxs)("div",{className:"insta-blk",children:[(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/date-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:e.date})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("span",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/time-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:e.time})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp mB0 mR0",style:{width:"100%"},children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/address-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"inst-add-contr fs14",children:e.address})]})]})]}),(0,v.jsxs)("div",{className:"certified-wrapp",children:[(0,v.jsx)("span",{children:(0,v.jsx)("img",{src:"/assets/images/confirm-appointment.png",alt:"",className:"img-fluid"})}),"Our Tata Play installation expert will call you to confirm the demo"]}),(0,v.jsx)("div",{className:"footer-contr text-center block mT32",children:(0,v.jsx)("a",{className:"btn btn-primary btn-lg waves-effect waves-light",href:`/${c.A.home_automation}/${j.dY}`,children:"Back to Home"})})]})]})})})]}):(0,v.jsx)(u.A,{})}),ss=e=>{const{paymentTxnId:t,paymentData:s,showGoHome:a,redirectToHome:r,getPaymentStatus:i}=e,n={buttonTry:{type:"button",class:"wAutoLgBlue",text:"Try Again"},buttonHome:{type:"button",class:"wAutoLgBlue",text:"Go To Home"}};
1return(0,v.jsxs)("div",{className:"inner-page",children:[(0,v.jsx)("div",{className:"main-container",children:(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:"Payment Awaited"}),(0,v.jsx)("h2",{className:"heading2",children:"There is some issue in payment. Please contact Administrator"})]})}),(0,v.jsxs)("div",{className:"content-container",children:[(0,v.jsx)("p",{children:"Â "}),(0,v.jsx)("p",{children:"Â "}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm text-center upgrade-payment-status",children:[t&&(0,v.jsxs)("p",{style:{display:"flex"},children:[(0,v.jsx)("label",{className:"bold",children:"Transaction Id "}),t]}),s&&s.txnDate&&(0,v.jsxs)("p",{style:{display:"flex"},children:[(0,v.jsx)("label",{className:"bold",children:"Order Date & Time "}),s.txnDate]})]}),(0,v.jsx)("div",{className:"btn-contr text-center more-connection-btn",children:a?(0,v.jsx)(R.A,{config:n.buttonHome,content:n.buttonHome.text,onClick:()=>r()}):(0,v.jsx)(R.A,{config:n.buttonTry,content:n.buttonTry.text,onClick:()=>i(!0)})})]})]})};class as extends a.Component{constructor(...e){super(...e),this.state={render:!1,paymentStatus:null,paymentTxnId:null,showGoHome:!1,timerId:"",callTime:1,timerDetails:{}},this.getPaymentStatus=async(e=!1)=>{this.getPaymentStatusResponse(e);const t=setInterval(this.getPaymentStatusResponse(e),2e3);this.setState({timerId:t})},this.getPaymentStatusResponse=async e=>{this.setState({render:!1});const t=(0,he.u6)("ha_plus"),{history:s,setApiError:a,setPaymentAwaitedData:r}=this.props;try{const{callTime:i}=this.state;let n;this.setState({callTime:i+1});let o={FAIL:"payment-failure",INITIATE:"bundle"};if(t.orderType&&"ADD_CAM"===t.orderType){const{addCameraSession:{orderUuid:e}}=t;n=e,o={FAIL:"payment-failure",INITIATE:"add-camera"}}else n=t.orderUuid;const{data:l}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${n}`);if(l.message===c.A.MESSAGES_TYPES.SUCCESS){const r=l.data[0].paymentStatus;if(r||a(c.A.serverError,!0),"INPROGRESS"===r)return this.setState({paymentStatus:l.data,render:!0,showGoHome:e}),void(t.orderType&&"ADD_CAM"===t.orderType?(0,he.VJ)(j.QZ.AWAITED,"ADD_CAM","ha_plus"):(0,he.VJ)(j.QZ.AWAITED,"HA","ha_plus"));"FAIL"===r?s.push(`/${c.A.home_automation}/${j.dY}/${o.FAIL}`):"INITIATE"===r?s.push(`/${c.A.home_automation}/${j.dY}/${o.INITIATE}`):s.push(`/${c.A.home_automation}/${j.dY}/payment-success`)}else a(c.A.serverError,!0);3===i&&(this.clearTimer(),r(l.data))}catch(e){a(c.A.serverError,!0)}},this.clearTimer=()=>{const{timerId:e}=this.state;""!==e&&clearInterval(e)},this.redirectToHome=()=>{const e=(0,he.u6)("ha_plus");e.orderType=null,(0,he.e)("ha_plus",e);const{history:t}=this.props;t.push(`/${c.A.home_automation}/${j.dY}`)}}componentDidMount(){const{setApiError:e}=this.props,t=!c.A.isServer()&&JSON.parse(localStorage.getItem(c.A.storagePaymentKey))||"",{paymentTxnId:s}=t;s?this.setState({paymentTxnId:s}):e(c.A.serverError,!0),this.getPaymentStatus()}componentWillUnmount(){this.clearTimer()}render(){const{paymentData:e}=this.props,{render:t,paymentTxnId:s,showGoHome:r}=this.state;return(0,v.jsxs)(a.Fragment,{children:[!t&&(0,v.jsx)(u.A,{}),(0,v.jsx)(ss,{paymentTxnId:s,paymentData:e,showGoHome:r,redirectToHome:this.redirectToHome,getPaymentStatus:this.getPaymentStatus})]})}}const rs=(0,l.Ng)(e=>({paymentData:e.getConnectionReducer.paymentDetails}),e=>({setApiError:(0,F.zH)(g.x8,e),setPaymentAwaitedData:(0,F.zH)(dt.Qm,e)}))(as),is=e=>{const{camImage:t,redirectHandler:s,address:a,activeCount:r,cameraCount:i,name:n,subscriptionId:o,status:l,flow:d}=e,m=d||"Google";return(0,v.jsx)(ot.A,{className:"subscription-card",children:(0,v.jsxs)(lt.A,{children:[(0,v.jsxs)("div",{className:"select-relocation-body dflex-fs",children:[t&&(0,v.jsx)("div",{className:"slec-reloleft",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+t.url,alt:t.alt,titile:t.title})}),(0,v.jsxs)("div",{className:"slec-reloright",children:[(0,v.jsxs)("div",{className:"slec-relo-blk mB20 dflex-sb-afs",children:["Hualai"===m&&(0,v.jsxs)("div",{className:"slec-relo-blkleft ",children:[(0,v.jsx)("div",{className:"smallttl",children:n}),(0,v.jsx)("div",{className:"para",children:`Subscription Id: ${o}`}),(0,v.jsx)("div",{className:"para mT5",children:`Qty: ${i} ${i>1?"Cameras":"Camera"}`})]}),"Google"===m&&(0,v.jsxs)("div",{className:"slec-relo-blkleft ",children:[(0,v.jsx)("div",{className:"smallttl",children:`Subscription Id: ${o}`}),(0,v.jsx)("div",{className:"para",children:`${i} ${n}`})]}),(0,v.jsx)("div",{className:"slec-relo-blkright",children:(0,v.jsx)("span",{className:"activecamera",children:l})})]}),(0,v.jsxs)("div",{className:"slec-relo-blk",children:[(0,v.jsx)("div",{className:"smallttl",children:"Address"}),(0,v.jsx)("div",{className:"para",children:a})]})]})]}),(0,v.jsx)("div",{className:"footer-contr mT30 text-center",children:(0,v.jsx)("button",{type:"button",className:"btn btn-primary w-auto continue-btn waves-effect waves-light btn-height",onClick:()=>s(o,"Relocate"),children:"Relocate"})})]})})},ns=(0,l.Ng)(null,e=>({openModal:(0,F.zH)(U.qf,e)}))(e=>{const{camImage:t,address:s,cameraCount:a,name:r,subscriptionId:i,status:n,rechargeText:o,uom:l,flow:d,packType:m}=e,u=d||"Google",h=async()=>{const e=JSON.parse(localStorage.userAuth),{subId:t}=e,s={subId:t.id,uom:l,cameraCount:a,provider:u,packType:m};(0,x.y1)("HA",s)},p=()=>{(0,x.Sw)({event:"ctaClick",clickText:"Recharge Now","Type of Journey":`HA -
1Secure ${"Google"===d?"Plus":""} - Relocation`,"Sub ID":(0,x.Xo)().id||null,productName:r||"",subscriptionID:i||"",productPrice:""})};return(0,v.jsx)(ot.A,{className:"subscription-card",children:(0,v.jsxs)(lt.A,{children:[(0,v.jsxs)("div",{className:"select-relocation-body dflex-fs",children:[t&&(0,v.jsx)("div",{className:"slec-reloleft",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+t.url,alt:t.alt,titile:t.title})}),(0,v.jsxs)("div",{className:"slec-reloright",children:[(0,v.jsxs)("div",{className:"slec-relo-blk mB20 dflex-sb-afs",children:[(0,v.jsxs)("div",{className:"slec-relo-blkleft ",children:[(0,v.jsx)("div",{className:"smallttl",children:r}),(0,v.jsx)("div",{className:"para",children:`Subscription Id: ${i}`}),(0,v.jsx)("div",{className:"para mT5",children:`Qty: ${a} ${a>1?"Cameras":"Camera"}`})]}),(0,v.jsx)("div",{className:"slec-relo-blkright",children:(0,v.jsx)("span",{className:"inactivecamera",children:n})})]}),n&&"Active"===n&&(0,v.jsxs)("div",{className:"slec-relo-blk",children:[(0,v.jsx)("div",{className:"smallttl",children:"Address"}),(0,v.jsx)("div",{className:"para",children:s})]})]})]}),(0,v.jsx)("div",{className:"renew-sub-blk",children:(0,v.jsxs)("div",{className:"footer-contr text-center",children:[(0,v.jsx)("div",{className:"para mB20",children:o}),(0,v.jsx)("div",{className:"footer-contr mT30 text-center",children:(0,v.jsx)("button",{type:"button",className:"btn btn-primary w-auto continue-btn waves-effect waves-light btn-height",onClick:()=>(()=>{p();const{openModal:t}=e;t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Renew subscription for relocation",body:"Relocation is possible only for cameras with active subscription. To relocate all your cameras and ensure complete security benefits, renew your subscription.",showRecharge:!0,rechargeHandler:h},parentClass:"new-summary",backDropClass:"bottom-sheet"})})(),children:"Recharge Now"})})]})})]})})});function os(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function ls(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?os(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):os(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class cs extends a.Component{constructor(...e){super(...e),this.state={title:null,subTitle:null,rechargeText:null,camImage:null,render:!1,subscriptionList:null,inactiveSubscriptionList:null,encSubId:null},this.modalCloseHandler=()=>{const{history:e}=this.props;e.push("/my-account")},this.checkHaUser=async()=>{const{setApiError:e,openModal:t,history:s}=this.props,{subId:a}=JSON.parse(localStorage.userAuth),r={subscriberId:a.id,source:"HA",provider:"Google"};try{const{data:e}=await f.n.checkHaUser(r);if(e.message!==c.A.MESSAGES_TYPES.SUCCESS&&!1===e.status)return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Not a valid user! ",body:"We see your account is not valid for this service. Request you to login with a different account",showRecharge:!1,redirectUrl:"/my-account"},onCloseEvent:()=>{s.push("/my-account")},history:s}),this.setState({render:!0}),!1}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}return!0},this.getJourneyStatus=async()=>{try{const{history:e}=this.props,{subId:t}=JSON.parse(localStorage.userAuth),s={subId:t.id,orderType:"RE_",provider:"Google"},{data:a}=await f.n.postData("package/getOrderStatusBySubId",s);if(a.message===c.A.MESSAGES_TYPES.SUCCESS){const t=a.data;t.address&&(t.address.addressType&&"TO_NEW"===t.address.addressType?(t.address.subscriptionId=t.subscriptionId,(0,he.PS)(t.address,"relocation","ha_plus")):t.address.addressType&&"TO_EXISTING"===t.address.addressType&&(0,he.PS)({orderUuid:t.address.orderUuid,subscriptionId:t.subscriptionId},"relocation","ha_plus"));const s=(0,he.u6)("ha_plus"),{relocate_session:r}=s;r.statusChecked=!0,(0,he.e)("ha_plus",s);const i=j.MC.relocationStatusList[t.page];i&&"CREATE ADDRESS"!==t.page&&e.push(`/${c.A.home_automation}/${j.dY}/${i}`)}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/select-cameras-relocation.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=ls({},t.data);this.setState({title:e.title,subTitle:e.field_subtitle,camImage:e.field_image,rechargeText:e.field_json.recharge_text})}else e(c.A.serverError,!0),this.setState({render:!0})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubscriptionData=async()=>{const{setApiError:e}=this.props;try{const t=JSON.parse(localStorage.userAuth),{subId:s}=t,a={subscriberId:s.id,provider:"Google"},{data:r}=await f.n.postData("order/relocationDetails",a);if(r.status||(e(c.A.serverError,!0),this.setState({render:!0})),r.message===c.A.MESSAGES_TYPES.SUCCESS){const{active:e,inactive:a}=r.data,i={},n={};let o=null;if(e&&Array.isArray(e)&&e.length>0&&e.forEach(e=>{i[e.subscriptionId]=e}),a&&Array.isArray(a)&&a.length>0){a.forEach(e=>{n[e.subscriptionId]=e});const{subscriberIds:e,encSubscriberId:r}=t,i={};e.forEach((e,t)=>{i[e]=r[t]}),o=i[s.id]}this.setState({subscriptionList:i,inactiveSubscriptionList:n,encSubId:o},()=>{this.setState({render:!0})})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.redirectToSelectAddress=async(e,t)=>{this.setState({render:!1}),this.relocationGaEvent(t,e);try{const{history:t}=this.props,{subscriptionList:s}=this.state,{address:a,cameraCount:r,name:i}=s[e],n=JSON.parse(localStorage.userAuth),{subId:o}=n,l={subId:o.id,count:r,name:i,subscriptionId:e,provider:"Google"},{data:d}=await f.n.postData("order/createRelocationOrder",l);if(d.message===c.A.MESSAGES_TYPES.SUCCESS){this.setState({render:!1});const{orderUuid:r}=d.data,i=(0,he.u6)("ha_plus"),{relocate_session:n}=i;n.address=a,n.subscriptionId=e,n.orderUuid=r,n.packName=s[e].packName,n.name=s[e].name,n.packPrice=s[e].packPrice,i.relocate_session=n,(0,he.e)("ha_plus",i),t.push(`/${c.A.home_automation}/${j.dY}/select-relocation-address`)}else this.setState({render:!0})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}},this.relocationGaEvent=(e,t)=>{const{subscriptionList:s}=this.state;(0,x.Sw)({event:"ctaClick",clickText:e,"Type of Journey":"HA - Secure Plus - Relocation","Sub ID":(0,x.Xo)().id||null,productName:s&&s[t]&&s[t].name,subscriptionID:t,productPrice:s&&s[t]&&s[t].packPrice})}}async componentDidMount(){let e=(0,he.u6)("ha_plus");if(!c.A.isServer())if(e){const{relocate_session:t}=e;t||(e=ls(ls({},e),{},{relocate_session:{statusChecked:!1}
1}),(0,he.e)("ha_plus",e))}else e={relocate_session:{statusChecked:!1}},(0,he.e)("ha_plus",e);if(await this.checkHaUser()){const{relocate_session:t}=e;t.statusChecked||this.getJourneyStatus(),this.getPageMetaData(),this.getSubscriptionData()}}render(){const{history:e}=this.props,{title:t,subTitle:s,camImage:a,render:r,subscriptionList:i,inactiveSubscriptionList:n,encSubId:o,rechargeText:l}=this.state;return r?(0,v.jsxs)("div",{className:"ipl_event",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert",children:(0,v.jsx)("div",{className:"container",style:{padding:"0 20px"},children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)(G,{history:e,type:"history_back"}),(0,v.jsxs)("div",{className:"heading-md ",style:{marginBottom:"24px"},children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:t}),(0,v.jsx)("h2",{className:"ha-heading2",children:s})]}),(0,v.jsx)("div",{className:"innercontainer-sm",children:(0,v.jsxs)("div",{className:"select-relocation-wrapp mT30 wyze-wrap",children:[i&&Object.keys(i).map(e=>(0,v.jsx)(is,{camImage:a,redirectHandler:this.redirectToSelectAddress,address:(0,he.FR)(i[e].address),activeCount:i[e].activeStatusCount,cameraCount:i[e].cameraCount,name:i[e].name,subscriptionId:e,status:"Active",flow:"Hualai"},e)),n&&Object.keys(n).map(e=>(0,v.jsx)(ns,{camImage:a,redirectHandler:this.redirectToSelectAddress,address:(0,he.FR)(n[e].address),activeCount:n[e].activeStatusCount,cameraCount:n[e].cameraCount,name:n[e].name,subscriptionId:e,status:"Inactive",encSubId:o,rechargeText:l,uom:n[e].uom,packType:n[e].packType,flow:"Google"},e))]})})]})})})]}):(0,v.jsx)(u.A,{})}}const ds=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),openModal:(0,F.zH)(U.qf,e)}))(cs),ms=e=>{const{toggle:t,isOpen:s,address:a,pageData:r}=e;return(0,v.jsx)(ot.A,{className:(s?"sel ":"")+"select-addr-card",children:(0,v.jsxs)(lt.A,{className:"radio-button",children:[(0,v.jsxs)("div",{className:"relocation-label",onClick:()=>t(r.price),children:[(0,v.jsx)("input",{className:"form-check-input",type:"radio",name:"addr_type",id:"radio1",value:"SA",checked:s}),(0,v.jsxs)("label",{className:(s?"":"sel ")+"form-check-label dflex-sb dflex",children:[(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"chnl-name d-block bold",children:r.title})}),(0,v.jsx)("div",{children:(0,v.jsxs)("span",{className:"chnl-name d-block bold",children:[(0,v.jsx)("span",{className:"fs14",children:"â¹"}),r.price]})})]})]}),(0,v.jsx)(D.A,{isOpen:s,children:(0,v.jsxs)("div",{className:"dflex-sb relocation-body accdesc",children:[(0,v.jsx)("p",{children:r.text}),(0,v.jsx)("p",{children:`Address: ${(0,he.FR)(a)}`})]})})]})})},us=e=>{const{setSelectedAddress:t,toggle:s,isOpen:r,addressList:i,pageData:n,history:o,formUrl:l,source:d}=e,m=d||"ha",[u,h]=(0,a.useState)(0),p=l||`${c.A.home_automation}/add-relocation-address`,g=()=>{const e=(0,he.u6)(m);(0,x.Sw)({event:"ctaClick",clickText:"+ Add new Address","Type of Journey":`HA - Secure ${"ha_plus"===m?"Plus":""} - Relocation`,"Sub ID":(0,x.Xo)().id||null,productName:e&&e.relocate_session&&e.relocate_session.name,subscriptionID:e&&e.relocate_session&&e.relocate_session.subscriptionId,productPrice:n&&n.price})};return(0,v.jsx)(ot.A,{className:(r?"sel ":"")+"select-addr-card",children:(0,v.jsxs)(lt.A,{className:"radio-button",children:[(0,v.jsxs)("div",{className:"relocation-label",onClick:()=>s(n.price),children:[(0,v.jsx)("input",{className:"form-check-input",type:"radio",name:"addr_type",id:"radio1",value:"DA",checked:r}),(0,v.jsxs)("label",{className:(r?"":"sel ")+"form-check-label dflex-sb dflex",children:[(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"chnl-name d-block bold",children:n.title})}),(0,v.jsx)("div",{children:(0,v.jsxs)("span",{className:"chnl-name d-block bold",children:[(0,v.jsx)("span",{className:"fs14",children:"â¹"}),n.price]})})]})]}),(0,v.jsx)(D.A,{isOpen:r,children:(0,v.jsxs)("div",{className:"dflex-sb relocation-body accdesc gray-txt",children:[(0,v.jsx)("p",{children:n.text}),i&&Array.isArray(i)&&i.length>0&&i.map((e,s)=>
1(0,v.jsx)("div",{className:(u===s?"activecard ":"")+"newadd-blk linktext",onClick:()=>((e,s)=>{h(s),t(e,n.price)})(e,s),children:`Address: ${(0,he.FR)(e)}`},s)),(0,v.jsx)("a",{type:"button",href:"javascript:void(0)",className:"mT20 d-block bold",onClick:()=>(()=>{g();const e=(0,he.u6)(m),{relocate_session:t}=e;t.charges=n.price,(0,he.e)(m,e),o.push(`/${p}`)})(),style:{width:"100%"},children:"+ Add new Address"})]})})]})})};class hs extends a.Component{constructor(...e){super(...e),this.state={selectedValue:"SA",isOpen:!0,currentAddress:null,associatedAddress:null,title:null,sameAddrData:null,diffAddrData:null,selectedAddr:null,price:500,render:!1,bottomTxt:null},this.getPageData=async()=>{const{setApiError:e,history:t}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/select-relocation-address.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s=e.field_json.filter(e=>"SA"===e.type)[0],a=e.field_json.filter(e=>"DA"===e.type)[0],r=s.bottom_text,{title:i}=e;this.setState({sameAddrData:s,diffAddrData:a,title:i,price:s.price,render:!0,bottomTxt:r})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubscriptionAddresses=async()=>{const{setApiError:e}=this.props;try{const t=(0,he.u6)("ha_plus"),{relocate_session:{subscriptionId:s}}=t,a=JSON.parse(localStorage.userAuth),{subId:r}=a,i={subscriberId:r.id,subscriptionId:s},{data:n}=await f.n.postData("order/addressDetails",i);if(n.message===c.A.MESSAGES_TYPES.SUCCESS){const{associatedAddress:t,currentAddress:s}=n.data;s&&t||e(c.A.serverError,!0),this.setState({associatedAddress:t,currentAddress:s,selectedAddr:s,render:!0})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.setSelectedAddress=(e,t)=>{this.setState({selectedAddr:e,price:t})},this.toggle=e=>{const{isOpen:t,currentAddress:s,associatedAddress:a,sameAddrData:r,diffAddrData:i}=this.state,n=t?"DA":"SA";t?a&&Array.isArray(a)&&a.length>0?this.setState({isOpen:!t,selectedValue:n,selectedAddr:a[0],price:e,bottomTxt:i.bottom_text}):this.setState({isOpen:!t,selectedValue:n,price:e}):this.setState({isOpen:!t,selectedValue:n,selectedAddr:s,price:e,bottomTxt:r.bottom_text})},this.handleSubmit=async e=>{this.selectAddressGaEvent(),this.setState({render:!1}),e.preventDefault();try{const{currentAddress:e,selectedAddr:t,price:s,selectedValue:a}=this.state,{setApiError:r,history:i}=this.props,{relocate_session:{orderUuid:n}}=(0,he.u6)("ha_plus");let o;"SA"===a?(e.addressType="TO_EXISTING",o={addressFrom:e,addressTo:e,charges:s,orderType:"RE_SA",orderUuid:n}):(t.addressType="TO_EXISTING",o={addressFrom:e,addressTo:t,charges:s,orderType:"RE_OA",orderUuid:n});const{data:l}=await f.n.postData("order/address/create/relocation",o);l.message===c.A.MESSAGES_TYPES.SUCCESS?i.push(`/${c.A.home_automation}/${j.dY}/relocation-summary`):r(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}},this.selectAddressGaEvent=()=>{const e=(0,he.u6)("ha_plus"),{relocate_session:{subscriptionId:t}}=e,{selectedValue:s,price:a}=this.state;(0,x.Sw)({event:"selectRelocationAddress",clickText:"Continue",eventAction:"SA"===s?"Within Same Adresss":"To a different Address","Type of Journey":"HA - Secure Plus - Relocation","Sub ID":(0,x.Xo)().id||null,productName:e.relocate_session.name,subscriptionID:t,productPrice:a})}}
1componentDidMount(){this.getPageData(),this.getSubscriptionAddresses()}render(){const{history:e}=this.props,{isOpen:t,associatedAddress:s,currentAddress:a,sameAddrData:r,diffAddrData:i,title:n,render:o,bottomTxt:l}=this.state;return o&&a&&s&&r&&i&&n?(0,v.jsxs)("div",{className:"ipl_event",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("form",{onSubmit:this.handleSubmit,children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)(G,{history:e,type:"history_back"}),(0,v.jsx)("div",{className:"heading-md ",style:{marginBottom:"24px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:n})}),(0,v.jsx)("div",{className:"innercontainer-sm",children:(0,v.jsxs)("div",{className:"select-relocation-wrapp mT30",children:[(0,v.jsx)(ms,{toggle:this.toggle,isOpen:t,address:a,pageData:r}),(0,v.jsx)(us,{toggle:this.toggle,isOpen:!t,addressList:s,pageData:i,setSelectedAddress:this.setSelectedAddress,history:e,formUrl:`${c.A.home_automation}/${j.dY}/add-relocation-address`,source:"ha_plus"})]})}),(0,v.jsx)("div",{className:"text-center block mT32",children:(0,v.jsx)("button",{className:"btn btn-primary waves-effect waves-light btn-height",type:"submit",children:" Continue "})}),l&&(0,v.jsx)("div",{className:"innercontainer-sm",children:(0,v.jsx)("p",{className:"mT20 text-center fs12",children:l})})]})})})})]}):(0,v.jsx)(u.A,{})}}const ps=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(hs),gs=["hasErrors"];function fs(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function xs(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?fs(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):fs(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class bs extends a.Component{constructor(...e){super(...e),this.initialForm={pinCode:{wrapperClasses:["form-group","pincode-field","more-connection-pincode"],labelConfig:{label:"Pin code",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"pinCode",type:"tel",placeholder:"",maxLength:6,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},location:{wrapperClasses:["form-group","location-field"],labelConfig:{label:"Location",classes:["sel","active","mendate"]},elementType:"select",elementConfig:{id:"location",placeholder:"",options:[{label:"select",value:""}]},value:"",errorMessage:"",valid:!0,touched:!1},building:{wrapperClasses:["form-group","building-field"],labelConfig:{label:"Building Name",classes:["sel","active"]},elementType:"input",elementConfig:{id:"building",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine1:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Address Line 1",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"adrLine1",type:"text",placeholder:"",maxLength:75,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine2:{wrapperClasses:["form-group","addr2-field"],labelConfig:{label:"Address Line 2",classes:["sel","active"]},elementType:"input",elementConfig:{id:"adrLine2",type:"text",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},landmark:{wrapperClasses:["form-group","landmark-field"],labelConfig:{label:"Landmark",classes:["sel","active"]},elementType:"input",elementConfig:{id:"landmark",type:"text",placeholder:"",maxLength:25,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},city:{wrapperClasses:["form-group","city-field"],labelConfig:{label:"City",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"city",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},state:{wrapperClasses:["form-group","state-field"],labelConfig:{label:"State",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"state",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},email:{wrapperClasses:["form-group","email-field"],labelConfig:{label:"Email",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"email",type:"email",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}},this.state={termsChecked:!0,showCheckError:!1,render:!0,infoForm:xs({},this.initialForm),formErrorMessage:null,button:{buttonConfig:{type:"submit",class:"wAutoLgBlue"},text:"Save",url:"select-language",disabled:!1},currentAddress:null,pageData:null},this.bodyRef=a.createRef(),this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/add-relocation-address-google.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,termsTxt:e.body,pincodeErr:e.field_json.pincode_err,stateErr:e.field_json.state_err};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubsciberDetails=async()=>{const e=JSON.parse(localStorage.userAuth),{subId:t}=e,s={subscriberId:t.id,source:"WEB"};try{const{data:e}=await f.n.postData("order/address/getAddress",s);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){this.setInfoForm(e.data);const t=e.data,{infoForm:s}=this.state,a=xs({},s),{city:r,pinCode:i,state:n}=a;r.value=t.city||"",i.value=t.areaPincode||"",n.value=t.state||"",this.setState({infoForm:a},()=>this.getPinCodeData(t.areaPincode))}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}},this.getSubscriptionAddresses=async()=>{const{setApiError:e}=this.props;try{const t=(0,he.u6)("ha_plus"),{relocate_session:s}=t,{subscriptionId:a}=s,r=JSON.parse(localStorage.userAuth),{subId:i}=r,n={subscriberId:i.id,subscriptionId:a},{data:o}=await f.n.postData("order/addressDetails",n);if(o.message===c.A.MESSAGES_TYPES.SUCCESS){const{currentAddress:e}=o.data;this.setState({currentAddress:e})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.setInfoForm=e=>{const{infoForm:t}=this.state,s=xs({},t),{adrLine1:a,adrLine2:r,city:i,email:n,pinCode:o,state:l,building:c,landmark:d,location:m}=s;a.value=e.streetAddress||"",r.value=e.streetAddress2||"",m.value=e.location||"",i.value=e.city||"",n.value=e.emailId||"",o.value=e.postalCode||"",l.value=e.state||"",c.value=e.building||"",d.value=e.landmark||"",e.termsChecked&&this.setState({termsChecked:e.termsChecked}),this.setState({infoForm:s,render:!0},()=>this.getPinCodeData(e.postalCode))},this.inputChangedHandler=(e,t)=>{const{infoForm:s}=this.state,a=xs({},s),{location:r}=a,i=xs({},a[t]);let n=e;"pinCode"===t&&(n=n.replace(/[^0-9]/g,""),n.length>6&&(n=n.slice(0,6)),6===n.length&&this.getPinCodeData(n,!0),n.length<6&&(r.elementConfig.options=[{label:"select",value:""}],r.value=null,this.setState({infoForm:a}))),i.value=n,i.touched=!0,i.valid=!0,i.errorMessage="",a[t]=i,this.setState({infoForm:a})},this.getPinCodeData=async e=>{if(!e)return;const{setApiError:t}=this.props;try{const{data:t}=await f.n.getData(`payment/pincode/getPinDetailsByZipCode/${e}/Google`),{infoForm:s,pageData:a}=this.state,r=xs({},s),{city:i,pinCode:n,state:o,location:l}=r,c=t.data;if(c&&Array.isArray(c)&&c.length>0){if(o.value&&o.value!==c[0].state.trim())return n.valid=!1,n.errorMessage=a&&a.stateErr||"State is different",void this.setState({infoForm:r});i.value=c[0].city.trim(),n.value=c[0].zipcode,n.valid=!0,o.value=c[0].state.trim();const e=c&&c.map(e=>({label:e.location,value:e.location}));l.elementConfig.options=[{label:"select",value:""},...e]}else n.valid=!1,n.errorMessage=a&&a.pincodeErr||"Apologies, currently we are unavailable in your city. We will be launching soon!";this.setState({infoForm:r})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.validateForm=async e=>{e.preventDefault();const{infoForm:t,termsChecked:s,currentAddress:a}=this.state,{history:r,setApiError:i}=this.props,n={},o=Object.keys(t);o.forEach(e=>{n[e]=t[e].value});const l=H(n),{hasErrors:d}=l,m=(0,I.A)(l,gs);if(d){const e=xs({},t);let s=null;o.forEach((t,a)=>{0===a&&(s=t);const r=m[`${t}Message`];r&&""!==r&&(e[t].valid=!1,e[t].errorMessage=r)}),this.setState({infoForm:e,formErrorMessage:""}),s&&document.getElementById(s).scrollIntoView()}else{let e=!0;if(o.forEach(s=>{t[s].valid||(e=!1)}),e){if(!s)return void this.setState({showCheckError:!0,render:!0});const e={postalCode:t.pinCode.value.trim(),streetAddress:t.adrLine1.value.trim(),streetAddress2:t.adrLine2.value.trim(),city:t.city.value.trim(),landmark:t.landmark.value.trim(),location:t.location.value.trim(),emailId:t.email.value.trim(),state:t.state.value.trim(),building:t.building.value.trim(),termsChecked:s},n=(0,he.u6)("ha_plus"),{relocate_session:o}=n;o.relocation_address=e,(0,he.e)("ha_plus",n);const{address:l,orderUuid:d,charges:m}=o;e.addressType="TO_NEW";const u={addressFrom:l||a,addressTo:e,charges:m,orderType:"RE_OA",orderUuid:d};try{const{data:e}=await f.n.postData("order/address/create/relocation",u);if(e.message===c.A.MESSAGES_TYPES.SUCCESS)r.push(`/${c.A.home_automation}/${j.dY}/relocation-summary`);else{const s=e.message.charAt(0).toUpperCase()+e.message.slice(1).toLowerCase();t.pinCode.valid=!1,this.setState({infoForm:t,formErrorMessage:s})}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||i(c.A.serverError,!0)}}}},this.inputCheckHandler=()=>{const{termsChecked:e,showCheckError:t}=this.state;this.setState({termsChecked:!e},()=>{const{termsChecked:e}=this.state;e&&t&&this.setState({showCheckError:!1})})}}async componentDidMount(){this.bodyRef.current&&this.bodyRef.current.scrollTo(0,0);const{history:e}=this.props,t=(0,he.u6)("ha_plus");if(t){const{relocate_session:s}=t;s||e.push(`/${c.A.home_automation}/${j.dY}/`)}else e.push(`/${c.A.home_automation}/${j.dY}/`);await this.getPageData();const{relocate_session:s}=t,{relocation_address:a,address:r}=s;a&&""!==a.postalCode?(this.setState({render:!1}
1),this.setInfoForm(a)):this.getSubsciberDetails(),r||this.getSubscriptionAddresses()}render(){const{button:e,infoForm:t,render:s,formErrorMessage:r,termsChecked:i,showCheckError:n,pageData:o}=this.state,{history:l}=this.props,c=[];return Object.keys(t).forEach(e=>{c.push({id:e,config:t[e]})}),(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{ref:this.bodyRef,children:[!s&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:l,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:o&&o.title})}),(0,v.jsx)("div",{className:"body-container innercontainer-sm pB0",children:(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"innercontainer-xs install-wrapp",children:[(0,v.jsx)("div",{className:"orderttl",children:"New Relocation Address"}),c&&c.map(e=>(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)},e.id)),o&&(0,v.jsxs)("div",{className:"mT32 text-center ha-plus-tnc",children:[(0,v.jsx)("input",{type:"checkbox",className:"filled-in form-check-input",id:"checkbox1",checked:i?"checked":"",onClick:()=>this.inputCheckHandler()}),(0,v.jsx)(b.A,{Tag:"label",className:"form-check-label fs12",htmlFor:"checkbox1",htmlContent:o.termsTxt})]}),n&&(0,v.jsx)("span",{className:"validate invalid-text",style:{marginTop:"10px"},children:"This field is required"})]}),(0,v.jsxs)("div",{className:"btn-contr text-center more-connection-btn",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",children:r}),(0,v.jsx)(R.A,{disabled:e.disabled,config:e.buttonConfig,content:e.text,onClick:e=>this.validateForm(e)})]})]})})]})]})})]})})}}const vs=(0,l.Ng)(e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}),null)(bs),ys={setApiError:g.x8};class Ss extends a.Component{constructor(...e){super(...e),this.state={render:!1,isSame:!1,addressTo:null,addressFrom:null,charges:null,count:null,pageMetaData:null,disableSubmit:!1},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/relocation-summary.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,subTitle:e.field_subtitle,diffText:e.field_json.different_text,sameText:e.field_json.same_text,camText:e.field_json.camera_text,btnText:e.field_json.button_text,text:e.field_json.text};this.setState({pageMetaData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSummaryData=async()=>{const{setApiError:e}=this.props;try{const{relocate_session:{orderUuid:t}}=(0,he.u6)("ha_plus"),{data:s}=await f.n.getData(`order/getRelocationSummary/${t}`);if(s.message===c.A.MESSAGES_TYPES.SUCCESS){const e=s.data;if(e.addressSame){const{addressSame:t,charges:s,count:a}=e;this.setState({isSame:!0,addressTo:t,count:a,charges:s,render:!0})}else{const{addressFrom:t,addressTo:s,charges:a,count:r}=e;this.setState({isSame:!1,addressFrom:t,addressTo:s,charges:a,count:r,render:!0})}}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.submitHandler=async()=>{this.relocationSummaryGaEvent(),this.setState({disableSubmit:!0});const{history:e,setApiError:t}=this.props;try{const{relocate_session:{orderUuid:s}}=(0,he.u6)("ha_plus"),{data:a}=await f.n.postData(`order/submit-relocation/${s}`);a.status?a.message===c.A.MESSAGES_TYPES.SUCCESS?e.push(`/${c.A.home_automation}/${j.dY}/relocation-success`):e.push(`/${c.A.home_automation}/${j.dY}/relocation-failure`):t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.relocationSummaryGaEvent=()=>{const{isSame:e,charges:t}=this.state,s=(0,he.u6)("ha_plus");(0,x.Sw)({event:"okayGotItClick",clickText:"Okay got it",eventAction:e?"Within Same Adresss":"To a different Address","Type of Journey":"HA - Secure Plus - Relocation","Sub ID":(0,x.Xo)().id||null,productName:s.relocate_session.name,subscriptionID:s.relocate_session.subscriptionId,productPrice:t})}}componentDidMount(){const{history:e}=this.props,t=(0,he.u6)("ha_plus");if(t){const{relocate_session:s}=t;s||e.push(`/${c.A.home_automation}/${j.dY}`)}else e.push(`/${c.A.home_automation}/${j.dY}`);
1this.getPageMetaData(),this.getSummaryData()}render(){const{render:e,isSame:t,addressTo:s,addressFrom:r,charges:i,count:n,pageMetaData:o,disableSubmit:l}=this.state,{history:c}=this.props;return(0,v.jsxs)(a.Fragment,{children:[(!e||!o)&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:c,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[o&&(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:o.title}),(0,v.jsx)("h2",{className:"ha-heading2",children:o.subTitle})]}),(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-sm-xs summary posR",children:[(0,v.jsxs)(ot.A,{className:"relocation-summary-card",children:[(0,v.jsxs)(lt.A,{children:[t&&o&&s&&(0,v.jsx)("div",{className:"inner-card-body addr",id:"same-addr",children:(0,v.jsxs)("section",{className:"v-start-top",children:[(0,v.jsxs)("h3",{className:"ha-heading2 mT0 ",children:[o.sameText,(0,v.jsx)("span",{className:"label-text d-block mB0 mT10",children:`Address: ${(0,he.FR)(s)}`})]}),(0,v.jsxs)("span",{className:"payment-left-amount",children:[(0,v.jsx)("span",{className:"rupee fs14",children:"â¹"}),i]})]})}),o&&!t&&s&&r&&(0,v.jsx)("div",{className:"inner-card-body addr",id:"diff-addr",children:(0,v.jsxs)("section",{className:"v-start-top",children:[(0,v.jsxs)("h3",{className:"ha-heading2 mT0",children:[o.diffText,(0,v.jsx)("div",{children:(0,v.jsxs)("span",{className:"label-text d-block mB0 mT10",children:[(0,v.jsx)("span",{className:"bold black",children:"From: "}),(0,he.FR)(r)]})}),(0,v.jsx)("div",{className:"mT10",children:(0,v.jsxs)("span",{className:"label-text d-block mB0",children:[(0,v.jsx)("span",{className:"bold black",children:"To: "}),(0,he.FR)(s)]})})]}),(0,v.jsxs)("span",{className:"payment-left-amount",children:[(0,v.jsx)("span",{className:"rupee fs14",children:"â¹"}),i]})]})}),o&&n&&(0,v.jsx)("div",{className:"inner-card-body qnty border-none pB0 mB0",id:"new",children:(0,v.jsx)("section",{className:"v-start-top",children:(0,v.jsxs)("h3",{className:"ha-heading2 mT0",children:[o.camText,(0,v.jsx)("span",{className:"label-text d-block mB0",children:`Qty. ${n}`})]})})})]}),(0,v.jsxs)(ct.A,{className:"card-footer",children:[(0,v.jsx)("h2",{className:"ha-heading2 bold",children:"Total Amount"}),i&&(0,v.jsx)("span",{className:"mB0 text-right",children:(0,v.jsxs)("span",{className:"price-xs mR0",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"count",children:i})]})})]})]}),o&&(0,v.jsx)("p",{className:"mT20 text-center fs12",children:o.text}),(0,v.jsxs)("div",{className:"text-center block mT32",children:[" ",!l&&(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light btn-height",style:{display:"inline-flex"},href:"javascript:void(0)",onClick:()=>this.submitHandler(),children:o&&o.btnText}),l&&(0,v.jsx)("button",{className:"btn btn-primary waves-effect waves-light btn-height",style:{display:"inline-flex"},disabled:l,type:"button",children:o&&o.btnText})," "]})]})})]})]})})]})}}const js=(0,l.Ng)(null,ys)(Ss),As=e=>{const{title:t,subtitle:s,btnText:r,btnUrl:i}=e,[n,o]=(0,a.useState)(null);return(0,a.useEffect)(()=>{const e=(0,x.Bd)();e&&o(e)},[]),(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#FF0600",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("line",{className:"path line",fill:"none",stroke:"#FF0600",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",x1:"34.4",y1:"37.9",x2:"95.8",y2:"92.3"}),(0,v.jsx)("line",{className:"path line",fill:"none",stroke:"#FF0600",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",x1:"95.8",y1:"38",x2:"34.4",y2:"92.2"})]}),(0,v.jsxs)("div",{className:"heading-md mT20",children:[t&&(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:t}),s&&(0,v.jsx)("h2",{className:"heading2",children:s})]}),!n&&(0,v.jsx)("div",{className:"body-container",children:(0,v.jsx)("div",{className:"text-center mT20 w-auto",children:r&&i&&(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light btn-style",href:i,children:r})})})]})})})]})},Ns={setApiError:g.x8},Cs=(0,l.Ng)(null,Ns)(e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha_plus"),{history:o}=e;return(0,a.useEffect)(()=>{n||o.push(`/${c.A.home_automation}/${j.dY}`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/relocation-failure.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,a=t.field_json.button_url?`/${c.A.home_automation}${t.field_json.button_url}`:`/${c.A.home_automation}/system/tata-play-secure-plus/gethelp`,r={title:t.title,subtitle:t.field_subtitle,btn_text:t.field_json.button_text,btn_url:a};s(r),i(!0)}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})});function ws(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}const _s={setApiError:g.x8},Es=(0,l.Ng)(null,_s)(e=>{const{setApiError:t}=e,[s,r]=(0,a.useState)({name:null,count:null,haId:null,addressTo:null,addressFrom:null,isSame:null}),[i,n]=(0,a.useState)(null),[o,l]=(0,a.useState)(!1),d=async()=>
1{l(!1);try{const e=(0,he.u6)("ha_plus");e||t(c.A.serverError,!0);const{relocate_session:{orderUuid:s}}=e,{data:a}=await f.n.getData(`order/getRelocationSummary/${s}`);if(a.message===c.A.MESSAGES_TYPES.SUCCESS){const e=a.data,{count:t,name:s,haId:i}=e,n={count:t,name:s,haId:i};if(e.addressSame){const{addressSame:t}=e;n.addressTo=t,n.isSame=!0}else{const{addressTo:t,addressFrom:s}=e;n.addressTo=t,n.addressFrom=s,n.isSame=!1}m(n),r(function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?ws(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ws(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},n)),l(!0)}else t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}};(0,a.useEffect)(()=>{(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/relocation-success-google.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,s={title:t.title,confirmImg:t.field_image,confirmTxt:t.field_json.confirm_text,btnTxt:t.field_json.button_text};n(s),l(!0)}else t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}})(),d()},[]);const m=e=>{const t=(0,he.u6)("ha_plus");(0,x.Sw)({event:"relocationSuccess",transactionID:e.haId,eventAction:e.isSame?"Within Same Adresss":"To a different Address","Type of Journey":"HA - Secure Plus - Relocation","Sub ID":(0,x.Xo)().id||null,productName:e.name,subscriptionID:t.relocate_session.subscriptionId,productPrice:""})};return o?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[i&&(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:i.title}),s.haId&&(0,v.jsx)("div",{className:"fs16 bold mB20 mT10",children:`Order Id: ${s.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("div",{className:"insta-blk-wrapp",children:[(0,v.jsx)("div",{className:"insta-blk-text bold",children:" Relocation Details:"}),(0,v.jsx)("div",{className:"insta-blk",children:(0,v.jsxs)("div",{className:"addr",id:"same-addr",children:[s.isSame&&s.addressTo&&(0,v.jsx)("div",{className:"insta-icon-wrapp mR0",children:(0,v.jsx)("div",{className:"fs14",children:`Address: ${(0,he.FR)(s.addressTo)}`})}),!s.isSame&&s.addressFrom&&s.addressTo&&(0,v.jsxs)("div",{className:"mR0",children:[(0,v.jsxs)("div",{className:"fs14",children:[(0,v.jsx)("span",{className:"bold black",children:"From: "}),(0,he.FR)(s.addressFrom)]}),(0,v.jsxs)("div",{className:"fs14 mT10",children:[(0,v.jsx)("span",{className:"bold black",children:"To: "}),(0,he.FR)(s.addressTo)]})]}),s.name&&s.count&&(0,v.jsx)("div",{className:"insta-icon-wrapp mB0 mR0 mT15",style:{marginTop:"15px"},children:(0,v.jsx)("div",{className:"fs14",children:`Qty: ${s.count} ${s.name}`})})]})})]}),i&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"certified-wrapp",children:[(0,v.jsx)("span",{children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+i.confirmImg.url,alt:i.confirmImg.alt,className:"img-fluid"})}),i.confirmTxt]}),(0,v.jsx)("div",{className:"footer-contr text-center mT20 block",children:(0,v.jsx)("a",{onClick:()=>{(0,x.Sw)({event:"ctaClick",clickText:"BAck to Tata Play Home","Type of Journey":"HA - Secure Plus - Relocation","Sub ID":(0,x.Xo)().id||null})},className:"btn btn-primary waves-effect waves-light btn-height",href:`/${c.A.home_automation}/${j.dY}`,children:i.btnTxt})})]})]})]})})})]}):(0,v.jsx)(u.A,{})}),Ts=e=>{const[t,s]=(0,a.useState)(null),{error:r}=e;return(0,a.useEffect)(()=>{const e=(0,x.Bd)();e&&s(e)},[]),(0,v.jsx)("div",{className:"content-container",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#FF0600",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("line",{className:"path line",fill:"none",stroke:"#FF0600",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",x1:"34.4",y1:"37.9",x2:"95.8",y2:"92.3"}),(0,v.jsx)("line",{className:"path line",fill:"none",stroke:"#FF0600",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",x1:"95.8",y1:"38",x2:"34.4",y2:"92.2"})]}),(0,v.jsxs)("div",{className:"heading-md mT20",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:"Oops! Payment failed"}),!t&&(0,v.jsx)("h2",{className:"ha-heading2",children:"Choose a different payment option from the payment page"})]}),(0,v.jsxs)("div",{className:"body-container",children:[r&&(0,v.jsx)("p",{children:r}),t?(0,v.jsxs)("div",{children:[(0,v.jsx)("br",{}),(0,v.jsx)("p",{children:"There is no sufficient EVD Balance to create the Tsecure Work order, please contact your Distributor / DSR to get EVD Balance"}),(0,v.jsx)("p",{children:"OR"}),(0,v.jsx)("p",{children:"If any EVD amount is deducted from your EVD Balance, the amount will be credited to Customer Account Shortly !"})]}):(0,v.jsx)("p",{children:"If any amount is deducted from your bank, it will be refunded in next 7 business days"}),(0,v.jsx)("div",{id:"loader-wrapper-inner",children:(0,v.jsx)("div",{id:"loader-inner"})})]})]})})})},Ds=e=>{const{error:t}=e.location&&e.location.data||{};return(0,a.useEffect)(()=>{const{history:t}=e;setTimeout(()=>{const e=(0,he.u6)("ha_plus"),s=e.orderType&&"ADD_CAM"===e.orderType?"add-camera":"bundle";e.orderType=null,(0,he.e)("ha_plus",e),t.push(`/${c.A.home_automation}/${j.dY}/${s}`)},5e3)},[]),(0,v.jsx)(Ts,{error:t})},Os=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha_plus"),o=m()(n,"isSms",!1),{history:l,setApiError:d}=e;return(0,a.useEffect)(()=>{n||l.push(`/${c.A.home_automation}/${j.dY}`);const{error:e}=(0,x.vA)(location.search);e&&"account_already_linked"===e&&(o?l.push(`/${c.A.home_automation}/${j.dY}/sms/sms-account-already-linked`):l.push(`/${c.A.home_automation}/${j.dY}/account-already-linked`)),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/account-linking-failure.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const{id:t}=(0,he.HW)(),a=e.data,r={title:a.title,subtitle:a.field_subtitle,btn_text:a.field_json.button_text,btn_url:`/${c.A.home_automation}/user/linkAccount/${t}`};s(r),i(!0)}else d(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||d(c.A.serverError,!0)}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})}),ks=e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha_plus"),{history:o}=e;return(0,a.useEffect)(()=>{n||o.push(`/${c.A.home_automation}/${j.dY}`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/demo-installation-failure.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,a={title:t.title,subtitle:t.field_subtitle,btn_text:t.field_json.button_text,btn_url:`/${c.A.home_automation}/${j.dY}`};s(a),i(!0)}}catch(e){}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})},Ps={setApiError:g.x8},Is=(0,l.Ng)(null,Ps)(e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha_plus"),{history:o}=e;return(0,a.useEffect)(()=>{n||o.push(`/${c.A.home_automation}/${j.dY}`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/demo-already-placed.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,a={title:t.title,subtitle:t.field_subtitle,btn_text:t.field_json.button_text,btn_url:`/${c.A.home_automation}/${j.dY}`};s(a),i(!0)}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})}),Ms=e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha_plus"),{history:o}=e;return(0,a.useEffect)(()=>{n||o.push(`/${c.A.home_automation}/${j.dY}`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/installation-failure.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,a={title:t.title,subtitle:t.field_subtitle,btn_text:t.field_json.button_text,btn_url:`/${c.A.home_automation}/${j.dY}`};s(a),i(!0)}}catch(e){console.log("page data error",e)}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})};function $s(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Rs(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?$s(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):$s(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Ls extends a.Component{constructor(...e){super(...e),this.state={render:!1,cartCount:1,miniCount:1,isBundled:!0,cameraPrice:"",subscriptionPrice:"",subscriptionSellingPrice:"",miniPrice:"",dropdownOpen:!1,isOpenCamera:!1,isOpenSubscription:!1,isOpenMini:!1,isCamFeatureOpen:!1,isMiniFeatureOpen:!1,productData:null,subscriptionData:[],selectedSubscription:{},pageTitle:"",showSnack:!1,subtitle:"",pageMeta:null,cartMaxCount:4},this.checkWoStatus=async()=>{this.setState({render:!1});const{setApiError:e,openModal:t,history:s}=this.props;try{const{userAuth:a}=localStorage,{subId:r}=JSON.parse(a),i={subscriberId:r.id},{data:n}=await f.n.postData("order/workorder/getWoPendingStatus",i);if(n.status)return!0;if("FAILURE"!==n.message){const e=!0;return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Oops! Your previous order is pending",body:"To perform any action, we need to close your previous order. Please contact our call centre to get an update on your work order status.",btnTxt:"Ok",redirectUrl:"/",onClose:e},redirectRoute:!0,onCloseEvent:()=>{e&&(window.location.href="/")},history:s}),this.setState({showBlank:!0,render:!0,productData:{}}),!1}e(c.A.serverError,!0)}catch(t){e(c.A.serverError,!0)}},this.checkPaymentStatus=async()=>{const{setApiError:e}=this.props,t=(0,he.u6)("ha_plus");if(!t)return;const{addCameraSession:s}=t;if(s&&s.orderUuid)try{const{data:t}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${s.orderUuid}`);if(t.status&&t.message===c.A.MESSAGES_TYPES.SUCCESS){const s=t.data;if(!s&&!Object.isArray(s)&&s.length<=0)return void e(c.A.serverError,!0);const a=s[0].paymentStatus;let r=null;"SUCCESS"===a?r=j.QZ.SUCCESS:"INPROGRESS"===a?r=j.QZ.AWAITED:"FAILED"===a&&(r=j.QZ.FAILURE),(0,he.VJ)(r,"ADD_CAM","ha_plus")}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.checkHaUser=async()=>{const{setApiError:e,openModal:t,history:s}=this.props,{subId:a}=JSON.parse(localStorage.userAuth),r={subscriberId:a.id,source:"HA",provider:"Google"};try{const{data:e}=await f.n.checkHaUser(r);if(e.message!==c.A.MESSAGES_TYPES.SUCCESS&&!1===e.status)return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Not a valid user! ",body:"We see your account is not valid for this service. Request you to login with a different account",showRecharge:!1,redirectUrl:"/my-account"},onCloseEvent:()=>{const{history:e}=this.props;e.push("/my-account")},history:s}),this.setState({render:!0}),!1;return await this.checkActiveHaUser()}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}return!0},this.checkActiveHaUser=async()=>{this.setState({render:!1});const{pageMeta:e}=this.state,{setApiError:t,openModal:s,history:a}=this.props;try{const{userAuth:r}=localStorage,{subId:i}=JSON.parse(r),n={subscriberId:i.id,provider:"Google"},{data:o}=await f.n.postData("order/checkActiveHAUser",n);if(o.status){const t={};let i,n,l="",c="",d=null,m="",u=!1,h=!1,p=!1;e.popup_config.forEach(e=>{t[e.status.toLowerCase()]=e});const{encSubscriberId:g}=JSON.parse(r),f=g[0];return"inactive"===o.message.toLowerCase()?(l=t.inactive.heading,c=t.inactive.subHeading,m=t.inactive.button_text,i="/",h=!0,p=!0):"temp_suspend"===o.message.toLowerCase()?(l=t.temp_suspend.heading,c=t.temp_suspend.subHeading1,d=t.temp_suspend.subHeading2,m=t.temp_suspend.button_text,i=t.temp_suspend.button_link,n=t.temp_suspend.field_url_source,p=!0,h=!0):"deactivated"===o.message.toLowerCase()&&(l=t.deactivated.heading,c=t.deactivated.subHeading,m=t.deactivated.button_text,u=!0,p=!0,h=!0),!p||(s(L.lx.COMMON_MODAL,{Component:Ne,data:{title:l,body:c,subHeading2:d,showRecharge:u,btnTxt:m,redirectUrl:i,fieldSource:n,encSubId:f},onCloseEvent:()=>{h&&(window.location.href="/")},history:a}),this.popupOpenGaEvent(l),this.setState({showBlank:!0}),!1)}t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.popupOpenGaEvent=e=>{(0,x.Sw)({event:"popUp",popUpAction:"Pop Up Appeared",popUpName:e,"Pop up option selected":"","Sub ID ":(0,x.Xo)().id||null})},this.getJourneyStatus=async()=>{const{setApiError:e}=this.props;try{const{history:t}=this.props,{subId:s}=JSON.parse(localStorage.userAuth),a={subId:s.id,orderType:"ADD_NEW",provider:"Google"},{data:r}=await f.n.postData("package/getOrderStatusBySubId",a);if(r.message===c.A.MESSAGES_TYPES.SUCCESS){const e=r.data;e.cameraCount&&""!==e.cameraCount&&e.miniCount&&""!==e.miniCount&&(0,he.Mg)(e.cameraCount,e.miniCount,"add_cam","ha_plus"),e.address&&"NEW"===e.address.addressType?(0,he.PS)(e.address,"add_cam","ha_plus"):e.address&&"NEW"!==e.address.addressType&&(0,he.PS)({orderUuid:e.address.orderUuid},"add_cam","ha_plus");const s=(0,he.u6)("ha_plus"),{addCameraSession:a}=s;a.statusChecked=!0,"Initiated"!==e.orderStatus&&"Completed"!==e.orderStatus||(a.paymentStatus=j.QZ.SUCCESS),s.orderType="ADD_CAM",(0,he.e)("ha_plus",s);const i=j.MC.addCamOrderStatusList[e.page];i&&"CREATE ADDRESS"!==e.page&&t.push(`/${c.A.home_automation}/${j.dY}/${i}`)}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getPageData=async()=>{const{setApiError:e}=this.props;this.setState({render:!1});try{const t="s3-api/v1/assets/pages/add-camera.json",s=(await f.n.getJsonData(t)).data,a=s.data.field_json;return s.status===c.A.MESSAGES_TYPES.SUCCESS?(this.setState({pageMeta:a,pageTitle:s.data.title,subtitle:s.data.field_subtitle,render:!0}),!0):(e(c.A.serverError,!0),!1)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubscriptionData=async()=>{const{setApiError:e}=this.props,t=new Date;try{const{data:s}=await f.n.getJsonData(`read/core-api/subscription/search/${ne()(t).format("YYYYMMDD")}`);if(s.status===c.A.MESSAGES_TYPES.SUCCESS){if(Array.isArray(s.data)&&s.data.length>0){const e=s.data.filter(e=>e.meta.field_journey&&e.meta.field_journey.includes("google"));if(e.length>0){const t=e.sort((e,t)=>e.deviceCountMin-t.deviceCountMin);this.setState({subscriptionData:t,cartMaxCount:e[0].maxCount},()=>{})}}}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getProductsData=async()=>{const{setApiError:e}=this.props;new Date;try{const{data:t}=await f.n.getJsonData("read/core-api/product/search/eyJmaWVsZF9qb3VybmV5IjoiZ29vZ2xlIn0="),s={},{cartCount:a}=this.state;if(t.status===c.A.MESSAGES_TYPES.SUCCESS){if(t.data.forEach(e=>{s[e.field_type&&e.field_type.toLowerCase()]=Rs({},e)}),this.setState({productData:Rs({},s)}),s.camera&&this.setState({cameraPrice:parseInt(s.camera.field_actualprice,10)*a,cameraSellPrice:parseInt(s.camera.field_discountprice,10)*a}),s["home mini"]){let e=a;s["home mini"].field_quantity&&"false"===s["home mini"].field_is_bundeled&&(e=parseInt(s["home mini"].field_quantity,10)),this.setState({miniPrice:parseInt(s["home mini"].field_actualprice,10)*e,miniSellPrice:parseInt(s["home mini"].field_discountprice,10)*e,miniCount:e,isBundled:s["home mini"].field_is_bundeled,render:!0})}}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.toggleAccordion=(e,t)=>{e.preventDefault(),this.setState({[t]:!this.state[t]})},this.handleSubmit=async e=>{const{productData:t,cartCount:s,miniCount:a}=this.state,{history:r,setApiError:i}=this.props;this.setState({render:!1});if(!await this.checkHaUser())return;const n=[],o=JSON.parse(t.camera.field_json).summary_text,l=JSON.parse(t["home mini"].field_json).summary_text;n.push({productUuid:t.camera.field_uuid,count:s,description:o||""}),n.push({productUuid:t["home mini"].field_uuid,count:a,description:l||""});const d=JSON.parse(localStorage.userAuth),{subId:{id:m}}=d,u={subId:m,product:[...n],provider:"Google"};try{const t=(0,he.u6)("ha_plus"),n=[j.QZ.SUCCESS,j.QZ.AWAITED,j.QZ.FAILURE],{addCameraSession:{camCount:o,prevCartCount:l,paymentStatus:d}}=t;if(o!==l||d&&n.includes(d)){const{data:t}=await f.n.postData("order/createAddNewCameraOrder",u);
1if(t.message===c.A.MESSAGES_TYPES.SUCCESS){if(!c.A.isServer()){const r=(0,he.u6)("ha_plus"),{addCameraSession:i}=r;i.paymentStatus=null,i.camCount=s,i.miniCount=a,i.prevCartCount=s,i.orderUuid=t.data.orderUuid,i.maxCount=parseInt(e.maxCount,10),i.gaInfo=this.getGaInfo(this.state.subscriptionData),(0,he.e)("ha_plus",r)}}else i(c.A.serverError,!0)}r.push(`/${c.A.home_automation}/${j.dY}/add-camera-select-address`)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||i(c.A.serverError,!0)}this.gaCheckoutEvent()},this.gaCheckoutEvent=()=>{const e=this.getGaInfo(this.state.subscriptionData);(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Add Camera",event:"checkout",ecommerce:{checkout:{actionField:{step:1,option:"Cart view"},products:[{name:"Tata Play Secure plus",id:e.id,price:e.price,brand:"Tata Play",category:"Home Automation",variant:"Google",quantity:this.state.cartCount,productName:e.ProductName}]}}})},this.handleCartItemCount=e=>{const{cartCount:t,miniCount:s,isBundled:a,cartMaxCount:r}=this.state;let i=0,n=s;"minus"===e?(i=parseInt(t,10)-1,s&&"true"===a&&(n=parseInt(s,10)-1)):"plus"===e&&(i=parseInt(t,10)+1,s&&"true"===a&&(n=parseInt(s,10)+1)),i>r?this.setState({showSnack:!0}
1):i<1||this.setState({cartCount:i,miniCount:n},()=>{this.handleCartPrice(),(0,he.Mg)(i,n,"add_cam","ha_plus"),this.addRemoveCartGaEvent(e,!1)})},this.addRemoveCartGaEvent=(e,t)=>{const s=this.getGaInfo(this.state.subscriptionData),{cartCount:a}=this.state;"minus"===e&&(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Add Camera",event:"removeFromCart",ecommerce:{remove:{products:[{name:"Tata Play Secure Plus",id:s.id,price:s.singlePrice,brand:"Tata Play",category:"Home Automation",variant:"Google",list:"NA",quantity:1,productName:s.ProductName}]}}}),"plus"===e&&(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Add Camera",event:"addToCart",ecommerce:{currencyCode:"INR",add:{products:[{name:"Tata Play Secure Plus",id:s.id,price:t?s.price:s.singlePrice,brand:"Tata Play",category:"Home Automation",variant:"Google",list:"NA",quantity:t?a:"1",productName:s.ProductName}]}}})},this.gaProductDetailEvent=e=>{const t=this.getGaInfo(e);(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Add Camera",event:"productDetailView",ecommerce:{detail:{actionField:"",products:[{name:"Tata Play Secure Plus",id:t.id,price:t.initialPrice,brand:"Tata Play",category:"Home Automation",variant:"Google",productName:t.ProductName}]}}})},this.getGaInfo=e=>{const{cartCount:t,productData:s,miniCount:a}=this.state,r=s&&s.camera&&s.camera.field_discountprice,i=s&&s.camera&&s["home mini"].field_discountprice,n=parseInt(r,10)*t,o=parseInt(i,10)*a;let l={};e.forEach(e=>{t>=e.deviceCountMin&&(l=e)});const c=parseInt(l.discountedPrice,10);return{id:l.id,price:o+n+c,packName:l.friendlyName,ProductName:`${s.camera.title}, ${s["home mini"].title}, ${l.friendlyName}`,initialPrice:parseInt(r,10)+parseInt(i,10)+c,singlePrice:parseInt(r,10)+parseInt(i,10)}},this.handleCartPrice=()=>{const{cartCount:e,productData:t,miniCount:s}=this.state,a=t.camera.field_actualprice,r=t.camera.field_discountprice,i=t["home mini"].field_actualprice,n=t["home mini"].field_discountprice;this.setState({cameraPrice:parseInt(a,10)*e,cameraSellPrice:parseInt(r,10)*e,miniPrice:parseInt(i,10)*s,miniSellPrice:parseInt(n,10)*s})},this.closeAlert=e=>{e.stopPropagation(),this.setState({showSnack:!1})}}async componentDidMount(){let e=(0,he.u6)("ha_plus");if(!c.A.isServer())if(e){const{addCameraSession:t}=e;t&&t.camCount&&t.miniCount?this.setState({cartCount:t.camCount,miniCount:t.miniCount}):(e=Rs(Rs({},e),{},{addCameraSession:{statusChecked:!1}
1}),(0,he.e)("ha_plus",e))}else e={addCameraSession:{statusChecked:!1}},(0,he.e)("ha_plus",e);let t=!1;if(await this.getPageData()&&(t=await this.checkHaUser()),t){if(!await this.checkWoStatus())return;const{addCameraSession:t}=e;t.statusChecked||this.getJourneyStatus()}await this.checkPaymentStatus(),Promise.all([this.getProductsData(),this.getSubscriptionData()]).then(()=>{this.gaProductDetailEvent(this.state.subscriptionData),this.addRemoveCartGaEvent("plus",!0)})}render(){const{history:e}=this.props,{productData:t,cartCount:s,cameraPrice:r,cameraSellPrice:i,cartMaxCount:n,isOpenCamera:o,isOpenMini:l,miniPrice:d,miniSellPrice:p,pageTitle:g,showSnack:f,miniCount:x,subtitle:y,render:S,isCamFeatureOpen:j,isMiniFeatureOpen:A,pageMeta:N,subscriptionData:C,showBlank:w}=this.state;if(w)return null;if(!t||!S)return(0,v.jsx)(u.A,{});let _={};return C.forEach(e=>{s>=e.deviceCountMin&&(_=e)}),(0,v.jsxs)("div",{className:"ipl_event",children:[f&&(0,v.jsx)(ge,{text:N&&N.snack_text,closeAlert:this.closeAlert,cartMaxCount:n}),(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)(G,{history:e,type:"history_back"}),(0,v.jsxs)("div",{className:"heading-md ",style:{marginBottom:"24px"},children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:g}),(0,v.jsx)("h2",{className:"ha-heading2",children:y})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsx)("div",{className:"features-wrapp",children:(0,v.jsxs)("div",{id:"accordion",className:"accordion-packchange",children:[(0,v.jsxs)("div",{className:"acc-cont",children:[(0,v.jsx)("div",{children:(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsxs)("div",{className:"feat-accor-img",children:[" ",(0,v.jsx)("img",{src:t.camera&&c.A.NODE_API_ROOT+t.camera.field_image.url,alt:t.camera&&t.camera.field_image.alt})," "]}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[(0,v.jsx)("span",{children:t.camera&&t.camera.title}),t.camera&&t.camera.field_subtitle]}),(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsxs)("div",{className:"qty",children:[(0,v.jsx)("span",{className:"minus",onClick:()=>this.handleCartItemCount("minus"),children:"-"}),(0,v.jsx)("input",{type:"text",className:"count",name:"qty",value:s}),(0,v.jsx)("span",{className:"plus",onClick:()=>this.handleCartItemCount("plus"),children:"+"})]}),(0,v.jsxs)("div",{className:"price",children:[r!==i&&(0,v.jsxs)("div",{className:"label cutprice",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:r})]}),0!==i?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:i})]}),(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"annual-sub-price offer-text",children:N&&N.inclusive_text})})]}):(0,v.jsx)("div",{className:"label",children:"Free"})]})]})]})}),(0,v.jsxs)("div",{className:"fea-bene-text-outer",children:[(0,v.jsx)("div",{onClick:e=>this.toggleAccordion(e,"isOpenCamera"),className:"fea-bene-text accordion-toggle "+(o?"acc-expanded":"acc-collapsed"),children:"Features and benefits"}),(0,v.jsx)(D.A,{isOpen:o,children:t.camera&&t.camera.field_features.map((e,s)=>{if(s<=4)return(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},s);if(5===s){const e=t.camera.field_features.slice(5,t.camera.field_features.length);return(0,v.jsxs)("div",{children:[(0,v.jsx)(D.A,{isOpen:j,style:{border:"0",paddingBottom:"0"},children:e.map((e,t)=>(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t))}),(0,v.jsx)("div",{className:"fb-blk d-block text-center",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:e=>this.toggleAccordion(e,"isCamFeatureOpen"),className:"viewmore less ha-hover",children:j?"View Less":"View More"})})]})}})})]})]}),(0,v.jsxs)("div",{className:"acc-cont last-acc-cont",children:[(0,v.jsx)("div",{children:(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsx)("div",{className:"feat-accor-img",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+m()(t,'["home mini"].field_image.url',""),alt:m()(t,'["home mini"].field_image.alt',"")})}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[(0,v.jsx)("span",{children:t["home mini"]&&t["home mini"].title}),t["home mini"]&&t["home mini"].field_subtitle]}),(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsx)("div",{className:"feat-accor-text",children:(0,v.jsxs)("span",{children:["Qty.",(0,v.jsx)("span",{className:"gmini-qnt d-inline",children:x})]})}),(0,v.jsxs)("div",{className:"price",children:[d!==p&&(0,v.jsxs)("div",{className:"label cutprice",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:d})]}),0!==p?(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:p})]}):(0,v.jsx)("div",{className:"label free-text",children:"Free"})]}),(0,v.jsx)("div",{className:"offer-text",children:t["home mini"]&&(0,v.jsx)(b.A,{htmlContent:t["home mini"].field_offer_label})})]})]})}),(0,v.jsxs)("div",{className:"fea-bene-text-outer",children:[(0,v.jsx)("div",{onClick:e=>this.toggleAccordion(e,"isOpenMini"),className:"fea-bene-text accordion-toggle "+(l?"acc-expanded":"acc-collapsed"),children:"Features and benefits"}),(0,v.jsx)(D.A,{isOpen:l,children:t["home mini"]&&t["home mini"].field_features&&t["home mini"].field_features.map((e,s)=>{if(s<=4)return(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},s);if(5===s){const e=t["home mini"].field_features.slice(5,t["home mini"].field_features.length);return(0,v.jsxs)("div",{children:[(0,v.jsx)(D.A,{isOpen:A,style:{border:"0",paddingBottom:"0"},children:e.map((e,t)=>(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t))}),(0,v.jsx)("div",{className:"fb-blk d-block text-center",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:e=>this.toggleAccordion(e,"isMiniFeatureOpen"),className:"viewmore less ha-hover",children:A?"View Less":"View More"})})]})}})})]})]})]})}),(0,v.jsx)("div",{className:"text-center mT32 block",children:(0,v.jsx)("button",{type:"button",className:"btn btn-primary btn-height waves-effect waves-light",onClick:()=>this.handleSubmit(_),children:"Continue"})})]})]})})})]})}}(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),openModal:(0,F.zH)(U.qf,e)}))(Ls);function Fs(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}const Us={setApiError:g.x8},Bs=(0,l.Ng)(null,Us)(e=>{const{history:t,setApiError:s}=e,[r,i]=(0,a.useState)(!1),[n,o]=(0,a.useState)(null),[l,d]=(0,a.useState)(null),[m,p]=(0,a.useState)(!1),g=async e=>{i(!1);const a=(0,he.u6)("ha_plus"),{addCameraSession:{orderUuid:r,camCount:n,maxCount:o}}=a;if(parseInt(n,10)+parseInt(e.existingCount,10)>o)return p(!0),void i(!0);const l=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Fs(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Fs(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},e);l.orderUuid=r,l.addressType="EXISTING";const d={address:l,orderUuid:r,subscriptionId:e.subscriptionId};b(a);try{const{data:e}=await f.n.postData("order/address/create/AddNewCamera",d);e.message===c.A.MESSAGES_TYPES.SUCCESS?t.push(`/${c.A.home_automation}/${j.dY}/add-camera-payment-summary`):i(!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}},b=e=>{(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Add Camera",event:"checkout",ecommerce:{checkout:{actionField:{step:2,option:"Customer Details"},products:[{name:"Tata Play Secure Plus",id:e.addCameraSession.gaInfo.id,price:e.addCameraSession.gaInfo.price,brand:"Tata Play",category:"Home Automation",variant:"pass variant i.e. Hualai or Google",quantity:e.addCameraSession.camCount,productName:e.addCameraSession.gaInfo.ProductName}]}}})};(0,a.useEffect)(()=>{const e=(0,he.u6)("ha_plus");if(!e)return void t.push(`/${c.A.home_automation}/${j.dY}/add-camera`);const{addCameraSession:a}=e;if(!a)return void t.push(`/${c.A.home_automation}/${j.dY}/add-camera`);const{orderUuid:r}=a;if(!r)return void t.push(`/${c.A.home_automation}/${j.dY}/add-camera`);(async()=>{await(async()=>{try{const e=JSON.parse(localStorage.userAuth),{subId:{id:t}}=e,s={subscriberId:t,provider:"Google"},{data:a}=await f.n.postData("order/AddNewCamera/SelectAddress",s);if(a.message===c.A.MESSAGES_TYPES.SUCCESS){const{associatedAddress:e}=a.data;e&&Array.isArray(e)&&e.length>0&&d(e)}i(!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}})(),await(async()=>{try{const e="s3-api/v1/assets/pages/add-camera-select-address-google.json",t=(await f.n.getJsonData(e)).data;if(t.status===c.A.MESSAGES_TYPES.SUCCESS){const e={title:t.data.title,btn_txt:t.data.field_json.text};o(e)}else s(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}})()})()},[]);if(!r)return(0,v.jsx)(u.A,{});const y=(0,he.u6)("ha_plus"),{addCameraSession:{maxCount:S}}=y,A={label:"Back",url:`/${c.A.home_automation}/${j.dY}/add-camera`};return(0,v.jsxs)("div",{className:"ipl_event",children:[m&&(0,v.jsx)(ge,{closeAlert:e=>{e.stopPropagation(),p(!1)},cartMaxCount:S,btn:A,history:t}),(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:t,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[n&&(0,v.jsx)("div",{className:"heading-md ",style:{marginBottom:"24px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:n.title})}),(0,v.jsxs)("div",{className:"body-container innercontainer-md-sm",children:[l&&l.map((e,t)=>(0,v.jsxs)("div",{className:"newadd-blk addblk",onClick:()=>g(e),children:[(0,v.jsxs)("p",{children:[(0,v.jsx)("span",{className:"bold",children:"Address:"})," ",(0,he.FR)(e)]}),(0,v.jsxs)("p",{children:[(0,v.jsx)("span",{className:"bold",children:"Subscription Id:"})," ",e.subscriptionId]}),(0,v.jsxs)("p",{children:[(0,v.jsx)("span",{className:"bold",children:"Qty:"})," ",`${e.existingCount} ${e.existingCount>1?"Cameras":"Camera"}`]})]},t)),(0,v.jsx)("a",{href:"javascript:void(0)",onClick:()=>{return e=n.btn_txt,(0,x.Sw)({event:"ctaClick",clickText:e,"Type of Journey":"HA-Secure Plus -Add Camera","Sub ID":(0,x.Xo)().id||null}),void t.push(`/${c.A.home_automation}/${j.dY}/add-camera-new-address`);var e},className:"mT20 d-block bold ha-hover",children:n&&n.btn_txt})]})]})]})})]})}),Hs=["hasErrors"];function Ys(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Gs(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Ys(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ys(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Js extends a.Component{constructor(...e){super(...e),this.initialForm={pinCode:{wrapperClasses:["form-group","pincode-field","more-connection-pincode"],labelConfig:{label:"Pin code",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"pinCode",type:"tel",placeholder:"",maxLength:6,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},location:{wrapperClasses:["form-group","location-field"],labelConfig:{label:"Location",classes:["sel","active","mendate"]},elementType:"select",elementConfig:{id:"location",placeholder:"",options:[{label:"select",value:""}]},value:"",errorMessage:"",valid:!0,touched:!1},building:{wrapperClasses:["form-group","building-field"],labelConfig:{label:"Building Name",classes:["sel","active"]},elementType:"input",elementConfig:{id:"building",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine1:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Address Line 1",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"adrLine1",type:"text",placeholder:"",maxLength:75,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine2:{wrapperClasses:["form-group","addr2-field"],labelConfig:{label:"Address Line 2",classes:["sel","active"]},elementType:"input",elementConfig:{id:"adrLine2",type:"text",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},landmark:{wrapperClasses:["form-group","landmark-field"],labelConfig:{label:"Landmark",classes:["sel","active"]},elementType:"input",elementConfig:{id:"landmark",type:"text",placeholder:"",maxLength:25,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},city:{wrapperClasses:["form-group","city-field"],labelConfig:{label:"City",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"city",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},state:{wrapperClasses:["form-group","state-field"],labelConfig:{label:"State",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"state",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},email:{wrapperClasses:["form-group","email-field"],labelConfig:{label:"Email",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"email",type:"email",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}},this.state={termsChecked:!0,showCheckError:!1,render:!0,infoForm:Gs({},this.initialForm),formErrorMessage:null,button:{buttonConfig:{type:"submit",class:"wAutoLgBlue"},text:"Save",url:"select-language",disabled:!1},pageData:null},this.bodyRef=a.createRef(),this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/add-cam-new-address-google.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,summaryTxt:e.field_json.summary_txt,termsTxt:e.body,pincodeErr:e.field_json.pincode_err,stateErr:e.field_json.state_err};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubsciberDetails=async()=>{const{setApiError:e}=this.props,t=JSON.parse(localStorage.userAuth),{subId:s}=t,a={subscriberId:s.id,source:"WEB"};try{const{data:t}=await f.n.postData("order/address/getAddress",a);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){this.setInfoForm(t.data);const e=t.data,{infoForm:s}=this.state,a=Gs({},s),{city:r,pinCode:i,state:n}=a;r.value=e.city||"",i.value=e.areaPincode||"",n.value=e.state||"",this.setState({infoForm:a},()=>this.getPinCodeData(e.areaPincode))}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.setInfoForm=e=>{const{infoForm:t}=this.state,s=Gs({},t),{adrLine1:a,adrLine2:r,city:i,email:n,pinCode:o,state:l,building:c,landmark:d,location:m}=s;a.value=e.streetAddress||"",r.value=e.streetAddress2||"",m.value=e.location||"",i.value=e.city||"",n.value=e.email||"",o.value=e.postalCode||"",l.value=e.state||"",c.value=e.building||"",d.value=e.landmark||"",e.termsChecked&&this.setState({termsChecked:e.termsChecked}),this.setState({infoForm:s,render:!0},()=>this.getPinCodeData(e.postalCode))},this.inputChangedHandler=(e,t)=>{const{infoForm:s}=this.state,a=Gs({},s),{location:r}=a,i=Gs({},a[t]);let n=e;"pinCode"===t&&(n=n.replace(/[^0-9]/g,""),n.length>6&&(n=n.slice(0,6)),6===n.length&&this.getPinCodeData(n,!0),n.length<6&&(r.elementConfig.options=[{label:"select",value:""}],r.value=null,this.setState({infoForm:a}))),i.value=n,i.touched=!0,i.valid=!0,i.errorMessage="",a[t]=i,this.setState({infoForm:a})},this.getPinCodeData=async e=>{const{setApiError:t}=this.props;if(e)try{const{data:t}=await f.n.getData(`payment/pincode/getPinDetailsByZipCode/${e}/Google`),{infoForm:s,pageData:a}=this.state,r=Gs({},s),{city:i,pinCode:n,state:o,location:l}=r,c=t.data;if(c&&Array.isArray(c)&&c.length>0){if(o.value&&o.value!==c[0].state.trim())return n.valid=!1,n.errorMessage=a&&a.stateErr||"State is different",void this.setState({infoForm:r,render:!0});i.value=c[0].city.trim(),n.value=c[0].zipcode,n.valid=!0,o.value=c[0].state.trim();const e=c&&c.map(e=>({label:e.location,value:e.location}));l.elementConfig.options=[{label:"select",value:""},...e]}else n.valid=!1,n.errorMessage=a&&a.pincodeErr||"Apologies, currently we are unavailable in your city. We will be launching soon!";this.setState({infoForm:r,render:!0})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}else this.setState({render:!0})},this.validateForm=async e=>{this.setState({render:!1}),e.preventDefault();const{infoForm:t,termsChecked:s}=this.state,{history:a,setApiError:r}=this.props,i={},n=Object.keys(t);n.forEach(e=>{i[e]=t[e].value});const o=H(i),{hasErrors:l}=o,d=(0,I.A)(o,Hs);if(l){const e=Gs({},t);let s=null;
1n.forEach((t,a)=>{0===a&&(s=t);const r=d[`${t}Message`];r&&""!==r&&(e[t].valid=!1,e[t].errorMessage=r)}),this.setState({infoForm:e,formErrorMessage:"",render:!0}),s&&document.getElementById(s).scrollIntoView()}else{let e=!0;if(n.forEach(s=>{t[s].valid||(e=!1)}),e){if(this.checkout2GA(),!s)return void this.setState({showCheckError:!0,render:!0});const e=(0,he.u6)("ha_plus"),{addCameraSession:{orderUuid:i}}=e,n={postalCode:t.pinCode.value.trim(),streetAddress:t.adrLine1.value.trim(),streetAddress2:t.adrLine2.value.trim(),city:t.city.value.trim(),landmark:t.landmark.value.trim(),location:t.location.value.trim(),email:t.email.value.trim(),state:t.state.value.trim(),building:t.building.value.trim(),addressType:"NEW",orderUuid:i,termsChecked:s},o={address:n,orderUuid:i,subscriptionId:null};try{const{data:s}=await f.n.postData("order/address/create/AddNewCamera",o);if(s.message===c.A.MESSAGES_TYPES.SUCCESS){e.addCameraSession.infoForm=n,(0,he.e)("ha_plus",e),a.push(`/${c.A.home_automation}/${j.dY}/add-camera-payment-summary`)}else{const e=s.message.charAt(0).toUpperCase()+s.message.slice(1).toLowerCase();t.pinCode.valid=!1,this.setState({infoForm:t,formErrorMessage:e,render:!0})}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}}}},this.checkout2GA=()=>{const e=(0,he.u6)("ha_plus");(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Add Camera",event:"checkout",ecommerce:{checkout:{actionField:{step:2,option:"Customer Details"},products:[{name:"Tata Play Secure Plus",id:e.addCameraSession.gaInfo.id,price:e.addCameraSession.gaInfo.price,brand:"Tata Play",category:"Home Automation",variant:"Google",quantity:e.addCameraSession.camCount,productName:e.addCameraSession.gaInfo.ProductName}]}}})},this.inputCheckHandler=()=>{const{termsChecked:e,showCheckError:t}=this.state;this.setState({termsChecked:!e},()=>{const{termsChecked:e}=this.state;e&&t&&this.setState({showCheckError:!1})})}}async componentDidMount(){this.bodyRef.current&&this.bodyRef.current.scrollTo(0,0);const{history:e}=this.props,t=(0,he.u6)("ha_plus");if(t){const{addCameraSession:s}=t;s||e.push(`/${c.A.home_automation}/${j.oh}/add-camera`)}else e.push(`/${c.A.home_automation}/${j.oh}/add-camera`);await this.getPageData();const{addCameraSession:{infoForm:s}}=t;s&&""!==s.postalCode?(this.setState({render:!1}),this.setInfoForm(s)):this.getSubsciberDetails()}render(){const{button:e,infoForm:t,render:s,formErrorMessage:r,termsChecked:i,showCheckError:n,pageData:o}=this.state,{history:l}=this.props,c=[];return Object.keys(t).forEach(e=>{c.push({id:e,config:t[e]})}),(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{ref:this.bodyRef,children:[!s&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:l,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[o&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:o.title})}),(0,v.jsx)("div",{className:"innercontainer-sm-xs",children:(0,v.jsx)("div",{className:"yellow-back-text text-center",children:o.summaryTxt})})]}),(0,v.jsx)("div",{className:"body-container innercontainer-sm pB0",children:(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"innercontainer-xs install-wrapp",children:[(0,v.jsx)("div",{className:"orderttl",children:"New installation address"}),c&&c.map(e=>(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)},e.id)),o&&(0,v.jsxs)("div",{className:"mT32 text-center ha-plus-tnc",children:[(0,v.jsx)("input",{type:"checkbox",className:"filled-in form-check-input",id:"checkbox1",checked:i?"checked":"",onClick:()=>this.inputCheckHandler()}),(0,v.jsx)(b.A,{className:"form-check-label fs12",htmlFor:"checkbox1",Tag:"label",htmlContent:o.termsTxt})]}),n&&(0,v.jsx)("span",{className:"validate invalid-text",style:{marginTop:"10px"},children:"This field is required"})]}),(0,v.jsxs)("div",{className:"btn-contr text-center more-connection-btn",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",children:r}),(0,v.jsx)(R.A,{disabled:e.disabled,config:e.buttonConfig,content:e.text,onClick:e=>this.validateForm(e)})]})]})})]})]})})]})})}}const qs=(0,l.Ng)(e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}),null)(Js);function Vs(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}class zs extends a.Component{constructor(...e){super(...e),this.state={render:!1,productsData:null,subscriptions:[],address:[],transactionAmount:null,formErrorMessage:null,isSubExist:!1,infoText:null,showInfoIcon:!1,infoModalText:null,pageData:null},this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/add-cam-summary-google.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS&&t.status===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,amtText:e.field_json.amount_text,amtCameraTxt:e.field_json.amt_camera_text,btnText:e.field_json.button_text,note:e.field_json.note,note_txt:e.field_json.note_text};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.payNowHandler=async()=>{const e=(0,he.u6)("ha_plus"),{addCameraSession:{orderUuid:t}}=e,{history:s,setStepAndUuidForPayment:a,updateS3Data:r}=this.props;try{const{data:i}=await f.n.postData(`payment/authPayment/${t}`,{});if(!0===i.status){const{uuid:t}=i.data;e.orderType="ADD_CAM",e.journey="Google",(0,he.e)("ha_plus",e),r("isCOD",!1),a(t),localStorage.setItem("SOURCE",c.A.sourcetype.HA),this.checkout3GaEvent(),s.push("/secure/home")}else this.setState({render:!0,formErrorMessage:i.message||c.A.serverError})}catch(e){this.setState({render:!0,formErrorMessage:c.A.serverError})}},this.checkout3GaEvent=()=>{try{const e=(0,he.u6)("ha_plus"),{productsData:t,subscriptions:s,transactionAmount:a}=this.state,r=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Vs(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Vs(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},e);r.addCameraSession.gaInfo={id:e.addCameraSession&&e.addCameraSession.gaInfo&&e.addCameraSession.gaInfo.id||"",price:a||""},(0,he.e)("ha_plus",r),(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure Plus -Add Camera",event:"checkout",ecommerce:{checkout:{actionField:{step:3,option:"Order Summary"},products:[{name:"Tata Play Secure Plus",id:e.addCameraSession&&e.addCameraSession.gaInfo&&e.addCameraSession.gaInfo.id||"",price:a,brand:"Tata Play",category:"Home Automation",variant:"pass variant i.e. Hualai or Google",quantity:t.camera[0].newCount,productName:`${t.camera[0].name||""},\n ${t.hub[0].name||""},\n ${s[0].description||""}`}]}}})}catch(e){console.log(e,"error in GA")}},this.getSummaryData=async()=>{const e=(0,he.u6)("ha_plus"),{addCameraSession:{orderUuid:t}}=e,{history:s,setApiError:a}=this.props;try{const{data:e}=await f.n.getData(`order/getAddNewCameraSummaryByUuid/${t}`);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){if(e.data.page&&"bundle"===e.data.page.toLowerCase())return void s.push(`/${c.A.home_automation}/${j.dY}/add-camera`);const t=e.data.products.filter(e=>e.type&&"camera"===e.type.toLowerCase()),a=e.data.products.filter(e=>e.type&&"home mini"===e.type.toLowerCase());let r=!1;e.data.subscriptions.length>0&&(r=!0);let i=null,n=!1,o=null;!r&&parseInt(t[0].existingCount,10)>0?i="This camera will be added to the existing subscription for the selected address at no additional cost.":r&&parseInt(t[0].existingCount,10)>0?(i=`This address has ${t[0].existingCount} camera(s) installed. On adding more cameras more than ${e.data.subscriptions[0].currentSlabMaxCount} on the same address, your monthly subscription cost will be changed.`,n=!0,o=`Addition of camera to the existing camera bundle will change your monthly subscription. It will now cost â¹${e.data.subscriptions[0].discountedPrice}.`):r&&0===parseInt(t[0].existingCount,10)&&(o=`Every new address requires a new Tata Play Secure+ subscription. Your payment summary includes â¹${e.data.subscriptions[0].discountedPrice} for the new address you added.`,n=!0),n&&(o+=`<div class="pricebox bold mT20">\n <div class="leftblk">New Subscription Cost</div>\n <div class="rightblk"><span class="rupee fs12">â¹</span>${e.data.subscriptions[0].actualPrice}</div>\n </div>\n <div class="pricebox bold">\n <div class="leftblk">New Subscription Cost (Pro-Rated to ${e.data.subscriptions[0].remainingDays} days)</div>\n <div class="rightblk"><span class="rupee fs12">â¹</span>${e.data.subscriptions[0].upgradedAmount}</div>\n </div>\n <div class="pricebox bold">\n <div class="leftblk">Existing Subscription Balance Available </div>\n <div class="rightblk"><span class="rupee fs12">â¹</span>${e.data.subscriptions[0].currentAmount}</div>\n </div>\n <div class="pricebox bold">\n <div class="leftblk">Balance Amount to be paid </div>\n <div class="rightblk"><span class="rupee fs12">â¹</span>${e.data.subscriptions[0].discountedPrice}</div>\n </div>`),this.setState({productsData:{camera:t,hub:a},subscriptions:[...e.data.subscriptions],address:[...e.data.addresses],transactionAmount:e.data.transactionAmount,isSubExist:r,infoText:i,render:!0,showInfoIcon:n,infoModalText:o})}else e.message===j.qO?s.push(`/${c.A.home_automation}/${j.dY}/add-camera`):a(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||a(c.A.serverError,!0)}}}componentDidMount(){const e=(0,he.u6)("ha_plus"),{history:t}=this.props;if(!e)return void t.push(`/${c.A.home_automation}/${j.dY}/add-camera`);const{addCameraSession:s}=e;if(!s)return void t.push(`/${c.A.home_automation}/${j.dY}/add-camera`);const{orderUuid:a}=s;
1a?(this.getPageData(),this.getSummaryData()):t.push(`/${c.A.home_automation}/${j.dY}/add-camera`)}render(){const{render:e,address:t,productsData:s,subscriptions:r,transactionAmount:i,formErrorMessage:n,isSubExist:o,infoText:l,showInfoIcon:c,infoModalText:d,pageData:m}=this.state;if(!(s&&t.length>0&&i&&e&&m))return(0,v.jsx)(u.A,{});let p={},g={},f=0;s.camera&&Array.isArray(s.camera)&&s.camera.length>0&&(p={name:s.camera[0].name||"",desc:"null"!==s.camera[0].description?s.camera[0].description:null,actualPrice:0!==s.camera[0].actualPrice?s.camera[0].actualPrice:null,sellPrice:0!==s.camera[0].discountedPrice?s.camera[0].discountedPrice:"FREE",qty:s.camera[0].newCount},f+=s.camera[0].actualPrice),s.hub&&Array.isArray(s.hub)&&s.hub.length>0&&(g={name:s.hub[0].name||"",desc:"null"!==s.hub[0].description?s.hub[0].description:null,actualPrice:0!==s.hub[0].actualPrice?s.hub[0].actualPrice:null,sellPrice:0!==s.hub[0].discountedPrice?s.hub[0].discountedPrice:"FREE",qty:s.hub[0].newCount},f+=s.hub[0].actualPrice);const x=[];r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{x.push({name:e.friendlyName||"",desc:"null"!==e.description?e.description:null,actualPrice:e.actualPrice,packUom:e.uom,sellPrice:0!==e.discountedPrice?e.discountedPrice:"FREE"}),f+=e.actualPrice});const b=f-i,y=i,{history:S}=this.props;return(0,v.jsxs)(a.Fragment,{children:[!e&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_ADD_CAM_SUBSCRIPTION,activeStepper:"3"}),(0,v.jsx)(G,{classes:"",history:S,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:m&&m.title}),o&&(0,v.jsx)("h2",{className:"ha-heading2",children:`Includes cost of additional ${p.qty} ${p.name} and monthly subscription`}),!o&&(0,v.jsx)("h2",{className:"ha-heading2",children:`Includes cost of additional ${p.qty} ${p.name}`})]}),(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-sm-xs summary posR",children:[l&&(0,v.jsx)("div",{className:"yellow-back-text subttl",id:"exismore-text",style:{textAlign:"center"},children:l}),(0,v.jsxs)(ot.A,{children:[(0,v.jsxs)(lt.A,{className:"secure-plus-info-icon",children:[(0,v.jsx)(mt,{priceData:p,qty:p.qty,showIcon:!1}),x.length>0&&x.map((e,t)=>(0,v.jsx)(mt,{source:"google-add-cam-subs",hideStrike:!0,isDrawer:!0,priceData:e,showIcon:c,infoModalText:d,infoModalTitle:"Monthly Subscription Details"})),(0,v.jsx)(mt,{priceData:g,qty:g.qty,showIcon:!1})]}),(0,v.jsxs)(ct.A,{className:"card-footer",children:[(0,v.jsxs)("h2",{className:"ha-heading2 bold total-heading",children:["Total Amount",m&&(0,v.jsx)("span",{className:"d-block mB0 small",children:c?m.amtText:m.amtCameraTxt})]}),(0,v.jsxs)("span",{className:"mB0 text-right",children:[(0,v.jsxs)("span",{className:"price-lg mR0",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"count",children:(0,he.Px)(y)||"00"})]}),(0,v.jsxs)("span",{className:"gradient gradient-text",children:["Benefits worth ",(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,he.Px)(b)||"00"]})]})]})]}),t.length>0&&(0,v.jsxs)("div",{className:"form-group field dateContr mT20",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Address"}),(0,v.jsx)("div",{className:"add-text",children:(0,he.FR)(t[0])}),(0,v.jsx)("span",{className:"validate",children:" "})," "]}),m&&m.note&&(0,v.jsxs)("p",{className:"mT20 fs14",children:[(0,v.jsxs)("span",{className:"bold",children:[m.note,"
1: "]}),m.note_txt]}),(0,v.jsxs)("div",{className:"fixed-btn cart-wrapper mT20 show text-center",children:[(0,v.jsx)("div",{className:"heading3 invalid-text text-center",children:n})," ",(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light",style:{display:"inline-flex;"},href:"javascript:void(0)",onClick:()=>this.payNowHandler(),children:m&&m.btnText})," "]})]})})]})]})})]})}}const Ws={setStepAndUuidForPayment:dt.Cn,updateS3Data:dt.WX,setApiError:g.x8},Xs=(0,l.Ng)(null,Ws)(zs);function Zs(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Qs(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Zs(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Zs(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Ks extends a.Component{constructor(...e){super(...e),this.state={render:!0,startDate:null,startTime:ne()((new Date).getTime()),slotTime:{wrapperClasses:["form-group","custom-Select-Arrow","slot-field"],labelConfig:{label:"Time",classes:["sel","active"]},elementType:"customSelect",elementConfig:{options:[],placeholder:"Select time",maxLength:null,tabIndex:0,readonly:"readonly"},value:null,errorMessage:null,valid:!0,touched:!1},slotList:null,teamId:null,taskId:null,address:null,allowedDays:2,pageData:null,disableSubmit:!1},this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/add-camera-schedule-installation.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS&&t.status===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,subtitle:e.field_subtitle,shieldImg:e.field_image,safetyImgs:e.field_images,safetyTxt:e.field_json.safety_text};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getAddress=async()=>{const{setApiError:e}=this.props;try{const t=(0,he.u6)("ha_plus"),{addCameraSession:{orderUuid:s}}=t,{data:a}=await f.n.getData(`order/getAddNewCameraSummaryByUuid/${s}`);let r=null;if(a.message===c.A.MESSAGES_TYPES.SUCCESS){const e=a.data,{addresses:t}=e;return t&&Array.isArray(t)&&t.length>0&&(r=(0,he.FR)(t[0])),this.setState({address:r}),!0}return e(c.A.serverError,!0),!1}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.redirectToDestination=e=>{const{history:t}=this.props;t.push(`/${c.A.home_automation}/${j.dY}/${e}`)},this.handleDateChange=e=>{this.setState({render:!1});const{slotTime:t}=this.state,s=t;s.value=null,this.setState({startDate:e,render:!1,disableSubmit:!1,slotTime:s},()=>this.getSlots())},this.getSlots=async e=>{const{setApiError:t}=this.props,{startDate:s,slotTime:a}=this.state,{addCameraSession:r}=(0,he.u6)("ha_plus"),i=e?new Date:s,n={orderUuid:r.orderUuid,slotStartDate:ne()(i).format("DD-MM-YYYY"),provider:"Google"};try{const{data:t}=await f.n.postData("order/get-slots/",n);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const s=[],{slotSuggestions:r,ocsFlag:i}=t.data;let n=0;if("N"===i||""===i?n=2:"Y"===i&&(n=29),e)this.setState({allowedDays:n,render:!0});else{r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{const t=ne()(e.start).format("LT"),a=ne()(e.end).format("LT");s.push({label:`${t} - ${a}`,value:`${ne()(e.start).format("HH:mm:ss")}-${ne()(e.end).format("HH:mm:ss")}`})});const e=Qs({},a);e.elementConfig.options=s,e.errorMessage="",e.valid=!0,this.setState({slotList:s,slotTime:e,teamId:t.data.teamId,taskId:t.data.taskId,allowedDays:n,render:!0})}}else{let s=2;if(t.data){const{ocsFlag:e}=t.data;"N"===e||""===e?s=2:"Y"===e&&(s=29)}if(e)this.setState({allowedDays:s,render:!0});else{const e=Qs({},a);e.elementConfig.options=[],e.value=null,e.errorMessage="No slots available! Please select another date.",e.valid=!1,this.setState({slotList:null,slotTime:e,teamId:null,taskId:null,allowedDays:s,render:!0})}}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.handleTimeChange=e=>{const{slotTime:t}=Qs({},this.state),s=Qs({},t);s.value=e,s.touched=!0,s.valid=!0,s.errorMessage=null,this.setState({slotTime:s,formError:""})},this.handleSubmit=async()=>{this.setState({disableSubmit:!0});const{slotTime:e,teamId:t,taskId:s,startDate:a}=this.state,{history:r,setApiError:i}=this.props;if(null===e.value){const t=Qs({},e);return t.valid=!1,t.errorMessage="Please select a slot.",void this.setState({slotTime:t,formError:"",disableSubmit:!1})}const n=(0,he.u6)("ha_plus"),{addCameraSession:{orderUuid:o}}=n,l=ne()(a).format("DD-MM-YYYY"),d={teamId:t,taskId:s,orderUuid:o,slot:{start:`${l} ${e.value.split("-")[0]}`,end:`${l} ${e.value.split("-")[1]}`}};try{const{data:e}=await f.n.postData("order/confirm-slots/",d);!0===e.status?r.push(`/${c.A.home_automation}/${j.dY}/add-camera-booking-success`):r.push(`/${c.A.home_automation}/${j.dY}/booking-failure`)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||i(c.A.serverError,!0)}},this.handleDateChangeRaw=e=>{e.preventDefault()}}async componentDidMount(){const{history:e}=this.props,t=(0,he.u6)("ha_plus");t||e.push(`/${c.A.home_automation}/${j.dY}/add-camera`);const{addCameraSession:s}=t;s||e.push(`/${c.A.home_automation}/${j.dY}/add-camera`),this.getPageData();let a=null;
1a=await this.getAddress(),a&&this.getSlots(!0)}render(){const{startDate:e,slotTime:t,address:s,allowedDays:r,pageData:i,render:n,disableSubmit:o}=this.state;if(!s||!i||!n)return(0,v.jsx)(u.A,{});const{history:l}=this.props;return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container schedul-install bottompadd gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_ADD_CAM_SUBSCRIPTION,activeStepper:"4"}),(0,v.jsxs)("div",{className:"main-container text-center",children:[i&&(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:i.title}),(0,v.jsx)("h2",{className:"ha-heading2",children:i.subtitle})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-xs pB0",children:[(0,v.jsxs)("div",{className:"fullwidth mT30 text-left",children:[s&&(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Address"}),(0,v.jsx)("div",{className:"add-text",children:s}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Date"}),(0,v.jsx)(yt(),{dateFormat:"DD MMMM YYYY",selected:e,placeholderText:"Select date",onChange:e=>this.handleDateChange(e),minDate:ne()(),maxDate:ne()().add(r,"days"),onChangeRaw:e=>this.handleDateChangeRaw(e)}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsx)("div",{className:"form-group field-time",children:(0,v.jsx)($.A,{labelConfig:t.labelConfig,elementType:t.elementType,elementConfig:t.elementConfig,value:t.value,valid:t.valid,errorMessage:t.errorMessage,touched:t.touched,wrapperClasses:t.wrapperClasses,changed:e=>this.handleTimeChange(e)},"slot")})]}),(0,v.jsx)("div",{className:"wyze-wrap",children:(0,v.jsx)(jt,{source:"Installation"})}),(0,v.jsxs)("p",{className:"mT20 fs14 bottom-text",children:[(0,v.jsx)("span",{className:"bold",children:"Note: "}),"All required electricals (e.g., wiring, switches, points) at installation site must be arranged for by the customer. Our technicians cannot provide the same."]}),(0,v.jsxs)("div",{className:"fixed-btn cart-wrapper mT20 show",children:[!o&&(0,v.jsx)("button",{type:"button",className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",onClick:()=>this.handleSubmit(),children:"Confirm"}),o&&(0,v.jsx)("button",{type:"button",className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",disabled:o,children:"Confirm"})]})]})]})]})})]})}}const ea=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(Ks),ta=e=>{const[t,s]=(0,a.useState)({address:null,date:null,time:null,haId:null,count:null,name:null}),[r,i]=(0,a.useState)(null),{history:n}=e,o=(0,l.wA)(),d=(0,he.u6)("ha_plus"),{addCameraSession:{orderUuid:m}}=d;return(0,a.useEffect)(()=>{d||n.push(`/${c.A.home_automation}/${j.dY}/add-camera`);const{addCameraSession:e}=d;e||n.push(`/${c.A.home_automation}/${j.dY}/add-camera`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/Installation-success-page-google.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS&&e.status===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,s={title:t.title,btnTxt:t.field_json.button_text,scheduleTxt:t.field_json.schedule_text,installationTxt:t.field_json.installation_text};i(s)}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}})(),(async()=>{try{const{data:e}=await f.n.getData(`payment/workorder/getDetailsByUuid/${m}`);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,{workOrderDTOS:a}=t;(!a||0===Object.keys(a).length&&a.constructor===Object)&&o((0,g.x8)(c.A.serverError,!0));const r=(0,he.FR)(t.addresses),i=ne()(a.woSlotEndTime).format("MMMM DD, YYYY"),n=`${ne()(a.woSlotStartTime).format("LT")} - ${ne()(a.woSlotEndTime).format("LT")}`;s({address:r,date:i,time:n,haId:t.haId,name:t.name,count:t.count})}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}})()}
1,[]),t.haId&&t.address&&t.date&&t.time&&r?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:r&&r.title}),(0,v.jsx)("div",{className:"id-text bold",children:`Order ID: ${t.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("div",{className:"insta-blk-wrapp",children:[(0,v.jsxs)("div",{className:"insta-blk-text bold",children:[" ",r&&r.scheduleTxt]}),(0,v.jsxs)("div",{className:"insta-blk",children:[(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/date-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:t.date})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("span",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/time-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:t.time})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp mR0",style:{width:"100%"},children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/address-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"inst-add-contr fs14",children:t.address})]}),t.count&&t.name&&(0,v.jsx)("div",{className:"insta-icon-wrapp mB0 mR0",children:(0,v.jsx)("div",{className:"fs14",children:`Qty: ${t.count} ${t.name}`})})]})]}),(0,v.jsxs)("div",{className:"certified-wrapp",children:[(0,v.jsx)("span",{children:(0,v.jsx)("img",{src:"/assets/images/confirm-appointment.png",alt:"",className:"img-fluid"})}),r&&r.installationTxt]}),(0,v.jsx)("div",{className:"footer-contr text-center mT32 block",children:(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light",href:`/${c.A.home_automation}/${j.dY}`,children:r&&r.btnTxt})})]})]})})})]}):(0,v.jsx)(u.A,{})},sa=e=>{const{pageData:t}=e;return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]}),(0,v.jsxs)("div",{className:"heading-md mT20",children:[t.field_json.Already_link_title&&(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:t.field_json.Already_link_title}),t.field_json.SubHeading&&(0,v.jsx)("h2",{className:"heading2",children:t.field_json.SubHeading})]})]})},aa={setApiError:g.x8},ra=(0,l.Ng)(null,aa)(e=>{const[t,s]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/success-page.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const{field_json:t,field_images:a}=e.data;s({field_json:t,field_images:a})}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}})()},[]),t?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsx)(sa,{pageData:t}),(0,v.jsx)("div",{className:"body-container",children:(0,v.jsx)("div",{className:"text-center mT20 w-auto",children:(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light btn-style",href:"schedule-installation",children:"Schedule Installation"})})})]})})})]}):(0,v.jsx)(u.A,{})});const ia=e=>{const{camImage:t,address:s,count:r,date:i,name:n,packName:o,packPrice:d,subscriptionId:m,rechargeText:u,rechargeBtnTxt:h,status:p,encSubId:g,uom:f,detailsText:b,rechargePreText:y,classes:S,source:j,packType:A}=e,[N,C]=(0,a.useState)(!1),[w,_]=(0,a.useState)(null),[E,T]=(0,a.useState)(!0),[O,k]=(0,a.useState)("Recharge Now"),[P,I]=(0,a.useState)(!0),{manifest:M}=(0,l.d4)(e=>e.commonReducer),$=()=>{(0,x.Sw)({event:"ctaClick",clickText:O,"Type of Journey":"ha_plus_google"===j?"HA - Secure Plus - RenewSubs":"HA - Secure - RenewSubs","Sub ID":(0,x.Xo)().id||null,productName:o,subscriptionID:m,productPrice:d})},R=()=>{(async()=>{const e=JSON.parse(localStorage.userAuth),{subId:t}=e,s={subId:t.id,uom:f,cameraCount:r,packType:A,provider:"ha_plus_google"===j?"Google":"Hualai"};$(),(0,x.y1)("HA",s)})()};return(0,a.useEffect)(()=>{(()=>{const e=new Date,t=new Date(i),s=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),a=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());let r=Math.floor((a-s)/864e5);"Cancelled"===p&&I(!1),r<4&&r>=0&&(0===r&&T(!1),r=0===r?1:r,_(r),"Active"===p&&I(!1))})(),"Inactive"===p&&"ha_plus_google"!==j&&k("Recharge and Activate now")},[]),(0,v.jsx)(ot.A,{className:`${"Pending Activation"===p?"pending-card ":""}${S?`${S} `:""}subscription-card`,children:(0,v.jsxs)(lt.A,{className:"select-relo-blk",children:[(0,v.jsxs)("div",{className:"select-relocation-body dflex-fs",children:[(0,v.jsx)("div",{className:"slec-reloleft",children:t&&(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+t.url,alt:t.alt})}),(0,v.jsx)("div",{className:"slec-reloright",children:(0,v.jsxs)("div",{className:"slec-relo-blk mB20 dflex-sb-afs",children:[(0,v.jsxs)("div",{className:"slec-relo-blkleft ",children:[n&&"ha_plus"!==j&&(0,v.jsx)("div",{className:"smallttl",children:n}),m&&"ha_plus"!==j&&(0,v.jsx)("div",{className:"para mT5 fs12",children:`Subscription Id: ${m}`}),m&&"ha_plus"===j&&(0,v.jsx)("div",{className:"smallttl",children:`Subscription Id: ${m}`}),"Inactive"===p&&(0,v.jsx)("div",{className:"expire-wrapp",children:(0,v.jsxs)("div",{className:"expire-blk dflex-fs",children:[(0,v.jsx)("span",{style:{marginRight:"5px"},children:(0,v.jsx)("img",{src:"/assets/images/past-due.png",alt:"",titile:""})}),(0,v.jsx)("span",{children:"Insufficient Balance"})]})}),"Active"===p&&i&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"para mT5 fs12",children:[`Renewal Date: ${i}`,"Â ",(0,v.jsx)("span",{className:"autorenewal",children:(0,v.jsx)("img",{src:"/assets/images/autorenewal-icon.png",alt:""})})]}),w&&E&&(0,v.jsx)("div",{className:"expire-wrapp auto-renew",children:(0,v.jsxs)("div",{className:"expire-blk dflex-fs",children:[(0,v.jsx)("span",{className:"auto-renew-img",children:(0,v.jsx)("img",{src:"/assets/images/auto-renewal.png",alt:"",titile:""})}),(0,v.jsx)("span",{children:`Auto-renewal in ${w} ${1===w?"day":"days"}`})]})})]}),"Cancelled"===p&&i&&(0,v.jsx)("div",{className:"para mT5 fs12",children:`Cancellation Date: ${i}`})]}),(0,v.jsx)("div",{className:("Pending Activation"===p?"pending-slec-relo ":"")+"slec-relo-blkright",children:(0,v.jsx)("span",{className:`${"Active"===p?"activecamera":"inactivecamera"}${"Pending Activation"===p?" pending-camera":""}`,children:p})})]})})]}),(0,v.jsxs)("div",{className:"discription-all",children:[(0,v.jsxs)(D.A,{className:"details",isOpen:N||P&&"Active"===p||"Cancelled"===p,children:[r&&(0,v.jsxs)("div",{className:"details-row",children:[(0,v.jsx)("div",{className:"label",children:"Qty:"}),(0,v.jsx)("div",{className:"data",children:`${r} ${r>1?"Cameras":"Camera"}`})]}),o&&(0,v.jsxs)("div",{className:"details-row",children:[(0,v.jsx)("div",{className:"label",children:"Plan:"}),(0,v.jsx)("div",{className:"data",children:o})]}),d&&(0,v.jsxs)("div",{className:"details-row",children:[(0,v.jsx)("div",{className:"label",children:"Price: "}),(0,v.jsxs)("div",{className:"data",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),`${d}
1/${"Annual"===f?"Year":"Month"}`]})]}),s&&(0,v.jsxs)("div",{className:"details-row",children:[(0,v.jsx)("div",{className:"label",children:"Address:"}),(0,v.jsx)("div",{className:"data",children:(0,he.FR)(s)})]})]}),"Inactive"===p&&(0,v.jsxs)(a.Fragment,{children:[u&&"ha_plus_google"!==j&&(0,v.jsx)("div",{className:"recharge-para",children:u}),(0,v.jsxs)("div",{className:"renew-spc text-center",children:["ha_plus_google"===j&&u&&(0,v.jsx)("div",{className:"recharge-para",children:u}),y&&(0,v.jsx)("div",{className:"para mB15 notwrapp",children:y}),(0,v.jsx)("div",{className:"text-center full-btn mB20",children:(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light",href:"javascript:void(0)",onClick:()=>R(),style:{height:"42px",lineHeight:"42px"},children:O})}),b&&(0,v.jsxs)("div",{className:"relocation-greaypach",children:[(0,v.jsx)("div",{className:"infogray",children:(0,v.jsx)("img",{src:"/assets/images/info-icon-gray.svg",alt:"",titile:""})}),(0,v.jsx)("p",{className:"info-txt text-left",children:b})]})]})]}),"Active"===p&&w&&(0,v.jsxs)("div",{className:"renew-spc text-center",children:[u&&(0,v.jsx)("div",{className:"para mB15 notwrapp",children:u}),(0,v.jsx)("div",{className:"text-center full-btn mB20",children:(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light",href:"javascript:void(0)",onClick:()=>R(),style:{height:"42px",lineHeight:"42px"},children:O})}),b&&(0,v.jsxs)("div",{className:"relocation-greaypach",children:[(0,v.jsx)("div",{className:"infogray",children:(0,v.jsx)("img",{src:"/assets/images/info-icon-gray.svg",alt:"",titile:""})}),(0,v.jsx)("p",{className:"info-txt text-left",children:b})]})]}),"Pending"===p&&b&&(0,v.jsx)("div",{className:"renew-spc text-center",children:(0,v.jsxs)("div",{className:"relocation-greaypach",children:[(0,v.jsx)("div",{className:"infogray",children:(0,v.jsx)("img",{src:"/assets/images/info-icon-gray.svg",alt:"",titile:""})}),(0,v.jsx)("p",{className:"info-txt text-left",children:b})]})})]}),("Active"!==p&&"Cancelled"!==p||"Active"===p&&w)&&(0,v.jsx)("div",{onClick:e=>(e=>{e.preventDefault(),N?(0,x.Sw)({event:"Show less"}):(0,x.Sw)({event:"Show more"}),C(!N)})(e),className:"text-center showtext",children:(0,v.jsx)("a",{href:"javascript:void(0)",className:N?"readless":"",children:N?"Show Less":"Show more"})})]})})};function na(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}class oa extends a.Component{constructor(...e){super(...e),this.state={title:null,rechargeText:null,activeBtnTxt:null,rechargeBtnTxt:null,camImage:null,render:!1,subscriptionList:null,inactiveSubscriptionList:null,pendingSubscriptionList:null,canceledSubscriptionList:null,encSubId:null,rechargePreText:null,detailsText:null,pendingText:null,cameraName:null},this.checkHaUser=async()=>{const{setApiError:e,openModal:t,history:s}=this.props,{subId:a}=JSON.parse(localStorage.userAuth),r={subscriberId:a.id,source:"HA",provider:"Google"};try{const{data:e}=await f.n.checkHaUser(r);if(e.message!==c.A.MESSAGES_TYPES.SUCCESS&&!1===e.status)return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Not a valid user! ",body:"We see your account is not valid for this service. Request you to login with a different account",showRecharge:!1,redirectUrl:"/my-account"},onCloseEvent:()=>{const{history:e}=this.props;e.push("/my-account")},history:s}),this.setState({render:!0}),!1}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}return!0},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/renew-subscription.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?na(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):na(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},t.data);this.setState({title:e.title,camImage:e.field_image,rechargeText:e.field_json.text,activeBtnTxt:e.field_json.activate_button,rechargeBtnTxt:e.field_json.recharge_button,rechargePreText:e.field_json.recharge_pretext,detailsText:e.field_json.details_text,pendingText:e.field_json.pending_text,cameraName:e.field_json.camera_name})}else e(c.A.serverError,!0),this.setState({render:!0})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubscriptionData=async()=>{const{setApiError:e}=this.props;try{const t=JSON.parse(localStorage.userAuth),{subId:s,subscriberIds:a,encSubscriberId:r}=t,i={subscriberId:s.id,provider:"Google"},{data:n}=await f.n.postData("order/relocationDetails",i);if(n.status||(e(c.A.serverError,!0),this.setState({render:!0})),n.message===c.A.MESSAGES_TYPES.SUCCESS){const{active:e,inactive:t,pending:i,cancel:o}=n.data,l={},c={},d={},m={};let u=null;e&&Array.isArray(e)&&e.length>0&&e.forEach(e=>{l[e.subscriptionId]=e}),t&&Array.isArray(t)&&t.length>0&&t.forEach(e=>{c[e.subscriptionId]=e}),i&&Array.isArray(i)&&i.length>0&&i.forEach(e=>{d[e.subscriptionId]=e}),o&&Array.isArray(o)&&o.length>0&&o.forEach(e=>{m[e.subscriptionId]=e});const h={};a.forEach((e,t)=>{h[e]=r[t]}),u=h[s.id],this.setState({subscriptionList:l,inactiveSubscriptionList:c,pendingSubscriptionList:d,canceledSubscriptionList:m,encSubId:u},()=>{this.setState({render:!0})})}else e(c.A.serverError,!0),this.setState({render:!0})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.redirectToSelectAddress=async e=>{this.setState({render:!1});try{const{history:t,setApiError:s}=this.props,{subscriptionList:a}=this.state,{address:r,cameraCount:i,name:n}=a[e],o=JSON.parse(localStorage.userAuth),{subId:l}=o,d={subId:l.id,count:i,name:n,subscriptionId:e,provider:"Google"},{data:m}=await f.n.postData("order/createRelocationOrder",d);if(m.message===c.A.MESSAGES_TYPES.SUCCESS){this.setState({render:!1});const{orderUuid:s}=m.data,a=(0,he.u6)("ha_plus"),i={address:r,subscriptionId:e,orderUuid:s};a?(a.relocate_session=i,(0,he.e)("ha_plus",a)):(0,he.e)("ha_plus",{relocate_session:i}),t.push(`/${c.A.home_automation}/${j.dY}/select-relocation-address`)}else s(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}}}async componentDidMount(){await this.checkHaUser()&&(this.getPageMetaData(),this.get
1SubscriptionData())}render(){const{history:e,errorCode:t}=this.props,{title:s,camImage:a,render:r,subscriptionList:i,inactiveSubscriptionList:n,pendingSubscriptionList:l,canceledSubscriptionList:d,encSubId:m,rechargeText:p,rechargeBtnTxt:g,pendingText:f,cameraName:x,activeBtnTxt:b,detailsText:y,rechargePreText:S}=this.state,{userType:j}=!c.A.isServer()&&(JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||""),A=j&&"HA"===j?`${c.A.home_automation}/my-account`:`${c.A.my_account_path}`;return r?t||!i&&t?(0,v.jsx)(o.A,{}):(0,v.jsxs)("div",{className:"ipl_event",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA_PLUS"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)(G,{history:e,destination:A,excludeHa:!0}),(0,v.jsx)("div",{className:"heading-md ",style:{marginBottom:"24px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:s})}),(0,v.jsx)("div",{className:"innercontainer-sm wyze-wrap",children:(0,v.jsxs)("div",{className:"select-relocation-wrapp mT30",children:[i&&Object.keys(i).map(e=>(0,v.jsx)(ia,{camImage:a,address:i[e].address,count:i[e].cameraCount,date:i[e].endDate,name:i[e].name,packName:i[e].packName,packType:i[e].packType,packPrice:i[e].packPrice,subscriptionId:e,rechargeText:p,rechargeBtnTxt:g,status:"Active",encSubId:m,uom:i[e].uom,detailsText:y,source:"ha_plus_google"},e)),n&&Object.keys(n).map(e=>(0,v.jsx)(ia,{camImage:a,address:n[e].address,count:n[e].cameraCount,date:n[e].endDate,name:n[e].name,packName:n[e].packName,packType:n[e].packType,packPrice:n[e].packPrice,subscriptionId:e,rechargeText:p,rechargeBtnTxt:g,status:"Inactive",encSubId:m,uom:n[e].uom,detailsText:y,source:"ha_plus_google"},e)),l&&Object.keys(l).map(e=>(0,v.jsx)(ia,{camImage:a,address:l[e].address,name:l[e].name||x,subscriptionId:e,status:"Pending Activation",detailsText:f},e)),d&&Object.keys(d).map(e=>(0,v.jsx)(ia,{count:d[e].cameraCount,camImage:a,address:d[e].address,name:d[e].name||x,subscriptionId:e,status:"Cancelled",detailsText:f,date:d[e].endDate},e))]})})]})})})]}):(0,v.jsx)(u.A,{})}}const la=(0,l.Ng)(e=>({errorCode:e.commonReducer.errorCode}),e=>({setApiError:(0,F.zH)(g.x8,e),openModal:(0,F.zH)(U.qf,e)}))(oa);function ca(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}class da extends a.Component{constructor(...e){super(...e),this.state={isMsales:null,isOTT:null,isToggle:!1,collapse:""},this.handleCampaignUpdate=async()=>{const{setApiError:e}=this.props,{salesLeadParams:t}=(0,he.u6)("ha");if(t)try{const{data:s}=await f.n.postData("package/campaignRecord/update",{campaignId:t.campaignId,plan:t.plan});s.status||e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getPageMetaData=async()=>{await(0,T.bk)(`${j.dV}/s3-api/v1/assets/pages/hualai-homepage.json`,{},!0)},this.redirectToDestination=e=>{const{history:t,pageMetaData:s}=this.props;(0,x.Sw)({clickText:s.field_json&&s.field_json.button_text||"","Sub ID":(0,x.Xo)().id||null,pageSection:"","Type of Journey":"HA-Secure -Buy Journey ",event:"productClick",ecommerce:{click:{actionField:"",products:[{name:"Tata Play Secure",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Hualai",position:1}]}}}),(0,x.Sw)({event:"ctaClick",clickText:s.field_json&&s.field_json.button_text||"",featureName:"Tata Play Secure","Sub ID":(0,x.Xo)().id||null,pageSection:""}),t.push(`/${c.A.home_automation}/${j.oh}/${e}`)},this.redirectToDrupal=(e,t)=>{if(t)try{(0,x.Sw)({event:"ctaClick",clickText:t.clickText,featureName:t.featureName,"Sub ID":(0,x.Xo)().id||null,pageSection:"C"})}catch(e){}window.location.href=`/${c.A.home_automation}/${e}`},this.showVideoModal=(e,t)=>{e.preventDefault();const{openModal:s}=this.props;s(L.lx.HA_VIDEO_MODAL,{data:t,showVideoPopup:!0,parentClass:"wyze-vid-modal",backDropClass:"wyze-vid-backdrop",closePopup:!0})},this.handleModal=(e,t,s=null)=>{const{openModal:a}=this.props;if(s)try{(0,x.Sw)({event:"ctaClick",clickText:s.clickText,featureName:s.featureName,"Sub ID":(0,x.Xo)().id||null,pageSection:"D"})}catch(e){}a(L.lx.HA_COMMON_MODAL,{parentClass:"wyze-modal",backDropClass:"faded-backdrop",data:{title:e,body:t},closePopup:!0})},this.toggle=e=>{e.preventDefault();const{isToggle:t}=this.state;this.setState({isToggle:!t})},this.toggleFooter=e=>{const{collapse:t}=this.state;t&&e===t?t===e&&this.setState({collapse:!1}):this.setState({collapse:e})}}componentDidMount(){const{pageMetaData:e,location:t,location:{search:s}}=this.props;if(s){const e=(0,x.vA)(s),t={};e&&e.utm_campaign&&(t.utmCampaign=e.utm_campaign),e&&e.utm_source&&(t.utmSource=e.utm_source),e&&e.a&&(t.a=e.a),(0,x.ec)("utmParam",t)}const a=(0,x.Bd)(),r=(0,x.jv)();if(a||r)return void this.redirectToDestination("bundle");const i=(0,x.dl)();(a||r)&&this.setState({isMsales:!0}),i&&this.setState({isOTT:!0}),!e&&this.getPageMetaData();const{campaignId:n,plan:o}=(0,x.vA)(t.search),l=(0,he.u6)("ha"),c={campaignId:n||"",plan:o||""};if(l){if(n||o){const e=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?ca(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ca(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},l);e.salesLeadParams=c,(0,he.e)("ha",e)}}else(0,he.e)("ha",{salesLeadParams:c});this.handleCampaignUpdate();try{(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Buy Journey",event:"productImpression",ecommerce:{currencyCode:"INR",impressions:[{name:"Tata Play Secure ",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Hualai",list:"",position:" A"}]}})}catch(e){}}render(){const{history:e,pageMetaData:t,footerSsrData:s,footerStaticSsrData:r}=this.props,{isMsales:i,isOTT:n,isToggle:o,collapse:l}=this.state;return t?(0,v.jsxs)(A.A,{isSecure:!0,metatags:t?t.metatag:{},showBreadCrumb:!0,breadCrumbSchema:t.breadcrumb,children:[(0,v.jsxs)("div",{className:"wyze-wrap",children:[i||n?(0,v.jsx)(h.A,{isLogo:!0,journeyType:"HA"}):(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)(_t,{classes:"wyze-banner",bannerUrl:t.field_header_image&&t.field_header_image.url,body:t.field_subtitle,bannerResUrl:t.field_json&&t.field_json.field_responsive_image,btnText:t.field_json&&t.field_json.button_text,knowMoreTxt:t.field_json&&t.field_json.know_more,knowMoreUrl:`${j.oh}/hualai-camera`,btnUrl:`${j.oh}/bundle`,title:t.title,history:e}),(0,v.jsx)("section",{className:"clearfix con-servicewrapp check-planwrapp",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Et,{title:t.field_title_alert&&t.field_title_alert,vidData:t.field_home_video,imgData:t.field_image,body:t.field_body_alert,anchorTxt:t.field_json&&t.field_json.smart_alert,showVideoModal:this.showVideoModal,anchorUrl:"system/tata-play-secure/buy-journey-subscription"}),(0,v.jsxs)("div",{className:"alert-packwrapp",children:[(0,v.jsx)(b.A,{className:"heading-sm text-center",htmlContent:t.field_package_title_body}),(0,v.jsx)("div",{className:"alert-packcontainer",children:(0,v.jsx)("div",{className:"alert-pack-left alert-pack",children:t.field_smart_features&&t.field_smart_features.map((e,s)=>(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"gencamera",children:[(0,v.jsxs)("div",{className:"camera-section",children:[(0,v.jsx)("div",{className:"genimg setimg",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+e.field_image.url,alt:"",className:"img-fluid decorative-image"})}),(0,v.jsxs)("div",{className:"gentext",children:[e.field_label,(0,v.jsx)(b.A,{className:"camera-small-text",htmlContent:e.field_body})]}),(0,v.jsx)("div",{className:"sky-securewrapp",children:(0,v.jsx)("div",{className:"sky-secure-price",children:(0,v.jsxs)("span",{className:"tata-secureamount",children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("span",{className:"rupee fs12",children:"â¹"}),(0,v.jsxs)("span",{className:"price",children:[e&&e.field_features_price,e&&e.field_feature_duration&&(0,v.jsxs)("span",{className:"price-duration",children:["/",e.field_feature_duration]})]})]}),e.field_features_price_text&&(0,v.jsx)(b.A,{htmlContent:e.field_features_price_text})]})})})]}),(0,v.jsx)("div",{className:"knowmore-txt sec-cam-km",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:()=>this.redirectToDrupal(e.field_link[0].uri.split(":/")[1]||"",{clickText:e.field_link[0].title,featureName:e.field_label}),className:"linktext",children:e.field_link[0].title})})]}),t.field_smart_features.length-1!==s&&(0,v.jsx)("div",{className:"pluse-icon",children:(0,v.jsx)("img",{src:"/assets/images/home-automation/pluse-icon.png",className:"img-fluid informative-image",alt:""})})]}))})}),t.field_wifi_description&&(0,v.jsx)("div",{className:"wifi-container-home secure",children:(0,v.jsx)(k,{iconInfo:t.field_wifi_icon||"",descText:t.field_wifi_description})})]})]})}),(0,v.jsx)("section",{className:"benifit-service sub-planwrapp subscriptionwrapp buy-journey-wrapp",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)("div",{className:"heading-sm text-center",children:(0,v.jsx)("h2",{className:"ha-heading1 gradient",children:t.field_plans&&t.field_plans})}),(0,v.jsx)("div",{className:"row dth-offers-contr",children:t.field_subplans&&t.field_subplans.map((e,t)=>(0,v.jsx)(Tt,{title:e.field_title,imgUrl:e.field_image.url,plan:e.field_plan,anch
1orTxt:e.field_label,handleModal:this.handleModal,modalData:{title:e.field_link_popup,body:e.field_features_popup}},t))})]})}),(!w()(t.field_faq)||!w()(t.field_faq_main))&&(0,v.jsxs)("div",{className:"innercontainer-md ha-faq",style:{marginBottom:"60px",marginTop:"60px"},children:[!w()(t.field_faq_main)&&(0,v.jsx)(b.A,{htmlContent:t.field_faq_main}),!w()(t.field_faq)&&(0,v.jsx)("div",{id:"accordion",className:"accordion-main "+(o?"":"dis-none"),children:t.field_faq.map((e,t)=>(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("h3",{className:l===`id${t}`?"accordion-toggle acc-expanded":"accordion-toggle acc-collapsed",onClick:()=>this.toggleFooter(`id${t}`),children:e.question}),(0,v.jsx)(D.A,{isOpen:l===`id${t}`,children:(0,v.jsx)("div",{className:"accordion-content gc-acc",children:(0,v.jsx)("div",{className:"card-body",children:(0,v.jsx)("div",{className:"accordion-text",children:(0,v.jsx)(b.A,{htmlContent:e.answer})})})})})]}))}),(0,v.jsx)("div",{className:"mT20",children:(0,v.jsx)("div",{onClick:e=>this.toggle(e),className:"gc-anchor",children:o?"Less":"More"})})]}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show text-center home",children:(0,v.jsx)("button",{className:"btn42 btn-primary btn-lg waves-effect waves-light btn-resfull",type:"button",onClick:()=>this.redirectToDestination("bundle"),children:t.field_json&&t.field_json.button_text})}),i||n?null:(0,v.jsx)(p.A,{footerStaticSsrData:r,footerSsrData:s,showBreadCrumb:!0,breadCrumbData:t.breadcrumb})]}),!w()(t.field_faq)&&(0,v.jsx)(b.A,{Tag:"script",type:"application/ld+json",htmlContent:JSON.stringify((0,O.S)(t.field_faq))})]}):(0,v.jsx)(u.A,{})}}const ma={setApiError:g.x8,openModal:U.qf},ua=(0,l.Ng)(e=>({pageMetaData:e.commonReducer.currentPageMetaData,footerSsrData:e.commonReducer.footerSsrData,footerStaticSsrData:e.commonReducer.footerStaticSsrData}),ma)(da);class ha extends a.Component{constructor(...e){super(...e),this.state={activeTab:"1",showDemo:!0},this.getPageMetaData=async()=>{await(0,T.bk)(`${j.dV}/s3-api/v1/assets/pages/hualai-camera.json`,{},!0)},this.toggleTab=e=>{const{activeTab:t}=this.state;t!==e&&this.setState({activeTab:e})},this.showVideoModal=(e,t)=>{e.preventDefault();const{openModal:s}=this.props;s(L.lx.HA_VIDEO_MODAL,{data:t,showVideoPopup:!0,parentClass:"wyze-vid-modal",backDropClass:"wyze-vid-backdrop",closePopup:!0})},this.redirectToDestination=(e,t)=>{const{history:s}=this.props;(0,x.Sw)({event:"ctaClick",clickText:t,featureName:"","Sub ID":(0,x.Xo)().id||null,pageSection:""}),(0,x.Sw)({clickText:t,"Sub ID":(0,x.Xo)().id||null,pageSection:"","Type of Journey":"HA-Secure -Buy Journey",event:"productClick",ecommerce:{click:{actionField:"",products:[{name:"Tata Play Secure",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Hualai",position:1}]}}}),s.push(`/${c.A.home_automation}/${e}`)},this.checkHaUser=async()=>{const{setApiError:e}=this.props,{subId:t}=JSON.parse(localStorage.userAuth),s={subscriberId:t.id,source:"HA",provider:"Hualai"};try{const{data:e}=await f.n.checkHaUser(s);e.message===c.A.MESSAGES_TYPES.SUCCESS&&!0===e.status&&this.setState({showDemo:!1})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}}componentDidMount(){(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Buy Journey",event:"productImpression",ecommerce:{currencyCode:"INR",impressions:[{name:"Tata Play Secure",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"Hualai",list:"",position:""}]}}),this.getPageMetaData(),this.checkHaUser()}render(){const{activeTab:e,showDemo:t}=this.state,{history:s,pageMetaData:r,footerStaticSsrData:i,footerSsrData:n}=this.props;if(!r)return(0,v.jsx)(u.A,{});const o=[];return r&&r.field_tech_specs.forEach(e=>{o.push({field_content_techspecs:e.subform.field_content_techspecs[0].value,field_label_techspecs:e.subform.field_label_techspecs[0].value})}),(0,v.jsx)(A.A,{isSecure:!0,metatags:r?r.metatag:{},showBreadCrumb:!0,breadCrumbSchema:r.breadcrumb,children:(0,v.jsxs)("div",{className:"ipl_event google-camera hualai-camera wyze-wrap",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA",className:"on-top"}),(0,v.jsxs)("div",{className:"content-container pay-succes gs-alert",children:[(0,v.jsx)("div",{className:"gen-heading-wrapper",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:s,type:"history_back"}),(0,v.jsx)("div",{className:"heading-sm text-center top-space",children:(0,v.jsx)("h1",{className:"ha-heading1 movieTitle gradient",children:r.field_json.page_title})}),(0,v.jsx)("div",{className:"adon-tabs offer-tab gentab-wrapper",children:(0,v.jsx)("div",{className:"tabs-section",children:(0,v.jsxs)(Pt.A,{tabs:!0,className:"tabs style2",children:[(0,v.jsx)(It.A,{className:"1"===e?"active":"",children:(0,v.jsx)(Mt.A,{onClick:()=>{this.toggleTab("1")},children:"Overview"})}),(0,v.jsx)(It.A,{className:"2"===e?"active":"",children:(0,v.jsx)(Mt.A,{onClick:()=>{this.toggleTab("2")},children:"Tech Specs"})})]})})}),r&&(0,v.jsx)(Se,{classes:"wyze-drop",history:s,title:r.field_json.page_title,jsonUrl:"s3-api/v1/assets/pages/hualai-dropdown.json",includeCurrent:!0})]})}),(0,v.jsx)("div",{className:"nextgen-camwrapp mB0",style:{display:"1"===e?"block":"none"},children:r&&r.field_overview&&(0,v.jsx)(a.Fragment,{children:r.field_overview.map((e,s)=>"left"===e.field_allignment?(0,v.jsx)(_,{pageMetaText:r.field_json,showDemo:t,showVideoModal:this.showVideoModal,vidUrl:""!==e.field_link?e.field_link[0].uri:"",descData:e,isLastElement:s===r.field_overview.length-1}):(0,v.jsx)(E,{pageMetaText:r.field_json,showDemo:t,showVideoModal:this.showVideoModal,vidUrl:""!==e.field_link?e.field_link[0].uri:"",descData:e,isLastElement:s===r.field_overview.length-1}))})}),(0,v.jsx)("div",{className:"tech-specs-wrapp",style:{display:"2"===e?"block":"none"},children:o&&(0,v.jsx)(Lt,{pageData:o})}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show text-center",children:(0,v.jsx)(b.A,{Tag:"button",className:"btn42 btn-primary btn-lg waves-effect waves-light btn-resfull",type:"button",htmlContent:r.field_json&&r.field_json.button_text,onClick:()=>this.redirectToDestination(`${j.oh}/bundle`,r.field_json.button_text)})})]}),(0,v.jsx)(p.A,{footerStaticSsrData:i,footerSsrData:n,showBreadCrumb:!0,breadCrumbData:r.breadcrumb})]})})}}const pa=(0,l.Ng)(e=>({pageMetaData:e.commonReducer.currentPageMetaData,footerSsrData:e.commonReducer.footerSsrData,footerStaticSsrData:e.commonReducer.footerStaticSsrData}),e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))(ha);class ga extends a.Component{constructor(...e){super(...e),this.state={cartCount:1,dropdownOpen:!1,isOpenSubscription:!0,isSubsFeatureOpen:!1,subscriptionData:[],showSnack:!1,cartMaxCount:4,isMsales:!1,isOTT:!1,snackText:null,render:!1,utmSource:null,a:null},this.componentDidUpdate=e=>{const{pageData:{productData:t}}=this.props;e.pageData.productData},this.productDetailGA=()=>{const{cartCount:e,subscriptionData:t,isMsales:s}=this.state,{pageData:{productData:a},pageMetaData:r}=this.props;parseInt(a&&a.field_discountprice,10);let i={};t.forEach(t=>{e>=t.deviceCountMin&&"base"===t.packTypeEbr.toLowerCase()&&"annual"===t.packUom.toLowerCase()&&(i=t)});const n=parseInt(i.discountedPrice,10);(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Buy Journey",event:"productDetailVie
1w",ecommerce:{detail:{actionField:"",products:[{name:"Tata Play Secure",id:i.id,price:parseInt(a&&a.field_discountprice,10)+n,brand:"Tata Play",category:"Home Automation",variant:"Hualai",productName:`${a&&a.title||"Tata Play Secure Camera"}, ${i&&i.friendlyName}`}]}}})},this.updateCampaignRecord=async()=>{try{const{salesLeadParams:e}=(0,he.u6)("ha");if(!e)return;const{data:t}=await ue.campaignRecordUpdate({campaignId:e.campaignId||"",plan:e.plan||""})}catch(e){console.log(e)}},this.getPageMetaData=async()=>{await(0,T.bk)(`${j.dV}/s3-api/v1/assets/pages/bundle-page-hualai.json`,{},!0)},this.getProductsData=async()=>{await(0,he.Sg)()},this.getSubscriptionData=async()=>{(0,he.qS)().then(e=>{this.saveSubData()})},this.saveSubData=()=>{new Date;const e=(0,x.Bd)(),{pageData:{subscriptionData:t}}=this.props;try{if(Array.isArray(t)&&t.length>0){let s="wyze";e&&(s="hualai_msales");const a=t.filter(e=>e.meta.field_journey&&e.meta.field_journey.includes(s));if(a.length>0){const e=a.sort((e,t)=>e.deviceCountMin-t.deviceCountMin);this.setState({subscriptionData:e,cartMaxCount:a[0].maxCount})}}this.productDetailGA(),this.addRemoveCartGaEvent("plus",!0)}catch(e){console.log(e)}},this.toggle=e=>{e.preventDefault();const{dropdownOpen:t}=this.state;this.setState({dropdownOpen:!t})},this.toggleAccordion=(e,t)=>{const{[t]:s}=this.state;e.preventDefault(),this.setState({[t]:!s})},this.checkPaymentStatus=async()=>{const{setApiError:e}=this.props,t=(0,he.u6)("ha");if(t&&t.orderUuid)try{const{data:s}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${t.orderUuid}`);if(s.status&&s.message===c.A.MESSAGES_TYPES.SUCCESS){const t=s.data;if(!t&&!Object.isArray(t)&&t.length<=0)return void e(c.A.serverError,!0);const a=t[0].paymentStatus;let r=null;"SUCCESS"===a?r=j.QZ.SUCCESS:"INPROGRESS"===a?r=j.QZ.AWAITED:"FAILED"===a&&(r=j.QZ.FAILURE),(0,he.VJ)(r)}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.handleSubmit=async(e,t)=>{const s=this.getCartInfoGA();await this.checkPaymentStatus();const{cartCount:a,utmSource:r,a:i}=this.state,{history:n,pageData:{productData:o}}=this.props,l=[];let d,m;""!==o.field_json&&""!==e.meta.field_json&&(d=JSON.parse(o&&o.field_json).summary_text,m=JSON.parse(e.meta.field_json).summary_text),l.push({subscriptionUuid:e.uuid,description:m||""});const u=[];u.push({productUuid:o.field_uuid,count:a,description:d||""});const h={addedProductData:u,addedsubscriptionData:l};
1if(!c.A.isServer()){const e=(0,he.u6)("ha");e?(e.productData=h,e.cartCount=a,e.gaInfo=s,(0,he.e)("ha",e)):(0,he.e)("ha",{productData:h,cartCount:a,gaInfo:s})}if((0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Buy Journey",event:"checkout",ecommerce:{checkout:{actionField:{step:1,option:"Cart view"},products:[{name:"Tata Play Secure",id:s.id,price:s.price,brand:"Tata Play",category:"Home Automation",variant:"Hualai",quantity:a,productName:`${s.ProductName}, ${s.packName}`}]}}}),"tp-fiberndth"===r){const e=[];e.push({product:o&&o.title||"",count:a,productType:o&&o.field_type});const t={product:e,subscription:l,totalAmout:s&&s.price,source:"haportal",serviceProvider:"Hualai",refId:i};(0,x.Nq)("hatpfD",t),n.push(`/${c.A.home_automation}/intent`)}else n.push(`/${c.A.home_automation}/${j.oh}/order-address`)},this.setSessionCartCount=()=>{const{cartCount:e}=this.state;if(!c.A.isServer()){const t=(0,he.u6)("ha");t?(t.cartCount=e,t.prevCartCount=t.prevCartCount?t.prevCartCount:e,(0,he.e)("ha",t)):(0,he.e)("ha",{cartCount:e,prevCartCount:e})}},this.handleCartItemCount=(e,t)=>{const{cartCount:s,cartMaxCount:a}=this.state,{pageMetaData:r,pageData:{productData:i}}=this.props;let n=0;if("minus"===e?n=parseInt(s,10)-1:"plus"===e&&(n=parseInt(s,10)+1),n>a){const e=r?`${r.field_json.snack_text} ${a}`:null;return void this.setState({showSnack:!0,snackText:e})}n<1||this.setState({cartCount:n},()=>{this.handleCartPrice(t),this.addRemoveCartGaEvent(e,!1)})},this.addRemoveCartGaEvent=(e,t)=>{const s=this.getCartInfoGA(),{cartCount:a}=this.state;"minus"===e&&(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Buy Journey",event:"removeFromCart",ecommerce:{remove:{products:[{name:"Tata Play Secure",id:s.id,price:s.singleProdPrice,brand:"Tata Play",category:"Home Automation",variant:"Hualai",list:"NA",quantity:1,productName:`${s.ProductName}, ${s.packName}`}]}}}),"plus"===e&&(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Buy Journey",event:"addToCart",ecommerce:{currencyCode:"INR",add:{products:[{name:"Tata Play Secure",id:s.id,price:t?s.price:s.singleProdPrice,brand:"Tata Play",category:"Home Automation",variant:"Hualai",list:"NA",quantity:t?a:"1",productName:`${s.ProductName}, ${s.packName}`}]}}})},this.getCartInfoGA=()=>{const{cartCount:e,subscriptionData:t,isMsales:s}=this.state,{pageData:{productData:a},pageMetaData:r}=this.props,i=parseInt(a&&a.field_discountprice,10)*e;let n={};t.forEach(t=>{e>=t.deviceCountMin&&"base"===t.packTypeEbr.toLowerCase()&&"annual"===t.packUom.toLowerCase()&&(n=t)});const o=i+parseInt(n.discountedPrice,10);return{id:n.id,price:o,packName:n.friendlyName,ProductName:a&&a.title||"Tata Play Secure Camera",singleProdPrice:parseInt(a&&a.field_discountprice,10)}},this.closeAlert=e=>{e.stopPropagation(),this.setState({showSnack:!1})},this.handleCartPrice=e=>{const{cartCount:t,subscriptionData:s,isMsales:a}=this.state,{pageData:{productData:r},pageMetaData:i}=this.props,n=r&&r.field_actualprice,o=parseInt(r&&r.field_discountprice,10)*t;let l={};s.forEach(e=>{t>=e.deviceCountMin&&"base"===e.packTypeEbr.toLowerCase()&&"annual"===e.packUom.toLowerCase()&&(l=e)});const c=parseInt(l.discountedPrice,10);let d=null;if(a&&o+c>parseInt(r&&r.field_msales_transamt,10))return d=i?`${i.field_json.snack_msales_transtext} ${r.field_msales_transamt}`:null,void this.setState({snackText:d,showSnack:!0,cartCount:t-1},()=>{this.setSessionCartCount()});this.setState({cameraPrice:parseInt(n,10)*t,cameraSellPrice:o},()=>{this.setSessionCartCount()})},this.redirectToDestination=e=>{const{history:t}=this.props;t.push(`/${c.A.home_automation}/${e}`)}}componentDidMount(){const{history:{location:{search:e}}}=this.props,t=(0,x.GY)("utmParam")||"";if(this.setState({utmSource:t?t.utmSource:null}),this.setState({a:t?t.a:null}),e&&!t){const t=(0,x.vA)(e),s={};t&&t.utm_campaign&&(s.utm_campaign=t.utm_campaign),t&&t.utm_source&&(s.utm_source=t.utm_source),t&&t.a&&(s.a=t.a),(0,x.ec)("utmParam",s)}this.getPageMetaData(),this.getProductsData();const s=(0,x.Bd)(),a=(0,x.dl)(),r=(0,x.jv)();(s||r)&&this.setState({isMsales:!0}),a&&this.setState({isOTT:!0});const i=(0,he.u6)("ha");if(i){const e=i.cartCount?i.cartCount:1;this.setState({cartCount:e})}else(0,he.e)("ha",{salesLeadParams:{campaignId:"",plan:""}});
1this.getSubscriptionData(),this.updateCampaignRecord()}render(){const{history:e,pageMetaData:t,pageData:{productData:s,subscriptionData:r},footerStaticSsrData:i,footerSsrData:n}=this.props,{cartCount:o,cartMaxCount:l,isOpenSubscription:d,showSnack:m,snackText:g,isSubsFeatureOpen:f,isMsales:x,isOTT:y,utmSource:S}=this.state;if(!s||w()(r)||!(r.length>0))return(0,v.jsx)(u.A,{});let j={};r.forEach(e=>{o>=e.deviceCountMin&&"base"===e.packTypeEbr.toLowerCase()&&"annual"===e.packUom.toLowerCase()&&(j=e)});const N=s&&s.field_actualprice&&parseInt(s.field_actualprice,10)*o,C=s&&s.field_discountprice&&parseInt(s.field_discountprice,10)*o,_=j&&j.packMrp&&parseInt(j.packMrp,10),E=C+(j&&j.discountedPrice&&parseInt(j.discountedPrice,10)),T=N+_-E;return(0,v.jsx)(A.A,{isSecure:!0,metatags:t?t.metatag:{},showBreadCrumb:!0,breadCrumbSchema:t&&t.breadcrumb?t.breadcrumb:{},children:(0,v.jsxs)("div",{className:"ipl_event wyze-wrap wyze-bundle",children:[m&&g&&(0,v.jsx)(ge,{text:g,closeAlert:this.closeAlert,cartMaxCount:l}),x||y?(0,v.jsx)(h.A,{isLogo:!0,journeyType:"HA"}):(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[x||y?null:(0,v.jsx)(G,{history:e,destination:"tata-play-secure"}),(0,v.jsx)("div",{className:"heading-md "+(x||y?"msale-ott":""),style:{marginBottom:"30px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient wyze-bundle-heading",children:t&&t.field_json.bundle_heading})}),!x&&t&&(0,v.jsx)("div",{className:"bundle",children:(0,v.jsx)(Se,{classes:"wyze-drop",history:e,title:t&&t.field_json.dropdown_title,jsonUrl:"s3-api/v1/assets/pages/hualai-dropdown.json",includeCurrent:!0})}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsx)("div",{className:"features-wrapp",children:(0,v.jsxs)("div",{id:"accordion",className:"accordion-packchange",children:[(0,v.jsx)("div",{className:"acc-cont bor-bottom pB10",children:(0,v.jsx)("div",{children:(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsxs)("div",{className:"feat-accor-img",children:[" ",(0,v.jsx)("img",{src:s&&s.field_image&&`${c.A.NODE_API_ROOT}${s.field_image.url}`,alt:s&&s.field_image&&s.field_image.alt})," "]}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[(0,v.jsx)("span",{children:s&&s.title}),s&&s.field_wifi_description&&(0,v.jsxs)("div",{className:"wifi-contr",children:[(0,v.jsx)("span",{className:"icon-contr",style:{marginRight:"5px"},children:s.field_wifi_icon&&s.field_wifi_icon.url&&(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${s.field_wifi_icon.url}`,alt:"",style:{display:"flex",width:"14px"}})}),(0,v.jsx)(b.A,{Tag:"span",className:"wifi-desclaimer-text",htmlContent:s.field_wifi_description})]}),s&&s.field_subtitle]}),(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsxs)("div",{className:"qty",children:[(0,v.jsx)("span",{className:"minus",onClick:()=>this.handleCartItemCount("minus",j),children:"-"}),(0,v.jsx)("input",{type:"text",className:"count",name:"qty",value:o}),(0,v.jsx)("span",{className:"plus",onClick:()=>this.handleCartItemCount("plus",j),children:"+"})]}),(0,v.jsxs)("div",{className:"price",children:[N!==C&&(0,v.jsxs)("div",{className:"label cutprice",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:N})]}),0!==C?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee rupee-fs14",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:C})]}),(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"annual-sub-price offer-text",children:t&&t.field_json.inclusive_text})})]}):(0,v.jsx)("div",{className:"label",children:"Free"})]})]})]})})}),j&&Object.keys(j).length>0&&(0,v.jsxs)("div",{className:"acc-cont",children:[(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsxs)("div",{className:"feat-accor-img",children:[" ",j.meta.field_image&&(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+j.meta.field_image.url,alt:j.meta.field_image.alt,style:{width:"45px"}})," "]}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[" ",(0,v.jsx)("span",{children:j.friendlyName})," ",j.meta.title," "]}),(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsxs)("div",{className:"price",children:[j.packMrp!==j.discountedPrice&&(0,v.jsxs)("div",{className:"label cutprice",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"annual-sub-cut-price",children:j&&j.packMrp})]}),(0,v.jsx)("div",{className:"label",children:(0,v.jsxs)("span",{className:"annual-sub-price",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"bold",children:j&&j.discountedPrice}),(0,v.jsx)("span",{className:"small",children:j&&"annual"===j.packUom.toLowerCase()?"/year":null})]})})]}),(0,v.jsx)(b.A,{Tag:"span",htmlContent:j.meta.field_offer_label})]})]}),(0,v.jsxs)("div",{className:"fea-bene-text-outer",children:[(0,v.jsx)("div",{onClick:e=>this.toggleAccordion(e,"isOpenSubscription"),className:"fea-bene-text accordion-toggle "+(d?"acc-expanded":"acc-collapsed"),children:"Features and benefits"}),(0,v.jsx)(D.A,{isOpen:d,children:j.meta.field_sub_features&&j.meta.field_sub_features.map((e,t)=>{if(t<=4)return(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t);if(5===t){const e=j.meta.field_sub_features.slice(5,j.meta.field_sub_features.length);return(0,v.jsxs)("div",{children:[(0,v.jsx)(D.A,{isOpen:f,style:{border:"0",paddingBottom:"0"},children:e.map((e,t)=>{if(""!==e.field_body&&""!==e.field_image.url)return(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t)})}),(0,v.jsx)("div",{className:"fb-blk d-block",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:e=>this.toggleAccordion(e,"isSubsFeatureOpen"),className:"viewmore less",children:f?"View Less":"View More"})})]})}})})]})]})]})}),!x&&t&&(0,v.jsx)(b.A,{htmlContent:t.body}),x&&t&&(0,v.jsx)("div",{children:(0,v.jsx)("p",{className:"fs12 mT10 text-center botom-txt",children:t.field_json.bottom_info_text})})]}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show",children:(0,v.jsxs)("div",{className:"dflex-sb innercontainer-sm",children:[(0,v.jsxs)("div",{className:"cart-wrapp dflex-sb",children:[(0,v.jsxs)("div",{className:"cart-icon mR10",children:[" ",(0,v.jsx)("img",{src:"/assets/images/home-automation/cart.svg",alt:""}),(0,v.jsx)("div",{className:"cart-items",children:o})]}),(0,v.jsxs)("div",{className:"carttext ",children:[" ",(0,v.jsx)("span",{className:"d-block",children:(0,v.jsxs)("div",{className:"label mL5 bigfont",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"total-price1",children:E})]})})," ",T>0&&(0,v.jsxs)("span",{className:"gradient",children:["Benefits worth ",(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"you-save-price",children:T})]})]})," "]})]}),(0,v.jsx)("button",{type:"button",className:"btn42 btn-primary waves-effect waves-light share-summary",onClick:()=>this.handleSubmit(j,E,T),children:"Subscribe"})]})})]})})}),x||y?null:(0,v.jsx)(p.A,{footerStaticSsrData:i,footerSsrData:n,showBreadCrumb:!0,breadCrumbData:t&&t.breadcrumb})]})})}}const fa={setApiError:g.x8},xa=((0,l.Ng)(e=>({pageMetaData:e.commonReducer.currentPageMetaData,pageData:e.commonReducer.pageData,footerSsrData:e.commonReducer.footerSsrData,footerStaticSsrData:e.commonReducer.footerStaticSsrData}),fa)(ga),["hasErrors"]);function ba(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function va(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?ba(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ba(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class ya extends a.Component{constructor(e){super(e),this.checkWoStatus=async()=>{this.setState({render:!1});const{setApiError:e,openModal:t,history:s}=this.props;try{const{userAuth:a}=localStorage,{subId:r}=JSON.parse(a),i={subscriberId:r.id},{data:n}=await f.n.postData("order/workorder/getWoPendingStatus",i);if(n.status)return!0;if("FAILURE"!==n.message){const e=!0;return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Oops! Your previous order is pending",body:"To perform any action, we need to close your previous order. Please contact our call centre to get an update on your work order status.",btnTxt:"Ok",redirectUrl:"/",onClose:e},redirectRoute:!0,onCloseEvent:()=>{e&&(window.location.href="/")},history:s}),this.setState({showBlank:!0,render:!0}),!1}e(c.A.serverError,!0)}catch(t){e(c.A.serverError,!0)}},this.checkOrderStatus=async e=>{const{history:t,setApiError:s}=this.props;let a=va({},e);const r={orderType:"NEW",subId:JSON.parse(localStorage.userAuth).subId.id,provider:"Hualai"};try{const{data:e}=await f.n.postData("package/getOrderStatusBySubId",r);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const s=e.data;let r=null;s.cameraCount&&""!==s.cameraCount&&((0,he.$4)(s.cameraCount,"ha",s.cameraCount),r=await this.setSubscriptionData(s.cameraCount)),s.address&&(0,he.PS)(s.address);const i=s.subId||localStorage.userAuth&&JSON.parse(localStorage.userAuth).subId;if(a=(0,he.u6)("ha"),r){const{productData:e}=a;e.addedsubscriptionData=[{subscriptionUuid:r.uuid,description:r.meta.field_subtitle||""}]}a.orderChecked=!0,"Initiated"!==s.orderStatus&&"Completed"!==s.orderStatus||(a.paymentStatus=j.QZ.SUCCESS),"Completed"!==s.orderStatus?a.orderCreated=!!m()(s,"address.orderUuid",!1):a.prevCartCount=1,a.subId=i,(0,he.e)("ha",a);const n=j.MC.orderStatusList[s.page];n?"CREATE ADDRESS"!==s.page&&t.push(`/${c.A.home_automation}/${j.oh}/${n}`):t.push(`/${c.A.home_automation}/${j.oh}`)}else s(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}return a},this.setSubscriptionData=async e=>{const t=new Date;let s={};try{const{data:a}=await f.n.getJsonData(`read/core-api/subscription/search/${ne()(t).format("YYYYMMDD")}`);if(a.status===c.A.MESSAGES_TYPES.SUCCESS&&Array.isArray(a.data)&&a.data.length>0){const t=a.data;t.filter(e=>e.meta.field_journey&&e.meta.field_journey.includes("wyze")).forEach(t=>{e>=t.deviceCountMin&&(s=t)})}}catch(e){console.log(e)}return s},this.getModalData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/order-address-page-json-data.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data;this.setState({title:e.title,pageJsonData:e.field_json,termsText:e.body,modalData:e.field_json.popup_config})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.checkSubscriberStatus=()=>{const{selectedSubId:e,subscribersStatus:t,modalData:s,encSubIdList:a}=this.state,r="object"==typeof e?e.id:e,i=a[r];if("Active"===t[r])return!0;const{openModal:n,history:o}=this.props;let l,c,d="",m="",u=null,h="",p=!1;if(s&&Array.isArray(s)&&s.length>0){if("Temp Suspension"===t[r]){const e=s.filter(e=>"TEMP_SUSPEND"===e.status);d=e[0].heading,m=e[0].subHeading1,u=e[0].subHeading2,h=e[0].button_text,l=e[0].button_link,c=e[0].field_url_source}if("Deactivated"===t[r]){const e=s.filter(e=>"DEACTIVATED"===e.status);d=e[0].heading,m=e[0].subHeading,h=e[0].button_text,p=!0}}return n(L.lx.COMMON_MODAL,{Component:Ne,data:{title:d,body:m,subHeading2:u,showRecharge:p,encSubId:i,btnTxt:h,redirectUrl:l,fieldSource:c},history:o}),!1},this.createOrder=async e=>{const{setApiError:t}=this.props,s=(0,x.Bd)(),a=(0,x.jv)(),r=(0,x.GY)("utmParam");if(e){const i=va({},e),n=m()(i,"salesLeadParams",""),o=m()(i,"productData",""),l=JSON.parse(localStorage.getItem("userAuth")),{subId:d}=l,u={campaignId:n?n.campaignId:"",name:d.name,orderType:"NEW",plan:n?n.plan:"",subId:d.id,product:o.addedProductData,subscription:o.addedsubscriptionData,provider:"Hualai",utmParam:r||null};s&&(u.dealerId=s.HaDealerId,u.source="hamsales"),a&&(u.dealerId=a.HaDealerId,u.source="TPF");try{const{data:e}=await ue.createOrder(u);e&&!0===e.status?(this.setState({orderUuid:e.data.orderUuid}),i.orderUuid=e.data.orderUuid,i.prevCartCount=i.cartCount,i.orderCreated=!0,i.paymentStatus=null,i.mismatch=!1,(0,he.e)("ha",i)):t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}}}
1,this.getSubsciberDetails=async e=>{const{setApiError:t}=this.props,s={subscriberId:"object"==typeof e?e.id:e,source:"WEB"};try{const{data:e}=await f.n.postData("order/address/getAddress",s);e.message===c.A.MESSAGES_TYPES.SUCCESS?this.setInfoForm(e.data):t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.setInfoForm=(e,t)=>{const{infoForm:s}=this.state,a=va({},s),{adrLine1:r,adrLine2:i,city:n,email:o,pinCode:l,state:c,building:d,landmark:m,location:u}=a;r.value=e.address||"",i.value=e.addressline2||"",u.value=e.location||"",n.value=e.city||"",o.value=e.emailId||"",l.value=e.areaPincode||"",c.value=e.state||"",d.value=e.building||"",m.value=e.landmark||"",e.termsChecked&&this.setState({termsChecked:e.termsChecked}),this.setState({infoForm:a,selectedSubName:e.subscriberName,render:!0},()=>this.getPinCodeData(e.areaPincode,t))},this.getPinCodeData=async(e,t)=>{if(!e)return;const{setApiError:s}=this.props;try{const{data:t}=await f.n.getData(`payment/pincode/getPinDetailsByZipCode/${e}/Hualai`),{infoForm:a,pageJsonData:r}=this.state,i=va({},a),{city:n,pinCode:o,state:l,location:d}=i;if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data;if(e&&Array.isArray(e)&&e.length>0){if(l.value&&l.value!==e[0].state.trim())return o.valid=!1,o.errorMessage=r&&r.state_err||"State is different",void this.setState({infoForm:i});n.value=e[0].city.trim(),o.value=e[0].zipcode,o.valid=!0,l.value=e[0].state.trim();const t=e&&e.map(e=>({label:e.location,value:e.location}));d.elementConfig.options=[{label:"select",value:""},...t]}else o.valid=!1,o.errorMessage=r&&r.pincode_err||"Apologies, currently we are unavailable in your city. We will be launching soon!";this.setState({infoForm:i})}else s(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}},this.inputChangedHandler=(e,t)=>{const{infoForm:s}=this.state,a=va({},s),{location:r}=a,i=va({},a[t]);let n=e;"pinCode"===t&&(n=n.replace(/[^0-9]/g,""),n.length>6&&(n=n.slice(0,6)),6===n.length&&this.getPinCodeData(n,!0),n.length<6&&(r.elementConfig.options=[{label:"select",value:""}],r.value=null,this.setState({infoForm:a}))),i.value=n,i.touched=!0,i.valid=!0,i.errorMessage="",a[t]=i,this.setState({infoForm:a})},this.validateForm=async e=>{this.setState({render:!1}),e.preventDefault();const{infoForm:t,selectedSubId:s,selectedSubName:a,orderUuid:r,termsChecked:i}=this.state;if(!this.checkSubscriberStatus())return void this.setState({render:!0});const{history:n}=this.props,o={},l=Object.keys(t);l.forEach(e=>{o[e]=t[e].value});const c=H(o),{hasErrors:d}=c,m=(0,I.A)(c,xa);if(d){const e=va({},t);let s=null;l.forEach((t,a)=>{0===a&&(s=t);const r=m[`${t}Message`];r&&""!==r&&(e[t].valid=!1,e[t].errorMessage=r)}),this.setState({infoForm:e,formErrorMessage:"",render:!0}),s&&document.getElementById(s).scrollIntoView()}else{let e=!0;if(l.forEach(s=>{t[s].valid||(e=!1)}),e){if(!i)return void this.setState({showCheckError:!0,render:!0});const e={areaPincode:t.pinCode.value.trim(),address:t.adrLine1.value.trim(),addressline2:t.adrLine2.value.trim(),city:t.city.value.trim(),landmark:t.landmark.value.trim(),location:t.location.value.trim(),emailId:t.email.value.trim(),state:t.state.value.trim(),building:t.building.value.trim(),subId:s,subscriberName:a,termsChecked:i},r=(0,he.u6)("ha");r.infoForm=e,(0,he.e)("ha",r);const n={building:t.building.value.trim(),city:t.city.value.trim(),landmark:t.landmark.value.trim(),location:t.location.value.trim(),orderUuid:r.orderUuid,postalCode:t.pinCode.value.trim(),state:t.state.value.trim(),streetAddress:t.adrLine1.value.trim(),streetAddress2:t.adrLine2.value.trim(),email:t.email.value.trim(),subId:"object"==typeof s?s.id:s};this.gaCheckoutEvent(),this.createAddress(n)}}},this.gaCheckoutEvent=()=>{const e=(0,he.u6)("ha");(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Buy Journey",event:"checkout",ecommerce:{checkout:{actionField:{step:2,option:"Customer Details"},products:[{name:"Tata Play Secure ",id:e.gaInfo.id,price:e.gaInfo.price,brand:"Tata Play",category:"Home Automation",variant:"Hualai",quantity:e.cartCount,productName:`${e.gaInfo.ProductName},${e.gaInfo.packName}`}]}}})},this.createAddress=async e=>{const{history:t}=this.props;try{const{data:s}=await f.n.postData("order/address/create",e);if(s.status)if(null===s.data){const{infoForm:e}=this.state,t=s.message.charAt(0).toUpperCase()+s.message.slice(1).toLowerCase();e.pinCode.valid=!1,this.setState({infoForm:e,formErrorMessage:t,render:!0})}else{if(s.data.page&&"bundle"===s.data.page.toLowerCase())return void t.push(`/${c.A.home_automation}/${j.oh}/bundle`);t.push(`/${c.A.home_automation}/${j.oh}/payment-summary`)}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}},this.handleSubscriberIDSelect=e=>{this.setState({render:!1}),this.setState({selectedSubId:e.target.value},()=>{const{selectedSubId:e}=this.state;
1this.getSubsciberDetails(e)})},this.inputCheckHandler=()=>{const{termsChecked:e,showCheckError:t}=this.state;this.setState({termsChecked:!e},()=>{const{termsChecked:e}=this.state;e&&t&&this.setState({showCheckError:!1})})},this.initialForm={pinCode:{wrapperClasses:["form-group","pincode-field","more-connection-pincode"],labelConfig:{label:"Pin code",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"pinCode",type:"tel",placeholder:"",maxLength:6,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},location:{wrapperClasses:["form-group","location-field"],labelConfig:{label:"Location",classes:["sel","active","mendate"]},elementType:"select",elementConfig:{id:"location",placeholder:"",options:[{label:"select",value:""}]},value:"",errorMessage:"",valid:!0,touched:!1},building:{wrapperClasses:["form-group","building-field"],labelConfig:{label:"Building Name",classes:["sel","active"]},elementType:"input",elementConfig:{id:"building",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine1:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Address Line 1",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"adrLine1",type:"text",placeholder:"",maxLength:75,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine2:{wrapperClasses:["form-group","addr2-field"],labelConfig:{label:"Address Line 2",classes:["sel","active"]},elementType:"input",elementConfig:{id:"adrLine2",type:"text",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},landmark:{wrapperClasses:["form-group","landmark-field"],labelConfig:{label:"Landmark",classes:["sel","active"]},elementType:"input",elementConfig:{id:"landmark",type:"text",placeholder:"",maxLength:25,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},city:{wrapperClasses:["form-group","city-field"],labelConfig:{label:"City",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"city",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},state:{wrapperClasses:["form-group","state-field"],labelConfig:{label:"State",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"state",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},email:{wrapperClasses:["form-group","email-field"],labelConfig:{label:"Email",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"email",type:"email",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}},this.state={showBlank:!1,title:null,pageJsonData:null,termsText:null,termsChecked:!0,showCheckError:!1,render:!0,infoForm:va({},this.initialForm),subIdList:[],encSubIdList:[],selectedSubId:null,selectedSubName:null,formErrorMessage:null,button:{buttonConfig:{type:"submit",class:"wAutoLgBlue"},text:"Proceed to Summary",url:"select-language",disabled:!1},orderUuid:null,subscribersStatus:null,modalData:null,isMsales:null},this.bodyRef=a.createRef()}async componentDidMount(){this.bodyRef.current&&this.bodyRef.current.scrollTo(0,0);const{history:e}=this.props;if(!await this.checkWoStatus())return;const t=(0,x.Bd)(),s=(0,x.jv)();(t||s)&&this.setState({isMsales:!0,termsChecked:!0});const a=(0,he.u6)("ha");let r;if(a||e.push(`/${c.A.home_automation}/${j.oh}`),a.orderType=null,(0,he.e)("ha",a),a.orderChecked||t||(r=await this.checkOrderStatus(a)),await this.getModalData(),localStorage.getItem("userAuth")){this.setState({render:!1});const e=JSON.parse(localStorage.getItem("userAuth")),{subscriberIds:t,accountStatus:s,encSubscriberId:i}=e,n=[],o={},l={};t.forEach((e,t)=>{n.push({label:e,value:e}),o[e]=s[t],l[e]=i[t]}),this.setState({subIdList:[...n],subscribersStatus:o,encSubIdList:l},()=>{const t=r||a;if(t&&t.infoForm){const e=t.infoForm;this.setState({selectedSubId:e.subId}),this.setInfoForm(e,!1)}else{const t=e.subId.name,s=e.subId.id;this.setState({selectedSubId:s,selectedSubName:t},()=>{this.getSubsciberDetails(s)})}})}const i=(0,he.u6)("ha"),n=[j.QZ.SUCCESS,j.QZ.AWAITED,j.QZ.FAILURE],{cartCount:o,prevCartCount:l,paymentStatus:d,mismatch:m}=i;(!i.orderCreated||o!==l||d||m)&&(o&&l||d&&n.includes(d)||m||t)&&this.createOrder(r||a)}render(){const{showBlank:e,button:t,infoForm:s,render:r,formErrorMessage:i,subIdList:n,selectedSubName:o,selectedSubId:l,modalData:d,termsChecked:m,isMsales:p,showCheckError:g,termsText:f,pageJsonData:x,title:y}=this.state,{history:S}=this.props,A=(0,he.u6)("ha");if(e)return null;if(!(d&&o&&l&&n.length>0&&r))return(0,v.jsx)(u.A,{});const N=[];
1return Object.keys(s).forEach(e=>{N.push({id:e,config:s[e]})}),(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{className:"inner-page",ref:this.bodyRef,children:[!r&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap wyze-secure",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_WYZE_SUBSCRIPTION,activeStepper:"2"}),(0,v.jsx)(G,{history:S,destination:`${j.oh}/bundle`}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:y&&y})}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("div",{className:"details-wrapp",children:[(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"sel",children:"Name"}),(0,v.jsx)("div",{className:"forminfo",children:o})]}),(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"sel",children:"Subscriber ID"}),n&&n.length>1&&(0,v.jsx)("div",{className:"forminfo",children:(0,v.jsx)("select",{className:"form-control",style:{padding:"0 6px"},value:l,onChange:e=>{this.handleSubscriberIDSelect(e)},children:n&&n.map(e=>(0,v.jsx)("option",{value:e.value,children:e.label}))})}),n&&1===n.length&&(0,v.jsx)("div",{className:"forminfo",children:n[0].label})]})]}),(x&&x.multi_disclaimer&&x.multi_disclaimer.sub_title||x&&x.multi_disclaimer&&x.multi_disclaimer.title)&&A.cartCount>1&&(0,v.jsxs)("div",{className:"Installation-info",children:[x.multi_disclaimer.title&&(0,v.jsxs)("p",{className:"txt-medium mB5 main-text",children:[(0,v.jsx)("span",{className:"icon-contr",children:x.multi_disclaimer.icon&&(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${x.multi_disclaimer.icon}`,width:"14"})}),x.multi_disclaimer.title]}),x.multi_disclaimer.sub_title&&(0,v.jsx)(b.A,{Tag:"p",className:"small mT0",htmlContent:x.multi_disclaimer.sub_title})]}),(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"innercontainer-xs install-wrapp order-addr-form",children:[(0,v.jsx)("div",{className:"orderttl",children:"Installation Address"}),N&&N.map(e=>(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)},e.id)),f&&!p&&(0,v.jsxs)("div",{className:"mT32 text-center",children:[(0,v.jsx)("input",{type:"checkbox",className:"filled-in form-check-input",id:"checkbox1",checked:m?"checked":"",onClick:()=>this.inputCheckHandler()}),(0,v.jsx)(b.A,{Tag:"label",className:"form-check-label fs12",htmlFor:"checkbox1",htmlContent:f})]}),g&&(0,v.jsx)("span",{className:"validate invalid-text",style:{marginTop:"10px"},children:"This field is required"})]}),(0,v.jsxs)("div",{className:"btn-contr text-center more-connection-btn",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",children:i}),(0,v.jsx)(R.A,{disabled:t.disabled,config:t.buttonConfig,content:t.text,onClick:e=>this.validateForm(e)})]})]}),(0,v.jsx)("div",{className:"text-center order-note",children:x&&x.bottom_txt})]})]})]})})]})})}}(0,l.Ng)(null,e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))(ya);class Sa extends a.Component{constructor(...e){super(...e),this.state={render:!0,productsData:null,subscriptions:[],address:[],transactionAmount:null,formErrorMessage:null,subId:null,bottomInfoText:null,isMsales:null,pageData:null},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-summary-balance.json");if(t.status===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,{field_json:s}=e,a=s.filter(e=>"BUY"===e.journey)[0],r=s,i=e.body;this.setState({pageMetaData:a,bottomInfoText:i,pageData:r})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.handleMSalesModal=()=>{const{openModal:e,history:t}=this.props,{pageMetaData:s}=this.state;e(L.lx.HA_MSALES_PIN_MODAL,{modalId:"ha-wyze-paymentsummary-pin",source:"ha",title:s.evd_title,history:t,closePopup:!0})},this.payNowHandler=async()=>{const{productsData:e,subscriptions:t,transactionAmount:s,subId:a,isMsales:r}=this.state;if(!e.camera||!Array.isArray(t)||0===t.length)return;if(r)return void this.handleMSalesModal();const i=(0,he.u6)("ha");this.gaCheckoutEvent(i);const{orderUuid:n}=i,{history:o,setStepAndUuidForPayment:l,updateS3Data:d}=this.props;try{const{data:e}=await f.n.postData(`payment/authPayment/${n}`,{});if(!0===e.status){const{uuid:t}=e.data;d("isCOD",!1),l(t),localStorage.setItem("SOURCE",c.A.sourcetype.HA_HUALAI),i.journey="Hualai",(0,he.e)("ha",i),o.push("/secure/home")}else this.setState({render:!0,formErrorMessage:e.message||c.A.serverError})}catch(e){this.setState({render:!0,formErrorMessage:c.A.serverError})}},this.gaCheckoutEvent=e=>{(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Buy Journey",event:"checkout",ecommerce:{checkout:{actionField:{step:3,option:"Order Summary"},products:[{name:"Tata Play Secure",id:e.gaInfo.id,price:e.gaInfo.price,brand:"Tata Play",category:"Home Automation",variant:"Hualai",quantity:e.cartCount,productName:`${e.gaInfo.ProductName},${e.gaInfo.packName}`}]}}})}
1,this.getSummaryData=async()=>{const{orderUuid:e}=(0,he.u6)("ha"),{history:t,setApiError:s}=this.props;if(e)try{const{data:a}=await f.n.getData(`package/getSummaryByUuid/${e}`);if(a.message===c.A.MESSAGES_TYPES.SUCCESS){if(a.data.page&&"bundle"===a.data.page.toLowerCase())return void t.push(`/${c.A.home_automation}/${j.oh}/bundle`);const e=a.data.products.filter(e=>e.type&&"camera"===e.type.toLowerCase());this.setState({productsData:{camera:e},subscriptions:[...a.data.subscriptions],address:[...a.data.addresses],transactionAmount:a.data.transactionAmount,subId:a.data.subId})}else{if(a.message===j.qO){const e=(0,he.u6)("ha");return e.mismatch=!0,(0,he.e)("ha",e),void t.push(`/${c.A.home_automation}/${j.oh}/bundle`)}s(c.A.serverError,!0)}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}else s(c.A.serverError,!0)}}componentDidMount(){const e=(0,he.u6)("ha"),{history:t}=this.props,s=(0,x.Bd)();s&&this.setState({isMsales:s}),e?e.orderType&&"ADD_CAM"===e.orderType?t.push(`/${c.A.home_automation}/${j.oh}
1/add-camera-payment-summary`):(this.getPageMetaData(),this.getSummaryData()):t.push(`/${c.A.home_automation}/${j.oh}`)}render(){const{render:e,address:t,productsData:s,subscriptions:r,transactionAmount:i,formErrorMessage:n,pageMetaData:o,bottomInfoText:l,isMsales:c,pageData:d}=this.state;if(!(o&&s&&t.length>0&&r.length>0&&i))return(0,v.jsx)(u.A,{});let m={},p=0;s.camera&&Array.isArray(s.camera)&&s.camera.length>0&&(m={name:s.camera[0].name||"",desc:"null"!==s.camera[0].description?s.camera[0].description:null,actualPrice:0!==s.camera[0].actualPrice?s.camera[0].actualPrice:null,sellPrice:0!==s.camera[0].sellingPrice?s.camera[0].sellingPrice:"FREE",count:s.camera[0].count},p+=s.camera[0].actualPrice);const g=[];r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{g.push({name:e.friendlyName||"",desc:"null"!==e.description?e.description:null,actualPrice:e.actualPrice,sellPrice:0!==e.sellingPrice?e.sellingPrice:"FREE",packUom:e.packUom}),p+=e.actualPrice});const f=i,{history:x}=this.props;return(0,v.jsxs)(a.Fragment,{children:[!e&&(0,v.jsx)(u.A,{}),(0,v.jsx)("div",{className:"payment-summary-page inner-page",children:(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1})}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert inner-page wyze-wrap",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_WYZE_SUBSCRIPTION,activeStepper:"3"}),(0,v.jsx)(G,{history:x,destination:`${j.oh}/order-address`}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:o&&o.title}),(0,v.jsx)("h2",{className:"ha-heading2",children:o&&o.subTitle})]}),(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-sm-xs summary summary-page posR",children:[(0,v.jsxs)(ot.A,{children:[(0,v.jsxs)(lt.A,{children:[(0,v.jsx)(mt,{priceData:m,qty:m.count,source:"wyze"}),g.length>0&&g.map((e,t)=>(0,v.jsx)(mt,{priceData:e,source:"wyze-sub"},t))]}),(0,v.jsxs)(ct.A,{className:"card-footer",children:[(0,v.jsx)("h2",{className:"ha-heading2 bold total-heading",children:"Total Amount"}),(0,v.jsx)("span",{className:"mB0 text-right",children:(0,v.jsxs)("span",{className:"price-lg mR0",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"count",children:f||"00"})]})})]})]}),t.length>0&&(0,v.jsxs)("div",{className:"form-group field dateContr mT20",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Address"}),(0,v.jsx)("div",{className:"add-text",children:(0,he.FR)(t[0])}),(0,v.jsx)("span",{className:"validate",children:"Â "})," "]}),d&&d[2].note&&(0,v.jsxs)("p",{className:"mT20 fs14",children:[(0,v.jsxs)("span",{className:"bold",children:[d[2].note,": "]}),d[2].note_text]}),(0,v.jsx)("div",{className:"heading3 invalid-text text-center",children:n}),(0,v.jsxs)("div",{className:"fixed-btn cart-wrapper mT20 show text-center",children:[(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",href:"javascript:void(0)",onClick:()=>this.payNowHandler(),children:o&&o.btnTxt}),!c&&l&&(0,v.jsx)(b.A,{htmlContent:l}),c&&o&&(0,v.jsx)("p",{className:"fs12 mT10",children:o.bottomTxt})]})]})})]})]})})]})}}const ja={setStepAndUuidForPayment:dt.Cn,updateS3Data:dt.WX,setApiError:g.x8,openModal:U.qf},Aa=(0,l.Ng)(null,ja)(Sa);function Na(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Ca(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Na(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Na(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class wa extends a.Component{constructor(...e){super(...e),this.state={render:!0,activeSlot:null,startDate:null,startTime:ne()((new Date).getTime()),slotTime:{wrapperClasses:["form-group","custom-Select-Arrow","slot-field"],labelConfig:{label:"Installation Time",classes:["sel","active"]},elementType:"customSelect",elementConfig:{options:[],placeholder:"Select time",maxLength:null,tabIndex:0,readonly:"readonly"},value:null,errorMessage:null,valid:!0,touched:!1},slotList:null,teamId:null,taskId:null,address:null,allowedDays:2,disableSubmit:!1,pageData:null,callTime:1,timerId:"",paymentStatus:null},this.checkIfAlreadyScheduled=async()=>{const{startDate:e}=this.state,{setApiError:t}=this.props,s=(0,he.u6)("ha");if(s)if(s.orderUuid){const a={orderUuid:s.orderUuid,slotStartDate:ne()(e).format("DD-MM-YYYY")};try{const{data:e}=await f.n.postData("order/workorder/checkAlreadyScheduled",a);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const{data:t}=e,{alreadyScheduled:s,paymentDone:a}=t;s&&this.redirectToDestination("booking-success"),a||this.redirectToDestination("payment-summary")}
1else t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}}else t(c.A.serverError,!0);else t(c.A.serverError,!0)},this.redirectToDestination=e=>{const{history:t}=this.props;t.push(`/${c.A.home_automation}/${j.oh}/${e}`)},this.createAddress=()=>{const{infoForm:e}=(0,he.u6)("ha");if(!e)return this.setState({address:""}),"";const t=e.building&&(""!==e.building?`${e.building}, `:""),s=e.address&&(""!==e.address?`${e.address}, `:""),a=e.addressline2&&(""!==e.addressline2?`${e.addressline2}, `:""),r=e.city&&(""!==e.city?`${e.city}, `:""),i=e.state&&(""!==e.state?`${e.state}-`:""),n=e.areaPincode&&(""!==e.areaPincode?`${e.areaPincode}`:""),o=`${t}${s}${a}${e.landmark&&(""!==e.landmark?`${e.landmark}, `:"")}${e.location&&(""!==e.location?`${e.location}, `:"")}${r}${i}${n}`;return this.setState({address:o}),!0},this.handleDateChange=e=>{const{slotTime:t}=this.state,s=t;s.value=null,this.setState({startDate:e,render:!1,disableSubmit:!1,slotTime:s},()=>this.getSlots())},this.getSlots=async e=>{const{setApiError:t}=this.props,{startDate:s,slotTime:a}=this.state,{orderUuid:r}=(0,he.u6)("ha"),i=e?new Date:s,n={orderUuid:r,slotStartDate:ne()(i).format("DD-MM-YYYY"),provider:"Hualai"};try{const{data:t}=await f.n.postData("order/get-slots/",n);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const s=[],{slotSuggestions:r,ocsFlag:i}=t.data;let n=0;if("N"===i||""===i?n=2:"Y"===i&&(n=29),e)this.setState({allowedDays:n,render:!0});else{r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{const t=ne()(e.start).format("LT"),a=ne()(e.end).format("LT");s.push({label:`${t} - ${a}`,value:`${ne()(e.start).format("HH:mm:ss")}-${ne()(e.end).format("HH:mm:ss")}`})});const e=Ca({},a);e.elementConfig.options=s,e.errorMessage="",e.valid=!0,this.setState({slotList:s,slotTime:e,teamId:t.data.teamId,taskId:t.data.taskId,allowedDays:n,render:!0})}}else{let s=2;if(t.data){const{ocsFlag:e}=t.data;"N"===e||""===e?s=2:"Y"===e&&(s=29)}if(e)this.setState({allowedDays:s,render:!0});else{const e=Ca({},a);e.elementConfig.options=[],e.value=null,e.errorMessage="No slots available! Please select another date.",e.valid=!1,this.setState({slotList:null,slotTime:e,teamId:null,taskId:null,allowedDays:s,render:!0})}}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.handleTimeChange=e=>{const{slotTime:t}=Ca({},this.state);t.value=e,t.touched=!0,t.valid=!0,t.errorMessage=null,this.setState({slotTime:t,formError:""})},this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-buy-paymentsuccess.json");if(t.status===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,btnTxt:e.field_json.button_text,subTitle:e.field_subtitle,note:e.field_json.note,note_text:e.field_json.note_text};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.handleSubmit=async()=>{this.setState({render:!1,disableSubmit:!0});const{slotTime:e,teamId:t,taskId:s,startDate:a}=this.state,{history:r,setApiError:i}=this.props;if(null===e.value){const t=Ca({},e);t.valid=!1,t.errorMessage="Please select a slot.",this.setState({slotTime:t,formError:"",render:!0,disableSubmit:!1})}const{orderUuid:n}=(0,he.u6)("ha"),o=ne()(a).format("DD-MM-YYYY"),l={teamId:t,taskId:s,orderUuid:n,slot:{start:`${o} ${e.value.split("-")[0]}`,end:`${o} ${e.value.split("-")[1]}`}};try{const{data:e}=await f.n.postData("order/confirm-slots/",l);!0===e.status&&e.message===c.A.MESSAGES_TYPES.SUCCESS?r.push(`/${c.A.home_automation}/${j.oh}/booking-success`):!0===e.status&&"FAILURE"===e.message?r.push(`/${c.A.home_automation}/${j.oh}/booking-failure`):i(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||i(c.A.serverError,!0)}},this.gaSuccessTransaction=e=>{try{const t=(0,he.u6)("ha");(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"ADD_CAM"===t.orderType?"HA-Secure Plus -Add Camera":"HA-Secure Plus -Buy Journey",transactionID:e.haId,PaymentType:e.PayementType,event:"purchaseSuccess",ecommerce:{purchase:{actionField:{id:e.haId,affiliation:" ",revenue:"ADD_CAM"===t.orderType?t.addCameraSession.gaInfo.price:t.gaInfo.price,tax:"",shipping:"",coupon:""},products:[{name:e.name,id:"ADD_CAM"===t.orderType?t.addCameraSession.gaInfo.id:t.gaInfo.id,price:"ADD_CAM"===t.orderType?t.addCameraSession.gaInfo.price:t.gaInfo.price,brand:"Tata Play",category:"Home Automation",variant:"Hualai",quantity:"ADD_CAM"===t.orderType?t.addCameraSession.camCount:t.cartCount,productName:e.name,coupon:""}]}}})}catch(e){}},this.handleDateChangeRaw=e=>{e.preventDefault()},this.clearTimer=()=>{const{timerId:e}=this.state;""!==e&&clearInterval(e)},this.getPaymentStatusResponse=async()=>{const{setPaymentAwaitedData:e,history:t,setApiError:s}=this.props,{callTime:a}=this.state,r=(0,he.u6)("ha");try{let i;this.setState({callTime:a+1});let n={INPROGRESS:`${j.oh}/payment-awaited`,FAIL:`${j.oh}/payment-failure`,INITIATE:`${j.oh}/bundle`};if(r.orderType&&"ADD_CAM"===r.orderType){const{addCameraSession:{orderUuid:e}}=r;n={INPROGRESS:`${j.oh}/payment-awaited`,FAIL:`${j.oh}/payment-failure`,INITIATE:`${j.oh}/add-camera`,SUCCESS:`${j.oh}/add-camera-schedule-installation`},i=e}else i=r.orderUuid;const{data:o}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${i}`);if(o.message===c.A.MESSAGES_TYPES.SUCCESS&&o.status){const e=o.data;if(!e&&!Object.isArray(e)&&e.length<=0)return void s(c.A.serverError,!0);const a=[];
1e.forEach(e=>{a.push({name:e.name,id:e.paymentTransactionId,price:e.discountPrice,brand:"Tataplay",category:"Ecommerce",quantity:e.count,PayementType:e.paymentMethod,haId:e.haId})}),this.gaSuccessTransaction(a[0]);const i=e[0].paymentStatus;i||s(c.A.serverError,!0),"INPROGRESS"===i?t.push(`/${c.A.home_automation}/${n.INPROGRESS}`):"FAIL"===i?(this.clearTimer(),t.push(`/${c.A.home_automation}/${n.FAIL}`)):"INITIATE"===i?(this.clearTimer(),t.push(`/${c.A.home_automation}/${n.INITIATE}`)):(this.clearTimer(),(0,he.VJ)(j.QZ.SUCCESS),r.orderType&&"ADD_CAM"===r.orderType?t.push(`/${c.A.home_automation}/${n.SUCCESS}`):(this.getPageData(),this.checkIfAlreadyScheduled(),this.getSlots(!0),this.createAddress(),(0,gt.A)(),this.setState({paymentStatus:e[0],render:!0})))}else s(c.A.serverError,!0);3===a&&(this.clearTimer(),e(o.data[0]))}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}},this.getPaymentStatus=async()=>{const e=setInterval(this.getPaymentStatusResponse(),2e3);this.setState({timerId:e})}}async componentDidMount(){await this.getPaymentStatus()}componentWillUnmount(){this.clearTimer()}render(){const{startDate:e,slotTime:t,address:s,allowedDays:r,disableSubmit:i,render:n,pageData:o,paymentStatus:l}=this.state;if(!n)return(0,v.jsx)(u.A,{});const c={option:e=>Ca(Ca({},e),{},{fontSize:"14px"})};return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container schedul-install bottompadd gs-alert wyze-wrap wyze-secure",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_WYZE_SUBSCRIPTION,activeStepper:"4"}),(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsxs)("div",{className:"animation mB30",children:[(0,v.jsx)("canvas",{id:"canvas",width:"1390",height:"969"}),(0,v.jsx)("div",{id:"confettiAnimate",className:"ready",children:(0,v.jsx)("div",{className:"message",children:(0,v.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 11",children:(0,v.jsx)("polyline",{stroke:"currentColor",points:"1.4,5.8 5.1,9.5 11.6,2.1 "})})})}),(0,v.jsx)("div",{className:"svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",className:"",style:{position:"relative",top:"10px",left:"-10px",marginBottom:"20px"},"data-wow-delay":"0.8s",children:[(0,v.jsx)("circle",{className:"path circle",fill:"#ffffff",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})})]}),(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:o&&o.title}),(0,v.jsx)("h2",{className:"ha-heading2 mT30",children:o&&o.subTitle}),l&&l.haId&&(0,v.jsx)("div",{className:"id-text bold",children:`Your Order ID is: ${l.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-xs pB0",children:[(0,v.jsxs)("div",{className:"fullwidth mT30 text-left",children:[(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Date"}),(0,v.jsx)(yt(),{dateFormat:"DD MMMM YYYY",selected:e,placeholderText:"Select date",onChange:e=>this.handleDateChange(e),minDate:ne()(),maxDate:ne()().add(r,"days"),onChangeRaw:e=>this.handleDateChangeRaw(e)}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsx)("div",{className:"form-group field-time",children:(0,v.jsx)($.A,{labelConfig:t.labelConfig,elementType:t.elementType,elementConfig:t.elementConfig,value:t.value,valid:t.valid,errorMessage:t.errorMessage,touched:t.touched,wrapperClasses:t.wrapperClasses,changed:e=>this.handleTimeChange(e),customProps:{menuPortalTarget:document.body,menuPosition:"fixed",styles:c}},"slot")}),(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Address"}),(0,v.jsx)("div",{className:"add-text",children:s}),(0,v.jsx)("span",{className:"validate",children:"Â "})]})]}),o&&o.note&&(0,v.jsxs)("p",{className:"mT20 fs14 bottom-text",children:[(0,v.jsxs)("span",{className:"bold",children:[o.note,": "]}),o.note_text]}),(0,v.jsxs)("div",{className:"fixed-btn cart-wrapper mT20 show",children:[" ",!i&&(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",href:"javascript:void(0)",onClick:()=>this.handleSubmit(),disabled:i,children:o&&o.btnTxt}),i&&(0,v.jsx)("button",{type:"button",className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",disabled:i,children:o&&o.btnTxt})," "]})]})]})]})})]})}}const _a=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),setPaymentAwaitedData:(0,F.zH)(dt.Qm,e)}))(wa),Ea=e=>{const{error:t}=e.location&&e.location.data||{};return(0,a.useEffect)(()=>{const t=(0,he.u6)("ha");let s="bundle";t.orderType&&"ADD_CAM"===t.orderType?((0,he.VJ)(j.QZ.FAILURE,"ADD_CAM"),s="add-camera"):(0,he.VJ)(j.QZ.FAILURE);const{history:a}=e;setTimeout(()=>{a.push(`/${c.A.home_automation}/${j.oh}/${s}`)},5e3)},[]),(0,v.jsx)(Ts,{error:t})};class Ta extends a.Component{constructor(...e){super(...e),this.state={render:!1,paymentStatus:null,paymentTxnId:null,
1showGoHome:!1,timerId:"",callTime:1,timerDetails:{}},this.getPaymentStatus=async(e=!1)=>{this.setState({render:!1});const t=setInterval(()=>{this.getPaymentStatusResponse(e)},2e3);this.setState({timerId:t})},this.getPaymentStatusResponse=async e=>{const t=(0,he.u6)("ha"),{history:s,setApiError:a}=this.props;try{const{callTime:r}=this.state;if(r>3)return void this.clearTimer();let i,n={FAIL:`${j.oh}/payment-failure`,INITIATE:`${j.oh}/bundle`,SUCCESS:`${j.oh}/payment-success`};if(t.orderType&&"ADD_CAM"===t.orderType){const{addCameraSession:{orderUuid:e}}=t;i=e,n={FAIL:`${j.oh}/payment-failure`,INITIATE:`${j.oh}/add-camera`,SUCCESS:`${j.oh}/add-camera-schedule-installation`}}else i=t.orderUuid;const{data:o}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${i}`);if(o.message===c.A.MESSAGES_TYPES.SUCCESS){const r=o.data,i=r[0].paymentStatus;i||a(c.A.serverError,!0),"INPROGRESS"===i?(this.setState({paymentStatus:r[0],showGoHome:e}),t.orderType&&"ADD_CAM"===t.orderType?(0,he.VJ)(j.QZ.AWAITED,"ADD_CAM"):(0,he.VJ)(j.QZ.AWAITED)):"FAIL"===i?s.push(`/${c.A.home_automation}/${n.FAIL}`):"INITIATE"===i?s.push(`/${c.A.home_automation}/${n.INITIATE}`):s.push(`/${c.A.home_automation}/${n.SUCCESS}`)}else a(c.A.serverError,!0);this.setState({callTime:r+1})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||a(c.A.serverError,!0)}},this.clearTimer=()=>{const{timerId:e}=this.state;this.setState({render:!0,callTime:1}),""!==e&&clearInterval(e)},this.redirectToHome=()=>{const{history:e}=this.props,t=(0,he.u6)("ha");
1let s=`/${c.A.home_automation}/${j.oh}/bundle`;t.orderType&&"ADD_CAM"===t.orderType&&(s=`/${c.A.home_automation}/${j.oh}/add-camera`),t.orderType=null,(0,he.e)("ha",t),e.push(s)}}async componentDidMount(){const{setApiError:e}=this.props,t=!c.A.isServer()&&JSON.parse(localStorage.getItem(c.A.storagePaymentKey))||"",{paymentTxnId:s}=t;s?this.setState({paymentTxnId:s}):e(c.A.serverError,!0),await this.getPaymentStatus()}componentWillUnmount(){this.clearTimer();const e=(0,he.u6)("ha");e.orderType=null,(0,he.e)("ha",e)}render(){const{paymentData:e}=this.props,{render:t,paymentTxnId:s,showGoHome:r}=this.state;return(0,v.jsxs)(a.Fragment,{children:[!t&&(0,v.jsx)(u.A,{}),(0,v.jsx)(ss,{paymentTxnId:s,paymentData:e,showGoHome:r,redirectToHome:this.redirectToHome,getPaymentStatus:this.getPaymentStatus})]})}}const Da=(0,l.Ng)(e=>({paymentData:e.getConnectionReducer.paymentDetails}),e=>({setApiError:(0,F.zH)(g.x8,e),setPaymentAwaitedData:(0,F.zH)(dt.Qm,e)}))(Ta),Oa={setApiError:g.x8},ka=(0,l.Ng)(null,Oa)(e=>{const[t,s]=(0,a.useState)({address:null,date:null,time:null,haId:null}),[r,i]=(0,a.useState)(null),[n,o]=(0,a.useState)(null),{setApiError:l,history:d}=e;(0,he.u6)("ha")||l(c.A.serverError,!0);const{orderUuid:m}=(0,he.u6)("ha");return(0,a.useEffect)(()=>{const e=(0,x.Bd)(),t=(0,x.jv)();(e||t)&&o(!0),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/bundle-installation-booked.json");if(e.status===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data;i({title:t.title,subtitle:t.field_subtitle,btnText:t.field_json.button_text,installationText:t.field_json.installation_text,installationImg:t.field_image})}else l(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||l(c.A.serverError,!0)}})(),(async()=>{try{const{data:e}=await f.n.getData(`payment/workorder/getDetailsByUuid/${m}`);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,{workOrderDTOS:a}=t;(!a||0===Object.keys(a).length&&a.constructor===Object)&&dispatch(l(c.A.serverError,!0));const r=(0,he.FR)(t.addresses),i=ne()(a.woSlotEndTime).format("MMMM DD, YYYY"),n=`${ne()(a.woSlotStartTime).format("LT")} - ${ne()(a.woSlotEndTime).format("LT")}`;s({address:r,date:i,time:n,haId:t.haId,name:t.name,count:t.count}),(0,x.Sw)({event:"Installation Scheduled","Subscriber ID":t.subId,"Order ID":t.haId})}else l(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||l(c.A.serverError,!0)}})()},[]),r&&t.haId&&t.address&&t.date&&t.time?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap wyze-secure",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_WYZE_SUBSCRIPTION,activeStepper:"4"}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[r&&(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:r.title}),(0,v.jsx)("div",{className:"id-text bold",children:`Order ID: ${t.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[r&&(0,v.jsx)("div",{className:"saf-installationwrapp",children:(0,v.jsxs)("div",{className:"certified-wrapp",children:[(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"icon",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+r.installationImg.url,alt:r.installationImg.alt,className:"img-fluid"})})}),(0,v.jsx)("div",{children:r.installationText})]})}),(0,v.jsxs)("div",{className:"insta-blk-wrapp",children:[r&&(0,v.jsx)("div",{className:"insta-blk-text bold",children:r.subtitle}),(0,v.jsxs)("div",{className:"insta-blk",children:[(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/date-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:t.date})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("span",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/time-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:t.time})]}),(0,v.jsx)("div",{className:"insta-icon-wrapp mR0",style:{width:"100%"}
1,children:(0,v.jsx)("div",{className:"inst-add-contr fs14",children:`Address: ${t.address}`})}),(0,v.jsx)("div",{className:"insta-icon-wrapp mR0",children:(0,v.jsx)("div",{className:"fs14",children:`Qty: ${t.count} ${t.name}`})})]})]}),!n&&(0,v.jsx)("div",{className:"footer-contr text-center mT20 block",children:(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light",href:"javascript:void(0)",onClick:()=>{return e=`/${c.A.home_automation}/${j.oh}`,(0,he.e)("ha",{salesLeadParams:{campaignId:"",plan:""}}),(0,x.Sw)({event:"Back to Home"}),void d.push(e);var e},children:r&&r.btnText})})]})]})]})})]}):(0,v.jsx)(u.A,{})}),Pa=e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha"),{history:o}=e;return(0,a.useEffect)(()=>{n||o.push(`/${c.A.home_automation}`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/installation-failure.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,a={title:t.title,subtitle:t.field_subtitle,btn_text:t.field_json.button_text,btn_url:`/${c.A.home_automation}`};s(a),i(!0)}}catch(e){console.log("page data error",e)}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})};function Ia(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Ma(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ia(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ia(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class $a extends a.Component{constructor(...e){super(...e),this.state={isServicable:!0,pageData:null,render:!0,activeSlot:null,subIdList:[],selectedSubId:null,selectedSubName:null,startDate:null,startTime:ne()((new Date).getTime()),slotTime:{wrapperClasses:["form-group","custom-Select-Arrow","slot-field"],labelConfig:{label:"Installation Time",classes:["sel","active"]},elementType:"customSelect",elementConfig:{options:[],placeholder:"Select time",maxLength:null,tabIndex:0,readonly:"readonly"},value:null,errorMessage:null,valid:!0,touched:!1},slotList:null,teamId:null,taskId:null,address:null,allowedDays:2,errorMessage:null,disableSubmit:!1,backIndex:null},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-schedule-demo-screen.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=Ma({},t.data);this.setState({pageData:e},()=>{this.prepareSubIdList()})}else e(c.A.serverError,!0),this.setState({render:!0})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.prepareSubIdList=()=>{const{openModal:e,history:t}=this.props,{pageData:s}=this.state,a=(0,he.HW)().id,r=JSON.parse(localStorage.getItem("userAuth")),{subscriberIds:i,accountStatus:n,encSubscriberId:o}=r;let l,d,m="",u="",h=null,p="",g=!1;const f=[],x={};i.forEach((e,t)=>{if(x[e]=o[t],"Active"===n[t]&&f.push({label:e,value:e}),"Temp Suspension"===n[t]){const e=s.field_json.popup_config.filter(e=>"TEMP_SUSPEND"===e.status);m=e[0].heading,u=e[0].subHeading1,h=e[0].subHeading2,p=e[0].button_text,l=e[0].button_link,d=e[0].field_url_source}if("Deactivated"===n[t]){const e=s.field_json.popup_config.filter(e=>"DEACTIVATED"===e.status);m=e[0].heading,u=e[0].subHeading,p=e[0].button_text,g=!0}});const b=f.length>0?f[0].value:null;if(null===b)return e(L.lx.COMMON_MODAL,{Component:Ne,data:{title:m,body:u,subHeading2:h,showRecharge:g,encSubId:x[a],btnTxt:p,redirectUrl:l,fieldSource:d},onCloseEvent:()=>{t.push(`/${c.A.home_automation}/${j.oh}`)},history:t}),void this.setState({backIndex:-2});b&&this.checkIfAlreadyScheduled(b),this.setState({subIdList:[...f]},()=>{this.setState({selectedSubId:b},()=>
1{this.getSubsciberDetails(b),this.getSlots(b,!0)})})},this.checkIfAlreadyScheduled=async e=>{const{setApiError:t}=this.props,{pageData:s}=this.state,a={subId:e,provider:"Hualai"};let r=!1;try{const{data:e}=await f.n.postData("order/workorder/checkAlreadyScheduledDemo",a);e.message===c.A.MESSAGES_TYPES.SUCCESS?e.data.alreadyScheduled&&(this.showModal("DEMO_PLACED"),this.setState({backIndex:-2}),r=!0):t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}return r&&this.setState({render:!0}),r},this.showModal=e=>{const{openModal:t,history:s}=this.props,{pageData:a}=this.state,r=a.field_json.popup_config.filter(t=>t.type===e)[0],i={title:r.title,body:r.subTitle,btnTxt:r.button_text,showRecharge:!1};let n=null;if("DEMO_PLACED"===e&&(n=`/${c.A.home_automation}/${j.oh}`,i.gaInfo={event:"Okay Got It"}),"PINCODE_NOT_SERVICABLE"===e&&(n=`/${c.A.home_automation}/${j.oh}${r.url}`),"PINCODE_NOT_SERVICABLE"===e||"DEMO_PLACED"===e)return i.redirectUrl=n,void t(L.lx.HA_COMMON_MODAL,{Component:Ne,data:i,onCloseEvent:()=>{s.push(n)},history:s,closePopup:!0});t(L.lx.HA_COMMON_MODAL,{Component:Ne,data:i})},this.getSubsciberDetails=async e=>{const{setApiError:t}=this.props,s={subscriberId:"object"==typeof e?e.id:e,source:"WEB"};try{const{data:e}=await f.n.postData("order/address/getAddress",s);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data;this.createAddress(e.data),t.serviceEnable||(this.setState({isServicable:!1,disableSubmit:!0}),this.showModal("PINCODE_NOT_SERVICABLE"))}else t(c.A.serverError,!0)}catch(e){console.log(e),e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.createAddress=e=>{const t=e.subscriberName||"",s=e.building&&""!==e.building?`${e.building}, `:"",a=e.address&&""!==e.address?`${e.address}, `:"",r=e.addressline2&&""!==e.addressline2?`${e.addressline2}, `:"",i=e.city&&""!==e.city?`${e.city}, `:"",n=e.state&&""!==e.state?`${e.state}-`:"",o=e.areaPincode&&""!==e.areaPincode?`${e.areaPincode}`:"",l=`${s}${a}${r}${e.landmark&&""!==e.landmark?`${e.landmark}, `:""}${e.location&&""!==e.location?`${e.location}, `:""}${i}${n}${o}`;this.setState({address:l,selectedSubName:t,render:!0})},this.handleDateChange=e=>{const{selectedSubId:t,slotTime:s}=this.state,a=s;a.value=null,this.setState({startDate:e,render:!1,slotTime:a,disableSubmit:!1},()=>this.getSlots(t))}
1,this.getSlots=async(e,t)=>{const{startDate:s,slotTime:a}=this.state,{setApiError:r}=this.props,i=t?new Date:s,n={subId:e,slotStartDate:ne()(i).format("DD-MM-YYYY"),provider:"Hualai"};try{const{data:e}=await f.n.postData("order/get-slots/",n);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const s=[],{slotSuggestions:r,ocsFlag:i}=e.data;let n=0;if("N"===i||""===i?n=2:"Y"===i&&(n=29),t)this.setState({allowedDays:n,render:!0});else{r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{const t=ne()(e.start).format("LT"),a=ne()(e.end).format("LT");s.push({label:`${t} - ${a}`,value:`${ne()(e.start).format("HH:mm:ss")}-${ne()(e.end).format("HH:mm:ss")}`})});const t=Ma({},a);t.elementConfig.options=s,t.errorMessage="",t.valid=!0,this.setState({slotList:s,slotTime:t,teamId:e.data.teamId,taskId:e.data.taskId,allowedDays:n,render:!0})}}else{let s=2;if(e.data){const{ocsFlag:t}=e.data;"N"===t||""===t?s=2:"Y"===t&&(s=29)}if(t)this.setState({allowedDays:s,render:!0});else{const e=Ma({},a);e.elementConfig.options=[],e.value=null,e.errorMessage="No slots available! Please select another date.",e.valid=!1,this.setState({slotList:null,slotTime:e,teamId:null,taskId:null,allowedDays:s,render:!0})}}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}},this.handleTimeChange=e=>{const{slotTime:t}=Ma({},this.state);t.value=e,t.touched=!0,t.valid=!0,t.errorMessage=null,this.setState({slotTime:t,formError:""})},this.handleSubmit=async()=>{this.setState({render:!1,disableSubmit:!0});const{slotTime:e,startDate:t,selectedSubId:s}=this.state,{history:a,setApiError:r}=this.props;if(null===e.value){const t=Ma({},e);return t.valid=!1,t.errorMessage="Please select a slot.",void this.setState({slotTime:t,formError:"",render:!0,disableSubmit:!1})}if(await this.checkIfAlreadyScheduled(s))return;const i=ne()(t).format("DD-MM-YYYY"),n=e.value.split("-")[0],o={subId:s,woSlotEndTime:`${i} ${e.value.split("-")[1]}`,woSlotStartTime:`${i} ${n}`,provider:"Hualai"};try{(0,x.Sw)({event:"Confirm Demo","Subscriber ID":s});const{data:e}=await f.n.postData("order/createDemoOrder/",o);if(!0===e.status)if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const{orderUuid:t}=e.data;let s=(0,he.u6)("ha");s||(s={}),s.demoUuid=t,(0,he.e)("ha",s),a.push(`/${c.A.home_automation}/${j.oh}/demo-booking-success`)}else a.push(`/${c.A.home_automation}/${j.oh}/demo-booking-failure`);else a.push(`/${c.A.home_automation}/${j.oh}/demo-booking-failure`)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}},this.handleDateChangeRaw=e=>{e.preventDefault()},this.handleSubscriberIDSelect=e=>{this.setState({render:!1}),this.setState({selectedSubId:e.target.value},()=>{const{selectedSubId:e}=this.state;this.checkIfAlreadyScheduled(e),this.getSubsciberDetails(e)})}}componentDidMount(){this.getPageMetaData()}render(){const{startDate:e,slotTime:t,address:s,allowedDays:r,subIdList:i,selectedSubId:n,selectedSubName:o,render:l,disableSubmit:c,activeSlot:d,pageData:m,backIndex:p,isServicable:g}=this.state;if(!l)return(0,v.jsx)(u.A,{});const f={option:e=>Ma(Ma({},e),{},{fontSize:"14px"})},{history:x}=this.props;return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container schedul-install bottompadd gs-alert wyze-wrap wyze-demo",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:x,type:"history_back",backIndex:p}),(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:m&&m.title}),(0,v.jsx)("h2",{className:"ha-heading2",children:m&&m.field_subtitle})]}),(0,v.jsx)("div",{className:"body-container innercontainer-xs pB0",children:(0,v.jsxs)("div",{className:"details-wrapp",children:[(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"sel",children:"Name"}),(0,v.jsx)("div",{className:"forminfo",children:o})]}),(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)("label",{className:"sel",children:"Subscriber ID"}),(0,v.jsxs)("div",{className:"forminfo",children:[i&&i.length>1&&(0,v.jsx)("select",{className:"form-control",style:{padding:"0 6px"},value:n,onChange:e=>{this.handleSubscriberIDSelect(e)},children:i&&i.map(e=>(0,v.jsx)("option",{value:e.value,children:e.label}))}),i&&1===i.length&&i[0].label]})]})]})}),(0,v.jsxs)("div",{className:"body-container innercontainer-xs pB0",children:[(0,v.jsxs)("div",{className:"fullwidth mT30 text-left",children:[s&&(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Address"}),(0,v.jsx)("div",{className:"add-text",children:s}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Date"}),(0,v.jsx)(yt(),{dateFormat:"DD MMMM YYYY",selected:e,placeholderText:"Select date",onCh
1ange:e=>this.handleDateChange(e),minDate:ne()(),maxDate:ne()().add(r,"days"),onChangeRaw:e=>this.handleDateChangeRaw(e)}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsx)("div",{className:"form-group field-time",children:(0,v.jsx)($.A,{labelConfig:t.labelConfig,elementType:t.elementType,elementConfig:t.elementConfig,value:t.value,valid:t.valid,errorMessage:t.errorMessage,touched:t.touched,wrapperClasses:t.wrapperClasses,changed:e=>this.handleTimeChange(e),customProps:{menuPortalTarget:document.body,menuPosition:"absolute",styles:f}},"slot")})]}),(0,v.jsxs)("div",{className:"fixed-btn cart-wrapper mT20 show",children:[" ",!c&&g&&(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",href:"javascript:void(0)",onClick:()=>this.handleSubmit(),disabled:c,children:m&&m.field_json.button_text}),(c||!g)&&(0,v.jsx)("button",{className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",type:"button",disabled:c||!g,children:m&&m.field_json.button_text})," "]})]})]})]})})]})}}const Ra=(0,l.Ng)(null,e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))($a),La={setApiError:g.x8},Fa=(0,l.Ng)(null,La)(e=>{const[t,s]=(0,a.useState)({address:null,date:null,time:null,haId:null,rmn:null,subId:null}),{setApiError:r,history:i}=e,[n,o]=(0,a.useState)(null),{demoUuid:l}=(0,he.u6)("ha");return(0,a.useEffect)(()=>{(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-demo-success.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data;let s,a,r;const i=t.field_image;t.field_images.forEach(e=>{"time"===e.alt?s=e:"date"===e.alt?a=e:"address"===e.alt&&(r=e)});const n={demoScheduledTxt:t.field_json.demo_scheduled,title:t.title,safetyTxt:t.field_json.text,timeImg:s,dateImg:a,addrImg:r,btnTxt:t.field_json.button_text,techIcon:i};o(n)}else r(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}})(),(async()=>{try{const{data:e}=await f.n.getData(`payment/workorder/getDetailsByUuid/${l}`);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,{workOrderDTOS:a}=t,r=(0,he.FR)(t.addresses),i=ne()(a.woSlotEndTime).format("MMMM DD, YYYY"),n=`${ne()(a.woSlotStartTime).format("LT")} - ${ne()(a.woSlotEndTime).format("LT")}`;s({address:r,date:i,time:n,haId:t.haId,rmn:t.rmn,subId:t.subId||""})}else r(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}})()},[]),t.haId&&t.address&&t.date&&t.time?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:n&&n.title}),(0,v.jsx)("h2",{className:"ha-heading2",children:`A confirmation SMS is sent to ${t.rmn}`}),(0,v.jsx)("div",{className:"id-text bold",children:`Order ID: ${t.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("div",{className:"insta-blk-wrapp",children:[(0,v.jsx)("div",{className:"insta-blk-text bold",children:n&&n.demoScheduledTxt}),(0,v.jsxs)("div",{className:"insta-blk",children:[(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:n&&c.A.NODE_API_ROOT+n.dateImg.url,alt:n&&n.dateImg.alt,className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:t.date})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("span",{className:"insta-icon",children:(0,v.jsx)("img",{src:n&&c.A.NODE_API_ROOT+n.timeImg.url,alt:n&&n.timeImg.alt,className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:t.time})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp mB0 mR0",style:{width:"100%"},children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:n&&c.A.NODE_API_ROOT+n.addrImg.url,alt:n&&n.addrImg.alt,className:"img-fluid"})}
1),(0,v.jsx)("div",{className:"inst-add-contr fs14",children:t.address})]})]})]}),n&&(0,v.jsx)(jt,{}),(0,v.jsx)("div",{className:"footer-contr text-center block mT32",children:(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light",href:"javascript:void(0)",onClick:()=>((0,x.Sw)({event:"Go Back to Tata Play Home","Subscriber ID":t.subId}),void i.push(`/${c.A.home_automation}/${j.oh}`)),children:n&&n.btnTxt})})]})]})})})]}):(0,v.jsx)(u.A,{})}),Ua={setApiError:g.x8},Ba=(0,l.Ng)(null,Ua)(e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha"),{setApiError:o,history:l}=e;return(0,a.useEffect)(()=>{n||l.push(`/${c.A.home_automation}`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/demo-installation-failure.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,a={title:t.title,subtitle:t.field_subtitle,btn_text:t.field_json.button_text,btn_url:`/${c.A.home_automation}`};s(a),i(!0)}else o(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||o(c.A.serverError,!0)}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})}),Ha={setApiError:g.x8},Ya=(0,l.Ng)(null,Ha)(e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha"),{setApiError:o,history:l}=e;return(0,a.useEffect)(()=>{n||l.push(`/${c.A.home_automation}`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/demo-already-placed.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,a={title:t.title,subtitle:t.field_subtitle,btn_text:t.field_json.button_text,btn_url:`/${c.A.home_automation}`};s(a),i(!0)}else o(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||o(c.A.serverError,!0)}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})});function Ga(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Ja(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ga(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ga(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class qa extends a.Component{constructor(...e){super(...e),this.state={title:null,subTitle:null,rechargeText:null,camImage:null,render:!1,subscriptionList:null,inactiveSubscriptionList:null,encSubId:null},this.modalCloseHandler=()=>{const{history:e}=this.props;e.push("/my-account")},this.checkHaUser=async()=>{const{setApiError:e,openModal:t,history:s}=this.props,{subId:a}=JSON.parse(localStorage.userAuth),r={subscriberId:a.id,source:"HA",provider:"Hualai"};try{const{data:e}=await f.n.checkHaUser(r);if(e.message!==c.A.MESSAGES_TYPES.SUCCESS&&!1===e.status)return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Not a valid user! ",body:"We see your account is not valid for this service. Request you to login with a different account",showRecharge:!1,redirectUrl:"/my-account"},onCloseEvent:()=>{const{history:e}=this.props;e.push("/my-account")},history:s}),this.setState({render:!0}),!1}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}return!0},this.getJourneyStatus=async()=>{try{const{history:e,setApiError:t}=this.props,{subId:s}=JSON.parse(localStorage.userAuth),a={subId:s.id,orderType:"RE_",provider:"Hualai"},{data:r}=await f.n.postData("package/getOrderStatusBySubId",a);if(r.message===c.A.MESSAGES_TYPES.SUCCESS){const t=r.data;t.address&&t.address.addressType&&"TO_NEW"===t.address.addressType?(t.address.subscriptionId=t.subscriptionId,(0,he.PS)(t.address,"relocation")):t.address&&t.address.addressType&&"TO_EXISTING"===t.address.addressType&&(0,he.PS)({orderUuid:t.address.orderUuid,subscriptionId:t.subscriptionId},"relocation");const s=(0,he.u6)("ha"),{relocate_session:a}=s;a.statusChecked=!0,(0,he.e)("ha",s);const i=j.MC.relocationStatusList[t.page];i&&"CREATE ADDRESS"!==t.page&&e.push(`/${c.A.home_automation}/${j.oh}/${i}`)}else t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-select-camera-relocate.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=Ja({},t.data);this.setState({title:e.title,subTitle:e.field_subtitle,camImage:e.field_image,rechargeText:e.field_json.recharge_text})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubscriptionData=async()=>{const{setApiError:e}=this.props;try{const t=JSON.parse(localStorage.userAuth),{subId:s}=t,a={subscriberId:s.id,provider:"Hualai"},{data:r}=await f.n.postData("order/relocationDetails",a);if(r.status||(e(c.A.serverError,!0),this.setState({render:!0})),r.message===c.A.MESSAGES_TYPES.SUCCESS){const{active:e,inactive:a}=r.data,i={},n={};let o=null;if(e&&Array.isArray(e)&&e.length>0&&e.forEach(e=>{i[e.subscriptionId]=e}),a&&Array.isArray(a)&&a.length>0){a.forEach(e=>{n[e.subscriptionId]=e});const{subscriberIds:e,encSubscriberId:r}=t,i={};e.forEach((e,t)=>{i[e]=r[t]}),o=i[s.id]}this.setState({subscriptionList:i,inactiveSubscriptionList:n,encSubId:o},()=>{this.setState({render:!0})})}}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.redirectToSelectAddress=async e=>{this.setState({render:!1});try{const{history:t}=this.props,{subscriptionList:s}=this.state,{address:a,cameraCount:r,name:i}=s[e],n=JSON.parse(localStorage.userAuth),{subId:o}=n;this.relocationGaEvent("Relocate",e);const l={subId:o.id,count:r,name:i,subscriptionId:e,provider:"Hualai"},{data:d}=await f.n.postData("order/createRelocationOrder",l);if(d.message===c.A.MESSAGES_TYPES.SUCCESS){this.setState({render:!1});const{orderUuid:s}=d.data,r=(0,he.u6)("ha"),{relocate_session:n}=r;n.address=a,n.subscriptionId=e,n.orderUuid=s,n.name=i,r.relocate_session=n,(0,he.e)("ha",r),t.push(`/${c.A.home_automation}/${j.oh}/select-relocation-address`)}else this.setState({render:!0})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}},this.relocationGaEvent=(e,t)=>{const{subscriptionList:s}=this.state;try{(0,x.Sw)({event:"ctaClick",clickText:e,"Type of Journey":"HA - Secure - Relocation","Sub ID":(0,x.Xo)().id||null,productName:s&&s[t]&&s[t].name,subscriptionID:t,productPrice:s&&s[t]&&s[t].packPrice})}catch(e){}}}async componentDidMount(){(0,x.NP)("Shift Your CCTV Camera to a New Location | Tata Play Secure","Tata Play Secure offers security camera relocation service to protect you in a new place. Take your Tata Play Secure camera with you wherever you are shifting");let e=(0,he.u6)("ha");if(!c.A.isServer())if(e){const{relocate_session:t}=e;t||(e=Ja(Ja({},e),{},{relocate_session:{statusChecked:!1}
1}),(0,he.e)("ha",e))}else e={relocate_session:{statusChecked:!1}},(0,he.e)("ha",e);this.getPageMetaData();let t=!0;if(t=await this.checkHaUser(),t){const{relocate_session:t}=e;t.statusChecked||this.getJourneyStatus(),this.getSubscriptionData()}}componentWillUnmount(){(0,x.Cq)('"Shift Your CCTV Camera to a New Location | Tata Play Secure"')}render(){const{history:e}=this.props,{title:t,subTitle:s,camImage:a,render:r,subscriptionList:i,inactiveSubscriptionList:n,encSubId:o,rechargeText:l}=this.state;return r?(0,v.jsxs)("div",{className:"ipl_event wyze-wrap",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert",children:(0,v.jsx)("div",{className:"container",style:{padding:"0 20px"},children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)(G,{history:e,destination:"system/tata-play-secure/gethelp",excludeHa:!1,isAnchor:!0}),(0,v.jsxs)("div",{className:"heading-md ",style:{marginBottom:"24px"},children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient heading-mob",children:t}),(0,v.jsx)("h2",{className:"ha-heading2 sub-heading-mob",children:s})]}),(0,v.jsx)("div",{className:"innercontainer-sm",children:(0,v.jsxs)("div",{className:"select-relocation-wrapp mT30",children:[i&&Object.keys(i).map(e=>(0,v.jsx)(is,{camImage:a,redirectHandler:this.redirectToSelectAddress,address:(0,he.FR)(i[e].address),activeCount:i[e].activeStatusCount,cameraCount:i[e].cameraCount,name:i[e].name,subscriptionId:e,status:"Active",flow:"Hualai"},e)),n&&Object.keys(n).map(e=>(0,v.jsx)(ns,{camImage:a,address:(0,he.FR)(n[e].address),activeCount:n[e].activeStatusCount,cameraCount:n[e].cameraCount,name:n[e].name,subscriptionId:e,status:"Inactive",encSubId:o,rechargeText:l,uom:n[e].uom,packType:n[e].packType,flow:"Hualai"},e))]})})]})})})]}):(0,v.jsx)(u.A,{})}}const Va=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),openModal:(0,F.zH)(U.qf,e)}))(qa);class za extends a.Component{constructor(...e){super(...e),this.state={selectedValue:"SA",isOpen:!0,currentAddress:null,associatedAddress:null,title:null,sameAddrData:null,diffAddrData:null,selectedAddr:null,price:500,render:!1,errorMessage:null,bottomTxt:null},this.getPageData=async()=>{const{setApiError:e,history:t}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/select-relocation-address.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s=e.field_json.filter(e=>"SA"===e.type)[0],a=e.field_json.filter(e=>"DA"===e.type)[0],r=s.bottom_text,{title:i}=e;this.setState({sameAddrData:s,diffAddrData:a,title:i,price:s.price,render:!0,bottomTxt:r})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubscriptionAddresses=async()=>{const{setApiError:e}=this.props;try{const t=(0,he.u6)("ha"),{relocate_session:{subscriptionId:s}}=t,a=JSON.parse(localStorage.userAuth),{subId:r}=a,i={subscriberId:r.id,subscriptionId:s},{data:n}=await f.n.postData("order/addressDetails",i);if(n.message===c.A.MESSAGES_TYPES.SUCCESS){const{associatedAddress:t,currentAddress:s}=n.data;s&&t||e(c.A.serverError,!0),this.setState({associatedAddress:t,currentAddress:s,selectedAddr:s,render:!0})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.setSelectedAddress=(e,t)=>{this.setState({selectedAddr:e,price:t})},this.toggle=()=>{const{isOpen:e,currentAddress:t,associatedAddress:s,sameAddrData:a,diffAddrData:r}=this.state,i=e?"DA":"SA";e?s&&Array.isArray(s)&&s.length>0?this.setState({isOpen:!e,selectedValue:i,selectedAddr:s[0],bottomTxt:r.bottom_text}):this.setState({isOpen:!e,selectedValue:i}):this.setState({isOpen:!e,selectedValue:i,selectedAddr:t,bottomTxt:a.bottom_text})},this.handleSubmit=async e=>{this.setState({render:!1}),e.preventDefault();try{const{currentAddress:e,selectedAddr:t,price:s,selectedValue:a,sameAddrData:r,diffAddrData:i}=this.state,{setApiError:n,history:o}=this.props,{relocate_session:{orderUuid:l}}=(0,he.u6)("ha"),{relocate_session:d}=(0,he.u6)("ha"),m=JSON.parse(localStorage.userAuth),{subId:u}=m;let h;(0,x.Sw)({event:"selectRelocationAddress",clickText:"Continue",eventAction:"SA"===a?"Within Same Adresss":"To a different Address","Type of Journey":"HA - Secure - Relocation","Sub ID":u.id||null,productName:d&&d.name,subscriptionID:d&&d.subscriptionId,productPrice:s}),"SA"===a?(e.addressType="TO_EXISTING",h={addressFrom:e,addressTo:e,charges:r.price,orderType:"RE_SA",orderUuid:l}):(t.addressType="TO_EXISTING",h={addressFrom:e,addressTo:t,charges:i.price,orderType:"RE_OA",orderUuid:l});const{data:p}=await f.n.postData("order/address/create/relocation",h);if(p.status&&p.message===c.A.MESSAGES_TYPES.SUCCESS)o.push(`/${c.A.home_automation}/${j.oh}/relocation-summary`);else{if(p.status&&"DATA_MISMATCH"===p.message)return void this.setState({errorMessage:"Something went wrong.",render:!0});n(c.A.serverError,!0)}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}}}
1componentDidMount(){this.getPageData(),this.getSubscriptionAddresses()}render(){const{history:e}=this.props,{isOpen:t,associatedAddress:s,currentAddress:a,sameAddrData:r,diffAddrData:i,title:n,render:o,errorMessage:l,bottomTxt:d}=this.state;return o&&a&&s&&r&&i&&n?(0,v.jsxs)("div",{className:"ipl_event wyze-wrap",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("form",{onSubmit:this.handleSubmit,children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)(G,{history:e,destination:`${j.oh}/relocation`}),(0,v.jsx)("div",{className:"heading-md ",style:{marginBottom:"24px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:n})}),(0,v.jsx)("div",{className:"innercontainer-sm",children:(0,v.jsxs)("div",{className:"select-relocation-wrapp mT30",children:[(0,v.jsx)(ms,{toggle:this.toggle,isOpen:t,address:a,pageData:r}),(0,v.jsx)(us,{toggle:this.toggle,isOpen:!t,addressList:s,pageData:i,setSelectedAddress:this.setSelectedAddress,history:e,formUrl:`${c.A.home_automation}/${j.oh}/add-relocation-address`})]})}),(0,v.jsx)("div",{className:"text-center block mT32",children:(0,v.jsx)("button",{className:"btn btn-primary waves-effect waves-light btn-height",type:"submit",children:" Continue "})}),d&&(0,v.jsx)("div",{className:"innercontainer-sm",children:(0,v.jsx)("p",{className:"mT20 text-center fs12",children:d})}),l&&(0,v.jsx)("p",{style:{color:"red",textAlign:"center",marginTop:"20px"},children:l})]})})})})]}):(0,v.jsx)(u.A,{})}}const Wa=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(za),Xa=["hasErrors"];function Za(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Qa(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Za(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Za(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class Ka extends a.Component{constructor(...e){super(...e),this.initialForm={pinCode:{wrapperClasses:["form-group","pincode-field","more-connection-pincode"],labelConfig:{label:"Pin code",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"pinCode",type:"tel",placeholder:"",maxLength:6,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},location:{wrapperClasses:["form-group","location-field"],labelConfig:{label:"Location",classes:["sel","active","mendate"]},elementType:"select",elementConfig:{id:"location",placeholder:"",options:[{label:"select",value:""}]},value:"",errorMessage:"",valid:!0,touched:!1},building:{wrapperClasses:["form-group","building-field"],labelConfig:{label:"Building Name",classes:["sel","active"]},elementType:"input",elementConfig:{id:"building",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine1:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Address Line 1",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"adrLine1",type:"text",placeholder:"",maxLength:75,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine2:{wrapperClasses:["form-group","addr2-field"],labelConfig:{label:"Address Line 2",classes:["sel","active"]},elementType:"input",elementConfig:{id:"adrLine2",type:"text",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},landmark:{wrapperClasses:["form-group","landmark-field"],labelConfig:{label:"Landmark",classes:["sel","active"]},elementType:"input",elementConfig:{id:"landmark",type:"text",placeholder:"",maxLength:25,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},city:{wrapperClasses:["form-group","city-field"],labelConfig:{label:"City",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"city",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},state:{wrapperClasses:["form-group","state-field"],labelConfig:{label:"State",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"state",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},email:{wrapperClasses:["form-group","email-field"],labelConfig:{label:"Email",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"email",type:"email",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}},this.state={termsChecked:!0,showCheckError:!1,render:!0,infoForm:Qa({},this.initialForm),formErrorMessage:null,button:{buttonConfig:{type:"submit",class:"wAutoLgBlue"},text:"Save",url:"select-language",disabled:!1},currentAddress:null,pageData:null},this.bodyRef=a.createRef(),this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/relocation-new-address-hualai.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,termsTxt:e.body,relocationTxt:e.field_json.relocation_text,pincodeErr:e.field_json.pincode_err,stateErr:e.field_json.state_err};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubsciberDetails=async()=>{const{setApiError:e}=this.props,t=JSON.parse(localStorage.userAuth),{subId:s}=t,a={subscriberId:s.id,source:"WEB"};try{const{data:t}=await f.n.postData("order/address/getAddress",a);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){this.setInfoForm(t.data);const e=t.data,{infoForm:s}=this.state,a=Qa({},s),{city:r,pinCode:i,state:n}=a;r.value=e.city||"",i.value=e.areaPincode||"",n.value=e.state||"",this.setState({infoForm:a},()=>this.getPinCodeData(e.areaPincode))}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getSubscriptionAddresses=async()=>{const{setApiError:e}=this.props;try{const t=(0,he.u6)("ha"),{relocate_session:s}=t,{subscriptionId:a}=s,r=JSON.parse(localStorage.userAuth),{subId:i}=r,n={subscriberId:i.id,subscriptionId:a},{data:o}=await f.n.postData("order/addressDetails",n);if(o.message===c.A.MESSAGES_TYPES.SUCCESS){const{currentAddress:e}=o.data;this.setState({currentAddress:e})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.setInfoForm=e=>{const{infoForm:t}=this.state,s=Qa({},t),{adrLine1:a,adrLine2:r,city:i,email:n,pinCode:o,state:l,building:c,landmark:d,location:m}=s;a.value=e.streetAddress||"",r.value=e.streetAddress2||"",m.value=e.location||"",i.value=e.city||"",n.value=e.emailId||"",o.value=e.postalCode||"",l.value=e.state||"",c.value=e.building||"",d.value=e.landmark||"",e.termsChecked&&this.setState({termsChecked:e.termsChecked}),this.setState({infoForm:s,render:!0},()=>this.getPinCodeData(e.postalCode))},this.inputChangedHandler=(e,t)=>{const{infoForm:s}=this.state,a=Qa({},s),{location:r}=a,i=Qa({},a[t]);let n=e;"pinCode"===t&&(n=n.replace(/[^0-9]/g,""),n.length>6&&(n=n.slice(0,6)),6===n.length&&this.getPinCodeData(n,!0),n.length<6&&(r.elementConfig.options=[{label:"select",value:""}],r.value=null,this.setState({infoForm:a}))),i.value=n,i.touched=!0,i.valid=!0,i.errorMessage="",a[t]=i,this.setState({infoForm:a})},this.getPinCodeData=async e=>{const{setApiError:t}=this.props;if(e)try{const{data:t}=await f.n.getData(`payment/pincode/getPinDetailsByZipCode/${e}/Hualai`),{infoForm:s,pageData:a}=this.state,r=Qa({},s),{city:i,pinCode:n,state:o,location:l}=r,c=t.data;if(c&&Array.isArray(c)&&c.length>0){if(o.value&&o.value!==c[0].state.trim())return n.valid=!1,n.errorMessage=a&&a.stateErr||"State is different",void this.setState({infoForm:r});i.value=c[0].city.trim(),n.value=c[0].zipcode,n.valid=!0,o.value=c[0].state.trim();const e=c&&c.map(e=>({label:e.location,value:e.location}));l.elementConfig.options=[{label:"select",value:""},...e]}else n.valid=!1,n.errorMessage=a&&a.pincodeErr||"Apologies, currently we are unavailable in your city. We will be launching soon!";this.setState({infoForm:r})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.validateForm=async e=>{e.preventDefault();const{infoForm:t,termsChecked:s,currentAddress:a}=this.state,{history:r,setApiError:i}=this.props,n={},o=Object.keys(t);o.forEach(e=>{n[e]=t[e].value});const l=H(n),{hasErrors:d}=l,m=(0,I.A)(l,Xa);if(d){const e=Qa({},t);let s=null;o.forEach((t,a)=>{0===a&&(s=t);const r=m[`${t}Message`];r&&""!==r&&(e[t].valid=!1,e[t].errorMessage=r)}),this.setState({infoForm:e,formErrorMessage:""}),s&&document.getElementById(s).scrollIntoView()}else{let e=!0;if(o.forEach(s=>{t[s].valid||(e=!1)}),e){if(!s)return void this.setState({showCheckError:!0,render:!0});const e={postalCode:t.pinCode.value.trim(),streetAddress:t.adrLine1.value.trim(),streetAddress2:t.adrLine2.value.trim(),city:t.city.value.trim(),landmark:t.landmark.value.trim(),location:t.location.value.trim(),emailId:t.email.value.trim(),state:t.state.value.trim(),building:t.building.value.trim(),termsChecked:s},n=(0,he.u6)("ha"),{relocate_session:o}=n;o.relocation_address=e,(0,he.e)("ha",n);const{address:l,orderUuid:d,charges:m}=o;e.addressType="TO_NEW";const u={addressFrom:l||a,addressTo:e,charges:m,orderType:"RE_OA",orderUuid:d};try{const{data:e}=await f.n.postData("order/address/create/relocation",u);if(e.message===c.A.MESSAGES_TYPES.SUCCESS)r.push(`/${c.A.home_automation}/${j.oh}/relocation-summary`);else{const s=e.message.charAt(0).toUpperCase()+e.message.slice(1).toLowerCase();t.pinCode.valid=!1,this.setState({infoForm:t,formErrorMessage:s})}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||i(c.A.serverError,!0)}}}},this.inputCheckHandler=()=>{const{termsChecked:e,showCheckError:t}=this.state;this.setState({termsChecked:!e},()=>{const{termsChecked:e}=this.state;e&&t&&this.setState({showCheckError:!1})})}}async componentDidMount(){this.bodyRef.current&&this.bodyRef.current.scrollTo(0,0);const{history:e}=this.props,t=(0,he.u6)("ha");if(t){const{relocate_session:s}=t;s||e.push(`/${c.A.home_automation}/${j.oh}/`)}else e.push(`/${c.A.home_automation}/${j.oh}/`);await this.getPageData();const{relocate_session:s}=t,{relocation_address:a,address:r}=s;a&&""!==a.postalCode?(this.setState({render:!1}
1),this.setInfoForm(a)):this.getSubsciberDetails(),r||this.getSubscriptionAddresses()}render(){const{button:e,infoForm:t,render:s,formErrorMessage:r,termsChecked:i,showCheckError:n,pageData:o}=this.state,{history:l}=this.props,c=[];return Object.keys(t).forEach(e=>{c.push({id:e,config:t[e]})}),(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{ref:this.bodyRef,children:[!s&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:l,destination:`${j.oh}/select-relocation-address`}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:o&&o.title})}),(0,v.jsx)("div",{className:"body-container innercontainer-sm pB0",children:(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"innercontainer-xs install-wrapp",children:[(0,v.jsx)("div",{className:"orderttl",children:o&&o.relocationTxt}),c&&c.map(e=>(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)},e.id)),o&&(0,v.jsxs)("div",{className:"mT32 text-center relocation-tnc",children:[(0,v.jsx)("input",{type:"checkbox",className:"filled-in form-check-input",id:"checkbox1",checked:i?"checked":"",onClick:()=>this.inputCheckHandler()}),(0,v.jsx)(b.A,{Tag:"label",className:"form-check-label",htmlFor:"checkbox1",htmlContent:o.termsTxt})]}),n&&(0,v.jsx)("span",{className:"validate invalid-text",style:{marginTop:"10px"},children:"This field is required"})]}),(0,v.jsxs)("div",{className:"text-center mT30 block",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",children:r}),(0,v.jsxs)("a",{className:"btn btn-primary waves-effect waves-light btn-height",href:"javascript:void(0)",onClick:e=>this.validateForm(e),children:[" ",e.text]})]})]})})]})]})})]})})}}const er=(0,l.Ng)(null,e=>({openModal:(0,F.zH)(U.qf,e),setApiError:(0,F.zH)(g.x8,e)}))(Ka);class tr extends a.Component{constructor(...e){super(...e),this.state={render:!1,isSame:!1,addressTo:null,addressFrom:null,charges:null,count:null,pageMetaData:null,disableSubmit:!1},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-relocation-summary.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,subTitle:e.field_subtitle,diffText:e.field_json.different_text,sameText:e.field_json.same_text,camText:e.field_json.camera_text,btnText:e.field_json.button_text,text:e.field_json.text};this.setState({pageMetaData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSummaryData=async()=>{const{setApiError:e}=this.props;try{const{relocate_session:{orderUuid:t}}=(0,he.u6)("ha"),{data:s}=await f.n.getData(`order/getRelocationSummary/${t}`);if(s.message===c.A.MESSAGES_TYPES.SUCCESS){const e=s.data;if(e.addressSame){const{addressSame:t,charges:s,count:a}=e;this.setState({isSame:!0,addressTo:t,count:a,charges:s,render:!0})}else{const{addressFrom:t,addressTo:s,charges:a,count:r}=e;this.setState({isSame:!1,addressFrom:t,addressTo:s,charges:a,count:r,render:!0})}}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.submitHandler=async()=>{this.setState({disableSubmit:!0});const{history:e,setApiError:t}=this.props,{relocate_session:s}=(0,he.u6)("ha"),{isSame:a,charges:r}=this.state;try{const t=JSON.parse(localStorage.userAuth),{subId:i}=t;(0,x.Sw)({event:"okayGotItClick",clickText:"OKay got it",eventAction:a?"Within Same Adresss":"To a different Address","Type of Journey":"HA - Secure - Relocation","Sub ID":i.id||null,productName:s&&s.name,subscriptionID:s&&s.subscriptionId,productPrice:r});const{relocate_session:{orderUuid:n}}=(0,he.u6)("ha"),{data:o}=await f.n.postData(`order/submit-relocation/${n}`);o.message===c.A.MESSAGES_TYPES.SUCCESS?e.push(`/${c.A.home_automation}/${j.oh}/relocation-success`):e.push(`/${c.A.home_automation}/${j.oh}/relocation-failure`)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}}}componentDidMount(){const{history:e}=this.props,t=(0,he.u6)("ha");if(t){const{relocate_session:s}=t;s||e.push(`/${c.A.home_automation}/${j.oh}/`)}else e.push(`/${c.A.home_automation}/${j.oh}/`);
1this.getPageMetaData(),this.getSummaryData()}render(){const{render:e,isSame:t,addressTo:s,addressFrom:r,charges:i,count:n,pageMetaData:o,disableSubmit:l}=this.state,{history:c}=this.props;return(0,v.jsxs)(a.Fragment,{children:[(!e||!o)&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(G,{history:c,destination:`${j.oh}/select-relocation-address`}),(0,v.jsxs)("div",{className:"main-container",children:[o&&(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:o.title}),(0,v.jsx)("h2",{className:"ha-heading2",children:o.subTitle})]}),(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-sm-xs summary posR",children:[(0,v.jsxs)(ot.A,{className:"relocation-summary-card",children:[(0,v.jsxs)(lt.A,{children:[t&&o&&s&&(0,v.jsx)("div",{className:"inner-card-body addr",id:"same-addr",children:(0,v.jsxs)("section",{className:"v-start-top",children:[(0,v.jsxs)("h3",{className:"ha-heading2 mT0 ",children:[o.sameText,(0,v.jsx)("span",{className:"label-text d-block mB0 mT10",children:`Address: ${(0,he.FR)(s)}`})]}),(0,v.jsxs)("span",{className:"payment-left-amount",children:[(0,v.jsx)("span",{className:"rupee fs14",children:"â¹"}),i]})]})}),o&&!t&&s&&r&&(0,v.jsx)("div",{className:"inner-card-body addr",id:"diff-addr",children:(0,v.jsxs)("section",{className:"v-start-top",children:[(0,v.jsxs)("h3",{className:"ha-heading2 mT0",children:[o.diffText,(0,v.jsx)("div",{children:(0,v.jsxs)("span",{className:"label-text d-block mB0 mT10",children:[(0,v.jsx)("span",{className:"bold black",children:"From: "}),(0,he.FR)(r)]})}),(0,v.jsx)("div",{className:"mT10",children:(0,v.jsxs)("span",{className:"label-text d-block mB0",children:[(0,v.jsx)("span",{className:"bold black",children:"To: "}),(0,he.FR)(s)]})})]}),(0,v.jsxs)("span",{className:"payment-left-amount",children:[(0,v.jsx)("span",{className:"rupee fs14",children:"â¹"}),i]})]})}),o&&n&&(0,v.jsx)("div",{className:"inner-card-body qnty border-none pB0 mB0",id:"new",children:(0,v.jsx)("section",{className:"v-start-top",children:(0,v.jsxs)("h3",{className:"ha-heading2 mT0",children:[o.camText,(0,v.jsx)("span",{className:"label-text d-block mB0",children:`Qty. ${n}`})]})})})]}),(0,v.jsxs)(ct.A,{className:"card-footer",children:[(0,v.jsx)("h2",{className:"ha-heading2 bold",children:"Total Amount"}),i&&(0,v.jsx)("span",{className:"mB0 text-right",children:(0,v.jsxs)("span",{className:"price-xs mR0",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"count",children:i})]})})]})]}),o&&(0,v.jsx)("p",{className:"mT20 text-center fs12",children:o.text}),(0,v.jsxs)("div",{className:"text-center block mT32",children:[" ",!l&&(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light btn-height",style:{display:"inline-flex"},href:"javascript:void(0)",onClick:()=>this.submitHandler(),children:o&&o.btnText}),l&&(0,v.jsx)("button",{className:"btn btn-primary waves-effect waves-light btn-height",style:{display:"inline-flex"},disabled:l,type:"button",children:o&&o.btnText})," "]})]})})]})]})})]})}}const sr=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(tr);function ar(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}const rr=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(e=>{const[t,s]=(0,a.useState)({name:null,count:null,haId:null,addressTo:null,addressFrom:null,isSame:null}),[r,i]=(0,a.useState)(null),[n,o]=(0,a.useState)(!1),{setApiError:l}=e,d=async()=>{try{const e=(0,he.u6)("ha");e||l(c.A.serverError,!0);const{relocate_session:{orderUuid:t}}=e,{data:a}=await f.n.getData(`order/getRelocationSummary/${t}`);if(a.message===c.A.MESSAGES_TYPES.SUCCESS){const t=a.data,{count:r,name:i,haId:n}=t,l=JSON.parse(localStorage.userAuth),{subId:c}=l;(0,x.Sw)({event:"relocationSuccess",transactionID:n,eventAction:t.addressSame?"Within Same Adresss":"To a different Address","Type of Journey":"HA - Secure - Relocation","Sub ID":c.id||null,productName:e&&e.relocate_session&&e.relocate_session.name,subscriptionID:e&&e.relocate_session&&e.relocate_session.subscriptionId,productPrice:t.charges});const d={count:r,name:i,haId:n};if(t.addressSame){const{addressSame:e}=t;d.addressTo=e,d.isSame=!0}else{const{addressTo:e,addressFrom:s}=t;d.addressTo=e,d.addressFrom=s,d.isSame=!1}s(function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?ar(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ar(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},d)),o(!0)}else l(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||l(c.A.serverError,!0)}};return(0,a.useEffect)(()=>{(async()=>{o(!1);try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-relocation-successful.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,s={title:t.title,btnTxt:t.field_json.button_text,safetyTxt:t.field_json.safety_text,relocateDetails:t.field_json.relocate_details,img:t.field_image};i(s)}else l(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||l(c.A.serverError,!0)}})(),d()},[]),n?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:r&&r.title}),t.haId&&(0,v.jsx)("div",{className:"fs16 bold mB20 mT10",children:`Order Id: ${t.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("div",{className:"insta-blk-wrapp",children:[(0,v.jsxs)("div",{className:"insta-blk-text bold",children:[" ",r&&r.relocateDetails]}),(0,v.jsx)("div",{className:"insta-blk",children:(0,v.jsxs)("div",{className:"addr",id:"same-addr",children:[t.isSame&&t.addressTo&&(0,v.jsxs)("div",{className:"insta-icon-wrapp mR0",children:[(0,v.jsx)("div",{className:"fs14 label-left",children:"Address: "}),(0,v.jsx)("div",{className:"fs14",children:`${(0,he.FR)(t.addressTo)}`})]}),!t.isSame&&t.addressFrom&&t.addressTo&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"insta-icon-wrapp mR0 mT10",children:[(0,v.jsx)("div",{className:"bold black fs14 label-left",children:"From: "}),(0,v.jsx)("div",{className:"fs14",children:`${(0,he.FR)(t.addressFrom)}`})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp mR0 mT10",children:[(0,v.jsx)("div",{className:"bold black fs14 label-left",children:"To: "}),(0,v.jsx)("div",{className:"fs14",children:`${(0,he.FR)(t.addressTo)}`})]})]}),t.name&&t.count&&(0,v.jsxs)("div",{className:"insta-icon-wrapp mB0 mR0 mT15",style:{marginTop:"15px"},children:[(0,v.jsx)("div",{className:"fs14 label-left",children:"Qty: "}),(0,v.jsx)("div",{className:"fs14",children:`${t.count} ${t.name}`})]})]})})]}),r&&(0,v.jsx)(jt,{source:"Installation"}),(0,v.jsx)("div",{className:"footer-contr text-center mT20 block",children:(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light btn-height",onClick:()=>(()=>{const{history:t}=e,s=JSON.parse(localStorage.userAuth),{subId:a}=s;(0,x.Sw)({event:"ctaClick",clickText:"Back to Home","Type of Journey":"HA - Secure - Relocation","Sub ID":a.id||null}),t.push(`/${c.A.home_automation}/${j.oh}`)})(),href:"javascript:void(0)",children:"Back to Home"})})]})]})})})]}):(0,v.jsx)(u.A,{})}),ir=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(e=>{const[t,s]=(0,a.useState)({title:null,subtitle:null,btn_text:null,btn_url:null}),[r,i]=(0,a.useState)(!1),n=(0,he.u6)("ha"),{history:o,setApiError:l}=e;return(0,a.useEffect)(()=>{n||o.push(`/${c.A.home_automation}/`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/relocation-failure.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,a={title:t.title,subtitle:t.field_subtitle,btn_text:t.field_json.button_text,btn_url:`/${c.A.home_automation}`};s(a),i(!0)}else l(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||l(c.A.serverError,!0)}})()},[]),r?(0,v.jsx)(As,{title:t.title,subtitle:t.subtitle,btnText:t.btn_text,btnUrl:t.btn_url}):(0,v.jsx)(u.A,{})});function nr(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function or(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?nr(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):nr(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class lr extends a.Component{constructor(...e){super(...e),this.state={render:!1,cartCount:1,cameraPrice:"",isOpenSubscription:!0,isSubsFeatureOpen:!1,productData:null,subscriptionData:[],pageMeta:null,showSnack:!1,cartMaxCount:4,showBlank:!1,breadCrumb:null},this.gaProductDetailEvent=e=>{const t=this.getGaInfo(e);(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Add Camera",event:"productDetailView",ecommerce:{detail:{actionField:"",products:[{name:"Tata Play Secure",id:t.id,price:t.singleProductPrice,brand:"Tata Play",category:"Home Automation",variant:"Hualai",productName:`${t.productName||""}${t.packname&&","} ${t.packname||""}`}]}}})},this.addRemoveCartGaEvent=(e,t,s=!1)=>{const{cartCount:a}=this.state,r=this.getGaInfo(t);"minus"===e&&(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Add Camera",event:"removeFromCart",ecommerce:{remove:{products:[{name:"Tata Play Secure",id:r.id,price:r.singleProductPrice,brand:"Tata Play",category:"Home Automation",variant:"Hualai",list:"NA",quantity:1,productName:`${r.productName}, ${r.packname}`}]}}}),"plus"===e&&(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Add Camera",event:"addToCart",ecommerce:{currencyCode:"INR",add:{products:[{name:"Tata Play Secure",id:r.id,price:s?r.initialSellingPrice:r.singleProductPrice,brand:"Tata Play",category:"Home Automation",variant:"Hualai",list:"NA",quantity:s?a:"1",productName:`${r.productName}, ${r.packname}`}]}}})},this.gaCheckoutEvent=e=>{const{cartCount:t}=this.state;(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Add Camera",event:"checkout",ecommerce:{checkout:{actionField:{step:1,option:"Cart view"},products:[{name:"Tata Play Secure",id:e.id,price:e.price,brand:"Tata Play",category:"Home Automation",variant:"Hualai",quantity:t,productName:`${e.productName}, ${e.packname}`}]}}})},this.getGaInfo=e=>{const{productData:t,cartCount:s,cameraPrice:a}=this.state;let r={};e.forEach(e=>{s>=e.deviceCountMin&&(r=e)});const i=parseInt(t&&t.field_discountprice,10)*s,n=(parseInt(r.packMrp,10),parseInt(r.discountedPrice,10)),o=i+n;return{id:r.id,price:o,packname:r.friendlyName,productName:t.title,singleProductPrice:parseInt(t&&t.field_discountprice,10),initialSellingPrice:parseInt(t&&t.field_discountprice,10)*s+n}},this.checkPaymentStatus=async()=>{const{setApiError:e}=this.props,t=(0,he.u6)("ha");if(!t)return;const{addCameraSession:s}=t;if(s&&s.orderUuid)try{const{data:t}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${s.orderUuid}`);if(t.status&&t.message===c.A.MESSAGES_TYPES.SUCCESS){const s=t.data;if(!s&&!Object.isArray(s)&&s.length<=0)return void e(c.A.serverError,!0);const a=s[0].paymentStatus;let r=null;"SUCCESS"===a?r=j.QZ.SUCCESS:"INPROGRESS"===a?r=j.QZ.AWAITED:"FAILED"===a&&(r=j.QZ.FAILURE),(0,he.VJ)(r,"ADD_CAM")}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.checkWoStatus=async()=>{this.setState({render:!1});const{setApiError:e,openModal:t,history:s}=this.props;try{const{userAuth:a}=localStorage,{subId:r}=JSON.parse(a),i={subscriberId:r.id},{data:n}=await f.n.postData("order/workorder/getWoPendingStatus",i);if(n.status)return this.setState({render:!0}),!0;if("FAILURE"!==n.message){const e=!0;return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Oops! Your previous order is pending",body:"To perform any action, we need to close your previous order. Please contact our call centre to get an update on your work order status.",btnTxt:"Ok",redirectUrl:"/",onClose:e},redirectRoute:!0,onCloseEvent:()=>{e&&(window.location.href="/")},history:s}),this.setState({showBlank:!0,render:!0}),!1}e(c.A.serverError,!0)}catch(t){e(c.A.serverError,!0)}},this.checkActiveHaUser=async()=>{this.setState({render:!1});const{pageMeta:e}=this.state,{setApiError:t,openModal:s,history:a}=this.props;try{const{userAuth:r}=localStorage,{subId:i}=JSON.parse(r),n={subscriberId:i.id,provider:"Hualai"},{data:o}=await f.n.postData("order/checkActiveHAUser",n);if(o.status){const t={};let i,n,l="",c="",d=null,m="",u=!1,h=!1,p=!1;
1e.popup_config.forEach(e=>{t[e.status.toLowerCase()]=e});const{encSubscriberId:g}=JSON.parse(r),f=g[0];return"inactive"===o.message.toLowerCase()?(l=t.inactive.heading,c=t.inactive.subHeading,m=t.inactive.button_text,i="/",h=!0,p=!0):"temp_suspend"===o.message.toLowerCase()?(l=t.temp_suspend.heading,c=t.temp_suspend.subHeading1,d=t.temp_suspend.subHeading2,m=t.temp_suspend.button_text,i=t.temp_suspend.button_link,n=t.temp_suspend.field_url_source,p=!0,h=!0):"deactivated"===o.message.toLowerCase()&&(l=t.deactivated.heading,c=t.deactivated.subHeading,m=t.deactivated.button_text,u=!0,p=!0,h=!0),!p||(s(L.lx.COMMON_MODAL,{Component:Ne,data:{title:l,body:c,subHeading2:d,showRecharge:u,btnTxt:m,redirectUrl:i,fieldSource:n,encSubId:f},onCloseEvent:()=>{h&&(window.location.href="/")},history:a}),this.popupOpenGaEvent(l),this.setState({showBlank:!0}),!1)}t(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.popupOpenGaEvent=e=>{(0,x.Sw)({event:"popUp",popUpAction:"Pop Up Appeared",popUpName:e,"Pop up option selected":"","Sub ID ":(0,x.Xo)().id||null})},this.getBreadCrumbData=async()=>{const{setApiError:e}=this.props;try{const t="s3-api/v1/assets/pages/add-cam-page-hualai.json",s=(await f.n.getJsonData(t)).data;if(s.status===c.A.MESSAGES_TYPES.SUCCESS){const e=s.data;return this.setState({breadCrumb:e.breadcrumb,render:!0}),!0}return e(c.A.serverError,!0),!1}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubscriptionData=async()=>{const{setApiError:e}=this.props,t=new Date;try{const{data:s}=await f.n.getJsonData(`read/core-api/subscription/search/${ne()(t).format("YYYYMMDD")}`);if(s.status===c.A.MESSAGES_TYPES.SUCCESS){if(Array.isArray(s.data)&&s.data.length>0){const e=s.data.filter(e=>e.meta.field_journey&&e.meta.field_journey.includes("wyze"));if(e.length>0){const t=e.sort((e,t)=>e.deviceCountMin-t.deviceCountMin);this.setState({subscriptionData:t,cartMaxCount:e[0].maxCount})}}}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.checkHaUser=async(e=!1)=>{this.setState({render:!1});const{setApiError:t,openModal:s,history:a}=this.props,{subId:r}=JSON.parse(localStorage.userAuth),i={subscriberId:r.id,source:"HA",provider:"Hualai"};try{const{data:t}=await f.n.checkHaUser(i);if(t.message!==c.A.MESSAGES_TYPES.SUCCESS&&!1===t.status)return s(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Not a valid user! ",body:"We see your account is not valid for this service. Request you to login with a different account",showRecharge:!1,redirectUrl:"/my-account"},onCloseEvent:()=>{const{history:e}=this.props;e.push("/my-account")},history:a}),this.setState({showBlank:!0,render:!0}),!1;const r=await this.checkActiveHaUser();return e||this.setState({render:!0}),r}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}return!0},this.getJourneyStatus=async()=>{const{setApiError:e}=this.props;try{const{history:t}=this.props,{subId:s}=JSON.parse(localStorage.userAuth),a={subId:s.id,orderType:"ADD_NEW",provider:"Hualai"},{data:r}=await f.n.postData("package/getOrderStatusBySubId",a);if(r.message===c.A.MESSAGES_TYPES.SUCCESS){const e=r.data;e.cameraCount&&""!==e.cameraCount&&(0,he.$4)(e.cameraCount,"add_cam",e.cameraCount),e.address&&"NEW"===e.address.addressType?(0,he.PS)(e.address,"add_cam"):e.address&&"NEW"!==e.address.addressType&&(0,he.PS)({orderUuid:e.address.orderUuid},"add_cam");const s=(0,he.u6)("ha"),{addCameraSession:a}=s;a.statusChecked=!0,"Initiated"!==e.orderStatus&&"Completed"!==e.orderStatus||(a.paymentStatus=j.QZ.SUCCESS),s.orderType="ADD_CAM",(0,he.e)("ha",s);const i=j.MC.addCamOrderStatusList[e.page];i&&"CREATE ADDRESS"!==e.page&&t.push(`/${c.A.home_automation}/${j.oh}/${i}`)}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getPageData=async()=>{const{setApiError:e}=this.props;try{const t="s3-api/v1/assets/pages/bundle-page-hualai.json",s=(await f.n.getJsonData(t)).data;if(s.status===c.A.MESSAGES_TYPES.SUCCESS){const e=s.data,t=e.field_json,a={bottom_info_text:e.body,pageTitle:t.bundle_heading,onwards_text:t.onwards_text,popup_config:t.popup_config,snack_text:t.snack_add_text,inclusive_text:t.inclusive_text,breadcrumb:e.breadcrumb,dropdown_title:t.dropdown_title};return this.setState({pageMeta:a,render:!0}),!0}return e(c.A.serverError,!0),!1}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getProductsData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("read/core-api/product/search/eyJmaWVsZF9qb3VybmV5Ijoid3l6ZSJ9"),{cartCount:s}=this.state;if(t.status===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data[0];this.setState({productData:or({},e),cameraPrice:parseInt(e.field_actualprice,10)*s,cameraSellPrice:parseInt(e.field_discountprice,10)*s});const a={event:"eec.impressionView",ecommerce:{currencyCode:"INR",impressions:[{"Product name":e.title,"Product id":e.field_uuid,price:e.field_discountprice,brand:"Tataplay",category:"Home Automation",position:1}]}};(0,x.Sw)(a)}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.toggleAccordion=(e,t)=>{const{[t]:s}=this.state;s||(0,x.Sw)({event:"View More"}),e.preventDefault(),this.setState({[t]:!s})},this.handleSubmit=async(e,t)=>{this.setState({render:!1});const{productData:s,cartCount:a}=this.state,{setApiError:r,history:i}=this.props,n=this.getGaInfo(this.state.subscriptionData);if(await this.checkHaUser(!0))try{const t=[],o=JSON.parse(s.field_json).summary_text;t.push({productUuid:s.field_uuid,count:a,description:o||""});const l=JSON.parse(localStorage.userAuth),{subId:{id:d}}=l,m={subId:d,product:[...t],provider:"Hualai"},u=(0,he.u6)("ha"),h=[j.QZ.SUCCESS,j.QZ.AWAITED,j.QZ.FAILURE],{addCameraSession:{camCount:p,prevCartCount:g,paymentStatus:x}}=u;if(p!==g||x&&h.includes(x)){const{data:t}=await f.n.postData("order/createAddNewCameraOrder",m);
1if(t.message===c.A.MESSAGES_TYPES.SUCCESS){if(!c.A.isServer()){const s=(0,he.u6)("ha"),{addCameraSession:r}=s;r.paymentStatus=null,r.camCount=a,r.prevCartCount=a,r.orderUuid=t.data.orderUuid,r.maxCount=parseInt(e.maxCount,10),r.gaInfo=n,(0,he.e)("ha",s)}}else r(c.A.serverError,!0)}else{const e=(0,he.u6)("ha");e.addCameraSession.gaInfo=n,(0,he.e)("ha",e)}this.gaCheckoutEvent(n),i.push(`/${c.A.home_automation}/${j.oh}/add-camera-select-address`)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}},this.handleCartItemCount=e=>{const{cartCount:t,cartMaxCount:s}=this.state;let a=0;"minus"===e?a=parseInt(t,10)-1:"plus"===e&&(a=parseInt(t,10)+1),a>s?this.setState({showSnack:!0}):a<1||this.setState({cartCount:a},()=>{this.handleCartPrice(),(0,he.$4)(a,"add_cam"),this.addRemoveCartGaEvent(e,this.state.subscriptionData)})},this.handleCartPrice=()=>{const{cartCount:e,productData:t}=this.state,s=t.field_actualprice,a=t.field_discountprice;this.setState({cameraPrice:parseInt(s,10)*e,cameraSellPrice:parseInt(a,10)*e})},this.closeAlert=e=>{e.stopPropagation(),this.setState({showSnack:!1})}}async componentDidMount(){(0,x.NP)("Buy Tata Play Secure Camera Subscription at Low Price","Subscribe to Tata Play Secure to protect your home & office. Just click the buy subscription button and opt your suitable CCTV subscription package.");let e=(0,he.u6)("ha");if(e||(e={addCameraSession:{statusChecked:!1}
1},(0,he.e)("ha",e)),!c.A.isServer()&&e){const{addCameraSession:t}=e;e&&t?t.camCount?this.setState({cartCount:t.camCount}):t.statusChecked||(e=or(or({},e),{},{addCameraSession:{statusChecked:!1}}),(0,he.e)("ha",e)):(e={addCameraSession:{statusChecked:!1}},(0,he.e)("ha",e))}let t=!1;if(await this.getPageData()&&(t=await this.checkHaUser()),t){if(!await this.checkWoStatus())return;const e=(0,he.u6)("ha");if(e){const{addCameraSession:t}=e;t.statusChecked||this.getJourneyStatus()}await this.checkPaymentStatus(),Promise.all([this.getProductsData(),this.getSubscriptionData(),this.getBreadCrumbData()]).then(()=>{this.gaProductDetailEvent(this.state.subscriptionData),this.addRemoveCartGaEvent("plus",this.state.subscriptionData,!0)})}}componentWillUnmount(){(0,x.Cq)('"Buy Tata Play Secure Camera Subscription at Low Price"')}render(){const{history:e}=this.props,{productData:t,subscriptionData:s,cartCount:r,cameraPrice:i,cameraSellPrice:n,cartMaxCount:o,isOpenSubscription:l,pageMeta:d,showSnack:m,showBlank:g,isSubsFeatureOpen:f,render:x,breadCrumb:y}=this.state;if(!x)return(0,v.jsx)(u.A,{});if(g)return null;let S={};s.forEach(e=>{r>=e.deviceCountMin&&(S=e)});const j=parseInt(S.packMrp,10),A=n+parseInt(S.discountedPrice,10),N=i+j-A;return(0,v.jsxs)("div",{className:"ipl_event wyze-wrap wyze-bundle",children:[m&&(0,v.jsx)(ge,{text:d.snack_text,closeAlert:this.closeAlert,cartMaxCount:o}),(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsxs)("div",{className:"content-container pay-succes gs-alert",children:[(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)(G,{history:e,type:"history_back"}),(0,v.jsx)("div",{className:"heading-md ",style:{marginBottom:"30px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient wyze-bundle-heading",children:d.pageTitle})}),d&&(0,v.jsx)("div",{className:"bundle",children:(0,v.jsx)(Se,{classes:"wyze-drop",history:e,title:d&&d.dropdown_title,jsonUrl:"s3-api/v1/assets/pages/hualai-dropdown.json",includeCurrent:!0})}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("div",{className:"features-wrapp",children:[(0,v.jsxs)("div",{id:"accordion",className:"accordion-packchange",children:[(0,v.jsx)("div",{className:"acc-cont bor-bottom pB10",children:(0,v.jsx)("div",{children:(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsxs)("div",{className:"feat-accor-img",children:[" ",(0,v.jsx)("img",{src:t&&c.A.NODE_API_ROOT+t.field_image.url,alt:t&&t.field_image.alt})," "]}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[(0,v.jsx)("span",{children:t&&t.title}),t&&t.field_subtitle]}),(0,v.jsxs)("div",{className:"feat-accor-price",children:[(0,v.jsxs)("div",{className:"qty",children:[(0,v.jsx)("span",{className:"minus",onClick:()=>this.handleCartItemCount("minus",S),children:"-"}),(0,v.jsx)("input",{type:"text",className:"count",name:"qty",value:r}),(0,v.jsx)("span",{className:"plus",onClick:()=>this.handleCartItemCount("plus",S),children:"+"})]}),(0,v.jsxs)("div",{className:"price",children:[i!==n&&(0,v.jsxs)("div",{className:"label cutprice",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:i})]}),0!==n?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsxs)("div",{className:"label",children:[(0,v.jsx)("span",{className:"rupee rupee-fs14",children:"â¹"}),(0,v.jsx)("span",{className:"camera-price",children:n})]}),(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"annual-sub-price offer-text",children:d&&d.inclusive_text})})]}):(0,v.jsx)("div",{className:"label",children:"Free"})]})]})]})})}),S&&Object.keys(S).length&&(0,v.jsxs)("div",{className:"acc-cont",children:[(0,v.jsxs)("div",{className:"feat-accor-wrapp",children:[(0,v.jsxs)("div",{className:"feat-accor-img",children:[" ",S.meta.field_image&&(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+S.meta.field_image.url,alt:S.meta.field_image.alt,style:{width:"45px"}})," "]}),(0,v.jsxs)("div",{className:"feat-accor-text",children:[" ",(0,v.jsx)("span",{children:S.friendlyName})," ",S.meta.title," "]}),(0,v.jsx)("div",{className:"feat-accor-price",children:(0,v.jsxs)("div",{className:"price",children:[S.packMrp!==S.discountedPrice&&(0,v.jsxs)("div",{className:"label cutprice",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"annual-sub-cut-price",children:S&&S.packMrp})]}),(0,v.jsx)("div",{className:"label",children:(0,v.jsxs)("span",{className:"annual-sub-price",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"bold",children:S&&S.discountedPrice}),(0,v.jsx)("span",{className:"small",children:S&&"annual"===S.packUom.toLowerCase()?"/year":null})]})}),(0,v.jsx)(b.A,{Tag:"span",htmlContent:S.meta.field_offer_label})]})})]}),(0,v.jsxs)("div",{className:"fea-bene-text-outer",children:[(0,v.jsx)("div",{onClick:e=>this.toggleAccordion(e,"isOpenSubscription"),className:"fea-bene-text accordion-toggle "+(l?"acc-expanded":"acc-collapsed"),children:"Features and benefits"}),(0,v.jsx)(D.A,{isOpen:l,children:S.meta.field_sub_features&&S.meta.field_sub_features.map((e,t)=>{if(t<=4)return(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t);if(5===t){const e=S.meta.field_sub_features.slice(5,S.meta.field_sub_features.length);return(0,v.jsxs)("div",{children:[(0,v.jsx)(D.A,{isOpen:f,style:{border:"0",paddingBottom:"0"},children:e.map((e,t)=>(0,v.jsx)(fe,{body:e.field_body,url:e.field_image.url},t))}),(0,v.jsx)("div",{className:"fb-blk d-block text-center",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:e=>this.toggleAccordion(e,"isSubsFeatureOpen"),className:"viewmore less",children:f?"View Less":"View More"})})]})}})})]})]})]}),d&&(0,v.jsx)(b.A,{htmlContent:d.bottom_info_text})]}),(0,v.jsx)("div",{className:"fixed-btn cart-wrapper mT20 show",children:(0,v.jsxs)("div",{className:"dflex-sb innercontainer-sm",children:[(0,v.jsxs)("div",{className:"cart-wrapp dflex-sb",children:[(0,v.jsxs)("div",{className:"cart-icon mR10",children:[" ",(0,v.jsx)("img",{src:"/assets/images/home-automation/cart.svg"}),(0,v.jsx)("div",{className:"cart-items",children:r})]}),(0,v.jsxs)("div",{className:"carttext ",children:[" ",(0,v.jsx)("span",{className:"d-block",children:(0,v.jsxs)("div",{className:"label mL5 bigfont",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"total-price1",children:A})]})})," "," "]})]}),(0,v.jsx)("button",{type:"button",className:"btn42 btn-primary waves-effect waves-light share-summary",onClick:()=>this.handleSubmit(S,A,N),children:"Subscribe"})]})})]})]})}),(0,v.jsx)(p.A,{showBreadCrumb:!0,breadCrumbData:y}),y&&(0,v.jsx)(b.A,{Tag:"script",type:"application/ld+json",htmlContent:JSON.stringify((0,O.$)(y))})]})]})}}(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),openModal:(0,F.zH)(U.qf,e)}))(lr);function cr(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}const dr=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(e=>{const{history:t,setApiError:s}=e,[r,i]=(0,a.useState)(!1),[n,o]=(0,a.useState)(null),[l,d]=(0,a.useState)(null),[m,p]=(0,a.useState)(!1),g=async e=>{i(!1);const a=(0,he.u6)("ha"),{addCameraSession:{orderUuid:r,camCount:n,maxCount:o}}=a;if(parseInt(n,10)+parseInt(e.existingCount,10)>o)return p(!0),void i(!0);const l=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?cr(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):cr(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},e);l.orderUuid=r,l.addressType="EXISTING";const d={address:l,orderUuid:r,subscriptionId:e.subscriptionId};try{const{data:e}=await f.n.postData("order/address/create/AddNewCamera",d);e.message===c.A.MESSAGES_TYPES.SUCCESS?(b(),t.push(`/${c.A.home_automation}/${j.oh}/add-camera-payment-summary`)):s(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}},b=()=>{const{addCameraSession:{gaInfo:e,camCount:t}}=(0,he.u6)("ha");(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Add Camera",event:"checkout",ecommerce:{checkout:{actionField:{step:2,option:"Customer Details"},products:[{name:"Tata Play Secure",id:e.id||"",price:e.price||"",brand:"Tata Play",category:"Home Automation",variant:"Hualai",quantity:t,productName:e.productName&&e.packname?`${e.productName},${e.packname}`:""}]}}})};if((0,a.useEffect)(()=>{const e=(0,he.u6)("ha");if(!e)return void t.push(`/${c.A.home_automation}/${j.oh}/add-camera`);const{addCameraSession:a}=e;if(!a)return void t.push(`/${c.A.home_automation}/${j.oh}/add-camera`);const{orderUuid:r}=a;if(!r)return void t.push(`/${c.A.home_automation}/${j.oh}/add-camera`);(async()=>{await(async()=>{try{const e=JSON.parse(localStorage.userAuth),{subId:{id:t}}=e,a={subscriberId:t,provider:"Hualai"},{data:r}=await f.n.postData("order/AddNewCamera/SelectAddress",a);if(r.message===c.A.MESSAGES_TYPES.SUCCESS){const{associatedAddress:e}=r.data;e&&Array.isArray(e)&&e.length>0&&d(e)}else s(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}})(),await(async()=>{try{const e="s3-api/v1/assets/pages/add-camera-select-address.json",t=(await f.n.getJsonData(e)).data;if(t.status===c.A.MESSAGES_TYPES.SUCCESS){const e={title:t.data.title,btn_txt:t.data.field_json.text};o(e)}else s(c.A.serverError,!0);i(!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}})()})()},[]),!r)return(0,v.jsx)(u.A,{});const y=(0,he.u6)("ha"),{addCameraSession:{maxCount:S}}=y,A={label:"Back",url:`/${c.A.home_automation}/${j.oh}/add-camera`};return(0,v.jsxs)(a.Fragment,{children:[!r&&(0,v.jsx)(u.A,{}),m&&(0,v.jsx)(ge,{closeAlert:e=>{e.stopPropagation(),p(!1)},cartMaxCount:S,btn:A,history:t}),(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_ADD_CAM_SUBSCRIPTION,activeStepper:"2"}),(0,v.jsx)(G,{history:t,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[n&&(0,v.jsx)("div",{className:"heading-md ",style:{marginBottom:"30px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",style:{padding:"0 230px"},children:n.title})}),(0,v.jsxs)("div",{className:"body-container innercontainer-md-sm",children:[l&&l.map((e,t)=>(0,v.jsxs)("div",{className:"newadd-blk addblk",onClick:()=>g(e),children:[(0,v.jsxs)("p",{children:[(0,v.jsx)("span",{className:"bold",children:"Address:"})," ",(0,he.FR)(e)]}),(0,v.jsxs)("p",{children:[(0,v.jsx)("span",{className:"bold",children:"Subscription Id:"})," ",e.subscriptionId]}),(0,v.jsxs)("p",{children:[(0,v.jsx)("span",{className:"bold",children:"Qty:"})," ",`${e.existingCount} ${e.existingCount>1?"Cameras":"Camera"}`]})]},t)),(0,v.jsx)("a",{href:"javascript:void(0)",onClick:()=>{return e=`/${c.A.home_automation}/${j.oh}/add-camera-new-address`,s=n.btn_txt,(0,x.Sw)({event:"ctaClick",clickText:s,"Type of Journey":"HA-Secure -Add Camera","Sub ID":(0,x.Xo)().id||null}),void t.push(e);var e,s},className:"mT20 d-block bold",children:n&&n.btn_txt})]})]})]})})]})});class mr extends a.Component{constructor(...e){super(...e),this.state={render:!1,productsData:null,subscriptions:[],address:[],transactionAmount:null,formErrorMessage:null,isSubExist:!1,infoText:null,showInfoIcon:!1,infoModalText:null,pageMetaData:null},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-summary-balance.json");if(t.status===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,{field_json:s}=e,a=s.filter(e=>
1"ADD_CAM"===e.journey)[0];a.bottomInfoTxt=e.body,this.setState({pageMetaData:a})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.payNowHandler=async()=>{const{productsData:e,subscriptions:t,transactionAmount:s}=this.state;let a=e.camera[0].name;0!==t.length&&(a=`${e.camera[0].name} | ${t[0].friendlyName}`);const r=(0,he.u6)("ha"),{addCameraSession:{orderUuid:i}}=r,{history:n,setStepAndUuidForPayment:o,updateS3Data:l}=this.props;try{const{data:e}=await f.n.postData(`payment/authPayment/${i}`,{});if(!0===e.status){const{uuid:t}=e.data;r.orderType="ADD_CAM",r.journey="Hualai",r.addCameraSession.gaInfo.price=s,(0,he.e)("ha",r),l("isCOD",!1),o(t),localStorage.setItem("SOURCE",c.A.sourcetype.HA_HUALAI),this.gaCheckoutEvent(),n.push("/secure/home")}else this.setState({render:!0,formErrorMessage:e.message||c.A.serverError})}catch(e){this.setState({render:!0,formErrorMessage:c.A.serverError})}},this.gaCheckoutEvent=()=>{const{addCameraSession:{gaInfo:e,camCount:t}}=(0,he.u6)("ha"),{transactionAmount:s}=this.state;(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Add Camera",event:"checkout",ecommerce:{checkout:{actionField:{step:3,option:"Order Summary"},products:[{name:"Tata Play Secure",id:e.id,price:s,brand:"Tata Play",category:"Home Automation",variant:"Hualai",quantity:t,productName:`${e.productName},${e.packname}`}]}}})},this.getSummaryData=async()=>{const{setApiError:e}=this.props,t=(0,he.u6)("ha"),{addCameraSession:{orderUuid:s,camCount:a}}=t,{history:r}=this.props;try{const{data:t}=await f.n.getData(`order/getAddNewCameraSummaryByUuid/${s}`);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){if(t.data.page&&"bundle"===t.data.page.toLowerCase())return void r.push(`/${c.A.home_automation}/${j.oh}/add-camera`);const e=t.data.products.filter(e=>e.type&&"camera"===e.type.toLowerCase());let s=!1;t.data.subscriptions.length>0&&(s=!0);const i=null;let n=!1,o=null;s&&parseInt(e[0].existingCount,10)>=0&&t.data.endDate&&(o=`<p>Addition of camera to the existing <span>${e[0].existingCount}</span> camera(s) bundle may change your <span>Tata Play Secure</span> subscription.</p>\n <p> You will be required to pay <span><span class="rupee fs12">â¹</span>${t.data.subscriptions[0].discountedPrice}</span> for additional cost to maintain upto <span>${parseInt(a,10)+parseInt(e[0].existingCount,10)}</span> Camera(s) till <span>${t.data.endDate}</span> </p>\n <div class="pricebox bold mT20">\n <div class="leftblk">Current <span class="bold">Tata Play's Secure Subscription</span> Cost</div>\n <div class="rightblk"><span class="rupee fs12">â¹</span>${t.data.subscriptions[0].currentAmount}</div>\n </div>\n <div class="pricebox bold">\n <div class="leftblk">Upgraded <span class="bold">Tata Play's Secure Subscription</span> Cost</div>\n <div class="rightblk"><span class="rupee fs12">â¹</span>${t.data.subscriptions[0].upgradedAmount}</div>\n </div>\n <div class="pricebox bold">\n <div class="leftblk">Balance Amount </div>\n <div class="rightblk"><span class="rupee fs12">â¹</span>${t.data.subscriptions[0].discountedPrice}</div>\n </div>`,"NEW"!==t.data.addresses[0].addressType&&(n=!0)),this.setState({productsData:{camera:e},subscriptions:[...t.data.subscriptions],address:[...t.data.addresses],transactionAmount:t.data.transactionAmount,isSubExist:s,infoText:i,render:!0,showInfoIcon:n,infoModalText:o})}else t.message===j.qO?r.push(`/${c.A.home_automation}/${j.oh}/add-camera`):e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}}componentDidMount(){const e=(0,he.u6)("ha"),{history:t}=this.props;if(!e)return void t.push(`/${c.A.home_automation}/${j.oh}/add-camera`);const{addCameraSession:s}=e;if(!s)return void t.push(`/${c.A.home_automation}/${j.oh}/add-camera`);const{orderUuid:a}=s;
1a?(this.getPageMetaData(),this.getSummaryData()):t.push(`/${c.A.home_automation}/${j.oh}/add-camera`)}render(){const{render:e,address:t,productsData:s,subscriptions:r,transactionAmount:i,formErrorMessage:n,showInfoIcon:o,infoModalText:l,pageMetaData:c}=this.state;if(!(c&&s&&t.length>0&&i&&e))return(0,v.jsx)(u.A,{});let d={},m=0;s.camera&&Array.isArray(s.camera)&&s.camera.length>0&&(d={name:s.camera[0].name||"",desc:"null"!==s.camera[0].description?s.camera[0].description:null,actualPrice:0!==s.camera[0].actualPrice?s.camera[0].actualPrice:null,sellPrice:0!==s.camera[0].discountedPrice?s.camera[0].discountedPrice:"FREE",qty:s.camera[0].newCount},m+=s.camera[0].actualPrice);const p=[];r&&Array.isArray(r)&&r.length>0&&r.forEach(e=>{p.push({name:e.friendlyName||"",desc:"null"!==e.description?e.description:null,actualPrice:e.actualPrice,packUom:e.uom,sellPrice:0!==e.discountedPrice?e.discountedPrice:"FREE"}),m+=e.actualPrice});const g=i,{history:f}=this.props;return(0,v.jsxs)(a.Fragment,{children:[!e&&(0,v.jsx)(u.A,{}),(0,v.jsx)("div",{className:"payment-summary-page",children:(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1})}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert inner-page wyze-wrap",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_WYZE_SUBSCRIPTION,activeStepper:"3"}),(0,v.jsx)(G,{history:f,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:c&&c.title}),(0,v.jsx)("h2",{className:"ha-heading2",children:`Includes subscription cost of ${d.qty} ${d.name}`})]}),(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-sm-xs summary posR",children:["NEW"!==t[0].addressType&&(0,v.jsx)("div",{className:"yellow-back-text morepara text-center",id:"moreinfo",style:{display:"block"},children:"These cameras will be added to the existing subscription for the selected address."}),(0,v.jsxs)(ot.A,{children:[(0,v.jsxs)(lt.A,{children:[(0,v.jsx)(mt,{priceData:d,qty:d.qty,source:"wyze"}),p.length>0&&p.map((e,t)=>(0,v.jsx)(mt,{priceData:e,source:"wyze-sub-add",showIcon:o,infoModalText:l,infoModalTitle:"Details of annual subscription",isDrawer:!0},t))]}),(0,v.jsxs)(ct.A,{className:"card-footer",children:[(0,v.jsx)("h2",{className:"ha-heading2 bold total-heading",children:"Total Amount"}),(0,v.jsx)("span",{className:"mB0 text-right",children:(0,v.jsxs)("span",{className:"price-lg mR0",children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),(0,v.jsx)("span",{className:"count",children:g||"00"})]})})]})]}),t.length>0&&(0,v.jsxs)("div",{className:"form-group field dateContr mT20",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Address"}),(0,v.jsx)("div",{className:"add-text",children:(0,he.FR)(t[0])}),(0,v.jsx)("span",{className:"validate",children:"Â "})," "]}),c&&c.note&&(0,v.jsxs)("p",{className:"mT20 fs14",children:[(0,v.jsxs)("span",{className:"bold",children:[c.note,": "]}),c.note_text]}),(0,v.jsx)("div",{className:"heading3 invalid-text text-center",children:n}),(0,v.jsxs)("div",{className:"fixed-btn cart-wrapper mT20 show text-center",children:[(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",href:"javascript:void(0)",onClick:()=>this.payNowHandler(),children:c&&c.btnTxt}),c&&(0,v.jsx)(b.A,{htmlContent:c.bottomInfoTxt})]})]})})]})]})})]})}}const ur=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),setStepAndUuidForPayment:(0,F.zH)(dt.Cn,e),updateS3Data:(0,F.zH)(dt.WX,e)}))(mr),hr=["hasErrors"];function pr(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function gr(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?pr(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):pr(Object(s)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class fr extends a.Component{constructor(...e){super(...e),this.initialForm={pinCode:{wrapperClasses:["form-group","pincode-field","more-connection-pincode"],labelConfig:{label:"Pin code",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"pinCode",type:"tel",placeholder:"",maxLength:6,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},location:{wrapperClasses:["form-group","location-field"],labelConfig:{label:"Location",classes:["sel","active","mendate"]},elementType:"select",elementConfig:{id:"location",placeholder:"",options:[{label:"select",value:""}]},value:"",errorMessage:"",valid:!0,touched:!1},building:{wrapperClasses:["form-group","building-field"],labelConfig:{label:"Building Name",classes:["sel","active"]},elementType:"input",elementConfig:{id:"building",type:"text",placeholder:"",maxLength:24,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine1:{wrapperClasses:["form-group","addr1-field"],labelConfig:{label:"Address Line 1",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"adrLine1",type:"text",placeholder:"",maxLength:75,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},adrLine2:{wrapperClasses:["form-group","addr2-field"],labelConfig:{label:"Address Line 2",classes:["sel","active"]},elementType:"input",elementConfig:{id:"adrLine2",type:"text",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},landmark:{wrapperClasses:["form-group","landmark-field"],labelConfig:{label:"Landmark",classes:["sel","active"]},elementType:"input",elementConfig:{id:"landmark",type:"text",placeholder:"",maxLength:25,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},city:{wrapperClasses:["form-group","city-field"],labelConfig:{label:"City",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"city",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},state:{wrapperClasses:["form-group","state-field"],labelConfig:{label:"State",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"state",type:"text",placeholder:"",maxLength:24,tabIndex:0,readonly:"readonly"},value:"",errorMessage:"",valid:!0,touched:!1},email:{wrapperClasses:["form-group","email-field"],labelConfig:{label:"Email",classes:["sel","active","mendate"]},elementType:"input",elementConfig:{id:"email",type:"email",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}},this.state={pageData:null,termsChecked:!0,showCheckError:!1,render:!0,infoForm:gr({},this.initialForm),formErrorMessage:null,button:{buttonConfig:{type:"submit",class:"wAutoLgBlue"},text:"Proceed to Summary",url:"select-language",disabled:!1}},this.bodyRef=a.createRef(),this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/add-cam-hualai.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,bottomTxt:e.field_json.bottom_txt,installationTxt:e.field_json.installation_txt,summaryTxt:e.field_json.summary_txt,termsTxt:e.body,pincodeErr:e.field_json.pincode_err,stateErr:e.field_json.state_err};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubsciberDetails=async()=>{const{setApiError:e}=this.props,t=JSON.parse(localStorage.userAuth),{subId:s}=t,a={subscriberId:s.id,source:"WEB"};try{const{data:t}=await f.n.postData("order/address/getAddress",a);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){this.setInfoForm(t.data);const e=t.data,{infoForm:s}=this.state,a=gr({},s),{city:r,pinCode:i,state:n}=a;r.value=e.city||"",i.value=e.areaPincode||"",n.value=e.state||"",this.setState({infoForm:a},()=>this.getPinCodeData(e.areaPincode))}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.setInfoForm=e=>{const{infoForm:t}=this.state,s=gr({},t),{adrLine1:a,adrLine2:r,city:i,email:n,pinCode:o,state:l,building:c,landmark:d,location:m}=s;a.value=e.streetAddress||"",r.value=e.streetAddress2||"",m.value=e.location||"",i.value=e.city||"",n.value=e.email||"",o.value=e.postalCode||"",l.value=e.state||"",c.value=e.building||"",d.value=e.landmark||"",e.termsChecked&&this.setState({termsChecked:e.termsChecked}),this.setState({infoForm:s,render:!0},()=>this.getPinCodeData(e.postalCode))},this.inputChangedHandler=(e,t)=>{const{infoForm:s}=this.state,a=gr({},s),{location:r}=a,i=gr({},a[t]);let n=e;"pinCode"===t&&(n=n.replace(/[^0-9]/g,""),n.length>6&&(n=n.slice(0,6)),6===n.length&&this.getPinCodeData(n,!0),n.length<6&&(r.elementConfig.options=[{label:"select",value:""}],r.value=null,this.setState({infoForm:a}))),i.value=n,i.touched=!0,i.valid=!0,i.errorMessage="",a[t]=i,this.setState({infoForm:a})},this.getPinCodeData=async e=>{const{setApiError:t}=this.props;if(e)try{const{data:t}=await f.n.getData(`payment/pincode/getPinDetailsByZipCode/${e}/Hualai`),{infoForm:s,pageData:a}=this.state,r=gr({},s),{city:i,pinCode:n,state:o,location:l}=r,c=t.data;if(c&&Array.isArray(c)&&c.length>0){if(o.value&&o.value!==c[0].state.trim())return n.valid=!1,n.errorMessage=a&&a.stateErr||"State is different",void this.setState({infoForm:r,render:!0});i.value=c[0].city.trim(),n.value=c[0].zipcode,n.valid=!0,o.value=c[0].state.trim();const e=c&&c.map(e=>({label:e.location,value:e.location}));l.elementConfig.options=[{label:"select",value:""},...e]}else n.valid=!1,n.errorMessage=a&&a.pincodeErr||"Apologies, currently we are unavailable in your city. We will be launching soon!";this.setState({infoForm:r,render:!0})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}else this.setState({render:!0})},this.validateForm=async e=>{this.setState({render:!1}),e.preventDefault();const{infoForm:t,termsChecked:s}=this.state,{history:a,setApiError:r}=this.props,i={},n=Object.keys(t);n.forEach(e=>{i[e]=t[e].value});const o=H(i),{hasErrors:l}=o,d=(0,I.A)(o,hr);if(l){const e=gr({},t);let s=null;
1n.forEach((t,a)=>{0===a&&(s=t);const r=d[`${t}Message`];r&&""!==r&&(e[t].valid=!1,e[t].errorMessage=r)}),this.setState({infoForm:e,formErrorMessage:"",render:!0}),s&&document.getElementById(s).scrollIntoView()}else{let e=!0;if(n.forEach(s=>{t[s].valid||(e=!1)}),e){if(this.gaCheckoutEvent(),!s)return void this.setState({showCheckError:!0,render:!0});const e=(0,he.u6)("ha"),{addCameraSession:{orderUuid:i}}=e,n={postalCode:t.pinCode.value.trim(),streetAddress:t.adrLine1.value.trim(),streetAddress2:t.adrLine2.value.trim(),city:t.city.value.trim(),landmark:t.landmark.value.trim(),location:t.location.value.trim(),email:t.email.value.trim(),state:t.state.value.trim(),building:t.building.value.trim(),addressType:"NEW",orderUuid:i,termsChecked:s},o={address:n,orderUuid:i,subscriptionId:null};try{const{data:s}=await f.n.postData("order/address/create/AddNewCamera",o);if(s.message===c.A.MESSAGES_TYPES.SUCCESS){e.addCameraSession.infoForm=n,(0,he.e)("ha",e);const t=JSON.parse(localStorage.userAuth),{subId:s}=t,r={event:"Proceed to Summary","Subscriber ID":s.id};(0,x.Sw)(r),a.push(`/${c.A.home_automation}/${j.oh}/add-camera-payment-summary`)}else{const e=s.message.charAt(0).toUpperCase()+s.message.slice(1).toLowerCase();t.pinCode.valid=!1,this.setState({infoForm:t,formErrorMessage:e,render:!0})}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||r(c.A.serverError,!0)}}}},this.gaCheckoutEvent=()=>{const{addCameraSession:{gaInfo:e,camCount:t}}=(0,he.u6)("ha");(0,x.Sw)({"Sub ID":(0,x.Xo)().id||null,"Type of Journey":"HA-Secure -Add Camera",event:"checkout",ecommerce:{checkout:{actionField:{step:2,option:"Customer Details"},products:[{name:"Tata Play Secure",id:e.id,price:e.price,brand:"Tata Play",category:"Home Automation",variant:"Hualai",quantity:t,productName:`${e.productName},${e.packname}`}]}}})},this.inputCheckHandler=()=>{const{termsChecked:e,showCheckError:t}=this.state;this.setState({termsChecked:!e},()=>{const{termsChecked:e}=this.state;e&&t&&this.setState({showCheckError:!1})})}}async componentDidMount(){this.bodyRef.current&&this.bodyRef.current.scrollTo(0,0);const{history:e}=this.props,t=(0,he.u6)("ha");if(t){const{addCameraSession:s}=t;s||e.push(`/${c.A.home_automation}/${j.oh}/add-camera`)}else e.push(`/${c.A.home_automation}/${j.oh}/add-camera`);await this.getPageData();const{addCameraSession:{infoForm:s}}=t;s&&""!==s.postalCode?(this.setState({render:!1}),this.setInfoForm(s)):this.getSubsciberDetails()}render(){const{button:e,infoForm:t,render:s,formErrorMessage:r,termsChecked:i,showCheckError:n,pageData:o}=this.state,{history:l}=this.props,c=[];return Object.keys(t).forEach(e=>{c.push({id:e,config:t[e]})}),(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{ref:this.bodyRef,children:[!s&&(0,v.jsx)(u.A,{}),(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_WYZE_SUBSCRIPTION,activeStepper:"2"}),(0,v.jsx)(G,{history:l,type:"history_back"}),(0,v.jsxs)("div",{className:"main-container",children:[o&&(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"ha-heading1 gradient",children:o.title})}),(0,v.jsx)("div",{className:"innercontainer-sm-xs",children:(0,v.jsx)("div",{className:"yellow-back-text text-center",children:o.summaryTxt})})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"innercontainer-xs install-wrapp order-addr-form",children:[(0,v.jsx)("div",{className:"orderttl",children:o&&o.installationTxt}),c&&c.map(e=>(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)},e.id)),o&&(0,v.jsxs)("div",{className:"mT32 text-center",children:[(0,v.jsx)("input",{type:"checkbox",className:"filled-in form-check-input",id:"checkbox1",checked:i?"checked":"",onClick:()=>this.inputCheckHandler()}),(0,v.jsx)(b.A,{Tag:"label",className:"form-check-label fs12",htmlFor:"checkbox1",htmlContent:o.termsTxt})]}),n&&(0,v.jsx)("span",{className:"validate invalid-text",style:{marginTop:"10px"},children:"This field is required"})]}),(0,v.jsxs)("div",{className:"btn-contr text-center more-connection-btn",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text",children:r}),(0,v.jsx)(R.A,{disabled:e.disabled,config:e.buttonConfig,content:e.text,onClick:e=>this.validateForm(e)})]})]}),(0,v.jsx)("div",{className:"text-center order-note",children:o&&o.bottomTxt})]})]})]})})]})})}}const xr=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),openModal:(0,F.zH)(U.qf,e)}))(fr);function br(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function vr(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?br(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):br(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class yr extends a.Component{constructor(...e){super(...e),this.state={render:!0,activeSlot:null,startDate:null,startTime:ne()((new Date).getTime()),slotTime:{wrapperClasses:["form-group","custom-Select-Arrow","slot-field"],labelConfig:{label:"Installation Time",classes:["sel","active"]},elementType:"customSelect",elementConfig:{options:[],placeholder:"Select time",maxLength:null,tabIndex:0,readonly:"readonly"},value:null,errorMessage:null,valid:!0,touched:!1},slotList:null,teamId:null,taskId:null,address:null,allowedDays:2,pageData:null,paymentStatus:null,disableSubmit:!1},this.getPaymentStatusResponse=async()=>{const{setPaymentAwaitedData:e,history:t,setApiError:s}=this.props,{callTime:a}=this.state,r=(0,he.u6)("ha");try{a>3&&this.clearTimer();const{addCameraSession:{orderUuid:e}}=r,i={INPROGRESS:`${j.oh}/payment-awaited`,FAIL:`${j.oh}/payment-failure`,INITIATE:`${j.oh}/add-camera`},{data:n}=await f.n.getData(`order/getOrderPaymentStatusByUuid/${e}`);if(n.message===c.A.MESSAGES_TYPES.SUCCESS){const e=n.data;if(!e&&!Object.isArray(e)&&e.length<=0)return void s(c.A.serverError,!0);const a=[];e.forEach(e=>{a.push({name:e.name,id:e.paymentTransactionId,price:e.discountPrice,brand:"Tataplay",category:"Ecommerce",quantity:e.count,PayementType:e.paymentMethod})});const r={event:"PaymentSuccess",ecommerce:{purchase:{actionField:{id:e[0].haId,revenue:"",tax:""},products:a}}};(0,x.Sw)(r);const o=e[0].paymentStatus;"INPROGRESS"===o?((0,he.VJ)(j.QZ.AWAITED,"ADD_CAM"),t.push(`/${c.A.home_automation}/${i.INPROGRESS}`)):"FAIL"===o?((0,he.VJ)(j.QZ.FAILURE,"ADD_CAM"),this.clearTimer(),t.push(`/${c.A.home_automation}/${i.FAIL}`)):"INITIATE"===o?(this.clearTimer(),t.push(`/${c.A.home_automation}/${i.INITIATE}`)):((0,he.VJ)(j.QZ.SUCCESS,"ADD_CAM"),this.clearTimer(),this.setState({paymentStatus:e[0],render:!0}))}else s(c.A.serverError,!0);this.setState({callTime:a+1})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||s(c.A.serverError,!0)}},this.clearTimer=()=>{const{timerId:e}=this.state;""!==e&&(clearInterval(e),this.setState({render:!0,callTime:1}))},this.getPaymentStatus=async()=>{const e=setInterval(function(){this.getPaymentStatusResponse()},2e3);this.setState({timerId:e})},this.getPageData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-buy-paymentsuccess.json");if(t.status===c.A.MESSAGES_TYPES.SUCCESS){const e=t.data,s={title:e.title,btnTxt:e.field_json.button_text,subTitle:e.field_subtitle};this.setState({pageData:s})}else e(c.A.serverError,!0)}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.getAddress=async()=>{const{setApiError:e}=this.props;try{const e=(0,he.u6)("ha"),{addCameraSession:{orderUuid:t}}=e,{data:s}=await f.n.getData(`order/getAddNewCameraSummaryByUuid/${t}`);let a=null;if(s.message===c.A.MESSAGES_TYPES.SUCCESS){const e=s.data,{addresses:t}=e;t&&Array.isArray(t)&&t.length>0&&(a=(0,he.FR)(t[0]))}this.setState({address:a},()=>(0,gt.A)())}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.redirectToDestination=e=>{const{history:t}=this.props;t.push(`/${c.A.home_automation}/${e}`)},this.handleDateChange=e=>{const{slotTime:t}=this.state,s=t;s.value=null,this.setState({startDate:e,render:!1,disableSubmit:!1,slotTime:s},()=>this.getSlots())},this.getSlots=async e=>{const{setApiError:t}=this.props,{startDate:s,slotTime:a}=this.state,{addCameraSession:r}=(0,he.u6)("ha"),i=e?new Date:s,n={orderUuid:r.orderUuid,slotStartDate:ne()(i).format("DD-MM-YYYY"),provider:"Hualai"};try{const{data:t}=await f.n.postData("order/get-slots/",n);if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const s=[],{slotSuggestions:r,ocsFlag:i}=t.data;let n=0;if("N"===i||""===i?n=2:"Y"===i&&(n=29),e)this.setState({allowedDays:n,render:!0});else{r&&Array.isArray(r)&&r.length>
10&&r.forEach(e=>{const t=ne()(e.start).format("LT"),a=ne()(e.end).format("LT");s.push({label:`${t} - ${a}`,value:`${ne()(e.start).format("HH:mm:ss")}-${ne()(e.end).format("HH:mm:ss")}`})});const e=vr({},a);e.elementConfig.options=s,e.errorMessage="",e.valid=!0,this.setState({slotList:s,slotTime:e,teamId:t.data.teamId,taskId:t.data.taskId,allowedDays:n,render:!0})}}else{let s=2;if(t.data){const{ocsFlag:e}=t.data;"N"===e||""===e?s=2:"Y"===e&&(s=29)}if(e)this.setState({allowedDays:s,render:!0});else{const e=vr({},a);e.elementConfig.options=[],e.value=null,e.errorMessage="No slots available! Please select another date.",e.valid=!1,this.setState({slotList:null,slotTime:e,teamId:null,taskId:null,allowedDays:s,render:!0})}}}catch(e){e&&e.response&&[401,409].includes(e.response.status)||t(c.A.serverError,!0)}},this.handleTimeChange=e=>{const{slotTime:t}=vr({},this.state);t.value=e,t.touched=!0,t.valid=!0,t.errorMessage=null,this.setState({slotTime:t,formError:""})},this.handleSubmit=async()=>{this.setState({disableSubmit:!0});const{slotTime:e,teamId:t,taskId:s,startDate:a}=this.state,{history:r,setApiError:i}=this.props;if(null===e.value){const t=vr({},e);return t.valid=!1,t.errorMessage="Please select a slot.",void this.setState({slotTime:t,formError:"",disableSubmit:!1})}const n=(0,he.u6)("ha"),{addCameraSession:{orderUuid:o}}=n,l=ne()(a).format("DD-MM-YYYY"),d={teamId:t,taskId:s,orderUuid:o,slot:{start:`${l} ${e.value.split("-")[0]}`,end:`${l} ${e.value.split("-")[1]}`}};try{const{data:e}=await f.n.postData("order/confirm-slots/",d);!0===e.status?r.push(`/${c.A.home_automation}/${j.oh}/add-camera-booking-success`):r.push(`/${c.A.home_automation}/${j.oh}/booking-failure`)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||i(c.A.serverError,!0)}},this.handleDateChangeRaw=e=>{e.preventDefault()}}async componentDidMount(){const{history:e}=this.props,t=(0,he.u6)("ha");if(!t)return void e.push(`/${c.A.home_automation}/${j.oh}/add-camera`);const{addCameraSession:s}=t;s?(await this.getPaymentStatus(),this.getPageData(),this.getAddress(),this.get
1Slots(!0)):e.push(`/${c.A.home_automation}/${j.oh}/add-camera`)}componentWillUnmount(){this.clearTimer()}render(){const{startDate:e,slotTime:t,address:s,render:r,allowedDays:i,pageData:n,paymentStatus:o,activeSlot:l,disableSubmit:c}=this.state;if(!r)return(0,v.jsx)(u.A,{});const d={option:e=>vr(vr({},e),{},{fontSize:"14px"})};return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container schedul-install bottompadd gs-alert wyze-wrap",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_WYZE_SUBSCRIPTION,activeStepper:"4"}),(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsxs)("div",{className:"animation mB30",children:[(0,v.jsx)("canvas",{id:"canvas",width:"1390",height:"969"}),(0,v.jsx)("div",{id:"confettiAnimate",className:"ready",children:(0,v.jsx)("div",{className:"message",children:(0,v.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 13 11",children:(0,v.jsx)("polyline",{stroke:"currentColor",points:"1.4,5.8 5.1,9.5 11.6,2.1 "})})})}),(0,v.jsx)("div",{className:"svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",className:"",style:{position:"relative",top:"10px",left:"-10px",marginBottom:"20px"},"data-wow-delay":"0.8s",children:[(0,v.jsx)("circle",{className:"path circle",fill:"#ffffff",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})})]}),(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:n&&n.title}),(0,v.jsx)("h2",{className:"ha-heading2 mT30",children:n&&n.subTitle}),o&&o.haId&&(0,v.jsx)("div",{className:"id-text bold",children:`Your Order ID is:${o.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-xs pB0",children:[(0,v.jsxs)("div",{className:"fullwidth mT30 text-left",children:[(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Date"}),(0,v.jsx)(yt(),{dateFormat:"DD MMMM YYYY",selected:e,placeholderText:"Select date",onChange:e=>this.handleDateChange(e),minDate:ne()(),maxDate:ne()().add(i,"days"),onChangeRaw:e=>this.handleDateChangeRaw(e)}),(0,v.jsx)("span",{className:"validate",children:"Â "})]}),(0,v.jsx)("div",{className:"form-group field-time",children:(0,v.jsx)($.A,{labelConfig:t.labelConfig,elementType:t.elementType,elementConfig:t.elementConfig,value:t.value,valid:t.valid,errorMessage:t.errorMessage,touched:t.touched,wrapperClasses:t.wrapperClasses,changed:e=>this.handleTimeChange(e),customProps:{menuPortalTarget:document.body,menuPosition:"fixed",styles:d}},"slot")}),(0,v.jsxs)("div",{className:"form-group field dateContr",children:[(0,v.jsx)("label",{className:"sel",children:"Installation Address"}),(0,v.jsx)("div",{className:"add-text",children:s}),(0,v.jsx)("span",{className:"validate",children:"Â "})]})]}),(0,v.jsxs)("div",{className:"fixed-btn cart-wrapper mT20 show",children:[!c&&(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",href:"javascript:void(0)",onClick:()=>this.handleSubmit(),disabled:c,children:n&&n.btnTxt}),c&&(0,v.jsx)("button",{type:"button",className:"btn btn-primary btn-height waves-effect waves-light btn-resfull",disabled:c,children:n&&n.btnTxt})]})]})]})]})})]})}}const Sr=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e),setPaymentAwaitedData:(0,F.zH)(dt.Qm,e)}))(yr),jr=(0,l.Ng)(null,e=>({setApiError:(0,F.zH)(g.x8,e)}))(e=>{const[t,s]=(0,a.useState)({address:null,date:null,time:null,haId:null,count:null,name:null}),[r,i]=(0,a.useState)(null),{history:n,setApiError:o}=e,l=(0,he.u6)("ha"),{addCameraSession:{orderUuid:d}}=l;return(0,a.useEffect)(()=>{l||n.push(`/${c.A.home_automation}/${j.oh}/add-camera`);const{addCameraSession:e}=l;e||n.push(`/${c.A.home_automation}/${j.oh}/add-camera`),(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/add-camera-installation-booked.json");if(e.status===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data;i({title:t.title,subtitle:t.field_subtitle,btnText:t.field_json.button_text,installationText:t.field_json.installation_text,installationImg:t.field_image})}else o(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||o(c.A.serverError,!0)}})(),(async()=>{try{const{data:e}=await f.n.getData(`payment/workorder/getDetailsByUuid/${d}`);if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const t=e.data,{workOrderDTOS:a}=t;(!a||0===Object.keys(a).length&&a.constructor===Object)&&dispatch(o(c.A.serverError,!0));const r=(0,he.FR)(t.addresses),i=ne()(a.woSlotEndTime).format("MMMM DD, YYYY"),n=`${ne()(a.woSlotStartTime).format("LT")}
1 - ${ne()(a.woSlotEndTime).format("LT")}`;s({address:r,date:i,time:n,haId:t.haId,name:t.name,count:t.count}),(0,x.Sw)({event:"Relocation Request Submitted","Subscriber ID":t.subId,"Order ID":t.haId})}else o(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||o(c.A.serverError,!0)}})()},[]),r&&t.haId&&t.address&&t.date&&t.time?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlySecureLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container order-detail gs-alert wyze-wrap",children:(0,v.jsxs)("div",{className:"container",children:[(0,v.jsx)(Ae.A,{isSticky:!1,stepperList:j.CB.HA_WYZE_SUBSCRIPTION,activeStepper:"4"}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)("div",{className:"posR svg-icon-right",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})}),(0,v.jsxs)("div",{className:"heading-md",children:[r&&(0,v.jsx)("h1",{className:"ha-heading1 gradient mB0",children:r.title}),(0,v.jsx)("div",{className:"id-text bold",children:`Order ID: ${t.haId}`})]}),(0,v.jsxs)("div",{className:"body-container innercontainer-sm pB0",children:[(0,v.jsx)("div",{className:"saf-installationwrapp",children:r&&(0,v.jsxs)("div",{className:"certified-wrapp",children:[(0,v.jsx)("div",{children:(0,v.jsx)("span",{className:"icon",children:(0,v.jsx)("img",{src:c.A.NODE_API_ROOT+r.installationImg.url,alt:r.installationImg.alt,className:"img-fluid"})})}),(0,v.jsx)("div",{children:r.installationText})]})}),(0,v.jsxs)("div",{className:"insta-blk-wrapp",children:[r&&(0,v.jsx)("div",{className:"insta-blk-text bold",children:r.subtitle}),(0,v.jsxs)("div",{className:"insta-blk",children:[(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("div",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/date-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:t.date})]}),(0,v.jsxs)("div",{className:"insta-icon-wrapp",children:[(0,v.jsx)("span",{className:"insta-icon",children:(0,v.jsx)("img",{src:"/assets/images/time-icon.svg",alt:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"fs14",children:t.time})]}),(0,v.jsx)("div",{className:"insta-icon-wrapp mR0",style:{width:"100%"},children:(0,v.jsx)("div",{className:"inst-add-contr fs14",children:`Address: ${t.address}`})}),(0,v.jsx)("div",{className:"insta-icon-wrapp mR0",children:(0,v.jsx)("div",{className:"fs14",children:`Qty: ${t.count} ${t.name}`})})]})]}),(0,v.jsx)("div",{className:"footer-contr text-center mT20 block",children:(0,v.jsx)("a",{className:"btn btn-primary btn-height waves-effect waves-light",href:"javascript:void(0)",onClick:()=>{var e;e=`/${c.A.home_automation}/${j.oh}`,(0,x.Sw)({event:"Back to Home"}),n.push(e)},children:r.btnText})})]})]})]})})]}):(0,v.jsx)(u.A,{})});function Ar(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}class Nr extends a.Component{constructor(...e){super(...e),this.state={title:null,rechargeText:null,rechargePreText:null,activeBtnTxt:null,rechargeBtnTxt:null,camImage:null,render:!1,subscriptionList:null,inactiveSubscriptionList:null,pendingSubscriptionList:null,canceledSubscriptionList:null,encSubId:null,detailsText:null,pendingText:null,cameraName:null},this.checkHaUser=async()=>{const{setApiError:e,openModal:t,history:s}=this.props,{subId:a}=JSON.parse(localStorage.userAuth),r={subscriberId:a.id,source:"HA",provider:"Hualai"};try{const{data:e}=await f.n.checkHaUser(r);if(e.message!==c.A.MESSAGES_TYPES.SUCCESS&&!1===e.status)return t(L.lx.COMMON_MODAL,{Component:Ne,data:{title:"Not a valid user! ",body:"We see your account is not val
1id for this service. Request you to login with a different account",showRecharge:!1,redirectUrl:"/my-account"},onCloseEvent:()=>{const{history:e}=this.props;e.push("/my-account")},history:s}),this.setState({render:!0}),!1}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}return!0},this.getPageMetaData=async()=>{const{setApiError:e}=this.props;try{const{data:t}=await f.n.getJsonData("s3-api/v1/assets/pages/hualai-subscription-details.json");if(t.message===c.A.MESSAGES_TYPES.SUCCESS){const e=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?Ar(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Ar(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},t.data);this.setState({title:e.title,camImage:e.field_image,rechargeText:e.field_json.text,activeBtnTxt:e.field_json.activate_button,rechargeBtnTxt:e.field_json.recharge_button,rechargePreText:e.field_json.recharge_pretext,detailsText:e.field_json.details_text,pendingText:e.field_json.pending_text,cameraName:e.field_json.camera_name})}else e(c.A.serverError,!0),this.setState({render:!0})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}}
1,this.getSubscriptionData=async()=>{const{setApiError:e}=this.props;try{const t=JSON.parse(localStorage.userAuth),{subId:s,subscriberIds:a,encSubscriberId:r}=t,i={subscriberId:s.id,provider:"Hualai"},{data:n}=await f.n.postData("order/relocationDetails",i);if(n.status||(e(c.A.serverError,!0),this.setState({render:!0})),n.message===c.A.MESSAGES_TYPES.SUCCESS){const{active:e,inactive:t,pending:i,cancel:o}=n.data,l={},c={},d={},m={};let u=null;e&&Array.isArray(e)&&e.length>0&&e.forEach(e=>{l[e.subscriptionId]=e}),t&&Array.isArray(t)&&t.length>0&&t.forEach(e=>{c[e.subscriptionId]=e}),i&&Array.isArray(i)&&i.length>0&&i.forEach(e=>{d[e.subscriptionId]=e}),o&&Array.isArray(o)&&o.length>0&&o.forEach(e=>{m[e.subscriptionId]=e});const h={};a.forEach((e,t)=>{h[e]=r[t]}),u=h[s.id],this.setState({subscriptionList:l,inactiveSubscriptionList:c,pendingSubscriptionList:d,canceledSubscriptionList:m,encSubId:u},()=>{this.setState({render:!0})})}else e(c.A.serverError,!0),this.setState({render:!0})}catch(t){t&&t.response&&[401,409].includes(t.response.status)||e(c.A.serverError,!0)}},this.redirectToSelectAddress=async e=>{this.setState({render:!1});try{const{history:t}=this.props,{subscriptionList:s}=this.state,{address:a,cameraCount:r,name:i}=s[e],n=JSON.parse(localStorage.userAuth),{subId:o}=n,l={subId:o.id,count:r,name:i,subscriptionId:e,provider:"Hualai"},{data:d}=await f.n.postData("order/createRelocationOrder",l);if(d.message===c.A.MESSAGES_TYPES.SUCCESS){this.setState({render:!1});const{orderUuid:s}=d.data,r=(0,he.u6)("ha"),i={address:a,subscriptionId:e,orderUuid:s};r?(r.relocate_session=i,(0,he.e)("ha",r)):(0,he.e)("ha",{relocate_session:i}),t.push(`/${c.A.home_automation}/select-relocation-address`)}else this.setState({render:!0})}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}}}async componentDidMount(){(0,x.NP)("Renew your CCTV Subscription Plan Online | Tata Play Secure","Renew your Tata Play Secure Subscription for home & office security needs. You can access new offerings and extra features with Tata Plan Secure packages renewal.");
1await this.checkHaUser()&&(this.getPageMetaData(),this.getSubscriptionData())}componentWillUnmount(){(0,x.Cq)('"Renew your CCTV Subscription Plan Online | Tata Play Secure"')}render(){const{history:e,errorCode:t}=this.props,{title:s,camImage:a,render:r,encSubId:i,rechargeText:n,rechargeBtnTxt:l,detailsText:d,pendingText:m,rechargePreText:p,subscriptionList:g,inactiveSubscriptionList:f,pendingSubscriptionList:x,canceledSubscriptionList:b,cameraName:y}=this.state,{userType:S}=!c.A.isServer()&&(JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||""),j=S&&"HA"===S?`${c.A.home_automation}/my-account`:`${c.A.my_account_path}`;return r?t||!g&&t?(0,v.jsx)(o.A,{}):(0,v.jsxs)("div",{className:"ipl_event wyze-wrap",children:[(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)("div",{className:"content-container pay-succes gs-alert wyze-wrap",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsx)(G,{history:e,destination:j,excludeHa:!0}),(0,v.jsx)("div",{className:"heading-md ",style:{marginBottom:"24px"},children:(0,v.jsx)("h1",{className:"ha-heading1 gradient heading-mob",children:s})}),(0,v.jsx)("div",{className:"innercontainer-sm",children:(0,v.jsxs)("div",{className:"select-relocation-wrapp mT30",children:[g&&Object.keys(g).map(e=>(0,v.jsx)(ia,{camImage:a,address:g[e].address,count:g[e].cameraCount,date:g[e].endDate,name:g[e].name,packName:g[e].packName,packPrice:g[e].packPrice,packType:g[e].packType,subscriptionId:e,rechargeText:n,rechargeBtnTxt:l,status:"Active",encSubId:i,uom:g[e].uom,detailsText:d},e)),f&&Object.keys(f).map(e=>(0,v.jsx)(ia,{camImage:a,address:f[e].address,count:f[e].cameraCount,date:f[e].endDate,name:f[e].name,packName:f[e].packName,packPrice:f[e].packPrice,packType:f[e].packType,subscriptionId:e,rechargeText:n,rechargeBtnTxt:l,status:"Inactive",encSubId:i,uom:f[e].uom,detailsText:d,rechargePreText:p},e)),x&&Object.keys(x).map(e=>(0,v.jsx)(ia,{camImage:a,address:x[e].address,name:x[e].name||y,subscriptionId:e,status:"Pending Activation",detailsText:m},e)),b&&Object.keys(b).map(e=>(0,v.jsx)(ia,{count:b[e].cameraCount,camImage:a,address:b[e].address,name:b[e].name||y,subscriptionId:e,status:"Cancelled",detailsText:m,date:b[e].endDate},e))]})})]})})})]}):(0,v.jsx)(u.A,{})}}const Cr=(0,l.Ng)(e=>({errorCode:e.commonReducer.errorCode}),e=>({setApiError:(0,F.zH)(g.x8,e),openModal:(0,F.zH)(U.qf,e)}))(Nr);var wr=s(25242),_r=s(31941);const Er=e=>{const t=[];return w()(e.active)||t.push({status:"Active",haBoxData:e.active}),w()(e.inactive)||t.push({status:"InActive",haBoxData:e.inactive}),w()(e.pending)||t.push({status:"Pending",haBoxData:e.pending}),w()(e.cancel)||t.push({status:"Cancelled",haBoxData:e.cancel}),t},Tr=e=>{if(!e)return"";const t=e.building&&""!==e.building?`${e.building}, `:"",s=e.streetAddress&&""!==e.streetAddress?`${e.streetAddress}, `:"",a=e.streetAddress2&&""!==e.streetAddress2?`${e.streetAddress2}, `:"",r=e.city&&""!==e.city?`${e.city}, `:"",i=e.state&&""!==e.state?`${e.state}-`:"",n=e.postalCode&&""!==e.postalCode?`${e.postalCode}`:"";return`${t}${s}${a}${e.landmark&&""!==e.landmark?`${e.landmark}, `:""}${e.location&&""!==e.location?`${e.location}, `:""}${r}${i}${n}`};const Dr=function(e){const{status:t,boxInfo:s,boxType:r,boxData:i}=e,[n,o]=(0,a.useState)(null),{manifest:d}=(0,l.d4)(e=>e.commonReducer),m=new Date(s.endDate).toLocaleString("en-US",{month:"short",day:"numeric",year:"numeric"});return(0,a.useEffect)(()=>{(()=>{const e=new Date,t=new Date(s.endDate),a=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),r=Date.UTC(t.getFullYear(),t.getMonth(),t.getDate());let i=Math.floor((r-a)/864e5);i<4&&i>=0&&(i=0===i?1:i,o(i))})()},[]),(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{className:"smartalertcard-wrapp",children:[(0,v.jsxs)("div",{className:"mB10 text-center fs16 bold",children:["Subscriber ID:"," ",(0,x.Xo)().id]}),(0,v.jsx)("p",{className:"text-center mB30 fs14",children:Tr(s.address)}),(0,v.jsx)("div",{className:"card-sm mB10 amount-month-wrapp",children:(0,v.jsxs)("div",{className:"card-body",children:[(0,v.jsx)("div",{className:"logo-contr",children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${"SECURE"===r?i.secure_image:i.securePlus_image}`})}),(0,v.jsxs)("div",{className:"status-check",children:[(0,v.jsxs)("p",{className:"bold d-flex align-items-center fs14",children:[s.uom?"Monthly"===s.uom?"Monthly Subscription":"Annual Subscription":null," ",(0,v.jsxs)("span",{className:"camare-no",children:[(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${"SECURE"===r?i.secureCamera_image:i.secureCameraPlus_image}`,height:"15px",className:"left5"})," ",`${s.cameraCount} ${i.cameraText}`]})]}),["Pending","Cancelled"].includes(t)?(0,v.jsx)("span",{className:"inactivecamera",style:{fontFamily:"VoltePlay-Medium,sans-serif",fontSize:"14px",color:"red",position:"relative",marginTop:"-11px"},children:t}):null]}
1),(0,v.jsxs)("div",{className:"information-details mT10 account-details",children:[(0,v.jsx)("div",{className:"img-contr",children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${"SECURE"===r?i.secureMini_image:i.securePlusMini_image}`})}),(0,v.jsxs)("div",{className:"text-contr",children:[(0,v.jsxs)("div",{className:"info-details-card",children:[i&&i.total_charge_text&&(0,v.jsx)("div",{className:"label",children:i.total_charge_text}),s&&s.packPrice?(0,v.jsxs)("div",{className:"data leadTxt text-left",children:[" ",(0,v.jsx)("span",{className:"rupee fs18",children:"â¹"}),(0,v.jsx)("span",{className:"count bold ",children:s.packPrice}),(0,v.jsx)("span",{className:"small",children:"Monthly"===s.uom?"/month":"/year"})]}):(0,v.jsx)("div",{className:"data leadTxt text-center",children:"-"})]}),(0,v.jsxs)("div",{className:"info-details-card",children:[i&&i.recharge_due_text&&(0,v.jsx)("div",{className:"label",children:i.recharge_due_text}),(0,v.jsx)("div",{className:"data leadTxt "+(s&&s.endDate?("InActive"===t||"Active"===t&&n?"invalid-text":"")+" text-left":"text-center"),children:s&&s.endDate?m:"-"})," "]})]})]}),"InActive"===t||"Active"===t&&n?(0,v.jsx)("div",{className:"text-center",children:(0,v.jsxs)("button",{onClick:()=>(async()=>{(0,x.Sw)({event:"Recharge - Secure","Sub ID":(0,x.Xo)().id||null});const e={subId:(0,x.Xo)().id,uom:s&&s.uom,cameraCount:s&&s.cameraCount,packType:s&&s.packType,provider:"SECURE"===r?"Hualai":"Google"};(0,x.y1)("HA",e)})(),type:"button",className:"btn btn-primary mT10 d-inline-flex align-items-center waves-effect waves-light",children:[(0,v.jsx)("img",{alt:"recharge-img",src:`${c.A.NODE_API_ROOT}${i.recharge_btn_Image}`,className:"mR10",height:"20"}),i&&i.recharge_btn_text]})}):null]})})]})})};const Or=function(e){const{modalParameters:{data:{logoutFunction:t,title:s,subTitle:a}}}=e;return(0,v.jsx)("div",{id:"notAValidUser",children:(0,v.jsxs)("div",{className:"text-center",children:[(0,v.jsxs)("div",{className:"heading-sm",children:[s&&(0,v.jsx)("h2",{className:"ha-heading1 gradient",children:s}),a&&(0,v.jsx)("h3",{className:"heading2",children:a})]}),(0,v.jsx)("div",{className:"btn-contr text-center",children:(0,v.jsxs)("button",{className:"MuiButtonBase-root MuiButton-root MuiButton-text animated1 fadeIn1 btn btn-primary",tabIndex:"0",type:"button",onClick:()=>t(),children:[(0,v.jsx)("span",{className:"MuiButton-label",children:"Ok"}),(0,v.jsx)("span",{className:"MuiTouchRipple-root"})]})})]})})};const kr=function(e){const{history:t,modalParameters:{data:{cameraList:s,title:r,handleRender:i}}}=e,n=(0,l.wA)(),[d,m]=(0,a.useState)(""),[h,p]=(0,a.useState)(!1),[f,b]=(0,a.useState)({}),{errorCode:y,manifest:S}=(0,l.d4)(e=>e.commonReducer),[j,A]=(0,a.useState)(!1),N=e=>{m(e),A(!0)};return(0,a.useEffect)(()=>{(async()=>{const e={apiPath:(0,x.th)("select_camera_modal",S)};try{const t=(await q.n.fetchData(e)).data;if(t.status===c.A.MESSAGES_TYPES.S3_SUCCESS){if(t.data){const e=t.data&&t.data.field_json_data;b(e),p(!0)}}else p(!0),n((0,g.x8)(c.A.serverError,!0))}catch(e){console.log(e),p(!0),n((0,g.x8)(c.A.serverError,!0))}})()},[]),h&&f?y||!h&&!f?(0,v.jsx)(o.A,{}):(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{className:"heading-sm text-center mB20",children:f&&f.title_text&&(0,v.jsx)("h2",{className:"heading1 gradient",children:f.title_text})}),(0,v.jsx)("div",{className:"innercontainer-sm",children:(0,v.jsxs)("div",{className:"radio-button",children:[(0,v.jsx)("div",{onClick:()=>N("SECURE"),className:"card-sm "+("SECURE"===d?"sel":""),children:(0,v.jsxs)("div",{className:"card-body",children:[(0,v.jsx)("input",{className:"form-check-input",checked:"SECURE"===d,name:"SECURE",type:"radio",value:"SECURE",id:"SECURE"}),(0,v.jsxs)("label",{className:"form-check-label d-flex align-items-center",htmlFor:"SECURE",children:[(0,v.jsx)("div",{className:"img-contr mR20",children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${f&&f.secure.camera_image}`})}),(0,v.jsxs)("div",{className:"text-contr",children:[(0,v.jsx)("div",{className:"logo-contr mB5",children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${f&&f.secure.title_image}`})}),(0,v.jsx)("p",{children:f&&f.secure.secure_title})]})]})]})}),(0,v.jsx)("div",{className:"card-sm "+("SECURE_PLUS"===d?"sel":""),onClick:()=>N("SECURE_PLUS"),children:(0,v.jsxs)("div",{className:"card-body",children:[(0,v.jsx)("input",{className:"form-check-input",checked:"SECURE_PLUS"===d,name:"SECURE_PLUS",type:"radio",value:"SECURE_PLUS",id:"SECURE_PLUS"}),(0,v.jsxs)("label",{className:"form-check-label d-flex align-items-center",htmlFor:"SECURE_PLUS",children:[(0,v.jsx)("div",{className:"img-contr mR20",children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}/${f&&f.securePlus.camera_image}`})}),(0,v.jsxs)("div",{className:"text-contr",children:[(0,v.jsx)("div",{className:"logo-contr mB5",children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}/${f&&f.securePlus.title_image}`})}),(0,v.jsx)("p",{children:f&&f.securePlus.secure_plus_title})]})]})]})})]})}),(0,v.jsx)("div",{className:"text-center btn-full mT32",style:j?{display:"block"}:{display:"none"},onClick:e=>(e=>{i(!1);const a=s.find(e=>e.tabTitle==d),n=x.Fr.Android(),o=x.Fr.iOS(),l=(0,x.cX)(),c=n?"android":o||l?"ios":"desktop",m=a.field_data.find(e=>e.title===r);(0,x.Sw)({event:"Proceed - Secure","camera name":"SECURE"===d?"TP secure":"Nest Cam"}),setTimeout(()=>{const s="desktop"===c?`${m.link}`:`${m[`${c}_link`]}`;["Manage devices","Get Help"].includes(r)?(0,x.nE)(e,t,s):t.push(`${s}`)},1e3)})(e),children:(0,v.jsx)("button",{className:"btn btn-primary waves-effect waves-light",type:"button",children:f&&f.button_text})})]}):(0,v.jsx)(u.A,{})};function Pr(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Ir(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Pr(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Pr(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const Mr={openModal:U.qf,closeModal:U.Oo,userSoftLogin:Fe.Jj,setApiError:g.x8};class $r extends a.Component{constructor(...e){super(...e),this.state={render:!1,accountDetail:{},options:[],selectedSubId:null,pageData:{},userName:"",eventsData:[],packTransformedData:[],previewMode:!1,activeTabData:[],accButtons:[],btnText:"",enrollToastMsg:"",secureData:{},secureMsg:[],camera:[],secureBoxData:[],securePlusBoxData:[]},this.componentDidMount=async()=>{const{history:e}=this.props,{userType:t}=!c.A.isServer()&&(JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||"");(0,x.wR)(!0)?t&&"HA"!==t?e.push(`/${c.A.my_account_path}`):(this.fetchData(),this.getHaEventData()):e.push(`/${c.A.my_account_path}/login`)},this.getHaEventData=async()=>{const{manifest:e}=this.props,t={apiPath:`${`${c.A.NODE_API_ROOT}/dth/read/core-api/eventsha`}/${ne()((0,ie.now)()).format("DDMMYYYY")}`};try{const e=(await wr.T.fetchData(t)).data;if(e&&e.status===c.A.MESSAGES_TYPES.S3_SUCCESS){let t=[];e.data&&e.data.length>0&&(t=e.data),this.setState({eventsData:t},()=>this.transformPack())}else if(e.data&&(e.data.length<0||Object.keys(e.data).length<0)){const e=[];this.setState({eventsData:e})}else{const e=[];this.setState({eventsData:e})}this.setUserName()}catch(e){const t=[];this.setState({eventsData:t},()=>this.setUserName())}},this.setUserName=()=>{if(!c.A.isServer()){const e=JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||"";e.subId.id===e.subscriberIds[0]?this.setState({userName:e.subscriberName[0],options:e.subscriberIds,selectedSubId:e.subscriberIds[0]}):this.setState({userName:e.subId.name,options:e.subscriberIds,selectedSubId:e.subId.id})}},this.setOnlySubID=()=>{if(!c.A.isServer()){const{selectedSubId:e}=this.state,t=Ir({},JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||""),s={sub:e};t.user=btoa(JSON.stringify(s)),localStorage.setItem(c.A.localStorageNames.userAuth,JSON.stringify(t)),this.setState({accountDetail:{}})}},this.fetchData=async()=>{const{setApiError:e}=this.props;try{const{manifest:t}=this.props,s={apiPath:(0,x.th)("secure_myaccount",t)},a=(await wr.T.fetchData(s)).data;if(a.status===c.A.MESSAGES_TYPES.S3_SUCCESS){const e=a.data&&a.data.field_json_data&&a.data.field_json_data;e&&this.setState({pageData:e},()=>{this.setUserName(),this.redirectToTsSecure(e)})}else this.setState({render:!0}),e(c.A.serverError,!0)}catch(t){e(c.A.serverError,!0)}},this.fetchAccountDetails=async e=>
1{if(!c.A.isServer()){const{manifest:t,closeModal:s}=this.props,a=(0,x.gK)("myaccount_event_flag",t);if(this.setState({render:!1}),s(),a&&"TRUE"===a.toUpperCase())this.setOnlySubID();else{const t=e||(0,x.Xo)().id;this.updateUserData(t);"HA"!==(JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||"").userType&&(window.location.href="/my-account"),this.setOnlySubID()}}},this.onChangeSelectHandler=e=>{const{selectedSubId:t}=this.state;t!==e?this.showPasswordModal(e):this.setState({render:!0})},this.generateData=async e=>{const{setApiError:t,manifest:s}=this.props,a=`${c.A.NODE_API_ROOT}/secure/order/relocationDetails`;try{if(e&&e.length<2){const s={subscriberId:(0,x.Xo)().id,provider:e.includes("SECURE")?"Hualai":"Google"},r=(await q.n.postData(a,s)).data;if(r&&!0===r.status){const t=Er(r.data),s=e.includes("SECURE")?"secureBoxData":"securePlusBoxData";this.setState({[s]:t,render:!0})}else this.setState({render:!0}),t(c.A.serverError,!0)}else{const e={apiUrl:a,obj:{subscriberId:(0,x.Xo)().id,provider:"Hualai"}},s={apiUrl:a,obj:{subscriberId:(0,x.Xo)().id,provider:"Google"}},r=await q.n.multiplePostData(e,s),i=r[0].data,n=r[1].data;if(r&&r.length>1&&r[0]&&r[1]){if(i&&!0===i.status){const e=Er(i.data);this.setState({secureBoxData:e})}else this.setState({render:!0}),t(c.A.serverError,!0);if(n&&!0===n.status){const e=Er(n.data);this.setState({securePlusBoxData:e})}else this.setState({render:!0}),t(c.A.serverError,!0);this.setState({render:!0})}else this.setState({render:!0}),t(c.A.serverError,!0)}}catch(e){}},this.redirectToTsSecure=async e=>{const{history:t,openModal:s}=this.props,{selectedSubId:a}=this.state;try{const a=(await wr.T.redirectToTsSecure()).data;if(!0===a.status&&a.data.message&&a.data.message.length>0){const t=a.data.message;
1this.setState({camera:e.cameraList,secureMsg:t},()=>{this.generateData(t),this.setActiveTab(t,e.cameraList)})}else this.setState({render:!0}),s(L.lx.COMMON_MODAL,{Component:Or,data:{logoutFunction:()=>(0,x.Lk)(!0,t.push(`/${c.A.my_account_path}/login`)),title:e&&e.inValidUserHeading,subTitle:e&&e.inValidUserSubHead},onCloseEvent:()=>(0,x.Lk)(!0,t.push(`/${c.A.my_account_path}/login`)),parentClass:"notAValidUserModal"})}catch(e){console.log(e)}},this.setActiveTab=(e,t)=>{const s=[];t.map(t=>{e.map(e=>{t.tabTitle===e&&s.push(t)})}),this.setState({secureData:s[0],activeTabData:s,title:s[0].title})},this.showPasswordModal=e=>{if(!c.A.isServer()){const{history:t,openModal:s}=this.props;s(L.lx.PASSWORD_MODAL,{userSelectedSubId:e,pagePath:"/my-account",popUpFunction:this.fetchAccountDetails,history:t,parentClass:"passwordModal"})}},this.updateUserData=e=>{if(!c.A.isServer()){const t=Ir({},JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||""),s=t.subscriberIds.findIndex(t=>t===e);t.subId={id:t.subscriberIds[s],encryptId:t.encSubscriberId[s],name:t.subscriberName[s],email:Array.isArray(t.email)?t.email[s]:"",sName:t.shortName[s]},localStorage.setItem(c.A.localStorageNames.userAuth,JSON.stringify(t)),this.setState({userName:t.subscriberName[s],selectedSubId:t.subscriberIds[s]})}},this.handleRender=e=>{this.setState({render:e})},this.handleGaEvent=e=>{(0,x.Sw)({event:`${e.title} - Secure`,"Sub ID":(0,x.Xo)().id||null})},this.handleRedirect=(e,t,s,a)=>{const{closeModal:r,openModal:i,history:n}=this.props;e.preventDefault(),this.handleGaEvent(t);const o=x.Fr.Android(),l=x.Fr.iOS(),c=(0,x.cX)(),d=o?"android":l||c?"ios":"desktop";this.setState({render:!1}),s&&s.length>1?(this.setState({render:!0}),i(L.lx.COMMON_MODAL,{Component:kr,data:{cameraList:a,title:t.title,handleRender:this.handleRender},parentClass:"select-cameraType drawer-popup",backDropClass:"bottom-sheet"})):setTimeout(()=>{const s="desktop"===d?`${t.link}`:`${t[`${d}_link`]}`;["Manage devices","Get Help"].includes(t.title)?(0,x.nE)(e,n,s):n.push(`${s}`)},1e3)},this.transformPack=()=>{const{eventsData:e}=this.state,{isConsentTD:t}=JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||"",s=[];e.map(e=>{"packs"===e.event_type&&e.packages&&e.packages.length>0&&(e.packages.selectedId=e.packages.selectedId?e.packages.selectedId:e.packages[0].id,s.push(e)),"subscribe"===e.event_type&&e.packages&&e.packages.length>0&&s.push(e),"offers"!==e.event_type&&"banner_offer"!==e.event_type||e.field_body&&""!==e.field_body&&s.push(e),"enroll_banner"===e.event_type&&e.field_body&&""!==e.field_body&&!t&&s.push(e)}),this.setState({packTransformedData:s})},this.onPackChange=(e,t)=>
1{const{packTransformedData:s}=this.state,a=[...s];a[t].packages.selectedId=e.id,this.setState({packTransformedData:a})},this.validateForm=async(e,t)=>{const{packTransformedData:s}=this.state,{setApiError:a,history:r}=this.props,i=s[e]&&"packs"===t?s[e].packages.selectedId:s[e].packages[0].id,n="EVENTS",o=await wr.T.addPack(i,n);o.data.status===c.A.MESSAGES_TYPES.SUCCESS?r.push({pathname:`/${c.A.my_account_path}/confirm-pack`,state:o.data.data}):o.data.data&&o.data.data.tempFlag?r.push({pathname:`/${c.A.my_account_path}/temp-suspend`,search:`?flow=add-pack&packId=${i}&source=${n}`}):a(c.A.serverError,!0)},this.generateEvents=()=>{const{accountDetail:e,packTransformedData:t,previewMode:s,btnText:a}=this.state,{history:r}=this.props;if(t&&t.length>0)return(0,v.jsx)(S.A,{type:"event",arrayElements:t,accountDetail:e,validateFormHandler:this.validateForm,redirectToRechargeHandler:this.redirectToRecharge,onPackChangeHandler:this.onPackChange,previewMode:s,history:r,btnText:a})}}render(){const{render:e,pageData:t,selectedSubId:s,securePlusBoxData:r,secureBoxData:i,options:n,secureMsg:l,camera:d,secureData:m,activeTabData:p,userName:g,accountDetail:f,accButtons:b,enrollToastMsg:y,bannerData:S,packTransformedData:j}=this.state,{errorCode:A,manifest:N,history:C}=this.props,_=[],E=[];n.forEach(e=>{e!==s&&_.push({value:e,label:e}),E.push({value:e,label:e})});const T={value:s,label:s},D={control:e=>Ir(Ir({},e),{},{boxShadow:"none",border:"none",fontSize:"15px",color:"#A9A0A2"}),option:e=>Ir(Ir({},e),{},{color:"#A9A0A2",fontSize:"15px",backgroundColor:"#FFF",textAlign:"left",marginBottom:"5px","&:hover":{color:"#FFF",backgroundColor:"#e940ad"}}),input:e=>Ir(Ir({},e),{},{color:"#A9A0A2",fontSize:"14px",lineHeight:"28px",border:"1px solid red"})};return A?(0,v.jsx)(o.A,{}):e?(0,v.jsx)("div",{id:"my-account-root",children:(0,v.jsxs)("div",{id:"introPage",children:[(0,v.jsx)(h.A,{headerType:"authUser",selectedSubId:s}),(0,v.jsxs)("div",{id:"secure-account",children:[(0,v.jsxs)("div",{className:"container ",children:[(0,v.jsx)("div",{className:"logo-margin-top",children:(0,v.jsx)("div",{className:"hero-text",children:(0,v.jsx)("div",{className:"container text-center",children:(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsxs)("h1",{className:"headingL1 gradient",children:["Hi"," ",g,"!"]})})})})}),(0,v.jsx)("div",{className:"content-container",children:(0,v.jsx)("div",{className:"innercontainer-md text-center balance-details home-unauth-info home-container",children:(0,v.jsx)("div",{className:"form-group mB20",children:n.length>1?(0,v.jsx)(a.Fragment,{children:(0,v.jsxs)("div",{className:"falseinput clearfix",children:[(0,v.jsx)("div",{className:"subid",children:"Subscriber ID:"}),!0===(0,x.Xb)()?(0,v.jsxs)("div",{className:"mySelect-wrapper",children:[(0,v.jsx)("span",{children:s}),(0,v.jsx)("select",{onChange:e=>this.onChangeSelectHandler(e.target.value),value:s,children:E.map(e=>(0,v.jsx)("option",{value:e.value,selected:e.value===s,children:e.label},e.value))})]}):(0,v.jsx)("div",{className:"subidextn",children:(0,v.jsx)(_r.default,{styles:D,defaultValue:T||_[0],options:_,isSearchable:!1,onChange:e=>this.onChangeSelectHandler(e.value)})})]})}):null})})}),(0,v.jsxs)("div",{id:"subscribe-box",className:"innercontainer-md-sm",children:[!w()(i)&&i.map(e=>e&&e.haBoxData.map(s=>(0,v.jsx)(Dr,{status:e.status,boxType:"SECURE",boxData:t,boxInfo:s}))),!w()(r)&&r.map(e=>e&&e.haBoxData.map(s=>(0,v.jsx)(Dr,{status:e.status,boxType:"SECURE_PLUS",boxData:t,boxInfo:s})))]})]}),(0,v.jsx)("div",{className:"pack-optionwrapp",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("div",{className:"card-outer",children:m&&m.field_data&&m.field_data.map(e=>(0,x.Xb)()||e.show_on_browser?(0,v.jsxs)("button",{className:"card-sm subscription-card link "+(["Add camera"].includes(e.title)?"disabled-card":""),tabIndex:"0",type:"button",disabled:["Add camera"].includes(e.title),onClick:t=>this.handleRedirect(t,e,l,d),children:[e.show_tag&&(0,v.jsx)("div",{className:"button-tag offer-tag bold",children:e.show_tag}),(0,v.jsxs)("div",{className:"card-body",children:[(0,v.jsx)("span",{className:"view text-center "+("OTT Apps"===e.title?"binge":""),children:(0,v.jsx)("img",{src:`${c.A.NODE_API_ROOT}${e.icon}`,alt:e.title,title:e.title})}),(0,v.jsx)("h3",{className:"heading1 mB0 textupper",children:e.title})]})," "]}):null)})})}),(0,v.jsx)("div",{className:"container",children:j&&j.length>0?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("div",{className:"heading-xs",children:(0,v.jsx)("h2",{className:"heading1 bold pack-heading",children:"Whatâs New"})}),(0,v.jsx)("div",{className:"offer-card-outer balance-details ",children:this.generateEvents()})]}):null})]})]})}):(0,v.jsx)(u.A,{})}}const Rr=(0,l.Ng)(e=>({accountDetail:e.myAccountReducer.accountDetail,errorCode:e.commonReducer.errorCode,manifest:e.commonReducer.manifest,transactionData:e.myAccountReducer.transactionData}),Mr)($r);var Lr=s(10504);class Fr extends a.Component{constructor(...e){super(...e),this.state={button:{buttonConfig:{type:"button",class:"wAutoLgBlue"}}},this.redirectButton=()=>{c.A.isServer()||(window.location.href=`/${c.A.landing_path}`)}}render(){const{button:e}=this.state,{location:{state:{thankYouDesc:t,thankYouText:s}}}=this.props;return(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{isLogo:!0,isShadow:!1}),(0,v.jsx)("div",{className:"content-container",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)(Lr.A,{type:"default",headingclass:"heading1 gradient",title:s}),(0,v.jsx)(Lr.A,{type:"default",headingclass:"heading2 gradient",title:t})]}),(0,v.jsx)("div",{className:"body-container innercontainer-sm text-center",children:(0,v.jsx)("div",{className:"posR",children:(0,v.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 130.2 130.2",children:[(0,v.jsx)("circle",{className:"path circle",fill:"none",stroke:"#009822",strokeWidth:"6",strokeMiterlimit:"10",cx:"65.1",cy:"65.1",r:"62.1"}),(0,v.jsx)("polyline",{className:"path check",fill:"none",stroke:"#009822",strokeWidth:"6",strokeLinecap:"round",strokeMiterlimit:"10",points:"100.2,40.2 51.5,88.8 29.8,67.5 "})]})})})]})})})]})}}const Ur=Fr,Br=["hasErrors"];function Hr(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function Yr(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Hr(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Hr(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const Gr={userSecureSoftLogin:Fe.Qz,setApiError:g.x8,openModal:U.qf};class Jr extends a.Component{constructor(...e){super(...e),this.state={render:!0,button:{buttonConfig:{type:"button",class:"blue"},text:"Continue"},formErrorMessage:"",subMessage:"",verifyRmnForm:{subscriberId:{wrapperClasses:["form-group","phone-field"],labelConfig:{label:"Subscriber ID / Registered Mobile Number",classes:["sel","active"]},elementType:"input",elementConfig:{type:"tel",placeholder:"",maxLength:10,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}}},this.componentDidMount=async()=>{const{pageMetaData:e}=this.props;if(!e)try{await(0,T.h8)("/secure/system/s3-api/v1/assets/pages/hualai_myaccount_login.json")}catch(e){(0,g.x8)(c.A.serverError,!0)}},this.inputChangedHandler=(e,t)=>{this.setState({subMessage:""});const{verifyRmnForm:s}=this.state,a=Yr({},s),r=Yr({},a[t]);let i=e;"subscriberId"===t&&(i=i.replace(/[^0-9]/g,""),i.length>10&&(i=i.slice(0,10))),r.value=i,r.touched=!0,r.valid=!0,r.errorMessage="",a[t]=r,this.setState({verifyRmnForm:a,formErrorMessage:""})},this.validateForm=async()=>{if(!c.A.isServer()){const{verifyRmnForm:e}=this.state,t={},s=Object.keys(e);s.forEach(s=>{t[s]=e[s].value});const a=J.A.validateVerifyRmnOrSubscriberid(t),{hasErrors:r}=a,i=(0,I.A)(a,Br),n=Yr({},e);if(r)s.forEach(e=>{const t=i[`${e}Message`];t&&""!==t&&(n[e].valid=!1,n[e].errorMessage=t)}),this.setState({verifyRmnForm:n,formErrorMessage:""});else try{const{userSecureSoftLogin:e,history:s,location:{search:a}}=this.props,{dest:r,transactionId:i}=(0,x.vA)(a);this.setState({render:!1});const n={rmnOrSubscriberId:t.subscriberId,transactionId:i},o=await e(n,"HA"),l=o;if(!0===l.status){(0,x.Sw)({event:"Successful Login",SubscriberID:t.subscriberId||""});const e={transactionId:i,data:o.data};(0,he.e)("secureAuth",e),s.push(`/${c.A.home_automation}/auth/authentication`)}else this.setState({render:!0,formErrorMessage:l.message||"Oops! Something went wrong",subMessage:l.data&&l.data.subMessage||""})}catch(e){n.subscriberId.valid=!1,n.subscriberId.errorMessage=c.A.serverError,this.setState({render:!0,verifyRmnForm:n})}}},this.redirectBack=e=>{const{history:t}=this.props;e.preventDefault();const s=t.location.state&&t.location.state.prevPath,a=(0,x.vA)(t.location.search);t.location&&s?t.push(s):t.location.state&&t.location.state.multiSubId?t.go(-2):a&&a.dest&&(0,x.wR)(!0)||(0,x.wR)(!0)?t.go(-1):t.push(`/${c.A.landing_path}`)},this.redirectToPage=e=>{const{history:t}=this.props;t.push(e)},this.handleClickHere=()=>{(0,x.Sw)({event:"Click Here - Login"}),this.redirectToPage(`/${c.A.my_account_path}/register-user`)}}render(){const{verifyRmnForm:e,formErrorMessage:t,render:s,button:r,subMessage:n}=this.state,{pageMetaData:o,history:l}=this.props;if(!o)return(0,v.jsx)(u.A,{});const c=[];return Object.keys(e).forEach(t=>{c.push({id:t,config:e[t]})}),(0,v.jsx)(a.Fragment,{children:s?(0,v.jsx)(a.Fragment,{children:(0,v.jsx)(A.A,{isSecure:!0,metatags:o?o.metatag:{},children:(0,v.jsxs)("div",{id:"user-auth",children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"heading1 gradient",children:o.title}),o.field_sub_title?(0,v.jsx)(b.A,{Tag:"h2",className:"heading2",htmlContent:o.field_sub_title}):null]}),(0,v.jsxs)("form",{onSubmit:this.validateForm,action:"javascript:void(0)",children:[(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-xs save-user-details",children:[c&&c.map(e=>(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)}),(0,v.jsxs)("span",{className:"validate invalid-text",children:[" ",t]})," "]},e.id)),n&&""!==n&&(0,v.jsx)(b.A,{className:"mT10 fs14",htmlContent:n})]})}),(0,v.jsx)("div",{className:"footer-contr text-center",children:(0,v.jsx)("div",{className:"footer-contr btn-contr text-center",children:(0,v.jsx)(R.A,{config:r.buttonConfig,content:r.text,onClick:()=>this.validateForm()})})})]})]})})}),(0,v.jsx)(i.A,{})]})})}):(0,v.jsx)(u.A,{})})}}const qr=(0,l.Ng)(e=>({pageMetaData:e.commonReducer.currentPageMetaData}),Gr)(Jr);var Vr=s(11435);const zr=["hasErrors"];function Wr(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}const Xr={generateOtpSecure:Fe.Mm,validateSecureOTPFromServer:Fe.oD,resendOtpSecure:Fe.un,closeModal:U.Oo};class Zr extends a.Component{constructor(...e){super(...e),this.state={render:!0,showSendingMessage:!0,button:{buttonConfig:{type:"button",class:"blue"},text:"Continue"},formErrorMessage:"",messageClass:"",otpRmn:"",otpForm:{validateOTP:{wrapperClasses:["form-group"],labelConfig:{label:"",classes:["sel","active"]},elementType:"input",elementConfig:{type:"tel",placeholder:"",maxLength:6,tabIndex:0,autoComplete:"off"},value:" ".repeat(6),errorMessage:"",valid:!0,touched:!1}}},this.generateOtp=async()=>{const{generateOtpSecure:e,subscriberId:t,setOtpAlert:s}=this.props,a=await e({subscriberId:t});!0===a.status?this.setState({render:!0,showSendingMessage:!1,otpRmn:a.data,formErrorMessage:"",messageClass:""},()=>{this.startOtpTimer(),s("resend")}):this.setState({render:!0,showSendingMessage:!1,otpRmn:"",formErrorMessage:a.message||"Oops! Something went wrong",messageClass:""},()=>s("none"))},this.onChangeOTP=e=>{this.setState({otpForm:{validateOTP:{value:e}},formErrorMessage:""})},this.validateForm=async e=>{e.preventDefault();const{otpForm:t}=this.state,{validateSecureOTPFromServer:s}=this.props,a={};for(const e in t)a[e]=t[e].value.trim();const r=J.A.validateOTP(a),{hasErrors:i}=r,n=(0,I.A)(r,zr);if(i){const e=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?Wr(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):Wr(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},t);for(const s in t){const t=n[`${s}Message`];t&&""!==t&&(e[s].valid=!1,e[s].errorMessage=t)}this.setState({otpForm:e,formErrorMessage:n.validateOTPMessage})}else{const{history:e,closeModal:t,pagePath:r,popUpFunction:i,params:{eventId:n,eventType:o},noModal:l,subscriberId:d,transactionId:m}=this.props;if(!c.A.isServer()){const e={subscriberId:d,otp:a.validateOTP,source:"HA",transactionId:m},t=await s(e);if(!0===t.status){const{data:{redirectUri:e}}=t;e?((0,x.Sw)({event:"Submit New","Sub ID":d||null}),window.location.href=e):this.setState({render:!0,formErrorMessage:c.A.serverError})}else this.setState({render:!0,formErrorMessage:t.message,messageClass:""})}}},this.startOtpTimer=()=>{let e=30;const t=document.querySelector("#timer_div"),s=document.querySelector(".link-contr"),a=document.querySelector(".res-otp");s.style.display="none",setInterval(()=>{0===e&&s&&a?(clearTimeout(),s.style.display="flex",a.style.display="none"):(e=e<10?`0${e}`:e,t&&(a.style.display="flex",t.innerHTML=e),e--)},1e3)},this.ResendOTP=async()=>{const{resendOtpSecure:e,subscriberId:t,setOtpAlert:s}=this.props;s("none"),this.setState({render:!1,showSendingMessage:!0});const a=await e({subscriberId:t});!0===a.status?((0,x.Sw)({event:"Resend OTP New","Sub ID":t||null}),this.setState({render:!0,showSendingMessage:!1,formErrorMessage:"",messageClass:"classgreen"},()=>{this.startOtpTimer()}),s("resend")):this.setState({render:!0,showSendingMessage:!1,formErrorMessage:a.message,messageClass:""})}}componentDidMount(){this.generateOtp()}render(){const{otpForm:e,formErrorMessage:t,button:s,resendOtpMessage:r,validateOtpMessage:i,messageClass:n,render:o,showSendingMessage:l,otpRmn:d}=this.state,m=[];Object.keys(e).forEach(t=>{m.push({id:t,config:e[t]})});const h=!c.A.isServer()&&JSON.parse(localStorage.getItem(c.A.localStorageNames.userAuth))||"";(0,x.IB)(h&&h.rmn||"");return(0,v.jsx)(a.Fragment,{children:o?(0,v.jsx)("div",{className:"content-container",id:"login-password",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("div",{className:"main-container",children:(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsx)("div",{className:"body-container",children:(0,v.jsxs)("div",{className:"innercontainer-xs save-user-details",children:[d&&(0,v.jsxs)("span",{children:[(0,v.jsx)("b",{children:"Enter OTP sent to "})," ","+91"," ",d||""]}),m&&m.map(e=>(0,v.jsxs)("div",{className:"form-group",children:[(0,v.jsx)(V.A,{onChange:this.onChangeOTP,value:this.state.otpForm.validateOTP.value,valueLength:6,validateForm:this.validateForm}),(0,v.jsxs)("span",{className:`validate invalid-text ${n}`,children:[" ",t]})," "]},e.id)),l?(0,v.jsx)("span",{className:"lds-hourglass",children:" Sending"}):(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)("div",{className:"link-contr field-info-wrapper mT5",children:(0,v.jsx)("p",{className:"resend-text",children:(0,v.jsx)("a",{className:"field-info show-cursor",onClick:()=>this.ResendOTP(),children:"Resend OTP"})})}),(0,v.jsxs)("div",{className:"fs12 res-otp field-info-otp mT5",style:{display:"none"},children:["Resend OTP in 00:",(0,v.jsx)("span",{id:"timer_div"})]})]}),(0,v.jsxs)("p",{className:" text-center",children:[r,i]})]})}),(0,v.jsx)("div",{className:"footer-contr text-center",id:"login-password-footer",children:(0,v.jsx)("div",{className:"footer-contr btn-contr text-center",children:(0,v.jsx)(R.A,{config:s.buttonConfig,content:s.text,onClick:e=>this.validateForm(e)})})})]})})})}):(0,v.jsx)(u.A,{})})}}const Qr=(0,l.Ng)(e=>({resendOTPData:e.commonReducer.resendOTPData,otpData:e.commonReducer.otpData}),Xr)(Zr),Kr=["hasErrors"];function ei(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function ti(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?ei(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ei(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const si={userSecurePasswordLogin:Fe.Fh,userForgotPassword:Fe.GY,closeModal:U.Oo};class ai extends a.Component{constructor(...e){super(...e),this.state={render:!0,button:{buttonConfig:{type:"submit",class:"blue"},text:"Continue"},formErrorMessage:"",verifyPasswordForm:{password:{wrapperClasses:["form-group"],labelConfig:{label:"Password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",maxLength:32,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1}}},this.captchaElement=a.createRef(),this.captchaElementPass=a.createRef(),this.inputChangedHandler=(e,t)=>{const{verifyPasswordForm:s}=this.state,a=ti({},s),r=ti({},a[t]),i=e;r.value=i,r.touched=!0,r.valid=!0,r.errorMessage="",a[t]=r,this.setState({verifyPasswordForm:a,formErrorMessage:""})},this.forgotPassword=async e=>{const{userForgotPassword:t,forgotPasswordHandler:s}=this.props;try{this.setState({render:!1});const a=await t(e);this.setState({render:!0},()=>s(a))}catch(e){console.log("Error occuered in Forget Password",e)}},this.validateForm=e=>{e.preventDefault();const{verifyPasswordForm:t}=this.state,s={},a=Object.keys(t);a.forEach(e=>{s[e]=t[e].value});const r=J.A.validateLoginPasswordForm(s),{hasErrors:i}=r,n=(0,I.A)(r,Kr);if(i){const e=ti({},t);a.forEach(t=>{const s=n[`${t}Message`];s&&""!==s&&(e[t].valid=!1,e[t].errorMessage=s)}),this.setState({verifyPasswordForm:e,formErrorMessage:""})}else this.onValidateCaptchaPass()},this.validateFromServer=async e=>
1{if(!c.A.isServer()){this.setState({render:!1});const{verifyPasswordForm:t}=this.state,s={};Object.keys(t).forEach(e=>{s[e]=t[e].value});const{userSecurePasswordLogin:a,history:r,closeModal:i,pagePath:n,popUpFunction:o,params:{eventId:l,eventType:d},noModal:m,subscriberId:u,transactionId:h}=this.props,p={captchaToken:e,password:s.password,subscriberId:u,source:"HA",transactionId:h},g=await a(p);if(!0===g.status){const{data:{redirectUri:e}}=g;e?window.location.href=e:this.setState({render:!0,formErrorMessage:c.A.serverError})}else{const{data:e,message:t}=g;if(e&&!0===e.isRegisterationNeeded){const{history:e}=this.props;e.push({pathname:`/${c.A.my_account_path}/register-user`,state:{showALert:!0,displayMsg:t||""}})}else this.setState({render:!0,formErrorMessage:g.message||c.A.serverError})}}},this.onCaptchaResolved=e=>{e&&this.forgotPassword(e)},this.onCaptchaResolvedPass=e=>{e&&this.validateFromServer(e)},this.onValidateCaptcha=()=>{this.captchaElement.execute(this.captchaElementResetId)},this.onValidateCaptchaPass=()=>{this.captchaElementPass.execute(this.captchaElementPassResetId)}}render(){const{verifyPasswordForm:e,formErrorMessage:t,button:s,render:r}=this.state,{manifest:i}=this.props,n=[];return Object.keys(e).forEach(t=>{n.push({id:t,config:e[t]})}),(0,v.jsx)(a.Fragment,{children:r?(0,v.jsx)("div",{className:"content-container",id:"login-password",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsx)("div",{className:"main-container",children:(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),children:[(0,v.jsxs)("div",{className:"body-container",children:[(0,v.jsx)("div",{className:"innercontainer-xs save-user-details",children:n&&n.map(e=>(0,v.jsxs)("div",{className:"form-group mT20",children:[(0,v.jsx)($.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,changed:t=>this.inputChangedHandler(t,e.id)}),(0,v.jsxs)("span",{className:"validate invalid-text",children:[" ",t]})," "]},e.id))}),(0,v.jsx)(qe.A,{ref:this.captchaElement,id:"login-recaptcha",customClass:"customRecaptcha",getRef:e=>{this.captchaElement=e},onChange:this.onCaptchaResolved,resetId:e=>{this.captchaElementResetId=e}}),(0,v.jsx)(qe.A,{ref:this.captchaElementPass,id:"password-recaptcha",customClass:"customRecaptcha",getRef:e=>{this.captchaElementPass=e},onChange:this.onCaptchaResolvedPass,resetId:e=>{this.captchaElementPassResetId=e}})]}),(0,v.jsx)("div",{className:"footer-contr text-center",id:"login-password-footer",children:(0,v.jsx)("div",{className:"footer-contr btn-contr text-center",children:(0,v.jsx)(R.A,{config:s.buttonConfig,content:s.text,onClick:e=>this.validateForm(e)})})})]})})})}):(0,v.jsx)(u.A,{})})}}(0,l.Ng)(e=>({errorCode:e.commonReducer.errorCode,manifest:e.commonReducer.manifest}),si)(ai);function ri(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function ii(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?ri(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ri(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const ni={closeModal:U.Oo,userPasswordLogin:Fe.eS,setApiError:g.x8};class oi extends a.Component{constructor(...e){super(...e),this.state={render:!1,pageTitle:"",subTitle:"",isPassword:!1,isChecked:"otp",forgotPasswordMessage:"",tokenExpire:!1,receiveOtpMsg:"",button:{buttonConfig:{type:"button",class:"smallblue "}},transactionId:"",subId:{wrapperClasses:["form-group","custom-Select-Arrow"],labelConfig:{label:"Subscriber ID",classes:["sel"]},elementType:"customSelect",elementConfig:{options:[],placeholder:"Choose an option",maxLength:null,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}},this.componentDidMount=async()=>{const{subId:e}=this.state;((0,x.Ht)("tokenExpired")||"")&&this.setState({tokenExpire:!0});const t=(0,he.u6)("secureAuth"),s=ii({},e);let a="";if(t){const e=[],{data:{subscriberId:r,encSubscriberId:i},transactionId:n}=t;
1for(let t=0;t<r.length;t++)e.push({label:r[t],value:i[t]});s.elementConfig.options=e,s.value=i[0]||"",a=n}try{const e=await f.n.getJsonData("s3-api/v1/assets/pages/hualai_myaccount_login_detail.json");e.data.status===c.A.MESSAGES_TYPES.S3_SUCCESS&&this.setState({render:!0,pageTitle:e.data.data?e.data.data.title:"",subTitle:e.data.data?e.data.data.field_sub_title:"",subId:s,transactionId:a})}catch(e){(0,g.x8)(c.A.serverError,!0)}},this.setOtpAlert=e=>{this.setState({receiveOtpMsg:"resend"===e?"OTP sent successfully":"We will be calling you shortly on your Registered Mobile Number"}),"none"===e&&this.setState({receiveOtpMsg:""})},this.inputChangedHandler=(e,t)=>{const{subId:s}=this.state,a=ii({},s),r=e;a.value=r,a.touched=!0,a.valid=!0,a.errorMessage="",this.setState({subId:a,formError:""})},this.handleForgotPassword=e=>{if(e.status===c.A.MESSAGES_TYPES.S3_SUCCESS)this.setState({forgotPassword:!0});else{const{data:t,message:s}=e;if(t&&!0===t.isRegisterationNeeded){const{history:e}=this.props;e.push({pathname:`/${c.A.my_account_path}/register-user`,state:{showALert:!0,displayMsg:s||""}})}else this.setState({forgotPasswordMessage:e.message})}},this.setTokenExpire=()=>{c.A.isServer()||(sessionStorage.removeItem("tokenExpired"),this.setState({tokenExpire:!1}))},this.redirectToHome=()=>{const{history:e}=this.props;c.A.isServer()||(sessionStorage.removeItem("tokenExpired"),e.push(`/${c.A.my_account_path}`))}}componentWillUnmount(){(0,x.Ht)("tokenExpired")&&sessionStorage.removeItem("tokenExpired")}onChangeHandler(e){this.setState({isPassword:!this.state.isPassword,isChecked:e})}render(){const{render:e,pageTitle:t,subTitle:s,isPassword:r,isChecked:i,forgotPassword:n,forgotPasswordMessage:o,tokenExpire:l,button:c,subId:d,receiveOtpMsg:m,transactionId:h}=this.state,p=(0,x.WF)(),{history:g}=this.props;return n?(0,v.jsx)("div",{className:"main-container",children:(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)(Vr.A,{history:g})})}):""!==o?(0,v.jsx)("div",{className:"main-container",children:(0,v.jsx)("div",{className:"heading-md",children:o})}):l?(0,v.jsx)("div",{className:"main-container p-modal",children:(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"heading1 gradient",children:"Another Log in detected"}),(0,v.jsx)("h2",{className:"heading2",children:"This account has been logged in from another device. For security reasons, we have logged you out from this device."}),(0,v.jsx)("h2",{className:"heading3",children:"Log in again to continue"}),p?null:(0,v.jsxs)("div",{className:"btn-contr text-center",children:[(0,v.jsx)(R.A,{config:c.buttonConfig,content:"YES",onClick:()=>this.setTokenExpire()}),(0,v.jsx)(R.A,{config:c.buttonConfig,content:"NO",onClick:()=>this.redirectToHome()})]})]})}):(0,v.jsx)(a.Fragment,{children:e?(0,v.jsxs)(a.Fragment,{children:[m&&(0,v.jsx)(Ue.A,{receiveOtpMsg:m}),(0,v.jsx)("div",{className:"content-container",id:"passwordModal",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"heading1 gradient",children:t}),s?(0,v.jsx)("h2",{className:"heading2",children:s}):null]}),d.elementConfig.options.length>1&&(0,v.jsx)(a.Fragment,{children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{style:{marginBottom:"50px"},className:"innercontainer-xs save-user-details",children:[(0,v.jsx)($.A,{labelConfig:d.labelConfig,elementType:d.elementType,elementConfig:d.elementConfig,value:d.value,valid:d.valid,errorMessage:d.errorMessage,touched:d.touched,wrapperClasses:d.wrapperClasses,changed:e=>this.inputChangedHandler(e,"subId")},"subId"),(0,v.jsx)("div",{className:"validate invalid-text"})]})})}),(0,v.jsx)("div",{className:"radio-button password-otp"}),(0,v.jsx)("div",{className:"mT20",children:(0,v.jsx)(Qr,{pagePath:"",history:g,setOtpAlert:this.setOtpAlert,params:{eventId:"",eventType:""},subscriberId:d.value,transactionId:h})})]})})})]}):(0,v.jsx)(u.A,{})})}}const li=(0,l.Ng)(null,ni)((0,r.y)(oi)),ci={setApiError:g.x8},di=(0,l.Ng)(null,ci)(e=>{const[t,s]=(0,a.useState)(null);return(0,a.useEffect)(()=>{(async()=>{try{const{data:e}=await f.n.getJsonData("s3-api/v1/assets/pages/success-page.json");if(e.message===c.A.MESSAGES_TYPES.SUCCESS){const{field_json:t,field_images:a}=e.data;s({field_json:t,field_images:a})}else(0,g.x8)(c.A.serverError,!0)}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(0,g.x8)(c.A.serverError,!0)}})()},[]),t?(0,v.jsxs)(a.Fragment,{children:[(0,v.jsx)(h.A,{headerType:"onlyLogo",isShadow:!1}),(0,v.jsx)("div",{className:"content-container",children:(0,v.jsx)("div",{className:"container",children:(0,v.jsxs)("div",{className:"main-container text-center",children:[(0,v.jsx)(sa,{pageData:t}),(0,v.jsxs)("div",{className:"body-container text-center pB0",children:[(0,v.jsx)("div",{className:"tata-sky-logo",children:(0,v.jsx)("img",{src:"/assets/images/home-automation/link-tatasky-logo.png",alt:"",title:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"link-img",children:(0,v.jsx)("img",{src:"/assets/images/home-automation/link-icon.png",alt:"",title:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"google-img mB20",children:(0,v.jsx)("img",{src:"/assets/images/home-automation/google-logo.png",alt:"",title:"",className:"img-fluid"})}),(0,v.jsx)("div",{className:"footer-contr text-center block mT32",children:(0,v.jsx)("button",{className:"btn btn-primary btn-lg waves-effect waves-light",onClick:()=>(t=>{const{history:s}=e;s.push(t)})(`/${c.A.home_automation}/${j.dY}`),children:"Back to Home"})})]})]})})})]}):(0,v.jsx)(u.A,{})}),mi=["component","softLogin","type"];function ui(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function hi(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?ui(Object(s),!0).forEach(function(t){(0,M.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):ui(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const pi=e=>{let{component:t,softLogin:s,type:a}=e,i=(0,I.A)(e,mi);const{path:n,allowMsales:o,block:l}=i,d=(0,x.wR)(!0);if(!o){const e=(0,x.Bd)(),t=(0,x.jv)();let s=j.oh;if(n.includes("tata-play-secure-plus")&&(s=j.dY),e||t)return(0,v.jsx)(r.qh,hi(hi({},i),{},{render:()=>(0,v.jsx)(r.rd,{to:`/${c.A.home_automation}/${s}/bundle`})}))}return"protected"===a?(0,v.jsx)(r.qh,hi(hi({},i),{},{render:e=>(0,x.wR)(s)?(0,v.jsx)(t,hi({},e)):(0,v.jsx)(r.rd,{to:d?`/${c.A.home_automation}/authentication?dest=${n}`:`/${c.A.home_automation}/login?dest=${n}`})})):(0,v.jsx)(r.qh,hi(hi({},i),{},{render:e=>(0,v.jsx)(t,hi({},e))}))},gi=(0,x.Bd)(),fi=(0,x.dl)(),xi=({history:e})=>(0,v.jsxs)("div",{className:"ha-common google-camera",children:[gi||fi?(0,v.jsx)(h.A,{isLogo:!0,journeyType:"HA"}):(0,v.jsx)(h.A,{headerType:"toggleAuth",journeyType:"HA"}),(0,v.jsx)("div",{className:"error-msg",children:(0,v.jsx)("p",{children:"This product has been discontinuedâ¦"})})]}),bi=(0,l.Ng)(e=>({errorCode:e.commonReducer.errorCode}),null)(({match:e,errorCode:t})=>{if(t)return(0,v.jsx)(o.A,{});const s="protected";return(0,v.jsxs)("div",{id:"ha-root",children:[(0,v.jsxs)(r.dO,{children:[(0,v.jsx)(pi,{exact:!0,path:`${e.url}/home`,component:P,block:!0}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/my-account`,component:Rr}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/intent`,component:re}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/thank-you`,component:Ur}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/${j.dY}`,component:kt,block:!0}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/${j.dY}/next-gen-camera`,component:Ut}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/${j.dY}/google-home-mini`,component:Gt}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/auth/login`,component:qr}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/auth/authentication`,component:li}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/login`,component:Le}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/authentication`,component:nt}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.dY}/payment-success`,component:ft}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/ln/:encSubId`,component:ft}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.dY}/payment-failure`,component:Ds}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/payment-awaited`,component:rs}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/user/account-link-success`,component:bt}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/user/account-link-failure`,component:Os}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/account-already-linked`,component:ra}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/${j.dY}/sms/account-link/:encSubId`,component:Vt}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/${j.dY}/sms/account-link-success`,component:Wt}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/${j.dY}/sms/sms-account-already-linked`,component:di}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/demo-installation`,component:Kt}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/demo-booking-success`,component:ts}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/demo-booking-failure`,component:ks}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/demo-already-scheduled`,component:Is}),(0,v.jsx)(pi,{exact:!0,allowMsales:!0,path:`${e.url}/${j.dY}/bundle`,component:xi}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.dY}/payment-summary`,component:pt}),(0,v.jsx)(pi,{type:s,exact:!0,allowMsales:!0,path:`${e.url}/${j.dY}/order-address`,component:xi}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.dY}/schedule-installation`,component:wt}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.dY}/booking-success`,component:Jt}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.dY}/booking-failure`,component:Ms}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/relocation`,component:ds}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/select-relocation-address`,component:ps}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/add-relocation-address`,component:vs}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/relocation-summary`,component:js}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/relocation-success`,component:Es}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/relocation-failure`,component:Cs}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/add-camera`,component:xi}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/add-camera-select-address`,component:Bs}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/add-camera-new-address`,component:qs}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/add-camera-payment-summary`,component:Xs}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/add-camera-schedule-installation`,component:ea}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/add-camera-booking-success`,component:ta}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.dY}/renew-subscription`,component:la}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/${j.oh}`,component:ua,block:!0}),(0,v.jsx)(pi,{exact:!0,path:`${e.url}/${j.oh}/hualai-camera`,component:pa}),(0,v.jsx)(pi,{exact:!0,allowMsales:!0,path:`${e.url}/${j.oh}/bundle`,component:xi}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.oh}/order-address`,component:xi}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.oh}/payment-summary`,component:Aa}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.oh}/payment-success`,component:_a}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.oh}/payment-failure`,component:Ea}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/payment-awaited`,component:Da}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.oh}/booking-success`,component:ka}),(0,v.jsx)(pi,{exact:!0,type:s,allowMsales:!0,path:`${e.url}/${j.oh}/booking-failure`,component:Pa}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/demo-installation`,component:Ra}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/demo-booking-success`,component:Fa}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/demo-booking-failure`,component:Ba}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/demo-already-scheduled`,component:Ya}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/relocation`,component:Va}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/select-relocation-address`,component:Wa}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/add-relocation-address`,component:er}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/relocation-summary`,component:sr}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/relocation-success`,component:rr}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/relocation-failure`,component:ir}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/add-camera`,component:xi}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/add-camera-select-address`,component:dr}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/add-camera-new-address`,component:xr}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/add-camera-payment-summary`,component:ur}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/add-camera-schedule-installation`,component:Sr}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/add-camera-booking-success`,component:jr}),(0,v.jsx)(pi,{exact:!0,type:s,path:`${e.url}/${j.oh}/renew-subscription`,component:Cr}),(0,v.jsx)(r.qh,{allowMsales:!0,component:n.default})]}),(0,v.jsx)(i.A,{})]})})},7375(e,t,s){var a=s(64467),r=(s(21396),s(44979)),i=s(52852),n=s(49862),o=s(4798),l=s(18386),c=s(95093),d=s.n(c);function m(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}const u=(e,t)=>
1{if(!n.A.isServer()){const s=window.sessionStorage.getItem("ha");if(s){const a=JSON.parse(s);a[e]=t,window.sessionStorage.setItem("ha",JSON.stringify(a))}else{const s={[e]:t};window.sessionStorage.setItem("ha",JSON.stringify(s))}}},h=e=>{if(!n.A.isServer()){const t=window.sessionStorage.getItem("ha");if(t){const s=JSON.parse(t)[e];if(s)return s}}return null},p=e=>{const t={};return e.forEach(e=>{t[e.field_type&&e.field_type.toLowerCase()]=function(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?m(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):m(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}({},e)}),t};s.d(t,["$4",0,(e,t="ha",s)=>{const a=h("ha");if(a){if("ha"===t){a.cartCount=e,s&&(a.prevCartCount=s);const{productData:t}=a;if(t){const{addedProductData:s}=t;s[0].count=e}}if("add_cam"===t){const{addCameraSession:t}=a;t?(t.camCount=e,s&&(t.prevCartCount=s)):a.addCameraSession={camCount:e,prevCartCount:s}}u("ha",a)}},"FR",0,e=>{if(!e)return"";const t=e.building&&""!==e.building?`${e.building}, `:"",s=e.streetAddress&&""!==e.streetAddress?`${e.streetAddress}, `:"",a=e.streetAddress2&&""!==e.streetAddress2?`${e.streetAddress2}, `:"",r=e.city&&""!==e.city?`${e.city}, `:"",i=e.state&&""!==e.state?`${e.state}-`:"",n=e.postalCode&&""!==e.postalCode?`${e.postalCode}`:"";return`${t}${s}${a}${e.landmark&&""!==e.landmark?`${e.landmark}, `:""}${e.location&&""!==e.location?`${e.location}, `:""}${r}${i}${n}`},"HW",0,()=>{const e=JSON.parse(localStorage.userAuth),{subId:t}=e;return t},"Mg",0,(e,t,s="ha",a="ha")=>{const r=h(a);if(r){if("ha"===s){r.cartCount=e,r.miniCount=t;const{productData:s}=r;if(s){const{addedProductData:a}=s;a[0].count=e,a[1].count=t}}if("add_cam"===s){const{addCameraSession:s}=r;s?(s.camCount=e,s.miniCount=t):r.addCameraSession={camCount:e,miniCount:t}}u(a,r)}},"Om",0,()=>{let e="BUY_CAM";const t=h("ha");return t&&"ADD_CAM"===t.orderType&&(e="ADD_CAM"),e},"PS",0,(e,t="ha",s="ha")=>{const a=h(s);if(a){if("ha"===t){const t={address:e.streetAddress||"",addressline2:e.streetAddress2||"",areaPincode:e.postalCode||"",building:e.building||"",city:e.city||"",emailId:e.email||"",landmark:e.landmark||"",location:e.location||"",state:e.state||"",subId:e.subId||"",subscriberName:e.name||""};a.infoForm=t,a.orderUuid=e.orderUuid}if("add_cam"===t){const t={streetAddress:e.streetAddress||"",streetAddress2:e.streetAddress2||"",postalCode:e.postalCode||"",building:e.building||"",city:e.city||"",email:e.email||"",landmark:e.landmark||"",location:e.location||"",state:e.state||"",subId:e.subId||"",subscriberName:e.name||""},{addCameraSession:s}=a;s?(s.infoForm=t,s.orderUuid=e.orderUuid):a.addCameraSession={infoForm:t,orderUuid:e.orderUuid}}if("relocation"===t){const t={streetAddress:e.streetAddress||"",streetAddress2:e.streetAddress2||"",postalCode:e.postalCode||"",building:e.building||"",city:e.city||"",email:e.email||"",landmark:e.landmark||"",location:e.location||"",state:e.state||"",subId:e.subId||"",subscriberName:e.name||""},{relocate_session:s}=a;s?(s.relocation_address=t,s.orderUuid=e.orderUuid,s.subscriptionId=e.subscriptionId):a.relocate_session={relocation_address:t,orderUuid:e.orderUuid}}u(s,a)}},"Px",0,e=>e.toString().split(".")[0],"Sg",0,async e=>{const t=n.A.isServer()?e:l.Ay;try{const e={apiPath:`${n.A.NODE_API_ROOT}/${o.dV}/read/core-api/product/search/eyJmaWVsZF9qb3VybmV5Ijoid3l6ZSJ9`},s=(await i.n.fetchData(e)).data;s.status===n.A.MESSAGES_TYPES.S3_SUCCESS&&t.dispatch((0,r.PQ)({productData:s.data[0]}))}catch(e){t.dispatch((0,r.x8)(n.A.serverError,!0))}},"VJ",0,(e,t="HA",s="ha")=>{const a=h(s);if("HA"===t)a.paymentStatus=e;else if("ADD_CAM"===t){const{addCameraSession:t}=a;t.paymentStatus=e}u(s,a)},"e",0,u,"j3",0,async e=>{const t=n.A.isServer()?e:l.Ay;try{const e={apiPath:`${n.A.NODE_API_ROOT}/${o.dV}/read/core-api/product/search/eyJmaWVsZF9qb3VybmV5IjoiZ29vZ2xlIn0=`},s=(await i.n.fetchData(e)).data;if(s.status===n.A.MESSAGES_TYPES.S3_SUCCESS){const e=p(s.data);return t.dispatch((0,r.PQ)({productData:e})),s}}catch(e){t.dispatch((0,r.x8)(n.A.serverError,!0))}},"qS",0,async e=>{const t=n.A.isServer()?e:l.Ay,s=new Date;try{const e={apiPath:`${n.A.NODE_API_ROOT}/${o.dV}/read/core-api/subscription/search/${d()(s).format("YYYYMMDD")}`},a=(await i.n.fetchData(e)).data;if(a.status===n.A.MESSAGES_TYPES.S3_SUCCESS)return t.dispatch((0,r.PQ)({subscriptionData:a.data})),a}catch(e){t.dispatch((0,r.x8)(n.A.serverError,!0))}},"u6",0,h])},66410(e,t,s){var a=s(49862),r=s(4798);const i={method:"GET",url:`${a.A.NODE_API_ROOT}/${a.A.home_automation}`,headers:a.A.getHeaders(["JSON"])},n={method:"GET",url:`${a.A.NODE_API_ROOT}/${r.dV}`,headers:a.A.getHeaders(["JSON"])},o={method:"POST",url:`${a.A.NODE_API_ROOT}/${a.A.home_automation}`,headers:a.A.getHeaders(["JSON"])},l={method:"get",headers:a.A.getHeaders(["JSON"]),params:{}};s.d(t,["XN",0,l,"d_",0,o,"vW",0,n,"x4",0,i])},98906(e,t,s){var a=s(64467),r=s(81106),i=s(66410);function n(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function o(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?n(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):n(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const l=new class{getData(e,t){const s=o({},i.x4);s.url=`${s.url}/${e}`,s.params=t;return new r.I(s).doAjax()}fetchData(e){e.mock&&!0===e.mock?i.XN.url=`/mocks/${e.apiPath}.json`:i.XN.url=e.apiPath;return new r.I(i.XN).doAjax()}getJsonData(e,t){const s=o({},i.vW);s.url=`${s.url}/${e}`,s.params=t;return new r.I(s).doAjax()}postData(e,t){const s=o({},i.d_);s.url=`${s.url}/${e}`,s.params=t;return new r.I(s).doAjax()}checkHaUser(e){const t=o({},i.d_);t.url=`${t.url}/order/checkHAUser`,t.params=e;return new r.I(t).doAjax()}};s.d(t,["n",0,l])},75035(e,t,s){s.d(t,{A:()=>o});var a=s(96540),r=s(21247),i=s(74848);const n=e=>{const{detail:t,currentTab:s,toggle:n,deviceAccordianLength:o,allInactive:l,allInactiveBingeDevices:c,activeBingeDevicesLength:d,someInactive:m,someInactiveFTV:u,otherDetails:h}=e,p={vc:"Digicard No",stbSerialNum:"SetTop Box No",status:"Box Status",deviceId:"Device Id"};let g,f=!1;t&&s===t.assetTypeDetails&&(f=!0);const x="MORE Device"!==t.assetType&&1!==o&&(t.warrantyStatus&&"active"===t.warrantyStatus.toLowerCase()||t.status&&"active"===t.status.toLowerCase()||t.status&&"suspend"===t.status.toLowerCase())&&!l||h,b=!x&&"Inactive"!==t.warrantyStatus||1===o,v=1!==o&&"Active"===t.warrantyStatus&&!c&&1!==d;g=c?!v||1===o:!v&&"Inactive"!==t.warrantyStatus||1===o,"MORE Device"===t.assetType||m||l?"MORE Device"!==t.assetType&&(p.warrantyStatus="Warranty Status",p.stbEndDate="Warranty End Date"):(p.assetType="SetTop Box Type",p.connectionType="Type of Connection",p.warrantyStatus="Warranty Status",p.stbEndDate="Warranty End Date"),"MORE Device"!==t.assetType||c||u||(p.assetType="SetTop Box Type",p.connectionType="Type of Connection",p.warrantyStatus="Warranty Status",p.stbEndDate="Warranty End Date");const y=Object.keys(t).filter(e=>Object.keys(p).includes(e));return y&&Array.isArray(y)&&y.length>0?(0,i.jsx)(a.Fragment,{children:("MORE Device"===t.assetType?v:x)?(0,i.jsxs)("div",{className:"acc-cont",children:[(0,i.jsx)("h4",{className:"accordion-toggle1 "+(f?"acc-expanded":"acc-collapsed"),onClick:()=>{n(t.assetTypeDetails)},children:t&&t.assetTypeDetails}),(0,i.jsx)(r.A,{isOpen:f,children:(0,i.jsx)("div",{className:"accordion-content1",children:(0,i.jsx)("div",{className:"pack-contr",children:(0,i.jsx)("ul",{className:"pack-list",children:y.map(e=>(0,i.jsxs)("li",{children:[(0,i.jsx)("span",{className:"bold",children:p[e]}),(0,i.jsx)("span",{className:"Box Status"===p[e]||"Warranty Status"===p[e]?"Active"===t[e]||"Available"===t[e]?"box-active":"Pending Activation"===t[e]?"box-pending":"box-expire":"",children:t[e]})]}))})})})})]}):("MORE Device"===t.assetType?g:b)&&(0,i.jsx)("div",{className:"acc-cont",children:(0,i.jsx)("div",{className:"accordion-content1",children:(0,i.jsx)("div",{className:"pack-contr",children:(0,i.jsx)("ul",{className:"pack-list",children:y.map(e=>(0,i.jsxs)("li",{children:[(0,i.jsx)("span",{className:"bold",children:p[e]}),(0,i.jsx)("span",{className:"Box Status"===p[e]||"Warranty Status"===p[e]?"Active"===t[e]||"Available"===t[e]?"box-active":"Pending Activation"===t[e]?"box-pending":"box-expire":"",children:t[e]})]}))})})})})}):null},o=e=>{const{modalParameters:{device:t,heading:s,otherDetails:r,modalId:o}}=e,[l,c]=(0,a.useState)(""),d=e=>{let t=e;l===e&&(t=""),c(t)},m=t&&Array.isArray(t)&&t.slice(1).every(e=>"Inactive"===e.warrantyStatus),u=t&&Array.isArray(t)&&t.every(e=>"Inactive"===e.warrantyStatus),h=t&&Array.isArray(t)&&t.filter(e=>"Active"===e.warrantyStatus).length,p=t.length,g=t&&Array.isArray(t)&&t.slice(1).some(e=>"Inactive"===e.warrantyStatus),f=t&&Array.isArray(t)&&t.some(e=>"Inactive"===e.warrantyStatus);return(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("div",{className:"heading-sm topline",children:(0,i.jsx)("h1",{id:o?`t-${o}`:void 0,className:"heading1 gradient",children:s})}),(0,i.jsx)("div",{className:"accordion-packchange accordion-parent ",children:(0,i.jsx)("div",{className:"acc-cont",children:(0,i.jsx)("div",{className:"accordion-content default",children:(0,i.jsxs)("div",{className:"accordion-pkchng accordion-parent",children:[(m||1===p)&&(0,i.jsx)(n,{detail:t[0],currentTab:l,toggle:d,deviceAccordianLength:p,allInactive:m,activeBingeDevicesLength:h,allInactiveBingeDevices:u,someInactive:g,someInactiveFTV:f,otherDetails:r},"all-inactive"),!m&&1!==p&&t&&Array.isArray(t)&&t.map(e=>(0,i.jsx)(n,{detail:e,currentTab:l,toggle:d,deviceAccordianLength:p,allInactive:m,allInactiveBingeDevices:u,activeBingeDevicesLength:h,someInactive:g,someInactiveFTV:f,otherDetails:r})),t["Binge Device 1"]&&t["Binge Device 1"].map(e=>(0,i.jsx)(n,{detail:e,currentTab:l,toggle:d}))]})})})})]})}},78725(e,t,s){s.d(t,{A:()=>_});var a=s(64467),r=s(96540),i=s(49862),n=s(45853),o=s(97965),l=s(58156),c=s.n(l),d=s(25242),m=s(67475),u=s(39789),h=(s(11018),s(32960)),p=s(75035),g=s(74848);const f=e=>{const{closeDrawerModal:t,modalParameters:{title:s,subTitle:a,btnTxt:r,bodyTxt:i,modalId:n}}=e;return(0,g.jsxs)("div",{className:"first-popup",children:[(0,g.jsxs)("div",{className:"ser-drawer-wrapp",children:[(0,g.jsxs)("div",{className:"heading-sm text-center",children:[(0,g.jsx)("h1",{id:n?`t-${n}`:void 0,className:"heading1 gradient",children:s&&s}),(0,g.jsx)("h2",{className:"heading2",children:a&&a})]}),i&&(0,g.jsx)("p",{className:"text-center gray-txt",children:i})]}),(0,g.jsx)("div",{className:"btn-contr text-center",children:(0,g.jsx)("button",{type:"button",className:"btn btn-height btn-secondary waves-effect waves-light",onClick:()=>t(),children:r})})]})};s(71725);var x=s(21439),b=s(26304),v=s(92568),y=s(12555),S=s(62193),j=s.n(S),A=s(37541),N=s(44979);function C(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function w(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?C(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):C(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const _=(0,n.y)(e=>{const{jsonData:t,device:s,history:a,pauseResumeData:n,moreDeviceAvailable:l,firstActivationDate:S}=e,{field_json_data:C}=t,_="device",E=s[0],T=E&&E.vc?E.vc.substr(E.vc.length-4):null,D=(0,o.wA)(),{deviceData:O,accountStatus:k,balanceData:P}=(0,o.d4)(e=>e.deviceDetailReducer),I={HD:"HD Set Top Box","4K":"UHD 4K Set Top Box",HD4K:"UHD 4K Set Top Box",HDPVRTransfer:"HD Set Top Box + Recorder",HDPVR:"HD Set Top Box + Recorder",Standard:"SD Set Top Box",Android:"Tata Play Binge+","MORE Device":"Amazon Firetv Stick"},[M,$]=(0,r.useState)(!1),[R,L]=(0,r.useState)(E?E.vcAlias:null),[F,U]=(0,r.useState)(E?E.vcAlias:null),[B,H]=(0,r.useState)(!1),[Y,G]=(0,r.useState)(!0),[J,q]=(0,r.useState)(!0),V=O&&O.filter(e=>e.stbNumber===E.stbSerialNum),z=E&&"Set Top Box"===E.assetTypeDetails&&V&&V[0]?V[0]:{},W=!(!z||"Primary"!==z.assetType)&&l,X=e=>{e.preventDefault(),""!==F?F!==E.vcAlias&&""!==F&&(H(!1),(async e=>{(await d.T.editBox(e)).data.status===i.A.MESSAGES_TYPES.SUCCESS&&(L(F),$(!M))})({vcNumber:E.vc,newBoxName:F})):H(!0)},Z=(e="device_detail")=>{let t=c()(C,"modal.non_warranty_modal.modalText","");"warranty_detail"===e&&(t=c()(C,"modal.warranty_modal.modalText","")),(0,x.Sw)({event:"STB - Device Details","Box ID":T||null,"Box Name":I[E.assetType]||null,"Sub ID":(0,x.Xo)().id||null}),D((0,m.qf)(u.lx.COMMON_MODAL,{Component:p.A,modalId:`device-modal-${s&&(s.serialNumber||s.deviceId)||"device"}`,device:s,heading:t,parentClass:"warranty-popup",draggerWidth:"87%"}))},Q=(e,t,s,a,r,i,o)=>{D((0,m.qf)(u.lx.COMMON_MODAL,{Component:b.A,modalId:"device-confirm-resume",parentClass:"drawer-popup confirm-resume",backDropClass:"bottom-sheet",stbNumber:e,stbType:t,actionType:s,vcSubStatus:a,isPartialPause:r,pauseResumeData:n,resumeAll:i,suspensionType:o}))},K=!["Deactivated","Deactive"].includes(k)&&("Active"===z.vcStatus&&"Android"===z.serviceType&&["DTH"].includes(z.androidPackType)&&j()(z.ottPack)&&j()(z.amazonPrimePacks)&&!j()(z.ldpPack)&&(!j()(z.ldpPack)&&(z.ldpPack.some(e=>e.isBingePlusPack)&&z.ldpPack.every(e=>!e.linearLdpPackExist&&!e.trailPackAvailable))||!j()(z.ldpPack)&&(z.ldpPack.some(e=>e.isBingePlusPack)&&z.ldpPack.every(e=>e.linearLdpPackExist&&e.offer_type&&!e.trailPackAvailable)))&&!W),ee=!["Deactivated","Deactive"].includes(k)&&("Active"===z.vcStatus&&"Android"===z.serviceType&&["COMVIVA"].includes(z.androidPackType)&&j()(z.ottPack)&&j()(z.amazonPrimePacks)&&(j()(z.ldpPack)||!j()(z.ldpPack)&&(z.ldpPack.every(e=>!e.linearLdpPackExist)||z.ldpPack.filter(e=>e.linearLdpPackExist).every(e=>e.linearLdpPackExist&&e.offer_type)))&&!j()(z.androidComvivaData)&&z.androidComvivaData.ldp&&!W),te=("Secondary"!==z.assetType||!["Temp Suspension","Deactive","Deactivated"].includes(k)||"Active"===z.vcStatus&&("Active"!==z.vcStatus||"DTH Only"!==z.vcSubStatus))&&(("Primary"===z.assetType?"Active"!==z.vcStatus&&"DTH Only"===z.vcSubStatus:"Active"!==z.vcStatus)||["Deactive","Deactivated"].includes(k)&&"Active"===z.vcStatus&&"DTH Only"===z.vcSubStatus),se=!["Deactivated","Deactive"].includes(k)&&(E&&"Primary"!==E.connectionType&&"Active"===E.vcStatus&&!K&&!ee),ae=O&&O[0]&&O[0].pauseResume&&(O[0].pauseResume.ottCombo>1||O.some(e=>e.pauseResume.trialBingePlusPack)||O[0].pauseResume.ftv),re=s&&Array.isArray(s)&&s.slice(1).every(e=>"Inactive"===e.warrantyStatus),ie=s&&Array.isArray(s)&&s.every(e=>"Inactive"===e.warrantyStatus),ne=s&&Array.isArray(s)&&s.slice(1).every(e=>"Active"===e.warrantyStatus),oe=s&&Array.isArray(s)&&s.every(e=>"Active"===e.warrantyStatus),le=s&&Array.isArray(s)&&!ne&&!re||1===s.length,ce=s&&Array.isArray(s)&&!ie&&!oe;return(0,g.jsx)("div",{className:"card",tabIndex:"0",children:(0,g.jsxs)("div",{className:"card-body",children:[E&&"Active"!==E.status&&(0,g.jsx)("div",{className:"inactive",children:"INACTIVE"}),(0,g.jsxs)("div",{className:"pack-header h-min",children:[(0,g.jsxs)("div",{className:"lft-contr",children:[(0,g.jsxs)("div",{className:"alias-ctr",children:[R&&E&&"Active"!==E.status&&(0,g.jsx)("h2",{className:"main-txt",children:R}),!R&&"MORE Device"===E.assetType&&(0,g.jsx)("h2",{className:"main-txt show-full-name",children:"Binge Device"}),R&&E&&"Active"===E.status&&(0,g.jsx)("span",{children:M?(0,g.jsxs)(r.Fragment,{children:[(0,g.jsx)("input",{type:"text",name:"input",value:F,className:"inputval",onChange:e=>{""!==e.target.value&&H(!1),U(e.target.value)},maxLength:"50"}),(0,g.jsx)("a",{href:"javascript:void(0)",className:"edit mL10 update-mode",onClick:e=>X(e),children:(0,g.jsx)("img",{src:"/assets/images/update.svg",alt:"",height:"15"})})]}):(0,g.jsxs)("div",{children:[(0,g.jsx)("h2",{className:"main-txt",children:R}),(0,g.jsx)("a",{href:"javascript:void(0)",className:"edit mL10",tabIndex:"0",onClick:()=>$(!0),children:(0,g.jsx)("img",{src:"/assets/images/edit_pencil-d.svg",alt:"",height:"14",width:"9"})})]})})]}),B&&(0,g.jsx)("div",{class:"error-msg",children:"Enter a name for your Set Top Box"}),T&&(0,g.jsx)("div",{className:"sub-txt",children:`${E.connectionType&&E.connectionType} Box Id: ${T}`})]}),(0,g.jsxs)("div",{className:"rit-contr",children:[(0,g.jsx)("div",{className:"upgrade-text",children:E&&["Android","HD4K","4K","MORE Device"].includes(E.assetType)?null:E&&E.assetType&&(0,g.jsxs)("a",{href:"javascript:void(0)",onClick:e=>{return t=E.vc,void a.push({pathname:`/${i.A.upgrade_stb_path}`,state:{vcNumber:t}});var t},children:[(0,g.jsx)("img",{src:"/assets/images/upgrade.svg",height:"15",className:"bounce-1"})," ","Upgrade"]})}),(0,g.jsx)("div",{className:"sub-txt",children:E&&E.assetType&&I[E.assetType]})]})]}),(0,g.jsxs)("div",{className:"pack-body",children:[(0,g.jsxs)("div",{className:"body-img-wrapp",children:[E&&E.assetType&&"MORE Device"===E.assetType&&C.MORE_Device&&(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+C.MORE_Device.imgUrl,alt:""}),E&&E.assetType&&C[E.assetType]&&(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+C[E.assetType].imgUrl,alt:""})]}),E&&(0,g.jsxs)("div",{className:"warranty-wrapp",children:[("MORE Device"===E.assetType?oe:ne&&s.length>1)&&(0,g.jsxs)("div",{className:"warranty-blk",onClick:()=>Z("warranty_detail"),children:[(0,g.jsx)("div",{className:"warranty-img",children:(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+c()(C,"modal.warranty_modal.iconUrl",""),alt:"",style:{height:"30px"}})}),(0,g.jsx)("div",{className:"warranty-text",children:c()(C,"modal.warranty_modal.modalText","")})]}),("MORE Device"===E.assetType?ie:re&&s.length>1)&&(0,g.jsxs)("div",{className:"warranty-blk",onClick:()=>Z("non_warranty_modal"),children:[(0,g.jsx)("div",{className:"warranty-img",children:(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+c()(C,"modal.non_warranty_modal.iconUrl",""),alt:"",style:{height:"30px"}})}),(0,g.jsx)("div",{className:"warranty-text",children:c()(C,"modal.non_warranty_modal.modalText","")})]}),("MORE Device"===E.assetType?ce:le)&&(0,g.jsxs)("div",{className:"warranty-blk",onClick:()=>Z(),children:[(0,g.jsx)("div",{className:"warranty-img",children:(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+c()(C,"modal.details_modal.iconUrl",""),alt:"",style:{width:"30px"}})}),(0,g.jsx)("div",{className:"warranty-text",children:c()(C,"modal.details_modal.modalText","")})]}),E.vcStatus&&(se||te)&&(0,g.jsx)("div",{className:"warranty-blk cta-contr pause-resume-contr",children:(0,g.jsxs)("div",{className:"act-btn-contr",children:[se&&(0,g.jsx)("div",{className:"pauseblk",id:"pauseblk",children:(0,g.jsxs)("div",{className:"leftbox",onClick:()=>J?(async(e,t)=>{const s=w({},E);s.boxId=T,s.stbNumber=s.stbSerialNum,s.assetType=s.connectionType,(0,x.Sw)({event:"STB - Pause Set Top Box","Box ID":T||null,"Box Name":I[E.assetType]||null,"Sub ID":(0,x.Xo)().id||null});
1try{const a={stbNumber:e,stbType:t,actionType:"Suspend",isPartialPause:!1},r=await d.T.checkSuspensionStatus(w(w({},a),{},{firstActivationDate:S})),o=r.data.data;r.data.status===i.A.MESSAGES_TYPES.SUCCESS?o.firstActivationStatus||o.pending||o.pastSuspensionDate?D((0,m.qf)(u.lx.COMMON_MODAL,{Component:v.A,modalId:"device-pause-suspend-box",parentClass:"drawer-popup pause-suspend-modal",backDropClass:"bottom-sheet",responseData:o,pauseResumeData:n,isMulti:O&&O.length>1,type:"boxLevel"})):D((0,m.qf)(u.lx.COMMON_MODAL,{Component:h.A,modalId:"device-suspend",boxData:s,source:_,title:c()(C,"modal.pause_modal.heading",""),subTitle:c()(C,"modal.pause_modal.label",""),parentClass:"drawer-popup resume",backDropClass:"bottom-sheet",boxTypeName:I[E.assetType]||null,setPauseTimeOut:q,staticData:C&&C.btn_timeOut,pauseResumeData:n,isMulti:O&&O.length>1})):D((0,N.x8)(i.A.serverError,!0))}catch(e){(0,x.oS)(e,()=>{D((0,N.x8)(i.A.serverError,!0))})}})(E.stbSerialNum,E.connectionType):null,children:[(0,g.jsx)("div",{className:""+(J?"warranty-img":"warranty-img disabled-btn"),children:(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+c()(C,"modal.pause_modal.iconUrl",""),className:"pause-icon",alt:"",style:{width:"30px"}})}),(0,g.jsx)("div",{className:""+(J?"warranty-text":"warranty-text disabled-btn"),children:c()(C,"modal.pause_modal.modalText","")})]})}),te&&(0,g.jsx)("div",{className:"resumeblk",id:"resumeblk",children:(0,g.jsxs)("div",{className:"leftbox",onClick:()=>{return Y?(e=E.stbSerialNum,t=E.connectionType,s="Resume",a=E.vcSubStatus,r=!1,i=!1,void(["Deactive","Deactivated"].includes(k)&&P.balance<(n&&n.dbr_days)*P.dbr?D((0,m.qf)(u.lx.COMMON_MODAL,{Component:A.A,modalId:"device-recharge-resume",parentClass:"drawer-popup recharge-resume",backDropClass:"bottom-sheet"})):Q(e,t,s,a,r,i))):null;var e,t,s,a,r,i},children:[(0,g.jsx)("div",{className:""+(Y?"warranty-img":"warranty-img disabled-btn"),children:(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+c()(C,"modal.resume_modal.iconUrl",""),className:"resume-icon",alt:""})}),(0,g.jsx)("div",{className:""+(Y?"warranty-text":"warranty-text disabled-btn"),children:c()(C,"modal.resume_modal.modalText","")})]})})]})}),"Active"===k&&"Active"===E.vcStatus&&"Primary"===E.connectionType&&!ae&&!se&&!K&&!ee&&(0,g.jsx)("div",{className:"warranty-blk cta-contr pause-resume-contr",children:(0,g.jsx)("div",{className:"act-btn-contr",children:(0,g.jsx)("div",{className:"pauseblk",id:"pauseblk",children:(0,g.jsxs)("div",{className:"leftbox",onClick:()=>J?(async(e,t)=>{try{const s={stbNumber:e,stbType:t,actionType:"Suspend",isPartialPause:!1};O&&O[0].pauseResume&&1===O[0].pauseResume.ottCombo?s.suspensionType="OTT":s.suspensionType="FULL";const a=await d.T.checkSuspensionStatus(w(w({},s),{},{firstActivationDate:S})),r=a.data.data;a.data.status===i.A.MESSAGES_TYPES.SUCCESS?r.firstActivationStatus||r.pending||r.pastSuspensionDate?D((0,m.qf)(u.lx.COMMON_MODAL,{Component:v.A,modalId:"device-pause-suspend-acc",parentClass:"drawer-popup pause-suspend-modal",backDropClass:"bottom-sheet",responseData:r,pauseResumeData:n,isMulti:O&&O.length>1,type:"accLevel"})):D((0,m.qf)(u.lx.COMMON_MODAL,{Component:y.A,modalId:"device-account-level-pause",parentClass:"drawer-popup accLevel-pause-modal",backDropClass:"bottom-sheet",payload:s,activeBingePack:O&&O.some(e=>e&&e.pauseResume&&e.pauseResume.activeBingePack),paidFtv:O&&O[0]&&O[0].pauseResume&&O[0].pauseResume.paidFtv,unpaidFtv:O&&O[0]&&O[0].pauseResume&&O[0].pauseResume.unpaidFtv,comboEndDate:O&&O[0]&&O[0].pauseResume&&O[0].pauseResume.comboEndDate,pauseResumeData:n,isMulti:O&&O.length>1})):D((0,N.x8)(i.A.serverError,!0))}catch(e){(0,x.oS)(e,()=>{D((0,N.x8)(i.A.serverError,!0))})}})(E.stbSerialNum,E.connectionType):null,children:[(0,g.jsx)("div",{className:""+(J?"warranty-img":"warranty-img disabled-btn"),children:(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+c()(C,"modal.pause_modal.iconUrl",""),className:"pause-icon",alt:"",style:{width:"30px"}})}),(0,g.jsx)("div",{className:""+(J?"warranty-text":"warranty-text disabled-btn"),children:O&&1===O.length?n&&n.pauseCta:n&&n.pauseAllCta})]})})})}),"Primary"===E.connectionType&&O.every(e=>"Active"!==e.vcStatus&&"DTH Only"!==e.vcSubStatus)&&(0,g.jsx)("div",{className:"warranty-blk cta-contr pause-resume-contr",children:(0,g.jsx)("div",{className:"act-btn-contr",children:(0,g.jsx)("div",{className:"resumeblk",id:"resumeblk",children:(0,g.jsxs)("div",{className:"leftbox",onClick:()=>Y?Q(E.stbSerialNum,E.connectionType,"Resume",E.vcSubStatus,!1,O&&O.length>1,O&&O[0]&&O[0].pauseResume&&1===O[0].pauseResume.ottCombo?"OTT":"FULL"):null,children:[(0,g.jsx)("div",{className:""+(Y?"warranty-img":"warranty-img disabled-btn"),children:(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+c()(C,"modal.resume_modal.iconUrl",""),className:"resume-icon",alt:""})}),(0,g.jsx)("div",{className:""+(Y?"warranty-text":"warranty-text disabled-btn"),children:O&&1===O.length?n&&n.resumeCta:n&&n.resumeAllCta})]})})})}),"Inactive"===E.vcStatus&&(0,g.jsxs)("div",{className:"warranty-blk",onClick:()=>{(0,x.Sw)({event:"STB - Activate Set Top Box","Box ID":T||null,"Box Name":I[E.assetType]||null,"Sub ID":(0,x.Xo)().id||null}),D((0,m.qf)(u.lx.COMMON_MODAL,{Component:f,modalId:"device-activate-prompt",title:c()(C,"modal.activate_modal.heading",""),subTitle:c()(C,"modal.activate_modal.label",""),btnTxt:c()(C,"modal.activate_modal.primary_Btn_Label",""),parentClass:"drawer
1-popup mp-ncf",backDropClass:"bottom-sheet",draggerWidth:"87%"}))},children:[(0,g.jsx)("div",{className:"warranty-img",children:(0,g.jsx)("img",{src:i.A.NODE_API_ROOT+c()(C,"modal.activate_modal.iconUrl",""),className:"activate-icon",alt:""})}),(0,g.jsx)("div",{className:"warranty-text",children:c()(C,"modal.activate_modal.modalText","")})]})]})]})]})})})},9798(e,t,s){var a=s(96540),r=s(49862),i=s(67475),n=s(97965),o=s(62193),l=s.n(o),c=s(15064),d=s(74848);const m=({modalParameters:{offerInfo:e,redirectToRecharge:t,callOfferAcceptanceApi:s,pageData:o,primaryBtnTxt:m,secBtnTxt:u,modalId:h}})=>{const p=(0,n.wA)();e&&e.offerDetails;return(0,d.jsxs)(a.Fragment,{children:[(0,d.jsxs)("div",{className:"extra-Apps binge-flexi-nbafs",children:[(0,d.jsx)("div",{class:"text-center mB20",children:(0,d.jsx)("img",{src:`${r.A.NODE_API_ROOT}${e&&e.offerDetails&&e.offerDetails.bingeLogo}`,alt:"Tata Play Binge",width:"80"})}),(0,d.jsx)("div",{class:"heading-xs text-center mB5",children:(0,d.jsx)("h2",{id:h?`t-${h}`:void 0,class:"heading1 font-semibold",children:e&&e.offerDetails&&e.offerDetails.ottApp.replace("{ottApp}",e.offerDetails.flexiApps.complimentaryApps.length+e.offerDetails.flexiAppCount)})}),(0,d.jsxs)("div",{class:"pricing text-center price-highlighted",children:["at ",((e,t)=>{const s=parseFloat(e).toFixed(2).split(".");return(0,d.jsxs)(a.Fragment,{children:[(0,d.jsxs)("span",{className:"rupee",children:["â¹",s[0]," "]}),t&&(0,d.jsx)("span",{className:"rupee-text",children:"Annual"===t?"/year":"Half Yearly"===t||"Semi Annual"===t?"/6 months":"Quarterly"===t?"/3 months":"/month"})]})})(e&&e.pack_mrp&&e.pack_mrp,e.offerDetails&&(e.offerDetails.packUom&&e.offerDetails.packUom||e.offerDetails.pack_uom&&e.offerDetails.pack_uom))]}),(0,d.jsxs)("div",{className:"app-info text-center",children:[(0,d.jsxs)("span",{className:"app-dtl font-md",children:[(0,d.jsxs)("span",{className:"no",children:[e&&e.offerDetails&&e.offerDetails.deviceCount," "]}),""+(e&&e.offerDetails&&e.offerDetails.deviceCount>1?"devices at a time":"device at a time")]}),(0,d.jsx)("span",{className:"mL5 margin5",children:"|"}),(0,d.jsx)("span",{className:"app-dtl",children:e&&e.offerDetails&&e.offerDetails.subText})]}),(0,d.jsxs)("div",{id:"extra-Apps",className:"more-packs",children:[(0,d.jsx)("ul",{className:"binge-steps",children:e&&!l()(e&&e.offerDetails&&e.offerDetails.mfyBenifits)&&e.offerDetails.mfyBenifits.map(t=>(0,d.jsxs)("li",{children:[(0,d.jsx)("div",{className:"step",children:(0,d.jsx)("img",{src:`${r.A.NODE_API_ROOT}${t.img}`,alt:"Buy"})}),(0,d.jsx)("div",{className:"text-contr",children:(0,d.jsx)("span",{dangerouslySetInnerHTML:{__html:t&&t.txt1&&t.txt1.replace("{complimentaryCount}",e.offerDetails.flexiApps.complimentaryApps.length).replace("{appCount}",e.offerDetails.flexiAppCount)}})})]}))}),e&&e.offerDetails&&e.offerDetails.PopupHeading&&(0,d.jsx)("p",{className:"text-center enjoy-ott-heading",children:e&&e.offerDetails&&e.offerDetails.PopupHeading}),(0,d.jsx)("div",{className:"apps-block",children:(0,d.jsxs)(a.Fragment,{children:[(0,d.jsx)("p",{class:"selected-apps-title text-left mT20",children:e&&e.offerDetails&&e&&e.offerDetails.appText&&(0,d.jsx)("span",{dangerouslySetInnerHTML:{__html:e&&e.offerDetails&&e&&e.offerDetails.appText.replace("{appCount}",e.offerDetails.flexiAppCount)}})}),e&&e.offerDetails&&e.offerDetails.flexiApps&&e.offerDetails.flexiApps.nonComplimentaryApps&&e.offerDetails.flexiApps.nonComplimentaryApps.length>0&&(0,d.jsx)("ul",{class:"listing-contr mT10",children:e&&e.offerDetails&&e.offerDetails.flexiApps&&e.offerDetails.flexiApps.nonComplimentaryApps.map((e,t)=>(0,d.jsxs)("li",{children:[(0,d.jsx)("img",{src:(0,c.mpCreateImagePath)(e),alt:"",className:"img-fluid"},t)," "]},t))}),e&&e.offerDetails&&e.offerDetails.flexiApps&&e.offerDetails.flexiApps.complimentaryApps&&e.offerDetails.flexiApps.complimentaryApps.length>0&&(0,d.jsxs)("div",{class:"app-contr-new mT10",children:[(0,d.jsxs)("div",{class:"d-flex align-items-center",children:[(0,d.jsx)("img",{src:`${r.A.NODE_API_ROOT}${e.offerDetails.complimentaryGiftIcon&&e.offerDetails.complimentaryGiftIcon}`,id:"a",class:"gift-animation mR5"}),e.offerDetails&&e.offerDetails.complimentaryBoxTxt&&e.offerDetails.complimentaryBoxTxt.replace("{complimentaryCount}",e&&e.offerDetails&&e.offerDetails.flexiApps.complimentaryApps.length)]}),(0,d.jsx)("ul",{className:"listing-contr mT10",children:e&&e.offerDetails&&e.offerDetails.flexiApps&&e.offerDetails.flexiApps.complimentaryApps.map((e,t)=>(0,d.jsxs)("li",{children:[(0,d.jsx)("img",{src:(0,c.mpCreateImagePath)(e),alt:"",className:"img-fluid"},t)," "]},t))})]}),e&&e.offerDetails&&e.offerDetails.bulletListText&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:e&&e.offerDetails&&e.offerDetails.bulletListText.replace("{complimentaryCount}",e&&e.offerDetails&&e.offerDetails.flexiApps.complimentaryApps.length)}})]})})]})]}),(0,d.jsxs)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:[(0,d.jsx)("button",{onClick:()=>s(),className:"btn btn-primary waves-effect waves-light",children:m}),(0,d.jsx)("button",{onClick:()=>p((0,i.Oo)()),className:"btn btn-secondary waves-effect waves-light","data-dismiss":"modal",children:u})]})]})};s.d(t,["A",0,m])},40310(e,t,s){s.d(t,{A:()=>g});var a=s(96540),r=s(49862),i=s(21439),n=s(67475),o=s(97965),l=s(74848);const c=({modalData:{offerInfo:e,redirectToRecharge:t,pageData:s},primaryBtnTxt:r,secBtnTxt:c,modalId:d})=>{const m=(0,o.wA)(),u=(e&&(0,i.ZG)(e,"felxiDesc1",{user_mbr:e.felxiAmount||"",apv_amount:e.packMRP||"",cashback_value:e.cashbackValue||"",recharge_amount:e.rechargeAmount||"",offer_value:e.offerValue||"",pack_uom:(0,i.E8)(e.offerKey)||""},{})?(0,i.ZG)(e,"felxiDesc1",{user_mbr:e.felxiAmount||"",apv_amount:e.packMRP||"",cashback_value:e.cashbackValue||"",recharge_amount:e.rechargeAmount||"",offer_value:e.offerValue||"",pack_uom:(0,i.E8)(e.offerKey)||""},{}):[])||[],h=e?(0,i.ZG)(e,"offerDrawerFooter",{},{}):null,p=e?(0,i.ZG)(e,"felxiDesc2",{},{}):null,g=e?(0,i.ZG)(e,"offerDrawerTitle",{pack_uom:(0,i.E8)(e.offerKey)},{width:"20",height:"18"}):null;return(0,l.jsxs)(a.Fragment,{children:[(0,l.jsx)("div",{className:"heading-sm text-center mB20",children:(0,l.jsxs)("h2",{id:d?`t-${d}`:void 0,className:"heading1 gradient",children:[g&&g.imageUrl&&(0,l.jsx)("img",{height:"24",src:g.imageUrl,alt:"Rupee Icon"})," ",g&&g.text&&(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:g.text}})]})}),u&&(0,i.dn)(u).map((e,t)=>(0,l.jsx)("div",{id:"bold-line",dangerouslySetInnerHTML:{__html:e.meta?e.meta:e.text}},t)),p&&p.text&&(0,l.jsx)("div",{className:"card cashback-info-contr mT10",children:(0,l.jsx)("div",{className:"card-body",children:p.text})}),h&&h.imageUrl&&(0,l.jsxs)("div",{className:"cashback-contr mT20",children:[(0,l.jsx)("span",{className:"icon-contr",children:(0,l.jsx)("img",{src:h.imageUrl,alt:"Power Button Icon",className:"mR10",width:"16"})}),(0,l.jsx)("span",{className:"text-contr",children:h.text})]}),(0,l.jsxs)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:[t&&e&&(0,l.jsx)("button",{onClick:()=>t(e),className:"btn btn-primary waves-effect waves-light",children:r}),(0,l.jsx)("button",{onClick:()=>m((0,n.Oo)()),className:"btn btn-secondary waves-effect waves-light","data-dismiss":"modal",children:c})]})]})},d=e=>{const{modalData:{offerInfo:t,redirectToRecharge:s},primaryBtnTxt:r,secBtnTxt:c,modalId:d}
1=e,m=(0,o.wA)(),u=(0,i.ZG)(t,"offerName")||null,h=(0,i.ZG)(t,"felxiDesc1")||null,p=(0,i.ZG)(t,"felxiDesc2")||null,g=(0,i.ZG)(t,"offerDrawerFooter")||null;return(0,l.jsxs)(a.Fragment,{children:[(0,l.jsxs)("div",{className:"more-packs",id:"smart-upgrade",children:[(0,l.jsxs)("div",{className:"heading-sm text-center mB20",children:[u&&(0,l.jsx)("h2",{id:d?`t-${d}`:void 0,className:"heading1 gradient",dangerouslySetInnerHTML:{__html:u.text}}),h&&(0,l.jsx)("h2",{className:"heading2",children:h.text})]}),(0,l.jsxs)("div",{className:"innercontainer-xs",children:[(0,l.jsx)("div",{className:"mT5 mB5",children:(0,l.jsx)("img",{src:"/assets/images/add-purple.svg",alt:"Addition"})}),h&&h.imageUrl&&(0,l.jsx)("div",{className:"appunit-contr",children:(0,l.jsx)("img",{src:h.imageUrl,alt:"App Unit",className:"img-fluid"})}),p&&(0,l.jsx)("p",{className:"mT20 small font-medium",dangerouslySetInnerHTML:{__html:p.text}}),(0,l.jsx)("div",{className:"card card-purple10 cardNo-sdo-brdr mT20",children:g&&(0,l.jsx)("div",{id:"bold-line",className:"card-body text-left d-block",dangerouslySetInnerHTML:{__html:g.text}})})]})]}),(0,l.jsxs)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:[(0,l.jsx)("button",{onClick:()=>s(t),className:"btn btn-primary waves-effect waves-light",children:r}),(0,l.jsx)("button",{onClick:()=>m((0,n.Oo)()),className:"btn btn-secondary waves-effect waves-light","data-dismiss":"modal",children:c})]})]})};var m=s(21247),u=s(60676);const h=({modalData:{offerInfo:e,redirectToRecharge:t,pageData:s},closeDrawerModal:n,primaryBtnTxt:c,secBtnTxt:d,modalId:h})=>{const[p,g]=(0,a.useState)([]),[f,x]=(0,a.useState)(""),[b,v]=(0,a.useState)(!1),y=((0,o.wA)(),(0,i.ZG)(e,"packPurpleTag")||null),S=`${r.A.NODE_API_ROOT}/s3-api/v1/assets/channels/default-channel.png`,j=s&&s.knowMoreData&&e&&e.type&&s.knowMoreData[e.type]?s.knowMoreData[e.type]:null;(0,a.useEffect)(()=>{e&&e.channels&&g((0,i.zZ)(e.channels))},[]);return(0,l.jsxs)(a.Fragment,{children:[(0,l.jsx)("div",{className:"heading-sm text-center mB10",children:e&&e.packFriendlyName&&(0,l.jsx)("h2",{id:h?`t-${h}`:void 0,className:"heading1 gradient",children:e.packFriendlyName})}),(0,l.jsxs)("div",{className:"more-packs ldp-modal",children:[e&&"LDP_HOLDING"===e.offerType?(0,l.jsx)("div",{className:"innercontainer-xs mB20",children:(0,l.jsx)("div",{className:"card cashback-info-contr",children:(0,l.jsx)("div",{className:"card-body",children:j&&j.packTxt})})}):null,(0,l.jsx)("div",{className:"pack-blk",children:(0,l.jsxs)("div",{className:"pack-card-inner text-left",children:[(0,l.jsxs)("div",{className:"ott-dtl-info",children:[(0,l.jsx)("div",{className:"label-heading",children:j&&j.chnlTxt}),(0,l.jsx)("div",{className:"channel-type mT0",children:(0,l.jsxs)("div",{className:"channel-blk-wrapp dflex-fs",children:[(0,l.jsxs)("div",{className:"channel-blk data",style:{display:"flex"},children:[(0,l.jsx)("img",{src:"/assets/images/hd-pack.svg",alt:"HD",width:"24"}),e&&e.hd_count]}),(0,l.jsxs)("div",{className:"channel-blk data",style:{display:"flex"},children:[(0,l.jsx)("img",{src:"/assets/images/sd-pack.svg",alt:"SD",width:"24"}),e&&e.sd_count]})]})})]}),(0,l.jsxs)("div",{className:"ott-dtl-info",children:[(0,l.jsx)("div",{className:"label-heading",children:j&&j.packAmtTxt}),(0,l.jsxs)("div",{className:"data",children:["â¹",e&&e.rechargeAmount]}),y&&(0,l.jsx)("div",{className:"saveTxt-only",children:y.text})]})]})}),(0,l.jsx)("div",{id:"accordion-cl-1",className:"multilevel mT20",children:p&&p.map((e,t)=>(0,l.jsxs)("div",{className:"card "+(0!==t?"mT10":""),children:[(0,l.jsx)("div",{className:"card-header",onClick:()=>{return t=e.id,void x(f===t?"":t);var t},id:"heading-cl-1-1",children:(0,l.jsx)("h5",{className:"card-header-inner",children:(0,l.jsxs)("a",{className:"collapsed","data-toggle":"collapse",href:"javascript:void(0)","aria-expanded":f===e.id?"true":"","aria-controls":"collapse-1-1",children:[(0,l.jsx)("span",{className:"channel-name",children:e.id}),(0,l.jsxs)("span",{className:"channel-count",children:[e.channels.length," Channels"]})]})})}),(0,l.jsx)(m.A,{isOpen:f===e.id,children:(0,l.jsxs)("div",{className:"card-body",children:[(0,l.jsx)("div",{className:"hindi-e
1ntertain-logo channel-logo-view",children:e.channels&&e.channels.slice(0,b?e.channels.length:4).map((e,t)=>{const s="Y"===e.HD_FLAG&&"HD"===e.BM_CATEGORY,a="Y"===e.HD_FLAG&&"4K"===e.BM_CATEGORY,r="N"===e.HD_FLAG;return(0,l.jsxs)("div",{className:"ente-logo-wrapp",children:[(0,l.jsxs)("span",{className:"defination-tag",children:[a&&(0,l.jsx)("div",{className:"chnl-def channel-4k",children:"4K"}),s&&(0,l.jsx)("div",{className:"chnl-def",children:"HD"}),r&&(0,l.jsx)("img",{src:"/assets/images/sd-pack.svg",width:"24",alt:"SD"})]}),(0,l.jsx)("div",{className:"ente-logo",children:(0,l.jsx)(u.A,{src:(0,i.zp)(e.CHANNEL_NAME),alt:e.CHANNEL_NAME,title:e.CHANNEL_NAME,className:"img-fluid",altImage:S})}),(0,l.jsxs)("div",{className:"label",children:[(0,l.jsxs)("span",{className:"incl-info",children:["Ch. ",e.EPG_NUMBER]}),e.CHANNEL_NAME]})]},t)})}),e.channels&&e.channels.length>4&&(0,l.jsx)("div",{className:"text-center mT20 linkfont",children:(0,l.jsx)("a",{onClick:()=>v(!b),href:"javascript:void(0)",className:"viewmore",children:b?j&&j.viewLessTxt:j&&j.viewAlltxt})})]})})]},e.id))})]}),(0,l.jsxs)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:[(0,l.jsx)("button",{onClick:()=>t&&e&&t(e),className:"btn btn-primary waves-effect waves-light",children:c}),(0,l.jsx)("button",{onClick:()=>n(),className:"btn btn-secondary waves-effect waves-light","data-dismiss":"modal",children:d})]})]})},p=({modalData:{offerInfo:e,redirectToRecharge:t,pageData:s},primaryBtnTxt:r,secBtnTxt:c,modalId:d})=>{const m=(0,o.wA)(),u=e&&e.felxiDesc1?(0,i.En)(e.felxiDesc1,{user_mbr:e.felxiAmount||"",binge_amount:e.packMRP||""},{width:40,height:40}):[],h=u?(0,i.dn)(u):[],p=e&&e.offerDrawerFooter?(0,i.aV)(e.offerDrawerFooter):[],g=e?(0,i.ZG)(e,"felxiDesc2",{},{}):null,f=e?(0,i.ZG)(e,"offerDrawerTitle",{},{width:"60",height:"18"}):null;return(0,l.jsx)(a.Fragment,{children:(0,l.jsxs)("div",{className:"binge-flexi-modal",children:[(0,l.jsx)("div",{className:"text-center mB10",children:f&&f.imageUrl&&(0,l.jsx)("img",{height:"24",src:f.imageUrl,alt:"Rupee Icon"})}),(0,l.jsx)("div",{className:"heading-sm text-center mB20",children:(0,l.jsx)("h2",{id:d?`t-${d}`:void 0,className:"heading1 gradient",children:f&&f.text&&(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:f.text}})})}),h&&h.map((e,t)=>e.meta?(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:e.meta}},`meta-${t}`):(0,l.jsx)("span",{className:"text-contr binge-flexi-span",dangerouslySetInnerHTML:{__html:e.text}},`txt-${t}`)),g&&g.text&&(0,l.jsx)("div",{className:"card cashback-info-contr mT10",children:(0,l.jsx)("div",{className:"card-body",children:g.text})}),p&&p.map((e,t)=>(0,l.jsxs)("div",{className:"cashback-contr text-left mT20 align-items-start justify-content-start",children:[e.imageUrls&&e.imageUrls[0]&&(0,l.jsx)("span",{className:"icon-contr",children:(0,l.jsx)("img",{src:e.imageUrls[0],alt:"Power Button Icon",className:"mR10",width:"16"})}),(0,l.jsx)("span",{className:"text-contr",children:e.text})]},t)),(0,l.jsxs)("div",{className:"fixed-btn btn-contr text-center mT20 show",children:[t&&e&&(0,l.jsx)("button",{onClick:()=>t(e),className:"btn btn-primary waves-effect waves-light",children:r}),(0,l.jsx)("button",{onClick:()=>m((0,n.Oo)()),className:"btn btn-secondary waves-effect waves-light","data-dismiss":"modal",children:c})]})]})})};s(9798);const g=e=>{const{closeDrawerModal:t,modalParameters:s,modalParameters:{offerInfo:a,redirectToRecharge:r,pageData:i,selectOffer:n,modalId:o}}=e,m=i&&i.knowMoreData&&a&&a.type&&i.knowMoreData[a.type]&&i.knowMoreData[a.type].primaryBtnTxt?i.knowMoreData[a.type].primaryBtnTxt.replace("<recharge amount>",a.rechargeAmount||""):"",u=i&&i.knowMoreData&&a&&a.type&&i.knowMoreData[a.type]&&i.knowMoreData[a.type].secBtnTxt?i.knowMoreData[a.type].secBtnTxt:"";return{APV_FLEXI:(0,l.jsx)(c,{modalData:s,modalId:o,closeDrawerModal:t,redirectToRecharge:r,primaryBtnTxt:m,secBtnTxt:u}),SMART_UPGRADE:(0,l.jsx)(d,{modalData:s,modalId:o,closeDrawerModal:t,redirectToRecharge:r,primaryBtnTxt:m,secBtnTxt:u}),LDP:(0,l.jsx)(h,{modalData:s,modalId:o,closeDrawerModal:t,redirectToRecharge:r,primaryBtnTxt:m,secBtnTxt:u}),FLEXI:(0,l.jsx)(c,{modalData:s,modalId:o,closeDrawerModal:t,redirectToRecharge:r,primaryBtnTxt:m,secBtnTxt:u}),SEGMENTED_CASHBACK:(0,l.jsx)(c,{modalData:s,modalId:o,closeDrawerModal:t,redirectToRecharge:r,primaryBtnTxt:m,secBtnTxt:u}),WINBACK_FLEXI:(0,l.jsx)(c,{modalData:s,modalId:o,closeDrawerModal:t,redirectToRecharge:r,primaryBtnTxt:m,secBtnTxt:u}),BINGE_FLEXI:(0,l.jsx)(p,{modalData:s,modalId:o,closeDrawerModal:t,redirectToRecharge:r,primaryBtnTxt:m,secBtnTxt:u})}[a&&a.type]}},37541(e,t,s){var a=s(96540),r=s(97965),i=s(52852),n=s(21439),o=s(49862),l=(s(44979),s(25242),s(70581)),c=s(74848);const d=e=>{const{closeDrawerModal:t,modalParameters:s}=e,d=s&&s.modalId,[m,u]=(0,a.useState)({}),{manifest:h}=(0,r.d4)(e=>e.commonReducer);(0,a.useEffect)(()=>{(async()=>{try{const e={apiPath:(0,n.th)("mp_recharge_resume",h)},t=await i.n.fetchData(e);t.data.status===o.A.MESSAGES_TYPES.S3_SUCCESS&&u(t.data.data)}catch(e){console.log(e)}})()},[]);return(0,c.jsxs)(a.Fragment,{children:[(0,c.jsxs)("div",{className:"heading-sm text-center",children:[(0,c.jsx)("div",{className:"mB10",children:(0,c.jsx)("img",{src:`${o.A.NODE_API_ROOT}${m&&m.field_json_data&&m.field_json_data.headIcon}`})}),(0,c.jsx)("h2",{id:d?`t-${d}`:void 0,className:"heading1 gradient",children:m&&m.field_json_data&&m.field_json_data.head}),(0,c.jsx)(l.A,{className:"heading2",htmlContent:m&&m.field_json_data&&m.field_json_data.subHeadOne}),(0,c.jsx)(l.A,{className:"heading2",htmlContent:m&&m.field_json_data&&m.field_json_data.subHeadTwo})]}),(0,c.jsxs)("div",{className:"btn-contr text-center mT20",children:[(0,c.jsxs)("button",{className:"btn btn-primary waves-effect waves-light recharge-cta btn-medium-primary",onClick:()=>(async()=>{(0,n.y1)()})(),children:[(0,c.jsx)("img",{src:`${o.A.NODE_API_ROOT}${m&&m.field_json_data&&m.field_json_data.rechargeIcon}`}),m&&m.field_json_data&&m.field_json_data.rechargeBtn]}),(0,c.jsx)("button",{className:"btn btn-secondary waves-effect waves-light cancel-cta btn-medium-secondary",onClick:()=>t(),children:m&&m.field_json_data&&m.field_json_data.cancelBtn})]})]})};s.d(t,["A",0,d])},71725(e,t,s){var a=s(96540),r=s(52852),i=s(49862),n=s(58156),o=s.n(n),l=s(74848);const c=e=>{const{closeModal:t,modalParameters:{errMsg:s,boxId:n,boxName:c,source:d,modalId:m},closeDrawerModal:u}=e,[h,p]=(0,a.useState)({});(0,a.useEffect)(()=>{(async()=>{const e=await r.n.getPageTitle("mpack_resume_popup");e.data.status===i.A.MESSAGES_TYPES.SUCCESS&&p(e.data.data)})()},[]);const g=()=>{const{history:t,modalParameters:{getBoxData:s,getBoxInfo:a,callOtherApi:r,setRenderFalse:n,flow:o}}=e;"active-packs"===o&&t.push(`/${i.A.managePack_Path}`),u(),"device"!==d&&(n(),s({refresh:!0})),a()};return(0,l.jsx)(a.Fragment,{children:s?(0,l.jsxs)(a.Fragment,{children:[(0,l.jsx)("div",{className:"heading-sm text-center",children:(0,l.jsx)("h2",{id:m?`t-${m}`:void 0,className:"heading1 gradient",children:s})}),(0,l.jsx)("div",{className:"btn-contr text-center mT20",children:(0,l.jsx)("button",{className:"btn btn-secondary waves-effect waves-light share-summary btn-medium-secondary",onClick:()=>g(),children:o()(h,"field_json_data.secondaryBtnlabel")||"Okay, Got It"})})]}):(0,l.jsxs)(a.Fragment,{children:[(0,l.jsxs)("div",{className:"heading-sm text-center",children:[(0,l.jsx)("h2",{id:m?`t-${m}`:void 0,className:"heading1 gradient",children:h.title}),(0,l.jsx)("div",{className:"heading2",children:h&&h.field_sub_title})]}),(0,l.jsx)("p",{className:"text-center gray-txt",style:{fontSize:"14px"},children:o()(h,"field_json_data.successText")||""}),(0,l.jsx)("div",{className:"btn-contr text-center mT20",children:(0,l.jsx)("button",{className:"btn btn-secondary waves-effect waves-light share-summary btn-medium-secondary",onClick:()=>g(),children:o()(h,"field_json_data.secondaryBtnlabel")})})]})})};s.d(t,["A",0,c])},32960(e,t,s){var a=s(64467),r=s(96540),i=s(97965),n=s(2543),o=s(49862),l=s(52852),c=s(25242),d=s(21439),m=s(39789),u=s(67475),h=s(11018),p=s(25614),g=s(74191),f=s(74848);function x(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function b(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?x(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):x(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const v=e=>{const{modalParameters:t,modalParameters:{boxData:s,source:a,subTitle:x,title:v,boxTypeName:y,setPauseTimeOut:S,staticData:j,isMulti:A,pauseResumeData:N,modalId:C},closeDrawerModal:w}=e,[_,E]=(0,r.useState)(""),[T,D]=(0,r.useState)({}),[O,k]=(0,r.useState)(!1),[P,I]=(0,r.useState)(10),[M,$]=(0,r.useState)(0),[R,L]=(0,r.useState)(!1),F=(0,i.wA)();(0,r.useEffect)(()=>{(async()=>{const e=await l.n.getPageTitle("mpack_pause_popup");e.data.status===o.A.MESSAGES_TYPES.SUCCESS&&("device"===a&&(e.data.data.field_sub_title=x,e.data.data.title=v),D(e.data.data))})()},[]);const U=e=>{(0,n.isEmpty)(e)?F((0,u.qf)(m.lx.COMMON_MODAL,{Component:h.A,modalId:C?`${C}-accepted`:"managepack-suspend-accepted",apiKey:"mp_pause_accepted",vcAlias:s.vcAlias,boxId:s.boxId,parentClass:"drawer-popup mp-ncf",backDropClass:"bottom-sheet"})):F((0,u.qf)(m.lx.COMMON_MODAL,{Component:p.A,modalId:C?`${C}-result`:"managepack-suspend-result",parentClass:"drawer-popup success-fail",backDropClass:"bottom-sheet",type:"pause",errMsg:e,isMulti:A,pauseResumeData:N}))},B=async(e,r,i,l,h)=>{k(!0),(()=>{let e;e=setInterval(()=>{let t;I(e=>(t=e-1,t)),0===t&&(clearInterval(e),I(10),k(!1))},1e3)})(),F((0,u.NB)(m.lx.COMMON_MODAL,b(b({},t),{},{hideCross:!0,noOverlayClose:!0,hidePopUpLine:!0,noDrawerClose:!0}))),"device"===a?(0,d.Sw)({event:"STB - Proceed","Box ID":l||null,"Box Name":y||null,"Sub ID":(0,d.Xo)().id||null}):(0,d.Sw)({event:"Manage Pack - Pause Proceed","Box Number":s.assetType,"Box Variant":s.serviceType,"Sub ID":(0,d.Xo)().id||null});try{S(!1);const t=await c.T.resumeBox({stbNumber:e,stbType:r,actionType:"Suspend",vcSubStatus:h});t.data.status===o.A.MESSAGES_TYPES.SUCCESS?(setTimeout(()=>{S(!0)},parseInt(j)),$(t.data.data.transactionId)):E((0,n.get)(t,"data.message")||"")}catch(e){console.log(e)}};(0,r.useEffect)(()=>{0===P&&(L(!0),(async()=>{try{const e=await c.T.pauseResumeTransactionResponse({transactionId:M});e.data.status===o.A.MESSAGES_TYPES.SUCCESS?"SUCCESS"===e.data.message?(L(!1),U("")):(L(!1),U(e.data.message)):e.data.status===o.A.MESSAGES_TYPES.FAIL?(L(!1),U("fail")):"FAILURE"===e.data.status?(L(!1),U(e.data.message)):(L(!1),U("inProgress"))}catch(e){console.log(e)}})())},[P]);const H="device"===a?s.vcAlias||`Box Id(${s.boxId})`:s.vcAlias;return R?(0,f.jsx)(g.A,{}):(0,f.jsx)(r.Fragment,{children:O?(0,f.jsxs)("div",{className:"spinnertimer-main",children:[(0,f.jsx)("div",{className:"spinnertimer"}),(0,f.jsxs)("div",{className:"timer-circle gradient1",style:{color:"red"},children:[" ",P]})]}):(0,f.jsxs)(r.Fragment,{children:[(0,f.jsxs)("div",{className:"top-section",children:[(0,f.jsxs)("div",{className:"heading-sm text-center",children:[(0,f.jsx)("h2",{id:C?`t-${C}`:void 0,className:"heading1 gradient",children:T.title&&(0,d.s9)(T.title,{"!boxName!":H})}),(0,f.jsx)("div",{className:"greay-text popupsubtext",children:T.field_sub_title})]}),(0,f.jsxs)("div",{className:"btn-contr text-center mT32",children:[(0,f.jsx)("button",{className:"btn btn-secondary waves-effect waves-light share-summary btn-medium-secondary",onClick:()=>{return e=s.boxId,"device"===a?(0,d.Sw)({event:"STB - Cancel","Box ID":e||null,"Box Name":y||null,"Sub ID":(0,d.Xo)().id||null}):(0,d.Sw)({event:"Manage Pack - Pause Cancel","Box Number":s.assetType,"Box Variant":s.serviceType,"Sub ID":(0,d.Xo)().id||null}),void w();var e},children:"Cancel"}),(0,f.jsx)("button",{className:"btn btn-primary waves-effect waves-light btn-medium-secondary",onClick:()=>B(s.stbNumber,s.assetType,s.vcAlias,s.boxId,s.vcSubStatus),children:"Proceed"})]})]}),!(0,n.isEmpty)(_)&&(0,f.jsx)("div",{className:"mT10 text-center",style:{fontSize:"14px",color:"red"},children:_})]})})};s.d(t,["A",0,v])},38518(e,t,s){s.d(t,{A:()=>w});var a=s(64467),r=s(96540),i=s(67475),n=s(97965),o=s(39789),l=s(49862),c=s(10705),d=s(21439),m=s(62193),u=s.n(m),h=s(15064),p=s(60676),g=s(74848);const f=e=>{const{modalParameters:{data:t,packName:s,packMrp:a,hdCount:i,sdCount:n,getImageUrlManifest:o,ctaClickFunc:l,packDuration:c="",viewOfferCta:m="",primaryCtaText:h="",cancelBtnCta:f="",backBtnCta:x="",offerType:b="",offerDescription:v="",ctaCloseFunc:y,serviceOfferHeading:S="",count4k:j,modalId:A}}=e,[N,C]=(0,r.useState)(8),w=t,_=o("default_channel"),E=(e="")=>{const t=(0,d.Xo)();let a=null;
1t&&(a=t.id),(0,d.Sw)({event:"MFY - New Chips - View All Channels","Offer Name":s,"Sub Id":a})};return(0,g.jsxs)(r.Fragment,{children:["serviceOffer"==b&&(0,g.jsxs)(r.Fragment,{children:[(0,g.jsx)("div",{className:"heading-sm text-center",children:(0,g.jsx)("h2",{id:A?`t-${A}`:void 0,className:"heading1 gradient",children:S})}),(0,g.jsx)("div",{children:(0,g.jsxs)("p",{className:"text-center",children:[s," ",v]})}),(0,g.jsxs)("div",{class:"footer-contr text-center mT20",children:[(0,g.jsx)("button",{class:"animated1 fadeIn1 btn btn-primary btn-md",onClick:l,children:h}),(0,g.jsx)("button",{class:"animated1 fadeIn1 btn btn-secondary btn-md",onClick:y,children:f})]})]}),"linearOffer"==b&&(0,g.jsxs)(r.Fragment,{children:[(0,g.jsx)("div",{className:"heading-sm text-center",children:(0,g.jsx)("h2",{id:A?`t-${A}`:void 0,className:"heading1 gradient",children:s})}),(0,g.jsxs)("div",{class:"hd-sd-channelwrapp mB20",children:[(0,g.jsxs)("div",{className:"dtl-information channelCount",children:[(0,g.jsxs)("span",{className:"hdCount",children:[(0,g.jsx)("img",{src:"/assets/images/4k.svg",alt:"",class:"maR5"})," ",j||0]}),(0,g.jsxs)("span",{className:"hdCount",children:[(0,g.jsx)("img",{src:"/assets/images/hd.svg",alt:"",class:"maR5"})," ",i||0]}),(0,g.jsxs)("span",{className:"sdCount",children:[(0,g.jsx)("img",{src:"/assets/images/sd.svg",alt:"",class:"maR5"})," ",n||0]})]}),!!a&&(0,g.jsxs)("div",{className:"dtl-information packCharges",children:[(0,g.jsx)("span",{class:"rupee",children:"â¹"}),(a&&parseFloat(a).toFixed(2)).split(".")[0],a&&parseFloat(a).toFixed(2).split(".")[1]&&".",(0,g.jsx)("span",{className:"rupee",children:(a&&parseFloat(a).toFixed(2)).split(".")[1]}),!!c&&(0,g.jsx)("span",{className:"rupee",children:"/month"})]})]}),(0,g.jsx)("div",{className:"accdesc d-block pD0",children:(0,g.jsx)("div",{className:"chnls-only",children:u()(w)?null:w.slice(0,N).map(e=>(0,g.jsxs)("div",{className:"ente-logo-wrapp",children:[e&&e.HD_FLAG&&"Y"==e.HD_FLAG&&"HD"===e.BM_CATEGORY&&(0,g.jsx)("div",{className:"chnl-def",children:"HD"}),e&&e.HD_FLAG&&"Y"==e.HD_FLAG&&"4K"===e.BM_CATEGORY&&(0,g.jsx)("div",{className:"chnl-def channel-4k",children:"4K"}),(0,g.jsx)("div",{className:"ente-logo",children:(0,g.jsx)(p.A,{src:(0,d.zp)(`${e.CNAME}`),className:"img-fluid",alt:e.channel_name,altImage:_})}),(0,g.jsxs)("div",{className:"label",children:[(0,g.jsxs)("span",{className:"incl-info",children:["Ch."," ",e.EPG_NUMBER]}),(0,g.jsx)("div",{className:"channelname",children:e.CHANNEL_NAME})]})]},e.CHANNEL_ID))})}),(0,g.jsx)("div",{className:"text-center linkfont mT10",children:(0,g.jsx)("a",{href:"javascript:void(0)",className:"viewmore",onClick:()=>{N!==w.length?(E(),C(w.length)):C(8)},"aria-label":"View Channels",children:N===(!u()(w)&&w.length)?8===w.length?null:"View Less Channels":!u()(w)&&w.length>8?"View All Channels":null})}),(0,g.jsx)("div",{class:"footer-contr text-center mT20",children:(0,g.jsx)("button",{class:"animated1 fadeIn1 btn btn-primary btn-md",onClick:l,children:h})})]})]})};var x=s(83731),b=s(9798),v=s(40310),y=s(78528),S=s(70581);function j(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function A(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?j(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):j(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const N={openModal:i.qf,closeModal:i.Oo};class C extends r.Component{constructor(...e){super(...e),this.state={button:{buttonConfig:{type:"button",class:"smallWhite btn-primary"},text:"Get this Offer"},updatedDndValue:!0,isConsentUpdated:!1,apiTimeOut:null},this.triggerGA=(e="",t="")=>{const s=(0,d.Xo)();let a=null;s&&(a=s.id),(0,d.Sw)({event:"MFY - New Chips","Chip Name":t,"Offer Name":e,"Sub Id":a})},this.offerRedirect=async(e,t,s,a,r)=>{const{history:i,bingeUrl:n}=this.props;if(!l.A.isServer()&&localStorage.removeItem("offerCardData"),this.triggerGA(t,a),"recharge"==e.toLowerCase()||"flexi"==e.toLowerCase()){const{redirectToRecharge:e}=this.props;e(t||"",s&&s.field_price||"")}else if("binge"==e.toLowerCase()){const{redirectToBinge:e}=this.props;e(t||"")}else if("upgrade"==e.toLowerCase()){let e=A({},s);e.offerDescription="",e.bouquet_channels=[],(0,d.Nq)("currentOffer",e);const a={channel:s.Channel||"",offerId:s.offerId||"",uniqueId:s.uniqueId||"",packAmount:s.pack_mrp||"",packDuration:s.packDuration||"",dthTransactionId:s.dthTransactionId||"",offerType:s.offerType||"",title:t||""};!l.A.isServer()&&localStorage.setItem("offerCardData",JSON.stringify(a));const r={pathname:`/${l.A.upgrade_stb_path}`,state:{offerRedirect:!0}};i.push(r)}else"editorail"==e.toLowerCase()||"editorialOffer"==e.toLowerCase()?r&&!u()(r)&&"apv"===r.banner_type?((0,h.setSourceInStorage)("MANAGEPACK"),i.push({pathname:`/${l.A.my_account_path}/mp-redirect`},{apps:!0,tab:"Prime Video",annual:!0,defaultBack:!0}
1)):n&&""!=n&&(window.location.href=n):console.log("invalid offerType")},this.setUpdatedDndValue=e=>{this.setState({updatedDndValue:e})},this.setIsConsentUpdated=e=>{this.setState({isConsentUpdated:e})},this.setApiTimeOut=e=>{this.setState({apiTimeOut:e})},this.showChannelList=(e="")=>{const{openModal:t,offer:s,history:a,getImageUrlManifest:r,mpOfferPack:i=!1,viewOfferCta:n,linearOfferCta:c,serviceOfferCta:m,backBtnCta:u,cancelBtnCta:h,serviceOfferHeading:p,jsonData:g,closeButtonHandling:b}=this.props,v=!l.A.isServer()&&JSON.parse(localStorage.getItem("dndData"))||{},y=v&&v.isDNDEligible&&v.isDNDActive,S=JSON.parse(s.bouquet_channels)||[];if(this.triggerGA(s.packName,e),!l.A.isServer()&&localStorage.removeItem("offerCardData"),s&&S.length&&"linearOffer"==(0,d.Ve)(s.offerType||s.field_offers_type)){let e=A({},s);e.offerDescription="",e.bouquet_channels=[],(0,d.Nq)("currentOffer",e);const a={channel:s.Channel||"",offerId:s.offerId||"",uniqueId:s.uniqueId||"",packAmount:s.pack_mrp||"",packDuration:s.packDuration||"",dthTransactionId:s.dthTransactionId||"",offerType:s.offerType||"",title:s.title||"",mpOfferPack:!!i};!l.A.isServer()&&localStorage.setItem("offerCardData",JSON.stringify(a)),t(o.lx.COMMON_MODAL,y?{Component:x.A,modalId:`unlock-offer-${s.offerId||s.title||"linear"}`,data:g,parentClass:" drawer-popup unlock-account dnd-popup",backDropClass:"bottom-sheet",setUpdatedDndValue:this.setUpdatedDndValue,redirectToPage:()=>{this.triggerCtaGA((0,d.Ve)(s.offerType),s.packName||""),this.props.callOfferAcceptanceApi((0,d.Ve)(s.offerType||""),s.title,s)},isMFY:!0,type:"isMfy",consentLoading:!0,offersData:s,setApiTimeOut:this.setApiTimeOut,apiTimeOut:this.state.apiTimeOut,closeButtonHandling:b,onCloseEvent:()=>{clearTimeout(this.state.apiTimeOut)}}:{Component:f,modalId:`view-channels-${s.offerId||s.packFriendlyName||"offer"}`,packName:s.packFriendlyName||"",data:S||[],parentClass:"packlist mfyPopup drawer-popup",backDropClass:"bottom-sheet",packMrp:s.packMrp||"",hdCount:s.hdCount||"",count4k:s["4kCount"]||"",sdCount:s.sdCount||"",getImageUrlManifest:r,ctaClickFunc:()=>{this.triggerCtaGA((0,d.Ve)(s.offerType),s.packName||""),this.props.callOfferAcceptanceApi((0,d.Ve)(s.offerType||""),s.title,s)},packDuration:s.packDuration||"",viewOfferCta:n,primaryCtaText:"serviceOffer"==(0,d.Ve)(s.offerType||s.field_offers_type)?m:c,backBtnCta:u,cancelBtnCta:h,offerType:(0,d.Ve)(s.offerType||s.field_offers_type)||"",serviceOfferHeading:p||"",jsonData:g})}if(s&&"serviceOffer"==(0,d.Ve)(s.offerType||s.field_offers_type)){let e=A({},s);e.offerDescription="",e.bouquet_channels=[],(0,d.Nq)("currentOffer",e);const a={channel:s.Channel||"",offerId:s.offerId||"",uniqueId:s.uniqueId||"",packAmount:s.pack_mrp||"",packDuration:s.packDuration||"",dthTransactionId:s.dthTransactionId||"",offerType:s.offerType||"",title:s.title||"",mpOfferPack:!!i};!l.A.isServer()&&localStorage.setItem("offerCardData",JSON.stringify(a)),t(o.lx.COMMON_MODAL,y?{Component:x.A,modalId:`unlock-offer-${s.offerId||s.title||"service"}`,data:g,parentClass:"drawer-popup unlock-account dnd-popup",backDropClass:"bottom-sheet",setUpdatedDndValue:this.setUpdatedDndValue,redirectToPage:()=>{this.triggerCtaGA((0,d.Ve)(s.offerType),s.packName||""),this.props.callOfferAcceptanceApi((0,d.Ve)(s.offerType||""),s.title,s)},isMFY:!0,type:"isMfy",consentLoading:!0,offersData:s,closeButtonHandling:b,setApiTimeOut:this.setApiTimeOut,apiTimeOut:this.state.apiTimeOut,onCloseEvent:()=>{clearTimeout(this.state.apiTimeOut)}}:{Component:f,modalId:`view-channels-${s.offerId||s.packFriendlyName||"service"}`,packName:s.packFriendlyName||"",data:S||[],parentClass:"packlist mfyPopup drawer-popup",backDropClass:"bottom-sheet",packMrp:s.packMrp||"",hdCount:s.hdCount||"",sdCount:s.sdCount||"",count4k:s["4kCount"]||"",getImageUrlManifest:r,ctaClickFunc:()=>{this.triggerCtaGA((0,d.Ve)(s.offerType),s.packName||""),this.props.callOfferAcceptanceApi((0,d.Ve)(s.offerType||""),s.title,s)},packDuration:s.packDuration||"",viewOfferCta:n,primaryCtaText:"serviceOffer"==(0,d.Ve)(s.offerType||s.field_offers_type)?m:c,backBtnCta:u,cancelBtnCta:h,offerType:(0,d.Ve)(s.offerType||s.field_offers_type),offerDescription:s.offerDescription||"",ctaCloseFunc:()=>{this.triggerCancelGA(s.packName||""),this.props.closeModal()},serviceOfferHeading:p||""})}}
1,this.triggerCtaGA=(e="",t="",s="")=>{const a=(0,d.Xo)();let r=null;a&&(r=a.id),(0,d.Sw)({event:"serviceOffer"==e?"MFY - New Chips - Proceed":"MFY - New Chips - Add","Offer Name":t,"Sub Id":r})},this.triggerCancelGA=(e="")=>{const t=(0,d.Xo)();let s=null;t&&(s=t.id),(0,d.Sw)({event:"MFY - New Chips - Cancel","Offer Name":e,"Sub Id":s})},this.onNetflixCta=(e,t,s,a)=>{const{jsonData:r,openModal:i,closeButtonHandling:n}=this.props,c=!l.A.isServer()&&JSON.parse(localStorage.getItem("dndData"))||{};c&&c.isDNDEligible&&c.isDNDActive?i(o.lx.COMMON_MODAL,{Component:x.A,modalId:`unlock-netflix-${s.packName||s.title||"netflix"}`,data:r,parentClass:"drawer-popup unlock-account dnd-popup",backDropClass:"bottom-sheet",setUpdatedDndValue:this.setUpdatedDndValue,redirectToPage:()=>{this.triggerGA(t,a),this.props.callOfferAcceptanceApi(e,s.packName,s)},isMFY:!0,type:"isMfy",consentLoading:!0,offersData:s,closeButtonHandling:n,setApiTimeOut:this.setApiTimeOut,apiTimeOut:this.state.apiTimeOut,onCloseEvent:()=>{clearTimeout(this.state.apiTimeOut)}}):(this.triggerGA(t,a),this.props.callOfferAcceptanceApi(e,s.packName,s))},this.handleProceed=async(e,t)=>{try{const s={amount:e&&e.rechargeAmount,key:e&&e.key},a=(await y.c.offerPreRechageRequest(s,t)).data;if(a.status===l.A.MESSAGES_TYPES.SUCCESS){const{data:e}=a,t=`${l.A.NODE_API_ROOT}${e.url}`;window.location.href=t}else window.location.replace("/recharge")}catch(e){e&&e.response&&[401,409].includes(e.response.status)||(console.error("error in pre recharge request",e),window.location.replace("/recharge"))}},this.offerRedirectHandler=(e,t)=>{this.handleProceed(e,t)},this.rechargeRedirectionHandler=e=>{const{openModal:t,jsonData:s,history:a,sourcePage:r}=this.props;e&&e.type&&"SMART_UPGRADE"==e.type?t(o.lx.COMMON_MODAL,{Component:v.A,modalId:`offer-know-more-${e&&(e.offerType||e.title)||"smart-upgrade"}`,offerInfo:e,pageData:s,redirectToRecharge:e=>this.offerRedirectHandler(e,r),parentClass:"drawer-popup offer-know-more ",backDropClass:"bottom-sheet"}):a.push(`/${l.A.my_account_path}/exciting-offers/exclusive-recharge-offers?offerType=${e.offerType}&sourcePage=${r}`)},this.openKnowMoreModal=e=>{const{openModal:t,jsonData:s,callOfferAcceptanceApi:a}=this.props;t(o.lx.COMMON_MODAL,{Component:b.A,modalId:`binge-flexi-nbafs-${e&&(e.title||e.offerType)||"binge"}`,offerInfo:e,pageData:s,callOfferAcceptanceApi:()=>{a(e.offerType,e.title,e)},primaryBtnTxt:s.knowMoreData["Binge Flexi"].primaryBtnTxt,secBtnTxt:s.knowMoreData["Binge Flexi"].secBtnTxt,parentClass:"drawer-popup offer-know-more binge-flexi-nbafs-modal",backDropClass:"bottom-sheet"})},this.getOfferButtonAriaLabel=(e,t,s)=>{const a=e[t].cta_txt||"",r=s.title||"";return a&&r?`${a} ${r}`:a||r}}render(){const{offer:e,closeButtonHandling:t,ctaTextObj:s,bannerDescTextObj:a,sourcePage:i}=this.props,n=e&&e.field_image&&e.field_image.url?{backgroundImage:`url(${l.A.NODE_API_ROOT}${e.field_image.url})`}:e&&e.imageFromJson&&1==e.imageFromJson&&a&&a[e.offerType]&&a[e.offerType].banner_image?{backgroundImage:`url(${l.A.NODE_API_ROOT}${a[e.offerType].banner_image})`}:{backgroundColor:"#220046"},o=e&&a&&a[e.offerType]&&1==a[e.offerType].showText&&"SMART_UPGRADE"!=e.offerType&&"SMART_UPGRADE_FTV"!=e.offerType;if(!e)return null;switch(e.type||e.offerType||e.field_offers_type){case"APV_FLEXI":case"BINGE_FLEXI":case"FLEXI":case"SMART_UPGRADE":case"LDP":case"SERVICE":case"UPGRADE":case"BINGE":case"WALLET":case"EDITORIAL":case"NETFLIX":case"LINEAR":case"SEGMENTED_CASHBACK":case"WINBACK_FLEXI":return"SEGMENTED_CASHBACK"==e.offerType||"WINBACK_FLEXI"==e.offerType?(0,g.jsx)(r.Fragment,{children:(0,g.jsx)("div",{className:"card-sm mB20 segmented-winback-offer",children:(0,g.jsxs)("div",{className:`${e.type||e.offerType||e.field_offers_type} card`,style:n,children:[(0,g.jsxs)("div",{className:"card-body",children:[(0,g.jsx)("div",{className:"close-card",children:(0,g.jsx)("button",{className:"btn btn-primary closeBtn",onClick:()=>t((0,d.Ve)(e&&1==e.imageFromJson?e.offerType:e.type||""),e),children:(0,g.jsx)("img",{src:"/assets/images/cardCloseIcon.svg",alt:"close"})})}),(0,g.jsxs)("div",{class:"banner-text",children:[(0,g.jsx)("h2",{children:a&&a[e.offerType]&&a[e.offerType].bannerHeading&&a[e.offerType].bannerHeading}),(0,g.jsx)(S.A,{Tag:"p",htmlContent:a&&a[e.offerType]&&a[e.offerType].cashBackText&&a[e.offerType].cashBackText.replace("{cashBackAmt}",e&&e.cashbackValue||"")})]})]}),(0,g.jsxs)("div",{className:"card-footer",children:[(0,g.jsx)("div",{className:"pricing",children:(0,g.jsxs)("span",{className:"rate recharge",children:["â¹ ",e.re
1chargeAmount]})}),"SEGMENTED_CASHBACK"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn",onClick:()=>this.rechargeRedirectionHandler(e),children:s&&s.SEGMENTED_CASHBACK?s.SEGMENTED_CASHBACK.cta_txt:""}),"WINBACK_FLEXI"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn",onClick:()=>this.rechargeRedirectionHandler(e),children:s&&s.WINBACK_FLEXI?s.WINBACK_FLEXI.cta_txt:""})]})]})})}):(0,g.jsx)(r.Fragment,{children:(0,g.jsx)("div",{className:"card-sm mB20",children:(0,g.jsxs)("div",{className:`${e.type||e.offerType||e.field_offers_type} card`,style:n,children:[(0,g.jsx)("div",{className:"card-body",children:(0,g.jsx)("div",{className:"close-card",children:(0,g.jsx)("button",{className:"btn btn-primary closeBtn",onClick:()=>t((0,d.Ve)(e&&1==e.imageFromJson?e.offerType:e.type||""),e),children:(0,g.jsx)("img",{src:"/assets/images/cardCloseIcon.svg",alt:"close"})})})}),(0,g.jsxs)("div",{className:"card-footer",children:[(0,g.jsxs)("div",{className:"pricing",children:[e&&e.field_strike_price&&(0,g.jsxs)("span",{className:"old-price",children:["â¹ ",e.field_strike_price]}),e&&e.strikePrice&&"BINGE"!=e.type&&(0,g.jsxs)("span",{className:"old-price",children:["â¹ ",e.strikePrice]}),e&&e.field_price&&(0,g.jsxs)("span",{className:"rate",children:["â¹ ",e.field_price," ",e&&e.packDuration&&(0,g.jsxs)("span",{children:["/ ",e.packDuration]})," "]}),e&&e.pack_mrp&&(0,g.jsxs)("span",{className:"rate duration",children:["â¹ ",e.pack_mrp," ",e&&e.packDuration&&(0,g.jsxs)("span",{children:["/ ",e.packDuration]})," "]}),a&&a[e.offerType]&&1==a[e.offerType].showText&&(o?(0,g.jsx)("span",{className:"pricing desc",children:a&&a[e.offerType].description}):(0,g.jsxs)("span",{className:"rate recharge",children:["â¹ ",e.rechargeAmount]}))]}),"WALLET"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"rechargeOffer",e),onClick:()=>this.offerRedirect("recharge",e.title,e,s&&s.rechargeOffer&&s.rechargeOffer.cta_txt),children:s&&s.rechargeOffer?s.rechargeOffer.cta_txt:""}),"BINGE"==e.type&&("Binge Flexi"==e.offerType||"BingeFlexi"==e.offerType)&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"Binge Flexi",e),onClick:()=>this.openKnowMoreModal(e),children:s&&s["Binge Flexi"]?s["Binge Flexi"].cta_txt:""}),"UPGRADE"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"upgradeOffer",e),onClick:()=>this.offerRedirect("upgrade",e.packName,e,s&&s.upgradeOffer&&s.upgradeOffer.cta_txt),children:s&&s.upgradeOffer?s.upgradeOffer.cta_txt:""}),"NETFLIX"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"netflixOffer",e),onClick:()=>{this.onNetflixCta("netflix",e.packName,e,s&&s.netflixOffer&&s.netflixOffer.cta_txt)},children:s&&s.netflixOffer?s.netflixOffer.cta_txt:""}),"LINEAR"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn addBtn","aria-label":this.getOfferButtonAriaLabel(s,"linearOffer",e),onClick:()=>this.showChannelList(s&&s.linearOffer&&s.linearOffer.cta_txt),children:s&&s.linearOffer?s.linearOffer.cta_txt:""}),"EDITORIAL"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn addBtn","aria-label":this.getOfferButtonAriaLabel(s,"editorialOffer",e),onClick:()=>this.offerRedirect("editorail",e.title,e,s&&s.editorialOffer&&s.editorialOffer.cta_txt,e&&e.field_json_data),children:s&&s.editorialOffer?s.editorialOffer.cta_txt:""}),"BINGE"==e.type&&"Binge Flexi"!=e.offerType&&"BingeFlexi"!=e.offerType&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"bingeOffer",e),onClick:()=>this.offerRedirect("binge",e.title,e,s&&s.bingeOffer&&s.bingeOffer.cta_txt),children:s&&s.bingeOffer?s.bingeOffer.cta_txt:""}),"SERVICE"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"serviceOffer",e),onClick:()=>this.showChannelList(s&&s.serviceOffer&&s.serviceOffer.cta_txt),children:s&&s.serviceOffer?s.serviceOffer.cta_txt:""}),"LDP"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"LDP",e),onClick:()=>this.rechargeRedirectionHandler(e),children:s&&s.LDP?s.LDP.cta_txt:""}),"FLEXI"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"FLEXI",e),onClick:()=>this.rechargeRedirectionHandler(e),children:s&&s.FLEXI?s.FLEXI.cta_txt:""}),"SMART_UPGRADE"==e.type&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"SMART_UPGRADE",e),onClick:()=>this.rechargeRedirectionHandler(e),children:s&&s.SMART_UPGRADE?s.SMART_UPGRADE.cta_txt:""}),"BINGE_FLEXI"==e.offerType&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"BINGE_FLEXI",e),onClick:()=>this.rechargeRedirectionHandler(e),children:s&&s.BINGE_FLEXI?s.BINGE_FLEXI.cta_txt:""}),"APV_FLEXI"==e.offerType&&(0,g.jsx)("button",{className:"btn btn-primary waves-effect waves-light actionBtn subscribeBtn","aria-label":this.getOfferButtonAriaLabel(s,"APV_FLEXI",e),onClick:()=>this.rechargeRedirectionHandler(e),children:s&&s.APV_FLEXI?s.APV_FLEXI.cta_txt:""})]})]})})});default:return console.log("invalid or new offer type===="),null}}}const w=(0,n.Ng)(null,N)((0,c.A)(C))},43350(e,t,s){s.d(t,{A:()=>B});var a=s(64467),r=s(96540),i=s(62193),n=s.n(i),o=s(10705),l=s(38518),c=s(97965),d=s(88827),m=s(60676),u=s(67475),h=s(21439),p=s(39789),g=s(15064),f=s(58156),x=s.n(f),b=s(49862),v=s(74848);const y=e=>{const{modalParameters:{data:t,service:s,addService:a,modalId:i}}=e,o=`${b.A.NODE_API_ROOT}/s3-api/v1/assets/mp/default-services_logo.png`,l=`${b.A.NODE_API_ROOT}/s3-api/v1/assets/mp/default-services_m.png`;return(0,v.jsxs)("div",{className:"ser-drawer-wrapp",children:[i&&(0,v.jsx)("h2",{id:`t-${i}`,className:"sr-only",children:t&&(t.pack_friendly_name||t.channel_name)}),(0,v.jsx)("div",{className:"text-center",children:(0,v.jsx)(m.A,{src:(0,g.mpCreateServiceImgPath)(t.pack_friendly_name||t.channel_name,"logo"),alt:t.pack_friendly_name||t.channel_name,title:t.pack_friendly_name||t.channel_name,altImage:l,className:"img-fluid"})}),(0,v.jsx)("div",{className:"text-center mT10",children:(0,v.jsx)("div",{className:"small gray-txt",children:x()(t,"pack_details_2")||""})}),(0,v.jsxs)("div",{className:"ser-drawer mT20",children:[(0,v.jsx)("div",{className:"ser-drawer-img",children:(0,v.jsx)(m.A,{src:(0,g.mpCreateServiceImgPath)(t.pack_friendly_name||t.channel_name,"main-img"),alt:t.pack_friendly_name||t.channel_name,title:t.pack_friendly_name||t.channel_name,altImage:o,className:"img-fluid"})}),(0,v.jsxs)("div",{className:"ser-drawer-text",children:[(()=>{if(t.channels&&t.channels.length>1){const e=t.channels,s=e.filter(e=>"Y"===e.HD_FLAG&&"HD"===e.BM_CATEGORY)||[],a=e.filter(e=>"N"===e.HD_FLAG)||[],i=e.filter(e=>"Y"===e.HD_FLAG&&"4K"===e.BM_CATEGORY)||[];return(0,v.jsx)(r.Fragment,{children:(0,v.jsxs)("div",{className:"hd-image mB5 mT5",children:[!n()(i)&&(0,v.jsxs)("div",{className:"dflex mB5",children:[(0,v.jsx)("span",{style:{marginRight:"5px"},children:(0,v.jsx)("img",{src:"/assets/images/4k.svg",alt:""})}),(0,v.jsx)("span",{className:"small",children:i[0].EPG_NUMBER})]}),!n()(s)&&(0,v.jsxs)("div",{className:"dflex mB5",children:[(0,v.jsx)("span",{style:{marginRight:"5px"},children:(0,v.jsx)("img",{src:"/assets/images/hd.svg",alt:""})}),(0,v.jsx)("span",{className:"small",children:s[0].EPG_NUMBER})]}),!n()(a)&&(0,v.jsxs)("div",{className:"dflex",children:[(0,v.jsx)("span",{style:{marginRight:"5px"},children:(0,v.jsx)("img",{src:"/assets/images/sd.svg",alt:""})}),(0,v.jsx)("span",{className:"small",children:a[0].EPG_NUMBER})]})]})})}return(0,v.jsxs)("div",{className:"small",children:["Tune in"," ",x()(t,"channels[0].EPG_NUMBER","")||x()(t,"channel_no","")]})})(),(0,v.jsxs)("div",{className:"label mT10",children:[(e=>{const t=parseFloat(e).toFixed(2).split(".");return(0,v.jsxs)(r.Fragment,{children:[(0,v.jsx)("span",{className:"rupee",children:"â¹"}),t[0],".",(0,v.jsx)("span",{className:"rupee-text",children:t[1]})]})})(x()(t,"daily_mrp","00"))," ",(0,v.jsx)("span",{className:"rupee-text",children:"/ day"})]}),(0,v.jsx)("div",{className:"label subTxt",children:(0,v.jsx)("span",{className:"gradient mT5",children:((e,t)=>{if(e&&Array.isArray(e)){const s=e.find(e=>e.tag_key===t);return s?(0,v.jsx)("div",{className:"packtrial gradient",children:s&&s.tag_value}):null}return null})(t.tag_data,"Pricebug")})}),"Y"===x()(t,"is_web_enable")&&(0,v.jsx)("button",{className:"btn btn-primary waves-effect waves-light mT10 w-auto",onClick:()=>a(s),children:"Add"})]})]})]})};var S=s(70581);const j=(0,o.A)(e=>{const{getImageUrlManifest:t,service:s,addService:a,showType:i=!0}=e,n=(0,c.wA)();let o="";const l=t("default_service"),{tagColor:d,label:f}=(0,g.getTagLabelColor)(s);return o=(0,v.jsxs)(r.Fragment,{children:[(0,v.jsxs)("div",{className:"view",children:[s&&(0,v.jsx)("div",{className:d,children:""!==s.field_offer_label&&f}),(0,v.jsx)(m.A,{src:s.field_image.url,alt:"",title:s.field_image.t
1itle,altImage:l,className:"img-fluid","aria-hidden":"true"}),i&&s.field_services_category&&(0,v.jsx)("span",{className:"info",children:s.field_services_category.map((e,t)=>(0,v.jsx)("span",{children:e},`${e}-${t}`))})]}),(0,v.jsxs)("div",{className:"card-body",children:[(0,v.jsxs)("div",{className:"offer-cont",children:[s.title&&(0,v.jsx)("h3",{className:"bold mB10",children:s.title}),(0,v.jsx)(S.A,{className:"desc",htmlContent:s.body})]}),(0,v.jsxs)("div",{className:"know-more",children:[(0,v.jsx)("div",{className:"view-detail",children:s.field_know_more.length>0&&s.field_know_more&&s.field_know_more.map((e,t)=>(0,v.jsx)("button",{type:"button",className:"a-link link","aria-label":`${e.title} ${s.title}`,onClick:e=>(e=>{e.preventDefault(),(0,h.Sw)({event:"Manage Pack - View Detail","Service Name":s.services.pack_name}),n((0,u.qf)(p.lx.COMMON_MODAL,{Component:y,modalId:`service-modal-${s&&(s.id||s.name)||"service"}`,data:s.services,addService:a,service:s,parentClass:"drawer-popup mp-ncf",backDropClass:"bottom-sheet",redirectRoute:!(0,h.Xb)()}))})(e),children:e.title},`${e}-${t}`))}),(0,v.jsxs)("div",{className:"pricing",children:["Y"===s.services.is_web_enable&&(0,v.jsxs)("div",{className:"duration",children:[(0,v.jsx)("span",{className:"rupee",children:`â¹${Math.round(s.services.pack_mrp)}`}),(0,v.jsx)("span",{className:"small",children:"/month"})]}),(0,v.jsx)("span",{className:"free-text",children:s.field_benefit})]})]}),(0,v.jsx)("div",{className:"card-actions text-left new-btn",children:"Y"===s.services.is_web_enable&&(0,v.jsx)("button",{type:"button",className:"btn btn-primary waves-effect waves-light","aria-label":`Add ${s.title}`,onClick:()=>a(s),children:"Add"})})]})]}),(0,v.jsx)(r.Fragment,{children:o})});var A=s(5556),N=s.n(A),C=s(83731);class w extends r.Component{constructor(...e){super(...e),this.state={button:{buttonConfig:{type:"button",class:"wAutoWhite"}},updatedDndValue:!0,isConsentUpdated:!1},this.attachSalesforceEventHandlers=()=>{const e=document.getElementById("know_more"),t=document.getElementById("explore_more"),s=document.getElementById("explore_now");e&&e.addEventListener("click",()=>{this.handleSalesforceEvent("KNOW MORE")}),t&&t.addEventListener("click",()=>{this.handleSalesforceEvent("EXPLORE MORE")}),s&&s.addEventListener("click",()=>{this.handleSalesforceEvent("EXPLORE NOW")})},this.sendInfoToGA=(e,t)=>{const s=e.target.outerHTML.substring(0,2);s&&s.includes("<a")&&(0,h.Sw)({event:"myAccountBannerClicks","Sub Id":(0,h.Xo)().id||"",field_body:t.field_body})},this.redirectToBingeCombos=()=>{const{history:e}=this.props,t={redirectUrl:`${b.A.NODE_API_ROOT}/my-account`,comboType:"Netflix",segregateCombo:"true",subIdSelected:(0,h.Xo)().id||"",netFlixCard:!0};(0,h.Nq)(b.A.sessionNames.comboCampaign,t),e.push(`/${b.A.my_account_path}/mp-redirect`)},this.redirectToNetflix=()=>{const e=document.getElementById("netflix-card");e&&e.addEventListener("click",this.redirectToBingeCombos)},this.redirectToAppPage=()=>{const{history:e}=this.props,t=document.getElementById("apv-card");t&&t.addEventListener("click",()=>{(0,g.setSourceInStorage)("MANAGEPACK"),e.push({pathname:`/${b.A.my_account_path}/mp-redirect`},{apps:!0,tab:"Prime Video"})})},this.validateForm=(e,t,s)=>{const{event:a}=this.props;let r="";if("packs"===t){const e=a.packages.find(e=>e.id.toString()===s.packId.toString());r=`${e.pack_name} @ ${e.pack_mrp}`}else(0,h.Sw)({event:"myAccountBannerClicks","Sub Id":(0,h.Xo)().id||"",field_media_image:a.field_media_image}),r=`${s.packName} @ ${s.packPrice}`;this.openConfirmationPopup(e,t,r)},this.setUpdatedDndValue=e=>{this.setState({updatedDndValue:e})},this.setIsConsentUpdated=e=>{this.setState({isConsentUpdated:e})},this.openConfirmationPopup=(e,t,s)=>{const{validateFormHandler:a,openModal:r}=this.props,i=!b.A.isServer()&&localStorage.getItem("token")||"",n=!b.A.isServer()&&JSON.parse(localStorage.getItem("dndData"))||{};n&&n.isDNDEligible&&n.isDNDActive?r(p.lx.COMMON_MODAL,{Component:C.A,modalId:"unlock-event-dnd",data:{},parentClass:"drawer-popup unlock-account dnd-popup",backDropClass:"bottom-sheet",setUpdatedDndValue:this.setUpdatedDndValue,redirectToPage:()=>
1{const s=(0,h.Ht)(b.A.sessionNames.isSpecialSession);let r;s&&s.updatedDndValue&&(r=!0),a(e,t,r),!b.A.isServer()&&sessionStorage.removeItem("isSpecialSession")},type:"isSpecial",closePopup:!0}):r(p.lx.ADD_PACKS_MODAL,{modalId:`add-packs-${e}`,text:"PACKS",idx:e,eventType:t,eventSubHeading:s,validateFormHandler:a,pwToken:i,openModal:r})},this.redirectToRecharge=()=>{const{redirectToRechargeHandler:e}=this.props;e()},this.onPackChange=(e,t)=>{const{onPackChangeHandler:s}=this.props;s(e,t)},this.redirectToTDigital=()=>{const e=(0,h.Xo)().encryptId;(0,h.Sw)({event:"Enroll Now My Account","Sub Id":(0,h.Xo)().id||""}),window.location.href=`${b.A.NODE_API_ROOT}/tcp/${e}`},this.handleSalesforceEvent=e=>{(0,h.Yl)({eventName:e})}}componentDidMount(){this.redirectToNetflix(),this.redirectToAppPage(),this.attachSalesforceEventHandlers()}render(){const{i:e,event:t,accountDetail:s,previewMode:a,btnText:i}=this.props,{button:n}=this.state;switch(t.event_type){case"subscribe":{const s=t.packages[0]&&"N"===t.packages[0].hd?"SD":"HD";return(0,v.jsx)(r.Fragment,{children:"text"===t.field_subscribe_type?(0,v.jsx)("div",{className:"card",children:(0,v.jsxs)("div",{className:"offer-card-home",style:{background:`url(${t.field_banner_image.url}) no-repeat 100% bottom`,height:"100%"},children:[(0,v.jsx)("div",{className:"img-contr",children:(0,v.jsx)("img",{src:t.field_show_image.url,alt:t.field_show_image.alt,title:t.field_show_image.title,width:t.field_show_image.width,height:t.field_show_image.height})}),(0,v.jsx)("div",{className:"code",children:t.field_name}),(0,v.jsxs)("p",{className:"mT10",children:[t.field_language," ",s&&t.field_language?`| ${s}`:`${s}`,t.packages[0].pack_mrp&&s?(0,v.jsxs)(r.Fragment,{children:[(0,v.jsx)("span",{className:"rupee",children:" â¹"}),t.packages[0].pack_mrp]}):(0,v.jsxs)(r.Fragment,{children:[(0,v.jsx)("span",{className:"rupee",children:" â¹"}),"|",t.packages[0].pack_mrp]})]}),t.field_body?(0,v.jsx)(S.A,{className:"card-info",htmlContent:t.field_body}):null,(0,v.jsx)(d.A,{disabled:a,config:n.buttonConfig,content:"Subscribe Now",onClick:()=>this.validateForm(e,"subscribe",{packPrice:t.packages[0].pack_mrp,packName:t.packages[0].pack_name})})]})}):(0,v.jsx)("div",{className:"card",children:(0,v.jsxs)("div",{className:"offer-card-home event-offers",children:[(0,v.jsx)("div",{children:(0,v.jsx)("img",{src:t.field_media_image.url,alt:t.field_media_image.alt,title:t.field_media_image.title,width:t.field_media_image.width,height:t.field_media_image.height})}),(0,v.jsx)(d.A,{disabled:a,config:n.buttonConfig,content:"Subscribe Now",onClick:()=>this.validateForm(e,"subscribe",{packPrice:t.packages[0].pack_mrp,packName:t.packages[0].pack_name})})]})})})}case"packs":return(0,v.jsx)(r.Fragment,{children:Object.keys(t).length>0?(0,v.jsx)("div",{className:"card",style:{background:`url(${t.field_banner_image.url}) no-repeat 100% -1px`},children:(0,v.jsxs)("div",{className:"offer-card-home",children:[(0,v.jsx)("h2",{className:"gradient heading2",children:t.field_name}),t.packages.length>0&&t.packages.map(s=>(0,v.jsxs)("div",{className:"radio-button text-left add-pack-dtl mT10",children:[(0,v.jsx)("input",{className:"form-check-input ellipse2",type:"radio",id:`${s.id}-${e}`,value:s.id,checked:s.id===t.packages.selectedId,onChange:()=>this.onPackChange(s,e)}),(0,v.jsxs)("label",{className:"form-check-label ellipse2",htmlFor:`${s.id}-${e}`,children:[s.pack_name," ","-"," ",s.pack_mrp?(0,v.jsxs)("span",{className:"small gray-txt",children:[(0,v.jsx)("span",{className:"rupee",children:" â¹"}),s.pack_mrp,(0,v.jsx)("span",{children:"/ month"})]}):null]})]},s.id)),(0,v.jsx)(d.A,{disabled:a,config:n.buttonConfig,content:"Add Pack",onClick:()=>this.validateForm(e,"packs",{packId:t.packages.selectedId})})]})}):null});case"offers":const s=t.field_body.match(/<img/)?"":"offer-img";return(0,v.jsx)(r.Fragment,{children:(0,v.jsx)("div",{className:"card",children:(0,v.jsxs)("div",{className:`offer-card-home event-offers ${s}`,children:[(0,v.jsx)(S.A,{htmlContent:t.field_body}),(0,v.jsx)(d.A,{disabled:a,config:n.buttonConfig,content:"Recharge Now",onClick:()=>this.redirectToRecharge()})]})})});case"banner_offer":return(0,v.jsx)(r.Fragment,{children:(0,v.jsx)("div",{className:"card",id:`WNBANNER${e+1}`,children:(0,v.jsx)("div",{className:"banner_offer offer-card-home other-offers new-btn campaign-netflix",onClick:e=>this.sendInfoToGA(e,t),children:(0,v.jsx)(S.A,{htmlContent:t.field_body})})})});case"enroll_banner":return(0,v.jsx)(r.Fragment,{children:(0,v.jsx)("div",{className:"card",children:(0,v.jsxs)("div",{className:`offer-card-home event-offers ${s}`,children:[(0,v.jsx)(S.A,{htmlContent:t.field_body}),(0,v.jsx)(d.A,{disabled:a,config:n.buttonConfig,content:i,onClick:()=>this.redirectToTDigital()})]})})});default:return null}}}const _={openModal:u.qf,closeModal:u.Oo};w.propTypes={previewMode:N().bool},w.defaultProps={previewMode:!1};const E=(0,c.Ng)(null,_)((0,o.A)(w)),T=e=>{const{menu:t,redirectToPage:s,history:a}=e,r=()=>{const e=t.link;(0,h.Sw)({event:"My Account- Bottom Scipt","Title of the script":`${t.title1} ${t.title2}`});const r=t&&t.title1?(t.title1+(t.title2?" "+t.title2:"")).toUpperCase():"";var i;if(r&&(i=r,(0,h.Yl)({eventName:"TATA PLAY REMOTE"===i?"TATAPLAY REMOTE":"TATA PLAY SPECIALS"===i?"TATAPLAY SPECIALS":i})),t.isAuth)s(t.link);else if(e.includes("tata-sky-services")){(0,h.CG)()?s(t.link):a.push(e)}else e.includes("/dth/")?window.location.href=`${e}`:a.push(e)};return(0,v.jsx)("div",{className:"menu-card",children:(0,v.jsxs)("a",{href:"javascript:void(0)",onClick:()=>r(),children:[(0,v.jsx)("div",{className:"menu-img",children:(0,v.jsx)("img",{src:`${b.A.NODE_API_ROOT}${t.imgSrc}`,alt:"Upgrade",title:"Upgrade",height:"27px"})}),(0,v.jsxs)("div",{className:"mT5 txt",children:[t.title1," ",(0,v.jsx)("span",{className:"nxtline",children:t.title2})]})]})})};var D=s(78725);const O=(0,s(45853).y)(e=>{const{"ha-common-banner":t,history:s}=e,a=(e,t,a)=>{const r=e.substring(e.indexOf(":")+1);(0,h.Sw)({event:"ctaClick",clickText:t,featureName:a,"Sub ID":(0,h.Xo)().id||null,section:"A"}),"/tata-play-secure-plus/bundle"!==r&&"/tata-play-secure/bundle"!==r||(0,h.Sw)({clickText:t,"Sub ID":(0,h.Xo)().id||null,pageSection:"A","Type of Journey":"/tata-play-secure-plus/bundle"===r?"HA-Secure Plus -Buy Journey":"HA-Secure -Buy Journey",event:"productClick",ecommerce:{click:{actionField:"",products:[{name:"/tata-play-secure-plus/bundle"===r?"Tata Play Secure Plus":"Tata Play Secure",id:"",price:"",brand:"Tata Play",category:"Home Automation",variant:"/tata-play-secure-plus/bundle"===r?"Google":"Hualai",position:1}]}}}),s.push(`/${b.A.home_automation}${r}`)};return(0,v.jsxs)("div",{className:"hero-banner-static unique-banner service2",style:{width:"1499px;"},children:[(0,v.jsx)("div",{className:"hero-text",children:(0,v.jsx)("div",{className:"contr",children:(0,v.jsxs)("div",{className:"heading-md mB0",children:[(0,v.jsx)("div",{className:"banner-bimglogo",children:(0,v.jsx)("img",{src:`${b.A.NODE_API_ROOT}${x()(t,"field_banner_logo.url","")}`,alt:"",className:"img-fluid imgwidth informative-image"})}),(0,v.jsx)("h1",{className:"heading1 gradient",children:x()(t,"field_title","")}),(0,v.jsx)("h2",{className:"heading2 for-desktop",children:x()(t,"field_subtitle","")}),(0,v.jsx)("h2",{className:"heading2 for-mobile",children:"Stay informed about your homeâs security â always, from anywhere"}),(0,v.jsx)("div",{className:"btn-wrapp",children:(0,v.jsxs)("div",{className:"btn-cont",children:[(0,v.jsx)("a",{className:"btn btn-primary waves-effect waves-light",href:"javascript:void(0)",onClick:()=>a(x()(t,"field_link[0].uri",""),x()(t,"field_link[0].title",""),x()(t,"field_title")),tabIndex:"0",children:x()(t,"field_link[0].title","")}),(0,v.jsx)("a",{className:"sub-link d-inline",href:"javascript:void(0)",onClick:()=>a(x()(t,"field_button[0].uri",""),x()(t,"field_button[0].title",""),x()(t,"field_title")),tabIndex:"0",children:x()(t,"field_button[0].title","")})]})})]})})}),(0,v.jsxs)("div",{className:"res-bottomwrapp",children:[(0,v.jsxs)("div",{className:"res-bottom-text",children:[(0,v.jsx)("div",{className:"left-icon",children:(0,v.jsx)("img",{src:`${b.A.NODE_API_ROOT}${x()(t,"field_mobile_banner_image.url","")}`,alt:"",className:"img-fluid decorative-image"})}),(0,v.jsx)("div",{className:"top-text",children:x()(t,"field_mobile_banner_text","")})]}),(0,v.jsx)("div",{className:"res-bottom-sub",children:(0,v.jsx)("a",{href:"javascript:void(0)",onClick:()=>a(x()(t,"field_link[0].uri",""),x()(t,"field_link[0].title",""),x()(t,"field_title")),tabIndex:"0",children:x()(t,"field_link[0].title","")})})]}),(0,v.jsx)("div",{className:"hero-image",style:{backgroundImage:`url('${b.A.NODE_API_ROOT}${x()(t,"field_image.url","")}')`,zIndex:"-9"}}),(0,v.jsx)("div",{className:"res-image",children:(0,v.jsx)("img",{src:`${b.A.NODE_API_ROOT}${x()(t,"field_mobile_image.url","")}`,alt:"",className:"img-fluid imgwidth informative-image"})})]})}),k=({banners:e,redirectToPage:t})=>{const s="/s3-api/v1/assets/mp/channels-category-default.png",a=(0,r.useRef)([]);a.current=[];const i=e=>{e&&!a.current.includes(e)&&a.current.push(e)};return(0,r.useEffect)(()=>{a.current.map((e,t)=>{const s=e;s.style.animationDelay=`${t}s`,s.style.animationDuration=`${a.current.length}s`})},[]),["Netflix","UpgradeNetflix","NetflixSignUp"].includes(e.type)?(0,v.jsx)("div",{className:"smart-tips-wrapp bing-smart-tip netflix-promo",onClick:()=>{t(e.type)},children:(0,v.jsx)("div",{className:"dflex bing-tipwrapp cursor",children:(0,v.jsx)("div",{className:"tatabing-blk txtsel-disable",children:(0,v.jsxs)("div",{className:"top-section",children:[(0,v.jsx)("span",{className:"img-contr",children:(0,v.jsx)(m.A,{src:`${b.A.NODE_API_ROOT}${e.icon}`,alt:e.type,title:e.type,altImage:s})}),(0,v.jsxs)("div",{className:"txt-contr",children:[(0,v.jsx)("span",{className:"gradient maintxt",children:e.title}),(0,v.jsx)("div",{className:"mT5 small",children:e.subDescription})]})]})})})}):["MobileBingePrimary","MobileBingeUpgrade"].includes(e.type)?(0,v.jsx)("div",{className:"binge-primary",children:(0,v.jsx)("div",{className:"smart-tips-wrapp bing-smart-tip curs
1or",onClick:()=>{t(e.type)},children:(0,v.jsxs)("div",{className:"txt-contr",children:[(0,v.jsx)("span",{className:"gradient maintxt",children:e.title}),(0,v.jsxs)("div",{className:"cont-contr",children:[(0,v.jsx)("span",{className:"img-contr",children:(0,v.jsx)(m.A,{src:`${b.A.NODE_API_ROOT}${e.icon}`,alt:e.type,title:e.type,altImage:s})}),(0,v.jsx)("span",{className:"txt-contr",children:e.subDescription})]})]})})}):["SuperCombos","SuperCombosUpgrade"].includes(e.type)?(0,v.jsx)("div",{className:"combo-banner",children:(0,v.jsx)("div",{className:"smart-tips-wrapp bing-smart-tip",onClick:()=>{t(e.type)},children:(0,v.jsx)("div",{className:"dflex bing-tipwrapp txtsel-disable",children:(0,v.jsx)("div",{className:"tatabing-blk",children:(0,v.jsxs)("div",{className:"top-section netflix-binge",children:[(0,v.jsx)("span",{className:"img-contr",id:"crossfade",children:e.icon.map(e=>(0,v.jsx)("img",{src:e,alt:s,title:e.type,className:"img-fluid",ref:i}))}),(0,v.jsxs)("div",{className:"txt-contr",children:[(0,v.jsxs)("span",{className:"maintxt-outer",children:[(0,v.jsx)("span",{className:"gradient maintxt",children:e.title}),(0,v.jsx)("span",{className:"gradient maintxt",children:e.subTitle})]}),(0,v.jsx)("div",{className:"mT5 small",children:e.subDescription})]})]})})})})}):(0,v.jsx)("div",{className:"smart-tips-wrapp bing-smart-tip",onClick:()=>{t(e.type)},children:(0,v.jsx)("div",{className:"dflex bing-tipwrapp cursor",children:(0,v.jsxs)("div",{className:"tatabing-blk txtsel-disable",children:[(0,v.jsxs)("div",{className:"top-section",children:[(0,v.jsx)("span",{className:"img-contr",children:(0,v.jsx)(m.A,{src:`${b.A.NODE_API_ROOT}${e.icon}`,alt:"Recording Storage Plan",title:"Recording Storage Plan",altImage:s,width:"20px"})}),(0,v.jsx)("span",{className:"gradient maintxt",children:e.title})]}),(0,v.jsx)("div",{className:"mT5 small",children:e.subDescription})]})})})},P={menu:{setting:{dots:!1,infinite:!1,arrows:!1,speed:500,slidesToShow:5,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:4,slidesToScroll:1}},{breakpoint:600,settings:{slidesToShow:3.5,slidesToScroll:2,swipeToSlide:!0}},{breakpoint:800,settings:{slidesToShow:3.5,slidesToScroll:1,swipeToSlide:!0}},{breakpoint:480,settings:{slidesToShow:3.5,slidesToScroll:1,swipeToSlide:!0}}]},component:T},event:{setting:{dots:!0,infinite:!1,speed:500,slidesToShow:3,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:4,slidesToScroll:1}},{breakpoint:850,settings:{slidesToShow:2.1,slidesToScroll:1,swipeToSlide:!0}},{breakpoint:600,settings:{slidesToShow:1.7,slidesToScroll:1,swipeToSlide:!0}},{breakpoint:480,settings:{slidesToShow:1.1,slidesToScroll:1,swipeToSlide:!0}}]},component:E},offer:{setting:{variableWidth:!0,dots:!0,infinite:!1,speed:500,slidesToShow:3,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:600,settings:{slidesToShow:2,slidesToScroll:1,dots:!1,arrows:!1}},{breakpoint:800,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:480,settings:{slidesToShow:1.15,slidesToScroll:1,dots:!1,arrows:!1}}]},component:l.A},service:{setting:{dots:!0,infinite:!1,speed:500,slidesToShow:3,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:600,settings:{slidesToShow:2,slidesToScroll:2,dots:!1,arrows:!1}},{breakpoint:800,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:480,settings:{slidesToShow:1.15,slidesToScroll:1,dots:!1,arrows:!1}}]},component:j},"ha-common-banner":{setting:{dots:!0,infinite:!1,speed:500,slidesToShow:1,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:1,slidesToScroll:1}},{breakpoint:600,settings:{slidesToShow:1,slidesToScroll:2}},{breakpoint:800,settings:{slidesToShow:1,slidesToScroll:1}},{breakpoint:480,settings:{slidesToShow:1,slidesToScroll:1}}]},component:O},banners:{setting:{dots:!0,infinite:!0,arrows:!1,speed:1e3,slidesToShow:1,slidesToScroll:1,autoplay:!0,responsive:[{breakpoint:1024,settings:{slidesToShow:1,slidesToScroll:1}},{breakpoint:600,settings:{slidesToShow:1,slidesToScroll:1,swipeToSlide:!0}},{breakpoint:800,settings:{slidesToShow:1,slidesToScroll:1,swipeToSlide:!0}},{breakpoint:480,settings:{slidesToShow:1,slidesToScroll:1,swipeToSlide:!0}}]},component:k},device:{setting:{dots:!0,infinite:!1,speed:500,slidesToShow:3,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:600,settings:{slidesToShow:3,slidesToScroll:2}},{breakpoint:800,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:480,settings:{slidesToShow:1,slidesToScroll:1}}]},component:D.A},default:{setting:{dots:!0,infinite:!1,speed:500,slidesToShow:4,slidesToScroll:1,responsive:[{breakpoint:1024,settings:{slidesToShow:4,slidesToScroll:1}},{breakpoint:600,settings:{slidesToShow:3,slidesToScroll:2}},{breakpoint:800,settings:{slidesToShow:3,slidesToScroll:1}},{breakpoint:480,settings:{slidesToShow:1.25,slidesToScroll:1}}]},component:j}};var I=s(4589);function M(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function $(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};
1t%2?M(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):M(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const R=e=>{const t=e.cardComponent;return(0,v.jsx)(I.A,$($({ref:e.forwardRef},e.settings),{},{children:e.arrayElement&&e.arrayElement.map((s,a)=>(0,v.jsx)(t,$({i:a,[e.type]:s,offerType:s&&(0,g.getOfferType)(s.field_offers_category,s.field_offers_type).offerType||"",offerCategory:s&&(0,g.getOfferType)(s.field_offers_category,s.field_offers_type).offerCategory||""},e),s&&s.id?s.id:a))}))};function L(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function F(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?L(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):L(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}class U extends r.Component{constructor(...e){super(...e),this.state={settings:{}},this.onSwipe=()=>{this.slider&&(this.slider.innerSlider.clickable=!0)},this.getComponent=()=>{let{type:e}=this.props;e in P||(e="default");return P[e].component}}componentDidMount(){const{type:e}=this.props;this.updateSliderSetting(e)}updateSliderSetting(e){let t=e;e in P||(t="default");const s=F({},P[t].setting);s.onSwipe=this.onSwipe.bind(this),this.setState({settings:s})}render(){const{settings:e}=this.state,{arrayElements:t,type:s}=this.props;return n()(e)?null:(0,v.jsx)(r.Fragment,{children:(0,v.jsx)(R,F({type:s,cardComponent:this.getComponent(),forwardRef:e=>{this.slider=e},settings:e,arrayElement:t},this.props))})}}const B=(0,o.A)(U)},11435(e,t,s){var a=s(80045),r=s(64467),i=s(96540),n=s(52852),o=s(44979),l=s(49862),c=s(74191),d=s(56480),m=s(88827),u=s(34674),h=s(52278),p=s(97965),g=s(3304),f=s(21439),x=s(71693),b=s(23866),v=s(74848);const y=["hasErrors"];function S(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function j(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?S(Object(s),!0).forEach(function(t){(0,r.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):S(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const A={setApiError:o.x8};class N extends i.Component{constructor(...e){super(...e),this.state={render:!1,noEmail:!1,emailSuccess:!1,pageTitle:"",subTitle:"",formErrorMessage:"",resetPwdForm:(0,b.L3)(),confirmButton:{buttonConfig:{type:"submit",class:"blue"}},email:null,phone:null},this.captchaElement=i.createRef(),this.componentDidMount=async()=>{if(!l.A.isServer()){const{setApiError:e,forgotPasswordData:t}=this.props,{resetPwdForm:s}=this.state;try{const e=await n.n.getPageTitle("myaccount_reset_password");if(e.data.status===l.A.MESSAGES_TYPES.S3_SUCCESS){const s=t&&t.rmn||"",a=t&&t.email||"";if(s&&""!==s||a&&""!==a&&"null"!==a){const t=a||"-",r=s||"-";this.setState({email:t,phone:r,render:!0,pageTitle:e.data.data?e.data.data.title:"",subTitle:e.data.data?e.data.data.field_sub_title:""})}else s&&""===s&&a&&(""===a||null===a)&&this.setState({noEmail:!0,render:!0})}}catch(t){console.log(t),e(l.A.serverError,!0)}}},this.inputChangedHandler=(e,t)=>{this.setState({formErrorMessage:""});const{resetPwdForm:s}=this.state,a=j({},s),r=j({},a[t]);let i=e;"verificationCode"===t&&(i=i.replace(/[^0-9]/g,""),i.length>4&&(i=i.slice(0,4))),"newPassword"!==t&&"confirmPassword"!==t||(i=i.replace(/\s/g,"")),r.value=i,r.touched=!0,r.valid=!0,r.errorMessage="",a[t]=r,this.setState({resetPwdForm:a})},this.validateForm=e=>{e.preventDefault();const{resetPwdForm:t}=this.state,s={};for(const e in t)s[e]=t[e].value;const r=u.A.validateResetPwdForm(s),{hasErrors:i}=r,n=(0,a.A)(r,y);if(i){const e=j({},t);for(const s in t){const t=n[`${s}Message`];t&&""!==t&&(e[s].valid=!1,e[s].errorMessage=t)}this.setState({resetPwdForm:e})}else this.onValidateCaptcha()},this.validateFromServer=async(e,t)=>{this.setState({render:!1});try{const s=(0,f.Xo)().id||(0,f.Ht)("userSubId"),a=j(j({},e),{},{subscriberId:s,captchaToken:t}),r=await h.j.resetPassword(a),i=await r.data;if(i.status===l.A.MESSAGES_TYPES.S3_SUCCESS)this.setState({render:!0,emailSuccess:!0});else{const{data:e,message:t}=i;if(e&&!0===e.isRegisterationNeeded){const{history:e}=this.props;e.push(`/${l.A.my_account_path}`)}else this.setState({render:!0,formErrorMessage:i.message||l.A.serverError})}}catch(e){this.setState({render:!0,formErrorMessage:l.A.serverError})}},this.onCaptchaResolved=e=>{const{resetPwdForm:t}=this.state,s={};for(const e in t)s[e]=t[e].value;e&&this.validateFromServer(s,e)},this.onValidateCaptcha=()=>{this.captchaElement.execute(this.captchaElementResetId)},this.redirectBack=()=>{const{history:e}=this.props;e.push(`/${l.A.my_account_path}/login`)}}render(){const{render:e,pageTitle:t,subTitle:s,resetPwdForm:a,confirmButton:r,formErrorMessage:n,noEmail:o,emailSuccess:l,email:u,phone:h}=this.state,{errorCode:p,manifest:b,showBackBtn:y}=this.props,S=(0,f.WF)(),j=[];
1return Object.keys(a).forEach(e=>{j.push({id:e,config:a[e]})}),p?(0,v.jsx)(g.A,{}):o?(0,v.jsx)(i.Fragment,{children:(0,v.jsxs)("div",{className:"container backbtn-without-header",children:[!S&&y&&(0,v.jsx)("div",{className:"back-button backbtn-responsive",onClick:()=>this.redirectBack(),children:(0,v.jsxs)("span",{className:"a-link",children:[(0,v.jsx)("i",{className:"icon-left-arrow",title:"Back"}),(0,v.jsx)("span",{children:"Back"})]})}),(0,v.jsx)("div",{className:"main-container",children:(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"heading1 gradient",style:{fontSize:"32px"},children:"Your Email Id and Registered Mobile Number are not registered. Kindly contact customer support!"})})})]})}):l?(0,v.jsx)(i.Fragment,{children:(0,v.jsxs)("div",{className:"container backbtn-without-header",children:[!S&&y&&(0,v.jsx)("div",{className:"back-button backbtn-responsive",onClick:()=>this.redirectBack(),children:(0,v.jsxs)("span",{className:"a-link",children:[(0,v.jsx)("i",{className:"icon-left-arrow",title:"Back"}),(0,v.jsx)("span",{children:"Back"})]})}),(0,v.jsx)("div",{className:"main-container",children:(0,v.jsx)("div",{className:"heading-md",children:(0,v.jsx)("h1",{className:"heading1 gradient",style:{fontSize:"40px"},children:"Your Password has been reset Successfully!"})})})]})}):e?(0,v.jsx)(i.Fragment,{children:(0,v.jsx)("div",{id:"static-reset-pwd",className:"reset-pwd",style:{position:"relative"},children:(0,v.jsxs)("div",{className:"container reset-pwd-back",children:[!S&&y&&(0,v.jsx)("div",{className:"back-button backbtn-responsive",onClick:()=>this.redirectBack(),children:(0,v.jsxs)("span",{className:"a-link",children:[(0,v.jsx)("i",{className:"icon-left-arrow",title:"Back"}),(0,v.jsx)("span",{children:"Back"})]})}),(0,v.jsxs)("div",{className:"main-container",children:[(0,v.jsxs)("div",{className:"heading-md",children:[(0,v.jsx)("h1",{className:"heading1 gradient",children:t}),s?(0,v.jsx)("h2",{className:"heading2",children:s}):null]}),(0,v.jsxs)("ul",{className:"email-phone",children:[u?(0,v.jsxs)("li",{style:{display:"flex"},children:[(0,v.jsx)("span",{children:"Email:"})," ",(0,v.jsx)("span",{className:"reset-pwd-credential",children:u})]}):null,h?(0,v.jsxs)("li",{style:{display:"flex"},children:[(0,v.jsx)("span",{children:"Registered Mobile Number:"}),(0,v.jsx)("span",{className:"reset-pwd-credential",children:h})]}):null]}),(0,v.jsxs)("form",{onSubmit:e=>this.validateForm(e),autoComplete:"off",children:[(0,v.jsx)("div",{className:"body-container",children:(0,v.jsx)("div",{className:"innercontainer-xs save-user-details",children:j&&j.map(e=>(0,v.jsx)("div",{className:"form-group",children:(0,v.jsx)(d.A,{labelConfig:e.config.labelConfig,elementType:e.config.elementType,elementConfig:e.config.elementConfig,value:e.config.value,valid:e.config.valid,errorMessage:e.config.errorMessage,touched:e.config.touched,wrapperClasses:e.config.wrapperClasses,helpText:e.config.helpText,changed:t=>this.inputChangedHandler(t,e.id)})},e.id))})}),(0,v.jsx)(x.A,{ref:this.captchaElement,id:"login-recaptcha",customClass:"resetPwdRecaptcha",getRef:e=>{this.captchaElement=e},onChange:this.onCaptchaResolved,resetId:e=>{this.captchaElementResetId=e}}),(0,v.jsxs)("div",{className:"footer-contr text-center",id:"verify-footer",children:[(0,v.jsx)("h3",{className:"heading3 validate invalid-text form-error",children:n}),(0,v.jsx)(m.A,{config:r.buttonConfig,content:"Confirm",onClick:e=>this.validateForm(e)})]})]})]})]})})}):(0,v.jsx)(c.A,{})}}const C=(0,p.Ng)(e=>({errorCode:e.commonReducer.errorCode,manifest:e.commonReducer.manifest}),A)(N);s.d(t,["A",0,C])},23866(e,t,s){var a=s(67328);s.d(t,["L3",0,()=>({verificationCode:{wrapperClasses:["form-group"],labelConfig:{label:"Verification code",classes:["sel","active"]},elementType:"input",elementConfig:{type:"text",placeholder:"",maxLength:4,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1},newPassword:{wrapperClasses:["form-group"],labelConfig:{label:"New password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",minLength:8,tabIndex:0,autoComplete:"new-password"},value:"",helpText:"Password must contain One Capital, One Small, One Number, One Special Character with minimum 8 characters",errorMessage:"",valid:!0,touched:!1},confirmPassword:{wrapperClasses:["form-group"],labelConfig:{label:"Confirm new password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",minLength:8,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1}}),"LE",0,()=>({subscriberId:{wrapperClasses:["form-group"],labelConfig:{label:"Subscriber ID",classes:["sel","active"]},elementType:"input",elementConfig:{type:"tel",placeholder:"",maxLength:10,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1},password:{wrapperClasses:["form-group"],labelConfig:{label:"Password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",maxLength:20,tabIndex:0,autoComplete:"new-password"},value:"",errorMessage:"",valid:!0,touched:!1},confirmPassword:{wrapperClasses:["form-group"],labelConfig:{label:"Confirm password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",maxLength:20,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1},email:{wrapperClasses:["form-group"],labelConfig:{label:"Email ID",classes:["sel","active"]},elementType:"input",elementConfig:{type:"text",placeholder:"",maxLength:50,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1},rmn:{wrapperClasses:["form-group","phone-field"],labelConfig:{label:"Registered mobile number",classes:["sel","active"]},elementType:"input",elementConfig:{type:"tel",placeholder:"",maxLength:10,tabIndex:0},value:"",errorMessage:"",valid:!0,touched:!1}}),"ks",0,e=>!!a.xT[e]&&a.xT[e],"sz",0,()=>({password:{wrapperClasses:["form-group"],labelConfig:{label:"Old password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",minLength:8,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1},newPassword:{wrapperClasses:["form-group"],labelConfig:{label:"New password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",minLength:8,tabIndex:0,autoComplete:"new-password"},value:"",helpText:"Password must contain One Capital, One Small, One Number, One Special Character with minimum 8 characters",errorMessage:"",valid:!0,touched:!1},confirmPassword:{wrapperClasses:["form-group"],labelConfig:{label:"Confirm new password",classes:["sel","active"]},elementType:"input",elementConfig:{type:"password",placeholder:"",minLength:8,tabIndex:0,autoComplete:"off"},value:"",errorMessage:"",valid:!0,touched:!1}})])}
1,78528(e,t,s){var a=s(64467),r=s(81106),i=s(11668),n=(s(44979),s(49862)),o=s(21439);function l(e,t){var s=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),s.push.apply(s,a)}return s}function c(e){for(var t=1;t<arguments.length;t++){var s=null!=arguments[t]?arguments[t]:{};t%2?l(Object(s),!0).forEach(function(t){(0,a.A)(e,t,s[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(s)):l(Object(s)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t))})}return e}const d=new class{getMyOffers(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-pack/offers/getOffers`;return new r.I(t).doAjax()}getMsalesOffers(){const e=c({},i.x4);e.url=`${n.A.NODE_API_ROOT}/inception-pack/mSales/offers`;return new r.I(e).doAjax()}offerSummary(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-pack/mSales/offers/summary`;return new r.I(t).doAjax()}offerBalanceCheck(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-pack/mSales/balance-data`;return new r.I(t).doAjax()}resendOtp(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-pack/otp/resend-otp`;return new r.I(t).doAjax()}verifyOtp(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-pack/otp/verify-otp`;return new r.I(t).doAjax()}removeAndAcceptOffer(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-pack/mSales/acceptOffer`;return new r.I(t).doAjax()}campaignOfferStatus(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-pack/mSales/acceptOfferStatus`;return new r.I(t).doAjax()}sendRechargeLink(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-pack/mSales/sendRechargeLink`;return new r.I(t).doAjax()}rechargeOffer(e){const t=c({},i.d_);t.params={packAmount:e.packAmount},t.url=`${n.A.NODE_API_ROOT}/inception-consumer/user/get-recharge-offer/${e.subscriberId}`;return new r.I(t).doAjax()}getPackSummary(e){i.d_.params=e,i.d_.url=`${n.A.NODE_API_ROOT}/inception-pack/recommended-api/get-pack`;return new r.I(i.d_).doAjax()}fetchData(e){e.mock&&!0===e.mock?i.XN.url=`/mocks/${e.apiPath}.json`:i.XN.url=e.apiPath;return new r.I(i.XN).doAjax()}offerRedirection(e){const t=c({},i.d_);t.params=e,t.url=`${n.A.NODE_API_ROOT}/inception-consumer/user/recharge-offer`;return new r.I(t).doAjax()}offerPreRechageRequest(e,t){const s=(0,o.M1)(),a=c({},i.d_);a.params=e,a.url=`${n.A.NODE_API_ROOT}/inception-pack/offers/preRechargeRequest`,t&&"mpPage"==t&&(a.url=`${n.A.NODE_API_ROOT}/manage-pack/offer-data/preRechargeRequest/${s}`);return new r.I(a).doAjax()}getNBAOBOffers(){const e=(0,o.M1)(),t=c({},i.d_);t.url=`${n.A.NODE_API_ROOT}/manage-pack/offer-data/pulse/getOffers/${e}`;return new r.I(t).doAjax()}getSelectedPack(e){const t=(0,o.M1)(),s=c({},i.d_);s.params=e,s.url=`${n.A.NODE_API_ROOT}/manage-pack/usp-data/v1/selectedPackData/${t}`;return new r.I(s).doAjax()}getPackSummary(e){const t=(0,o.M1)(),s=c({},i.d_);s.params=e,s.url=`${n.A.NODE_API_ROOT}/manage-pack/sec-static-data/packSummary/${t}`;return new r.I(s).doAjax()}getSubscribeCharges(e){const t=(0,o.M1)(),s=c({},i.d_);s.params=e,s.url=`${n.A.NODE_API_ROOT}/manage-pack/sec-static-data/subscriber-charges/${t}`;return new r.I(s).doAjax()}getSubscribeExcistingChargers(){const e=(0,o.M1)(),t=c({},i.x4);t.url=`${n.A.NODE_API_ROOT}/manage-pack/static-data/subscriberExistingPacks/${e}`;return new r.I(t).doAjax()}getBalanceCheck(){const e=(0,o.M1)(),t=c({},i.x4);t.url=`${n.A.NODE_API_ROOT}/manage-pack/sub-data/balance-data/${e}`;return new r.I(t).doAjax()}removeAndAcceptOBOffer(e){const t=(0,o.M1)(),s=c({},i.d_);s.params=e,s.url=`${n.A.NODE_API_ROOT}/manage-pack/offer-data/acceptOffer/${t}`;return new r.I(s).doAjax()}campaignOfferOBStatus(e){const t=(0,o.M1)(),s=c({},i.d_);s.params=e,s.url=`${n.A.NODE_API_ROOT}/manage-pack/offer-data/acceptOfferStatus/${t}`;return new r.I(s).doAjax()}};s.d(t,["c",0,d])}}]);
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.