@eka-care/abha-stg 0.1.74 → 0.1.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,7 @@ var No=a=>{throw TypeError(a)};var Gs=(a,_,$)=>_.has(a)||No("Cannot "+$);var Ft=
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var f$3=reactExports,k$3=Symbol.for("react.element"),l$b=Symbol.for("react.fragment"),m$3=Object.prototype.hasOwnProperty,n$5=f$3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$6={key:!0,ref:!0,__self:!0,__source:!0};function q$2(a,_,$){var _e,et={},tt=null,rt=null;$!==void 0&&(tt=""+$),_.key!==void 0&&(tt=""+_.key),_.ref!==void 0&&(rt=_.ref);for(_e in _)m$3.call(_,_e)&&!p$6.hasOwnProperty(_e)&&(et[_e]=_[_e]);if(a&&a.defaultProps)for(_e in _=a.defaultProps,_)et[_e]===void 0&&(et[_e]=_[_e]);return{$$typeof:k$3,type:a,key:tt,ref:rt,props:et,_owner:n$5.current}}reactJsxRuntime_production_min.Fragment=l$b;reactJsxRuntime_production_min.jsx=q$2;reactJsxRuntime_production_min.jsxs=q$2;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports,ABHA_V3_SKIP_STATES=(a=>(a.ABHA_END="abha_end",a.CONFIRM_MOBILE_OTP="confirm_mobile_otp",a.ABHA_CREATE="abha_create",a.ABHA_SELECT="abha_select",a.REQUEST_MOBILE_OTP="request_mobile_otp",a))(ABHA_V3_SKIP_STATES||{}),APPOINTMENT_CHANNEL=(a=>(a.PRACTO="Practo",a.COVID_CONNECT="Covid-Connect",a.CORPORATE_CONNECT="Corporate-Connect",a.SPHERE_INDIA_PSYCHOLOGY="SPPS",a.SPHERE_INDIA_COVID="SPCO",a.TALK_TO_DOCTOR="TTD",a.SECOND_OPINION="SECO",a.EMERGENCY="EMCY",a.CORPORATE_CONNECT_INIT="CC-Init",a.WALKIN="Walkin",a.WALKINQR="Walkin-Scan",a.OFFLINE="Offline",a.ON_PAD="ON-PAD",a.UHI_HPD="UHI_HPD",a.UHI_DCM="UHI_DCM",a.IVR="IVR",a.STAFF="Staff",a.DOCTOR="Doctor",a.FOLLOW_UP="FOLLOW-UP",a.ONLINE_APPOINTMENT="Online-Appointment",a.PACKAGE="PACKAGE",a.PATIENT_REQUESTED="Patient-Requested",a.ABHA="ABHA",a))(APPOINTMENT_CHANNEL||{}),APPOINTMENT_STATUS=(a=>(a.CANCELLED="CN",a.ABORTED="AB",a.NO_SHOW="NS",a.NO_SHOW_DOCTOR="NSD",a.NO_SHOW_STAFF="NSS",a.COMPLETED="CM",a.RESCHEDULED="RE",a.ONGOING="OG",a.BOOKED="BK",a.PARKED="PA",a.PROVISIONAL_CANCELLED="PC",a.COMPLETED_NO_PRESCRIPTION="CMNP",a.DOCTOR_RESCHEDULED="RED",a.DOCTOR_CANCELLED="CND",a.STAFF_RESCHEDULED="RES",a.STAFF_CANCELLED="CNS",a.PAYMENT_NOT_RECEIVED="PNR",a.INITIATED="IN",a.RESERVED="RV",a.CHECKED_IN="CK",a.COMPLETED_IP="CMIP",a))(APPOINTMENT_STATUS||{});const bookedAptWhitelist=new Set(["BK","PA"]),completedQueueStatus=["CM","CMNP"],otherQueueStatus=["CN","CNS","CND","RE","RES","RED","AB","NS","NSD","NSS"],followupQueueStatus=["IN","RV","PC","RE"],completedAptWhitelist=new Set(completedQueueStatus),followupAptWhileWhitelist=new Set(followupQueueStatus),otherAptWhitelist=new Set(otherQueueStatus),opdAptWhitelist=new Set(["CK","OG"]);[...Array.from(completedAptWhitelist),...Array.from(followupAptWhileWhitelist),...Array.from(bookedAptWhitelist),...Array.from(opdAptWhitelist),...Array.from(otherAptWhitelist)];var AUTH_METHOD=(a=>(a[a.EMAIL=1]="EMAIL",a[a.MOBILE=2]="MOBILE",a[a.ABHA=7]="ABHA",a))(AUTH_METHOD||{}),LOADING_STATE=(a=>(a.IDLE="IDLE",a.LOADING="LOADING",a.RESOLVED="RESOLVED",a.REJECTED="REJECTED",a))(LOADING_STATE||{}),ABHA_AUTH_FLOW_METHOD=(a=>(a.PHR_ADDRESS="phr_address",a.MOBILE="mobile",a.ABHA_NUMBER="abha_number",a.AADHAR_NUMBER="aadhaar_number",a.REGISTRATION_TYPE="registration_type",a))(ABHA_AUTH_FLOW_METHOD||{}),REGISTRATION_TYPE=(a=>(a.LOGIN="login",a.CREATE="create",a))(REGISTRATION_TYPE||{}),DISCOUNT_TYPE=(a=>(a.PERCENTAGE="PERCENTAGE",a.AMOUNT="AMOUNT",a))(DISCOUNT_TYPE||{}),RECEIPT_PAYMENT_MODE_ID=(a=>(a.CASH="CASH",a.UPI="UPI",a.DEBIT_CARD="DEBIT_CARD",a.GPAY="GPAY",a.PAYTM="PAYTM",a.CREDIT_CARD="CREDIT_CARD",a.OTHER="OTHER",a.EKA_POSTPAY="EKA_POSTPAY",a.EKA_PREPAID="EKA_PREPAID",a.EKA_WALLET="EKA_WALLET",a))(RECEIPT_PAYMENT_MODE_ID||{}),RECEIPT_PAYMENT_MODE_NAME=(a=>(a.CASH="Cash",a.UPI="UPI",a.DEBIT_CARD="Debit Card",a.GPAY="GPay",a.PAYTM="Paytm",a.CREDIT_CARD="Credit Card",a.OTHER="Other",a.EKA_POSTPAY="Eka Payment",a.EKA_PREPAID="Eka Prepaid",a))(RECEIPT_PAYMENT_MODE_NAME||{}),QUEUE_CARD_ACTIONS=(a=>(a.TAGS="TAGS",a.VISIT_TYPE="VITY",a.PAYMENT_STATUS="PAYS",a.ASSESSMENT_STATUS="ASST",a.PAST_VISITS="PRES",a.CREATE_ABHA="ABHA",a.ADD_VITALS_AND_LAB_RESULTS="AVLR",a.ADD_ADDRESS="ADDR",a.REQUEST_RECORDS="RMDR",a.REQUEST_PAYMENT="REQP",a.ARCHIVE_APPOINTMENT="AAPT",a.CREATE_CERTIFICATE="CRMC",a.REFER_TO_DOCTOR="RTOD",a.SEND_GOOGLE_REVIEW_LINK="SGRL",a.MARK_NO_SHOW="MNSH",a.CREATE_TEMPLATE="CATP",a.FOLLOW_UP="FLWU",a.ABHA_ID="ABHA_ID",a.UPLOAD_MEDICAL_RECORDS="UPMR",a.RESUME="RESUME",a.CHECK_IN="CHECK_IN",a.EXIT="EXIT",a.WRITE_RX="WRITE_RX",a.START_VISIT="START_VISIT",a.RECEIPT="RECEIPT",a.ORDER_MEDICINE="ORDER_MEDICINE",a.PRINT_RX="PRINT_RX",a.QUESTIONAIRE="SAQU",a.LABEL="LABEL",a.NOTES="NOTES",a.ASSIGN_DOCTOR="ASSIGN_DOCTOR",a.RESCHEDULE_APPOINTMENT="RAPT",a))(QUEUE_CARD_ACTIONS||{}),AADHAAR_AUTH_STATES=(a=>(a.FACE_AUTH="FACE_AUTH",a.OTP="OTP",a.BIOMETRIC="BIOMETRIC",a.NONE="NONE",a))(AADHAAR_AUTH_STATES||{}),FACE_AUTH_CAPTURE_STATUS=(a=>(a.PENDING="PENDING",a.VERIFIED="VERIFIED",a.FAILED="FAILED",a.COMPLETE="COMPLETE",a))(FACE_AUTH_CAPTURE_STATUS||{});APPOINTMENT_STATUS.BOOKED,APPOINTMENT_STATUS.PARKED;APPOINTMENT_STATUS.CHECKED_IN,APPOINTMENT_STATUS.ONGOING;APPOINTMENT_STATUS.COMPLETED,APPOINTMENT_STATUS.COMPLETED_NO_PRESCRIPTION;APPOINTMENT_STATUS.CANCELLED,APPOINTMENT_STATUS.STAFF_CANCELLED,APPOINTMENT_STATUS.DOCTOR_CANCELLED,APPOINTMENT_STATUS.RESCHEDULED,APPOINTMENT_STATUS.STAFF_RESCHEDULED,APPOINTMENT_STATUS.DOCTOR_RESCHEDULED,APPOINTMENT_STATUS.ABORTED,APPOINTMENT_STATUS.NO_SHOW,APPOINTMENT_STATUS.NO_SHOW_DOCTOR,APPOINTMENT_STATUS.NO_SHOW_STAFF;APPOINTMENT_STATUS.INITIATED,APPOINTMENT_STATUS.RESERVED,APPOINTMENT_STATUS.PROVISIONAL_CANCELLED,APPOINTMENT_STATUS.RESCHEDULED;RECEIPT_PAYMENT_MODE_NAME.CASH,RECEIPT_PAYMENT_MODE_ID.CASH,RECEIPT_PAYMENT_MODE_ID.CASH,RECEIPT_PAYMENT_MODE_NAME.CREDIT_CARD,RECEIPT_PAYMENT_MODE_ID.CREDIT_CARD,RECEIPT_PAYMENT_MODE_ID.CREDIT_CARD,RECEIPT_PAYMENT_MODE_NAME.DEBIT_CARD,RECEIPT_PAYMENT_MODE_ID.DEBIT_CARD,RECEIPT_PAYMENT_MODE_ID.DEBIT_CARD,RECEIPT_PAYMENT_MODE_NAME.PAYTM,RECEIPT_PAYMENT_MODE_ID.PAYTM,RECEIPT_PAYMENT_MODE_ID.PAYTM,RECEIPT_PAYMENT_MODE_NAME.GPAY,RECEIPT_PAYMENT_MODE_ID.GPAY,RECEIPT_PAYMENT_MODE_ID.GPAY,RECEIPT_PAYMENT_MODE_NAME.UPI,RECEIPT_PAYMENT_MODE_ID.UPI,RECEIPT_PAYMENT_MODE_ID.UPI,RECEIPT_PAYMENT_MODE_NAME.OTHER,RECEIPT_PAYMENT_MODE_ID.OTHER,RECEIPT_PAYMENT_MODE_ID.OTHER;RECEIPT_PAYMENT_MODE_ID.CASH,RECEIPT_PAYMENT_MODE_NAME.CASH,RECEIPT_PAYMENT_MODE_ID.CREDIT_CARD,RECEIPT_PAYMENT_MODE_NAME.CREDIT_CARD,RECEIPT_PAYMENT_MODE_ID.DEBIT_CARD,RECEIPT_PAYMENT_MODE_NAME.DEBIT_CARD,RECEIPT_PAYMENT_MODE_ID.PAYTM,RECEIPT_PAYMENT_MODE_NAME.PAYTM,RECEIPT_PAYMENT_MODE_ID.GPAY,RECEIPT_PAYMENT_MODE_NAME.GPAY,RECEIPT_PAYMENT_MODE_ID.UPI,RECEIPT_PAYMENT_MODE_NAME.UPI,RECEIPT_PAYMENT_MODE_ID.OTHER,RECEIPT_PAYMENT_MODE_NAME.OTHER;DISCOUNT_TYPE.AMOUNT,DISCOUNT_TYPE.PERCENTAGE;APPOINTMENT_STATUS.CANCELLED,APPOINTMENT_STATUS.ABORTED,APPOINTMENT_STATUS.ONGOING,APPOINTMENT_STATUS.COMPLETED,APPOINTMENT_STATUS.RESCHEDULED,APPOINTMENT_STATUS.BOOKED,APPOINTMENT_STATUS.CHECKED_IN,APPOINTMENT_STATUS.NO_SHOW,APPOINTMENT_STATUS.INITIATED,APPOINTMENT_STATUS.PARKED;APPOINTMENT_STATUS.COMPLETED_NO_PRESCRIPTION+"",APPOINTMENT_STATUS.COMPLETED,APPOINTMENT_STATUS.DOCTOR_CANCELLED+"",APPOINTMENT_STATUS.CANCELLED,APPOINTMENT_STATUS.STAFF_CANCELLED+"",APPOINTMENT_STATUS.CANCELLED,APPOINTMENT_STATUS.NO_SHOW_DOCTOR+"",APPOINTMENT_STATUS.NO_SHOW,APPOINTMENT_STATUS.NO_SHOW_STAFF+"",APPOINTMENT_STATUS.NO_SHOW,APPOINTMENT_STATUS.DOCTOR_RESCHEDULED+"",APPOINTMENT_STATUS.RESCHEDULED,APPOINTMENT_STATUS.STAFF_RESCHEDULED+"",APPOINTMENT_STATUS.RESCHEDULED;APPOINTMENT_CHANNEL.WALKIN,APPOINTMENT_CHANNEL.FOLLOW_UP,APPOINTMENT_CHANNEL.PATIENT_REQUESTED,APPOINTMENT_CHANNEL.OFFLINE,APPOINTMENT_CHANNEL.STAFF,APPOINTMENT_CHANNEL.DOCTOR,APPOINTMENT_CHANNEL.ONLINE_APPOINTMENT,APPOINTMENT_CHANNEL.ABHA;QUEUE_CARD_ACTIONS.TAGS,QUEUE_CARD_ACTIONS.VISIT_TYPE,QUEUE_CARD_ACTIONS.RECEIPT,QUEUE_CARD_ACTIONS.CREATE_ABHA,QUEUE_CARD_ACTIONS.ADD_VITALS_AND_LAB_RESULTS,QUEUE_CARD_ACTIONS.UPLOAD_MEDICAL_RECORDS;const PROD={AORTA_HOST:"https://auth.eka.care",AORTA_GO_HOST:"https://aortago.eka.care",TRYST_HOST:"https://tryst.eka.care",AXON_HOST:"https://axon.eka.care",PARCHI_HOST:"https://parchi.eka.care",CURIO_HOST:"https://eka.care",AVATAR_HOST:"https://a.eka.care",PTDIR_HOST:"https://ptdir.eka.care",TELE_HOST:"https://mweb.eka.care",METROLPOLIS_HOST:"https://consultation.metropolisindia.com",LUCID_WS_HOST:"https://lucid-ws.eka.care",LUCID_HOST:"https://lucid.eka.care",DEEPTHOUGHT_HOST:"https://deepthought.eka.care",NDHM_HOST:"https://api.eka.care",LOGIN_HOST:"https://login.eka.care",HUB:"https://hub.eka.care",RECEIPT_DOMAIN:"https://doc-receipts.eka.care"},DEV={AORTA_HOST:"https://aorta.dev.eka.care",AORTA_GO_HOST:"https://aortago.dev.eka.care",TRYST_HOST:"https://tryst.dev.eka.care",AXON_HOST:"https://axon.dev.eka.care",PARCHI_HOST:"https://parchi.dev.eka.care",CURIO_HOST:"https://curio.dev.eka.care",AVATAR_HOST:"https://eka-avatar.dev.eka.care",PTDIR_HOST:"https://ptdir.dev.eka.care",TELE_HOST:"https://mweb.dev.eka.care",METROLPOLIS_HOST:"https://consultation.metropolisindia.com",LUCID_WS_HOST:"https://lucid-ws.dev.eka.care",LUCID_HOST:"https://lucid.dev.eka.care",DEEPTHOUGHT_HOST:"https://deepthought.dev.eka.care",NDHM_HOST:"https://api.dev.eka.care",LOGIN_HOST:"https://login.dev.eka.care",HUB:"https://hub.dev.eka.care",RECEIPT_DOMAIN:"https://doc-receipt.s3.ap-south-1.amazonaws.com"};let envVar=DEV,client_id="",refresh_token="",extraHeaders=null;const setEnv=({env:a,clientId:_,extraHeaders:$})=>{envVar=a==="PROD"?PROD:DEV,client_id=_,$&&(extraHeaders=$)},setIndividualEnv=({clientId:a,env:_,extraHeaders:$})=>{a&&(client_id=a),_&&(envVar=_==="PROD"?PROD:DEV),$&&(extraHeaders={...extraHeaders,...$})},setRefreshToken=a=>{refresh_token=a},GET_REFRESH_TOKEN=()=>refresh_token,GET_AORTA_GO_HOST=()=>envVar.AORTA_GO_HOST,GET_NDHM_HOST=()=>envVar.NDHM_HOST,GET_CLIENT_ID=()=>client_id,GET_EXTRA_HEADERS=()=>extraHeaders;function pushToMxpDataLayer({data:a}){typeof window<"u"&&(window.mxpDataLayer=window.mxpDataLayer||[],window.mxpDataLayer.push(a))}function sendApiFailedEvent({category:a="api-failed",url:_,params:$}){pushToMxpDataLayer({data:{name:a,data:{url:_,...$}}}),{...$}}async function refreshToken(){if(await updateToken())return!0;const _=new Headers;_.append("Content-Type","application/json"),_.set("client-id",GET_CLIENT_ID());const $=JSON.stringify({}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include",mode:"cors"};try{const et=GET_AORTA_GO_HOST();if((await fetch(`${et}/emr/v3/auth/refresh`,{..._e,body:JSON.stringify({})})).status===401)return!1}catch{return!1}return!0}async function fetchWrapper(a,_={},$=!0,_e=!1){var et,tt;try{const rt=((tt=(et=window==null?void 0:window.Eka)==null?void 0:et.getSessionToken)==null?void 0:tt.call(et))||"",nt=new Headers(_.headers);let at,st;!nt.get("client-id")&&!_e&&nt.set("client-id",GET_CLIENT_ID()),rt&&!nt.get("auth")&&nt.set("auth",rt);const it=GET_EXTRA_HEADERS();it&&Object.keys(it).forEach(lt=>{nt.set(lt,it[lt])});const ot=await fetch(a,{..._,headers:nt});return window&&(st=window.location.pathname,at=nt.get("client-id")),ot.status===401&&$&&await refreshToken()?await fetchWrapper(a,_,!1):(ot.status>401&&sendApiFailedEvent({url:a,params:{responseStatus:ot.status}}),ot)}catch(rt){throw sendApiFailedEvent({url:a,params:{error:`${rt.message||rt}`}}),console.error(rt),rt}}let androidRefreshCB=[];async function refreshCallback(a){androidRefreshCB.forEach(_=>_(!0)),androidRefreshCB=[]}async function updateToken(){var a,_,$,_e,et,tt;if(typeof window<"u"){if(typeof((a=window==null?void 0:window.Eka)==null?void 0:a.updateToken)=="function")return(_=window.parent)==null||_.postMessage({type:"REFRESH_TOKEN"},"*"),window.refreshCallback=window.refreshCallback||refreshCallback,new Promise(rt=>{var nt;androidRefreshCB.push(rt),(nt=window==null?void 0:window.Eka)==null||nt.updateToken("refreshCallback")});if(typeof((et=(_e=($=window==null?void 0:window.webkit)==null?void 0:$.messageHandlers)==null?void 0:_e.statusCodeHandler)==null?void 0:et.postMessage)=="function")return(tt=window.parent)==null||tt.postMessage({type:"REFRESH_TOKEN"},"*"),window.refreshCallback=window.refreshCallback||refreshCallback,new Promise(rt=>{var nt,at,st;androidRefreshCB.push(rt),(st=(at=(nt=window==null?void 0:window.webkit)==null?void 0:nt.messageHandlers)==null?void 0:at.statusCodeHandler)==null||st.postMessage(JSON.stringify({status:401}))})}return!1}async function postAuthInitV2({method:a,identifier:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({method:a,identifier:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${tt}/v2/auth/init`,et)).json()}catch(tt){console.error(tt)}return{}}async function postAuthVerifyV2({txn_id:a,code:_,token:$}){const _e=new Headers;_e.append("Content-Type","application/json");const et=JSON.stringify({txn_id:a,..._?{code:_}:{},...$?{token:$}:{}}),tt={method:"POST",headers:_e,body:et,redirect:"follow",credentials:"include"};try{const rt=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${rt}/v2/auth/verify`,tt)).json()}catch(rt){console.error(rt)}return{}}async function getProfilePhrUser(){const a=new Headers;a.append("Content-Type","application/json");const _={method:"GET",headers:a,redirect:"follow",credentials:"include"};try{const $=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${$}/profiles/v1/patient`,_)).json()}catch($){return console.error("profilePhrUser error =>",$),[]}}async function getProfilesPatient(){const a=new Headers;a.append("Content-Type","application/json");const _={method:"GET",headers:a,redirect:"follow",credentials:"include"},$=GET_EXTRA_HEADERS(),_e=$==null?void 0:$["X-User-ID"];if(!_e)return{};try{const et=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${et}/profiles/v1/patient/${_e}`,_)).json()}catch(et){return console.error("profilePhrUser error =>",et),{}}}async function postProfileSwitch({oid:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({oid:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${et}/v1/profile/switch`,_e)).json()}catch(et){console.error("postProfileSwitchError: ",et)}return{}}async function postAuthLogoutV2(){console.log("inside postAuthLogoutV2 api call");const a=new Headers;a.append("Content-Type","application/json");const _=JSON.stringify({}),_e=`${GET_AORTA_GO_HOST()}/v2/auth/logout`,et={method:"POST",headers:a,body:_,redirect:"follow",credentials:"include"};try{const tt=await fetchWrapper(_e,et);return tt.ok?!0:(console.log("Logout failed with status",tt==null?void 0:tt.status),!1)}catch(tt){return console.error("Logout API failed:",tt),!1}}async function postAbdmLoginInit({method:a,identifier:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({method:a,identifier:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/profile/login/init`,et)).json()}catch(tt){console.error("postAbdmLoginInit error =>",tt)}return{}}async function postAbdmKycInit({method:a,identifier:_}){const $=new Headers,_e=GET_EXTRA_HEADERS();$.append("Content-Type","application/json");const et=JSON.stringify({method:a,identifier:_,user_x_token:(_e==null?void 0:_e.auth)??""}),tt={method:"POST",headers:$,body:et,redirect:"follow",credentials:"include"};try{const rt=GET_NDHM_HOST();return await(await fetchWrapper(`${rt}/abdm/v1/profile/kyc/init`,tt)).json()}catch(rt){console.error("postAbdmKycInit error =>",rt)}return{}}async function postAbdmConsentDeny({consentId:a}){const _=new Headers;_.append("Content-Type","application/json");const $=GET_NDHM_HOST(),_e=JSON.stringify({id:a,reason:"Consent Denied"}),et={method:"POST",headers:_,body:_e,credentials:"include"};try{const tt=await fetchWrapper(`${$}/abdm/v1/consents/deny`,et);return tt.ok?{success:!0}:await tt.json()}catch(tt){console.error("postabdmConsentDenyError error =>",tt)}return{}}async function postAbdmConsentRevoke({consent_artefacts_ids:a}){const _=new Headers;_.append("Content-Type","application/json");const $=GET_NDHM_HOST(),_e=JSON.stringify({consent_artefacts:a}),et={method:"POST",headers:_,body:_e,credentials:"include"};try{const tt=await fetchWrapper(`${$}/abdm/v1/consents/revoke`,et);return tt.ok?{success:!0}:await tt.json()}catch(tt){console.error("postabdmConsentRevokeError error =>",tt)}return{}}async function postAbdmConsentApprove({consentApprovePayload:a}){const _=new Headers;_.append("Content-Type","application/json");const $=GET_NDHM_HOST(),_e=JSON.stringify(a),et={method:"POST",headers:_,body:_e,credentials:"include"};try{const tt=await fetchWrapper(`${$}/abdm/v1/consents/approve`,et);return tt.ok?{success:!0}:await tt.json()}catch(tt){console.error("postabdmConsentDenyError error =>",tt)}return{}}async function postAbdmLoginVerify({txn_id:a,otp:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,otp:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/profile/login/verify`,et)).json()}catch(tt){console.error("postAbdmLoginVerify error =>",tt)}return{}}async function postAbdmKycVerify({txn_id:a,otp:_}){const $=new Headers,_e=GET_EXTRA_HEADERS();$.append("Content-Type","application/json");const et=JSON.stringify({txn_id:a,otp:_,user_x_token:(_e==null?void 0:_e.auth)??""}),tt={method:"POST",headers:$,body:et,redirect:"follow",credentials:"include"};try{const rt=GET_NDHM_HOST();return await(await fetchWrapper(`${rt}/abdm/v1/profile/kyc/verify`,tt)).json()}catch(rt){console.error("postAbdmKycVerify error =>",rt)}return{}}async function postRegisterAadhaarInit({aadhaar_number:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({aadhaar_number:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/aadhaar/init`,_e)).json()}catch{}return{}}async function postRegisterAadhaarFaceAuthInit(){const a=new Headers;a.append("Content-Type","application/json");const _={method:"POST",headers:a,redirect:"follow",credentials:"include"};try{const $=GET_NDHM_HOST();return await(await fetchWrapper(`${$}/abdm/na/v1/registration/aadhaar/face-auth/init`,_)).json()}catch{}return{}}async function postRegisterAadhaarFaceAuthCapture({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({txn_id:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/aadhaar/face-auth/capture`,_e)).json()}catch{}return{}}async function postRegisterAadhaarFaceAuthVerify({txn_id:a,aadhaar:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,aadhaar:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/face-auth/verify`,et)).json()}catch{}return{}}async function postRegisterMobileInit({mobile_number:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({mobile_number:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/mobile/init`,_e)).json()}catch(et){console.error(et)}return{}}async function postRegisterAadhaarMobileInit({mobile:a,txn_id:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({mobile:a,txn_id:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/mobile/init`,et)).json()}catch(tt){console.error(tt)}return{}}async function postRegisterAadhaarVerify({txn_id:a,mobile:_,otp:$}){const _e=new Headers;_e.append("Content-Type","application/json");const et=JSON.stringify({txn_id:a,mobile:_,otp:$}),tt={method:"POST",headers:_e,body:et,redirect:"follow",credentials:"include"};try{const rt=GET_NDHM_HOST();return await(await fetchWrapper(`${rt}/abdm/na/v1/registration/aadhaar/verify`,tt)).json()}catch{}return{}}async function postRegisterAadhaarAutoLogin({txn_id:a,abha_address:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,abha_address:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/auto-login`,et)).json()}catch{}return{}}async function postRegisterAadhaarMobileVerify({txn_id:a,otp:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,otp:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/mobile/verify`,et)).json()}catch{}return{}}async function postRegisterAadhaarResendOtp({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({txn_id:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/aadhaar/resend`,_e)).json()}catch{}return{}}async function postAbdmKycVerifyResendOtp({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({txn_id:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/v1/profile/kyc/resend`,_e)).json()}catch{}return{}}async function postRegisterAadhaarMobileResendOtp({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({txn_id:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/aadhaar/mobile/resend`,_e)).json()}catch{}return{}}async function postRegisterAadhaarCreatePhr({abha_address:a,txn_id:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({abha_address:a,txn_id:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/create-phr`,et)).json()}catch(tt){console.error("postRegisterAadhaarCreatePhr ==>",tt)}return{}}async function postAbdmRegisterMobileCreatePhr({abha_address:a,address:_,first_name:$,last_name:_e,day_of_birth:et,month_of_birth:tt,year_of_birth:rt,gender:nt,middle_name:at,pincode:st,txn_id:it}){const ot=new Headers;ot.append("Content-Type","application/json");const lt=JSON.stringify({abha_address:a,profile:{address:_,day_of_birth:et,first_name:$,gender:nt,last_name:_e,middle_name:at,month_of_birth:tt,pincode:st,year_of_birth:rt},txn_id:it}),ht={method:"POST",headers:ot,body:lt,redirect:"follow",credentials:"include"};try{const pt=GET_NDHM_HOST();return await(await fetchWrapper(`${pt}/abdm/na/v1/registration/mobile/create-phr`,ht)).json()}catch(pt){console.error("postAbdmRegisterMobileCreatePhr error =>",pt)}return{}}async function postAbdmProfileLoginPhr({txn_id:a,phr_address:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,phr_address:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/profile/login/phr`,et)).json()}catch(tt){console.error("postAbdmProfileLoginPhr error =>",tt)}return{}}async function getAbdmRegisterSuggest({txn_id:a,fn:_,mn:$,ln:_e,dob:et}){const tt=new Headers;tt.append("Content-Type","application/json");const rt={method:"GET",headers:tt,redirect:"follow",credentials:"include"};try{const nt=GET_NDHM_HOST();return await(await fetchWrapper(`${nt}/abdm/na/v1/registration/suggest?transactionId=${a}&fn=${_||""}&mn=${$||""}&ln=${_e||""}&dob=${et||""}`,rt)).json()}catch(nt){console.error("postAbdmLoginVerify error =>",nt)}return{}}async function postAbdmRegisterAbhaNumberCreatePhr({abha_address:a,txn_id:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({abha_address:a,txn_id:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/abha-number/create-phr`,et)).json()}catch(tt){console.error("postAbdmRegisterAbhaNumberCreatePhr ==>",tt)}return{}}async function postAbdmRegisterPhrCheck({abha_address:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({abha_address:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/phr/check`,_e)).json()}catch(et){console.error("postAbdmRegisterPhrCheck ==>",et)}return{}}async function postAbdmProfileEka({abha_address:a,address:_,first_name:$,last_name:_e,day_of_birth:et,month_of_birth:tt,year_of_birth:rt,gender:nt,middle_name:at,pincode:st}){const it=new Headers;it.append("Content-Type","application/json");const ot=JSON.stringify({abha_address:a,profile:{address:_,day_of_birth:et,first_name:$,gender:nt,last_name:_e,middle_name:at,month_of_birth:tt,pincode:st,year_of_birth:rt}}),lt={method:"POST",headers:it,body:ot,redirect:"follow",credentials:"include"};try{const ht=GET_NDHM_HOST();return await(await fetchWrapper(`${ht}/abdm/v1/profile/eka`,lt)).json()}catch(ht){console.error("postAbdmProfileEka error =>",ht)}return{}}async function postAbdmProfileEkaLinkPhr({abha_address:a,oid:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({abha_address:a,oid:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/v1/profile/eka/link-phr`,et)).json()}catch(tt){console.error("postAbdmProfileLinkPhr ==>",tt)}return{}}async function postAbdmRegisterMobileVerify({txn_id:a,otp:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,otp:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/mobile/verify`,et)).json()}catch{}return{}}async function postAbdmRegisterMobileResendOtp({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $={method:"POST",headers:_,body:JSON.stringify({txn_id:a}),redirect:"follow",credentials:"include"};try{const _e=GET_NDHM_HOST();return await(await fetchWrapper(`${_e}/abdm/na/v1/registration/mobile/resend`,$)).json()}catch{}return{}}async function getPincodeDetails({pincode:a}){const $=`${GET_NDHM_HOST()}/abdm/na/v1/registration/pincode/${a}`,_e=new Headers;_e.append("Content-Type","application/json");const et={method:"GET",headers:_e,redirect:"follow",credentials:"include"};try{return await(await fetchWrapper($,et)).json()}catch(tt){console.error(tt)}return{}}var ConsentStatus=(a=>(a.REQUESTED="REQUESTED",a.GRANTED="GRANTED",a.DENIED="DENIED",a.EXPIRED="EXPIRED",a.REVOKED="REVOKED",a))(ConsentStatus||{});async function getConsentRequest({id:a,type:_}){const $=GET_NDHM_HOST();console.log("NDHM_HOST",$);const _e=`${$}/abdm/v1/request?type=consent&status=${_}&id=${a}`,et=new Headers;et.append("Content-Type","application/json");const tt={method:"GET",headers:et,redirect:"follow",credentials:"include"};try{const rt=await fetchWrapper(_e,tt);if(rt.status===200)return await rt.json();throw Error("Error fetching Consent Details")}catch(rt){console.error(rt)}return{}}async function getAbdmAssestCard(){const a=GET_NDHM_HOST();console.log("NDHM_HOST",a);const _=`${a}/abdm/v1/profile/asset/card`,_e={method:"GET",headers:new Headers,redirect:"follow",credentials:"include"};try{const et=await fetchWrapper(_,_e);if(et.status===200)return await et.blob();throw Error("Error fetching Consent Details")}catch(et){console.error(et)}return{}}async function getAbdmSessionStatus(){const a=GET_NDHM_HOST();console.log("NDHM_HOST",a);const _=`${a}abdm/v1/session/status`,$=new Headers;$.append("Content-Type","application/json");const _e={method:"GET",headers:$,redirect:"follow",credentials:"include"};try{const et=await fetchWrapper(_,_e);if(et.status===200)return await et.json();throw Error("Error fetching Consent Details")}catch(et){console.error(et)}return{}}async function postAbdmProfileSearch({mobile:a}){const _=new Headers;_.append("Content-Type","application/json");const $=GET_NDHM_HOST(),_e=JSON.stringify({mobile:a}),et={method:"POST",headers:_,body:_e,credentials:"include"};try{return(await fetchWrapper(`${$}/abdm/v1/profile/search`,et)).json()}catch(tt){console.error("postAbdmProfileSearch error =>",tt)}return{}}var reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
17
+ */var f$3=reactExports,k$3=Symbol.for("react.element"),l$b=Symbol.for("react.fragment"),m$3=Object.prototype.hasOwnProperty,n$5=f$3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p$6={key:!0,ref:!0,__self:!0,__source:!0};function q$2(a,_,$){var _e,et={},tt=null,rt=null;$!==void 0&&(tt=""+$),_.key!==void 0&&(tt=""+_.key),_.ref!==void 0&&(rt=_.ref);for(_e in _)m$3.call(_,_e)&&!p$6.hasOwnProperty(_e)&&(et[_e]=_[_e]);if(a&&a.defaultProps)for(_e in _=a.defaultProps,_)et[_e]===void 0&&(et[_e]=_[_e]);return{$$typeof:k$3,type:a,key:tt,ref:rt,props:et,_owner:n$5.current}}reactJsxRuntime_production_min.Fragment=l$b;reactJsxRuntime_production_min.jsx=q$2;reactJsxRuntime_production_min.jsxs=q$2;jsxRuntime.exports=reactJsxRuntime_production_min;var jsxRuntimeExports=jsxRuntime.exports,ABHA_V3_SKIP_STATES=(a=>(a.ABHA_END="abha_end",a.CONFIRM_MOBILE_OTP="confirm_mobile_otp",a.ABHA_CREATE="abha_create",a.ABHA_SELECT="abha_select",a.REQUEST_MOBILE_OTP="request_mobile_otp",a))(ABHA_V3_SKIP_STATES||{}),APPOINTMENT_CHANNEL=(a=>(a.PRACTO="Practo",a.COVID_CONNECT="Covid-Connect",a.CORPORATE_CONNECT="Corporate-Connect",a.SPHERE_INDIA_PSYCHOLOGY="SPPS",a.SPHERE_INDIA_COVID="SPCO",a.TALK_TO_DOCTOR="TTD",a.SECOND_OPINION="SECO",a.EMERGENCY="EMCY",a.CORPORATE_CONNECT_INIT="CC-Init",a.WALKIN="Walkin",a.WALKINQR="Walkin-Scan",a.OFFLINE="Offline",a.ON_PAD="ON-PAD",a.UHI_HPD="UHI_HPD",a.UHI_DCM="UHI_DCM",a.IVR="IVR",a.STAFF="Staff",a.DOCTOR="Doctor",a.FOLLOW_UP="FOLLOW-UP",a.ONLINE_APPOINTMENT="Online-Appointment",a.PACKAGE="PACKAGE",a.PATIENT_REQUESTED="Patient-Requested",a.ABHA="ABHA",a))(APPOINTMENT_CHANNEL||{}),APPOINTMENT_STATUS=(a=>(a.CANCELLED="CN",a.ABORTED="AB",a.NO_SHOW="NS",a.NO_SHOW_DOCTOR="NSD",a.NO_SHOW_STAFF="NSS",a.COMPLETED="CM",a.RESCHEDULED="RE",a.ONGOING="OG",a.BOOKED="BK",a.PARKED="PA",a.PROVISIONAL_CANCELLED="PC",a.COMPLETED_NO_PRESCRIPTION="CMNP",a.DOCTOR_RESCHEDULED="RED",a.DOCTOR_CANCELLED="CND",a.STAFF_RESCHEDULED="RES",a.STAFF_CANCELLED="CNS",a.PAYMENT_NOT_RECEIVED="PNR",a.INITIATED="IN",a.RESERVED="RV",a.CHECKED_IN="CK",a.COMPLETED_IP="CMIP",a))(APPOINTMENT_STATUS||{});const bookedAptWhitelist=new Set(["BK","PA"]),completedQueueStatus=["CM","CMNP"],otherQueueStatus=["CN","CNS","CND","RE","RES","RED","AB","NS","NSD","NSS"],followupQueueStatus=["IN","RV","PC","RE"],completedAptWhitelist=new Set(completedQueueStatus),followupAptWhileWhitelist=new Set(followupQueueStatus),otherAptWhitelist=new Set(otherQueueStatus),opdAptWhitelist=new Set(["CK","OG"]);[...Array.from(completedAptWhitelist),...Array.from(followupAptWhileWhitelist),...Array.from(bookedAptWhitelist),...Array.from(opdAptWhitelist),...Array.from(otherAptWhitelist)];var AUTH_METHOD=(a=>(a[a.EMAIL=1]="EMAIL",a[a.MOBILE=2]="MOBILE",a[a.ABHA=7]="ABHA",a))(AUTH_METHOD||{}),LOADING_STATE=(a=>(a.IDLE="IDLE",a.LOADING="LOADING",a.RESOLVED="RESOLVED",a.REJECTED="REJECTED",a))(LOADING_STATE||{}),ABHA_AUTH_FLOW_METHOD=(a=>(a.PHR_ADDRESS="phr_address",a.MOBILE="mobile",a.ABHA_NUMBER="abha_number",a.AADHAR_NUMBER="aadhaar_number",a.REGISTRATION_TYPE="registration_type",a))(ABHA_AUTH_FLOW_METHOD||{}),REGISTRATION_TYPE=(a=>(a.LOGIN="login",a.CREATE="create",a))(REGISTRATION_TYPE||{}),DISCOUNT_TYPE=(a=>(a.PERCENTAGE="PERCENTAGE",a.AMOUNT="AMOUNT",a))(DISCOUNT_TYPE||{}),RECEIPT_PAYMENT_MODE_ID=(a=>(a.CASH="CASH",a.UPI="UPI",a.DEBIT_CARD="DEBIT_CARD",a.GPAY="GPAY",a.PAYTM="PAYTM",a.CREDIT_CARD="CREDIT_CARD",a.OTHER="OTHER",a.EKA_POSTPAY="EKA_POSTPAY",a.EKA_PREPAID="EKA_PREPAID",a.EKA_WALLET="EKA_WALLET",a))(RECEIPT_PAYMENT_MODE_ID||{}),RECEIPT_PAYMENT_MODE_NAME=(a=>(a.CASH="Cash",a.UPI="UPI",a.DEBIT_CARD="Debit Card",a.GPAY="GPay",a.PAYTM="Paytm",a.CREDIT_CARD="Credit Card",a.OTHER="Other",a.EKA_POSTPAY="Eka Payment",a.EKA_PREPAID="Eka Prepaid",a))(RECEIPT_PAYMENT_MODE_NAME||{}),QUEUE_CARD_ACTIONS=(a=>(a.TAGS="TAGS",a.VISIT_TYPE="VITY",a.PAYMENT_STATUS="PAYS",a.ASSESSMENT_STATUS="ASST",a.PAST_VISITS="PRES",a.CREATE_ABHA="ABHA",a.ADD_VITALS_AND_LAB_RESULTS="AVLR",a.ADD_ADDRESS="ADDR",a.REQUEST_RECORDS="RMDR",a.REQUEST_PAYMENT="REQP",a.ARCHIVE_APPOINTMENT="AAPT",a.CREATE_CERTIFICATE="CRMC",a.REFER_TO_DOCTOR="RTOD",a.SEND_GOOGLE_REVIEW_LINK="SGRL",a.MARK_NO_SHOW="MNSH",a.CREATE_TEMPLATE="CATP",a.FOLLOW_UP="FLWU",a.ABHA_ID="ABHA_ID",a.UPLOAD_MEDICAL_RECORDS="UPMR",a.RESUME="RESUME",a.CHECK_IN="CHECK_IN",a.EXIT="EXIT",a.WRITE_RX="WRITE_RX",a.START_VISIT="START_VISIT",a.RECEIPT="RECEIPT",a.ORDER_MEDICINE="ORDER_MEDICINE",a.PRINT_RX="PRINT_RX",a.QUESTIONAIRE="SAQU",a.LABEL="LABEL",a.NOTES="NOTES",a.ASSIGN_DOCTOR="ASSIGN_DOCTOR",a.RESCHEDULE_APPOINTMENT="RAPT",a))(QUEUE_CARD_ACTIONS||{}),AADHAAR_AUTH_STATES=(a=>(a.FACE_AUTH="FACE_AUTH",a.OTP="OTP",a.BIOMETRIC="BIOMETRIC",a.NONE="NONE",a))(AADHAAR_AUTH_STATES||{}),FACE_AUTH_CAPTURE_STATUS=(a=>(a.PENDING="PENDING",a.VERIFIED="VERIFIED",a.FAILED="FAILED",a.COMPLETE="COMPLETE",a))(FACE_AUTH_CAPTURE_STATUS||{});APPOINTMENT_STATUS.BOOKED,APPOINTMENT_STATUS.PARKED;APPOINTMENT_STATUS.CHECKED_IN,APPOINTMENT_STATUS.ONGOING;APPOINTMENT_STATUS.COMPLETED,APPOINTMENT_STATUS.COMPLETED_NO_PRESCRIPTION;APPOINTMENT_STATUS.CANCELLED,APPOINTMENT_STATUS.STAFF_CANCELLED,APPOINTMENT_STATUS.DOCTOR_CANCELLED,APPOINTMENT_STATUS.RESCHEDULED,APPOINTMENT_STATUS.STAFF_RESCHEDULED,APPOINTMENT_STATUS.DOCTOR_RESCHEDULED,APPOINTMENT_STATUS.ABORTED,APPOINTMENT_STATUS.NO_SHOW,APPOINTMENT_STATUS.NO_SHOW_DOCTOR,APPOINTMENT_STATUS.NO_SHOW_STAFF;APPOINTMENT_STATUS.INITIATED,APPOINTMENT_STATUS.RESERVED,APPOINTMENT_STATUS.PROVISIONAL_CANCELLED,APPOINTMENT_STATUS.RESCHEDULED;RECEIPT_PAYMENT_MODE_NAME.CASH,RECEIPT_PAYMENT_MODE_ID.CASH,RECEIPT_PAYMENT_MODE_ID.CASH,RECEIPT_PAYMENT_MODE_NAME.CREDIT_CARD,RECEIPT_PAYMENT_MODE_ID.CREDIT_CARD,RECEIPT_PAYMENT_MODE_ID.CREDIT_CARD,RECEIPT_PAYMENT_MODE_NAME.DEBIT_CARD,RECEIPT_PAYMENT_MODE_ID.DEBIT_CARD,RECEIPT_PAYMENT_MODE_ID.DEBIT_CARD,RECEIPT_PAYMENT_MODE_NAME.PAYTM,RECEIPT_PAYMENT_MODE_ID.PAYTM,RECEIPT_PAYMENT_MODE_ID.PAYTM,RECEIPT_PAYMENT_MODE_NAME.GPAY,RECEIPT_PAYMENT_MODE_ID.GPAY,RECEIPT_PAYMENT_MODE_ID.GPAY,RECEIPT_PAYMENT_MODE_NAME.UPI,RECEIPT_PAYMENT_MODE_ID.UPI,RECEIPT_PAYMENT_MODE_ID.UPI,RECEIPT_PAYMENT_MODE_NAME.OTHER,RECEIPT_PAYMENT_MODE_ID.OTHER,RECEIPT_PAYMENT_MODE_ID.OTHER;RECEIPT_PAYMENT_MODE_ID.CASH,RECEIPT_PAYMENT_MODE_NAME.CASH,RECEIPT_PAYMENT_MODE_ID.CREDIT_CARD,RECEIPT_PAYMENT_MODE_NAME.CREDIT_CARD,RECEIPT_PAYMENT_MODE_ID.DEBIT_CARD,RECEIPT_PAYMENT_MODE_NAME.DEBIT_CARD,RECEIPT_PAYMENT_MODE_ID.PAYTM,RECEIPT_PAYMENT_MODE_NAME.PAYTM,RECEIPT_PAYMENT_MODE_ID.GPAY,RECEIPT_PAYMENT_MODE_NAME.GPAY,RECEIPT_PAYMENT_MODE_ID.UPI,RECEIPT_PAYMENT_MODE_NAME.UPI,RECEIPT_PAYMENT_MODE_ID.OTHER,RECEIPT_PAYMENT_MODE_NAME.OTHER;DISCOUNT_TYPE.AMOUNT,DISCOUNT_TYPE.PERCENTAGE;APPOINTMENT_STATUS.CANCELLED,APPOINTMENT_STATUS.ABORTED,APPOINTMENT_STATUS.ONGOING,APPOINTMENT_STATUS.COMPLETED,APPOINTMENT_STATUS.RESCHEDULED,APPOINTMENT_STATUS.BOOKED,APPOINTMENT_STATUS.CHECKED_IN,APPOINTMENT_STATUS.NO_SHOW,APPOINTMENT_STATUS.INITIATED,APPOINTMENT_STATUS.PARKED;APPOINTMENT_STATUS.COMPLETED_NO_PRESCRIPTION+"",APPOINTMENT_STATUS.COMPLETED,APPOINTMENT_STATUS.DOCTOR_CANCELLED+"",APPOINTMENT_STATUS.CANCELLED,APPOINTMENT_STATUS.STAFF_CANCELLED+"",APPOINTMENT_STATUS.CANCELLED,APPOINTMENT_STATUS.NO_SHOW_DOCTOR+"",APPOINTMENT_STATUS.NO_SHOW,APPOINTMENT_STATUS.NO_SHOW_STAFF+"",APPOINTMENT_STATUS.NO_SHOW,APPOINTMENT_STATUS.DOCTOR_RESCHEDULED+"",APPOINTMENT_STATUS.RESCHEDULED,APPOINTMENT_STATUS.STAFF_RESCHEDULED+"",APPOINTMENT_STATUS.RESCHEDULED;APPOINTMENT_CHANNEL.WALKIN,APPOINTMENT_CHANNEL.FOLLOW_UP,APPOINTMENT_CHANNEL.PATIENT_REQUESTED,APPOINTMENT_CHANNEL.OFFLINE,APPOINTMENT_CHANNEL.STAFF,APPOINTMENT_CHANNEL.DOCTOR,APPOINTMENT_CHANNEL.ONLINE_APPOINTMENT,APPOINTMENT_CHANNEL.ABHA;QUEUE_CARD_ACTIONS.TAGS,QUEUE_CARD_ACTIONS.VISIT_TYPE,QUEUE_CARD_ACTIONS.RECEIPT,QUEUE_CARD_ACTIONS.CREATE_ABHA,QUEUE_CARD_ACTIONS.ADD_VITALS_AND_LAB_RESULTS,QUEUE_CARD_ACTIONS.UPLOAD_MEDICAL_RECORDS;const PROD={AORTA_HOST:"https://auth.eka.care",AORTA_GO_HOST:"https://aortago.eka.care",TRYST_HOST:"https://tryst.eka.care",AXON_HOST:"https://axon.eka.care",PARCHI_HOST:"https://parchi.eka.care",CURIO_HOST:"https://eka.care",AVATAR_HOST:"https://a.eka.care",PTDIR_HOST:"https://ptdir.eka.care",TELE_HOST:"https://mweb.eka.care",METROLPOLIS_HOST:"https://consultation.metropolisindia.com",LUCID_WS_HOST:"https://lucid-ws.eka.care",LUCID_HOST:"https://lucid.eka.care",DEEPTHOUGHT_HOST:"https://deepthought.eka.care",NDHM_HOST:"https://api.eka.care",LOGIN_HOST:"https://login.eka.care",HUB:"https://hub.eka.care",RECEIPT_DOMAIN:"https://doc-receipts.eka.care"},DEV={AORTA_HOST:"https://aorta.dev.eka.care",AORTA_GO_HOST:"https://aortago.dev.eka.care",TRYST_HOST:"https://tryst.dev.eka.care",AXON_HOST:"https://axon.dev.eka.care",PARCHI_HOST:"https://parchi.dev.eka.care",CURIO_HOST:"https://curio.dev.eka.care",AVATAR_HOST:"https://eka-avatar.dev.eka.care",PTDIR_HOST:"https://ptdir.dev.eka.care",TELE_HOST:"https://mweb.dev.eka.care",METROLPOLIS_HOST:"https://consultation.metropolisindia.com",LUCID_WS_HOST:"https://lucid-ws.dev.eka.care",LUCID_HOST:"https://lucid.dev.eka.care",DEEPTHOUGHT_HOST:"https://deepthought.dev.eka.care",NDHM_HOST:"https://api.dev.eka.care",LOGIN_HOST:"https://login.dev.eka.care",HUB:"https://hub.dev.eka.care",RECEIPT_DOMAIN:"https://doc-receipt.s3.ap-south-1.amazonaws.com"};let envVar=DEV,client_id="",refresh_token="",extraHeaders=null;const setEnv=({env:a,clientId:_,extraHeaders:$})=>{envVar=a==="PROD"?PROD:DEV,client_id=_,$&&(extraHeaders=$)},setIndividualEnv=({clientId:a,env:_,extraHeaders:$})=>{a&&(client_id=a),_&&(envVar=_==="PROD"?PROD:DEV),$&&(extraHeaders={...extraHeaders,...$})},setRefreshToken=a=>{refresh_token=a},GET_REFRESH_TOKEN=()=>refresh_token,GET_AORTA_GO_HOST=()=>envVar.AORTA_GO_HOST,GET_NDHM_HOST=()=>envVar.NDHM_HOST,GET_CLIENT_ID=()=>client_id,GET_EXTRA_HEADERS=()=>extraHeaders;function pushToMxpDataLayer({data:a}){typeof window<"u"&&(window.mxpDataLayer=window.mxpDataLayer||[],window.mxpDataLayer.push(a))}function sendApiFailedEvent({category:a="api-failed",url:_,params:$}){pushToMxpDataLayer({data:{name:a,data:{url:_,...$}}}),{...$}}async function refreshToken(){if(await updateToken())return!0;const _=new Headers;_.append("Content-Type","application/json"),_.set("client-id",GET_CLIENT_ID());const $=JSON.stringify({}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include",mode:"cors"};try{const et=GET_AORTA_GO_HOST();if((await fetch(`${et}/emr/v3/auth/refresh`,{..._e,body:JSON.stringify({})})).status===401)return!1}catch{return!1}return!0}async function fetchWrapper(a,_={},$=!0,_e=!1){var et,tt;try{const rt=((tt=(et=window==null?void 0:window.Eka)==null?void 0:et.getSessionToken)==null?void 0:tt.call(et))||"",nt=new Headers(_.headers);let at,st;!nt.get("client-id")&&!_e&&nt.set("client-id",GET_CLIENT_ID()),rt&&!nt.get("auth")&&nt.set("auth",rt);const it=GET_EXTRA_HEADERS();it&&Object.keys(it).forEach(lt=>{nt.set(lt,it[lt])});const ot=await fetch(a,{..._,headers:nt});return window&&(st=window.location.pathname,at=nt.get("client-id")),ot.status===401&&$&&await refreshToken()?await fetchWrapper(a,_,!1):(ot.status>401&&sendApiFailedEvent({url:a,params:{responseStatus:ot.status}}),ot)}catch(rt){throw sendApiFailedEvent({url:a,params:{error:`${rt.message||rt}`}}),console.error(rt),rt}}let androidRefreshCB=[];async function refreshCallback(a){androidRefreshCB.forEach(_=>_(!0)),androidRefreshCB=[]}async function updateToken(){var a,_,$,_e,et,tt;if(typeof window<"u"){if(typeof((a=window==null?void 0:window.Eka)==null?void 0:a.updateToken)=="function")return(_=window.parent)==null||_.postMessage({type:"REFRESH_TOKEN"},"*"),window.refreshCallback=window.refreshCallback||refreshCallback,new Promise(rt=>{var nt;androidRefreshCB.push(rt),(nt=window==null?void 0:window.Eka)==null||nt.updateToken("refreshCallback")});if(typeof((et=(_e=($=window==null?void 0:window.webkit)==null?void 0:$.messageHandlers)==null?void 0:_e.statusCodeHandler)==null?void 0:et.postMessage)=="function")return(tt=window.parent)==null||tt.postMessage({type:"REFRESH_TOKEN"},"*"),window.refreshCallback=window.refreshCallback||refreshCallback,new Promise(rt=>{var nt,at,st;androidRefreshCB.push(rt),(st=(at=(nt=window==null?void 0:window.webkit)==null?void 0:nt.messageHandlers)==null?void 0:at.statusCodeHandler)==null||st.postMessage(JSON.stringify({status:401}))})}return!1}async function postAuthInitV2({method:a,identifier:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({method:a,identifier:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${tt}/v2/auth/init`,et)).json()}catch(tt){console.error(tt)}return{}}async function postAuthVerifyV2({txn_id:a,code:_,token:$}){const _e=new Headers;_e.append("Content-Type","application/json");const et=JSON.stringify({txn_id:a,..._?{code:_}:{},...$?{token:$}:{}}),tt={method:"POST",headers:_e,body:et,redirect:"follow",credentials:"include"};try{const rt=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${rt}/v2/auth/verify`,tt)).json()}catch(rt){console.error(rt)}return{}}async function getProfilePhrUser(){const a=new Headers;a.append("Content-Type","application/json");const _={method:"GET",headers:a,redirect:"follow",credentials:"include"};try{const $=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${$}/profiles/v1/patient`,_)).json()}catch($){return console.error("profilePhrUser error =>",$),[]}}async function getProfilesPatient(){const a=new Headers;a.append("Content-Type","application/json");const _={method:"GET",headers:a,redirect:"follow",credentials:"include"},$=GET_EXTRA_HEADERS(),_e=$==null?void 0:$["X-User-ID"];if(!_e)return{};try{const et=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${et}/profiles/v1/patient/${_e}`,_)).json()}catch(et){return console.error("profilePhrUser error =>",et),{}}}async function postProfileSwitch({oid:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({oid:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_AORTA_GO_HOST();return await(await fetchWrapper(`${et}/v1/profile/switch`,_e)).json()}catch(et){console.error("postProfileSwitchError: ",et)}return{}}async function postAuthLogoutV2(){console.log("inside postAuthLogoutV2 api call");const a=new Headers;a.append("Content-Type","application/json");const _=JSON.stringify({}),_e=`${GET_AORTA_GO_HOST()}/v2/auth/logout`,et={method:"POST",headers:a,body:_,redirect:"follow",credentials:"include"};try{const tt=await fetchWrapper(_e,et);return tt.ok?!0:(console.log("Logout failed with status",tt==null?void 0:tt.status),!1)}catch(tt){return console.error("Logout API failed:",tt),!1}}async function postAbdmLoginInit({method:a,identifier:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({method:a,identifier:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/profile/login/init`,et)).json()}catch(tt){console.error("postAbdmLoginInit error =>",tt)}return{}}async function postAbdmKycInit({method:a,identifier:_}){const $=new Headers,_e=GET_EXTRA_HEADERS();$.append("Content-Type","application/json");const et=JSON.stringify({method:a,identifier:_,user_x_token:(_e==null?void 0:_e.auth)??""}),tt={method:"POST",headers:$,body:et,redirect:"follow",credentials:"include"};try{const rt=GET_NDHM_HOST();return await(await fetchWrapper(`${rt}/abdm/v1/profile/kyc/init`,tt)).json()}catch(rt){console.error("postAbdmKycInit error =>",rt)}return{}}async function postAbdmConsentDeny({consentId:a}){const _=new Headers;_.append("Content-Type","application/json");const $=GET_NDHM_HOST(),_e=JSON.stringify({id:a,reason:"Consent Denied"}),et={method:"POST",headers:_,body:_e,credentials:"include"};try{const tt=await fetchWrapper(`${$}/abdm/v1/consents/deny`,et);return tt.ok?{success:!0}:await tt.json()}catch(tt){console.error("postabdmConsentDenyError error =>",tt)}return{}}async function postAbdmConsentRevoke({consent_artefacts_ids:a}){const _=new Headers;_.append("Content-Type","application/json");const $=GET_NDHM_HOST(),_e=JSON.stringify({consent_artefacts:a}),et={method:"POST",headers:_,body:_e,credentials:"include"};try{const tt=await fetchWrapper(`${$}/abdm/v1/consents/revoke`,et);return tt.ok?{success:!0}:await tt.json()}catch(tt){console.error("postabdmConsentRevokeError error =>",tt)}return{}}async function postAbdmConsentApprove({consentApprovePayload:a}){const _=new Headers;_.append("Content-Type","application/json");const $=GET_NDHM_HOST(),_e=JSON.stringify(a),et={method:"POST",headers:_,body:_e,credentials:"include"};try{const tt=await fetchWrapper(`${$}/abdm/v1/consents/approve`,et);return tt.ok?{success:!0}:await tt.json()}catch(tt){console.error("postabdmConsentDenyError error =>",tt)}return{}}async function postAbdmLoginVerify({txn_id:a,otp:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,otp:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/profile/login/verify`,et)).json()}catch(tt){console.error("postAbdmLoginVerify error =>",tt)}return{}}async function postAbdmKycVerify({txn_id:a,otp:_}){const $=new Headers,_e=GET_EXTRA_HEADERS();$.append("Content-Type","application/json");const et=JSON.stringify({txn_id:a,otp:_,user_x_token:(_e==null?void 0:_e.auth)??""}),tt={method:"POST",headers:$,body:et,redirect:"follow",credentials:"include"};try{const rt=GET_NDHM_HOST();return await(await fetchWrapper(`${rt}/abdm/v1/profile/kyc/verify`,tt)).json()}catch(rt){console.error("postAbdmKycVerify error =>",rt)}return{}}async function postRegisterAadhaarInit({aadhaar_number:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({aadhaar_number:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/aadhaar/init`,_e)).json()}catch{}return{}}async function postRegisterAadhaarFaceAuthInit(){const a=new Headers;a.append("Content-Type","application/json");const _={method:"POST",headers:a,redirect:"follow",credentials:"include"};try{const $=GET_NDHM_HOST();return await(await fetchWrapper(`${$}/abdm/na/v1/registration/aadhaar/face-auth/init`,_)).json()}catch{}return{}}async function postRegisterAadhaarFaceAuthCapture({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({txn_id:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/aadhaar/face-auth/capture`,_e)).json()}catch{}return{}}async function postRegisterAadhaarFaceAuthVerify({txn_id:a,aadhaar:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,aadhaar:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/face-auth/verify`,et)).json()}catch{}return{}}async function postRegisterMobileInit({mobile_number:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({mobile_number:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/mobile/init`,_e)).json()}catch(et){console.error(et)}return{}}async function postRegisterAadhaarMobileInit({mobile:a,txn_id:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({mobile:a,txn_id:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/mobile/init`,et)).json()}catch(tt){console.error(tt)}return{}}async function postRegisterAadhaarVerify({txn_id:a,mobile:_,otp:$}){const _e=new Headers;_e.append("Content-Type","application/json");const et=JSON.stringify({txn_id:a,mobile:_,otp:$}),tt={method:"POST",headers:_e,body:et,redirect:"follow",credentials:"include"};try{const rt=GET_NDHM_HOST();return await(await fetchWrapper(`${rt}/abdm/na/v1/registration/aadhaar/verify`,tt)).json()}catch{}return{}}async function postRegisterAadhaarAutoLogin({txn_id:a,abha_address:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,abha_address:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/auto-login`,et)).json()}catch{}return{}}async function postRegisterAadhaarMobileVerify({txn_id:a,otp:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,otp:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/mobile/verify`,et)).json()}catch{}return{}}async function postRegisterAadhaarResendOtp({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({txn_id:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/aadhaar/resend`,_e)).json()}catch{}return{}}async function postAbdmKycVerifyResendOtp({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({txn_id:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/v1/profile/kyc/resend`,_e)).json()}catch{}return{}}async function postRegisterAadhaarMobileResendOtp({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({txn_id:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/aadhaar/mobile/resend`,_e)).json()}catch{}return{}}async function postRegisterAadhaarCreatePhr({abha_address:a,txn_id:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({abha_address:a,txn_id:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/aadhaar/create-phr`,et)).json()}catch(tt){console.error("postRegisterAadhaarCreatePhr ==>",tt)}return{}}async function postAbdmRegisterMobileCreatePhr({abha_address:a,address:_,first_name:$,last_name:_e,day_of_birth:et,month_of_birth:tt,year_of_birth:rt,gender:nt,middle_name:at,pincode:st,txn_id:it}){const ot=new Headers;ot.append("Content-Type","application/json");const lt=JSON.stringify({abha_address:a,profile:{address:_,day_of_birth:et,first_name:$,gender:nt,last_name:_e,middle_name:at,month_of_birth:tt,pincode:st,year_of_birth:rt},txn_id:it}),ht={method:"POST",headers:ot,body:lt,redirect:"follow",credentials:"include"};try{const pt=GET_NDHM_HOST();return await(await fetchWrapper(`${pt}/abdm/na/v1/registration/mobile/create-phr`,ht)).json()}catch(pt){console.error("postAbdmRegisterMobileCreatePhr error =>",pt)}return{}}async function postAbdmProfileLoginPhr({txn_id:a,phr_address:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,phr_address:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/profile/login/phr`,et)).json()}catch(tt){console.error("postAbdmProfileLoginPhr error =>",tt)}return{}}async function getAbdmRegisterSuggest({txn_id:a,fn:_,mn:$,ln:_e,dob:et}){const tt=new Headers;tt.append("Content-Type","application/json");const rt={method:"GET",headers:tt,redirect:"follow",credentials:"include"};try{const nt=GET_NDHM_HOST();return await(await fetchWrapper(`${nt}/abdm/na/v1/registration/suggest?transactionId=${a}&fn=${_||""}&mn=${$||""}&ln=${_e||""}&dob=${et||""}`,rt)).json()}catch(nt){console.error("postAbdmLoginVerify error =>",nt)}return{}}async function postAbdmRegisterAbhaNumberCreatePhr({abha_address:a,txn_id:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({abha_address:a,txn_id:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/abha-number/create-phr`,et)).json()}catch(tt){console.error("postAbdmRegisterAbhaNumberCreatePhr ==>",tt)}return{}}async function postAbdmRegisterPhrCheck({abha_address:a}){const _=new Headers;_.append("Content-Type","application/json");const $=JSON.stringify({abha_address:a}),_e={method:"POST",headers:_,body:$,redirect:"follow",credentials:"include"};try{const et=GET_NDHM_HOST();return await(await fetchWrapper(`${et}/abdm/na/v1/registration/phr/check`,_e)).json()}catch(et){console.error("postAbdmRegisterPhrCheck ==>",et)}return{}}async function postAbdmProfileEka({abha_address:a,address:_,first_name:$,last_name:_e,day_of_birth:et,month_of_birth:tt,year_of_birth:rt,gender:nt,middle_name:at,pincode:st}){const it=new Headers;it.append("Content-Type","application/json");const ot=JSON.stringify({abha_address:a,profile:{address:_,day_of_birth:et,first_name:$,gender:nt,last_name:_e,middle_name:at,month_of_birth:tt,pincode:st,year_of_birth:rt}}),lt={method:"POST",headers:it,body:ot,redirect:"follow",credentials:"include"};try{const ht=GET_NDHM_HOST();return await(await fetchWrapper(`${ht}/abdm/v1/profile/eka`,lt)).json()}catch(ht){console.error("postAbdmProfileEka error =>",ht)}return{}}async function postAbdmProfileEkaLinkPhr({abha_address:a,oid:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({abha_address:a,oid:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/v1/profile/eka/link-phr`,et)).json()}catch(tt){console.error("postAbdmProfileLinkPhr ==>",tt)}return{}}async function postAbdmRegisterMobileVerify({txn_id:a,otp:_}){const $=new Headers;$.append("Content-Type","application/json");const _e=JSON.stringify({txn_id:a,otp:_}),et={method:"POST",headers:$,body:_e,redirect:"follow",credentials:"include"};try{const tt=GET_NDHM_HOST();return await(await fetchWrapper(`${tt}/abdm/na/v1/registration/mobile/verify`,et)).json()}catch{}return{}}async function postAbdmRegisterMobileResendOtp({txn_id:a}){const _=new Headers;_.append("Content-Type","application/json");const $={method:"POST",headers:_,body:JSON.stringify({txn_id:a}),redirect:"follow",credentials:"include"};try{const _e=GET_NDHM_HOST();return await(await fetchWrapper(`${_e}/abdm/na/v1/registration/mobile/resend`,$)).json()}catch{}return{}}async function getPincodeDetails({pincode:a}){const $=`${GET_NDHM_HOST()}/abdm/na/v1/registration/pincode/${a}`,_e=new Headers;_e.append("Content-Type","application/json");const et={method:"GET",headers:_e,redirect:"follow",credentials:"include"};try{return await(await fetchWrapper($,et)).json()}catch(tt){console.error(tt)}return{}}var ConsentStatus=(a=>(a.REQUESTED="REQUESTED",a.GRANTED="GRANTED",a.DENIED="DENIED",a.EXPIRED="EXPIRED",a.REVOKED="REVOKED",a))(ConsentStatus||{});async function getConsentRequest({id:a,type:_}){const $=GET_NDHM_HOST();console.log("NDHM_HOST",$);const _e=`${$}/abdm/v1/request?type=consent&status=${_}&id=${a}`,et=new Headers;et.append("Content-Type","application/json");const tt={method:"GET",headers:et,redirect:"follow",credentials:"include"};try{const rt=await fetchWrapper(_e,tt);if(rt.status===200)return await rt.json();throw Error("Error fetching Consent Details")}catch(rt){console.error(rt)}return{}}async function getAbdmAssestCard(){const a=GET_NDHM_HOST();console.log("NDHM_HOST",a);const _=`${a}/abdm/v1/profile/asset/card`,_e={method:"GET",headers:new Headers,redirect:"follow",credentials:"include"};try{const et=await fetchWrapper(_,_e);if(et.status===200)return await et.blob();throw Error("Error fetching Consent Details")}catch(et){console.error(et)}return{}}async function getAbdmSessionStatus(){const a=GET_NDHM_HOST();console.log("NDHM_HOST",a);const _=`${a}/abdm/v1/session/status`,$=new Headers;$.append("Content-Type","application/json");const _e={method:"GET",headers:$,redirect:"follow",credentials:"include"};try{const et=await fetchWrapper(_,_e);if(et.status===200)return await et.json();throw Error("Error fetching Consent Details")}catch(et){console.error(et)}return{}}async function postAbdmProfileSearch({mobile:a}){const _=new Headers;_.append("Content-Type","application/json");const $=GET_NDHM_HOST(),_e=JSON.stringify({mobile:a}),et={method:"POST",headers:_,body:_e,credentials:"include"};try{return(await fetchWrapper(`${$}/abdm/v1/profile/search`,et)).json()}catch(tt){console.error("postAbdmProfileSearch error =>",tt)}return{}}var reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
18
18
  * @license React
19
19
  * scheduler.production.min.js
20
20
  *
@@ -147,7 +147,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
147
147
  ${_e?"pds2-border-bg-brand-01":"pds2-border-border-03 group-hover:pds2-border-bg-brand-01"}`,children:[jsxRuntimeExports.jsx("div",{className:"pds2-p-12 pds2-bg-bg-02 pds2-rounded-8",children:jsxRuntimeExports.jsx("div",{className:`pds2-m-auto pds2-w-20 pds2-h-20
148
148
  `,children:_e?jsxRuntimeExports.jsx("img",{src:tt,alt:"icon",className:"pds2-w-20 pds2-h-20"}):jsxRuntimeExports.jsx("img",{src:a,alt:"icon",className:"pds2-w-20 pds2-h-20"})})}),jsxRuntimeExports.jsx("div",{className:`Body4Medium pds2-py-8 group-hover:pds2-text-bg-brand-01
149
149
  ${_e?"pds2-text-bg-brand-01":""}`,children:_})]}),$&&jsxRuntimeExports.jsx("div",{className:`Label2Regular pds2-p-6 group-hover:pds2-text-bg-brand-01
150
- ${_e?"pds2-text-bg-brand-01":"pds2-text-text-03"}`,children:"No OTP needed"})]}),LoginorCreateAbhaScreen=()=>{const a=useAuthAbhaStore(_e=>_e.clientId);reactExports.useEffect(()=>{var _e;if((_e=window.EkaAbha)!=null&&_e.changeStatusBarColor)return window.EkaAbha.changeStatusBarColor("#F2F4F7"),()=>{var et,tt;(et=window.EkaAbha)!=null&&et.changeStatusBarColor&&((tt=window==null?void 0:window.EkaAbha)==null||tt.changeStatusBarColor("#FFFFFF"))}},[]);const _=()=>{var _e;(_e=window.EkaAbha)==null||_e.onAbhaClose(),unMount()},$=["eka-web","phr","www-eka"];return jsxRuntimeExports.jsxs("div",{className:"pds2-h-full pds2-overflow-y-auto",children:[!$.includes(a)&&jsxRuntimeExports.jsx(Pds2Header,{prefixIcon:jsxRuntimeExports.jsx("button",{onClick:_,children:jsxRuntimeExports.jsx(n$4,{})}),title:"",className:"pds2-bg-bg-01"}),jsxRuntimeExports.jsx(LoginOrCreateWithDifferentMethods,{})]})},LoginOrCreateWithDifferentMethods=()=>{const a=useAuthAbhaStore(nr=>nr.abhaAuthFlowMethod||ABHA_AUTH_FLOW_METHOD.MOBILE),_=useAuthAbhaStore(nr=>nr.setAbhaAuthFlowMethod),$=useAuthAbhaStore(nr=>nr.goBackToLogin),_e=useAuthAbhaStore(nr=>nr.setGoBackToLogin),et=useAuthAbhaStore(nr=>nr.setIdentifierValue),tt=useAuthAbhaStore(nr=>nr.identifierValue),rt=useAuthAbhaStore(nr=>nr.isEkaAppLogin),nt=useAuthAbhaStore(nr=>nr.setSelectedAbhaAddress),at=useAuthAbhaStore(nr=>nr.setLoginIdentifierValue),st=useAuthAbhaStore(nr=>nr.setRegistrationType),it=useAuthAbhaStore(nr=>nr.setAadhaarInitResponse),ot=useAuthAbhaStore(nr=>nr.setAadhaarFaceAuthInitResponse),lt=useAuthAbhaStore(nr=>nr.setMobileInitResponse),ht=useAuthAbhaStore(nr=>nr.initAbhaAppMobileNumber),pt=useAuthAbhaStore(nr=>nr.initAbhaAppIdentifierType),dt=useAuthAbhaStore(nr=>nr.initAbhaAppIdentifier),mt=useAuthAbhaStore(nr=>nr.setInitAbhaAppIdentifier),ct=useAuthAbhaStore(nr=>nr.setInitAbhaAppIdentifierType),ft=useAuthAbhaStore(nr=>nr.isDocAppRequest),ut=useAuthAbhaStore(nr=>nr.faceAuthEnable),gt=useAuthAbhaStore(nr=>nr.isNewLoginOrCreateFlow),yt=useAuthAbhaStore(nr=>nr.setIsNewLoginOrCreateFlow),Et=useAuthAbhaStore(nr=>nr.clientId),_t=useAuthAbhaStore(nr=>nr.isInitApiTriggered),St=useAuthAbhaStore(nr=>nr.setIsInitApiTriggered),wt=useAuthAbhaStore(nr=>nr.setIdentityValue);useAuthAbhaStore(nr=>nr.identityValue);const Pt=useAuthAbhaStore(nr=>nr.setSelectedAbhaFlow),Nt=useAuthAbhaStore(nr=>nr.txnId),Mt=useAuthAbhaStore(nr=>nr.initAbhaFlow),Dt=useAuthAbhaStore(nr=>nr.selectedAadhaarAuth),Rt=useAuthAbhaStore(nr=>nr.setSelectedAadhaarAuth),[kt,xt]=reactExports.useState(LOADING_STATE.IDLE),[bt,vt]=reactExports.useState(""),At=useAuthAbhaStore(nr=>nr.setScreen),[Ct,Tt]=reactExports.useState({aadhaar:LOADING_STATE.IDLE,mobile:LOADING_STATE.IDLE}),[Ot,$t]=reactExports.useState($?tt.mobile:""),[It,jt]=reactExports.useState(!1),[Ht,Lt]=reactExports.useState(!1),[Vt,Yt]=reactExports.useState(tt.aadhaar_number||""),[Wt,Ut]=reactExports.useState(tt.abha_number||""),[Bt,zt]=reactExports.useState(""),[Gt,Qt]=reactExports.useState(tt.phr_address||""),rr=reactExports.useRef(!1),Zt=GET_EXTRA_HEADERS(),vr=(Zt==null?void 0:Zt["X-User-ID"])??void 0;reactExports.useEffect(()=>{Jt({name:"abha_login_or_create_screen",data:{flow:a.toString()}})});const ar=async nr=>{var dr;try{xt(LOADING_STATE.LOADING);const kr=await postAbdmProfileSearch({mobile:nr});if(((dr=kr==null?void 0:kr.profiles)==null?void 0:dr.length)>0&&dt)$t(dt);else{xt(LOADING_STATE.REJECTED),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),vt(`KYC ABHA not found for ${dt}. Please register with Aadhaar.`);return}}catch(kr){console.error("Error searching ABDM profile:",kr),xt(LOADING_STATE.REJECTED),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)}};reactExports.useEffect(()=>{dt&&pt===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!$?(zt(dt),Qt(dt.split("@")[0]),et({phr_address:dt.split("@")[0]}),gr(!0),$r(!0),_(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS)):dt&&pt===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!$?(et({abha_number:dt}),Ut(dt),gr(!0),wr(!0),_(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER)):dt&&pt===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!$?(Yt(dt),Lt(!0),et({aadhaar_number:dt}),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)):dt&&pt===ABHA_AUTH_FLOW_METHOD.MOBILE&&!$&&(_(ABHA_AUTH_FLOW_METHOD.MOBILE),ar(dt),jt(dt.length===10),et({mobile:dt}),vt(null))},[pt,dt]),reactExports.useEffect(()=>{_t||rr.current||Ot&&Ot.length===10&&a==ABHA_AUTH_FLOW_METHOD.MOBILE&&(mr("auto_submit_mobile"),St(!0),rr.current=!0)},[Ot]),reactExports.useEffect(()=>{_t||rr.current||Vt&&Vt.length===12&&a==ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!ut&&(St(!0),rr.current=!0,mr("auto_submit_aadhaar"))},[Vt]),reactExports.useEffect(()=>{_t||rr.current||Wt&&Wt.length===17&&a==ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&(St(!0),rr.current=!0,mr("auto_submit_abha"))},[Wt]),reactExports.useEffect(()=>{_t||rr.current||Bt&&Bt.includes("@sbx")&&a==ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&(St(!0),rr.current=!0,mr("auto_submit_phr"))},[Bt]);const Jt=({name:nr,data:dr={}})=>{var Pr,en;const jr={...{login_platform:Et,is_eka_app_login:rt?"true":"false",is_new_login_or_create_flow:gt?"true":"false",oid:Zt!=null&&Zt["X-User-ID"]?"true":"false",access_token:Zt!=null&&Zt.auth?"true":"false",txn_id:Nt||"missing txnId",flow:a??""},...dr};handleSendEvent({eventName:nr,eventData:jr}),(en=(Pr=window.curio)==null?void 0:Pr.pushToMixpanel)==null||en.call(Pr,nr,jr)},Kt=React.useMemo(()=>{switch(a){case ABHA_AUTH_FLOW_METHOD.MOBILE:return"Enter your Mobile Number";case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return"Enter your Aadhaar Number";default:return""}},[a]),Xt=nr=>{ct(""),vt("");const dr=nr.target.value;switch(a){case ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS:if(dr.length>20)return;Qt(dr),et({phr_address:dr}),mt(null);break;case ABHA_AUTH_FLOW_METHOD.MOBILE:if(dr&&!/^[0-9]+$/.test(dr)||dr.length>10)return;$t(dr),jt(!0),et({mobile:dr}),mt(null);break;case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:if(!/^[\d-]*$/.test(dr)||dr.length>17)return;const kr=nr.target.value.replace(/-/g,"");let jr="";return kr.length>0&&(jr+=kr.slice(0,2)),kr.length>2&&(jr+=`-${kr.slice(2,6)}`),kr.length>6&&(jr+=`-${kr.slice(6,10)}`),kr.length>10&&(jr+=`-${kr.slice(10,14)}`),Ut(jr),mt(null),et({abha_number:jr.trim()});case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:if(dr&&!/^[0-9]+$/.test(dr)||dr.length>12)return;Yt(dr),Lt(!0),mt(null),et({aadhaar_number:dr});break}};ABHA_AUTH_FLOW_METHOD.MOBILE;const ir=React.useMemo(()=>{switch(a){case ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS:return tt.phr_address.length>=4&&tt.phr_address.length<=20;case ABHA_AUTH_FLOW_METHOD.MOBILE:return tt.mobile.length===10;case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:return tt.abha_number.length===17;case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return tt.aadhaar_number.length===12&&Dt!=AADHAAR_AUTH_STATES.NONE}},[a,tt,Dt]),qt=(nr,dr)=>{Tt(kr=>({...kr,[nr]:dr}))},er=({inputVal:nr})=>{nr.length===12&&(et({aadhaar_number:nr}),Yt(nr),Lt(!0))};reactExports.useEffect(()=>{console.log("selectedMethod changed:==================>",a)},[a]);const mr=async nr=>{var jr,Pr,en,Xr;yt(!0),Jt({name:"abha_login_next_click",data:{flow_step_type:nr}}),xt(LOADING_STATE.LOADING),st(REGISTRATION_TYPE.LOGIN);let dr="";if(!rt){const ur=await postAuthLogoutV2();Jt({name:ur?"abha_logout_success":"abha_logout_failure",data:{platform:Et}});const{txn_id:Mr,error:yr}=await postAuthInitV2({method:AUTH_METHOD.ABHA});if(!Mr||yr){Jt({name:"abha_auth_init_failure",data:{flow_step_type:"init",authTxnId:dr,error_message:yr||"missing_txnId_or_unknown_error",error_message_exists:!!yr,txn_id_exists:!!Mr}}),vt((yr==null?void 0:yr.message)||"Something went wrong. Please try again."),xt(LOADING_STATE.REJECTED);return}dr=Mr,Jt({name:"abha_auth_init_success.",data:{flow_step_type:"init",auth_txnId:dr}})}const kr=a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS?`${tt.phr_address}@sbx`:a===ABHA_AUTH_FLOW_METHOD.MOBILE?tt.mobile:a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?tt.abha_number:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?tt.aadhaar_number:"";if(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER||a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS){const{txn_id:ur,error:Mr,action:yr,hint:Er}=await postAbdmLoginInit({method:a,identifier:kr});if(St(!0),wt(kr),Jt({name:"abha_login_init_triggered",data:{flow_step_type:"init",authTxnId:dr,ndhmTxnId:ur,method:a}}),a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&nt(kr),Mr||!ur){if(_e(!0),((jr=yr==null?void 0:yr.cta)==null?void 0:jr.pid)==="abha_mobile_enroll"&&a===ABHA_AUTH_FLOW_METHOD.MOBILE){qt("mobile",LOADING_STATE.LOADING),st(REGISTRATION_TYPE.CREATE);const{txn_id:Hr,hint:dn,error:Or,action:Jr}=await postRegisterMobileInit({mobile_number:tt.mobile});if(St(!0),wt(tt.mobile),Pt("mobile"),Hr&&dn){lt({authTxnId:dr,txnId:Hr,mobileOtpSentToHint:dn}),Jt({name:"abha_mobile_registration_init_success",data:{flow_step_type:"init",authTxnId:dr,ndhmTxnId:ur,error_message:Or,error_action:yr}}),qt("mobile",LOADING_STATE.RESOLVED),xt(LOADING_STATE.RESOLVED),st(REGISTRATION_TYPE.CREATE),At(SCREEN_NAMES.ABHA_PHONE_NUMBER_VERIFICATION);return}if(qt("mobile",LOADING_STATE.REJECTED),Jt({name:"abha_mobile_registration_init_failure",data:{flow_step_type:"init",authTxnId:dr,error_message:Or||"unknown_error",error_message_exists:!!Or,error_action_exists:!!Jr}}),Jr){if((Pr=Jr==null?void 0:Jr.cta)!=null&&Pr.pid)return At(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA)}else vt(Or||"Something went wrong");vt(Or||"Something went wrong. Please try again."),xt(LOADING_STATE.REJECTED);return}Jt({name:"abha_login_init_failure",data:{flow_step_type:"init",authTxnId:dr,error_message:Mr||"unknown_error",error_message_exists:!!Mr,error_action_exists:!!yr}}),vt(Mr||"Something went wrong. Please try again."),xt(LOADING_STATE.REJECTED);return}Jt({name:"abha_login_init_success",data:{flow_step_type:"init",authTxnId:dr,ndhmTxnId:ur,hint:Er}}),it({authTxnId:dr,txnId:ur,aadhaarOtpSentToHint:Er||null}),_e(!1),at(kr),xt(LOADING_STATE.RESOLVED),At(SCREEN_NAMES.VERIFY_OTP_LOGIN_WITH_ABHA);return}if(a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&Dt===AADHAAR_AUTH_STATES.OTP){qt("aadhaar",LOADING_STATE.LOADING),Jt({name:"aadhaar_registration_init_start",data:{flow_step_type:"init",authTxnId:dr,aadhaarNumber:tt.aadhaar_number}});const{txn_id:ur,hint:Mr,error:yr,action:Er}=await postRegisterAadhaarInit({aadhaar_number:tt.aadhaar_number});if(wt(tt.aadhaar_number),Pt("aadhaar"),ur&&Mr){it({authTxnId:dr,txnId:ur,aadhaarOtpSentToHint:Mr}),Jt({name:"aadhaar_registration_init_success",data:{flow_step_type:"verify",ndhmTxnId:ur,authTxnId:dr}}),_e(!1),qt("aadhaar",LOADING_STATE.RESOLVED),st(REGISTRATION_TYPE.CREATE),xt(LOADING_STATE.RESOLVED),At(SCREEN_NAMES.ABHA_OTP_AND_MOBILE);return}if(Jt({name:"abha_registration_init_failure",data:{error_message:yr||"unknown_error",error_message_exists:!!yr,auth_txn_id:dr,error_action:Er,error_action_exists:!!Er}}),qt("aadhaar",LOADING_STATE.REJECTED),xt(LOADING_STATE.REJECTED),Er||yr){_e(!0),(en=Er==null?void 0:Er.cta)!=null&&en.pid?At(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):vt(yr||"Something went wrong");return}}if(a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&Dt===AADHAAR_AUTH_STATES.FACE_AUTH){qt("aadhaar",LOADING_STATE.LOADING),Jt({name:"aadhaar_registration_faceauth_init_start",data:{flow_step_type:"init",authTxnId:dr,aadhaarNumber:tt.aadhaar_number}});const{url:ur,txn_id:Mr,hint:yr,error:Er,action:Hr}=await postRegisterAadhaarFaceAuthInit();if(wt(tt.aadhaar_number),Pt("aadhaar"),Mr&&yr&&ur){ot({authTxnId:dr,txnId:Mr,aadhaarFaceAuthOtpSentToHint:yr,faceAuthQrUrl:ur}),Jt({name:"aadhaar_registration_faceauth_init_success",data:{flow_step_type:"verify",ndhmTxnId:Mr,authTxnId:dr}}),_e(!1),qt("aadhaar",LOADING_STATE.RESOLVED),st(REGISTRATION_TYPE.CREATE),xt(LOADING_STATE.RESOLVED),At(SCREEN_NAMES.ABHA_AUTH_QR_SCREEN);return}if(Jt({name:"abha_registration_faceauth_init_failure",data:{error_message:Er||"unknown_error",error_message_exists:!!Er,auth_txn_id:dr,error_action:Hr,error_action_exists:!!Hr}}),qt("aadhaar",LOADING_STATE.REJECTED),xt(LOADING_STATE.REJECTED),Hr||Er){_e(!0),(Xr=Hr==null?void 0:Hr.cta)!=null&&Xr.pid?At(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):vt(Er||"Something went wrong");return}}},[pr,gr]=reactExports.useState(!1),[Dr,wr]=reactExports.useState($&&a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),[Vr,$r]=reactExports.useState($&&a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:`pds2-p-16 pds2-bg-bg-01 pds2-space-y-16 pds2-text-center pds2-rounded-b-24 ${ft?"pds2-pt-0 -pds2-mt-20":"pds2-pt-22"}`,children:[Mt?jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-bg-01"}):jsxRuntimeExports.jsx(AbhaStepper,{}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-items-center pds2-gap-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-bg-bg-white pds2-rounded-16",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-64 pds2-h-64"})})}),jsxRuntimeExports.jsx("div",{className:"Heading3Semibold pds2-text-text-black",children:Et==="phr"?"Login or Create your ABHA":ft?"Add Patient via ABHA":"Create your ABHA"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-03",style:{marginTop:"4px"},children:a===ABHA_AUTH_FLOW_METHOD.MOBILE?ft?"Enter Patient's Mobile Number":"Enter your Mobile Number":a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?ft?"Enter Patient's Aadhaar Number":"Enter your Aadhaar Number":a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?ft?"Enter Patient's ABHA Number":"Enter your ABHA Number":a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS?ft?"Enter Patient's ABHA Address":"Enter your ABHA Address":Kt}),(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsxs("div",{className:"pds2-w-full",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-1/2 pds2-relative",children:jsxRuntimeExports.jsx("div",{className:"Label2Medium pds2-w-fit pds2-px-8 pds2-py-2 pds2-bg-bg-green-100 pds2-text-text-success pds2-mx-auto pds2-border pds2-border-border-neutral pds2-border-b-none pds2-rounded-t-6",children:"Recommended"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative pds2-flex pds2-bg-bg-seperator-dark pds2-rounded-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-top-0 pds2-bottom-0 pds2-bg-bg-white pds2-rounded-12 pds2-transition-all pds2-duration-300",style:{left:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?0:"50%",width:"50%",boxShadow:"0px 10px 4px -6px #18274B17"}}),jsxRuntimeExports.jsxs("button",{onClick:()=>{_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),vt("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm5mcdm3h00070tfs9fjkepff.webp",alt:"aadhaar-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?{fontWeight:700}:{fontWeight:400},children:"Aadhaar"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{_(ABHA_AUTH_FLOW_METHOD.MOBILE),vt("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx(n$3,{className:"pds2-w-14 pds2-h-14 pds2-text-icon-success-02"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${a===ABHA_AUTH_FLOW_METHOD.MOBILE?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:a===ABHA_AUTH_FLOW_METHOD.MOBILE?{fontWeight:700}:{fontWeight:400},children:"Mobile"})]})]})]}),(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx("div",{className:"pds2-mt-16 pds2-w-full pds2-max-w-md pds2-mx-auto pds2-px-4 pds2-relative",children:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaInputComponent,{initialValues:pt===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!$?(dt==null?void 0:dt.match(/.{1,4}/g))??void 0:(Vt==null?void 0:Vt.match(/.{1,4}/g))??void 0,disabled:!$&&pt===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!!dt,numberOfInputs:3,length:4,placeholder:"XXXX",onSubmit:er,setIsValid:Lt,setValue:Yt,setError:vt}),ut&&jsxRuntimeExports.jsxs("div",{className:"pds2-mt-20",children:[jsxRuntimeExports.jsx("hr",{className:"pds2-text-bg-04 pds2-border-t-2 pds2-border-bg-04 pds2-w-4/5 pds2-mx-auto"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-py-12 pds2-text-text-03 ",children:"Authenticate using"}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-evenly pds2-w-11/12 pds2-mx-auto",children:[jsxRuntimeExports.jsx(AuthLoginCard,{icon:otpSvg,selectIcon:selectOtpSvg,text:"OTP",otpReq:!1,isSelected:Dt===AADHAAR_AUTH_STATES.OTP,onClick:()=>Rt(AADHAAR_AUTH_STATES.OTP)}),jsxRuntimeExports.jsx(AuthLoginCard,{icon:faceAuth,selectIcon:selectFaceAuth,text:"Face Auth",otpReq:!0,isSelected:Dt===AADHAAR_AUTH_STATES.FACE_AUTH,onClick:()=>Rt(AADHAAR_AUTH_STATES.FACE_AUTH)})]})]})]}):jsxRuntimeExports.jsx(Pds2InputField,{value:pt===ABHA_AUTH_FLOW_METHOD.MOBILE&&!$?dt||"":Ot,disabled:!$&&pt===ABHA_AUTH_FLOW_METHOD.MOBILE||!!dt&&!!vr,onChange:Xt,type:"text",autoComplete:"tel-national",pattern:"[0-9]*",placeholder:"Mobile Number",inputMode:"numeric",autoFocus:!0,maxLength:10,PrefixComponent:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-x-8 pds2-border-r pds2-border-border-brand-02 pds2-pr-24",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4mlct2900000tg98p8u967s.webp",alt:"indian-flag-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:"pds2-text-text-black pds2-text-sm",children:"+91"})]})})}),bt&&(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx("div",{className:`${bt.includes("KYC ABHA not found for")?"pds2-text-text-01":"pds2-text-text-error"} Body3Regular`,children:bt}),(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!ir||kt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:kt===LOADING_STATE.LOADING,onClick:()=>mr("aadhaar_or_mobile_on_click"),className:"pds2-w-full"})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-m-16 pds2-bg-bg-white pds2-rounded-16 pds2-border pds2-border-border-03 pds2-overflow-hidden",children:[jsxRuntimeExports.jsxs("button",{onClick:()=>gr(!pr),className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-16 pds2-bg-bg-white hover:pds2-bg-bg-02 pds2-transition-colors",children:[jsxRuntimeExports.jsx("span",{className:"pds2-text-text-03",children:ft?"Other add options for ABHA":"Other login options for ABHA"}),jsxRuntimeExports.jsx(c$3,{className:`pds2-w-16 pds2-h-16 pds2-text-text-03 pds2-transition-transform ${pr?"pds2-rotate-180":""}`})]}),jsxRuntimeExports.jsxs("div",{className:`pds2-overflow-hidden pds2-transition-all pds2-duration-300 ${pr?"pds2-max-h-126 pds2-opacity-100":"pds2-max-h-0 pds2-opacity-0"}`,children:[jsxRuntimeExports.jsxs("button",{onClick:()=>{gr(!1),_(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),wr(!0),vt("")},className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-12 hover:pds2-bg-bg-02 pds2-transition-colors",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-40 pds2-h-40 pds2-rounded-full pds2-bg-bg-02 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-24 pds2-h-24"})}),jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-text-text-black",children:ft?"Add patient with ABHA Number":"Login with ABHA Number"})]}),jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-text-text-03"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{gr(!1),_(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS),$r(!0),vt("")},className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-12 hover:pds2-bg-bg-02 pds2-transition-colors",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-40 pds2-h-40 pds2-rounded-full pds2-bg-bg-02 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"ABHA",className:"pds2-w-24 pds2-h-24"})}),jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-text-text-black",children:ft?"Add patient with ABHA Address":"Login with ABHA Address"})]}),jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-text-text-03"})]})]})]}),jsxRuntimeExports.jsx(AbhaBottomSheet,{isOpen:Dr,setIsOpen:wr,setFlowMethod:_,setError:vt,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{vt(null),wr(!1),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-text-03 hover:pds2-text-text-black",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-mb-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-w-64 pds2-h-64 pds2-rounded-full pds2-bg-bg-01 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-48 pds2-h-48"})})}),jsxRuntimeExports.jsx("h2",{className:"Heading3Semibold pds2-text-text-black",children:ft?"Add Patient with ABHA Number":"Login with ABHA Number"}),jsxRuntimeExports.jsx("p",{className:"Body2Regular pds2-text-text-03 pds2-mb-24",children:ft?"Enter Patient's 14 digit ABHA Number":"Enter your 14 digit ABHA Number"}),jsxRuntimeExports.jsx(Pds2InputField,{value:pt===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!$?dt||"":Wt,disabled:!$&&pt===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!!dt,onChange:Xt,placeholder:"00-0000-0000-0000",padding:"pds2-p-18",textStyle:"Body2Regular pds2-text-center pds2-text-lg",borderStyle:"focus-within:pds2-border-border-brand-01",type:"tel",inputMode:"numeric",autoFocus:!0,onKeyDown:nr=>{nr.key==="Enter"&&mr("after_enter_abha_number_on_click_by_user")}}),bt&&jsxRuntimeExports.jsx("div",{className:"pds2-text-text-error Body3Regular pds2-mt-12",children:bt}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!tt||kt===LOADING_STATE.LOADING?"disabled":"enabled",onClick:()=>mr("after_enter_abha_number_on_click_by_user"),className:`pds2-w-full ${bt?"pds2-mt-12":"pds2-mt-24"}`,isLoading:kt===LOADING_STATE.LOADING})]})]})}),jsxRuntimeExports.jsx(AbhaBottomSheet,{isOpen:Vr,setIsOpen:$r,setFlowMethod:_,setError:vt,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[!Mt&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{vt(null),$r(!1),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-text-03 hover:pds2-text-text-black",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-mb-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-w-64 pds2-h-64 pds2-rounded-full pds2-bg-bg-01 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-48 pds2-h-48"})})}),jsxRuntimeExports.jsx("h2",{className:"Heading3Semibold pds2-text-text-black",children:ft?"Add Patient with ABHA Address":"Login with ABHA Address"}),jsxRuntimeExports.jsx("p",{className:"Body2Regular pds2-text-text-03 pds2-mb-24",children:ft?"Enter Patient's ABHA Address below":"Enter your ABHA Address below"}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative",children:[jsxRuntimeExports.jsx(Pds2InputField,{value:pt===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!$?(dt==null?void 0:dt.split("@")[0])||"":Gt,disabled:!$&&pt===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!!dt,onChange:Xt,placeholder:"Enter ABHA Address",inputMode:"text",autoFocus:!0,onKeyDown:nr=>{nr.key==="Enter"&&mr("after_enter_abha_address_on_click_by_user")}}),jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-right-16 pds2-top-16 Body1Regular pds2-text-text-03",children:"@sbx"})]}),bt&&jsxRuntimeExports.jsx("div",{className:"pds2-text-text-error Body3Regular pds2-mt-12",children:bt}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!tt||kt===LOADING_STATE.LOADING?"disabled":"enabled",onClick:()=>mr("after_enter_abha_address_on_click_by_user"),className:`pds2-w-full ${bt?"pds2-mt-12":"pds2-mt-24"}`,isLoading:kt===LOADING_STATE.LOADING})]})]})})]})},AbhaBottomSheet=({isOpen:a,setIsOpen:_,children:$,setFlowMethod:_e,overlayClassName:et="pds2-bg-text-black pds2-bg-opacity-50",setError:tt})=>{const[rt,nt]=reactExports.useState(a),at=useAuthAbhaStore(st=>st.initAbhaFlow);return reactExports.useEffect(()=>{if(a)nt(!0);else{const st=setTimeout(()=>nt(!1),300);return()=>clearTimeout(st)}},[a]),rt?jsxRuntimeExports.jsxs("div",{className:`pds2-absolute pds2-inset-0 pds2-z-50 pds2-flex pds2-items-end pds2-transition-all pds2-duration-300 ${a?"pds2-opacity-100":"pds2-opacity-0 pointer-events-none"}`,children:[jsxRuntimeExports.jsx("div",{className:`pds2-absolute pds2-inset-0 ${et} pds2-transition-opacity pds2-duration-300`,style:{backgroundColor:"rgba(0, 0, 0, 0.5)"},onClick:st=>{if(at){st.stopPropagation();return}tt(null),_(!1),_e(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)}}),jsxRuntimeExports.jsx("div",{className:`pds2-relative pds2-bg-bg-white pds2-rounded-t-24 pds2-w-full pds2-transition-transform pds2-duration-300 ${a?"pds2-translate-y-0":"pds2-translate-y-full"}`,style:{height:"75%",maxHeight:"600px",overflowY:"auto"},children:$})]}):null},formatDateTime=(a,_={date:!0,time:!0})=>{const $=new Date(a);let _e="",et="";return _.time&&(_e=$.toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0})),_.date&&(et=$.toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"})),_.time&&_.date?`${_e}, ${et}`:_.time?_e:_.date?et:""};function ConsentCard(){var _,$,_e,et,tt,rt,nt,at,st;const a=useAuthAbhaStore(it=>it.consentDetails);return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-p-16 pds2-rounded-16 pds2-bg-bg-white pds2-space-y-8",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-space-x-16",children:[jsxRuntimeExports.jsxs("div",{className:"Body2Semibold pds2-text-text-01 pds2-flex-1",children:[(_=a==null?void 0:a.hiu)==null?void 0:_.name,jsxRuntimeExports.jsx("div",{className:"Body2Regular",children:($=a==null?void 0:a.hiu)==null?void 0:$.id})]}),(a==null?void 0:a.status)==ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-brand pds2-bg-bg-brand-03 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$8,{}),"Pending"]}),(a==null?void 0:a.status)==ConsentStatus.GRANTED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-success pds2-bg-bg-success-03 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$1,{}),"Granted"]}),(a==null?void 0:a.status)==ConsentStatus.EXPIRED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-03 pds2-bg-bg-01 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$2,{}),"Expired"]}),(a==null?void 0:a.status)==ConsentStatus.DENIED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-error pds2-bg-bg-error-03 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$2,{}),"Denied"]}),(a==null?void 0:a.status)==ConsentStatus.REVOKED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-error pds2-bg-bg-error-03 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$2,{}),"Revoked"]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Type of Request"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:"consent"})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Purpose of Request"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:(_e=a==null?void 0:a.purpose)==null?void 0:_e.text})]}),((et=a==null?void 0:a.duration)==null?void 0:et.from)&&((tt=a==null?void 0:a.duration)==null?void 0:tt.to)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Duration"}),jsxRuntimeExports.jsxs("div",{className:"Body2Regular pds2-text-text-03",children:[formatDateTime((rt=a==null?void 0:a.duration)==null?void 0:rt.from,{date:!0,time:!1})," - ",formatDateTime((nt=a==null?void 0:a.duration)==null?void 0:nt.to,{date:!0,time:!1})]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Requested by"}),jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-text-03",children:((at=a==null?void 0:a.requester)==null?void 0:at.name)||((st=a==null?void 0:a.hiu)==null?void 0:st.name)})]}),(a==null?void 0:a.created_at)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Requested at"}),jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-text-03",children:formatDateTime(a==null?void 0:a.created_at,{date:!0,time:!0})})]})]})]})}const ConsentHiTypeListCard=()=>{var tt;const a=useAuthAbhaStore(rt=>rt.consentDetails),_=useAuthAbhaStore(rt=>rt.consentApiBody),$=useAuthAbhaStore(rt=>rt.setConsentApiBody),_e=(_==null?void 0:_.hi_types)??[],et=rt=>{const nt=rt.target.id,st=rt.target.checked?[..._e,nt]:_e.filter(it=>it!==nt);$({hi_types:st})};return jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-bg-white pds2-space-y-8",children:jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col ",children:(tt=a==null?void 0:a.hi_types)==null?void 0:tt.map((rt,nt)=>jsxRuntimeExports.jsx("div",{className:`pds2-px-16 pds2-py-16 ${nt<a.hi_types.length-1?"pds2-border-b pds2-border-bg-seperator-dark":""}`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[(a==null?void 0:a.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsx("input",{id:rt.id,type:"checkbox",checked:_e.includes(rt.id),className:"pds2-accent-border-brand-01",onChange:et}),jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:rt.display})]})},rt==null?void 0:rt.id))})})},formatDateToBackendISO=a=>{const _=new Date;return new Date(`${a}T${_.getHours().toString().padStart(2,"0")}:${_.getMinutes().toString().padStart(2,"0")}:${_.getSeconds().toString().padStart(2,"0")}`).toISOString()},ConsentDurationCard=()=>{var nt,at,st,it;const a=reactExports.useRef(null),_=reactExports.useRef(null),$=useAuthAbhaStore(ot=>ot.consentApiBody),_e=useAuthAbhaStore(ot=>ot.setConsentApiBody),et=useAuthAbhaStore(ot=>ot.consentDetails),tt=new Date,rt=(ot,lt)=>{const ht=formatDateToBackendISO(lt);_e({duration:{...$==null?void 0:$.duration,[ot]:ht}})};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-py-6 pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-bg-white pds2-space-y-8",children:[jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-py-6 Body3Regular pds2-text-text-03",children:jsxRuntimeExports.jsxs("div",{className:`${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"":"pds2-flex pds2-items-center pds2-justify-between"} pds2-border-b pds2-border-bg-seperator-dark`,children:[jsxRuntimeExports.jsxs("div",{className:`${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["From",jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:((nt=$==null?void 0:$.duration)==null?void 0:nt.from)&&formatDateTime((at=$==null?void 0:$.duration)==null?void 0:at.from,{date:!0,time:!1})})]}),(et==null?void 0:et.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(n$2,{className:"pds2-text-bg-brand-01 pds2-text-16",onClick:()=>{var ot;return(ot=a.current)==null?void 0:ot.showPicker()}}),jsxRuntimeExports.jsx("input",{className:"pds2-absolute pds2-opacity-0 pds2-pointer-events-none",ref:a,type:"date",max:tt.toISOString().split("T")[0],onChange:ot=>rt("from",ot.target.value)})]})]})}),jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-py-6 Body3Regular pds2-text-text-03",children:jsxRuntimeExports.jsxs("div",{className:`${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"":"pds2-flex pds2-items-center pds2-justify-between"} pds2-border-b pds2-border-bg-seperator-dark`,children:[jsxRuntimeExports.jsxs("div",{className:`${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["To",jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:((st=$==null?void 0:$.duration)==null?void 0:st.to)&&formatDateTime((it=$==null?void 0:$.duration)==null?void 0:it.to,{date:!0,time:!1})})]}),(et==null?void 0:et.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(n$2,{className:"pds2-text-bg-brand-01 pds2-text-16",onClick:()=>{var ot;return(ot=_.current)==null?void 0:ot.showPicker()}}),jsxRuntimeExports.jsx("input",{className:"pds2-absolute pds2-opacity-0 pds2-pointer-events-none",ref:_,type:"date",max:tt.toISOString().split("T")[0],onChange:ot=>rt("to",ot.target.value)})]})]})}),jsxRuntimeExports.jsxs("div",{className:`pds2-px-16 pds2-py-6 Body3Regular pds2-text-text-03 ${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["Expires on",($==null?void 0:$.erase_at)&&jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:formatDateTime($==null?void 0:$.erase_at,{date:!0,time:!0})})]})]})},ConsentHCPCard=()=>{var mt,ct,ft;const a=useAuthAbhaStore(ut=>ut.consentDetails),_=(mt=a==null?void 0:a.providers)==null?void 0:mt.reduce((ut,gt)=>(ut[gt.hip.id]=gt.care_contexts,ut),{}),$=useAuthAbhaStore(ut=>ut.setConsentApiBody),[_e,et]=reactExports.useState(_||{}),[tt,rt]=reactExports.useState([]),nt=()=>{var ut;return(ut=Object==null?void 0:Object.entries(_e??{}))==null?void 0:ut.map(([gt,yt])=>({hip_id:gt,care_contexts:yt}))};reactExports.useEffect(()=>{const ut=nt();$({consent_artefacts:ut})},[_e]);const at=ut=>{rt(gt=>gt.includes(ut)?gt.filter(yt=>yt!==ut):[...gt,ut])},st=ut=>tt.includes(ut),it=(ct=a==null?void 0:a.providers)==null?void 0:ct.every(ut=>_e[ut.hip.id].length===ut.care_contexts.length&&ut.care_contexts.length>0),ot=ut=>{var gt;return((gt=_e[ut.hip.id])==null?void 0:gt.length)===ut.care_contexts.length},lt=(ut,gt)=>{var yt;return(yt=_e[ut])==null?void 0:yt.some(Et=>Et.id===gt)},ht=ut=>{if(ut){const gt=a==null?void 0:a.providers.reduce((yt,Et)=>(yt[Et.hip.id]=Et.care_contexts,yt),{});et(gt||{})}else{const gt=a==null?void 0:a.providers.reduce((yt,Et)=>(yt[Et.hip.id]=[],yt),{});et(gt||{})}},pt=(ut,gt)=>{const yt=ut.hip.id;et(Et=>({...Et,[yt]:gt?ut.care_contexts:[]}))},dt=(ut,gt,yt)=>{et(Et=>{const _t=Et[ut]??[];let St;return yt?St=[..._t,gt]:St=_t.filter(wt=>wt.id!==gt.id),{...Et,[ut]:St}})};return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-gap-10 pds2-px-16 pds2-py-16 pds2-uppercase pds2-border-b pds2-border-bg-seperator-dark",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-border-brand-01",checked:it,onChange:ut=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){ut.preventDefault();return}ht(ut.target.checked)},onClick:ut=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(ut.preventDefault(),ut.stopPropagation())}}),"All"]}),(ft=a==null?void 0:a.providers)==null?void 0:ft.map(ut=>{const gt=ut.hip.id;return jsxRuntimeExports.jsxs("div",{className:"Body3Medium",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between pds2-items-center pds2-cursor-pointer",onClick:()=>at(gt),children:[jsxRuntimeExports.jsxs("div",{className:" pds2-flex pds2-gap-10 pds2-px-16 pds2-py-16 pds2-text-text-03",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-border-brand-01",checked:ot(ut),onChange:yt=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){yt.preventDefault();return}pt(ut,yt.target.checked)},onClick:yt=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(yt.preventDefault(),yt.stopPropagation())}}),ut.hip.name]}),jsxRuntimeExports.jsx("div",{className:"pds2-pr-16",children:st(gt)?jsxRuntimeExports.jsx(e$2,{}):jsxRuntimeExports.jsx(c$3,{})})]}),st(gt)&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-bg-white pds2-space-y-8",children:ut.care_contexts.map((yt,Et)=>jsxRuntimeExports.jsx("div",{className:`pds2-px-24 pds2-py-16 ${Et<ut.care_contexts.length-1?"pds2-border-b pds2-border-bg-seperator-dark":""}`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-border-brand-01",checked:lt(gt,yt.id),onChange:_t=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){_t.preventDefault();return}dt(gt,yt,_t.target.checked)},onClick:_t=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(_t.preventDefault(),_t.stopPropagation())}}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-5 pds2-flex-col",children:[jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-text-01",children:yt.display}),jsxRuntimeExports.jsx("div",{className:"!Body3Regular pds2-text-text-03",children:yt.id})]})]})},yt.id))})]},gt)})]})},AbhaLoadingStatus=()=>jsxRuntimeExports.jsxs("div",{className:"pds2-bg-bg-01 pds2-px-16 pds2-w-full pds2-min-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm5m96sno000d0tg92v2g42tx.webp",alt:"loading",className:"pds2-w-60"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-01 Heading4Semibold pds2-mt-48",children:"Loading"})]}),ConsentDetailsScreen=()=>{const a=useAuthAbhaStore(st=>st.txnId),_=useAuthAbhaStore(st=>st.setScreen),$=useAuthAbhaStore(st=>st.isEkaAppLogin),_e=useAuthAbhaStore(st=>st.clientId),et=useAuthAbhaStore(st=>st.isNewLoginOrCreateFlow),tt=GET_EXTRA_HEADERS(),rt=useAuthAbhaStore(st=>st.consentDetails),nt={REQUESTED:"Consent Request Details",GRANTED:"Granted Consent Details",DENIED:"Consent Denied Details",EXPIRED:"Consent Expired Details",REVOKED:"Consent Revoked Details"};return rt||(({name:st,data:it={}})=>{var ht,pt;const lt={...{login_platform:_e,is_eka_app_login:$?"true":"false",is_new_login_or_create_flow:et?"true":"false",txn_id:a||"missing txnId",oid:tt!=null&&tt["X-User-ID"]?"true":"false",access_token:tt!=null&&tt.auth?"true":"false"},...it};handleSendEvent({eventName:st,eventData:lt}),(pt=(ht=window.curio)==null?void 0:ht.pushToMixpanel)==null||pt.call(ht,st,lt)})({name:"abha_consent_details_screen",data:{page_view:"abha_consent_details_screen",platform:_e,error:"consent details not found"}}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:rt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaHeader,{title:`${rt!=null&&rt.status?nt[rt.status]??"":""}`,className:"pds2-border-b-1 pds2-border-bg-seperator-dark"}),jsxRuntimeExports.jsxs("div",{className:"pds2-p-16 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-bg-01",children:[jsxRuntimeExports.jsx(ConsentCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-text-03",children:"DURATION"}),jsxRuntimeExports.jsx(ConsentDurationCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-text-03",children:"REQUEST INFORMATION TYPE"}),jsxRuntimeExports.jsx(ConsentHiTypeListCard,{}),jsxRuntimeExports.jsxs("div",{className:"Body3Semibold pds2-text-text-03",children:["HEALTH CARE PROVIDERS",jsxRuntimeExports.jsx("br",{}),"Sharing your data for requested information, from following healthcare providers:"]}),jsxRuntimeExports.jsx(ConsentHCPCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-text-03",children:"By granting this consent, you agree to let the Doctors view your health information."})]}),["REQUESTED","GRANTED"].includes(rt.status)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10 pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-bg-white pds2-w-full pds2-border pds2-border-border-brand-02",children:[rt.status==="REQUESTED"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Pds2Button,{title:"Deny",buttonColor:"pds2-bg-bg-red",className:"pds2-w-full",onClick:()=>_(SCREEN_NAMES.CONSENT_DENY)}),jsxRuntimeExports.jsx(Pds2Button,{title:"Grant Access",buttonColor:"pds2-bg-bg-success-02",className:"pds2-w-full",onClick:()=>_(SCREEN_NAMES.CONSENT_APPROVE)})]}),rt.status==="GRANTED"&&jsxRuntimeExports.jsx(Pds2Button,{title:"Revoke Access",buttonColor:"pds2-bg-bg-red",className:"pds2-w-full",onClick:()=>_(SCREEN_NAMES.CONSENT_REVOKE)})]})]}):jsxRuntimeExports.jsx(AbhaLoadingStatus,{})})},v$1="5.9.6",fr$1=30,ip$1=0,op$1=10,w$1=400,h$1=400,nm$1="Композиция 1",ddd$1=0,assets$1=[{id:"comp_0",nm:"closr",fr:30,layers:[{ddd:0,ind:1,ty:4,nm:"Кривые Слой 6",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.111],y:[.313]},o:{x:[.333],y:[0]},t:9,s:[0]},{i:{x:[.666],y:[1]},o:{x:[.157],y:[0]},t:15,s:[100]},{i:{x:[.795],y:[1]},o:{x:[.436],y:[0]},t:50,s:[100]},{t:59,s:[0]}],ix:11},r:{a:1,k:[{i:{x:[.464],y:[1.145]},o:{x:[.333],y:[0]},t:5,s:[134]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:16,s:[0]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:50,s:[0]},{t:59,s:[125]}],ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[43.184,43.184,0],ix:1,l:2},s:{a:1,k:[{i:{x:[0,0,.667],y:[1.194,1.194,1]},o:{x:[.773,.773,.333],y:[0,0,0]},t:7,s:[130,130,100]},{i:{x:[.664,.664,.664],y:[1,1,1]},o:{x:[.157,.157,.157],y:[0,0,0]},t:16,s:[100,100,100]},{i:{x:[.796,.796,.796],y:[1,1,1]},o:{x:[.436,.436,.436],y:[0,0,0]},t:50,s:[100,100,100]},{t:59,s:[30,30,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,38.184],[38.184,-38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,-38.184],[38.184,38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 2",np:3,cix:2,bm:0,ix:2,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Кривые Слой 5",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:3,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[96.25,96.25,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.524,.524,.667],y:[1.264,1.264,1]},o:{x:[.712,.712,.333],y:[0,0,0]},t:-.566,s:[4,4,100]},{i:{x:[.833,.833,.833],y:[1,1,1]},o:{x:[.517,.517,.333],y:[0,0,0]},t:17,s:[100,100,100]},{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[1,1,.167],y:[-.624,-.624,-16.667]},t:49,s:[100,100,100]},{t:61.208984375,s:[0,0,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-53.019],[53.019,0],[0,53.019],[-53.019,0]],o:[[0,53.019],[-53.019,0],[0,-53.019],[53.019,0]],v:[[96,0],[0,96],[-96,0],[0,-96]],c:!0},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[.898595114315,.179309067072,.190338763069,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[96.25,96.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0}]}],layers$1=[{ddd:0,ind:1,ty:0,nm:"closr",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[200,200,0],ix:1,l:2},s:{a:0,k:[154,154,100],ix:6,l:2}},ao:0,w:400,h:400,ip:0,op:311,st:0,bm:0}],markers$1=[],animationDataLoading={v:v$1,fr:fr$1,ip:ip$1,op:op$1,w:w$1,h:h$1,nm:nm$1,ddd:ddd$1,assets:assets$1,layers:layers$1,markers:markers$1},v="5.9.6",fr=30,ip=0,op=50,w=400,h=400,nm="Композиция 1",ddd=0,assets=[{id:"comp_0",nm:"closr",fr:30,layers:[{ddd:0,ind:1,ty:4,nm:"Кривые Слой 6",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.111],y:[.313]},o:{x:[.333],y:[0]},t:9,s:[0]},{i:{x:[.666],y:[1]},o:{x:[.157],y:[0]},t:15,s:[100]},{i:{x:[.795],y:[1]},o:{x:[.436],y:[0]},t:50,s:[100]},{t:59,s:[0]}],ix:11},r:{a:1,k:[{i:{x:[.464],y:[1.145]},o:{x:[.333],y:[0]},t:5,s:[134]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:16,s:[0]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:50,s:[0]},{t:59,s:[125]}],ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[43.184,43.184,0],ix:1,l:2},s:{a:1,k:[{i:{x:[0,0,.667],y:[1.194,1.194,1]},o:{x:[.773,.773,.333],y:[0,0,0]},t:7,s:[130,130,100]},{i:{x:[.664,.664,.664],y:[1,1,1]},o:{x:[.157,.157,.157],y:[0,0,0]},t:16,s:[100,100,100]},{i:{x:[.796,.796,.796],y:[1,1,1]},o:{x:[.436,.436,.436],y:[0,0,0]},t:50,s:[100,100,100]},{t:59,s:[30,30,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,38.184],[38.184,-38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,-38.184],[38.184,38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 2",np:3,cix:2,bm:0,ix:2,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Кривые Слой 5",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:3,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[96.25,96.25,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.524,.524,.667],y:[1.264,1.264,1]},o:{x:[.712,.712,.333],y:[0,0,0]},t:-.566,s:[4,4,100]},{i:{x:[.833,.833,.833],y:[1,1,1]},o:{x:[.517,.517,.333],y:[0,0,0]},t:17,s:[100,100,100]},{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[1,1,.167],y:[-.624,-.624,-16.667]},t:49,s:[100,100,100]},{t:61.208984375,s:[0,0,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-53.019],[53.019,0],[0,53.019],[-53.019,0]],o:[[0,53.019],[-53.019,0],[0,-53.019],[53.019,0]],v:[[96,0],[0,96],[-96,0],[0,-96]],c:!0},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[.898595114315,.179309067072,.190338763069,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[96.25,96.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0}]}],layers=[{ddd:0,ind:1,ty:0,nm:"closr",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[200,200,0],ix:1,l:2},s:{a:0,k:[154,154,100],ix:6,l:2}},ao:0,w:400,h:400,ip:0,op:311,st:0,bm:0}],markers=[],animationData={v,fr,ip,op,w,h,nm,ddd,assets,layers,markers},AbhaRejectionStatus=({loading:a=!1,loadingText:_,rejectText:$})=>jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-w-full pds2-min-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center",style:{backgroundColor:"#F2F2F2"},children:a?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData:animationDataLoading,loop:!0,className:"pds2-w-200"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-01 Heading4Semibold pds2-absolute pds2-mt-220",children:_})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData,loop:!1,className:"pds2-w-200"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-01 Heading4Semibold pds2-absolute pds2-mt-220",children:$})]})}),AbhaConsentDenyScreen=()=>{const[a,_]=reactExports.useState(!0),$=useAuthAbhaStore(ht=>ht.clientId),_e=useAuthAbhaStore(ht=>ht.isEkaAppLogin),et=useAuthAbhaStore(ht=>ht.txnId),tt=useAuthAbhaStore(ht=>ht.isNewLoginOrCreateFlow),rt=GET_EXTRA_HEADERS(),nt=useAuthAbhaStore(ht=>ht.abhaRequestConsentId),at=useAuthAbhaStore(ht=>ht.goBackLoginScreen),st=useAuthAbhaStore(ht=>ht.setBottomsheetErrorInfo),it=({name:ht,data:pt={}})=>{var ct,ft;const mt={...{login_platform:$,is_eka_app_login:_e?"true":"false",is_new_login_or_create_flow:tt?"true":"false",txn_id:et||"missing txnId",oid:rt!=null&&rt["X-User-ID"]?"true":"false",access_token:rt!=null&&rt.auth?"true":"false"},...pt};handleSendEvent({eventName:ht,eventData:mt}),(ft=(ct=window.curio)==null?void 0:ct.pushToMixpanel)==null||ft.call(ct,ht,mt)},ot=()=>{it({name:"abha_consent_revoke_error_bottomsheet_dismissed",data:{platform:$}}),st(null),at(),setIndividualEnv({extraHeaders:{auth:""}})},lt=async()=>{if(!nt){it({name:"abha_consent_deny_screen",data:{page_view:"abha_consent_request_page",platform:$,data:{error_msg:"No consent ID found"}}}),console.error("No consent ID found");return}it({name:"abha_consent_revoke_triggered",data:{flow_step_type:"init",clientId:$}});const ht=await postAbdmConsentDeny({consentId:nt});if("success"in ht){console.log("Success"),_(!1),setTimeout(()=>{onConsentSuccess("Consent deny success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),it({name:"abha_consent_deny_success",data:{flow_step_type:"init",clientId:$}});return}const{code:pt,error:dt,source_error:mt}=ht;st({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),it({name:"abha_consent_revoke_failed",data:{flow_step_type:"init",clientId:$,error_code:pt,error_msg:dt,source_error:mt}})};return reactExports.useEffect(()=>{lt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaRejectionStatus,{loading:a,loadingText:"Denying...",rejectText:"Consent Denied Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:ot})]})},AbhaConsentRevokeScreen=()=>{const[a,_]=reactExports.useState(!0),$=useAuthAbhaStore(ht=>ht.clientId),_e=useAuthAbhaStore(ht=>ht.isEkaAppLogin),et=useAuthAbhaStore(ht=>ht.txnId),tt=useAuthAbhaStore(ht=>ht.isNewLoginOrCreateFlow),rt=useAuthAbhaStore(ht=>ht.setBottomsheetErrorInfo),nt=GET_EXTRA_HEADERS(),at=useAuthAbhaStore(ht=>ht.goBackLoginScreen),st=useAuthAbhaStore(ht=>ht.consentApiBody),it=({name:ht,data:pt={}})=>{var ct,ft;const mt={...{login_platform:$,is_eka_app_login:_e?"true":"false",is_new_login_or_create_flow:tt?"true":"false",txn_id:et||"missing txnId",oid:nt!=null&&nt["X-User-ID"]?"true":"false",access_token:nt!=null&&nt.auth?"true":"false"},...pt};handleSendEvent({eventName:ht,eventData:mt}),(ft=(ct=window.curio)==null?void 0:ct.pushToMixpanel)==null||ft.call(ct,ht,mt)},ot=()=>{it({name:"abha_consent_revoke_error_bottomsheet_dismissed",data:{platform:$}}),rt(null),at(),setIndividualEnv({extraHeaders:{auth:""}})},lt=async()=>{if(!(st!=null&&st.consent_artefacts_id)){it({name:"abha_consent_revoke_screen",data:{page_view:"abha_consent_request_page",platform:$,data:{error_msg:"No consent artefacts ids found"}}}),console.error("No consent artefacts ids found");return}const ht=await postAbdmConsentRevoke({consent_artefacts_ids:st==null?void 0:st.consent_artefacts_id});if("success"in ht){console.log("Success"),_(!1),setTimeout(()=>{onConsentSuccess("Consent revoke success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),it({name:"abha_consent_revoke_success",data:{flow_step_type:"init",clientId:$}});return}const{code:pt,error:dt,source_error:mt}=ht;rt({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),it({name:"abha_consent_revoke_failed",data:{flow_step_type:"init",clientId:$,error_code:pt,error_msg:dt,source_error:mt}})};return reactExports.useEffect(()=>{lt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaRejectionStatus,{loading:a,loadingText:"Revoke in progress...",rejectText:"Consent Revoked Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:ot})]})},AbhaConsentApproveScreen=()=>{const[a,_]=reactExports.useState(!0),$=useAuthAbhaStore(ht=>ht.clientId),_e=useAuthAbhaStore(ht=>ht.isEkaAppLogin),et=useAuthAbhaStore(ht=>ht.txnId),tt=useAuthAbhaStore(ht=>ht.isNewLoginOrCreateFlow),rt=GET_EXTRA_HEADERS(),nt=useAuthAbhaStore(ht=>ht.consentApiBody),at=useAuthAbhaStore(ht=>ht.goBackLoginScreen),st=useAuthAbhaStore(ht=>ht.setBottomsheetErrorInfo),it=({name:ht,data:pt={}})=>{var ct,ft;const mt={...{login_platform:$,is_eka_app_login:_e?"true":"false",is_new_login_or_create_flow:tt?"true":"false",txn_id:et||"missing txnId",oid:rt!=null&&rt["X-User-ID"]?"true":"false",access_token:rt!=null&&rt.auth?"true":"false"},...pt};handleSendEvent({eventName:ht,eventData:mt}),(ft=(ct=window.curio)==null?void 0:ct.pushToMixpanel)==null||ft.call(ct,ht,mt)},ot=()=>{it({name:"abha_consent_approve_error_bottomsheet_dismissed",data:{platform:$}}),st(null),at(),setIndividualEnv({extraHeaders:{auth:""}})},lt=async()=>{if(!nt){it({name:"abha_consent_approve_screen",data:{page_view:"abha_consent_request_page",platform:$,data:{error_msg:"No consent details found"}}}),console.error("No consent details found");return}const{consent_artefacts_id:ht,...pt}=nt,dt=await postAbdmConsentApprove({consentApprovePayload:pt});if("success"in dt){console.log("Success"),_(!1),setTimeout(()=>{onConsentSuccess("Consent grant success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),it({name:"abha_consent_grant_success",data:{flow_step_type:"init",clientId:$}});return}const{code:mt,error:ct,source_error:ft}=dt;st({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),it({name:"abha_consent_grant_failed",data:{flow_step_type:"init",clientId:$,error_code:mt,error_msg:ct,source_error:ft}})};return reactExports.useEffect(()=>{lt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:a,loadingText:"Grant in progress...",successText:"Consent Granted Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:ot})]})};function SelfAssessmentSDKIframe({src:a,mountConfig:_,iframeId:$="sa-sdk-iframe"}){const _e=reactExports.useRef(null),et=reactExports.useRef(null);return reactExports.useEffect(()=>{var it;const tt=_e.current;if(!tt)return;et.current&&(et.current.remove(),et.current=null);const rt=document.createElement("iframe");et.current=rt,rt.id=$,rt.style.width="100%",rt.style.height="100%",rt.style.border="0",tt.appendChild(rt);const nt=(it=rt.contentWindow)==null?void 0:it.document;if(!nt)return;const at=`
150
+ ${_e?"pds2-text-bg-brand-01":"pds2-text-text-03"}`,children:"No OTP needed"})]}),handleReadOTP=()=>{var a;(a=window==null?void 0:window.Eka)!=null&&a.requestAutoReadOTP&&window.Eka.requestAutoReadOTP()},LoginorCreateAbhaScreen=()=>{const a=useAuthAbhaStore(_e=>_e.clientId);reactExports.useEffect(()=>{var _e;if((_e=window.EkaAbha)!=null&&_e.changeStatusBarColor)return window.EkaAbha.changeStatusBarColor("#F2F4F7"),()=>{var et,tt;(et=window.EkaAbha)!=null&&et.changeStatusBarColor&&((tt=window==null?void 0:window.EkaAbha)==null||tt.changeStatusBarColor("#FFFFFF"))}},[]);const _=()=>{var _e;(_e=window.EkaAbha)==null||_e.onAbhaClose(),unMount()},$=["eka-web","phr","www-eka"];return jsxRuntimeExports.jsxs("div",{className:"pds2-h-full pds2-overflow-y-auto",children:[!$.includes(a)&&jsxRuntimeExports.jsx(Pds2Header,{prefixIcon:jsxRuntimeExports.jsx("button",{onClick:_,children:jsxRuntimeExports.jsx(n$4,{})}),title:"",className:"pds2-bg-bg-01"}),jsxRuntimeExports.jsx(LoginOrCreateWithDifferentMethods,{})]})},LoginOrCreateWithDifferentMethods=()=>{const a=useAuthAbhaStore(nr=>nr.abhaAuthFlowMethod||ABHA_AUTH_FLOW_METHOD.MOBILE),_=useAuthAbhaStore(nr=>nr.setAbhaAuthFlowMethod),$=useAuthAbhaStore(nr=>nr.goBackToLogin),_e=useAuthAbhaStore(nr=>nr.setGoBackToLogin),et=useAuthAbhaStore(nr=>nr.setIdentifierValue),tt=useAuthAbhaStore(nr=>nr.identifierValue),rt=useAuthAbhaStore(nr=>nr.isEkaAppLogin),nt=useAuthAbhaStore(nr=>nr.setSelectedAbhaAddress),at=useAuthAbhaStore(nr=>nr.setLoginIdentifierValue),st=useAuthAbhaStore(nr=>nr.setRegistrationType),it=useAuthAbhaStore(nr=>nr.setAadhaarInitResponse),ot=useAuthAbhaStore(nr=>nr.setAadhaarFaceAuthInitResponse),lt=useAuthAbhaStore(nr=>nr.setMobileInitResponse),ht=useAuthAbhaStore(nr=>nr.initAbhaAppMobileNumber),pt=useAuthAbhaStore(nr=>nr.initAbhaAppIdentifierType),dt=useAuthAbhaStore(nr=>nr.initAbhaAppIdentifier),mt=useAuthAbhaStore(nr=>nr.setInitAbhaAppIdentifier),ct=useAuthAbhaStore(nr=>nr.setInitAbhaAppIdentifierType),ft=useAuthAbhaStore(nr=>nr.isDocAppRequest),ut=useAuthAbhaStore(nr=>nr.faceAuthEnable),gt=useAuthAbhaStore(nr=>nr.isNewLoginOrCreateFlow),yt=useAuthAbhaStore(nr=>nr.setIsNewLoginOrCreateFlow),Et=useAuthAbhaStore(nr=>nr.clientId),_t=useAuthAbhaStore(nr=>nr.isInitApiTriggered),St=useAuthAbhaStore(nr=>nr.setIsInitApiTriggered),wt=useAuthAbhaStore(nr=>nr.setIdentityValue);useAuthAbhaStore(nr=>nr.identityValue);const Pt=useAuthAbhaStore(nr=>nr.setSelectedAbhaFlow),Nt=useAuthAbhaStore(nr=>nr.txnId),Mt=useAuthAbhaStore(nr=>nr.initAbhaFlow),Dt=useAuthAbhaStore(nr=>nr.selectedAadhaarAuth),Rt=useAuthAbhaStore(nr=>nr.setSelectedAadhaarAuth),[kt,xt]=reactExports.useState(LOADING_STATE.IDLE),[bt,vt]=reactExports.useState(""),At=useAuthAbhaStore(nr=>nr.setScreen),[Ct,Tt]=reactExports.useState({aadhaar:LOADING_STATE.IDLE,mobile:LOADING_STATE.IDLE}),[Ot,$t]=reactExports.useState($?tt.mobile:""),[It,jt]=reactExports.useState(!1),[Ht,Lt]=reactExports.useState(!1),[Vt,Yt]=reactExports.useState(tt.aadhaar_number||""),[Wt,Ut]=reactExports.useState(tt.abha_number||""),[Bt,zt]=reactExports.useState(""),[Gt,Qt]=reactExports.useState(tt.phr_address||""),rr=reactExports.useRef(!1),Zt=GET_EXTRA_HEADERS(),vr=(Zt==null?void 0:Zt["X-User-ID"])??void 0;reactExports.useEffect(()=>{Jt({name:"abha_login_or_create_screen",data:{flow:a.toString()}}),handleReadOTP()});const ar=async nr=>{var dr;try{xt(LOADING_STATE.LOADING);const kr=await postAbdmProfileSearch({mobile:nr});if(((dr=kr==null?void 0:kr.profiles)==null?void 0:dr.length)>0&&dt)$t(dt);else{xt(LOADING_STATE.REJECTED),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),vt(`KYC ABHA not found for ${dt}. Please register with Aadhaar.`);return}}catch(kr){console.error("Error searching ABDM profile:",kr),xt(LOADING_STATE.REJECTED),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)}};reactExports.useEffect(()=>{dt&&pt===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!$?(zt(dt),Qt(dt.split("@")[0]),et({phr_address:dt.split("@")[0]}),gr(!0),$r(!0),_(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS)):dt&&pt===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!$?(et({abha_number:dt}),Ut(dt),gr(!0),wr(!0),_(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER)):dt&&pt===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!$?(Yt(dt),Lt(!0),et({aadhaar_number:dt}),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)):dt&&pt===ABHA_AUTH_FLOW_METHOD.MOBILE&&!$&&(_(ABHA_AUTH_FLOW_METHOD.MOBILE),ar(dt),jt(dt.length===10),et({mobile:dt}),vt(null))},[pt,dt]),reactExports.useEffect(()=>{_t||rr.current||Ot&&Ot.length===10&&a==ABHA_AUTH_FLOW_METHOD.MOBILE&&(mr("auto_submit_mobile"),St(!0),rr.current=!0)},[Ot]),reactExports.useEffect(()=>{_t||rr.current||Vt&&Vt.length===12&&a==ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!ut&&(St(!0),rr.current=!0,mr("auto_submit_aadhaar"))},[Vt]),reactExports.useEffect(()=>{_t||rr.current||Wt&&Wt.length===17&&a==ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&(St(!0),rr.current=!0,mr("auto_submit_abha"))},[Wt]),reactExports.useEffect(()=>{_t||rr.current||Bt&&Bt.includes("@sbx")&&a==ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&(St(!0),rr.current=!0,mr("auto_submit_phr"))},[Bt]);const Jt=({name:nr,data:dr={}})=>{var Pr,en;const jr={...{login_platform:Et,is_eka_app_login:rt?"true":"false",is_new_login_or_create_flow:gt?"true":"false",oid:Zt!=null&&Zt["X-User-ID"]?"true":"false",access_token:Zt!=null&&Zt.auth?"true":"false",txn_id:Nt||"missing txnId",flow:a??""},...dr};handleSendEvent({eventName:nr,eventData:jr}),(en=(Pr=window.curio)==null?void 0:Pr.pushToMixpanel)==null||en.call(Pr,nr,jr)},Kt=React.useMemo(()=>{switch(a){case ABHA_AUTH_FLOW_METHOD.MOBILE:return"Enter your Mobile Number";case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return"Enter your Aadhaar Number";default:return""}},[a]),Xt=nr=>{ct(""),vt("");const dr=nr.target.value;switch(a){case ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS:if(dr.length>20)return;Qt(dr),et({phr_address:dr}),mt(null);break;case ABHA_AUTH_FLOW_METHOD.MOBILE:if(dr&&!/^[0-9]+$/.test(dr)||dr.length>10)return;$t(dr),jt(!0),et({mobile:dr}),mt(null);break;case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:if(!/^[\d-]*$/.test(dr)||dr.length>17)return;const kr=nr.target.value.replace(/-/g,"");let jr="";return kr.length>0&&(jr+=kr.slice(0,2)),kr.length>2&&(jr+=`-${kr.slice(2,6)}`),kr.length>6&&(jr+=`-${kr.slice(6,10)}`),kr.length>10&&(jr+=`-${kr.slice(10,14)}`),Ut(jr),mt(null),et({abha_number:jr.trim()});case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:if(dr&&!/^[0-9]+$/.test(dr)||dr.length>12)return;Yt(dr),Lt(!0),mt(null),et({aadhaar_number:dr});break}};ABHA_AUTH_FLOW_METHOD.MOBILE;const ir=React.useMemo(()=>{switch(a){case ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS:return tt.phr_address.length>=4&&tt.phr_address.length<=20;case ABHA_AUTH_FLOW_METHOD.MOBILE:return tt.mobile.length===10;case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:return tt.abha_number.length===17;case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return tt.aadhaar_number.length===12&&Dt!=AADHAAR_AUTH_STATES.NONE}},[a,tt,Dt]),qt=(nr,dr)=>{Tt(kr=>({...kr,[nr]:dr}))},er=({inputVal:nr})=>{nr.length===12&&(et({aadhaar_number:nr}),Yt(nr),Lt(!0))};reactExports.useEffect(()=>{console.log("selectedMethod changed:==================>",a)},[a]);const mr=async nr=>{var jr,Pr,en,Xr;yt(!0),Jt({name:"abha_login_next_click",data:{flow_step_type:nr}}),xt(LOADING_STATE.LOADING),st(REGISTRATION_TYPE.LOGIN);let dr="";if(!rt){const ur=await postAuthLogoutV2();Jt({name:ur?"abha_logout_success":"abha_logout_failure",data:{platform:Et}});const{txn_id:Mr,error:yr}=await postAuthInitV2({method:AUTH_METHOD.ABHA});if(!Mr||yr){Jt({name:"abha_auth_init_failure",data:{flow_step_type:"init",authTxnId:dr,error_message:yr||"missing_txnId_or_unknown_error",error_message_exists:!!yr,txn_id_exists:!!Mr}}),vt((yr==null?void 0:yr.message)||"Something went wrong. Please try again."),xt(LOADING_STATE.REJECTED);return}dr=Mr,Jt({name:"abha_auth_init_success.",data:{flow_step_type:"init",auth_txnId:dr}})}const kr=a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS?`${tt.phr_address}@sbx`:a===ABHA_AUTH_FLOW_METHOD.MOBILE?tt.mobile:a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?tt.abha_number:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?tt.aadhaar_number:"";if(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER||a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS){const{txn_id:ur,error:Mr,action:yr,hint:Er}=await postAbdmLoginInit({method:a,identifier:kr});if(St(!0),wt(kr),Jt({name:"abha_login_init_triggered",data:{flow_step_type:"init",authTxnId:dr,ndhmTxnId:ur,method:a}}),a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&nt(kr),Mr||!ur){if(_e(!0),((jr=yr==null?void 0:yr.cta)==null?void 0:jr.pid)==="abha_mobile_enroll"&&a===ABHA_AUTH_FLOW_METHOD.MOBILE){qt("mobile",LOADING_STATE.LOADING),st(REGISTRATION_TYPE.CREATE);const{txn_id:Hr,hint:dn,error:Or,action:Jr}=await postRegisterMobileInit({mobile_number:tt.mobile});if(St(!0),wt(tt.mobile),Pt("mobile"),Hr&&dn){lt({authTxnId:dr,txnId:Hr,mobileOtpSentToHint:dn}),Jt({name:"abha_mobile_registration_init_success",data:{flow_step_type:"init",authTxnId:dr,ndhmTxnId:ur,error_message:Or,error_action:yr}}),qt("mobile",LOADING_STATE.RESOLVED),xt(LOADING_STATE.RESOLVED),st(REGISTRATION_TYPE.CREATE),At(SCREEN_NAMES.ABHA_PHONE_NUMBER_VERIFICATION);return}if(qt("mobile",LOADING_STATE.REJECTED),Jt({name:"abha_mobile_registration_init_failure",data:{flow_step_type:"init",authTxnId:dr,error_message:Or||"unknown_error",error_message_exists:!!Or,error_action_exists:!!Jr}}),Jr){if((Pr=Jr==null?void 0:Jr.cta)!=null&&Pr.pid)return At(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA)}else vt(Or||"Something went wrong");vt(Or||"Something went wrong. Please try again."),xt(LOADING_STATE.REJECTED);return}Jt({name:"abha_login_init_failure",data:{flow_step_type:"init",authTxnId:dr,error_message:Mr||"unknown_error",error_message_exists:!!Mr,error_action_exists:!!yr}}),vt(Mr||"Something went wrong. Please try again."),xt(LOADING_STATE.REJECTED);return}Jt({name:"abha_login_init_success",data:{flow_step_type:"init",authTxnId:dr,ndhmTxnId:ur,hint:Er}}),it({authTxnId:dr,txnId:ur,aadhaarOtpSentToHint:Er||null}),_e(!1),at(kr),xt(LOADING_STATE.RESOLVED),At(SCREEN_NAMES.VERIFY_OTP_LOGIN_WITH_ABHA);return}if(a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&Dt===AADHAAR_AUTH_STATES.OTP){qt("aadhaar",LOADING_STATE.LOADING),Jt({name:"aadhaar_registration_init_start",data:{flow_step_type:"init",authTxnId:dr,aadhaarNumber:tt.aadhaar_number}});const{txn_id:ur,hint:Mr,error:yr,action:Er}=await postRegisterAadhaarInit({aadhaar_number:tt.aadhaar_number});if(wt(tt.aadhaar_number),Pt("aadhaar"),ur&&Mr){it({authTxnId:dr,txnId:ur,aadhaarOtpSentToHint:Mr}),Jt({name:"aadhaar_registration_init_success",data:{flow_step_type:"verify",ndhmTxnId:ur,authTxnId:dr}}),_e(!1),qt("aadhaar",LOADING_STATE.RESOLVED),st(REGISTRATION_TYPE.CREATE),xt(LOADING_STATE.RESOLVED),At(SCREEN_NAMES.ABHA_OTP_AND_MOBILE);return}if(Jt({name:"abha_registration_init_failure",data:{error_message:yr||"unknown_error",error_message_exists:!!yr,auth_txn_id:dr,error_action:Er,error_action_exists:!!Er}}),qt("aadhaar",LOADING_STATE.REJECTED),xt(LOADING_STATE.REJECTED),Er||yr){_e(!0),(en=Er==null?void 0:Er.cta)!=null&&en.pid?At(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):vt(yr||"Something went wrong");return}}if(a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&Dt===AADHAAR_AUTH_STATES.FACE_AUTH){qt("aadhaar",LOADING_STATE.LOADING),Jt({name:"aadhaar_registration_faceauth_init_start",data:{flow_step_type:"init",authTxnId:dr,aadhaarNumber:tt.aadhaar_number}});const{url:ur,txn_id:Mr,hint:yr,error:Er,action:Hr}=await postRegisterAadhaarFaceAuthInit();if(wt(tt.aadhaar_number),Pt("aadhaar"),Mr&&yr&&ur){ot({authTxnId:dr,txnId:Mr,aadhaarFaceAuthOtpSentToHint:yr,faceAuthQrUrl:ur}),Jt({name:"aadhaar_registration_faceauth_init_success",data:{flow_step_type:"verify",ndhmTxnId:Mr,authTxnId:dr}}),_e(!1),qt("aadhaar",LOADING_STATE.RESOLVED),st(REGISTRATION_TYPE.CREATE),xt(LOADING_STATE.RESOLVED),At(SCREEN_NAMES.ABHA_AUTH_QR_SCREEN);return}if(Jt({name:"abha_registration_faceauth_init_failure",data:{error_message:Er||"unknown_error",error_message_exists:!!Er,auth_txn_id:dr,error_action:Hr,error_action_exists:!!Hr}}),qt("aadhaar",LOADING_STATE.REJECTED),xt(LOADING_STATE.REJECTED),Hr||Er){_e(!0),(Xr=Hr==null?void 0:Hr.cta)!=null&&Xr.pid?At(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):vt(Er||"Something went wrong");return}}},[pr,gr]=reactExports.useState(!1),[Dr,wr]=reactExports.useState($&&a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),[Vr,$r]=reactExports.useState($&&a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs("div",{className:`pds2-p-16 pds2-bg-bg-01 pds2-space-y-16 pds2-text-center pds2-rounded-b-24 ${ft?"pds2-pt-0 -pds2-mt-20":"pds2-pt-22"}`,children:[Mt?jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-bg-01"}):jsxRuntimeExports.jsx(AbhaStepper,{}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-items-center pds2-gap-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-bg-bg-white pds2-rounded-16",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-64 pds2-h-64"})})}),jsxRuntimeExports.jsx("div",{className:"Heading3Semibold pds2-text-text-black",children:Et==="phr"?"Login or Create your ABHA":ft?"Add Patient via ABHA":"Create your ABHA"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-03",style:{marginTop:"4px"},children:a===ABHA_AUTH_FLOW_METHOD.MOBILE?ft?"Enter Patient's Mobile Number":"Enter your Mobile Number":a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?ft?"Enter Patient's Aadhaar Number":"Enter your Aadhaar Number":a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?ft?"Enter Patient's ABHA Number":"Enter your ABHA Number":a===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS?ft?"Enter Patient's ABHA Address":"Enter your ABHA Address":Kt}),(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsxs("div",{className:"pds2-w-full",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-1/2 pds2-relative",children:jsxRuntimeExports.jsx("div",{className:"Label2Medium pds2-w-fit pds2-px-8 pds2-py-2 pds2-bg-bg-green-100 pds2-text-text-success pds2-mx-auto pds2-border pds2-border-border-neutral pds2-border-b-none pds2-rounded-t-6",children:"Recommended"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative pds2-flex pds2-bg-bg-seperator-dark pds2-rounded-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-top-0 pds2-bottom-0 pds2-bg-bg-white pds2-rounded-12 pds2-transition-all pds2-duration-300",style:{left:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?0:"50%",width:"50%",boxShadow:"0px 10px 4px -6px #18274B17"}}),jsxRuntimeExports.jsxs("button",{onClick:()=>{_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),vt("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm5mcdm3h00070tfs9fjkepff.webp",alt:"aadhaar-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?{fontWeight:700}:{fontWeight:400},children:"Aadhaar"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{_(ABHA_AUTH_FLOW_METHOD.MOBILE),vt("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx(n$3,{className:"pds2-w-14 pds2-h-14 pds2-text-icon-success-02"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${a===ABHA_AUTH_FLOW_METHOD.MOBILE?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:a===ABHA_AUTH_FLOW_METHOD.MOBILE?{fontWeight:700}:{fontWeight:400},children:"Mobile"})]})]})]}),(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx("div",{className:"pds2-mt-16 pds2-w-full pds2-max-w-md pds2-mx-auto pds2-px-4 pds2-relative",children:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaInputComponent,{initialValues:pt===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!$?(dt==null?void 0:dt.match(/.{1,4}/g))??void 0:(Vt==null?void 0:Vt.match(/.{1,4}/g))??void 0,disabled:!$&&pt===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!!dt,numberOfInputs:3,length:4,placeholder:"XXXX",onSubmit:er,setIsValid:Lt,setValue:Yt,setError:vt}),ut&&jsxRuntimeExports.jsxs("div",{className:"pds2-mt-20",children:[jsxRuntimeExports.jsx("hr",{className:"pds2-text-bg-04 pds2-border-t-2 pds2-border-bg-04 pds2-w-4/5 pds2-mx-auto"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-py-12 pds2-text-text-03 ",children:"Authenticate using"}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-evenly pds2-w-11/12 pds2-mx-auto",children:[jsxRuntimeExports.jsx(AuthLoginCard,{icon:otpSvg,selectIcon:selectOtpSvg,text:"OTP",otpReq:!1,isSelected:Dt===AADHAAR_AUTH_STATES.OTP,onClick:()=>Rt(AADHAAR_AUTH_STATES.OTP)}),jsxRuntimeExports.jsx(AuthLoginCard,{icon:faceAuth,selectIcon:selectFaceAuth,text:"Face Auth",otpReq:!0,isSelected:Dt===AADHAAR_AUTH_STATES.FACE_AUTH,onClick:()=>Rt(AADHAAR_AUTH_STATES.FACE_AUTH)})]})]})]}):jsxRuntimeExports.jsx(Pds2InputField,{value:pt===ABHA_AUTH_FLOW_METHOD.MOBILE&&!$?dt||"":Ot,disabled:!$&&pt===ABHA_AUTH_FLOW_METHOD.MOBILE||!!dt&&!!vr,onChange:Xt,type:"text",autoComplete:"tel-national",pattern:"[0-9]*",placeholder:"Mobile Number",inputMode:"numeric",autoFocus:!0,maxLength:10,PrefixComponent:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-x-8 pds2-border-r pds2-border-border-brand-02 pds2-pr-24",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4mlct2900000tg98p8u967s.webp",alt:"indian-flag-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:"pds2-text-text-black pds2-text-sm",children:"+91"})]})})}),bt&&(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx("div",{className:`${bt.includes("KYC ABHA not found for")?"pds2-text-text-01":"pds2-text-text-error"} Body3Regular`,children:bt}),(a===ABHA_AUTH_FLOW_METHOD.MOBILE||a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)&&jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!ir||kt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:kt===LOADING_STATE.LOADING,onClick:()=>mr("aadhaar_or_mobile_on_click"),className:"pds2-w-full"})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-m-16 pds2-bg-bg-white pds2-rounded-16 pds2-border pds2-border-border-03 pds2-overflow-hidden",children:[jsxRuntimeExports.jsxs("button",{onClick:()=>gr(!pr),className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-16 pds2-bg-bg-white hover:pds2-bg-bg-02 pds2-transition-colors",children:[jsxRuntimeExports.jsx("span",{className:"pds2-text-text-03",children:ft?"Other add options for ABHA":"Other login options for ABHA"}),jsxRuntimeExports.jsx(c$3,{className:`pds2-w-16 pds2-h-16 pds2-text-text-03 pds2-transition-transform ${pr?"pds2-rotate-180":""}`})]}),jsxRuntimeExports.jsxs("div",{className:`pds2-overflow-hidden pds2-transition-all pds2-duration-300 ${pr?"pds2-max-h-126 pds2-opacity-100":"pds2-max-h-0 pds2-opacity-0"}`,children:[jsxRuntimeExports.jsxs("button",{onClick:()=>{gr(!1),_(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),wr(!0),vt("")},className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-12 hover:pds2-bg-bg-02 pds2-transition-colors",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-40 pds2-h-40 pds2-rounded-full pds2-bg-bg-02 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-24 pds2-h-24"})}),jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-text-text-black",children:ft?"Add patient with ABHA Number":"Login with ABHA Number"})]}),jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-text-text-03"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{gr(!1),_(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS),$r(!0),vt("")},className:"pds2-w-full pds2-flex pds2-items-center pds2-justify-between pds2-p-12 hover:pds2-bg-bg-02 pds2-transition-colors",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-gap-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-w-40 pds2-h-40 pds2-rounded-full pds2-bg-bg-02 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"ABHA",className:"pds2-w-24 pds2-h-24"})}),jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-text-text-black",children:ft?"Add patient with ABHA Address":"Login with ABHA Address"})]}),jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-text-text-03"})]})]})]}),jsxRuntimeExports.jsx(AbhaBottomSheet,{isOpen:Dr,setIsOpen:wr,setFlowMethod:_,setError:vt,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{vt(null),wr(!1),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-text-03 hover:pds2-text-text-black",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-mb-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-w-64 pds2-h-64 pds2-rounded-full pds2-bg-bg-01 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-48 pds2-h-48"})})}),jsxRuntimeExports.jsx("h2",{className:"Heading3Semibold pds2-text-text-black",children:ft?"Add Patient with ABHA Number":"Login with ABHA Number"}),jsxRuntimeExports.jsx("p",{className:"Body2Regular pds2-text-text-03 pds2-mb-24",children:ft?"Enter Patient's 14 digit ABHA Number":"Enter your 14 digit ABHA Number"}),jsxRuntimeExports.jsx(Pds2InputField,{value:pt===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!$?dt||"":Wt,disabled:!$&&pt===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!!dt,onChange:Xt,placeholder:"00-0000-0000-0000",padding:"pds2-p-18",textStyle:"Body2Regular pds2-text-center pds2-text-lg",borderStyle:"focus-within:pds2-border-border-brand-01",type:"tel",inputMode:"numeric",autoFocus:!0,onKeyDown:nr=>{nr.key==="Enter"&&mr("after_enter_abha_number_on_click_by_user")}}),bt&&jsxRuntimeExports.jsx("div",{className:"pds2-text-text-error Body3Regular pds2-mt-12",children:bt}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!tt||kt===LOADING_STATE.LOADING?"disabled":"enabled",onClick:()=>mr("after_enter_abha_number_on_click_by_user"),className:`pds2-w-full ${bt?"pds2-mt-12":"pds2-mt-24"}`,isLoading:kt===LOADING_STATE.LOADING})]})]})}),jsxRuntimeExports.jsx(AbhaBottomSheet,{isOpen:Vr,setIsOpen:$r,setFlowMethod:_,setError:vt,children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-24 pds2-text-center pds2-h-full pds2-flex pds2-flex-col",children:[!Mt&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-end pds2-mb-16",children:jsxRuntimeExports.jsx("button",{onClick:()=>{vt(null),$r(!1),_(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)},className:"pds2-w-24 pds2-h-24 pds2-flex pds2-items-center pds2-justify-center pds2-text-text-03 hover:pds2-text-text-black",children:"✕"})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex-1 pds2-flex pds2-flex-col pds2-justify-start",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-mb-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-w-64 pds2-h-64 pds2-rounded-full pds2-bg-bg-01 pds2-flex pds2-items-center pds2-justify-center",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-48 pds2-h-48"})})}),jsxRuntimeExports.jsx("h2",{className:"Heading3Semibold pds2-text-text-black",children:ft?"Add Patient with ABHA Address":"Login with ABHA Address"}),jsxRuntimeExports.jsx("p",{className:"Body2Regular pds2-text-text-03 pds2-mb-24",children:ft?"Enter Patient's ABHA Address below":"Enter your ABHA Address below"}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative",children:[jsxRuntimeExports.jsx(Pds2InputField,{value:pt===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!$?(dt==null?void 0:dt.split("@")[0])||"":Gt,disabled:!$&&pt===ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS&&!!dt,onChange:Xt,placeholder:"Enter ABHA Address",inputMode:"text",autoFocus:!0,onKeyDown:nr=>{nr.key==="Enter"&&mr("after_enter_abha_address_on_click_by_user")}}),jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-right-16 pds2-top-16 Body1Regular pds2-text-text-03",children:"@sbx"})]}),bt&&jsxRuntimeExports.jsx("div",{className:"pds2-text-text-error Body3Regular pds2-mt-12",children:bt}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!tt||kt===LOADING_STATE.LOADING?"disabled":"enabled",onClick:()=>mr("after_enter_abha_address_on_click_by_user"),className:`pds2-w-full ${bt?"pds2-mt-12":"pds2-mt-24"}`,isLoading:kt===LOADING_STATE.LOADING})]})]})})]})},AbhaBottomSheet=({isOpen:a,setIsOpen:_,children:$,setFlowMethod:_e,overlayClassName:et="pds2-bg-text-black pds2-bg-opacity-50",setError:tt})=>{const[rt,nt]=reactExports.useState(a),at=useAuthAbhaStore(st=>st.initAbhaFlow);return reactExports.useEffect(()=>{if(a)nt(!0);else{const st=setTimeout(()=>nt(!1),300);return()=>clearTimeout(st)}},[a]),rt?jsxRuntimeExports.jsxs("div",{className:`pds2-absolute pds2-inset-0 pds2-z-50 pds2-flex pds2-items-end pds2-transition-all pds2-duration-300 ${a?"pds2-opacity-100":"pds2-opacity-0 pointer-events-none"}`,children:[jsxRuntimeExports.jsx("div",{className:`pds2-absolute pds2-inset-0 ${et} pds2-transition-opacity pds2-duration-300`,style:{backgroundColor:"rgba(0, 0, 0, 0.5)"},onClick:st=>{if(at){st.stopPropagation();return}tt(null),_(!1),_e(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER)}}),jsxRuntimeExports.jsx("div",{className:`pds2-relative pds2-bg-bg-white pds2-rounded-t-24 pds2-w-full pds2-transition-transform pds2-duration-300 ${a?"pds2-translate-y-0":"pds2-translate-y-full"}`,style:{height:"75%",maxHeight:"600px",overflowY:"auto"},children:$})]}):null},formatDateTime=(a,_={date:!0,time:!0})=>{const $=new Date(a);let _e="",et="";return _.time&&(_e=$.toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit",hour12:!0})),_.date&&(et=$.toLocaleDateString("en-IN",{day:"2-digit",month:"short",year:"numeric"})),_.time&&_.date?`${_e}, ${et}`:_.time?_e:_.date?et:""};function ConsentCard(){var _,$,_e,et,tt,rt,nt,at,st;const a=useAuthAbhaStore(it=>it.consentDetails);return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-p-16 pds2-rounded-16 pds2-bg-bg-white pds2-space-y-8",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-space-x-16",children:[jsxRuntimeExports.jsxs("div",{className:"Body2Semibold pds2-text-text-01 pds2-flex-1",children:[(_=a==null?void 0:a.hiu)==null?void 0:_.name,jsxRuntimeExports.jsx("div",{className:"Body2Regular",children:($=a==null?void 0:a.hiu)==null?void 0:$.id})]}),(a==null?void 0:a.status)==ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-brand pds2-bg-bg-brand-03 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$8,{}),"Pending"]}),(a==null?void 0:a.status)==ConsentStatus.GRANTED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-success pds2-bg-bg-success-03 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$1,{}),"Granted"]}),(a==null?void 0:a.status)==ConsentStatus.EXPIRED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-03 pds2-bg-bg-01 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$2,{}),"Expired"]}),(a==null?void 0:a.status)==ConsentStatus.DENIED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-error pds2-bg-bg-error-03 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$2,{}),"Denied"]}),(a==null?void 0:a.status)==ConsentStatus.REVOKED&&jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-items-center pds2-gap-10 pds2-text-text-error pds2-bg-bg-error-03 pds2-px-8 pds2-py-4 pds2-border-transparent pds2-rounded-8",children:[jsxRuntimeExports.jsx(t$2,{}),"Revoked"]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Type of Request"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:"consent"})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Purpose of Request"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:(_e=a==null?void 0:a.purpose)==null?void 0:_e.text})]}),((et=a==null?void 0:a.duration)==null?void 0:et.from)&&((tt=a==null?void 0:a.duration)==null?void 0:tt.to)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Duration"}),jsxRuntimeExports.jsxs("div",{className:"Body2Regular pds2-text-text-03",children:[formatDateTime((rt=a==null?void 0:a.duration)==null?void 0:rt.from,{date:!0,time:!1})," - ",formatDateTime((nt=a==null?void 0:a.duration)==null?void 0:nt.to,{date:!0,time:!1})]})]}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Requested by"}),jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-text-03",children:((at=a==null?void 0:a.requester)==null?void 0:at.name)||((st=a==null?void 0:a.hiu)==null?void 0:st.name)})]}),(a==null?void 0:a.created_at)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:"Requested at"}),jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-text-03",children:formatDateTime(a==null?void 0:a.created_at,{date:!0,time:!0})})]})]})]})}const ConsentHiTypeListCard=()=>{var tt;const a=useAuthAbhaStore(rt=>rt.consentDetails),_=useAuthAbhaStore(rt=>rt.consentApiBody),$=useAuthAbhaStore(rt=>rt.setConsentApiBody),_e=(_==null?void 0:_.hi_types)??[],et=rt=>{const nt=rt.target.id,st=rt.target.checked?[..._e,nt]:_e.filter(it=>it!==nt);$({hi_types:st})};return jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-bg-white pds2-space-y-8",children:jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col ",children:(tt=a==null?void 0:a.hi_types)==null?void 0:tt.map((rt,nt)=>jsxRuntimeExports.jsx("div",{className:`pds2-px-16 pds2-py-16 ${nt<a.hi_types.length-1?"pds2-border-b pds2-border-bg-seperator-dark":""}`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[(a==null?void 0:a.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsx("input",{id:rt.id,type:"checkbox",checked:_e.includes(rt.id),className:"pds2-accent-border-brand-01",onChange:et}),jsxRuntimeExports.jsx("div",{className:"Body3Regular pds2-text-text-03",children:rt.display})]})},rt==null?void 0:rt.id))})})},formatDateToBackendISO=a=>{const _=new Date;return new Date(`${a}T${_.getHours().toString().padStart(2,"0")}:${_.getMinutes().toString().padStart(2,"0")}:${_.getSeconds().toString().padStart(2,"0")}`).toISOString()},ConsentDurationCard=()=>{var nt,at,st,it;const a=reactExports.useRef(null),_=reactExports.useRef(null),$=useAuthAbhaStore(ot=>ot.consentApiBody),_e=useAuthAbhaStore(ot=>ot.setConsentApiBody),et=useAuthAbhaStore(ot=>ot.consentDetails),tt=new Date,rt=(ot,lt)=>{const ht=formatDateToBackendISO(lt);_e({duration:{...$==null?void 0:$.duration,[ot]:ht}})};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-py-6 pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-bg-white pds2-space-y-8",children:[jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-py-6 Body3Regular pds2-text-text-03",children:jsxRuntimeExports.jsxs("div",{className:`${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"":"pds2-flex pds2-items-center pds2-justify-between"} pds2-border-b pds2-border-bg-seperator-dark`,children:[jsxRuntimeExports.jsxs("div",{className:`${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["From",jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:((nt=$==null?void 0:$.duration)==null?void 0:nt.from)&&formatDateTime((at=$==null?void 0:$.duration)==null?void 0:at.from,{date:!0,time:!1})})]}),(et==null?void 0:et.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(n$2,{className:"pds2-text-bg-brand-01 pds2-text-16",onClick:()=>{var ot;return(ot=a.current)==null?void 0:ot.showPicker()}}),jsxRuntimeExports.jsx("input",{className:"pds2-absolute pds2-opacity-0 pds2-pointer-events-none",ref:a,type:"date",max:tt.toISOString().split("T")[0],onChange:ot=>rt("from",ot.target.value)})]})]})}),jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-py-6 Body3Regular pds2-text-text-03",children:jsxRuntimeExports.jsxs("div",{className:`${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"":"pds2-flex pds2-items-center pds2-justify-between"} pds2-border-b pds2-border-bg-seperator-dark`,children:[jsxRuntimeExports.jsxs("div",{className:`${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["To",jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:((st=$==null?void 0:$.duration)==null?void 0:st.to)&&formatDateTime((it=$==null?void 0:$.duration)==null?void 0:it.to,{date:!0,time:!1})})]}),(et==null?void 0:et.status)===ConsentStatus.REQUESTED&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(n$2,{className:"pds2-text-bg-brand-01 pds2-text-16",onClick:()=>{var ot;return(ot=_.current)==null?void 0:ot.showPicker()}}),jsxRuntimeExports.jsx("input",{className:"pds2-absolute pds2-opacity-0 pds2-pointer-events-none",ref:_,type:"date",max:tt.toISOString().split("T")[0],onChange:ot=>rt("to",ot.target.value)})]})]})}),jsxRuntimeExports.jsxs("div",{className:`pds2-px-16 pds2-py-6 Body3Regular pds2-text-text-03 ${(et==null?void 0:et.status)===ConsentStatus.GRANTED?"pds2-flex pds2-justify-between":""}`,children:["Expires on",($==null?void 0:$.erase_at)&&jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-text-text-01",children:formatDateTime($==null?void 0:$.erase_at,{date:!0,time:!0})})]})]})},ConsentHCPCard=()=>{var mt,ct,ft;const a=useAuthAbhaStore(ut=>ut.consentDetails),_=(mt=a==null?void 0:a.providers)==null?void 0:mt.reduce((ut,gt)=>(ut[gt.hip.id]=gt.care_contexts,ut),{}),$=useAuthAbhaStore(ut=>ut.setConsentApiBody),[_e,et]=reactExports.useState(_||{}),[tt,rt]=reactExports.useState([]),nt=()=>{var ut;return(ut=Object==null?void 0:Object.entries(_e??{}))==null?void 0:ut.map(([gt,yt])=>({hip_id:gt,care_contexts:yt}))};reactExports.useEffect(()=>{const ut=nt();$({consent_artefacts:ut})},[_e]);const at=ut=>{rt(gt=>gt.includes(ut)?gt.filter(yt=>yt!==ut):[...gt,ut])},st=ut=>tt.includes(ut),it=(ct=a==null?void 0:a.providers)==null?void 0:ct.every(ut=>_e[ut.hip.id].length===ut.care_contexts.length&&ut.care_contexts.length>0),ot=ut=>{var gt;return((gt=_e[ut.hip.id])==null?void 0:gt.length)===ut.care_contexts.length},lt=(ut,gt)=>{var yt;return(yt=_e[ut])==null?void 0:yt.some(Et=>Et.id===gt)},ht=ut=>{if(ut){const gt=a==null?void 0:a.providers.reduce((yt,Et)=>(yt[Et.hip.id]=Et.care_contexts,yt),{});et(gt||{})}else{const gt=a==null?void 0:a.providers.reduce((yt,Et)=>(yt[Et.hip.id]=[],yt),{});et(gt||{})}},pt=(ut,gt)=>{const yt=ut.hip.id;et(Et=>({...Et,[yt]:gt?ut.care_contexts:[]}))},dt=(ut,gt,yt)=>{et(Et=>{const _t=Et[ut]??[];let St;return yt?St=[..._t,gt]:St=_t.filter(wt=>wt.id!==gt.id),{...Et,[ut]:St}})};return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:"Body3Medium pds2-flex pds2-gap-10 pds2-px-16 pds2-py-16 pds2-uppercase pds2-border-b pds2-border-bg-seperator-dark",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-border-brand-01",checked:it,onChange:ut=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){ut.preventDefault();return}ht(ut.target.checked)},onClick:ut=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(ut.preventDefault(),ut.stopPropagation())}}),"All"]}),(ft=a==null?void 0:a.providers)==null?void 0:ft.map(ut=>{const gt=ut.hip.id;return jsxRuntimeExports.jsxs("div",{className:"Body3Medium",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-justify-between pds2-items-center pds2-cursor-pointer",onClick:()=>at(gt),children:[jsxRuntimeExports.jsxs("div",{className:" pds2-flex pds2-gap-10 pds2-px-16 pds2-py-16 pds2-text-text-03",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-border-brand-01",checked:ot(ut),onChange:yt=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){yt.preventDefault();return}pt(ut,yt.target.checked)},onClick:yt=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(yt.preventDefault(),yt.stopPropagation())}}),ut.hip.name]}),jsxRuntimeExports.jsx("div",{className:"pds2-pr-16",children:st(gt)?jsxRuntimeExports.jsx(e$2,{}):jsxRuntimeExports.jsx(c$3,{})})]}),st(gt)&&jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-rounded-16 pds2-bg-bg-white pds2-space-y-8",children:ut.care_contexts.map((yt,Et)=>jsxRuntimeExports.jsx("div",{className:`pds2-px-24 pds2-py-16 ${Et<ut.care_contexts.length-1?"pds2-border-b pds2-border-bg-seperator-dark":""}`,children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",className:"pds2-accent-border-brand-01",checked:lt(gt,yt.id),onChange:_t=>{if((a==null?void 0:a.status)!=ConsentStatus.REQUESTED){_t.preventDefault();return}dt(gt,yt,_t.target.checked)},onClick:_t=>{(a==null?void 0:a.status)!=ConsentStatus.REQUESTED&&(_t.preventDefault(),_t.stopPropagation())}}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-5 pds2-flex-col",children:[jsxRuntimeExports.jsx("div",{className:"!Body2Regular pds2-text-text-01",children:yt.display}),jsxRuntimeExports.jsx("div",{className:"!Body3Regular pds2-text-text-03",children:yt.id})]})]})},yt.id))})]},gt)})]})},AbhaLoadingStatus=()=>jsxRuntimeExports.jsxs("div",{className:"pds2-bg-bg-01 pds2-px-16 pds2-w-full pds2-min-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm5m96sno000d0tg92v2g42tx.webp",alt:"loading",className:"pds2-w-60"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-01 Heading4Semibold pds2-mt-48",children:"Loading"})]}),ConsentDetailsScreen=()=>{const a=useAuthAbhaStore(st=>st.txnId),_=useAuthAbhaStore(st=>st.setScreen),$=useAuthAbhaStore(st=>st.isEkaAppLogin),_e=useAuthAbhaStore(st=>st.clientId),et=useAuthAbhaStore(st=>st.isNewLoginOrCreateFlow),tt=GET_EXTRA_HEADERS(),rt=useAuthAbhaStore(st=>st.consentDetails),nt={REQUESTED:"Consent Request Details",GRANTED:"Granted Consent Details",DENIED:"Consent Denied Details",EXPIRED:"Consent Expired Details",REVOKED:"Consent Revoked Details"};return rt||(({name:st,data:it={}})=>{var ht,pt;const lt={...{login_platform:_e,is_eka_app_login:$?"true":"false",is_new_login_or_create_flow:et?"true":"false",txn_id:a||"missing txnId",oid:tt!=null&&tt["X-User-ID"]?"true":"false",access_token:tt!=null&&tt.auth?"true":"false"},...it};handleSendEvent({eventName:st,eventData:lt}),(pt=(ht=window.curio)==null?void 0:ht.pushToMixpanel)==null||pt.call(ht,st,lt)})({name:"abha_consent_details_screen",data:{page_view:"abha_consent_details_screen",platform:_e,error:"consent details not found"}}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:rt?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaHeader,{title:`${rt!=null&&rt.status?nt[rt.status]??"":""}`,className:"pds2-border-b-1 pds2-border-bg-seperator-dark"}),jsxRuntimeExports.jsxs("div",{className:"pds2-p-16 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-bg-01",children:[jsxRuntimeExports.jsx(ConsentCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-text-03",children:"DURATION"}),jsxRuntimeExports.jsx(ConsentDurationCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-text-03",children:"REQUEST INFORMATION TYPE"}),jsxRuntimeExports.jsx(ConsentHiTypeListCard,{}),jsxRuntimeExports.jsxs("div",{className:"Body3Semibold pds2-text-text-03",children:["HEALTH CARE PROVIDERS",jsxRuntimeExports.jsx("br",{}),"Sharing your data for requested information, from following healthcare providers:"]}),jsxRuntimeExports.jsx(ConsentHCPCard,{}),jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-text-03",children:"By granting this consent, you agree to let the Doctors view your health information."})]}),["REQUESTED","GRANTED"].includes(rt.status)&&jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-gap-10 pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-bg-white pds2-w-full pds2-border pds2-border-border-brand-02",children:[rt.status==="REQUESTED"&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Pds2Button,{title:"Deny",buttonColor:"pds2-bg-bg-red",className:"pds2-w-full",onClick:()=>_(SCREEN_NAMES.CONSENT_DENY)}),jsxRuntimeExports.jsx(Pds2Button,{title:"Grant Access",buttonColor:"pds2-bg-bg-success-02",className:"pds2-w-full",onClick:()=>_(SCREEN_NAMES.CONSENT_APPROVE)})]}),rt.status==="GRANTED"&&jsxRuntimeExports.jsx(Pds2Button,{title:"Revoke Access",buttonColor:"pds2-bg-bg-red",className:"pds2-w-full",onClick:()=>_(SCREEN_NAMES.CONSENT_REVOKE)})]})]}):jsxRuntimeExports.jsx(AbhaLoadingStatus,{})})},v$1="5.9.6",fr$1=30,ip$1=0,op$1=10,w$1=400,h$1=400,nm$1="Композиция 1",ddd$1=0,assets$1=[{id:"comp_0",nm:"closr",fr:30,layers:[{ddd:0,ind:1,ty:4,nm:"Кривые Слой 6",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.111],y:[.313]},o:{x:[.333],y:[0]},t:9,s:[0]},{i:{x:[.666],y:[1]},o:{x:[.157],y:[0]},t:15,s:[100]},{i:{x:[.795],y:[1]},o:{x:[.436],y:[0]},t:50,s:[100]},{t:59,s:[0]}],ix:11},r:{a:1,k:[{i:{x:[.464],y:[1.145]},o:{x:[.333],y:[0]},t:5,s:[134]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:16,s:[0]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:50,s:[0]},{t:59,s:[125]}],ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[43.184,43.184,0],ix:1,l:2},s:{a:1,k:[{i:{x:[0,0,.667],y:[1.194,1.194,1]},o:{x:[.773,.773,.333],y:[0,0,0]},t:7,s:[130,130,100]},{i:{x:[.664,.664,.664],y:[1,1,1]},o:{x:[.157,.157,.157],y:[0,0,0]},t:16,s:[100,100,100]},{i:{x:[.796,.796,.796],y:[1,1,1]},o:{x:[.436,.436,.436],y:[0,0,0]},t:50,s:[100,100,100]},{t:59,s:[30,30,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,38.184],[38.184,-38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,-38.184],[38.184,38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 2",np:3,cix:2,bm:0,ix:2,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Кривые Слой 5",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:3,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[96.25,96.25,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.524,.524,.667],y:[1.264,1.264,1]},o:{x:[.712,.712,.333],y:[0,0,0]},t:-.566,s:[4,4,100]},{i:{x:[.833,.833,.833],y:[1,1,1]},o:{x:[.517,.517,.333],y:[0,0,0]},t:17,s:[100,100,100]},{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[1,1,.167],y:[-.624,-.624,-16.667]},t:49,s:[100,100,100]},{t:61.208984375,s:[0,0,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-53.019],[53.019,0],[0,53.019],[-53.019,0]],o:[[0,53.019],[-53.019,0],[0,-53.019],[53.019,0]],v:[[96,0],[0,96],[-96,0],[0,-96]],c:!0},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[.898595114315,.179309067072,.190338763069,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[96.25,96.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0}]}],layers$1=[{ddd:0,ind:1,ty:0,nm:"closr",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[200,200,0],ix:1,l:2},s:{a:0,k:[154,154,100],ix:6,l:2}},ao:0,w:400,h:400,ip:0,op:311,st:0,bm:0}],markers$1=[],animationDataLoading={v:v$1,fr:fr$1,ip:ip$1,op:op$1,w:w$1,h:h$1,nm:nm$1,ddd:ddd$1,assets:assets$1,layers:layers$1,markers:markers$1},v="5.9.6",fr=30,ip=0,op=50,w=400,h=400,nm="Композиция 1",ddd=0,assets=[{id:"comp_0",nm:"closr",fr:30,layers:[{ddd:0,ind:1,ty:4,nm:"Кривые Слой 6",sr:1,ks:{o:{a:1,k:[{i:{x:[.667],y:[1]},o:{x:[.167],y:[0]},t:0,s:[0]},{i:{x:[.111],y:[.313]},o:{x:[.333],y:[0]},t:9,s:[0]},{i:{x:[.666],y:[1]},o:{x:[.157],y:[0]},t:15,s:[100]},{i:{x:[.795],y:[1]},o:{x:[.436],y:[0]},t:50,s:[100]},{t:59,s:[0]}],ix:11},r:{a:1,k:[{i:{x:[.464],y:[1.145]},o:{x:[.333],y:[0]},t:5,s:[134]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:16,s:[0]},{i:{x:[.833],y:[1]},o:{x:[.167],y:[0]},t:50,s:[0]},{t:59,s:[125]}],ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[43.184,43.184,0],ix:1,l:2},s:{a:1,k:[{i:{x:[0,0,.667],y:[1.194,1.194,1]},o:{x:[.773,.773,.333],y:[0,0,0]},t:7,s:[130,130,100]},{i:{x:[.664,.664,.664],y:[1,1,1]},o:{x:[.157,.157,.157],y:[0,0,0]},t:16,s:[100,100,100]},{i:{x:[.796,.796,.796],y:[1,1,1]},o:{x:[.436,.436,.436],y:[0,0,0]},t:50,s:[100,100,100]},{t:59,s:[30,30,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,38.184],[38.184,-38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:3,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1},{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[-38.184,-38.184],[38.184,38.184]],c:!1},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"st",c:{a:0,k:[1,.999998743394,1,1],ix:3},o:{a:0,k:100,ix:4},w:{a:0,k:20,ix:5},lc:2,lj:1,ml:10,bm:0,nm:"Обводка 1",mn:"ADBE Vector Graphic - Stroke",hd:!1},{ty:"fl",c:{a:0,k:[.456032696892,.725485827876,.257378462249,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[43.184,43.184],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 2",np:3,cix:2,bm:0,ix:2,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0},{ddd:0,ind:2,ty:4,nm:"Кривые Слой 5",sr:1,ks:{o:{a:1,k:[{i:{x:[.833],y:[.833]},o:{x:[.167],y:[.167]},t:0,s:[0]},{t:3,s:[100]}],ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[96.25,96.25,0],ix:1,l:2},s:{a:1,k:[{i:{x:[.524,.524,.667],y:[1.264,1.264,1]},o:{x:[.712,.712,.333],y:[0,0,0]},t:-.566,s:[4,4,100]},{i:{x:[.833,.833,.833],y:[1,1,1]},o:{x:[.517,.517,.333],y:[0,0,0]},t:17,s:[100,100,100]},{i:{x:[.667,.667,.667],y:[1,1,1]},o:{x:[1,1,.167],y:[-.624,-.624,-16.667]},t:49,s:[100,100,100]},{t:61.208984375,s:[0,0,100]}],ix:6,l:2}},ao:0,shapes:[{ty:"gr",it:[{ind:0,ty:"sh",ix:1,ks:{a:0,k:{i:[[0,-53.019],[53.019,0],[0,53.019],[-53.019,0]],o:[[0,53.019],[-53.019,0],[0,-53.019],[53.019,0]],v:[[96,0],[0,96],[-96,0],[0,-96]],c:!0},ix:2},nm:"Контур 1",mn:"ADBE Vector Shape - Group",hd:!1},{ty:"fl",c:{a:0,k:[.898595114315,.179309067072,.190338763069,1],ix:4},o:{a:0,k:100,ix:5},r:1,bm:0,nm:"Заливка 1",mn:"ADBE Vector Graphic - Fill",hd:!1},{ty:"tr",p:{a:0,k:[96.25,96.25],ix:2},a:{a:0,k:[0,0],ix:1},s:{a:0,k:[100,100],ix:3},r:{a:0,k:0,ix:6},o:{a:0,k:100,ix:7},sk:{a:0,k:0,ix:4},sa:{a:0,k:0,ix:5},nm:"Преобразовать"}],nm:"Группа 1",np:2,cix:2,bm:0,ix:1,mn:"ADBE Vector Group",hd:!1}],ip:0,op:311,st:0,ct:1,bm:0}]}],layers=[{ddd:0,ind:1,ty:0,nm:"closr",refId:"comp_0",sr:1,ks:{o:{a:0,k:100,ix:11},r:{a:0,k:0,ix:10},p:{a:0,k:[200,200,0],ix:2,l:2},a:{a:0,k:[200,200,0],ix:1,l:2},s:{a:0,k:[154,154,100],ix:6,l:2}},ao:0,w:400,h:400,ip:0,op:311,st:0,bm:0}],markers=[],animationData={v,fr,ip,op,w,h,nm,ddd,assets,layers,markers},AbhaRejectionStatus=({loading:a=!1,loadingText:_,rejectText:$})=>jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-w-full pds2-min-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center",style:{backgroundColor:"#F2F2F2"},children:a?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData:animationDataLoading,loop:!0,className:"pds2-w-200"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-01 Heading4Semibold pds2-absolute pds2-mt-220",children:_})]}):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData,loop:!1,className:"pds2-w-200"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-01 Heading4Semibold pds2-absolute pds2-mt-220",children:$})]})}),AbhaConsentDenyScreen=()=>{const[a,_]=reactExports.useState(!0),$=useAuthAbhaStore(ht=>ht.clientId),_e=useAuthAbhaStore(ht=>ht.isEkaAppLogin),et=useAuthAbhaStore(ht=>ht.txnId),tt=useAuthAbhaStore(ht=>ht.isNewLoginOrCreateFlow),rt=GET_EXTRA_HEADERS(),nt=useAuthAbhaStore(ht=>ht.abhaRequestConsentId),at=useAuthAbhaStore(ht=>ht.goBackLoginScreen),st=useAuthAbhaStore(ht=>ht.setBottomsheetErrorInfo),it=({name:ht,data:pt={}})=>{var ct,ft;const mt={...{login_platform:$,is_eka_app_login:_e?"true":"false",is_new_login_or_create_flow:tt?"true":"false",txn_id:et||"missing txnId",oid:rt!=null&&rt["X-User-ID"]?"true":"false",access_token:rt!=null&&rt.auth?"true":"false"},...pt};handleSendEvent({eventName:ht,eventData:mt}),(ft=(ct=window.curio)==null?void 0:ct.pushToMixpanel)==null||ft.call(ct,ht,mt)},ot=()=>{it({name:"abha_consent_revoke_error_bottomsheet_dismissed",data:{platform:$}}),st(null),at(),setIndividualEnv({extraHeaders:{auth:""}})},lt=async()=>{if(!nt){it({name:"abha_consent_deny_screen",data:{page_view:"abha_consent_request_page",platform:$,data:{error_msg:"No consent ID found"}}}),console.error("No consent ID found");return}it({name:"abha_consent_revoke_triggered",data:{flow_step_type:"init",clientId:$}});const ht=await postAbdmConsentDeny({consentId:nt});if("success"in ht){console.log("Success"),_(!1),setTimeout(()=>{onConsentSuccess("Consent deny success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),it({name:"abha_consent_deny_success",data:{flow_step_type:"init",clientId:$}});return}const{code:pt,error:dt,source_error:mt}=ht;st({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),it({name:"abha_consent_revoke_failed",data:{flow_step_type:"init",clientId:$,error_code:pt,error_msg:dt,source_error:mt}})};return reactExports.useEffect(()=>{lt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaRejectionStatus,{loading:a,loadingText:"Denying...",rejectText:"Consent Denied Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:ot})]})},AbhaConsentRevokeScreen=()=>{const[a,_]=reactExports.useState(!0),$=useAuthAbhaStore(ht=>ht.clientId),_e=useAuthAbhaStore(ht=>ht.isEkaAppLogin),et=useAuthAbhaStore(ht=>ht.txnId),tt=useAuthAbhaStore(ht=>ht.isNewLoginOrCreateFlow),rt=useAuthAbhaStore(ht=>ht.setBottomsheetErrorInfo),nt=GET_EXTRA_HEADERS(),at=useAuthAbhaStore(ht=>ht.goBackLoginScreen),st=useAuthAbhaStore(ht=>ht.consentApiBody),it=({name:ht,data:pt={}})=>{var ct,ft;const mt={...{login_platform:$,is_eka_app_login:_e?"true":"false",is_new_login_or_create_flow:tt?"true":"false",txn_id:et||"missing txnId",oid:nt!=null&&nt["X-User-ID"]?"true":"false",access_token:nt!=null&&nt.auth?"true":"false"},...pt};handleSendEvent({eventName:ht,eventData:mt}),(ft=(ct=window.curio)==null?void 0:ct.pushToMixpanel)==null||ft.call(ct,ht,mt)},ot=()=>{it({name:"abha_consent_revoke_error_bottomsheet_dismissed",data:{platform:$}}),rt(null),at(),setIndividualEnv({extraHeaders:{auth:""}})},lt=async()=>{if(!(st!=null&&st.consent_artefacts_id)){it({name:"abha_consent_revoke_screen",data:{page_view:"abha_consent_request_page",platform:$,data:{error_msg:"No consent artefacts ids found"}}}),console.error("No consent artefacts ids found");return}const ht=await postAbdmConsentRevoke({consent_artefacts_ids:st==null?void 0:st.consent_artefacts_id});if("success"in ht){console.log("Success"),_(!1),setTimeout(()=>{onConsentSuccess("Consent revoke success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),it({name:"abha_consent_revoke_success",data:{flow_step_type:"init",clientId:$}});return}const{code:pt,error:dt,source_error:mt}=ht;rt({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),it({name:"abha_consent_revoke_failed",data:{flow_step_type:"init",clientId:$,error_code:pt,error_msg:dt,source_error:mt}})};return reactExports.useEffect(()=>{lt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaRejectionStatus,{loading:a,loadingText:"Revoke in progress...",rejectText:"Consent Revoked Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:ot})]})},AbhaConsentApproveScreen=()=>{const[a,_]=reactExports.useState(!0),$=useAuthAbhaStore(ht=>ht.clientId),_e=useAuthAbhaStore(ht=>ht.isEkaAppLogin),et=useAuthAbhaStore(ht=>ht.txnId),tt=useAuthAbhaStore(ht=>ht.isNewLoginOrCreateFlow),rt=GET_EXTRA_HEADERS(),nt=useAuthAbhaStore(ht=>ht.consentApiBody),at=useAuthAbhaStore(ht=>ht.goBackLoginScreen),st=useAuthAbhaStore(ht=>ht.setBottomsheetErrorInfo),it=({name:ht,data:pt={}})=>{var ct,ft;const mt={...{login_platform:$,is_eka_app_login:_e?"true":"false",is_new_login_or_create_flow:tt?"true":"false",txn_id:et||"missing txnId",oid:rt!=null&&rt["X-User-ID"]?"true":"false",access_token:rt!=null&&rt.auth?"true":"false"},...pt};handleSendEvent({eventName:ht,eventData:mt}),(ft=(ct=window.curio)==null?void 0:ct.pushToMixpanel)==null||ft.call(ct,ht,mt)},ot=()=>{it({name:"abha_consent_approve_error_bottomsheet_dismissed",data:{platform:$}}),st(null),at(),setIndividualEnv({extraHeaders:{auth:""}})},lt=async()=>{if(!nt){it({name:"abha_consent_approve_screen",data:{page_view:"abha_consent_request_page",platform:$,data:{error_msg:"No consent details found"}}}),console.error("No consent details found");return}const{consent_artefacts_id:ht,...pt}=nt,dt=await postAbdmConsentApprove({consentApprovePayload:pt});if("success"in dt){console.log("Success"),_(!1),setTimeout(()=>{onConsentSuccess("Consent grant success onConsentSuccess called, next page redirect"),window.location.href="https://www.eka.care/s/for-patients"},3e3),it({name:"abha_consent_grant_success",data:{flow_step_type:"init",clientId:$}});return}const{code:mt,error:ct,source_error:ft}=dt;st({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),it({name:"abha_consent_grant_failed",data:{flow_step_type:"init",clientId:$,error_code:mt,error_msg:ct,source_error:ft}})};return reactExports.useEffect(()=>{lt()},[]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:a,loadingText:"Grant in progress...",successText:"Consent Granted Successfully!"}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:ot})]})};function SelfAssessmentSDKIframe({src:a,mountConfig:_,iframeId:$="sa-sdk-iframe"}){const _e=reactExports.useRef(null),et=reactExports.useRef(null);return reactExports.useEffect(()=>{var it;const tt=_e.current;if(!tt)return;et.current&&(et.current.remove(),et.current=null);const rt=document.createElement("iframe");et.current=rt,rt.id=$,rt.style.width="100%",rt.style.height="100%",rt.style.border="0",tt.appendChild(rt);const nt=(it=rt.contentWindow)==null?void 0:it.document;if(!nt)return;const at=`
151
151
  <!doctype html>
152
152
  <html>
153
153
  <head><meta charset="utf-8"/></head>
@@ -196,4 +196,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
196
196
  <\/script>
197
197
  </body>
198
198
  </html>
199
- `;nt.open(),nt.write(at),nt.close();const st=ot=>{var lt,ht,pt,dt,mt;ot.source===rt.contentWindow&&(((lt=ot.data)==null?void 0:lt.type)==="sa-init"&&console.log("[SA INIT]",ot.data.data),((ht=ot.data)==null?void 0:ht.type)==="sa-submit"&&console.log("[SA SUBMIT]",ot.data.data),((pt=ot.data)==null?void 0:pt.type)==="sa-end"&&(console.log("[SA END]"),(dt=_.onEndCallback)==null||dt.call(_)),((mt=ot.data)==null?void 0:mt.type)==="sdk-error"&&console.error("SA SDK error:",ot.data.message))};return window.addEventListener("message",st),()=>{window.removeEventListener("message",st),rt.remove(),et.current=null}},[a,_,$]),jsxRuntimeExports.jsx("div",{ref:_e,style:{height:"100vh"}})}function calculateAge(a){const _=new Date(a),$=new Date;let _e=$.getFullYear()-_.getFullYear();return($.getMonth()<_.getMonth()||$.getMonth()===_.getMonth()&&$.getDate()<_.getDate())&&_e--,_e}const SelfAssessmentScreen=()=>{const a=useAuthAbhaStore(rt=>rt.setScreen),_=useAuthAbhaStore(rt=>rt.ekaProfileInfo),$=GET_EXTRA_HEADERS(),_e=GET_REFRESH_TOKEN(),et=reactExports.useCallback(()=>{console.log("SA ended → closing SDK and redirecting"),window.closeSaApp?window.closeSaApp():console.warn("closeSaApp not found on window"),a(SCREEN_NAMES.CONSENT_LOADER_SCREEN)},[]),tt={useAuthToken:!0,workflow_id:3788,auth_token:($==null?void 0:$.auth)??"",refresh_token:_e,params:{age:calculateAge((_==null?void 0:_.date_of_birth)||""),gender:_==null?void 0:_.gender},practice_info:{patient_uuid:_==null?void 0:_.patient_uuid,unique_identifier:_==null?void 0:_.oid},onEndCallback:et};return jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:jsxRuntimeExports.jsx(SelfAssessmentSDKIframe,{src:"https://api.eka.care/sa-fe/main.js",mountConfig:tt})})},ConsentLoaderScreen=()=>{const a=useAuthAbhaStore(pt=>pt.txnId),_=useAuthAbhaStore(pt=>pt.setConsentApiBody),$=useAuthAbhaStore(pt=>pt.setScreen),_e=useAuthAbhaStore(pt=>pt.goBackLoginScreen),et=useAuthAbhaStore(pt=>pt.setBottomsheetErrorInfo),tt=useAuthAbhaStore(pt=>pt.isEkaAppLogin),rt=useAuthAbhaStore(pt=>pt.clientId),nt=useAuthAbhaStore(pt=>pt.abhaRequestConsentId),at=useAuthAbhaStore(pt=>pt.isNewLoginOrCreateFlow),st=GET_EXTRA_HEADERS(),it=useAuthAbhaStore(pt=>pt.setConsentDetails),ot=useAuthAbhaStore(pt=>pt.screen),lt=({name:pt,data:dt={}})=>{var ft,ut;const ct={...{login_platform:rt,is_eka_app_login:tt?"true":"false",is_new_login_or_create_flow:at?"true":"false",txn_id:a||"missing txnId",oid:st!=null&&st["X-User-ID"]?"true":"false",access_token:st!=null&&st.auth?"true":"false"},...dt};handleSendEvent({eventName:pt,eventData:ct}),(ut=(ft=window.curio)==null?void 0:ft.pushToMixpanel)==null||ut.call(ft,pt,ct)};reactExports.useEffect(()=>{const pt=ot[ot.length-2];lt({name:"abha_consent_request_page",data:{page_view:"abha_consent_request_page",platform:rt}}),lt({name:"fetch_consent_details_api",data:{type:"get_init",platform:rt}});const dt=async(ft,ut)=>{var gt,yt,Et;try{if(!nt)return lt({name:"abha_consent_request_page",data:{page_view:"abha_consent_request_page",platform:rt,data:{error_msg:"No consent ID found"}}}),console.error("No consent ID found"),{response:null,hasEkaCareHIP:!1,error:null};let _t=await getConsentRequest({id:nt,type:"requested"});(_t==null?void 0:_t.status)==="GRANTED"&&(_t=await getConsentRequest({id:nt,type:"granted"})),it(_t),_({id:_t.id,access_mode:_t.access_mode.toLowerCase(),duration:{from:((gt=_t.duration)==null?void 0:gt.from)??void 0,to:((yt=_t.duration)==null?void 0:yt.to)??void 0},erase_at:_t.erase_at,hi_types:_t.hi_types.map(wt=>wt.id),consent_artefacts:_t.providers.map(wt=>{var Pt;return{hip_id:((Pt=wt.hip)==null?void 0:Pt.id)??"",care_contexts:wt.care_contexts??[]}}),consent_artefacts_id:_t.providers.map(wt=>wt.consent_artefact_id??"")});const St=(Et=_t.providers)==null?void 0:Et.some(wt=>wt.hip.id==="ekacare");return{response:_t,hasEkaCareHIP:St,error:null}}catch(_t){const{code:St,error:wt,source_error:Pt}=_t;return lt({name:ft==="init"?"abha_consent_get_failed":"abha_consent_polling_failed",data:{flow_step_type:ft,clientId:rt,attempt:ut,error_code:St,error_msg:wt,source_error:Pt}}),{response:null,hasEkaCareHIP:!1,error:_t}}},mt=async()=>{lt({name:"abha_consent_get_triggered",data:{flow_step_type:"init",clientId:rt}});const{hasEkaCareHIP:ft,response:ut}=await dt("init");!ft&&(ut==null?void 0:ut.status)==="REQUESTED"?(lt({name:"abha_consent_no_ekacare_hip",data:{platform:rt}}),$(SCREEN_NAMES.SELF_ASSESSMENT)):(lt({name:"abha_consent_has_ekacare_hip",data:{platform:rt}}),$(SCREEN_NAMES.CONSENT_SCREEN)),lt({name:"abha_consent_get_success",data:{flow_step_type:"init",clientId:rt}})},ct=()=>{let ft=0;const ut=5;lt({name:"abha_consent_polling_started",data:{platform:rt}});const gt=async()=>{ft++,lt({name:"abha_consent_polling_attempt",data:{attempt:ft,platform:rt}});const{hasEkaCareHIP:Et,response:_t}=await dt("polling",ft);if(Et){clearInterval(yt),lt({name:"abha_consent_polling_success",data:{attempt:ft,platform:rt}}),$(SCREEN_NAMES.CONSENT_SCREEN);return}ft>=ut&&(clearInterval(yt),lt({name:"abha_consent_polling_timeout",data:{attempts:ft,platform:rt}}),$(SCREEN_NAMES.CONSENT_SCREEN))};gt();const yt=setInterval(gt,1e3);return()=>clearInterval(yt)};pt===SCREEN_NAMES.SELF_ASSESSMENT?ct():mt()},[]);const ht=()=>{lt({name:"abha_consent_request_error_bottomsheet_dismissed",data:{platform:rt}}),et(null),_e(),setIndividualEnv({extraHeaders:{auth:""}})};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsx(AbhaLoadingStatus,{}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:ht})]})},KYCLoginScreen=()=>{const a=useAuthAbhaStore(_e=>_e.clientId);reactExports.useEffect(()=>{var _e;if((_e=window.EkaAbha)!=null&&_e.changeStatusBarColor)return window.EkaAbha.changeStatusBarColor("#F2F4F7"),()=>{var et,tt;(et=window.EkaAbha)!=null&&et.changeStatusBarColor&&((tt=window==null?void 0:window.EkaAbha)==null||tt.changeStatusBarColor("#FFFFFF"))}},[]);const _=()=>{var _e;(_e=window.EkaAbha)==null||_e.onAbhaClose(),unMount()},$=["eka-web","www-eka","doctor"];return jsxRuntimeExports.jsxs("div",{className:"pds2-h-full pds2-overflow-y-auto",children:[!$.includes(a)&&jsxRuntimeExports.jsx(Pds2Header,{prefixIcon:jsxRuntimeExports.jsx("button",{onClick:_,children:jsxRuntimeExports.jsx(n$4,{})}),title:"",className:"pds2-bg-bg-01"}),jsxRuntimeExports.jsx(KYCDiffMethods,{})]})},KYCDiffMethods=()=>{const a=useAuthAbhaStore(jt=>jt.abhaAuthFlowMethod||ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),_=useAuthAbhaStore(jt=>jt.authTxnId),$=useAuthAbhaStore(jt=>jt.setAbhaAuthFlowMethod),_e=useAuthAbhaStore(jt=>jt.goBackToLogin),et=useAuthAbhaStore(jt=>jt.setGoBackToLogin),tt=useAuthAbhaStore(jt=>jt.setIdentifierValue),rt=useAuthAbhaStore(jt=>jt.identifierValue),nt=useAuthAbhaStore(jt=>jt.isEkaAppLogin),at=useAuthAbhaStore(jt=>jt.setRegistrationType),st=useAuthAbhaStore(jt=>jt.setAadhaarInitResponse),it=useAuthAbhaStore(jt=>jt.initAbhaAppIdentifierType),ot=useAuthAbhaStore(jt=>jt.initAbhaAppIdentifier);useAuthAbhaStore(jt=>jt.isDocAppRequest);const lt=useAuthAbhaStore(jt=>jt.isNewLoginOrCreateFlow),ht=useAuthAbhaStore(jt=>jt.clientId),pt=useAuthAbhaStore(jt=>jt.isInitApiTriggered),dt=useAuthAbhaStore(jt=>jt.setIsInitApiTriggered),mt=useAuthAbhaStore(jt=>jt.setIdentityValue),ct=useAuthAbhaStore(jt=>jt.setSelectedAbhaFlow),ft=useAuthAbhaStore(jt=>jt.setKycInitResponse),ut=useAuthAbhaStore(jt=>jt.txnId),[gt,yt]=reactExports.useState(LOADING_STATE.IDLE),[Et,_t]=reactExports.useState(""),St=useAuthAbhaStore(jt=>jt.setScreen),[wt,Pt]=reactExports.useState(!1),[Nt,Mt]=reactExports.useState(!1),[Dt,Rt]=reactExports.useState(rt.aadhaar_number||""),[kt,xt]=reactExports.useState(rt.abha_number||""),bt=reactExports.useRef(!1),vt=GET_EXTRA_HEADERS();vt==null||vt["X-User-ID"],reactExports.useEffect(()=>{At({name:"abha_login_or_create_screen",data:{flow:a.toString()}})}),reactExports.useEffect(()=>{ot&&it===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!_e?(tt({abha_number:ot}),xt(ot),Mt(!0),$(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER)):ot&&it===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!_e&&(Rt(ot),Pt(!0),tt({aadhaar_number:ot}),$(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER))},[it,ot]),reactExports.useEffect(()=>{pt||bt.current||Dt&&Dt.length===12&&a==ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&(dt(!0),bt.current=!0,$t())},[Dt]),reactExports.useEffect(()=>{pt||bt.current||kt&&kt.length===17&&a==ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&(dt(!0),bt.current=!0,$t())},[kt]);const At=({name:jt,data:Ht={}})=>{var Yt,Wt;const Vt={...{login_platform:ht,is_eka_app_login:nt?"true":"false",is_new_login_or_create_flow:lt?"true":"false",oid:vt!=null&&vt["X-User-ID"]?"true":"false",access_token:vt!=null&&vt.auth?"true":"false",txn_id:ut||"missing txnId",flow:a??""},...Ht};handleSendEvent({eventName:jt,eventData:Vt}),(Wt=(Yt=window.curio)==null?void 0:Yt.pushToMixpanel)==null||Wt.call(Yt,jt,Vt)},Ct=React.useMemo(()=>{switch(a){case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:return rt.abha_number.length===17;case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return rt.aadhaar_number.length===12}},[a,rt]),Tt=({inputVal:jt})=>{jt.length===12&&(tt({aadhaar_number:jt}),Rt(jt),Pt(!0))},Ot=({inputVal:jt})=>{if(jt.length===14){let Ht="";jt.length>0&&(Ht+=jt.slice(0,2)),jt.length>2&&(Ht+=`-${jt.slice(2,6)}`),jt.length>6&&(Ht+=`-${jt.slice(6,10)}`),jt.length>10&&(Ht+=`-${jt.slice(10,14)}`),tt({abha_number:Ht}),xt(Ht),Mt(!0)}};reactExports.useEffect(()=>{console.log("selectedMethod changed:==================>",a)},[a]);const $t=async jt=>{var Ht;if(yt(LOADING_STATE.LOADING),a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER){const{txn_id:Lt,error:Vt,action:Yt,hint:Wt}=await postAbdmKycInit({method:"abha-number",identifier:rt.abha_number});if(At({name:"abha_kyc_init_triggered",data:{flow_step_type:"init",ndhmTxnId:Lt,method:a}}),dt(!0),mt(rt.abha_number),Lt){ft({txnId:Lt,kycOtpSentToHint:Wt||null}),yt(LOADING_STATE.RESOLVED),St(SCREEN_NAMES.VERIFY_KYC_OTP_LOGIN_WITH_ABHA);return}At({name:"abha_kyc_init_failure",data:{error_message:Vt||"unknown_error",error_message_exists:!!Vt,authTxnId:_,error_action:Yt,error_action_exists:!!Yt}}),_t(Vt||"Something went wrong"),yt(LOADING_STATE.REJECTED)}else{At({name:"aadhaar_registration_init_start",data:{flow_step_type:"init",authTxnId:_,aadhaarNumber:rt.aadhaar_number}});const{txn_id:Lt,hint:Vt,error:Yt,action:Wt}=await postRegisterAadhaarInit({aadhaar_number:rt.aadhaar_number});if(mt(rt.aadhaar_number),ct("aadhaar"),Lt&&Vt){st({authTxnId:_,txnId:Lt,aadhaarOtpSentToHint:Vt}),At({name:"aadhaar_registration_init_success",data:{flow_step_type:"verify",ndhmTxnId:Lt,authTxnId:_}}),et(!1),at(REGISTRATION_TYPE.CREATE),yt(LOADING_STATE.RESOLVED),St(SCREEN_NAMES.ABHA_OTP_AND_MOBILE);return}if(At({name:"abha_registration_init_failure",data:{error_message:Yt||"unknown_error",error_message_exists:!!Yt,authTxnId:_,error_action:Wt,error_action_exists:!!Wt}}),_t(Yt||"Something went wrong"),yt(LOADING_STATE.REJECTED),Wt||Yt){et(!0),(Ht=Wt==null?void 0:Wt.cta)!=null&&Ht.pid?St(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):_t(Yt||"Something went wrong");return}}},It=jt=>{const Ht=jt.replace(/-/g,""),Lt=Ht.slice(0,2),Yt=Ht.slice(2).match(/.{1,4}/g)||[];return[Lt,...Yt]};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-16 pds2-bg-bg-01 pds2-space-y-16 pds2-text-center pds2-rounded-b-24 pds2-pt-22",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-items-center pds2-gap-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-bg-bg-white pds2-rounded-16",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-64 pds2-h-64"})})}),jsxRuntimeExports.jsx("div",{className:"Heading3Semibold pds2-text-text-black",children:"Complete KYC"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-03",style:{marginTop:"4px"},children:a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?"using existing ABHA Number":a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"using your Aadhaar Number":""}),jsxRuntimeExports.jsx("div",{className:"pds2-w-full",children:jsxRuntimeExports.jsxs("div",{className:"pds2-relative pds2-flex pds2-bg-bg-seperator-dark pds2-rounded-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-top-0 pds2-bottom-0 pds2-bg-bg-white pds2-rounded-12 pds2-transition-all pds2-duration-300",style:{left:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?0:"50%",width:"50%",boxShadow:"0px 10px 4px -6px #18274B17"}}),jsxRuntimeExports.jsxs("button",{onClick:()=>{$(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),_t("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm5mcdm3h00070tfs9fjkepff.webp",alt:"aadhaar-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?{fontWeight:700}:{fontWeight:400},children:"Aadhaar"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{$(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),_t("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm6hreldp000b0tfwf0nj156l.webp",alt:"abha-abdm-icon",className:"pds2-w-26 pds2-h-26"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?{fontWeight:700}:{fontWeight:400},children:"ABHA number"})]})]})}),jsxRuntimeExports.jsx("div",{className:"pds2-mt-16 pds2-w-full pds2-max-w-md pds2-mx-auto pds2-px-4 pds2-relative pds2-pb-20 pds2-pt-10",children:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?jsxRuntimeExports.jsx(AbhaInputComponent,{isAbhaNum:!1,initialValues:it===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!_e?(ot==null?void 0:ot.match(/.{1,4}/g))??void 0:(Dt==null?void 0:Dt.match(/.{1,4}/g))??void 0,disabled:!_e&&it===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!!ot,numberOfInputs:3,length:4,placeholder:"XXXX",onSubmit:Tt,setIsValid:Pt,setValue:Rt,setError:_t},"aadhaar-input"):jsxRuntimeExports.jsx(AbhaInputComponent,{isAbhaNum:!0,initialValues:it===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!_e?(ot==null?void 0:ot.match(/.{1,4}/g))??void 0:It(kt)??void 0,disabled:!_e&&it===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!!ot,numberOfInputs:4,length:4,placeholder:"XXXX",onSubmit:Ot,setIsValid:Mt,setValue:xt,setError:_t},"abha-number-input")}),Et&&jsxRuntimeExports.jsx("div",{className:`${Et.includes("KYC ABHA not found for")?"pds2-text-text-01":"pds2-text-text-error"} !pds2-mt-0 Body3Regular`,children:Et}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!Ct||gt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:gt===LOADING_STATE.LOADING,onClick:()=>$t(),className:"pds2-w-full "})]})})},AbhaKycOtpVerifyScreen=()=>{const a=useAuthAbhaStore(Rt=>Rt.txnId),_=useAuthAbhaStore(Rt=>Rt.clearAbhaAuthStore),$=useAuthAbhaStore(Rt=>Rt.kycOtpSentToHint),_e=useAuthAbhaStore(Rt=>Rt.loginIdentifierValue),et=useAuthAbhaStore(Rt=>Rt.abhaAuthFlowMethod),tt=useAuthAbhaStore(Rt=>Rt.goBackLoginScreen),rt=useAuthAbhaStore(Rt=>Rt.setTxnId),nt=useAuthAbhaStore(Rt=>Rt.setBottomsheetErrorInfo),[at,st]=reactExports.useState(!1),[it,ot]=reactExports.useState(""),[lt,ht]=reactExports.useState(!1),[pt,dt]=reactExports.useState(""),[mt,ct]=reactExports.useState(LOADING_STATE.IDLE),ft=useAuthAbhaStore(Rt=>Rt.isEkaAppLogin),ut=useAuthAbhaStore(Rt=>Rt.clientId),gt=useAuthAbhaStore(Rt=>Rt.initAbhaFlow),yt=useAuthAbhaStore(Rt=>Rt.isNewLoginOrCreateFlow),[Et,_t]=reactExports.useState(!1),St=GET_EXTRA_HEADERS(),wt=({name:Rt,data:kt={}})=>{var vt,At;const bt={...{login_platform:ut,is_eka_app_login:ft?"true":"false",is_new_kyc_or_create_flow:yt?"true":"false",txn_id:a||"missing txnId",oid:St!=null&&St["X-User-ID"]?"true":"false",access_token:St!=null&&St.auth?"true":"false"},...kt};handleSendEvent({eventName:Rt,eventData:bt}),(At=(vt=window.curio)==null?void 0:vt.pushToMixpanel)==null||At.call(vt,Rt,bt)};reactExports.useEffect(()=>{wt({name:"page_view",data:{page_view:"abha_kyc_otp_verify",platform:ut}})},[]);const Pt=()=>{wt({name:"abha_kyc_otp_verify_error_bottomsheet_dismissed",data:{platform:ut}}),tt();const Rt=ut,kt=useAuthAbhaStore.getState().isEkaAppLogin;_(),useAuthAbhaStore.setState({clientId:Rt}),useAuthAbhaStore.setState({isEkaAppLogin:kt})},Nt=({otp:Rt})=>{ot(Rt),wt({name:"abha_kyc_otp_completion",data:{type:"verify",platform:ut,txn_id:a,otp_entered:!0,method:et}}),Mt(Rt)},Mt=async Rt=>{if(!a){wt({name:"abha_kyc_otp_verify_txnId_not_found",data:{type:"verify",platform:ut,txn_id:a||"missing_txn_id",txn_id_exists:!!a,method:(et==null?void 0:et.toLowerCase())||"unknown_method"}});return}wt({name:"abha_kyc_otp_verify",data:{type:"verify",platform:ut,txn_id:a}}),ct(LOADING_STATE.LOADING);const{txn_id:kt,error:xt,action:bt}=await postAbdmKycVerify({otp:Rt,txn_id:a});if(bt){wt({name:"abha_kyc_otp_verify_error_action",data:{type:"verify",platform:ut,error_action:bt||"no_error_action",error_message:xt||"no_error_message",error_action_exists:!!bt,error_message_exists:!!xt}}),nt(bt);return}if(xt){wt({name:"abha_kyc_otp_verify_error",data:{type:"verify",platform:ut,error_message:xt||"unknown_error",error_message_exists:!!xt}}),ct(LOADING_STATE.REJECTED),dt(xt);return}ct(LOADING_STATE.RESOLVED),kt&&(_t(!0),ut==="phr"?setTimeout(()=>{onKYCSuccess("KYC verify success, onKYCSuccess called,next abha unmount"),unMount()},3e3):(onKYCSuccess("KYC verify success, onKYCSuccess called, next page redirect"),setTimeout(()=>{window.location.href="https://www.eka.care/s/for-patients"},3e3)))},Dt=async()=>{if(_e&&et){const{txn_id:Rt}=await postAbdmKycVerifyResendOtp({txn_id:a??""});wt({name:"abha_kyc_verify_resend_otp",data:{method:et,platform:ut,txn_id:Rt}}),Rt&&rt(Rt)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et?jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:!Et,loadingText:"KYC verify in progress...",successText:"KYC Verified Successfully!"}):jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsx(AbhaHeader,{prefixIcon:jsxRuntimeExports.jsx("button",{className:"pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple",onClick:()=>st(!0),children:jsxRuntimeExports.jsx(n$4,{className:""})}),title:"OTP Verification",suffixIcon:jsxRuntimeExports.jsx(p$3,{className:"pds2-w-20 pds2-h-20"}),className:"pds2-border-b-1 pds2-border-bg-seperator-dark"}),gt?jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-bg-01"}):jsxRuntimeExports.jsx(AbhaStepper,{}),jsxRuntimeExports.jsx("div",{className:"pds2-p-16 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-bg-01",children:jsxRuntimeExports.jsx(AbhaOtpCard,{otpSentToText:$||"Enter OTP sent on mobile number linked with your Aadhaar",onOtpCompletion:Nt,onResendOtpClick:Dt,error:pt,setIsValid:Rt=>{pt&&dt(null),ht(Rt)},prefixIcon:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm6hreldp000b0tfwf0nj156l.webp",alt:"abdm-abha-icon",className:"pds2-w-48"})})}),jsxRuntimeExports.jsx("div",{className:"pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-bg-white pds2-w-full pds2-border pds2-border-border-brand-02",children:jsxRuntimeExports.jsx(Pds2Button,{title:"Verify",state:!lt||mt===LOADING_STATE.LOADING?"disabled":"enabled",className:"pds2-w-full",onClick:()=>Mt(it),isLoading:mt===LOADING_STATE.LOADING})}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:Pt}),jsxRuntimeExports.jsx(ExitPopup,{open:at,setOpen:st})]})})};var lib={},propTypes$2={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function a(_e,et,tt,rt,nt,at){if(at!==ReactPropTypesSecret){var st=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw st.name="Invariant Violation",st}}a.isRequired=a;function _(){return a}var $={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:_,element:a,elementType:a,instanceOf:_,node:a,objectOf:_,oneOf:_,oneOfType:_,shape:_,exact:_,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return $.PropTypes=$,$};propTypes$2.exports=factoryWithThrowingShims();var propTypesExports=propTypes$2.exports,ErrorCorrectLevel={L:1,M:0,Q:3,H:2},mode$1={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},mode=mode$1;function QR8bitByte(a){this.mode=mode.MODE_8BIT_BYTE,this.data=a}QR8bitByte.prototype={getLength:function(a){return this.data.length},write:function(a){for(var _=0;_<this.data.length;_++)a.put(this.data.charCodeAt(_),8)}};var _8BitByte=QR8bitByte,ECL=ErrorCorrectLevel;function QRRSBlock(a,_){this.totalCount=a,this.dataCount=_}QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(a,_){var $=QRRSBlock.getRsBlockTable(a,_);if($==null)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+_);for(var _e=$.length/3,et=new Array,tt=0;tt<_e;tt++)for(var rt=$[tt*3+0],nt=$[tt*3+1],at=$[tt*3+2],st=0;st<rt;st++)et.push(new QRRSBlock(nt,at));return et};QRRSBlock.getRsBlockTable=function(a,_){switch(_){case ECL.L:return QRRSBlock.RS_BLOCK_TABLE[(a-1)*4+0];case ECL.M:return QRRSBlock.RS_BLOCK_TABLE[(a-1)*4+1];case ECL.Q:return QRRSBlock.RS_BLOCK_TABLE[(a-1)*4+2];case ECL.H:return QRRSBlock.RS_BLOCK_TABLE[(a-1)*4+3];default:return}};var RSBlock$1=QRRSBlock;function QRBitBuffer(){this.buffer=new Array,this.length=0}QRBitBuffer.prototype={get:function(a){var _=Math.floor(a/8);return(this.buffer[_]>>>7-a%8&1)==1},put:function(a,_){for(var $=0;$<_;$++)this.putBit((a>>>_-$-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(a){var _=Math.floor(this.length/8);this.buffer.length<=_&&this.buffer.push(0),a&&(this.buffer[_]|=128>>>this.length%8),this.length++}};var BitBuffer$1=QRBitBuffer,QRMath={glog:function(a){if(a<1)throw new Error("glog("+a+")");return QRMath.LOG_TABLE[a]},gexp:function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return QRMath.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++)QRMath.EXP_TABLE[i]=1<<i;for(var i=8;i<256;i++)QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];for(var i=0;i<255;i++)QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;var math$2=QRMath,math$1=math$2;function QRPolynomial(a,_){if(a.length==null)throw new Error(a.length+"/"+_);for(var $=0;$<a.length&&a[$]==0;)$++;this.num=new Array(a.length-$+_);for(var _e=0;_e<a.length-$;_e++)this.num[_e]=a[_e+$]}QRPolynomial.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var _=new Array(this.getLength()+a.getLength()-1),$=0;$<this.getLength();$++)for(var _e=0;_e<a.getLength();_e++)_[$+_e]^=math$1.gexp(math$1.glog(this.get($))+math$1.glog(a.get(_e)));return new QRPolynomial(_,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var _=math$1.glog(this.get(0))-math$1.glog(a.get(0)),$=new Array(this.getLength()),_e=0;_e<this.getLength();_e++)$[_e]=this.get(_e);for(var _e=0;_e<a.getLength();_e++)$[_e]^=math$1.gexp(math$1.glog(a.get(_e))+_);return new QRPolynomial($,0).mod(a)}};var Polynomial$2=QRPolynomial,Mode=mode$1,Polynomial$1=Polynomial$2,math=math$2,QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var _=a<<10;QRUtil.getBCHDigit(_)-QRUtil.getBCHDigit(QRUtil.G15)>=0;)_^=QRUtil.G15<<QRUtil.getBCHDigit(_)-QRUtil.getBCHDigit(QRUtil.G15);return(a<<10|_)^QRUtil.G15_MASK},getBCHTypeNumber:function(a){for(var _=a<<12;QRUtil.getBCHDigit(_)-QRUtil.getBCHDigit(QRUtil.G18)>=0;)_^=QRUtil.G18<<QRUtil.getBCHDigit(_)-QRUtil.getBCHDigit(QRUtil.G18);return a<<12|_},getBCHDigit:function(a){for(var _=0;a!=0;)_++,a>>>=1;return _},getPatternPosition:function(a){return QRUtil.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,_,$){switch(a){case QRMaskPattern.PATTERN000:return(_+$)%2==0;case QRMaskPattern.PATTERN001:return _%2==0;case QRMaskPattern.PATTERN010:return $%3==0;case QRMaskPattern.PATTERN011:return(_+$)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(_/2)+Math.floor($/3))%2==0;case QRMaskPattern.PATTERN101:return _*$%2+_*$%3==0;case QRMaskPattern.PATTERN110:return(_*$%2+_*$%3)%2==0;case QRMaskPattern.PATTERN111:return(_*$%3+(_+$)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var _=new Polynomial$1([1],0),$=0;$<a;$++)_=_.multiply(new Polynomial$1([1,math.gexp($)],0));return _},getLengthInBits:function(a,_){if(1<=_&&_<10)switch(a){case Mode.MODE_NUMBER:return 10;case Mode.MODE_ALPHA_NUM:return 9;case Mode.MODE_8BIT_BYTE:return 8;case Mode.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(_<27)switch(a){case Mode.MODE_NUMBER:return 12;case Mode.MODE_ALPHA_NUM:return 11;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else if(_<41)switch(a){case Mode.MODE_NUMBER:return 14;case Mode.MODE_ALPHA_NUM:return 13;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}else throw new Error("type:"+_)},getLostPoint:function(a){for(var _=a.getModuleCount(),$=0,_e=0;_e<_;_e++)for(var et=0;et<_;et++){for(var tt=0,rt=a.isDark(_e,et),nt=-1;nt<=1;nt++)if(!(_e+nt<0||_<=_e+nt))for(var at=-1;at<=1;at++)et+at<0||_<=et+at||nt==0&&at==0||rt==a.isDark(_e+nt,et+at)&&tt++;tt>5&&($+=3+tt-5)}for(var _e=0;_e<_-1;_e++)for(var et=0;et<_-1;et++){var st=0;a.isDark(_e,et)&&st++,a.isDark(_e+1,et)&&st++,a.isDark(_e,et+1)&&st++,a.isDark(_e+1,et+1)&&st++,(st==0||st==4)&&($+=3)}for(var _e=0;_e<_;_e++)for(var et=0;et<_-6;et++)a.isDark(_e,et)&&!a.isDark(_e,et+1)&&a.isDark(_e,et+2)&&a.isDark(_e,et+3)&&a.isDark(_e,et+4)&&!a.isDark(_e,et+5)&&a.isDark(_e,et+6)&&($+=40);for(var et=0;et<_;et++)for(var _e=0;_e<_-6;_e++)a.isDark(_e,et)&&!a.isDark(_e+1,et)&&a.isDark(_e+2,et)&&a.isDark(_e+3,et)&&a.isDark(_e+4,et)&&!a.isDark(_e+5,et)&&a.isDark(_e+6,et)&&($+=40);for(var it=0,et=0;et<_;et++)for(var _e=0;_e<_;_e++)a.isDark(_e,et)&&it++;var ot=Math.abs(100*it/_/_-50)/5;return $+=ot*10,$}},util$1=QRUtil,BitByte=_8BitByte,RSBlock=RSBlock$1,BitBuffer=BitBuffer$1,util=util$1,Polynomial=Polynomial$2;function QRCode$1(a,_){this.typeNumber=a,this.errorCorrectLevel=_,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var proto=QRCode$1.prototype;proto.addData=function(a){var _=new BitByte(a);this.dataList.push(_),this.dataCache=null};proto.isDark=function(a,_){if(a<0||this.moduleCount<=a||_<0||this.moduleCount<=_)throw new Error(a+","+_);return this.modules[a][_]};proto.getModuleCount=function(){return this.moduleCount};proto.make=function(){if(this.typeNumber<1){var a=1;for(a=1;a<40;a++){for(var _=RSBlock.getRSBlocks(a,this.errorCorrectLevel),$=new BitBuffer,_e=0,et=0;et<_.length;et++)_e+=_[et].dataCount;for(var et=0;et<this.dataList.length;et++){var tt=this.dataList[et];$.put(tt.mode,4),$.put(tt.getLength(),util.getLengthInBits(tt.mode,a)),tt.write($)}if($.getLengthInBits()<=_e*8)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())};proto.makeImpl=function(a,_){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var $=0;$<this.moduleCount;$++){this.modules[$]=new Array(this.moduleCount);for(var _e=0;_e<this.moduleCount;_e++)this.modules[$][_e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,_),this.typeNumber>=7&&this.setupTypeNumber(a),this.dataCache==null&&(this.dataCache=QRCode$1.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,_)};proto.setupPositionProbePattern=function(a,_){for(var $=-1;$<=7;$++)if(!(a+$<=-1||this.moduleCount<=a+$))for(var _e=-1;_e<=7;_e++)_+_e<=-1||this.moduleCount<=_+_e||(0<=$&&$<=6&&(_e==0||_e==6)||0<=_e&&_e<=6&&($==0||$==6)||2<=$&&$<=4&&2<=_e&&_e<=4?this.modules[a+$][_+_e]=!0:this.modules[a+$][_+_e]=!1)};proto.getBestMaskPattern=function(){for(var a=0,_=0,$=0;$<8;$++){this.makeImpl(!0,$);var _e=util.getLostPoint(this);($==0||a>_e)&&(a=_e,_=$)}return _};proto.createMovieClip=function(a,_,$){var _e=a.createEmptyMovieClip(_,$),et=1;this.make();for(var tt=0;tt<this.modules.length;tt++)for(var rt=tt*et,nt=0;nt<this.modules[tt].length;nt++){var at=nt*et,st=this.modules[tt][nt];st&&(_e.beginFill(0,100),_e.moveTo(at,rt),_e.lineTo(at+et,rt),_e.lineTo(at+et,rt+et),_e.lineTo(at,rt+et),_e.endFill())}return _e};proto.setupTimingPattern=function(){for(var a=8;a<this.moduleCount-8;a++)this.modules[a][6]==null&&(this.modules[a][6]=a%2==0);for(var _=8;_<this.moduleCount-8;_++)this.modules[6][_]==null&&(this.modules[6][_]=_%2==0)};proto.setupPositionAdjustPattern=function(){for(var a=util.getPatternPosition(this.typeNumber),_=0;_<a.length;_++)for(var $=0;$<a.length;$++){var _e=a[_],et=a[$];if(this.modules[_e][et]==null)for(var tt=-2;tt<=2;tt++)for(var rt=-2;rt<=2;rt++)tt==-2||tt==2||rt==-2||rt==2||tt==0&&rt==0?this.modules[_e+tt][et+rt]=!0:this.modules[_e+tt][et+rt]=!1}};proto.setupTypeNumber=function(a){for(var _=util.getBCHTypeNumber(this.typeNumber),$=0;$<18;$++){var _e=!a&&(_>>$&1)==1;this.modules[Math.floor($/3)][$%3+this.moduleCount-8-3]=_e}for(var $=0;$<18;$++){var _e=!a&&(_>>$&1)==1;this.modules[$%3+this.moduleCount-8-3][Math.floor($/3)]=_e}};proto.setupTypeInfo=function(a,_){for(var $=this.errorCorrectLevel<<3|_,_e=util.getBCHTypeInfo($),et=0;et<15;et++){var tt=!a&&(_e>>et&1)==1;et<6?this.modules[et][8]=tt:et<8?this.modules[et+1][8]=tt:this.modules[this.moduleCount-15+et][8]=tt}for(var et=0;et<15;et++){var tt=!a&&(_e>>et&1)==1;et<8?this.modules[8][this.moduleCount-et-1]=tt:et<9?this.modules[8][15-et-1+1]=tt:this.modules[8][15-et-1]=tt}this.modules[this.moduleCount-8][8]=!a};proto.mapData=function(a,_){for(var $=-1,_e=this.moduleCount-1,et=7,tt=0,rt=this.moduleCount-1;rt>0;rt-=2)for(rt==6&&rt--;;){for(var nt=0;nt<2;nt++)if(this.modules[_e][rt-nt]==null){var at=!1;tt<a.length&&(at=(a[tt]>>>et&1)==1);var st=util.getMask(_,_e,rt-nt);st&&(at=!at),this.modules[_e][rt-nt]=at,et--,et==-1&&(tt++,et=7)}if(_e+=$,_e<0||this.moduleCount<=_e){_e-=$,$=-$;break}}};QRCode$1.PAD0=236;QRCode$1.PAD1=17;QRCode$1.createData=function(a,_,$){for(var _e=RSBlock.getRSBlocks(a,_),et=new BitBuffer,tt=0;tt<$.length;tt++){var rt=$[tt];et.put(rt.mode,4),et.put(rt.getLength(),util.getLengthInBits(rt.mode,a)),rt.write(et)}for(var nt=0,tt=0;tt<_e.length;tt++)nt+=_e[tt].dataCount;if(et.getLengthInBits()>nt*8)throw new Error("code length overflow. ("+et.getLengthInBits()+">"+nt*8+")");for(et.getLengthInBits()+4<=nt*8&&et.put(0,4);et.getLengthInBits()%8!=0;)et.putBit(!1);for(;!(et.getLengthInBits()>=nt*8||(et.put(QRCode$1.PAD0,8),et.getLengthInBits()>=nt*8));)et.put(QRCode$1.PAD1,8);return QRCode$1.createBytes(et,_e)};QRCode$1.createBytes=function(a,_){for(var $=0,_e=0,et=0,tt=new Array(_.length),rt=new Array(_.length),nt=0;nt<_.length;nt++){var at=_[nt].dataCount,st=_[nt].totalCount-at;_e=Math.max(_e,at),et=Math.max(et,st),tt[nt]=new Array(at);for(var it=0;it<tt[nt].length;it++)tt[nt][it]=255&a.buffer[it+$];$+=at;var ot=util.getErrorCorrectPolynomial(st),lt=new Polynomial(tt[nt],ot.getLength()-1),ht=lt.mod(ot);rt[nt]=new Array(ot.getLength()-1);for(var it=0;it<rt[nt].length;it++){var pt=it+ht.getLength()-rt[nt].length;rt[nt][it]=pt>=0?ht.get(pt):0}}for(var dt=0,it=0;it<_.length;it++)dt+=_[it].totalCount;for(var mt=new Array(dt),ct=0,it=0;it<_e;it++)for(var nt=0;nt<_.length;nt++)it<tt[nt].length&&(mt[ct++]=tt[nt][it]);for(var it=0;it<et;it++)for(var nt=0;nt<_.length;nt++)it<rt[nt].length&&(mt[ct++]=rt[nt][it]);return mt};var QRCode_1=QRCode$1,QRCodeSvg$1={};Object.defineProperty(QRCodeSvg$1,"__esModule",{value:!0});var _extends$1=Object.assign||function(a){for(var _=1;_<arguments.length;_++){var $=arguments[_];for(var _e in $)Object.prototype.hasOwnProperty.call($,_e)&&(a[_e]=$[_e])}return a},_propTypes$1=propTypesExports,_propTypes2$1=_interopRequireDefault$1(_propTypes$1),_react$1=reactExports,_react2$1=_interopRequireDefault$1(_react$1);function _interopRequireDefault$1(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties$1(a,_){var $={};for(var _e in a)_.indexOf(_e)>=0||Object.prototype.hasOwnProperty.call(a,_e)&&($[_e]=a[_e]);return $}var propTypes$1={bgColor:_propTypes2$1.default.oneOfType([_propTypes2$1.default.object,_propTypes2$1.default.string]).isRequired,bgD:_propTypes2$1.default.string.isRequired,fgColor:_propTypes2$1.default.oneOfType([_propTypes2$1.default.object,_propTypes2$1.default.string]).isRequired,fgD:_propTypes2$1.default.string.isRequired,size:_propTypes2$1.default.number.isRequired,title:_propTypes2$1.default.string,viewBoxSize:_propTypes2$1.default.number.isRequired,xmlns:_propTypes2$1.default.string},QRCodeSvg=(0,_react$1.forwardRef)(function(a,_){var $=a.bgColor,_e=a.bgD,et=a.fgD,tt=a.fgColor,rt=a.size,nt=a.title,at=a.viewBoxSize,st=a.xmlns,it=st===void 0?"http://www.w3.org/2000/svg":st,ot=_objectWithoutProperties$1(a,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return _react2$1.default.createElement("svg",_extends$1({},ot,{height:rt,ref:_,viewBox:"0 0 "+at+" "+at,width:rt,xmlns:it}),nt?_react2$1.default.createElement("title",null,nt):null,_react2$1.default.createElement("path",{d:_e,fill:$}),_react2$1.default.createElement("path",{d:et,fill:tt}))});QRCodeSvg.displayName="QRCodeSvg";QRCodeSvg.propTypes=propTypes$1;QRCodeSvg$1.default=QRCodeSvg;Object.defineProperty(lib,"__esModule",{value:!0});lib.QRCode=void 0;var _extends=Object.assign||function(a){for(var _=1;_<arguments.length;_++){var $=arguments[_];for(var _e in $)Object.prototype.hasOwnProperty.call($,_e)&&(a[_e]=$[_e])}return a},_propTypes=propTypesExports,_propTypes2=_interopRequireDefault(_propTypes),_ErrorCorrectLevel=ErrorCorrectLevel,_ErrorCorrectLevel2=_interopRequireDefault(_ErrorCorrectLevel),_QRCode=QRCode_1,_QRCode2=_interopRequireDefault(_QRCode),_react=reactExports,_react2=_interopRequireDefault(_react),_QRCodeSvg=QRCodeSvg$1,_QRCodeSvg2=_interopRequireDefault(_QRCodeSvg);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,_){var $={};for(var _e in a)_.indexOf(_e)>=0||Object.prototype.hasOwnProperty.call(a,_e)&&($[_e]=a[_e]);return $}var propTypes={bgColor:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.string]),fgColor:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.string]),level:_propTypes2.default.string,size:_propTypes2.default.number,value:_propTypes2.default.string.isRequired},QRCode=(0,_react.forwardRef)(function(a,_){var $=a.bgColor,_e=$===void 0?"#FFFFFF":$,et=a.fgColor,tt=et===void 0?"#000000":et,rt=a.level,nt=rt===void 0?"L":rt,at=a.size,st=at===void 0?256:at,it=a.value,ot=_objectWithoutProperties(a,["bgColor","fgColor","level","size","value"]),lt=new _QRCode2.default(-1,_ErrorCorrectLevel2.default[nt]);lt.addData(it),lt.make();var ht=lt.modules;return _react2.default.createElement(_QRCodeSvg2.default,_extends({},ot,{bgColor:_e,bgD:ht.map(function(pt,dt){return pt.map(function(mt,ct){return mt?"":"M "+ct+" "+dt+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:tt,fgD:ht.map(function(pt,dt){return pt.map(function(mt,ct){return mt?"M "+ct+" "+dt+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:_,size:st,viewBoxSize:ht.length}))});lib.QRCode=QRCode;QRCode.displayName="QRCode";QRCode.propTypes=propTypes;var _default=lib.default=QRCode;const AbhaFaceAuthStepsCarousel=({onClose:a})=>{const _=reactExports.useRef(null),$=_e=>{_.current&&_.current.scrollBy({left:_e,behavior:"smooth"})};return jsxRuntimeExports.jsxs("div",{className:"pds2-w-full pds2-pb-10 pds2-mt-25 pds2-relative",children:[jsxRuntimeExports.jsxs("div",{className:"Body1Semibold pds2-text-text-03 pds2-text-left pds2-w-full pds2-py-4 pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{children:"Follow these steps"}),jsxRuntimeExports.jsx("div",{className:"pds2-pr-5 pds2-cursor-pointer",title:"Close Carousel",onClick:a,children:"x"})]}),jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,onClick:()=>$(240),onKeyDown:_e=>_e.key==="Enter"&&$(240),className:"pds2-shadow-elevation-100 pds2-shadow-text-black pds2-absolute pds2-right-0 pds2-cursor-pointer pds2-bottom-110 pds2-bg-bg-seperator-dark pds2-rounded-full pds2-p-5",children:jsxRuntimeExports.jsx(l$6,{className:"pds2-text-text-01"})}),jsxRuntimeExports.jsx("div",{ref:_,className:"Body1Semibold pds2-text-text-03 pds2-flex pds2-overflow-x-scroll pds2-gap-16 pds2-w-full",children:FACE_AUTH_STEPS_URL.map((_e,et)=>jsxRuntimeExports.jsx("div",{className:"pds2-w-1/4 pds2-min-w-220 pds2-min-h-200px",children:jsxRuntimeExports.jsx("img",{className:"pds2-w-full pds2-shadow-elevation-100 pds2-shadow-border-neutral/50",src:_e})},et))}),jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,onClick:()=>$(-240),onKeyDown:_e=>_e.key==="Enter"&&$(-240),className:"pds2-shadow-elevation-100 pds2-shadow-text-black pds2-absolute pds2-cursor-pointer pds2-bottom-110 pds2-bg-bg-seperator-dark pds2-rounded-full pds2-p-5",children:jsxRuntimeExports.jsx(n$4,{className:"pds2-text-text-01"})})]})},AbhaAuthQRScreen=()=>{var Dt;const a=useAuthAbhaStore(Rt=>Rt.txnId),_=useAuthAbhaStore(Rt=>Rt.setTxnId),$=useAuthAbhaStore(Rt=>Rt.setScreen),_e=useAuthAbhaStore(Rt=>Rt.goBackScreen),et=useAuthAbhaStore(Rt=>Rt.setGoBackToLogin),tt=useAuthAbhaStore(Rt=>Rt.faceAuthQrUrl),rt=useAuthAbhaStore(Rt=>Rt.identifierValue),nt=useAuthAbhaStore(Rt=>Rt.initAbhaFlow),at=useAuthAbhaStore(Rt=>Rt.isEkaAppLogin),st=useAuthAbhaStore(Rt=>Rt.clientId),it=useAuthAbhaStore(Rt=>Rt.isNewLoginOrCreateFlow),ot=GET_EXTRA_HEADERS(),lt=useAuthAbhaStore(Rt=>Rt.setEkaSmallToken),ht=useAuthAbhaStore(Rt=>Rt.setSelectedAbhaAddress),pt=useAuthAbhaStore(Rt=>Rt.setOid),dt=useAuthAbhaStore(Rt=>Rt.setEkaProfileInfo),mt=useAuthAbhaStore(Rt=>Rt.setAbhaAddressList),ct=useAuthAbhaStore(Rt=>Rt.goBackLoginScreen),ft=useAuthAbhaStore(Rt=>Rt.setAadhaarVerificationSkipStateStatus),[ut,gt]=reactExports.useState(!0),[yt,Et]=reactExports.useState(!1),_t=useAuthAbhaStore(Rt=>Rt.setBottomsheetErrorInfo),[St,wt]=reactExports.useState(FACE_AUTH_CAPTURE_STATUS.PENDING),Pt=({name:Rt,data:kt={}})=>{var vt,At;const bt={...{login_platform:st,is_eka_app_login:at?"true":"false",is_new_login_or_create_flow:it?"true":"false",txn_id:a||"missing txnId",oid:ot!=null&&ot["X-User-ID"]?"true":"false",access_token:ot!=null&&ot.auth?"true":"false"},...kt};handleSendEvent({eventName:Rt,eventData:bt}),(At=(vt=window.curio)==null?void 0:vt.pushToMixpanel)==null||At.call(vt,Rt,bt)},Nt=()=>{Pt({name:"abha_faceauth_verify_error_bottomsheet_dismissed",data:{platform:st}}),ct(),_t(null)},Mt=async()=>{if(!a){Pt({name:"aadhaar_faceauth_verification_no_txnId",data:{platform:st,type:"verify",txn_id:a||"missing_txnId",txn_id_exists:!!a}});return}Pt({name:"abha_aadhaar_faceauth_verify_submitted",data:{platform:st,type:"verify"}});const{txn_id:Rt,skip_state:kt,profile:xt,eka:bt,error:vt,abha_profiles:At,source_error:Ct,action:Tt}=await postRegisterAadhaarFaceAuthVerify({aadhaar:(rt==null?void 0:rt.aadhaar_number)||"",txn_id:a});if(vt||Ct!=null&&Ct.message){Pt({name:"aadhaar_faceauth_verification_failed",data:{platform:st,reason:vt||Ct||"unknown_error",txn_id_exists:!!a}}),_t({title:"Aadhaar Verification Failed",img:"",description:vt||"Verification failed. Please retry.",cta:{title:"",pid:"",params:null}}),Tt&&_t(Tt);return}if(!Rt||!kt){Pt({name:"aadhaar_otp_verification_failed",data:{platform:st,reason:vt||"missing_txn_id_or_skip_state",txn_id_exists:!!Rt,skip_state_exists:!!kt}}),_t({title:"Verification Failed",img:"",description:vt||"Verification failed. Please retry.",cta:{title:"",pid:"",params:null}}),Tt&&_t(Tt);return}Pt({name:"aadhaar_faceauth_verification_success",data:{platform:st,skip_state:kt,oid:bt==null?void 0:bt.oid}}),ft(kt),bt!=null&&bt.min_token&&lt(bt.min_token),Rt&&_(Rt),xt&&xt.abha_address&&ht(xt.abha_address),bt!=null&&bt.oid&&pt(bt.oid),xt&&dt({date_of_birth:`${xt.year_of_birth}-${String(xt.month_of_birth).padStart(2,"0")}-${String(xt.day_of_birth).padStart(2,"0")}`,firstname:xt.first_name,lastname:xt.last_name,pincode:xt.pincode,gender:xt.gender,name:xt.first_name+" "+xt.last_name,mobile:xt.mobile,oid:bt==null?void 0:bt.oid,abha_address:xt.abha_address,abha_number:xt.abha_number,kyc_verified:xt==null?void 0:xt.kyc_verified}),Pt({name:"abha_aadhaar_otp_verification_success",data:{platform:st,skip_state:kt,oid:bt==null?void 0:bt.oid}}),At&&mt(At),$(SCREEN_NAMES.AADHAAR_FACEAUTH_VERIFICATION_STATUS)};return reactExports.useEffect(()=>{let Rt=0,kt;const xt=async()=>{Rt++;try{const bt=await postRegisterAadhaarFaceAuthCapture({txn_id:a});if(console.log("Poll attempt:",Rt,"Response:",bt),(bt==null?void 0:bt.status)==="COMPLETE"){wt(FACE_AUTH_CAPTURE_STATUS.COMPLETE),clearInterval(kt),await Mt();return}else if((bt==null?void 0:bt.status)==="VERIFIED")wt(FACE_AUTH_CAPTURE_STATUS.VERIFIED);else if((bt==null?void 0:bt.status)==="FAILED"){wt(FACE_AUTH_CAPTURE_STATUS.FAILED),clearInterval(kt),_t({title:"Authentication Failed",img:"",description:"Face capture failed. Please retry.",cta:{title:"",pid:"",params:null}});return}}catch(bt){console.error("Error in face auth poll:",bt)}};return xt(),kt=setInterval(xt,3e3),()=>clearInterval(kt)},[a]),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsx(AbhaHeader,{title:"Face Authentication",className:"pds2-border-b-1 pds2-border-bg-seperator-dark",prefixIcon:jsxRuntimeExports.jsx("button",{className:"pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple",onClick:()=>Et(!0),children:jsxRuntimeExports.jsx(n$4,{className:""})})}),!nt&&St===FACE_AUTH_CAPTURE_STATUS.PENDING?jsxRuntimeExports.jsx(AbhaStepper,{}):jsxRuntimeExports.jsx("div",{className:`pds2-pt-40 ${St===FACE_AUTH_CAPTURE_STATUS.FAILED?"":"pds2-bg-bg-01"}`}),St===FACE_AUTH_CAPTURE_STATUS.PENDING&&jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-pb-16 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-bg-01",children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-items-center pds2-text-center ",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"Body2Regular pds2-text-text-03 pds2-py-15",children:["Aadhaar:"," ",jsxRuntimeExports.jsx("span",{className:"Body2Semibold pds2-text-text-03",children:(Dt=rt==null?void 0:rt.aadhaar_number)==null?void 0:Dt.replace(/(.{4})/g,"$1-").replace(/-$/,"")})]}),jsxRuntimeExports.jsx("div",{title:"Change",className:"pds2-cursor-pointer pds2-pl-5",onClick:()=>{_e(),et(!0)},children:jsxRuntimeExports.jsx(i$1,{})})]}),jsxRuntimeExports.jsx("div",{className:"Heading3Semibold pds2-text-text-01",children:"Face Authentication"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-mb-25 pds2-text-text-03",children:"Scan this QR and complete authentication"}),jsxRuntimeExports.jsx(_default,{className:"pds2-w-250 pds2-h-250",bgColor:"#f2f4f7",value:tt||" "}),ut&&jsxRuntimeExports.jsx(AbhaFaceAuthStepsCarousel,{onClose:()=>gt(!1)})]})}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:Nt}),jsxRuntimeExports.jsx(ExitPopup,{open:yt,setOpen:Et}),St!=FACE_AUTH_CAPTURE_STATUS.PENDING&&St!=FACE_AUTH_CAPTURE_STATUS.FAILED&&jsxRuntimeExports.jsx("div",{className:"pds2-bg-bg-01 pds2-px-16 pds2-w-full pds2-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData:animationDataLoading$1,loop:!0,className:"pds2-w-400"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-01 Heading4Semibold pds2-absolute pds2-mt-220",children:"Verification in Progress..."})]})})]})},AbhaMobileandOtpScreen=()=>{const[a,_]=reactExports.useState(LOADING_STATE.IDLE),$=useAuthAbhaStore(Bt=>Bt.authTxnId),_e=useAuthAbhaStore(Bt=>Bt.setAbhaAddressList),et=useAuthAbhaStore(Bt=>Bt.setScreen),tt=useAuthAbhaStore(Bt=>Bt.identifierValue),rt=useAuthAbhaStore(Bt=>Bt.txnId),nt=useAuthAbhaStore(Bt=>Bt.setTxnId),at=useAuthAbhaStore(Bt=>Bt.aadhaarOtpSentToHint),st=useAuthAbhaStore(Bt=>Bt.setAadhaarVerificationSkipStateStatus),it=useAuthAbhaStore(Bt=>Bt.selectedAbhaFlow),ot=useAuthAbhaStore(Bt=>Bt.setEkaSmallToken),lt=useAuthAbhaStore(Bt=>Bt.setOid);useAuthAbhaStore(Bt=>Bt.clearAbhaAuthStore);const ht=useAuthAbhaStore(Bt=>Bt.setBottomsheetErrorInfo),pt=useAuthAbhaStore(Bt=>Bt.goBackLoginScreen),dt=useAuthAbhaStore(Bt=>Bt.goBackScreen),mt=useAuthAbhaStore(Bt=>Bt.isDocAppRequest),[ct,ft]=reactExports.useState(""),[ut,gt]=reactExports.useState(!1),[yt,Et]=reactExports.useState(mt?tt==null?void 0:tt.mobile:""),[_t,St]=reactExports.useState(null),[wt,Pt]=reactExports.useState(null),Nt=useAuthAbhaStore(Bt=>Bt.setSelectedAbhaAddress),Mt=useAuthAbhaStore(Bt=>Bt.setEkaProfileInfo),Dt=useAuthAbhaStore(Bt=>Bt.setMobileInitResponse),Rt=useAuthAbhaStore(Bt=>Bt.clientId),kt=useAuthAbhaStore(Bt=>Bt.isEkaAppLogin),xt=useAuthAbhaStore(Bt=>Bt.isNewLoginOrCreateFlow),bt=useAuthAbhaStore(Bt=>Bt.initAbhaFlow),vt=useAuthAbhaStore(Bt=>Bt.setIsInitApiTriggered),At=useAuthAbhaStore(Bt=>Bt.setAbhaAuthFlowMethod),Ct=useAuthAbhaStore(Bt=>Bt.setIdentifierValue),Tt=GET_EXTRA_HEADERS(),Ot=useAuthAbhaStore(Bt=>Bt.abhaAuthFlowMethod),[$t,It]=reactExports.useState(!1),jt=({name:Bt,data:zt={}})=>{var rr,Zt;const Qt={...{login_platform:Rt,is_eka_app_login:kt?"true":"false",is_new_login_or_create_flow:xt?"true":"false",txn_id:rt||"missing txnId",oid:Tt!=null&&Tt["X-User-ID"]?"true":"false",access_token:Tt!=null&&Tt.auth?"true":"false",flow:Ot??""},...zt};handleSendEvent({eventName:Bt,eventData:Qt}),(Zt=(rr=window.curio)==null?void 0:rr.pushToMixpanel)==null||Zt.call(rr,Bt,Qt)};reactExports.useEffect(()=>{jt({name:"page_view",data:{page_view:"abha_mobile_otp_verify",platform:Rt}})},[]);const Ht=({otp:Bt})=>{ft(Bt),jt({name:"abha_mobile_otp_completion",data:{platform:Rt,type:"verify",otp_entered:!0}}),Vt(Bt)},Lt=async()=>{if(!rt){jt({name:"abha_mobile_otp_resend_clicked_no_txnId",data:{type:"resend",platform:Rt,txn_id:"missing_txnId",txn_id_exists:!1}});return}jt({name:"abha_mobile_otp_verify_clicks",data:{type:"resend",platform:Rt}}),console.log("selectedMethod",Ot);let Bt;it==="mobile"?(jt({name:"abha_mobile_otp_resend_initiated",data:{platform:Rt,type:"verify",flow_type:it}}),console.log("selectedFlow is mobile, so triggering mobile resend otp api",it),Bt=await postAbdmRegisterMobileResendOtp({txn_id:rt})):(jt({name:"aadhaar_mobile_otp_resend_initiated",data:{platform:Rt,type:"verify",flow_type:it}}),console.log("selectedFlow is aadhaar, so triggering aadhaar resend otp api",it),Bt=await postRegisterAadhaarMobileResendOtp({txn_id:rt}));const{txn_id:zt,error:Gt,action:Qt}=Bt;if(!zt){jt({name:"abha_mobile_otp_resend_failed",data:{platform:Rt,reason:Gt||"no_txn_id",reason_exists:!!Gt}}),St(Gt||"Something went wrong, please try again"),Qt&&ht(Qt);return}zt&&nt(zt),jt({name:"abha_mobile_otp_resend_success",data:{platform:Rt,txn_id:zt}})},Vt=async Bt=>{if(!rt){jt({name:"abha_mobile_verify_no_txnId",data:{type:"verify",platform:Rt,txn_id:"missing_txnId",txn_id_exists:!1}});return}jt({name:"abha_mobile_otp_submitted",data:{type:"verify",platform:Rt,txn_id:rt}}),_(LOADING_STATE.LOADING);try{let zt;it==="mobile"?(jt({name:"abha_mobile_otp_verification_started",data:{platform:Rt,flow_type:it}}),zt=await postAbdmRegisterMobileVerify({otp:Bt,txn_id:rt})):(jt({name:"aadhaar_otp_verification_started",data:{platform:Rt,flow_type:it}}),zt=await postRegisterAadhaarMobileVerify({otp:Bt,txn_id:rt}));const{txn_id:Gt,skip_state:Qt,eka:rr,profile:Zt,error:vr,action:ar,abha_profiles:Jt}=zt;if(!Gt||!Qt){jt({name:"abha_mobile_otp_verification_failed",data:{platform:Rt,reason:vr||"missing_txn_id_or_skip_state",txn_id_exists:!!Gt,skip_state_exists:!!Qt}}),_(LOADING_STATE.REJECTED),St(vr||"Something went wrong, please try again"),ar&&ht(ar);return}if(_(LOADING_STATE.RESOLVED),st(Qt),rr!=null&&rr.min_token&&ot(rr.min_token),rr!=null&&rr.oid&&lt(rr.oid),Zt&&Zt.abha_address&&Nt(Zt.abha_address),Zt&&Mt({date_of_birth:`${Zt.year_of_birth}-${String(Zt.month_of_birth).padStart(2,"0")}-${String(Zt.day_of_birth).padStart(2,"0")}`,firstname:Zt.first_name,lastname:Zt.last_name,pincode:Zt.pincode,gender:Zt.gender,oid:rr==null?void 0:rr.oid,abha_address:Zt==null?void 0:Zt.abha_address,abha_number:Zt==null?void 0:Zt.abha_number,middlename:Zt==null?void 0:Zt.middle_name,kyc_verified:Zt==null?void 0:Zt.kyc_verified}),console.log("remove oid from set indvidual env"),jt({name:"abha_mobile_otp_verification_success",data:{platform:Rt,skip_state:Qt}}),Zt!=null&&Zt.abha_number&&bt==="abha-kyc"){vt(!1),Ct({abha_number:Zt==null?void 0:Zt.abha_number}),setIndividualEnv({extraHeaders:{"X-Pt-Id":(rr==null?void 0:rr.oid)??""}}),At(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),et(SCREEN_NAMES.KYC_LOGIN_SCREEN);return}if(Jt!=null&&Jt.length){_e(Jt),et(SCREEN_NAMES.SELECT_ABHA_FROM_LIST);return}et(SCREEN_NAMES.ABHA_MOBILE_LINKING_STATUS)}catch{jt({name:"abha_mobile_otp_verification_exception",data:{platform:Rt,reason:"exception_thrown"}}),_(LOADING_STATE.REJECTED),St("Something went wrong, please try again")}},Yt=async({mobileNumber:Bt})=>{if(Et(Bt),Bt.length===10&&["6","7","8","9"].includes(Bt.charAt(0))&&rt){const{txn_id:zt,hint:Gt,error:Qt,action:rr}=await postRegisterAadhaarMobileInit({mobile:Bt,txn_id:rt});if(Qt){jt({name:"aadhaar_faceauth_mobile_init_failed",data:{platform:Rt,reason:Qt||"error on mobile init in face auth",txn_id_exists:!!rt}}),ht({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),rr&&ht(rr);return}if(zt&&Gt){jt({name:"abha_login_select_abha_mobile_init_success",data:{method:Ot,platform:Rt,txn_id:zt}}),Dt({authTxnId:$,txnId:zt,mobileOtpSentToHint:Gt}),It(!0),Pt(null);return}}else Bt.trim()!=""&&!["6","7","8","9"].includes(Bt.charAt(0))&&Pt("Enter a valid mobile number");Bt.trim()==""&&It(!1),jt({name:"abha_aadhaar_mobile_otp_enter",data:{page_view:"aadhaar_verification",platform:Rt}})},Wt=()=>{jt({name:"abha_aadhaar_mobile_verify_error_bottomsheet_dismissed",data:{platform:Rt}}),pt(),ht(null)},Ut=ut&&yt.length===10;return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-01",children:[jsxRuntimeExports.jsx(AbhaHeader,{prefixIcon:jsxRuntimeExports.jsx("button",{className:"pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple",onClick:bt?dt:pt,children:jsxRuntimeExports.jsx(n$4,{className:""})}),title:"Create ABHA",suffixIcon:jsxRuntimeExports.jsx(p$3,{className:"pds2-w-20 pds2-h-20"}),className:"pds2-border-b-1 pds2-border-bg-seperator-dark"}),bt?jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-bg-01"}):jsxRuntimeExports.jsx(AbhaStepper,{}),jsxRuntimeExports.jsxs("div",{className:"pds2-px-16 pds2-pb-16 pds2-space-y-12 pds2-overflow-y-auto pds2-flex-1 pds2-bg-bg-01",children:[jsxRuntimeExports.jsx(EnterMobileNumberCard,{mobileNumber:yt,disabled:!!(tt!=null&&tt.mobile),onMobileNumberChange:Yt,isOtpValid:ut,error:wt,onKeyDown:({key:Bt})=>{Bt==="Enter"&&Vt(ct)}}),$t&&jsxRuntimeExports.jsx(AbhaOtpCard,{otpSentToText:at||"Enter OTP sent on mobile number",onOtpCompletion:Ht,onResendOtpClick:Lt,setIsValid:gt,error:_t,setError:St,prefixIcon:null})]}),jsxRuntimeExports.jsx("div",{className:"pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-bg-white pds2-w-full pds2-border pds2-border-border-brand-02",children:jsxRuntimeExports.jsx(Pds2Button,{title:"Verify",state:!Ut||a===LOADING_STATE.LOADING?"disabled":"enabled",className:"pds2-w-full",onClick:()=>Vt(ct),isLoading:a===LOADING_STATE.LOADING})}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:Wt})]})},EnterMobileNumberCard=({mobileNumber:a,disabled:_,onMobileNumberChange:$,isOtpValid:_e,onKeyDown:et,error:tt})=>{const rt=GET_EXTRA_HEADERS(),nt=(rt==null?void 0:rt["X-User-ID"])??void 0,at=useAuthAbhaStore(ht=>ht.isDocAppRequest),st=reactExports.useRef(null);reactExports.useEffect(()=>{st.current&&_e&&st.current.focus()},[_e]);const it=useAuthAbhaStore(ht=>ht.abhaAuthFlowMethod),ot=useAuthAbhaStore(ht=>ht.initAbhaAppMobileNumber);ot&&(a=ot);const lt=it===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!!nt&&_;return jsxRuntimeExports.jsxs(CustomCardLayout,{children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-space-x-16 pds2-w-full",children:[jsxRuntimeExports.jsxs("div",{className:"Body1Regular pds2-text-text-01 pds2-flex-1",children:["Enter ",at?"the patient's":"your"," mobile number to link with ABHA"," ",jsxRuntimeExports.jsx("sup",{className:"pds2-text-text-error Body3Semibold",children:"*"})]}),jsxRuntimeExports.jsx(n$3,{className:"pds2-w-48 pds2-h-48 pds2-text-icon-success-02 pds2-p-6"})]}),jsxRuntimeExports.jsxs("label",{className:`pds2-relative pds2-border pds2-rounded-12 ${tt?"pds2-border-border-error focus-within:pds2-border-border-error ":"pds2-border-border-03 focus-within:pds2-border-border-brand-01 "}`,children:[jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-absolute pds2-left-16 pds2-top-1/2 pds2-transform pds2--translate-y-1/2 pds2-text-text-01",children:"+91 -"}),jsxRuntimeExports.jsx("input",{ref:st,placeholder:"Mobile Number",type:"text",autoComplete:"tel-national",value:a,disabled:lt,pattern:"[0-9]*",inputMode:"numeric",onChange:ht=>{if(ht.target.value.length>10)return;const pt=ht.target.value.replace(/[^0-9]/g,"");$({mobileNumber:pt.slice(-10)})},maxLength:10,className:"Body1Regular pds2-w-full pds2-pl-60 pds2-pr-12 pds2-py-12 pds2-rounded-12 pds2-outline-none",onKeyDown:et})]}),tt?jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-text-error",children:tt}):jsxRuntimeExports.jsxs("div",{className:"Body3Regular pds2-text-text-03 pds2-flex pds2-items-center pds2-gap-8",children:[jsxRuntimeExports.jsx(e$1,{className:"pds2-w-20 pds2-h-20"}),"We will link this mobile number to your ABHA for all related communications"]}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-items-center pds2-space-x-8 pds2-text-text-03"})]})},CustomCardLayout=({children:a,className:_="pds2-space-y-12"})=>jsxRuntimeExports.jsx("div",{className:`pds2-flex pds2-flex-col pds2-w-full pds2-p-16 pds2-rounded-16 pds2-bg-bg-white ${_}`,children:a}),AbhaAadhaarVerificationFaceAuthStatusScreen=()=>{const a=useAuthAbhaStore(mt=>mt.aadhaarVerificationSkipStateStatus),_=useAuthAbhaStore(mt=>mt.authTxnId),$=useAuthAbhaStore(mt=>mt.ekaSmallToken),_e=useAuthAbhaStore(mt=>mt.setScreen),et=useAuthAbhaStore(mt=>mt.abhaAddressList),[tt,rt]=reactExports.useState(!0),nt=useAuthAbhaStore(mt=>mt.clientId),at=useAuthAbhaStore(mt=>mt.isEkaAppLogin),st=useAuthAbhaStore(mt=>mt.oid),it=useAuthAbhaStore(mt=>mt.ekaProfileInfo),ot=["M","F","O","U"],lt=useAuthAbhaStore(mt=>mt.txnId),ht=useAuthAbhaStore(mt=>mt.isNewLoginOrCreateFlow),pt=GET_EXTRA_HEADERS(),dt=({name:mt,data:ct={}})=>{var gt,yt;const ut={...{login_platform:nt,is_eka_app_login:at?"true":"false",is_new_login_or_create_flow:ht?"true":"false",txn_id:lt||"missing txnId",oid:pt!=null&&pt["X-User-ID"]?"true":"false",access_token:pt!=null&&pt.auth?"true":"false"},...ct};handleSendEvent({eventName:mt,eventData:ut}),(yt=(gt=window.curio)==null?void 0:gt.pushToMixpanel)==null||yt.call(gt,mt,ut)};return reactExports.useEffect(()=>{var ft,ut;const mt=new Promise(gt=>{setTimeout(()=>{gt(rt(!1))},500)});handleSendEvent({eventName:"page_view",eventData:{page_view:"aadhaar_faceauth_verified_successful",platform:nt}}),(ut=(ft=window.curio)==null?void 0:ft.pushToMixpanel)==null||ut.call(ft,"page_view",{platform:nt,page_view:"aadhaar_faceauth_verified_successful"});async function ct(){await mt,setTimeout(async()=>{var gt,yt,Et,_t,St,wt;if(a===ABHA_V3_SKIP_STATES.REQUEST_MOBILE_OTP){_e(SCREEN_NAMES.ABHA_MOBILE_AND_OTP_SCREEN);return}else{if(at){const Nt=ot.includes(it==null?void 0:it.gender)?it==null?void 0:it.gender:void 0,Mt={oid:(it==null?void 0:it.oid)||"",fln:(it==null?void 0:it.name)||"",dob:it==null?void 0:it.date_of_birth,gen:Nt,mobile:it==null?void 0:it.mobile,at:"",fn:(it==null?void 0:it.firstname)||"",mn:(it==null?void 0:it.middlename)||"",ln:(it==null?void 0:it.lastname)||"",abha_number:(it==null?void 0:it.abha_number)||"","health-ids":it!=null&&it.abha_address?[it==null?void 0:it.abha_address]:void 0};console.log("inside abha aadhaar verification status auth profile response ",Mt);const Dt=getMockAuthVerifyResponse(Mt);if(console.log("authResponse ",Dt),a===ABHA_V3_SKIP_STATES.ABHA_END&&st){if(handleSendEvent({eventName:"abha_aadhaar_verification_status_eka_flow",eventData:{type:"verify",platform:nt,transactionId:_||"",skipState:"abha_end",minToken:$||"",oid:st||"",abhaAddress:(it==null?void 0:it.abha_address)||"",isEkaAppLogin:at?"true":"false"}}),(yt=(gt=window.curio)==null?void 0:gt.pushToMixpanel)==null||yt.call(gt,"abha_aadhaar_verification_status_eka_flow",{platform:nt,type:"verify",transactionId:_||"",skipState:"abha_end",minToken:$||"",oid:st||"",abhaAddress:(it==null?void 0:it.abha_address)||"",isEkaAppLogin:at?"true":"false"}),window.EkaAbha&&window.EkaAbha.onAbhaSuccess){(Et=window.EkaAbha)==null||Et.onAbhaSuccess(JSON.stringify({response:Dt}));return}onAbhaSuccess({response:Dt}),unMount();return}if(a===ABHA_V3_SKIP_STATES.ABHA_CREATE&&et){_e(SCREEN_NAMES.SELECT_ABHA_FROM_LIST);return}console.log("redirecting to create eka profile for abha address creation -> mobile"),_e(SCREEN_NAMES.CREATE_EKA_PROFILE);return}if(!_||!$)return;const Pt=await postAuthVerifyV2({txn_id:_,token:$});if(Pt.data){if(a===ABHA_V3_SKIP_STATES.ABHA_END){if(st){if(window.EkaAbha&&window.EkaAbha.onAbhaSuccess){(_t=window.EkaAbha)==null||_t.onAbhaSuccess(JSON.stringify({response:Pt}));return}onAbhaSuccess({response:Pt}),unMount();return}setIndividualEnv({extraHeaders:{auth:(St=Pt.data)==null?void 0:St.tokens.sess}}),_e(SCREEN_NAMES.GET_ALL_PROFILES);return}setIndividualEnv({extraHeaders:{auth:(wt=Pt.data)==null?void 0:wt.tokens.sess}}),dt({name:"abha_login_otp_verify_abha_select",data:{type:"verify",platform:nt}}),_e(SCREEN_NAMES.SELECT_ABHA_FROM_LIST);return}}},2e3)}ct()},[]),jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:tt,loadingText:"Verifying...",successText:"Aadhaar Verification Successful!"})},AbhaSessionStatusLoaderScreen=()=>{const a=useAuthAbhaStore(ot=>ot.txnId),_=useAuthAbhaStore(ot=>ot.setScreen),$=useAuthAbhaStore(ot=>ot.goBackLoginScreen),_e=useAuthAbhaStore(ot=>ot.setBottomsheetErrorInfo),et=useAuthAbhaStore(ot=>ot.isEkaAppLogin),tt=useAuthAbhaStore(ot=>ot.clientId),rt=useAuthAbhaStore(ot=>ot.isNewLoginOrCreateFlow),nt=useAuthAbhaStore(ot=>ot.initAbhaFlow),at=GET_EXTRA_HEADERS();useAuthAbhaStore(ot=>ot.screen);const st=({name:ot,data:lt={}})=>{var dt,mt;const pt={...{login_platform:tt,is_eka_app_login:et?"true":"false",is_new_login_or_create_flow:rt?"true":"false",txn_id:a||"missing txnId",oid:at!=null&&at["X-User-ID"]?"true":"false",access_token:at!=null&&at.auth?"true":"false"},...lt};handleSendEvent({eventName:ot,eventData:pt}),(mt=(dt=window.curio)==null?void 0:dt.pushToMixpanel)==null||mt.call(dt,ot,pt)};reactExports.useEffect(()=>{st({name:"abha_doc_session_status_page",data:{page_view:"abha_session_status_page",platform:tt}}),st({name:"fetch_session_status_api",data:{type:"get_init",platform:tt}}),(async()=>{try{let lt=await getAbdmSessionStatus();lt.logged_in?nt==="abha-kyc"?lt.kyc_verified?_(SCREEN_NAMES.KYC_ALREADY_VERIFIED):_(SCREEN_NAMES.KYC_LOGIN_SCREEN):nt==="consent"&&_(SCREEN_NAMES.CONSENT_LOADER_SCREEN):_(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA)}catch(lt){const{code:ht,error:pt,source_error:dt}=lt;st({name:"abha_abdm_session_status_get_failed",data:{error_code:ht,error_msg:pt,source_error:dt}}),_(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA)}})()},[]);const it=()=>{st({name:"abha_session_status_request_error_bottomsheet_dismissed",data:{platform:tt}}),_e(null),$(),setIndividualEnv({extraHeaders:{auth:""}})};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsx(AbhaLoadingStatus,{}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:it})]})},AbhaKycAlreadyVerifiedScreen=()=>(reactExports.useEffect(()=>{onKYCSuccess("KYC already verified, onKYCSuccess called, next page redirect"),setTimeout(()=>{window.location.href="https://www.eka.care/s/for-patients"},3e3)},[]),jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:!1,loadingText:"KYC in progress...",successText:"KYC already Verified!"})),TickSwiggly="data:image/svg+xml,%3csvg%20width='37'%20height='37'%20viewBox='0%200%2037%2037'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.5%200.5C21.0312%200.5%2023.2812%201.97656%2024.4062%204.15625C26.7266%203.38281%2029.3984%203.94531%2031.2266%205.77344C33.0547%207.60156%2033.6172%2010.2734%2032.8438%2012.5938C35.0234%2013.7188%2036.5%2015.9688%2036.5%2018.5C36.5%2021.1016%2035.0234%2023.3516%2032.8438%2024.4766C33.6172%2026.7969%2033.0547%2029.3984%2031.2266%2031.2266C29.3984%2033.0547%2026.7266%2033.6172%2024.4062%2032.9141C23.2812%2035.0938%2021.0312%2036.5%2018.5%2036.5C15.8984%2036.5%2013.6484%2035.0938%2012.5234%2032.9141C10.2031%2033.6172%207.60156%2033.0547%205.77344%2031.2266C3.94531%2029.3984%203.38281%2026.7969%204.08594%2024.4766C1.90625%2023.3516%200.5%2021.1016%200.5%2018.5C0.5%2015.9688%201.90625%2013.7188%204.08594%2012.5938C3.38281%2010.2734%203.94531%207.60156%205.77344%205.77344C7.60156%203.94531%2010.2031%203.38281%2012.5234%204.15625C13.6484%201.97656%2015.8984%200.5%2018.5%200.5ZM25.3203%2016.3203C25.9531%2015.6875%2025.9531%2014.6328%2025.3203%2014C24.6172%2013.2969%2023.5625%2013.2969%2022.9297%2014L16.25%2020.6797L13.5078%2017.9375C12.8047%2017.2344%2011.75%2017.2344%2011.1172%2017.9375C10.4141%2018.5703%2010.4141%2019.625%2011.1172%2020.2578L15.0547%2024.1953C15.6875%2024.8984%2016.7422%2024.8984%2017.4453%2024.1953L25.3203%2016.3203Z'%20fill='%2346AB86'%20/%3e%3c/svg%3e",AbhaCardScreen=()=>{const[a,_]=reactExports.useState(!1),$=useAuthAbhaStore(ft=>ft.txnId),_e=useAuthAbhaStore(ft=>ft.ekaProfileInfo),et=useAuthAbhaStore(ft=>ft.initAbhaFlow),tt=useAuthAbhaStore(ft=>ft.isEkaAppLogin),rt=useAuthAbhaStore(ft=>ft.clientId),nt=useAuthAbhaStore(ft=>ft.clearAbhaAuthStore),at=useAuthAbhaStore(ft=>ft.goBackLoginScreen),[st,it]=reactExports.useState(LOADING_STATE.IDLE),[ot,lt]=reactExports.useState(LOADING_STATE.IDLE),ht=useAuthAbhaStore(ft=>ft.isNewLoginOrCreateFlow),pt=GET_EXTRA_HEADERS(),dt=({name:ft,data:ut={}})=>{var Et,_t;const yt={...{login_platform:rt,is_eka_app_login:tt?"true":"false",is_new_login_or_create_flow:ht?"true":"false",txn_id:$||"missing txnId",oid:pt!=null&&pt["X-User-ID"]?"true":"false",access_token:pt!=null&&pt.auth?"true":"false"},...ut};handleSendEvent({eventName:ft,eventData:yt}),(_t=(Et=window.curio)==null?void 0:Et.pushToMixpanel)==null||_t.call(Et,ft,yt)},mt=async()=>{dt({name:"abha_card_download_clicked",data:{platform:rt}});try{it(LOADING_STATE.LOADING);const ft=await getAbdmAssestCard();if(!(ft instanceof Blob)){console.error("Received non-blob response:",ft),dt({name:"abha_card_download_failed",data:{platform:rt,error:"Invalid Blob"}});return}const ut=window.URL.createObjectURL(ft),gt=document.createElement("a");gt.href=ut,gt.download=`${_e==null?void 0:_e.firstname}_${_e==null?void 0:_e.lastname}_AbhaCard.png`,document.body.appendChild(gt),gt.click(),document.body.removeChild(gt),window.URL.revokeObjectURL(ut),it(LOADING_STATE.RESOLVED),dt({name:"abha_card_download_success",data:{platform:rt}})}catch(ft){it(LOADING_STATE.REJECTED),console.error("Download Error:",ft),dt({name:"abha_card_download_failed",data:{platform:rt,error:JSON.stringify(ft)}})}},ct=()=>{if(lt(LOADING_STATE.LOADING),dt({name:"abha_card_continue_clicked",data:{platform:rt}}),rt.includes("doc"))unMount(),lt(LOADING_STATE.RESOLVED);else{at();const ft=rt,ut=useAuthAbhaStore.getState().isEkaAppLogin;nt(),useAuthAbhaStore.setState({clientId:ft,isEkaAppLogin:ut}),lt(LOADING_STATE.RESOLVED)}};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaHeader,{title:"Download ABHA card",className:"pds2-border-b-1 pds2-border-bg-seperator-dark",prefixIcon:jsxRuntimeExports.jsx("button",{className:"pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple",onClick:()=>_(!0),children:jsxRuntimeExports.jsx(n$4,{className:""})})}),et?jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-bg-01"}):jsxRuntimeExports.jsx(AbhaStepper,{}),jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-space-y-16 pds2-overflow-y-hidden pds2-bg-bg-01",children:jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-items-center ",children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-items-center md:pds2-px-40",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-items-center pds2-space-y-6",children:jsxRuntimeExports.jsx("div",{className:"pds2-px-24 pds2-flex pds2-flex-col pds2-space-y-8 md:pds2-p-16 pds2-justify-center pds2-items-center pds2-text-center",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:TickSwiggly,className:"pds2-w-54 pds2-h-54 md:pds2-h-60 md:pds2-w-60 "}),jsxRuntimeExports.jsx("p",{className:"Heading4Semibold pds2-mt-8",children:"ABHA Registration Successful!"})]})})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-items-center pds2-relative pds2-mt-16 pds2-w-full",children:[jsxRuntimeExports.jsx("div",{className:"pds2-relative pds2-h-159 pds2-w-166 pds2-ml-22",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/clxu62r5f00020tklemws6vkm.png",alt:"abha_card_bg_img",style:{objectFit:"contain",objectPosition:"center",width:"100%",height:"100%"}})}),jsxRuntimeExports.jsxs("div",{className:"pds2-rounded-4 pds2-overflow-hidden pds2-h-117 pds2-w-180 pds2-relative -pds2-top-50 pds2-bg-doctor-darwin-neutral-0",style:{boxShadow:"0px 2.43737px 9.74947px rgba(41, 41, 140, 0.16)"},children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-justify-between pds2-py-5 pds2-px-10 pds2-w-full",style:{background:"#232477"},children:[jsxRuntimeExports.jsx("div",{className:"pds2-relative pds2-h-23 pds2-w-26",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/clcoqygo000310sa3767u6mik.webp",style:{objectFit:"contain",objectPosition:"center",width:"100%",height:"100%"}})}),jsxRuntimeExports.jsx("div",{className:"pds2-relative pds2-h-23 pds2-w-50 pds2-bg-bg-invert",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/clcoqzar7002l0sdsfgx40nkp.webp",alt:"abha_card_bg_img",style:{objectFit:"contain",objectPosition:"center",width:"100%",height:"100%"}})})]}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-items-center pds2-justify-between pds2-pt-9 pds2-pb-30 pds2-px-10 pds2-bg-bg-white",children:jsxRuntimeExports.jsxs("div",{className:"pds2-space-y-3",children:[jsxRuntimeExports.jsx("div",{className:"pds2-font-700 pds2-text-12 pds2-leading-12",children:(_e==null?void 0:_e.firstname)+" "+(_e==null?void 0:_e.lastname)}),jsxRuntimeExports.jsxs("div",{className:"pds2-font-400 pds2-text-9 pds2-leading-10 pds2-text-text-03 pds2-pb-8",children:[(_e==null?void 0:_e.gender)==="M"?"Male":(_e==null?void 0:_e.gender)==="F"?"Female":"Others",", ",calculateAge((_e==null?void 0:_e.date_of_birth)??"")," years"]}),jsxRuntimeExports.jsx("div",{className:"pds2-space-y-2",children:(_e==null?void 0:_e.abha_number)&&jsxRuntimeExports.jsxs("div",{className:"pds2-font-500 pds2-text-9 pds2-leading-10",children:[jsxRuntimeExports.jsx("span",{className:"!pds2-font-400 pds2-text-text-03",children:"ABHA Number: "}),_e==null?void 0:_e.abha_number]})}),jsxRuntimeExports.jsx("div",{className:"pds2-space-y-2",children:(_e==null?void 0:_e.abha_address)&&jsxRuntimeExports.jsxs("div",{className:"pds2-font-500 pds2-text-9 pds2-leading-10",children:[jsxRuntimeExports.jsx("span",{className:"!pds2-font-400 pds2-text-text-03",children:"ABHA Address: "}),_e==null?void 0:_e.abha_address]})})]})})]})]})]})})}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative pds2-flex pds2-py-16 ",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-z-10 pds2-absolute pds2-bg-bg-accent-green pds2-top-0 pds2-mb-2 pds2-font-500 pds2-text-12 pds2-leading-18 pds2-w-full pds2-text-center ",children:[jsxRuntimeExports.jsx("span",{className:"pds2-font-700",children:"50 Cr"}),jsxRuntimeExports.jsx("span",{children:" + people have already created ABHA!"})]}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-gap-10 pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-bg-white pds2-w-full pds2-border pds2-border-border-brand-02",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Pds2Button,{state:ot===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:ot===LOADING_STATE.LOADING,title:"Continue",buttonColor:"pds2-bg-bg-white",className:"pds2-w-5/6 !pds2-text-text-brand pds2-border pds2-border-border-03",onClick:ct}),jsxRuntimeExports.jsx(Pds2Button,{state:st===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:st===LOADING_STATE.LOADING,title:"",IconComponent:()=>jsxRuntimeExports.jsx(t$7,{}),buttonColor:"pds2-bg-bg-brand-01",className:"pds2-w-1/6 !pds2-p-0",onClick:mt})]})})]})]}),jsxRuntimeExports.jsx(ExitPopup,{open:a,setOpen:_})]})},ScreenStack=()=>{const a=useAuthAbhaStore($=>$.screen);switch(a[a.length-1]){case SCREEN_NAMES.LOGIN_WITH_ABHA:return jsxRuntimeExports.jsx(LoginorCreateAbhaScreen,{});case SCREEN_NAMES.VERIFY_OTP_LOGIN_WITH_ABHA:return jsxRuntimeExports.jsx(AbhaLoginOtpVerifyScreen,{});case SCREEN_NAMES.VERIFY_KYC_OTP_LOGIN_WITH_ABHA:return jsxRuntimeExports.jsx(AbhaKycOtpVerifyScreen,{});case SCREEN_NAMES.CREATE_ABHA_WITH_AADHAAR:return jsxRuntimeExports.jsx(LoginorCreateAbhaScreen,{});case SCREEN_NAMES.ABHA_OTP_AND_MOBILE:return jsxRuntimeExports.jsx(AbhaOtpAndMobileScreen,{});case SCREEN_NAMES.ABHA_PHONE_NUMBER_VERIFICATION:return jsxRuntimeExports.jsx(AbhaPhoneNumberVerificationScreen,{});case SCREEN_NAMES.AADHAAR_VERIFICATION_STATUS:return jsxRuntimeExports.jsx(AbhaAadhaarVerificationStatusScreen,{});case SCREEN_NAMES.ABHA_MOBILE_LINKING_STATUS:return jsxRuntimeExports.jsx(AbhaMobileLinkingStatusScreen,{});case SCREEN_NAMES.SELECT_ABHA_FROM_LIST:return jsxRuntimeExports.jsx(SelectAbhaFromListScreen,{});case SCREEN_NAMES.SELECT_EKA_PROFILE:return jsxRuntimeExports.jsx(SelectEkaProfileScreen,{});case SCREEN_NAMES.CREATE_ABHA_ADDRESS:return jsxRuntimeExports.jsx(CreateAbhaAddressScreen,{});case SCREEN_NAMES.CREATE_EKA_PROFILE:return jsxRuntimeExports.jsx(CreateEkaProfileScreen,{});case SCREEN_NAMES.CREATE_PHR_EKA_PROFILE:return jsxRuntimeExports.jsx(CreateEkaProfileScreen,{});case SCREEN_NAMES.GET_ALL_PROFILES:return jsxRuntimeExports.jsx(GetAllProfilesScreen,{});case SCREEN_NAMES.LOGIN_OR_CREATE_ABHA:return jsxRuntimeExports.jsx(LoginorCreateAbhaScreen,{});case SCREEN_NAMES.CONSENT_SCREEN:return jsxRuntimeExports.jsx(ConsentDetailsScreen,{});case SCREEN_NAMES.CONSENT_DENY:return jsxRuntimeExports.jsx(AbhaConsentDenyScreen,{});case SCREEN_NAMES.CONSENT_REVOKE:return jsxRuntimeExports.jsx(AbhaConsentRevokeScreen,{});case SCREEN_NAMES.CONSENT_APPROVE:return jsxRuntimeExports.jsx(AbhaConsentApproveScreen,{});case SCREEN_NAMES.SELF_ASSESSMENT:return jsxRuntimeExports.jsx(SelfAssessmentScreen,{});case SCREEN_NAMES.CONSENT_LOADER_SCREEN:return jsxRuntimeExports.jsx(ConsentLoaderScreen,{});case SCREEN_NAMES.KYC_LOGIN_SCREEN:return jsxRuntimeExports.jsx(KYCLoginScreen,{});case SCREEN_NAMES.KYC_ALREADY_VERIFIED:return jsxRuntimeExports.jsx(AbhaKycAlreadyVerifiedScreen,{});case SCREEN_NAMES.ABHA_AUTH_QR_SCREEN:return jsxRuntimeExports.jsx(AbhaAuthQRScreen,{});case SCREEN_NAMES.AADHAAR_FACEAUTH_VERIFICATION_STATUS:return jsxRuntimeExports.jsx(AbhaAadhaarVerificationFaceAuthStatusScreen,{});case SCREEN_NAMES.ABHA_MOBILE_AND_OTP_SCREEN:return jsxRuntimeExports.jsx(AbhaMobileandOtpScreen,{});case SCREEN_NAMES.ABHA_HEALTHID_CARD_SCREEN:return jsxRuntimeExports.jsx(AbhaCardScreen,{});case SCREEN_NAMES.SESSION_STATUS_LOADER_SCREEN:return jsxRuntimeExports.jsx(AbhaSessionStatusLoaderScreen,{});default:return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}},queryClient=new QueryClient;function App(){const a=useAuthAbhaStore.getState().initAbhaFlow;return reactExports.useEffect(()=>()=>{unMount()},[]),jsxRuntimeExports.jsx(QueryClientProvider,{client:queryClient,children:jsxRuntimeExports.jsx("div",{className:"pds2-h-full pds2-w-full pds2-bg-bg-white",style:{borderRadius:GET_CLIENT_ID()==="www-eka"&&!a?"1.5rem":void 0,position:"relative",height:GET_CLIENT_ID()==="www-eka"?a==="consent"||a==="abha-kyc"?"100vh":"75vh":GET_CLIENT_ID()==="doc-web"?"100%":"100vh",overflowY:"auto",paddingTop:GET_CLIENT_ID()==="androiddoc"||GET_CLIENT_ID()==="doctor-app-ios"||GET_CLIENT_ID()==="doctor-ipad-ios"?"1rem":"0rem"},children:jsxRuntimeExports.jsx(ScreenStack,{})})})}const d=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],p=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]];function verhoeffValidate(a){let _=0;const $=a.split("").reverse().map(_e=>parseInt(_e,10));for(let _e=0;_e<$.length;_e++)_=d[_][p[_e%8][$[_e]]];return _===0}function isValidAadhaar(a){return/^\d{12}$/.test(a)?verhoeffValidate(a):!1}const abhaRegex=/^[0-9]{14}$/;function luhnCheck(a){let _=0,$=!1;for(let _e=a.length-1;_e>=0;_e--){let et=parseInt(a[_e],10);$&&(et*=2,et>9&&(et-=9)),_+=et,$=!$}return _%10===0}function isValidABHA(a){return!abhaRegex.test(a)||a.split("").every($=>$===a[0])?!1:luhnCheck(a)}const isValidMobile=a=>/^[6-9]\d{9}$/.test(a),setIdentifier=(a,_)=>{useAuthAbhaStore.getState().setInitAbhaAppIdentifierType(a),useAuthAbhaStore.getState().setInitAbhaAppIdentifier(_)},handleIdentifier=(a,_,$)=>{if(a){const _e=a.replace(/[\s-]/g,"");if(_){if(_===ABHA_AUTH_FLOW_METHOD.MOBILE){setIdentifier(ABHA_AUTH_FLOW_METHOD.MOBILE,a.slice(-10));return}setIdentifier(_,a);return}if(_e.endsWith("@sbx")){setIdentifier(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS,_e);return}if(/^\+91\d{10}$/.test(_e)){const tt=_e.slice(-10);if(tt.length===10&&isValidMobile(tt)){setIdentifier(ABHA_AUTH_FLOW_METHOD.MOBILE,tt);return}}else if(/^\d+$/.test(_e)){const tt=_e.length;if(tt===10&&isValidMobile(_e)){setIdentifier(ABHA_AUTH_FLOW_METHOD.MOBILE,_e);return}if(tt===12&&isValidAadhaar(_e)){setIdentifier(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER,_e);return}if(tt===14&&isValidABHA(_e)){const rt=`${_e.slice(0,2)}-${_e.slice(2,6)}-${_e.slice(6,10)}-${_e.slice(10,14)}`;setIdentifier(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER,rt);return}console.warn("Unknown numeric identifier type");return}console.warn("Unknown identifier type")}else console.warn("No identifier provided")};let PopupReactNode=null,unMount,onAbhaSuccess,onKYCSuccess,onConsentSuccess;function initAbhaApp(a){console.log("clear the abha auth store for every sdk invocation",a),useAuthAbhaStore.getState().clearAbhaAuthStore();const{clientId:_,containerId:$,urlParams:_e,method:et,data:tt,appVersion:rt,onSuccess:nt,onError:at,onAbhaClose:st}=a,{mobile:it,accessToken:ot,oid:lt,identifier:ht,identifier_type:pt,flow:dt,consent_id:mt,orgIcon:ct,linkToOrgIcon:ft,successRedirect:ut}=tt||{};console.log("recieved identifier, identifier_type",ht,pt),useAuthAbhaStore.getState().setOrgIcon(ct),useAuthAbhaStore.getState().setLinkToOrgIcon(ft),handleSendEvent({eventName:"recieved_init_identifiers",eventData:{identifier:ht||"",identifier_type:pt||""}});const gt={};if(dt&&useAuthAbhaStore.getState().setInitAbhaFlow(dt),ut&&useAuthAbhaStore.getState().setSuccessRedirect(ut),mt&&useAuthAbhaStore.getState().setAbhaRequestConsentId(mt),ot&&(gt.auth=ot),lt&&(dt==="abha-kyc"||dt==="consent")?setIndividualEnv({extraHeaders:{"X-Pt-Id":lt??""}}):lt&&dt!="abha-kyc"&&(gt["X-User-ID"]=lt),(dt==="abha-kyc"||dt==="consent")&&lt){const Mt=SCREEN_NAMES.SESSION_STATUS_LOADER_SCREEN;useAuthAbhaStore.getState().setInitState({screen:[Mt],urlParams:_e})}else if(dt==="abha-kyc"&&(_==="androidp"||_==="patient-app-ios")){const Mt=SCREEN_NAMES.KYC_LOGIN_SCREEN;useAuthAbhaStore.getState().setInitState({screen:[Mt],urlParams:_e})}else if(dt==="abha-kyc"&&_==="doc-web"||_==="ext"){const Mt=SCREEN_NAMES.SESSION_STATUS_LOADER_SCREEN;useAuthAbhaStore.getState().setInitState({screen:[Mt],urlParams:_e})}else{const Mt=SCREEN_NAMES.LOGIN_OR_CREATE_ABHA;useAuthAbhaStore.getState().setInitState({screen:[Mt],urlParams:_e})}console.log("set headers in headers"),console.log("invoked initAbhaApp",gt);const yt=gt!==null&&("auth"in gt||"X-User-ID"in gt);useAuthAbhaStore.getState().setIsEkaAppLogin(yt),dt==="consent"&&useAuthAbhaStore.getState().setAbhaAuthFlowMethod(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS),(_==="doc-web"||_==="ext")&&useAuthAbhaStore.getState().setIsEkaAppLogin(!0),console.log("clientId ",_),console.log("isEkaAppLogin",useAuthAbhaStore.getState().isEkaAppLogin),_==="androiddoc"||_==="doctor-app-ios"||_==="doctor-ipad-ios"||_==="doc-web"||_==="ext"?useAuthAbhaStore.getState().setClientId("doctor"):_==="androidp"||_==="patient-app-ios"?(useAuthAbhaStore.getState().setSelectedAadhaarAuth(AADHAAR_AUTH_STATES.OTP),useAuthAbhaStore.getState().setClientId("phr")):_==="www-eka"?(useAuthAbhaStore.getState().setSelectedAadhaarAuth(AADHAAR_AUTH_STATES.OTP),useAuthAbhaStore.getState().setClientId("eka-web")):(console.log("here"),useAuthAbhaStore.getState().setClientId("phr"));let Et=!1;handleSendEvent({eventName:"init_abha_app",eventData:{platform:_,method:et||"",mobile:it||"",accessToken:ot||"",oid:lt||"",appVersion:rt||"",isEkaAppLogin:yt.toString(),container_id:$}}),onTrack("init_abha_app",{platform:_,method:et||"",mobile:it||"",accessToken:gt.auth||"",oid:gt["X-User-ID"]||"",appVersion:rt||"",isEkaAppLogin:yt.toString(),container_id:$}),(_==="androiddoc"||_==="doctor-app-ios"||_==="doctor-ipad-ios"||_==="doc-web")&&(Et=!0,useAuthAbhaStore.getState().setIsDocAppRequest(Et)),(_==="doc-web"||_==="ext")&&useAuthAbhaStore.getState().setFaceAuthEnable(!0),useAuthAbhaStore.getState().setInitAbhaAppMethod(et==="create_abha_with_mobile"?"create_abha_with_mobile":"login_with_abha"),setEnv({clientId:_,env:"DEV",...gt&&{extraHeaders:gt}}),console.log("isProd is",!1);const wt=pt&&["mobile","aadhaar_number","abha_number","phr_address"].includes(pt)?pt:void 0;handleIdentifier(ht,wt),useAuthAbhaStore.getState().setAbhaAuthFlowMethod(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER);const Pt=()=>{useAuthAbhaStore.getState().clearAbhaAuthStore(),queryClient.removeQueries(),PopupReactNode==null||PopupReactNode.unmount(),st()},Nt=document.getElementById($);if(!Nt){const Mt=`Element with id ${$} not found`;console.error(Mt),at({error:Mt}),Pt();return}return onKYCSuccess=a.onKYCSuccess??(()=>{}),onConsentSuccess=a.onConsentSuccess??(()=>{}),onAbhaSuccess=nt??(()=>{}),PopupReactNode=createRoot(Nt),PopupReactNode.render(jsxRuntimeExports.jsx(App,{})),unMount=Pt,window.closeAbhaApp=Pt,Pt}window.initAbhaApp=initAbhaApp;function onTrack(a,_={}){var et;const $=useAuthAbhaStore.getState().clientId||"unknown-platform",_e={..._,platform:$};console.log("Tracking Event:",a,_e),(et=window.curio)!=null&&et.pushToMixpanel?(console.log("Pushing to Mixpanel:",a,_e),window.curio.pushToMixpanel(a,_e)):(console.log("Curio not available. Queuing event:",a,_e),console.error("Curio not available. Could not push event to Mixpanel."))}
199
+ `;nt.open(),nt.write(at),nt.close();const st=ot=>{var lt,ht,pt,dt,mt;ot.source===rt.contentWindow&&(((lt=ot.data)==null?void 0:lt.type)==="sa-init"&&console.log("[SA INIT]",ot.data.data),((ht=ot.data)==null?void 0:ht.type)==="sa-submit"&&console.log("[SA SUBMIT]",ot.data.data),((pt=ot.data)==null?void 0:pt.type)==="sa-end"&&(console.log("[SA END]"),(dt=_.onEndCallback)==null||dt.call(_)),((mt=ot.data)==null?void 0:mt.type)==="sdk-error"&&console.error("SA SDK error:",ot.data.message))};return window.addEventListener("message",st),()=>{window.removeEventListener("message",st),rt.remove(),et.current=null}},[a,_,$]),jsxRuntimeExports.jsx("div",{ref:_e,style:{height:"100vh"}})}function calculateAge(a){const _=new Date(a),$=new Date;let _e=$.getFullYear()-_.getFullYear();return($.getMonth()<_.getMonth()||$.getMonth()===_.getMonth()&&$.getDate()<_.getDate())&&_e--,_e}const SelfAssessmentScreen=()=>{const a=useAuthAbhaStore(rt=>rt.setScreen),_=useAuthAbhaStore(rt=>rt.ekaProfileInfo),$=GET_EXTRA_HEADERS(),_e=GET_REFRESH_TOKEN(),et=reactExports.useCallback(()=>{console.log("SA ended → closing SDK and redirecting"),window.closeSaApp?window.closeSaApp():console.warn("closeSaApp not found on window"),a(SCREEN_NAMES.CONSENT_LOADER_SCREEN)},[]),tt={useAuthToken:!0,workflow_id:3788,auth_token:($==null?void 0:$.auth)??"",refresh_token:_e,params:{age:calculateAge((_==null?void 0:_.date_of_birth)||""),gender:_==null?void 0:_.gender},practice_info:{patient_uuid:_==null?void 0:_.patient_uuid,unique_identifier:_==null?void 0:_.oid},onEndCallback:et};return jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:jsxRuntimeExports.jsx(SelfAssessmentSDKIframe,{src:"https://api.eka.care/sa-fe/main.js",mountConfig:tt})})},ConsentLoaderScreen=()=>{const a=useAuthAbhaStore(pt=>pt.txnId),_=useAuthAbhaStore(pt=>pt.setConsentApiBody),$=useAuthAbhaStore(pt=>pt.setScreen),_e=useAuthAbhaStore(pt=>pt.goBackLoginScreen),et=useAuthAbhaStore(pt=>pt.setBottomsheetErrorInfo),tt=useAuthAbhaStore(pt=>pt.isEkaAppLogin),rt=useAuthAbhaStore(pt=>pt.clientId),nt=useAuthAbhaStore(pt=>pt.abhaRequestConsentId),at=useAuthAbhaStore(pt=>pt.isNewLoginOrCreateFlow),st=GET_EXTRA_HEADERS(),it=useAuthAbhaStore(pt=>pt.setConsentDetails),ot=useAuthAbhaStore(pt=>pt.screen),lt=({name:pt,data:dt={}})=>{var ft,ut;const ct={...{login_platform:rt,is_eka_app_login:tt?"true":"false",is_new_login_or_create_flow:at?"true":"false",txn_id:a||"missing txnId",oid:st!=null&&st["X-User-ID"]?"true":"false",access_token:st!=null&&st.auth?"true":"false"},...dt};handleSendEvent({eventName:pt,eventData:ct}),(ut=(ft=window.curio)==null?void 0:ft.pushToMixpanel)==null||ut.call(ft,pt,ct)};reactExports.useEffect(()=>{const pt=ot[ot.length-2];lt({name:"abha_consent_request_page",data:{page_view:"abha_consent_request_page",platform:rt}}),lt({name:"fetch_consent_details_api",data:{type:"get_init",platform:rt}});const dt=async(ft,ut)=>{var gt,yt,Et;try{if(!nt)return lt({name:"abha_consent_request_page",data:{page_view:"abha_consent_request_page",platform:rt,data:{error_msg:"No consent ID found"}}}),console.error("No consent ID found"),{response:null,hasEkaCareHIP:!1,error:null};let _t=await getConsentRequest({id:nt,type:"requested"});(_t==null?void 0:_t.status)==="GRANTED"&&(_t=await getConsentRequest({id:nt,type:"granted"})),it(_t),_({id:_t.id,access_mode:_t.access_mode.toLowerCase(),duration:{from:((gt=_t.duration)==null?void 0:gt.from)??void 0,to:((yt=_t.duration)==null?void 0:yt.to)??void 0},erase_at:_t.erase_at,hi_types:_t.hi_types.map(wt=>wt.id),consent_artefacts:_t.providers.map(wt=>{var Pt;return{hip_id:((Pt=wt.hip)==null?void 0:Pt.id)??"",care_contexts:wt.care_contexts??[]}}),consent_artefacts_id:_t.providers.map(wt=>wt.consent_artefact_id??"")});const St=(Et=_t.providers)==null?void 0:Et.some(wt=>wt.hip.id==="ekacare");return{response:_t,hasEkaCareHIP:St,error:null}}catch(_t){const{code:St,error:wt,source_error:Pt}=_t;return lt({name:ft==="init"?"abha_consent_get_failed":"abha_consent_polling_failed",data:{flow_step_type:ft,clientId:rt,attempt:ut,error_code:St,error_msg:wt,source_error:Pt}}),{response:null,hasEkaCareHIP:!1,error:_t}}},mt=async()=>{lt({name:"abha_consent_get_triggered",data:{flow_step_type:"init",clientId:rt}});const{hasEkaCareHIP:ft,response:ut}=await dt("init");!ft&&(ut==null?void 0:ut.status)==="REQUESTED"?(lt({name:"abha_consent_no_ekacare_hip",data:{platform:rt}}),$(SCREEN_NAMES.SELF_ASSESSMENT)):(lt({name:"abha_consent_has_ekacare_hip",data:{platform:rt}}),$(SCREEN_NAMES.CONSENT_SCREEN)),lt({name:"abha_consent_get_success",data:{flow_step_type:"init",clientId:rt}})},ct=()=>{let ft=0;const ut=5;lt({name:"abha_consent_polling_started",data:{platform:rt}});const gt=async()=>{ft++,lt({name:"abha_consent_polling_attempt",data:{attempt:ft,platform:rt}});const{hasEkaCareHIP:Et,response:_t}=await dt("polling",ft);if(Et){clearInterval(yt),lt({name:"abha_consent_polling_success",data:{attempt:ft,platform:rt}}),$(SCREEN_NAMES.CONSENT_SCREEN);return}ft>=ut&&(clearInterval(yt),lt({name:"abha_consent_polling_timeout",data:{attempts:ft,platform:rt}}),$(SCREEN_NAMES.CONSENT_SCREEN))};gt();const yt=setInterval(gt,1e3);return()=>clearInterval(yt)};pt===SCREEN_NAMES.SELF_ASSESSMENT?ct():mt()},[]);const ht=()=>{lt({name:"abha_consent_request_error_bottomsheet_dismissed",data:{platform:rt}}),et(null),_e(),setIndividualEnv({extraHeaders:{auth:""}})};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsx(AbhaLoadingStatus,{}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:ht})]})},KYCLoginScreen=()=>{const a=useAuthAbhaStore(_e=>_e.clientId);reactExports.useEffect(()=>{var _e;if((_e=window.EkaAbha)!=null&&_e.changeStatusBarColor)return window.EkaAbha.changeStatusBarColor("#F2F4F7"),()=>{var et,tt;(et=window.EkaAbha)!=null&&et.changeStatusBarColor&&((tt=window==null?void 0:window.EkaAbha)==null||tt.changeStatusBarColor("#FFFFFF"))}},[]);const _=()=>{var _e;(_e=window.EkaAbha)==null||_e.onAbhaClose(),unMount()},$=["eka-web","www-eka","doctor"];return jsxRuntimeExports.jsxs("div",{className:"pds2-h-full pds2-overflow-y-auto",children:[!$.includes(a)&&jsxRuntimeExports.jsx(Pds2Header,{prefixIcon:jsxRuntimeExports.jsx("button",{onClick:_,children:jsxRuntimeExports.jsx(n$4,{})}),title:"",className:"pds2-bg-bg-01"}),jsxRuntimeExports.jsx(KYCDiffMethods,{})]})},KYCDiffMethods=()=>{const a=useAuthAbhaStore(jt=>jt.abhaAuthFlowMethod||ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),_=useAuthAbhaStore(jt=>jt.authTxnId),$=useAuthAbhaStore(jt=>jt.setAbhaAuthFlowMethod),_e=useAuthAbhaStore(jt=>jt.goBackToLogin),et=useAuthAbhaStore(jt=>jt.setGoBackToLogin),tt=useAuthAbhaStore(jt=>jt.setIdentifierValue),rt=useAuthAbhaStore(jt=>jt.identifierValue),nt=useAuthAbhaStore(jt=>jt.isEkaAppLogin),at=useAuthAbhaStore(jt=>jt.setRegistrationType),st=useAuthAbhaStore(jt=>jt.setAadhaarInitResponse),it=useAuthAbhaStore(jt=>jt.initAbhaAppIdentifierType),ot=useAuthAbhaStore(jt=>jt.initAbhaAppIdentifier);useAuthAbhaStore(jt=>jt.isDocAppRequest);const lt=useAuthAbhaStore(jt=>jt.isNewLoginOrCreateFlow),ht=useAuthAbhaStore(jt=>jt.clientId),pt=useAuthAbhaStore(jt=>jt.isInitApiTriggered),dt=useAuthAbhaStore(jt=>jt.setIsInitApiTriggered),mt=useAuthAbhaStore(jt=>jt.setIdentityValue),ct=useAuthAbhaStore(jt=>jt.setSelectedAbhaFlow),ft=useAuthAbhaStore(jt=>jt.setKycInitResponse),ut=useAuthAbhaStore(jt=>jt.txnId),[gt,yt]=reactExports.useState(LOADING_STATE.IDLE),[Et,_t]=reactExports.useState(""),St=useAuthAbhaStore(jt=>jt.setScreen),[wt,Pt]=reactExports.useState(!1),[Nt,Mt]=reactExports.useState(!1),[Dt,Rt]=reactExports.useState(rt.aadhaar_number||""),[kt,xt]=reactExports.useState(rt.abha_number||""),bt=reactExports.useRef(!1),vt=GET_EXTRA_HEADERS();vt==null||vt["X-User-ID"],reactExports.useEffect(()=>{At({name:"abha_login_or_create_screen",data:{flow:a.toString()}})}),reactExports.useEffect(()=>{ot&&it===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!_e?(tt({abha_number:ot}),xt(ot),Mt(!0),$(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER)):ot&&it===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!_e&&(Rt(ot),Pt(!0),tt({aadhaar_number:ot}),$(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER))},[it,ot]),reactExports.useEffect(()=>{pt||bt.current||Dt&&Dt.length===12&&a==ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&(dt(!0),bt.current=!0,$t())},[Dt]),reactExports.useEffect(()=>{pt||bt.current||kt&&kt.length===17&&a==ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&(dt(!0),bt.current=!0,$t())},[kt]);const At=({name:jt,data:Ht={}})=>{var Yt,Wt;const Vt={...{login_platform:ht,is_eka_app_login:nt?"true":"false",is_new_login_or_create_flow:lt?"true":"false",oid:vt!=null&&vt["X-User-ID"]?"true":"false",access_token:vt!=null&&vt.auth?"true":"false",txn_id:ut||"missing txnId",flow:a??""},...Ht};handleSendEvent({eventName:jt,eventData:Vt}),(Wt=(Yt=window.curio)==null?void 0:Yt.pushToMixpanel)==null||Wt.call(Yt,jt,Vt)},Ct=React.useMemo(()=>{switch(a){case ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER:return rt.abha_number.length===17;case ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER:return rt.aadhaar_number.length===12}},[a,rt]),Tt=({inputVal:jt})=>{jt.length===12&&(tt({aadhaar_number:jt}),Rt(jt),Pt(!0))},Ot=({inputVal:jt})=>{if(jt.length===14){let Ht="";jt.length>0&&(Ht+=jt.slice(0,2)),jt.length>2&&(Ht+=`-${jt.slice(2,6)}`),jt.length>6&&(Ht+=`-${jt.slice(6,10)}`),jt.length>10&&(Ht+=`-${jt.slice(10,14)}`),tt({abha_number:Ht}),xt(Ht),Mt(!0)}};reactExports.useEffect(()=>{console.log("selectedMethod changed:==================>",a)},[a]);const $t=async jt=>{var Ht;if(yt(LOADING_STATE.LOADING),a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER){const{txn_id:Lt,error:Vt,action:Yt,hint:Wt}=await postAbdmKycInit({method:"abha-number",identifier:rt.abha_number});if(At({name:"abha_kyc_init_triggered",data:{flow_step_type:"init",ndhmTxnId:Lt,method:a}}),dt(!0),mt(rt.abha_number),Lt){ft({txnId:Lt,kycOtpSentToHint:Wt||null}),yt(LOADING_STATE.RESOLVED),St(SCREEN_NAMES.VERIFY_KYC_OTP_LOGIN_WITH_ABHA);return}At({name:"abha_kyc_init_failure",data:{error_message:Vt||"unknown_error",error_message_exists:!!Vt,authTxnId:_,error_action:Yt,error_action_exists:!!Yt}}),_t(Vt||"Something went wrong"),yt(LOADING_STATE.REJECTED)}else{At({name:"aadhaar_registration_init_start",data:{flow_step_type:"init",authTxnId:_,aadhaarNumber:rt.aadhaar_number}});const{txn_id:Lt,hint:Vt,error:Yt,action:Wt}=await postRegisterAadhaarInit({aadhaar_number:rt.aadhaar_number});if(mt(rt.aadhaar_number),ct("aadhaar"),Lt&&Vt){st({authTxnId:_,txnId:Lt,aadhaarOtpSentToHint:Vt}),At({name:"aadhaar_registration_init_success",data:{flow_step_type:"verify",ndhmTxnId:Lt,authTxnId:_}}),et(!1),at(REGISTRATION_TYPE.CREATE),yt(LOADING_STATE.RESOLVED),St(SCREEN_NAMES.ABHA_OTP_AND_MOBILE);return}if(At({name:"abha_registration_init_failure",data:{error_message:Yt||"unknown_error",error_message_exists:!!Yt,authTxnId:_,error_action:Wt,error_action_exists:!!Wt}}),_t(Yt||"Something went wrong"),yt(LOADING_STATE.REJECTED),Wt||Yt){et(!0),(Ht=Wt==null?void 0:Wt.cta)!=null&&Ht.pid?St(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA):_t(Yt||"Something went wrong");return}}},It=jt=>{const Ht=jt.replace(/-/g,""),Lt=Ht.slice(0,2),Yt=Ht.slice(2).match(/.{1,4}/g)||[];return[Lt,...Yt]};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs("div",{className:"pds2-p-16 pds2-bg-bg-01 pds2-space-y-16 pds2-text-center pds2-rounded-b-24 pds2-pt-22",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-justify-center pds2-items-center pds2-gap-16",children:jsxRuntimeExports.jsx("div",{className:"pds2-bg-bg-white pds2-rounded-16",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm4ml1lwu00000tfs1okl7hs9.webp",alt:"abdm-icon",className:"pds2-w-64 pds2-h-64"})})}),jsxRuntimeExports.jsx("div",{className:"Heading3Semibold pds2-text-text-black",children:"Complete KYC"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-03",style:{marginTop:"4px"},children:a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?"using existing ABHA Number":a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"using your Aadhaar Number":""}),jsxRuntimeExports.jsx("div",{className:"pds2-w-full",children:jsxRuntimeExports.jsxs("div",{className:"pds2-relative pds2-flex pds2-bg-bg-seperator-dark pds2-rounded-12",children:[jsxRuntimeExports.jsx("div",{className:"pds2-absolute pds2-top-0 pds2-bottom-0 pds2-bg-bg-white pds2-rounded-12 pds2-transition-all pds2-duration-300",style:{left:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?0:"50%",width:"50%",boxShadow:"0px 10px 4px -6px #18274B17"}}),jsxRuntimeExports.jsxs("button",{onClick:()=>{$(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER),_t("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm5mcdm3h00070tfs9fjkepff.webp",alt:"aadhaar-icon",className:"pds2-w-24 pds2-h-24"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?{fontWeight:700}:{fontWeight:400},children:"Aadhaar"})]}),jsxRuntimeExports.jsxs("button",{onClick:()=>{$(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),_t("")},className:"pds2-flex-1 pds2-py-6 pds2-flex pds2-items-center pds2-justify-center pds2-gap-8 pds2-relative pds2-z-10",children:[jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm6hreldp000b0tfwf0nj156l.webp",alt:"abha-abdm-icon",className:"pds2-w-26 pds2-h-26"}),jsxRuntimeExports.jsx("span",{className:`pds2-text-base ${a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?"pds2-font-bold pds2-text-fg-default":"pds2-font-normal pds2-text-fg-subtle"}`,style:a===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER?{fontWeight:700}:{fontWeight:400},children:"ABHA number"})]})]})}),jsxRuntimeExports.jsx("div",{className:"pds2-mt-16 pds2-w-full pds2-max-w-md pds2-mx-auto pds2-px-4 pds2-relative pds2-pb-20 pds2-pt-10",children:a===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER?jsxRuntimeExports.jsx(AbhaInputComponent,{isAbhaNum:!1,initialValues:it===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!_e?(ot==null?void 0:ot.match(/.{1,4}/g))??void 0:(Dt==null?void 0:Dt.match(/.{1,4}/g))??void 0,disabled:!_e&&it===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!!ot,numberOfInputs:3,length:4,placeholder:"XXXX",onSubmit:Tt,setIsValid:Pt,setValue:Rt,setError:_t},"aadhaar-input"):jsxRuntimeExports.jsx(AbhaInputComponent,{isAbhaNum:!0,initialValues:it===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!_e?(ot==null?void 0:ot.match(/.{1,4}/g))??void 0:It(kt)??void 0,disabled:!_e&&it===ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER&&!!ot,numberOfInputs:4,length:4,placeholder:"XXXX",onSubmit:Ot,setIsValid:Mt,setValue:xt,setError:_t},"abha-number-input")}),Et&&jsxRuntimeExports.jsx("div",{className:`${Et.includes("KYC ABHA not found for")?"pds2-text-text-01":"pds2-text-text-error"} !pds2-mt-0 Body3Regular`,children:Et}),jsxRuntimeExports.jsx(Pds2Button,{title:"Next",IconComponent:()=>jsxRuntimeExports.jsx(c$3,{className:"pds2-w-16 pds2-h-16 -pds2-rotate-90 pds2-ml-8"}),state:!Ct||gt===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:gt===LOADING_STATE.LOADING,onClick:()=>$t(),className:"pds2-w-full "})]})})},AbhaKycOtpVerifyScreen=()=>{const a=useAuthAbhaStore(Rt=>Rt.txnId),_=useAuthAbhaStore(Rt=>Rt.clearAbhaAuthStore),$=useAuthAbhaStore(Rt=>Rt.kycOtpSentToHint),_e=useAuthAbhaStore(Rt=>Rt.loginIdentifierValue),et=useAuthAbhaStore(Rt=>Rt.abhaAuthFlowMethod),tt=useAuthAbhaStore(Rt=>Rt.goBackLoginScreen),rt=useAuthAbhaStore(Rt=>Rt.setTxnId),nt=useAuthAbhaStore(Rt=>Rt.setBottomsheetErrorInfo),[at,st]=reactExports.useState(!1),[it,ot]=reactExports.useState(""),[lt,ht]=reactExports.useState(!1),[pt,dt]=reactExports.useState(""),[mt,ct]=reactExports.useState(LOADING_STATE.IDLE),ft=useAuthAbhaStore(Rt=>Rt.isEkaAppLogin),ut=useAuthAbhaStore(Rt=>Rt.clientId),gt=useAuthAbhaStore(Rt=>Rt.initAbhaFlow),yt=useAuthAbhaStore(Rt=>Rt.isNewLoginOrCreateFlow),[Et,_t]=reactExports.useState(!1),St=GET_EXTRA_HEADERS(),wt=({name:Rt,data:kt={}})=>{var vt,At;const bt={...{login_platform:ut,is_eka_app_login:ft?"true":"false",is_new_kyc_or_create_flow:yt?"true":"false",txn_id:a||"missing txnId",oid:St!=null&&St["X-User-ID"]?"true":"false",access_token:St!=null&&St.auth?"true":"false"},...kt};handleSendEvent({eventName:Rt,eventData:bt}),(At=(vt=window.curio)==null?void 0:vt.pushToMixpanel)==null||At.call(vt,Rt,bt)};reactExports.useEffect(()=>{wt({name:"page_view",data:{page_view:"abha_kyc_otp_verify",platform:ut}})},[]);const Pt=()=>{wt({name:"abha_kyc_otp_verify_error_bottomsheet_dismissed",data:{platform:ut}}),tt();const Rt=ut,kt=useAuthAbhaStore.getState().isEkaAppLogin;_(),useAuthAbhaStore.setState({clientId:Rt}),useAuthAbhaStore.setState({isEkaAppLogin:kt})},Nt=({otp:Rt})=>{ot(Rt),wt({name:"abha_kyc_otp_completion",data:{type:"verify",platform:ut,txn_id:a,otp_entered:!0,method:et}}),Mt(Rt)},Mt=async Rt=>{if(!a){wt({name:"abha_kyc_otp_verify_txnId_not_found",data:{type:"verify",platform:ut,txn_id:a||"missing_txn_id",txn_id_exists:!!a,method:(et==null?void 0:et.toLowerCase())||"unknown_method"}});return}wt({name:"abha_kyc_otp_verify",data:{type:"verify",platform:ut,txn_id:a}}),ct(LOADING_STATE.LOADING);const{txn_id:kt,error:xt,action:bt}=await postAbdmKycVerify({otp:Rt,txn_id:a});if(bt){wt({name:"abha_kyc_otp_verify_error_action",data:{type:"verify",platform:ut,error_action:bt||"no_error_action",error_message:xt||"no_error_message",error_action_exists:!!bt,error_message_exists:!!xt}}),nt(bt);return}if(xt){wt({name:"abha_kyc_otp_verify_error",data:{type:"verify",platform:ut,error_message:xt||"unknown_error",error_message_exists:!!xt}}),ct(LOADING_STATE.REJECTED),dt(xt);return}ct(LOADING_STATE.RESOLVED),kt&&(_t(!0),ut==="phr"?setTimeout(()=>{onKYCSuccess("KYC verify success, onKYCSuccess called,next abha unmount"),unMount()},3e3):(onKYCSuccess("KYC verify success, onKYCSuccess called, next page redirect"),setTimeout(()=>{window.location.href="https://www.eka.care/s/for-patients"},3e3)))},Dt=async()=>{if(_e&&et){const{txn_id:Rt}=await postAbdmKycVerifyResendOtp({txn_id:a??""});wt({name:"abha_kyc_verify_resend_otp",data:{method:et,platform:ut,txn_id:Rt}}),Rt&&rt(Rt)}};return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et?jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:!Et,loadingText:"KYC verify in progress...",successText:"KYC Verified Successfully!"}):jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsx(AbhaHeader,{prefixIcon:jsxRuntimeExports.jsx("button",{className:"pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple",onClick:()=>st(!0),children:jsxRuntimeExports.jsx(n$4,{className:""})}),title:"OTP Verification",suffixIcon:jsxRuntimeExports.jsx(p$3,{className:"pds2-w-20 pds2-h-20"}),className:"pds2-border-b-1 pds2-border-bg-seperator-dark"}),gt?jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-bg-01"}):jsxRuntimeExports.jsx(AbhaStepper,{}),jsxRuntimeExports.jsx("div",{className:"pds2-p-16 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-bg-01",children:jsxRuntimeExports.jsx(AbhaOtpCard,{otpSentToText:$||"Enter OTP sent on mobile number linked with your Aadhaar",onOtpCompletion:Nt,onResendOtpClick:Dt,error:pt,setIsValid:Rt=>{pt&&dt(null),ht(Rt)},prefixIcon:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/cm6hreldp000b0tfwf0nj156l.webp",alt:"abdm-abha-icon",className:"pds2-w-48"})})}),jsxRuntimeExports.jsx("div",{className:"pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-bg-white pds2-w-full pds2-border pds2-border-border-brand-02",children:jsxRuntimeExports.jsx(Pds2Button,{title:"Verify",state:!lt||mt===LOADING_STATE.LOADING?"disabled":"enabled",className:"pds2-w-full",onClick:()=>Mt(it),isLoading:mt===LOADING_STATE.LOADING})}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:Pt}),jsxRuntimeExports.jsx(ExitPopup,{open:at,setOpen:st})]})})};var lib={},propTypes$2={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function a(_e,et,tt,rt,nt,at){if(at!==ReactPropTypesSecret){var st=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw st.name="Invariant Violation",st}}a.isRequired=a;function _(){return a}var $={array:a,bigint:a,bool:a,func:a,number:a,object:a,string:a,symbol:a,any:a,arrayOf:_,element:a,elementType:a,instanceOf:_,node:a,objectOf:_,oneOf:_,oneOfType:_,shape:_,exact:_,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return $.PropTypes=$,$};propTypes$2.exports=factoryWithThrowingShims();var propTypesExports=propTypes$2.exports,ErrorCorrectLevel={L:1,M:0,Q:3,H:2},mode$1={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},mode=mode$1;function QR8bitByte(a){this.mode=mode.MODE_8BIT_BYTE,this.data=a}QR8bitByte.prototype={getLength:function(a){return this.data.length},write:function(a){for(var _=0;_<this.data.length;_++)a.put(this.data.charCodeAt(_),8)}};var _8BitByte=QR8bitByte,ECL=ErrorCorrectLevel;function QRRSBlock(a,_){this.totalCount=a,this.dataCount=_}QRRSBlock.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];QRRSBlock.getRSBlocks=function(a,_){var $=QRRSBlock.getRsBlockTable(a,_);if($==null)throw new Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+_);for(var _e=$.length/3,et=new Array,tt=0;tt<_e;tt++)for(var rt=$[tt*3+0],nt=$[tt*3+1],at=$[tt*3+2],st=0;st<rt;st++)et.push(new QRRSBlock(nt,at));return et};QRRSBlock.getRsBlockTable=function(a,_){switch(_){case ECL.L:return QRRSBlock.RS_BLOCK_TABLE[(a-1)*4+0];case ECL.M:return QRRSBlock.RS_BLOCK_TABLE[(a-1)*4+1];case ECL.Q:return QRRSBlock.RS_BLOCK_TABLE[(a-1)*4+2];case ECL.H:return QRRSBlock.RS_BLOCK_TABLE[(a-1)*4+3];default:return}};var RSBlock$1=QRRSBlock;function QRBitBuffer(){this.buffer=new Array,this.length=0}QRBitBuffer.prototype={get:function(a){var _=Math.floor(a/8);return(this.buffer[_]>>>7-a%8&1)==1},put:function(a,_){for(var $=0;$<_;$++)this.putBit((a>>>_-$-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(a){var _=Math.floor(this.length/8);this.buffer.length<=_&&this.buffer.push(0),a&&(this.buffer[_]|=128>>>this.length%8),this.length++}};var BitBuffer$1=QRBitBuffer,QRMath={glog:function(a){if(a<1)throw new Error("glog("+a+")");return QRMath.LOG_TABLE[a]},gexp:function(a){for(;a<0;)a+=255;for(;a>=256;)a-=255;return QRMath.EXP_TABLE[a]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var i=0;i<8;i++)QRMath.EXP_TABLE[i]=1<<i;for(var i=8;i<256;i++)QRMath.EXP_TABLE[i]=QRMath.EXP_TABLE[i-4]^QRMath.EXP_TABLE[i-5]^QRMath.EXP_TABLE[i-6]^QRMath.EXP_TABLE[i-8];for(var i=0;i<255;i++)QRMath.LOG_TABLE[QRMath.EXP_TABLE[i]]=i;var math$2=QRMath,math$1=math$2;function QRPolynomial(a,_){if(a.length==null)throw new Error(a.length+"/"+_);for(var $=0;$<a.length&&a[$]==0;)$++;this.num=new Array(a.length-$+_);for(var _e=0;_e<a.length-$;_e++)this.num[_e]=a[_e+$]}QRPolynomial.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var _=new Array(this.getLength()+a.getLength()-1),$=0;$<this.getLength();$++)for(var _e=0;_e<a.getLength();_e++)_[$+_e]^=math$1.gexp(math$1.glog(this.get($))+math$1.glog(a.get(_e)));return new QRPolynomial(_,0)},mod:function(a){if(this.getLength()-a.getLength()<0)return this;for(var _=math$1.glog(this.get(0))-math$1.glog(a.get(0)),$=new Array(this.getLength()),_e=0;_e<this.getLength();_e++)$[_e]=this.get(_e);for(var _e=0;_e<a.getLength();_e++)$[_e]^=math$1.gexp(math$1.glog(a.get(_e))+_);return new QRPolynomial($,0).mod(a)}};var Polynomial$2=QRPolynomial,Mode=mode$1,Polynomial$1=Polynomial$2,math=math$2,QRMaskPattern={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},QRUtil={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var _=a<<10;QRUtil.getBCHDigit(_)-QRUtil.getBCHDigit(QRUtil.G15)>=0;)_^=QRUtil.G15<<QRUtil.getBCHDigit(_)-QRUtil.getBCHDigit(QRUtil.G15);return(a<<10|_)^QRUtil.G15_MASK},getBCHTypeNumber:function(a){for(var _=a<<12;QRUtil.getBCHDigit(_)-QRUtil.getBCHDigit(QRUtil.G18)>=0;)_^=QRUtil.G18<<QRUtil.getBCHDigit(_)-QRUtil.getBCHDigit(QRUtil.G18);return a<<12|_},getBCHDigit:function(a){for(var _=0;a!=0;)_++,a>>>=1;return _},getPatternPosition:function(a){return QRUtil.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,_,$){switch(a){case QRMaskPattern.PATTERN000:return(_+$)%2==0;case QRMaskPattern.PATTERN001:return _%2==0;case QRMaskPattern.PATTERN010:return $%3==0;case QRMaskPattern.PATTERN011:return(_+$)%3==0;case QRMaskPattern.PATTERN100:return(Math.floor(_/2)+Math.floor($/3))%2==0;case QRMaskPattern.PATTERN101:return _*$%2+_*$%3==0;case QRMaskPattern.PATTERN110:return(_*$%2+_*$%3)%2==0;case QRMaskPattern.PATTERN111:return(_*$%3+(_+$)%2)%2==0;default:throw new Error("bad maskPattern:"+a)}},getErrorCorrectPolynomial:function(a){for(var _=new Polynomial$1([1],0),$=0;$<a;$++)_=_.multiply(new Polynomial$1([1,math.gexp($)],0));return _},getLengthInBits:function(a,_){if(1<=_&&_<10)switch(a){case Mode.MODE_NUMBER:return 10;case Mode.MODE_ALPHA_NUM:return 9;case Mode.MODE_8BIT_BYTE:return 8;case Mode.MODE_KANJI:return 8;default:throw new Error("mode:"+a)}else if(_<27)switch(a){case Mode.MODE_NUMBER:return 12;case Mode.MODE_ALPHA_NUM:return 11;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 10;default:throw new Error("mode:"+a)}else if(_<41)switch(a){case Mode.MODE_NUMBER:return 14;case Mode.MODE_ALPHA_NUM:return 13;case Mode.MODE_8BIT_BYTE:return 16;case Mode.MODE_KANJI:return 12;default:throw new Error("mode:"+a)}else throw new Error("type:"+_)},getLostPoint:function(a){for(var _=a.getModuleCount(),$=0,_e=0;_e<_;_e++)for(var et=0;et<_;et++){for(var tt=0,rt=a.isDark(_e,et),nt=-1;nt<=1;nt++)if(!(_e+nt<0||_<=_e+nt))for(var at=-1;at<=1;at++)et+at<0||_<=et+at||nt==0&&at==0||rt==a.isDark(_e+nt,et+at)&&tt++;tt>5&&($+=3+tt-5)}for(var _e=0;_e<_-1;_e++)for(var et=0;et<_-1;et++){var st=0;a.isDark(_e,et)&&st++,a.isDark(_e+1,et)&&st++,a.isDark(_e,et+1)&&st++,a.isDark(_e+1,et+1)&&st++,(st==0||st==4)&&($+=3)}for(var _e=0;_e<_;_e++)for(var et=0;et<_-6;et++)a.isDark(_e,et)&&!a.isDark(_e,et+1)&&a.isDark(_e,et+2)&&a.isDark(_e,et+3)&&a.isDark(_e,et+4)&&!a.isDark(_e,et+5)&&a.isDark(_e,et+6)&&($+=40);for(var et=0;et<_;et++)for(var _e=0;_e<_-6;_e++)a.isDark(_e,et)&&!a.isDark(_e+1,et)&&a.isDark(_e+2,et)&&a.isDark(_e+3,et)&&a.isDark(_e+4,et)&&!a.isDark(_e+5,et)&&a.isDark(_e+6,et)&&($+=40);for(var it=0,et=0;et<_;et++)for(var _e=0;_e<_;_e++)a.isDark(_e,et)&&it++;var ot=Math.abs(100*it/_/_-50)/5;return $+=ot*10,$}},util$1=QRUtil,BitByte=_8BitByte,RSBlock=RSBlock$1,BitBuffer=BitBuffer$1,util=util$1,Polynomial=Polynomial$2;function QRCode$1(a,_){this.typeNumber=a,this.errorCorrectLevel=_,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}var proto=QRCode$1.prototype;proto.addData=function(a){var _=new BitByte(a);this.dataList.push(_),this.dataCache=null};proto.isDark=function(a,_){if(a<0||this.moduleCount<=a||_<0||this.moduleCount<=_)throw new Error(a+","+_);return this.modules[a][_]};proto.getModuleCount=function(){return this.moduleCount};proto.make=function(){if(this.typeNumber<1){var a=1;for(a=1;a<40;a++){for(var _=RSBlock.getRSBlocks(a,this.errorCorrectLevel),$=new BitBuffer,_e=0,et=0;et<_.length;et++)_e+=_[et].dataCount;for(var et=0;et<this.dataList.length;et++){var tt=this.dataList[et];$.put(tt.mode,4),$.put(tt.getLength(),util.getLengthInBits(tt.mode,a)),tt.write($)}if($.getLengthInBits()<=_e*8)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())};proto.makeImpl=function(a,_){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var $=0;$<this.moduleCount;$++){this.modules[$]=new Array(this.moduleCount);for(var _e=0;_e<this.moduleCount;_e++)this.modules[$][_e]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(a,_),this.typeNumber>=7&&this.setupTypeNumber(a),this.dataCache==null&&(this.dataCache=QRCode$1.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,_)};proto.setupPositionProbePattern=function(a,_){for(var $=-1;$<=7;$++)if(!(a+$<=-1||this.moduleCount<=a+$))for(var _e=-1;_e<=7;_e++)_+_e<=-1||this.moduleCount<=_+_e||(0<=$&&$<=6&&(_e==0||_e==6)||0<=_e&&_e<=6&&($==0||$==6)||2<=$&&$<=4&&2<=_e&&_e<=4?this.modules[a+$][_+_e]=!0:this.modules[a+$][_+_e]=!1)};proto.getBestMaskPattern=function(){for(var a=0,_=0,$=0;$<8;$++){this.makeImpl(!0,$);var _e=util.getLostPoint(this);($==0||a>_e)&&(a=_e,_=$)}return _};proto.createMovieClip=function(a,_,$){var _e=a.createEmptyMovieClip(_,$),et=1;this.make();for(var tt=0;tt<this.modules.length;tt++)for(var rt=tt*et,nt=0;nt<this.modules[tt].length;nt++){var at=nt*et,st=this.modules[tt][nt];st&&(_e.beginFill(0,100),_e.moveTo(at,rt),_e.lineTo(at+et,rt),_e.lineTo(at+et,rt+et),_e.lineTo(at,rt+et),_e.endFill())}return _e};proto.setupTimingPattern=function(){for(var a=8;a<this.moduleCount-8;a++)this.modules[a][6]==null&&(this.modules[a][6]=a%2==0);for(var _=8;_<this.moduleCount-8;_++)this.modules[6][_]==null&&(this.modules[6][_]=_%2==0)};proto.setupPositionAdjustPattern=function(){for(var a=util.getPatternPosition(this.typeNumber),_=0;_<a.length;_++)for(var $=0;$<a.length;$++){var _e=a[_],et=a[$];if(this.modules[_e][et]==null)for(var tt=-2;tt<=2;tt++)for(var rt=-2;rt<=2;rt++)tt==-2||tt==2||rt==-2||rt==2||tt==0&&rt==0?this.modules[_e+tt][et+rt]=!0:this.modules[_e+tt][et+rt]=!1}};proto.setupTypeNumber=function(a){for(var _=util.getBCHTypeNumber(this.typeNumber),$=0;$<18;$++){var _e=!a&&(_>>$&1)==1;this.modules[Math.floor($/3)][$%3+this.moduleCount-8-3]=_e}for(var $=0;$<18;$++){var _e=!a&&(_>>$&1)==1;this.modules[$%3+this.moduleCount-8-3][Math.floor($/3)]=_e}};proto.setupTypeInfo=function(a,_){for(var $=this.errorCorrectLevel<<3|_,_e=util.getBCHTypeInfo($),et=0;et<15;et++){var tt=!a&&(_e>>et&1)==1;et<6?this.modules[et][8]=tt:et<8?this.modules[et+1][8]=tt:this.modules[this.moduleCount-15+et][8]=tt}for(var et=0;et<15;et++){var tt=!a&&(_e>>et&1)==1;et<8?this.modules[8][this.moduleCount-et-1]=tt:et<9?this.modules[8][15-et-1+1]=tt:this.modules[8][15-et-1]=tt}this.modules[this.moduleCount-8][8]=!a};proto.mapData=function(a,_){for(var $=-1,_e=this.moduleCount-1,et=7,tt=0,rt=this.moduleCount-1;rt>0;rt-=2)for(rt==6&&rt--;;){for(var nt=0;nt<2;nt++)if(this.modules[_e][rt-nt]==null){var at=!1;tt<a.length&&(at=(a[tt]>>>et&1)==1);var st=util.getMask(_,_e,rt-nt);st&&(at=!at),this.modules[_e][rt-nt]=at,et--,et==-1&&(tt++,et=7)}if(_e+=$,_e<0||this.moduleCount<=_e){_e-=$,$=-$;break}}};QRCode$1.PAD0=236;QRCode$1.PAD1=17;QRCode$1.createData=function(a,_,$){for(var _e=RSBlock.getRSBlocks(a,_),et=new BitBuffer,tt=0;tt<$.length;tt++){var rt=$[tt];et.put(rt.mode,4),et.put(rt.getLength(),util.getLengthInBits(rt.mode,a)),rt.write(et)}for(var nt=0,tt=0;tt<_e.length;tt++)nt+=_e[tt].dataCount;if(et.getLengthInBits()>nt*8)throw new Error("code length overflow. ("+et.getLengthInBits()+">"+nt*8+")");for(et.getLengthInBits()+4<=nt*8&&et.put(0,4);et.getLengthInBits()%8!=0;)et.putBit(!1);for(;!(et.getLengthInBits()>=nt*8||(et.put(QRCode$1.PAD0,8),et.getLengthInBits()>=nt*8));)et.put(QRCode$1.PAD1,8);return QRCode$1.createBytes(et,_e)};QRCode$1.createBytes=function(a,_){for(var $=0,_e=0,et=0,tt=new Array(_.length),rt=new Array(_.length),nt=0;nt<_.length;nt++){var at=_[nt].dataCount,st=_[nt].totalCount-at;_e=Math.max(_e,at),et=Math.max(et,st),tt[nt]=new Array(at);for(var it=0;it<tt[nt].length;it++)tt[nt][it]=255&a.buffer[it+$];$+=at;var ot=util.getErrorCorrectPolynomial(st),lt=new Polynomial(tt[nt],ot.getLength()-1),ht=lt.mod(ot);rt[nt]=new Array(ot.getLength()-1);for(var it=0;it<rt[nt].length;it++){var pt=it+ht.getLength()-rt[nt].length;rt[nt][it]=pt>=0?ht.get(pt):0}}for(var dt=0,it=0;it<_.length;it++)dt+=_[it].totalCount;for(var mt=new Array(dt),ct=0,it=0;it<_e;it++)for(var nt=0;nt<_.length;nt++)it<tt[nt].length&&(mt[ct++]=tt[nt][it]);for(var it=0;it<et;it++)for(var nt=0;nt<_.length;nt++)it<rt[nt].length&&(mt[ct++]=rt[nt][it]);return mt};var QRCode_1=QRCode$1,QRCodeSvg$1={};Object.defineProperty(QRCodeSvg$1,"__esModule",{value:!0});var _extends$1=Object.assign||function(a){for(var _=1;_<arguments.length;_++){var $=arguments[_];for(var _e in $)Object.prototype.hasOwnProperty.call($,_e)&&(a[_e]=$[_e])}return a},_propTypes$1=propTypesExports,_propTypes2$1=_interopRequireDefault$1(_propTypes$1),_react$1=reactExports,_react2$1=_interopRequireDefault$1(_react$1);function _interopRequireDefault$1(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties$1(a,_){var $={};for(var _e in a)_.indexOf(_e)>=0||Object.prototype.hasOwnProperty.call(a,_e)&&($[_e]=a[_e]);return $}var propTypes$1={bgColor:_propTypes2$1.default.oneOfType([_propTypes2$1.default.object,_propTypes2$1.default.string]).isRequired,bgD:_propTypes2$1.default.string.isRequired,fgColor:_propTypes2$1.default.oneOfType([_propTypes2$1.default.object,_propTypes2$1.default.string]).isRequired,fgD:_propTypes2$1.default.string.isRequired,size:_propTypes2$1.default.number.isRequired,title:_propTypes2$1.default.string,viewBoxSize:_propTypes2$1.default.number.isRequired,xmlns:_propTypes2$1.default.string},QRCodeSvg=(0,_react$1.forwardRef)(function(a,_){var $=a.bgColor,_e=a.bgD,et=a.fgD,tt=a.fgColor,rt=a.size,nt=a.title,at=a.viewBoxSize,st=a.xmlns,it=st===void 0?"http://www.w3.org/2000/svg":st,ot=_objectWithoutProperties$1(a,["bgColor","bgD","fgD","fgColor","size","title","viewBoxSize","xmlns"]);return _react2$1.default.createElement("svg",_extends$1({},ot,{height:rt,ref:_,viewBox:"0 0 "+at+" "+at,width:rt,xmlns:it}),nt?_react2$1.default.createElement("title",null,nt):null,_react2$1.default.createElement("path",{d:_e,fill:$}),_react2$1.default.createElement("path",{d:et,fill:tt}))});QRCodeSvg.displayName="QRCodeSvg";QRCodeSvg.propTypes=propTypes$1;QRCodeSvg$1.default=QRCodeSvg;Object.defineProperty(lib,"__esModule",{value:!0});lib.QRCode=void 0;var _extends=Object.assign||function(a){for(var _=1;_<arguments.length;_++){var $=arguments[_];for(var _e in $)Object.prototype.hasOwnProperty.call($,_e)&&(a[_e]=$[_e])}return a},_propTypes=propTypesExports,_propTypes2=_interopRequireDefault(_propTypes),_ErrorCorrectLevel=ErrorCorrectLevel,_ErrorCorrectLevel2=_interopRequireDefault(_ErrorCorrectLevel),_QRCode=QRCode_1,_QRCode2=_interopRequireDefault(_QRCode),_react=reactExports,_react2=_interopRequireDefault(_react),_QRCodeSvg=QRCodeSvg$1,_QRCodeSvg2=_interopRequireDefault(_QRCodeSvg);function _interopRequireDefault(a){return a&&a.__esModule?a:{default:a}}function _objectWithoutProperties(a,_){var $={};for(var _e in a)_.indexOf(_e)>=0||Object.prototype.hasOwnProperty.call(a,_e)&&($[_e]=a[_e]);return $}var propTypes={bgColor:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.string]),fgColor:_propTypes2.default.oneOfType([_propTypes2.default.object,_propTypes2.default.string]),level:_propTypes2.default.string,size:_propTypes2.default.number,value:_propTypes2.default.string.isRequired},QRCode=(0,_react.forwardRef)(function(a,_){var $=a.bgColor,_e=$===void 0?"#FFFFFF":$,et=a.fgColor,tt=et===void 0?"#000000":et,rt=a.level,nt=rt===void 0?"L":rt,at=a.size,st=at===void 0?256:at,it=a.value,ot=_objectWithoutProperties(a,["bgColor","fgColor","level","size","value"]),lt=new _QRCode2.default(-1,_ErrorCorrectLevel2.default[nt]);lt.addData(it),lt.make();var ht=lt.modules;return _react2.default.createElement(_QRCodeSvg2.default,_extends({},ot,{bgColor:_e,bgD:ht.map(function(pt,dt){return pt.map(function(mt,ct){return mt?"":"M "+ct+" "+dt+" l 1 0 0 1 -1 0 Z"}).join(" ")}).join(" "),fgColor:tt,fgD:ht.map(function(pt,dt){return pt.map(function(mt,ct){return mt?"M "+ct+" "+dt+" l 1 0 0 1 -1 0 Z":""}).join(" ")}).join(" "),ref:_,size:st,viewBoxSize:ht.length}))});lib.QRCode=QRCode;QRCode.displayName="QRCode";QRCode.propTypes=propTypes;var _default=lib.default=QRCode;const AbhaFaceAuthStepsCarousel=({onClose:a})=>{const _=reactExports.useRef(null),$=_e=>{_.current&&_.current.scrollBy({left:_e,behavior:"smooth"})};return jsxRuntimeExports.jsxs("div",{className:"pds2-w-full pds2-pb-10 pds2-mt-25 pds2-relative",children:[jsxRuntimeExports.jsxs("div",{className:"Body1Semibold pds2-text-text-03 pds2-text-left pds2-w-full pds2-py-4 pds2-flex pds2-justify-between",children:[jsxRuntimeExports.jsx("div",{children:"Follow these steps"}),jsxRuntimeExports.jsx("div",{className:"pds2-pr-5 pds2-cursor-pointer",title:"Close Carousel",onClick:a,children:"x"})]}),jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,onClick:()=>$(240),onKeyDown:_e=>_e.key==="Enter"&&$(240),className:"pds2-shadow-elevation-100 pds2-shadow-text-black pds2-absolute pds2-right-0 pds2-cursor-pointer pds2-bottom-110 pds2-bg-bg-seperator-dark pds2-rounded-full pds2-p-5",children:jsxRuntimeExports.jsx(l$6,{className:"pds2-text-text-01"})}),jsxRuntimeExports.jsx("div",{ref:_,className:"Body1Semibold pds2-text-text-03 pds2-flex pds2-overflow-x-scroll pds2-gap-16 pds2-w-full",children:FACE_AUTH_STEPS_URL.map((_e,et)=>jsxRuntimeExports.jsx("div",{className:"pds2-w-1/4 pds2-min-w-220 pds2-min-h-200px",children:jsxRuntimeExports.jsx("img",{className:"pds2-w-full pds2-shadow-elevation-100 pds2-shadow-border-neutral/50",src:_e})},et))}),jsxRuntimeExports.jsx("div",{role:"button",tabIndex:0,onClick:()=>$(-240),onKeyDown:_e=>_e.key==="Enter"&&$(-240),className:"pds2-shadow-elevation-100 pds2-shadow-text-black pds2-absolute pds2-cursor-pointer pds2-bottom-110 pds2-bg-bg-seperator-dark pds2-rounded-full pds2-p-5",children:jsxRuntimeExports.jsx(n$4,{className:"pds2-text-text-01"})})]})},AbhaAuthQRScreen=()=>{var Dt;const a=useAuthAbhaStore(Rt=>Rt.txnId),_=useAuthAbhaStore(Rt=>Rt.setTxnId),$=useAuthAbhaStore(Rt=>Rt.setScreen),_e=useAuthAbhaStore(Rt=>Rt.goBackScreen),et=useAuthAbhaStore(Rt=>Rt.setGoBackToLogin),tt=useAuthAbhaStore(Rt=>Rt.faceAuthQrUrl),rt=useAuthAbhaStore(Rt=>Rt.identifierValue),nt=useAuthAbhaStore(Rt=>Rt.initAbhaFlow),at=useAuthAbhaStore(Rt=>Rt.isEkaAppLogin),st=useAuthAbhaStore(Rt=>Rt.clientId),it=useAuthAbhaStore(Rt=>Rt.isNewLoginOrCreateFlow),ot=GET_EXTRA_HEADERS(),lt=useAuthAbhaStore(Rt=>Rt.setEkaSmallToken),ht=useAuthAbhaStore(Rt=>Rt.setSelectedAbhaAddress),pt=useAuthAbhaStore(Rt=>Rt.setOid),dt=useAuthAbhaStore(Rt=>Rt.setEkaProfileInfo),mt=useAuthAbhaStore(Rt=>Rt.setAbhaAddressList),ct=useAuthAbhaStore(Rt=>Rt.goBackLoginScreen),ft=useAuthAbhaStore(Rt=>Rt.setAadhaarVerificationSkipStateStatus),[ut,gt]=reactExports.useState(!0),[yt,Et]=reactExports.useState(!1),_t=useAuthAbhaStore(Rt=>Rt.setBottomsheetErrorInfo),[St,wt]=reactExports.useState(FACE_AUTH_CAPTURE_STATUS.PENDING),Pt=({name:Rt,data:kt={}})=>{var vt,At;const bt={...{login_platform:st,is_eka_app_login:at?"true":"false",is_new_login_or_create_flow:it?"true":"false",txn_id:a||"missing txnId",oid:ot!=null&&ot["X-User-ID"]?"true":"false",access_token:ot!=null&&ot.auth?"true":"false"},...kt};handleSendEvent({eventName:Rt,eventData:bt}),(At=(vt=window.curio)==null?void 0:vt.pushToMixpanel)==null||At.call(vt,Rt,bt)},Nt=()=>{Pt({name:"abha_faceauth_verify_error_bottomsheet_dismissed",data:{platform:st}}),ct(),_t(null)},Mt=async()=>{if(!a){Pt({name:"aadhaar_faceauth_verification_no_txnId",data:{platform:st,type:"verify",txn_id:a||"missing_txnId",txn_id_exists:!!a}});return}Pt({name:"abha_aadhaar_faceauth_verify_submitted",data:{platform:st,type:"verify"}});const{txn_id:Rt,skip_state:kt,profile:xt,eka:bt,error:vt,abha_profiles:At,source_error:Ct,action:Tt}=await postRegisterAadhaarFaceAuthVerify({aadhaar:(rt==null?void 0:rt.aadhaar_number)||"",txn_id:a});if(vt||Ct!=null&&Ct.message){Pt({name:"aadhaar_faceauth_verification_failed",data:{platform:st,reason:vt||Ct||"unknown_error",txn_id_exists:!!a}}),_t({title:"Aadhaar Verification Failed",img:"",description:vt||"Verification failed. Please retry.",cta:{title:"",pid:"",params:null}}),Tt&&_t(Tt);return}if(!Rt||!kt){Pt({name:"aadhaar_otp_verification_failed",data:{platform:st,reason:vt||"missing_txn_id_or_skip_state",txn_id_exists:!!Rt,skip_state_exists:!!kt}}),_t({title:"Verification Failed",img:"",description:vt||"Verification failed. Please retry.",cta:{title:"",pid:"",params:null}}),Tt&&_t(Tt);return}Pt({name:"aadhaar_faceauth_verification_success",data:{platform:st,skip_state:kt,oid:bt==null?void 0:bt.oid}}),ft(kt),bt!=null&&bt.min_token&&lt(bt.min_token),Rt&&_(Rt),xt&&xt.abha_address&&ht(xt.abha_address),bt!=null&&bt.oid&&pt(bt.oid),xt&&dt({date_of_birth:`${xt.year_of_birth}-${String(xt.month_of_birth).padStart(2,"0")}-${String(xt.day_of_birth).padStart(2,"0")}`,firstname:xt.first_name,lastname:xt.last_name,pincode:xt.pincode,gender:xt.gender,name:xt.first_name+" "+xt.last_name,mobile:xt.mobile,oid:bt==null?void 0:bt.oid,abha_address:xt.abha_address,abha_number:xt.abha_number,kyc_verified:xt==null?void 0:xt.kyc_verified}),Pt({name:"abha_aadhaar_otp_verification_success",data:{platform:st,skip_state:kt,oid:bt==null?void 0:bt.oid}}),At&&mt(At),$(SCREEN_NAMES.AADHAAR_FACEAUTH_VERIFICATION_STATUS)};return reactExports.useEffect(()=>{let Rt=0,kt;const xt=async()=>{Rt++;try{const bt=await postRegisterAadhaarFaceAuthCapture({txn_id:a});if(console.log("Poll attempt:",Rt,"Response:",bt),(bt==null?void 0:bt.status)==="COMPLETE"){wt(FACE_AUTH_CAPTURE_STATUS.COMPLETE),clearInterval(kt),await Mt();return}else if((bt==null?void 0:bt.status)==="VERIFIED")wt(FACE_AUTH_CAPTURE_STATUS.VERIFIED);else if((bt==null?void 0:bt.status)==="FAILED"){wt(FACE_AUTH_CAPTURE_STATUS.FAILED),clearInterval(kt),_t({title:"Authentication Failed",img:"",description:"Face capture failed. Please retry.",cta:{title:"",pid:"",params:null}});return}}catch(bt){console.error("Error in face auth poll:",bt)}};return xt(),kt=setInterval(xt,3e3),()=>clearInterval(kt)},[a]),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsx(AbhaHeader,{title:"Face Authentication",className:"pds2-border-b-1 pds2-border-bg-seperator-dark",prefixIcon:jsxRuntimeExports.jsx("button",{className:"pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple",onClick:()=>Et(!0),children:jsxRuntimeExports.jsx(n$4,{className:""})})}),!nt&&St===FACE_AUTH_CAPTURE_STATUS.PENDING?jsxRuntimeExports.jsx(AbhaStepper,{}):jsxRuntimeExports.jsx("div",{className:`pds2-pt-40 ${St===FACE_AUTH_CAPTURE_STATUS.FAILED?"":"pds2-bg-bg-01"}`}),St===FACE_AUTH_CAPTURE_STATUS.PENDING&&jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-pb-16 pds2-space-y-16 pds2-overflow-y-auto pds2-flex-1 pds2-bg-bg-01",children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-items-center pds2-text-center ",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-justify-between",children:[jsxRuntimeExports.jsxs("div",{className:"Body2Regular pds2-text-text-03 pds2-py-15",children:["Aadhaar:"," ",jsxRuntimeExports.jsx("span",{className:"Body2Semibold pds2-text-text-03",children:(Dt=rt==null?void 0:rt.aadhaar_number)==null?void 0:Dt.replace(/(.{4})/g,"$1-").replace(/-$/,"")})]}),jsxRuntimeExports.jsx("div",{title:"Change",className:"pds2-cursor-pointer pds2-pl-5",onClick:()=>{_e(),et(!0)},children:jsxRuntimeExports.jsx(i$1,{})})]}),jsxRuntimeExports.jsx("div",{className:"Heading3Semibold pds2-text-text-01",children:"Face Authentication"}),jsxRuntimeExports.jsx("div",{className:"Body2Regular pds2-mb-25 pds2-text-text-03",children:"Scan this QR and complete authentication"}),jsxRuntimeExports.jsx(_default,{className:"pds2-w-250 pds2-h-250",bgColor:"#f2f4f7",value:tt||" "}),ut&&jsxRuntimeExports.jsx(AbhaFaceAuthStepsCarousel,{onClose:()=>gt(!1)})]})}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:Nt}),jsxRuntimeExports.jsx(ExitPopup,{open:yt,setOpen:Et}),St!=FACE_AUTH_CAPTURE_STATUS.PENDING&&St!=FACE_AUTH_CAPTURE_STATUS.FAILED&&jsxRuntimeExports.jsx("div",{className:"pds2-bg-bg-01 pds2-px-16 pds2-w-full pds2-h-full pds2-flex pds2-flex-col pds2-items-center pds2-justify-center pds2-text-center",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Lottie,{animationData:animationDataLoading$1,loop:!0,className:"pds2-w-400"}),jsxRuntimeExports.jsx("div",{className:"pds2-text-text-01 Heading4Semibold pds2-absolute pds2-mt-220",children:"Verification in Progress..."})]})})]})},AbhaMobileandOtpScreen=()=>{const[a,_]=reactExports.useState(LOADING_STATE.IDLE),$=useAuthAbhaStore(Bt=>Bt.authTxnId),_e=useAuthAbhaStore(Bt=>Bt.setAbhaAddressList),et=useAuthAbhaStore(Bt=>Bt.setScreen),tt=useAuthAbhaStore(Bt=>Bt.identifierValue),rt=useAuthAbhaStore(Bt=>Bt.txnId),nt=useAuthAbhaStore(Bt=>Bt.setTxnId),at=useAuthAbhaStore(Bt=>Bt.aadhaarOtpSentToHint),st=useAuthAbhaStore(Bt=>Bt.setAadhaarVerificationSkipStateStatus),it=useAuthAbhaStore(Bt=>Bt.selectedAbhaFlow),ot=useAuthAbhaStore(Bt=>Bt.setEkaSmallToken),lt=useAuthAbhaStore(Bt=>Bt.setOid);useAuthAbhaStore(Bt=>Bt.clearAbhaAuthStore);const ht=useAuthAbhaStore(Bt=>Bt.setBottomsheetErrorInfo),pt=useAuthAbhaStore(Bt=>Bt.goBackLoginScreen),dt=useAuthAbhaStore(Bt=>Bt.goBackScreen),mt=useAuthAbhaStore(Bt=>Bt.isDocAppRequest),[ct,ft]=reactExports.useState(""),[ut,gt]=reactExports.useState(!1),[yt,Et]=reactExports.useState(mt?tt==null?void 0:tt.mobile:""),[_t,St]=reactExports.useState(null),[wt,Pt]=reactExports.useState(null),Nt=useAuthAbhaStore(Bt=>Bt.setSelectedAbhaAddress),Mt=useAuthAbhaStore(Bt=>Bt.setEkaProfileInfo),Dt=useAuthAbhaStore(Bt=>Bt.setMobileInitResponse),Rt=useAuthAbhaStore(Bt=>Bt.clientId),kt=useAuthAbhaStore(Bt=>Bt.isEkaAppLogin),xt=useAuthAbhaStore(Bt=>Bt.isNewLoginOrCreateFlow),bt=useAuthAbhaStore(Bt=>Bt.initAbhaFlow),vt=useAuthAbhaStore(Bt=>Bt.setIsInitApiTriggered),At=useAuthAbhaStore(Bt=>Bt.setAbhaAuthFlowMethod),Ct=useAuthAbhaStore(Bt=>Bt.setIdentifierValue),Tt=GET_EXTRA_HEADERS(),Ot=useAuthAbhaStore(Bt=>Bt.abhaAuthFlowMethod),[$t,It]=reactExports.useState(!1),jt=({name:Bt,data:zt={}})=>{var rr,Zt;const Qt={...{login_platform:Rt,is_eka_app_login:kt?"true":"false",is_new_login_or_create_flow:xt?"true":"false",txn_id:rt||"missing txnId",oid:Tt!=null&&Tt["X-User-ID"]?"true":"false",access_token:Tt!=null&&Tt.auth?"true":"false",flow:Ot??""},...zt};handleSendEvent({eventName:Bt,eventData:Qt}),(Zt=(rr=window.curio)==null?void 0:rr.pushToMixpanel)==null||Zt.call(rr,Bt,Qt)};reactExports.useEffect(()=>{jt({name:"page_view",data:{page_view:"abha_mobile_otp_verify",platform:Rt}})},[]);const Ht=({otp:Bt})=>{ft(Bt),jt({name:"abha_mobile_otp_completion",data:{platform:Rt,type:"verify",otp_entered:!0}}),Vt(Bt)},Lt=async()=>{if(!rt){jt({name:"abha_mobile_otp_resend_clicked_no_txnId",data:{type:"resend",platform:Rt,txn_id:"missing_txnId",txn_id_exists:!1}});return}jt({name:"abha_mobile_otp_verify_clicks",data:{type:"resend",platform:Rt}}),console.log("selectedMethod",Ot);let Bt;it==="mobile"?(jt({name:"abha_mobile_otp_resend_initiated",data:{platform:Rt,type:"verify",flow_type:it}}),console.log("selectedFlow is mobile, so triggering mobile resend otp api",it),Bt=await postAbdmRegisterMobileResendOtp({txn_id:rt})):(jt({name:"aadhaar_mobile_otp_resend_initiated",data:{platform:Rt,type:"verify",flow_type:it}}),console.log("selectedFlow is aadhaar, so triggering aadhaar resend otp api",it),Bt=await postRegisterAadhaarMobileResendOtp({txn_id:rt}));const{txn_id:zt,error:Gt,action:Qt}=Bt;if(!zt){jt({name:"abha_mobile_otp_resend_failed",data:{platform:Rt,reason:Gt||"no_txn_id",reason_exists:!!Gt}}),St(Gt||"Something went wrong, please try again"),Qt&&ht(Qt);return}zt&&nt(zt),jt({name:"abha_mobile_otp_resend_success",data:{platform:Rt,txn_id:zt}})},Vt=async Bt=>{if(!rt){jt({name:"abha_mobile_verify_no_txnId",data:{type:"verify",platform:Rt,txn_id:"missing_txnId",txn_id_exists:!1}});return}jt({name:"abha_mobile_otp_submitted",data:{type:"verify",platform:Rt,txn_id:rt}}),_(LOADING_STATE.LOADING);try{let zt;it==="mobile"?(jt({name:"abha_mobile_otp_verification_started",data:{platform:Rt,flow_type:it}}),zt=await postAbdmRegisterMobileVerify({otp:Bt,txn_id:rt})):(jt({name:"aadhaar_otp_verification_started",data:{platform:Rt,flow_type:it}}),zt=await postRegisterAadhaarMobileVerify({otp:Bt,txn_id:rt}));const{txn_id:Gt,skip_state:Qt,eka:rr,profile:Zt,error:vr,action:ar,abha_profiles:Jt}=zt;if(!Gt||!Qt){jt({name:"abha_mobile_otp_verification_failed",data:{platform:Rt,reason:vr||"missing_txn_id_or_skip_state",txn_id_exists:!!Gt,skip_state_exists:!!Qt}}),_(LOADING_STATE.REJECTED),St(vr||"Something went wrong, please try again"),ar&&ht(ar);return}if(_(LOADING_STATE.RESOLVED),st(Qt),rr!=null&&rr.min_token&&ot(rr.min_token),rr!=null&&rr.oid&&lt(rr.oid),Zt&&Zt.abha_address&&Nt(Zt.abha_address),Zt&&Mt({date_of_birth:`${Zt.year_of_birth}-${String(Zt.month_of_birth).padStart(2,"0")}-${String(Zt.day_of_birth).padStart(2,"0")}`,firstname:Zt.first_name,lastname:Zt.last_name,pincode:Zt.pincode,gender:Zt.gender,oid:rr==null?void 0:rr.oid,abha_address:Zt==null?void 0:Zt.abha_address,abha_number:Zt==null?void 0:Zt.abha_number,middlename:Zt==null?void 0:Zt.middle_name,kyc_verified:Zt==null?void 0:Zt.kyc_verified}),console.log("remove oid from set indvidual env"),jt({name:"abha_mobile_otp_verification_success",data:{platform:Rt,skip_state:Qt}}),Zt!=null&&Zt.abha_number&&bt==="abha-kyc"){vt(!1),Ct({abha_number:Zt==null?void 0:Zt.abha_number}),setIndividualEnv({extraHeaders:{"X-Pt-Id":(rr==null?void 0:rr.oid)??""}}),At(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER),et(SCREEN_NAMES.KYC_LOGIN_SCREEN);return}if(Jt!=null&&Jt.length){_e(Jt),et(SCREEN_NAMES.SELECT_ABHA_FROM_LIST);return}et(SCREEN_NAMES.ABHA_MOBILE_LINKING_STATUS)}catch{jt({name:"abha_mobile_otp_verification_exception",data:{platform:Rt,reason:"exception_thrown"}}),_(LOADING_STATE.REJECTED),St("Something went wrong, please try again")}},Yt=async({mobileNumber:Bt})=>{if(Et(Bt),Bt.length===10&&["6","7","8","9"].includes(Bt.charAt(0))&&rt){const{txn_id:zt,hint:Gt,error:Qt,action:rr}=await postRegisterAadhaarMobileInit({mobile:Bt,txn_id:rt});if(Qt){jt({name:"aadhaar_faceauth_mobile_init_failed",data:{platform:Rt,reason:Qt||"error on mobile init in face auth",txn_id_exists:!!rt}}),ht({title:"Please try again.",img:"",description:"Something went wrong.",cta:{title:"",pid:"",params:null}}),rr&&ht(rr);return}if(zt&&Gt){jt({name:"abha_login_select_abha_mobile_init_success",data:{method:Ot,platform:Rt,txn_id:zt}}),Dt({authTxnId:$,txnId:zt,mobileOtpSentToHint:Gt}),It(!0),Pt(null);return}}else Bt.trim()!=""&&!["6","7","8","9"].includes(Bt.charAt(0))&&Pt("Enter a valid mobile number");Bt.trim()==""&&It(!1),jt({name:"abha_aadhaar_mobile_otp_enter",data:{page_view:"aadhaar_verification",platform:Rt}})},Wt=()=>{jt({name:"abha_aadhaar_mobile_verify_error_bottomsheet_dismissed",data:{platform:Rt}}),pt(),ht(null)},Ut=ut&&yt.length===10;return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-01",children:[jsxRuntimeExports.jsx(AbhaHeader,{prefixIcon:jsxRuntimeExports.jsx("button",{className:"pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple",onClick:bt?dt:pt,children:jsxRuntimeExports.jsx(n$4,{className:""})}),title:"Create ABHA",suffixIcon:jsxRuntimeExports.jsx(p$3,{className:"pds2-w-20 pds2-h-20"}),className:"pds2-border-b-1 pds2-border-bg-seperator-dark"}),bt?jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-bg-01"}):jsxRuntimeExports.jsx(AbhaStepper,{}),jsxRuntimeExports.jsxs("div",{className:"pds2-px-16 pds2-pb-16 pds2-space-y-12 pds2-overflow-y-auto pds2-flex-1 pds2-bg-bg-01",children:[jsxRuntimeExports.jsx(EnterMobileNumberCard,{mobileNumber:yt,disabled:!!(tt!=null&&tt.mobile),onMobileNumberChange:Yt,isOtpValid:ut,error:wt,onKeyDown:({key:Bt})=>{Bt==="Enter"&&Vt(ct)}}),$t&&jsxRuntimeExports.jsx(AbhaOtpCard,{otpSentToText:at||"Enter OTP sent on mobile number",onOtpCompletion:Ht,onResendOtpClick:Lt,setIsValid:gt,error:_t,setError:St,prefixIcon:null})]}),jsxRuntimeExports.jsx("div",{className:"pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-bg-white pds2-w-full pds2-border pds2-border-border-brand-02",children:jsxRuntimeExports.jsx(Pds2Button,{title:"Verify",state:!Ut||a===LOADING_STATE.LOADING?"disabled":"enabled",className:"pds2-w-full",onClick:()=>Vt(ct),isLoading:a===LOADING_STATE.LOADING})}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:Wt})]})},EnterMobileNumberCard=({mobileNumber:a,disabled:_,onMobileNumberChange:$,isOtpValid:_e,onKeyDown:et,error:tt})=>{const rt=GET_EXTRA_HEADERS(),nt=(rt==null?void 0:rt["X-User-ID"])??void 0,at=useAuthAbhaStore(ht=>ht.isDocAppRequest),st=reactExports.useRef(null);reactExports.useEffect(()=>{st.current&&_e&&st.current.focus()},[_e]);const it=useAuthAbhaStore(ht=>ht.abhaAuthFlowMethod),ot=useAuthAbhaStore(ht=>ht.initAbhaAppMobileNumber);ot&&(a=ot);const lt=it===ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER&&!!nt&&_;return jsxRuntimeExports.jsxs(CustomCardLayout,{children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-space-x-16 pds2-w-full",children:[jsxRuntimeExports.jsxs("div",{className:"Body1Regular pds2-text-text-01 pds2-flex-1",children:["Enter ",at?"the patient's":"your"," mobile number to link with ABHA"," ",jsxRuntimeExports.jsx("sup",{className:"pds2-text-text-error Body3Semibold",children:"*"})]}),jsxRuntimeExports.jsx(n$3,{className:"pds2-w-48 pds2-h-48 pds2-text-icon-success-02 pds2-p-6"})]}),jsxRuntimeExports.jsxs("label",{className:`pds2-relative pds2-border pds2-rounded-12 ${tt?"pds2-border-border-error focus-within:pds2-border-border-error ":"pds2-border-border-03 focus-within:pds2-border-border-brand-01 "}`,children:[jsxRuntimeExports.jsx("span",{className:"Body1Regular pds2-absolute pds2-left-16 pds2-top-1/2 pds2-transform pds2--translate-y-1/2 pds2-text-text-01",children:"+91 -"}),jsxRuntimeExports.jsx("input",{ref:st,placeholder:"Mobile Number",type:"text",autoComplete:"tel-national",value:a,disabled:lt,pattern:"[0-9]*",inputMode:"numeric",onChange:ht=>{if(ht.target.value.length>10)return;const pt=ht.target.value.replace(/[^0-9]/g,"");$({mobileNumber:pt.slice(-10)})},maxLength:10,className:"Body1Regular pds2-w-full pds2-pl-60 pds2-pr-12 pds2-py-12 pds2-rounded-12 pds2-outline-none",onKeyDown:et})]}),tt?jsxRuntimeExports.jsx("div",{className:"Body3Semibold pds2-text-text-error",children:tt}):jsxRuntimeExports.jsxs("div",{className:"Body3Regular pds2-text-text-03 pds2-flex pds2-items-center pds2-gap-8",children:[jsxRuntimeExports.jsx(e$1,{className:"pds2-w-20 pds2-h-20"}),"We will link this mobile number to your ABHA for all related communications"]}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-items-center pds2-space-x-8 pds2-text-text-03"})]})},CustomCardLayout=({children:a,className:_="pds2-space-y-12"})=>jsxRuntimeExports.jsx("div",{className:`pds2-flex pds2-flex-col pds2-w-full pds2-p-16 pds2-rounded-16 pds2-bg-bg-white ${_}`,children:a}),AbhaAadhaarVerificationFaceAuthStatusScreen=()=>{const a=useAuthAbhaStore(mt=>mt.aadhaarVerificationSkipStateStatus),_=useAuthAbhaStore(mt=>mt.authTxnId),$=useAuthAbhaStore(mt=>mt.ekaSmallToken),_e=useAuthAbhaStore(mt=>mt.setScreen),et=useAuthAbhaStore(mt=>mt.abhaAddressList),[tt,rt]=reactExports.useState(!0),nt=useAuthAbhaStore(mt=>mt.clientId),at=useAuthAbhaStore(mt=>mt.isEkaAppLogin),st=useAuthAbhaStore(mt=>mt.oid),it=useAuthAbhaStore(mt=>mt.ekaProfileInfo),ot=["M","F","O","U"],lt=useAuthAbhaStore(mt=>mt.txnId),ht=useAuthAbhaStore(mt=>mt.isNewLoginOrCreateFlow),pt=GET_EXTRA_HEADERS(),dt=({name:mt,data:ct={}})=>{var gt,yt;const ut={...{login_platform:nt,is_eka_app_login:at?"true":"false",is_new_login_or_create_flow:ht?"true":"false",txn_id:lt||"missing txnId",oid:pt!=null&&pt["X-User-ID"]?"true":"false",access_token:pt!=null&&pt.auth?"true":"false"},...ct};handleSendEvent({eventName:mt,eventData:ut}),(yt=(gt=window.curio)==null?void 0:gt.pushToMixpanel)==null||yt.call(gt,mt,ut)};return reactExports.useEffect(()=>{var ft,ut;const mt=new Promise(gt=>{setTimeout(()=>{gt(rt(!1))},500)});handleSendEvent({eventName:"page_view",eventData:{page_view:"aadhaar_faceauth_verified_successful",platform:nt}}),(ut=(ft=window.curio)==null?void 0:ft.pushToMixpanel)==null||ut.call(ft,"page_view",{platform:nt,page_view:"aadhaar_faceauth_verified_successful"});async function ct(){await mt,setTimeout(async()=>{var gt,yt,Et,_t,St,wt;if(a===ABHA_V3_SKIP_STATES.REQUEST_MOBILE_OTP){_e(SCREEN_NAMES.ABHA_MOBILE_AND_OTP_SCREEN);return}else{if(at){const Nt=ot.includes(it==null?void 0:it.gender)?it==null?void 0:it.gender:void 0,Mt={oid:(it==null?void 0:it.oid)||"",fln:(it==null?void 0:it.name)||"",dob:it==null?void 0:it.date_of_birth,gen:Nt,mobile:it==null?void 0:it.mobile,at:"",fn:(it==null?void 0:it.firstname)||"",mn:(it==null?void 0:it.middlename)||"",ln:(it==null?void 0:it.lastname)||"",abha_number:(it==null?void 0:it.abha_number)||"","health-ids":it!=null&&it.abha_address?[it==null?void 0:it.abha_address]:void 0};console.log("inside abha aadhaar verification status auth profile response ",Mt);const Dt=getMockAuthVerifyResponse(Mt);if(console.log("authResponse ",Dt),a===ABHA_V3_SKIP_STATES.ABHA_END&&st){if(handleSendEvent({eventName:"abha_aadhaar_verification_status_eka_flow",eventData:{type:"verify",platform:nt,transactionId:_||"",skipState:"abha_end",minToken:$||"",oid:st||"",abhaAddress:(it==null?void 0:it.abha_address)||"",isEkaAppLogin:at?"true":"false"}}),(yt=(gt=window.curio)==null?void 0:gt.pushToMixpanel)==null||yt.call(gt,"abha_aadhaar_verification_status_eka_flow",{platform:nt,type:"verify",transactionId:_||"",skipState:"abha_end",minToken:$||"",oid:st||"",abhaAddress:(it==null?void 0:it.abha_address)||"",isEkaAppLogin:at?"true":"false"}),window.EkaAbha&&window.EkaAbha.onAbhaSuccess){(Et=window.EkaAbha)==null||Et.onAbhaSuccess(JSON.stringify({response:Dt}));return}onAbhaSuccess({response:Dt}),unMount();return}if(a===ABHA_V3_SKIP_STATES.ABHA_CREATE&&et){_e(SCREEN_NAMES.SELECT_ABHA_FROM_LIST);return}console.log("redirecting to create eka profile for abha address creation -> mobile"),_e(SCREEN_NAMES.CREATE_EKA_PROFILE);return}if(!_||!$)return;const Pt=await postAuthVerifyV2({txn_id:_,token:$});if(Pt.data){if(a===ABHA_V3_SKIP_STATES.ABHA_END){if(st){if(window.EkaAbha&&window.EkaAbha.onAbhaSuccess){(_t=window.EkaAbha)==null||_t.onAbhaSuccess(JSON.stringify({response:Pt}));return}onAbhaSuccess({response:Pt}),unMount();return}setIndividualEnv({extraHeaders:{auth:(St=Pt.data)==null?void 0:St.tokens.sess}}),_e(SCREEN_NAMES.GET_ALL_PROFILES);return}setIndividualEnv({extraHeaders:{auth:(wt=Pt.data)==null?void 0:wt.tokens.sess}}),dt({name:"abha_login_otp_verify_abha_select",data:{type:"verify",platform:nt}}),_e(SCREEN_NAMES.SELECT_ABHA_FROM_LIST);return}}},2e3)}ct()},[]),jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:tt,loadingText:"Verifying...",successText:"Aadhaar Verification Successful!"})},AbhaSessionStatusLoaderScreen=()=>{const a=useAuthAbhaStore(ot=>ot.txnId),_=useAuthAbhaStore(ot=>ot.setScreen),$=useAuthAbhaStore(ot=>ot.goBackLoginScreen),_e=useAuthAbhaStore(ot=>ot.setBottomsheetErrorInfo),et=useAuthAbhaStore(ot=>ot.isEkaAppLogin),tt=useAuthAbhaStore(ot=>ot.clientId),rt=useAuthAbhaStore(ot=>ot.isNewLoginOrCreateFlow),nt=useAuthAbhaStore(ot=>ot.initAbhaFlow),at=GET_EXTRA_HEADERS();useAuthAbhaStore(ot=>ot.screen);const st=({name:ot,data:lt={}})=>{var dt,mt;const pt={...{login_platform:tt,is_eka_app_login:et?"true":"false",is_new_login_or_create_flow:rt?"true":"false",txn_id:a||"missing txnId",oid:at!=null&&at["X-User-ID"]?"true":"false",access_token:at!=null&&at.auth?"true":"false"},...lt};handleSendEvent({eventName:ot,eventData:pt}),(mt=(dt=window.curio)==null?void 0:dt.pushToMixpanel)==null||mt.call(dt,ot,pt)};reactExports.useEffect(()=>{st({name:"abha_doc_session_status_page",data:{page_view:"abha_session_status_page",platform:tt}}),st({name:"fetch_session_status_api",data:{type:"get_init",platform:tt}}),(async()=>{try{let lt=await getAbdmSessionStatus();lt.logged_in?nt==="abha-kyc"?lt.kyc_verified?_(SCREEN_NAMES.KYC_ALREADY_VERIFIED):_(SCREEN_NAMES.KYC_LOGIN_SCREEN):nt==="consent"&&_(SCREEN_NAMES.CONSENT_LOADER_SCREEN):_(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA)}catch(lt){const{code:ht,error:pt,source_error:dt}=lt;st({name:"abha_abdm_session_status_get_failed",data:{error_code:ht,error_msg:pt,source_error:dt}}),_(SCREEN_NAMES.LOGIN_OR_CREATE_ABHA)}})()},[]);const it=()=>{st({name:"abha_session_status_request_error_bottomsheet_dismissed",data:{platform:tt}}),_e(null),$(),setIndividualEnv({extraHeaders:{auth:""}})};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsx(AbhaLoadingStatus,{}),jsxRuntimeExports.jsx(AbhaErrorBottomSheet,{onSubmitClick:it})]})},AbhaKycAlreadyVerifiedScreen=()=>(reactExports.useEffect(()=>{onKYCSuccess("KYC already verified, onKYCSuccess called, next page redirect"),setTimeout(()=>{window.location.href="https://www.eka.care/s/for-patients"},3e3)},[]),jsxRuntimeExports.jsx(AbhaVerificationStatus,{loading:!1,loadingText:"KYC in progress...",successText:"KYC already Verified!"})),TickSwiggly="data:image/svg+xml,%3csvg%20width='37'%20height='37'%20viewBox='0%200%2037%2037'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M18.5%200.5C21.0312%200.5%2023.2812%201.97656%2024.4062%204.15625C26.7266%203.38281%2029.3984%203.94531%2031.2266%205.77344C33.0547%207.60156%2033.6172%2010.2734%2032.8438%2012.5938C35.0234%2013.7188%2036.5%2015.9688%2036.5%2018.5C36.5%2021.1016%2035.0234%2023.3516%2032.8438%2024.4766C33.6172%2026.7969%2033.0547%2029.3984%2031.2266%2031.2266C29.3984%2033.0547%2026.7266%2033.6172%2024.4062%2032.9141C23.2812%2035.0938%2021.0312%2036.5%2018.5%2036.5C15.8984%2036.5%2013.6484%2035.0938%2012.5234%2032.9141C10.2031%2033.6172%207.60156%2033.0547%205.77344%2031.2266C3.94531%2029.3984%203.38281%2026.7969%204.08594%2024.4766C1.90625%2023.3516%200.5%2021.1016%200.5%2018.5C0.5%2015.9688%201.90625%2013.7188%204.08594%2012.5938C3.38281%2010.2734%203.94531%207.60156%205.77344%205.77344C7.60156%203.94531%2010.2031%203.38281%2012.5234%204.15625C13.6484%201.97656%2015.8984%200.5%2018.5%200.5ZM25.3203%2016.3203C25.9531%2015.6875%2025.9531%2014.6328%2025.3203%2014C24.6172%2013.2969%2023.5625%2013.2969%2022.9297%2014L16.25%2020.6797L13.5078%2017.9375C12.8047%2017.2344%2011.75%2017.2344%2011.1172%2017.9375C10.4141%2018.5703%2010.4141%2019.625%2011.1172%2020.2578L15.0547%2024.1953C15.6875%2024.8984%2016.7422%2024.8984%2017.4453%2024.1953L25.3203%2016.3203Z'%20fill='%2346AB86'%20/%3e%3c/svg%3e",AbhaCardScreen=()=>{const[a,_]=reactExports.useState(!1),$=useAuthAbhaStore(ft=>ft.txnId),_e=useAuthAbhaStore(ft=>ft.ekaProfileInfo),et=useAuthAbhaStore(ft=>ft.initAbhaFlow),tt=useAuthAbhaStore(ft=>ft.isEkaAppLogin),rt=useAuthAbhaStore(ft=>ft.clientId),nt=useAuthAbhaStore(ft=>ft.clearAbhaAuthStore),at=useAuthAbhaStore(ft=>ft.goBackLoginScreen),[st,it]=reactExports.useState(LOADING_STATE.IDLE),[ot,lt]=reactExports.useState(LOADING_STATE.IDLE),ht=useAuthAbhaStore(ft=>ft.isNewLoginOrCreateFlow),pt=GET_EXTRA_HEADERS(),dt=({name:ft,data:ut={}})=>{var Et,_t;const yt={...{login_platform:rt,is_eka_app_login:tt?"true":"false",is_new_login_or_create_flow:ht?"true":"false",txn_id:$||"missing txnId",oid:pt!=null&&pt["X-User-ID"]?"true":"false",access_token:pt!=null&&pt.auth?"true":"false"},...ut};handleSendEvent({eventName:ft,eventData:yt}),(_t=(Et=window.curio)==null?void 0:Et.pushToMixpanel)==null||_t.call(Et,ft,yt)},mt=async()=>{dt({name:"abha_card_download_clicked",data:{platform:rt}});try{it(LOADING_STATE.LOADING);const ft=await getAbdmAssestCard();if(!(ft instanceof Blob)){console.error("Received non-blob response:",ft),dt({name:"abha_card_download_failed",data:{platform:rt,error:"Invalid Blob"}});return}const ut=window.URL.createObjectURL(ft),gt=document.createElement("a");gt.href=ut,gt.download=`${_e==null?void 0:_e.firstname}_${_e==null?void 0:_e.lastname}_AbhaCard.png`,document.body.appendChild(gt),gt.click(),document.body.removeChild(gt),window.URL.revokeObjectURL(ut),it(LOADING_STATE.RESOLVED),dt({name:"abha_card_download_success",data:{platform:rt}})}catch(ft){it(LOADING_STATE.REJECTED),console.error("Download Error:",ft),dt({name:"abha_card_download_failed",data:{platform:rt,error:JSON.stringify(ft)}})}},ct=()=>{if(lt(LOADING_STATE.LOADING),dt({name:"abha_card_continue_clicked",data:{platform:rt}}),rt.includes("doc"))unMount(),lt(LOADING_STATE.RESOLVED);else{at();const ft=rt,ut=useAuthAbhaStore.getState().isEkaAppLogin;nt(),useAuthAbhaStore.setState({clientId:ft,isEkaAppLogin:ut}),lt(LOADING_STATE.RESOLVED)}};return jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-w-full pds2-h-full pds2-bg-bg-white",children:[jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(AbhaHeader,{title:"Download ABHA card",className:"pds2-border-b-1 pds2-border-bg-seperator-dark",prefixIcon:jsxRuntimeExports.jsx("button",{className:"pds2-w-24 pds2-h-24 pds2-rounded-full pds2-flex pds2-items-center pds2-justify-center ripple",onClick:()=>_(!0),children:jsxRuntimeExports.jsx(n$4,{className:""})})}),et?jsxRuntimeExports.jsx("div",{className:"pds2-pt-40 pds2-bg-bg-01"}):jsxRuntimeExports.jsx(AbhaStepper,{}),jsxRuntimeExports.jsx("div",{className:"pds2-px-16 pds2-space-y-16 pds2-overflow-y-hidden pds2-bg-bg-01",children:jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-items-center ",children:jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-items-center md:pds2-px-40",children:[jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-flex-col pds2-items-center pds2-space-y-6",children:jsxRuntimeExports.jsx("div",{className:"pds2-px-24 pds2-flex pds2-flex-col pds2-space-y-8 md:pds2-p-16 pds2-justify-center pds2-items-center pds2-text-center",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("img",{src:TickSwiggly,className:"pds2-w-54 pds2-h-54 md:pds2-h-60 md:pds2-w-60 "}),jsxRuntimeExports.jsx("p",{className:"Heading4Semibold pds2-mt-8",children:"ABHA Registration Successful!"})]})})}),jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-flex-col pds2-items-center pds2-relative pds2-mt-16 pds2-w-full",children:[jsxRuntimeExports.jsx("div",{className:"pds2-relative pds2-h-159 pds2-w-166 pds2-ml-22",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/clxu62r5f00020tklemws6vkm.png",alt:"abha_card_bg_img",style:{objectFit:"contain",objectPosition:"center",width:"100%",height:"100%"}})}),jsxRuntimeExports.jsxs("div",{className:"pds2-rounded-4 pds2-overflow-hidden pds2-h-117 pds2-w-180 pds2-relative -pds2-top-50 pds2-bg-doctor-darwin-neutral-0",style:{boxShadow:"0px 2.43737px 9.74947px rgba(41, 41, 140, 0.16)"},children:[jsxRuntimeExports.jsxs("div",{className:"pds2-flex pds2-items-center pds2-justify-between pds2-py-5 pds2-px-10 pds2-w-full",style:{background:"#232477"},children:[jsxRuntimeExports.jsx("div",{className:"pds2-relative pds2-h-23 pds2-w-26",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/clcoqygo000310sa3767u6mik.webp",style:{objectFit:"contain",objectPosition:"center",width:"100%",height:"100%"}})}),jsxRuntimeExports.jsx("div",{className:"pds2-relative pds2-h-23 pds2-w-50 pds2-bg-bg-invert",children:jsxRuntimeExports.jsx("img",{src:"https://cdn.eka.care/vagus/clcoqzar7002l0sdsfgx40nkp.webp",alt:"abha_card_bg_img",style:{objectFit:"contain",objectPosition:"center",width:"100%",height:"100%"}})})]}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-items-center pds2-justify-between pds2-pt-9 pds2-pb-30 pds2-px-10 pds2-bg-bg-white",children:jsxRuntimeExports.jsxs("div",{className:"pds2-space-y-3",children:[jsxRuntimeExports.jsx("div",{className:"pds2-font-700 pds2-text-12 pds2-leading-12",children:(_e==null?void 0:_e.firstname)+" "+(_e==null?void 0:_e.lastname)}),jsxRuntimeExports.jsxs("div",{className:"pds2-font-400 pds2-text-9 pds2-leading-10 pds2-text-text-03 pds2-pb-8",children:[(_e==null?void 0:_e.gender)==="M"?"Male":(_e==null?void 0:_e.gender)==="F"?"Female":"Others",", ",calculateAge((_e==null?void 0:_e.date_of_birth)??"")," years"]}),jsxRuntimeExports.jsx("div",{className:"pds2-space-y-2",children:(_e==null?void 0:_e.abha_number)&&jsxRuntimeExports.jsxs("div",{className:"pds2-font-500 pds2-text-9 pds2-leading-10",children:[jsxRuntimeExports.jsx("span",{className:"!pds2-font-400 pds2-text-text-03",children:"ABHA Number: "}),_e==null?void 0:_e.abha_number]})}),jsxRuntimeExports.jsx("div",{className:"pds2-space-y-2",children:(_e==null?void 0:_e.abha_address)&&jsxRuntimeExports.jsxs("div",{className:"pds2-font-500 pds2-text-9 pds2-leading-10",children:[jsxRuntimeExports.jsx("span",{className:"!pds2-font-400 pds2-text-text-03",children:"ABHA Address: "}),_e==null?void 0:_e.abha_address]})})]})})]})]})]})})}),jsxRuntimeExports.jsxs("div",{className:"pds2-relative pds2-flex pds2-py-16 ",children:[jsxRuntimeExports.jsxs("div",{className:"pds2-z-10 pds2-absolute pds2-bg-bg-accent-green pds2-top-0 pds2-mb-2 pds2-font-500 pds2-text-12 pds2-leading-18 pds2-w-full pds2-text-center ",children:[jsxRuntimeExports.jsx("span",{className:"pds2-font-700",children:"50 Cr"}),jsxRuntimeExports.jsx("span",{children:" + people have already created ABHA!"})]}),jsxRuntimeExports.jsx("div",{className:"pds2-flex pds2-gap-10 pds2-p-16 pds2-sticky pds2-bottom-0 pds2-bg-bg-white pds2-w-full pds2-border pds2-border-border-brand-02",children:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Pds2Button,{state:ot===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:ot===LOADING_STATE.LOADING,title:"Continue",buttonColor:"pds2-bg-bg-white",className:"pds2-w-5/6 !pds2-text-text-brand pds2-border pds2-border-border-03",onClick:ct}),jsxRuntimeExports.jsx(Pds2Button,{state:st===LOADING_STATE.LOADING?"disabled":"enabled",isLoading:st===LOADING_STATE.LOADING,title:"",IconComponent:()=>jsxRuntimeExports.jsx(t$7,{}),buttonColor:"pds2-bg-bg-brand-01",className:"pds2-w-1/6 !pds2-p-0",onClick:mt})]})})]})]}),jsxRuntimeExports.jsx(ExitPopup,{open:a,setOpen:_})]})},ScreenStack=()=>{const a=useAuthAbhaStore($=>$.screen);switch(a[a.length-1]){case SCREEN_NAMES.LOGIN_WITH_ABHA:return jsxRuntimeExports.jsx(LoginorCreateAbhaScreen,{});case SCREEN_NAMES.VERIFY_OTP_LOGIN_WITH_ABHA:return jsxRuntimeExports.jsx(AbhaLoginOtpVerifyScreen,{});case SCREEN_NAMES.VERIFY_KYC_OTP_LOGIN_WITH_ABHA:return jsxRuntimeExports.jsx(AbhaKycOtpVerifyScreen,{});case SCREEN_NAMES.CREATE_ABHA_WITH_AADHAAR:return jsxRuntimeExports.jsx(LoginorCreateAbhaScreen,{});case SCREEN_NAMES.ABHA_OTP_AND_MOBILE:return jsxRuntimeExports.jsx(AbhaOtpAndMobileScreen,{});case SCREEN_NAMES.ABHA_PHONE_NUMBER_VERIFICATION:return jsxRuntimeExports.jsx(AbhaPhoneNumberVerificationScreen,{});case SCREEN_NAMES.AADHAAR_VERIFICATION_STATUS:return jsxRuntimeExports.jsx(AbhaAadhaarVerificationStatusScreen,{});case SCREEN_NAMES.ABHA_MOBILE_LINKING_STATUS:return jsxRuntimeExports.jsx(AbhaMobileLinkingStatusScreen,{});case SCREEN_NAMES.SELECT_ABHA_FROM_LIST:return jsxRuntimeExports.jsx(SelectAbhaFromListScreen,{});case SCREEN_NAMES.SELECT_EKA_PROFILE:return jsxRuntimeExports.jsx(SelectEkaProfileScreen,{});case SCREEN_NAMES.CREATE_ABHA_ADDRESS:return jsxRuntimeExports.jsx(CreateAbhaAddressScreen,{});case SCREEN_NAMES.CREATE_EKA_PROFILE:return jsxRuntimeExports.jsx(CreateEkaProfileScreen,{});case SCREEN_NAMES.CREATE_PHR_EKA_PROFILE:return jsxRuntimeExports.jsx(CreateEkaProfileScreen,{});case SCREEN_NAMES.GET_ALL_PROFILES:return jsxRuntimeExports.jsx(GetAllProfilesScreen,{});case SCREEN_NAMES.LOGIN_OR_CREATE_ABHA:return jsxRuntimeExports.jsx(LoginorCreateAbhaScreen,{});case SCREEN_NAMES.CONSENT_SCREEN:return jsxRuntimeExports.jsx(ConsentDetailsScreen,{});case SCREEN_NAMES.CONSENT_DENY:return jsxRuntimeExports.jsx(AbhaConsentDenyScreen,{});case SCREEN_NAMES.CONSENT_REVOKE:return jsxRuntimeExports.jsx(AbhaConsentRevokeScreen,{});case SCREEN_NAMES.CONSENT_APPROVE:return jsxRuntimeExports.jsx(AbhaConsentApproveScreen,{});case SCREEN_NAMES.SELF_ASSESSMENT:return jsxRuntimeExports.jsx(SelfAssessmentScreen,{});case SCREEN_NAMES.CONSENT_LOADER_SCREEN:return jsxRuntimeExports.jsx(ConsentLoaderScreen,{});case SCREEN_NAMES.KYC_LOGIN_SCREEN:return jsxRuntimeExports.jsx(KYCLoginScreen,{});case SCREEN_NAMES.KYC_ALREADY_VERIFIED:return jsxRuntimeExports.jsx(AbhaKycAlreadyVerifiedScreen,{});case SCREEN_NAMES.ABHA_AUTH_QR_SCREEN:return jsxRuntimeExports.jsx(AbhaAuthQRScreen,{});case SCREEN_NAMES.AADHAAR_FACEAUTH_VERIFICATION_STATUS:return jsxRuntimeExports.jsx(AbhaAadhaarVerificationFaceAuthStatusScreen,{});case SCREEN_NAMES.ABHA_MOBILE_AND_OTP_SCREEN:return jsxRuntimeExports.jsx(AbhaMobileandOtpScreen,{});case SCREEN_NAMES.ABHA_HEALTHID_CARD_SCREEN:return jsxRuntimeExports.jsx(AbhaCardScreen,{});case SCREEN_NAMES.SESSION_STATUS_LOADER_SCREEN:return jsxRuntimeExports.jsx(AbhaSessionStatusLoaderScreen,{});default:return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{})}},queryClient=new QueryClient;function App(){const a=useAuthAbhaStore.getState().initAbhaFlow;return reactExports.useEffect(()=>()=>{unMount()},[]),jsxRuntimeExports.jsx(QueryClientProvider,{client:queryClient,children:jsxRuntimeExports.jsx("div",{className:"pds2-h-full pds2-w-full pds2-bg-bg-white",style:{borderRadius:GET_CLIENT_ID()==="www-eka"&&!a?"1.5rem":void 0,position:"relative",height:GET_CLIENT_ID()==="www-eka"?a==="consent"||a==="abha-kyc"?"100vh":"75vh":GET_CLIENT_ID()==="doc-web"?"100%":"100vh",overflowY:"auto",paddingTop:GET_CLIENT_ID()==="androiddoc"||GET_CLIENT_ID()==="doctor-app-ios"||GET_CLIENT_ID()==="doctor-ipad-ios"?"1rem":"0rem"},children:jsxRuntimeExports.jsx(ScreenStack,{})})})}const d=[[0,1,2,3,4,5,6,7,8,9],[1,2,3,4,0,6,7,8,9,5],[2,3,4,0,1,7,8,9,5,6],[3,4,0,1,2,8,9,5,6,7],[4,0,1,2,3,9,5,6,7,8],[5,9,8,7,6,0,4,3,2,1],[6,5,9,8,7,1,0,4,3,2],[7,6,5,9,8,2,1,0,4,3],[8,7,6,5,9,3,2,1,0,4],[9,8,7,6,5,4,3,2,1,0]],p=[[0,1,2,3,4,5,6,7,8,9],[1,5,7,6,2,8,3,0,9,4],[5,8,0,3,7,9,6,1,4,2],[8,9,1,6,0,4,3,5,2,7],[9,4,5,3,1,2,6,8,7,0],[4,2,8,6,5,7,3,9,0,1],[2,7,9,3,8,0,6,4,1,5],[7,0,4,6,9,1,3,2,5,8]];function verhoeffValidate(a){let _=0;const $=a.split("").reverse().map(_e=>parseInt(_e,10));for(let _e=0;_e<$.length;_e++)_=d[_][p[_e%8][$[_e]]];return _===0}function isValidAadhaar(a){return/^\d{12}$/.test(a)?verhoeffValidate(a):!1}const abhaRegex=/^[0-9]{14}$/;function luhnCheck(a){let _=0,$=!1;for(let _e=a.length-1;_e>=0;_e--){let et=parseInt(a[_e],10);$&&(et*=2,et>9&&(et-=9)),_+=et,$=!$}return _%10===0}function isValidABHA(a){return!abhaRegex.test(a)||a.split("").every($=>$===a[0])?!1:luhnCheck(a)}const isValidMobile=a=>/^[6-9]\d{9}$/.test(a),setIdentifier=(a,_)=>{useAuthAbhaStore.getState().setInitAbhaAppIdentifierType(a),useAuthAbhaStore.getState().setInitAbhaAppIdentifier(_)},handleIdentifier=(a,_,$)=>{if(a){const _e=a.replace(/[\s-]/g,"");if(_){if(_===ABHA_AUTH_FLOW_METHOD.MOBILE){setIdentifier(ABHA_AUTH_FLOW_METHOD.MOBILE,a.slice(-10));return}setIdentifier(_,a);return}if(_e.endsWith("@sbx")){setIdentifier(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS,_e);return}if(/^\+91\d{10}$/.test(_e)){const tt=_e.slice(-10);if(tt.length===10&&isValidMobile(tt)){setIdentifier(ABHA_AUTH_FLOW_METHOD.MOBILE,tt);return}}else if(/^\d+$/.test(_e)){const tt=_e.length;if(tt===10&&isValidMobile(_e)){setIdentifier(ABHA_AUTH_FLOW_METHOD.MOBILE,_e);return}if(tt===12&&isValidAadhaar(_e)){setIdentifier(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER,_e);return}if(tt===14&&isValidABHA(_e)){const rt=`${_e.slice(0,2)}-${_e.slice(2,6)}-${_e.slice(6,10)}-${_e.slice(10,14)}`;setIdentifier(ABHA_AUTH_FLOW_METHOD.ABHA_NUMBER,rt);return}console.warn("Unknown numeric identifier type");return}console.warn("Unknown identifier type")}else console.warn("No identifier provided")};let PopupReactNode=null,unMount,onAbhaSuccess,onKYCSuccess,onConsentSuccess;function initAbhaApp(a){console.log("clear the abha auth store for every sdk invocation",a),useAuthAbhaStore.getState().clearAbhaAuthStore();const{clientId:_,containerId:$,urlParams:_e,method:et,data:tt,appVersion:rt,onSuccess:nt,onError:at,onAbhaClose:st}=a,{mobile:it,accessToken:ot,oid:lt,identifier:ht,identifier_type:pt,flow:dt,consent_id:mt,orgIcon:ct,linkToOrgIcon:ft,successRedirect:ut}=tt||{};console.log("recieved identifier, identifier_type",ht,pt),useAuthAbhaStore.getState().setOrgIcon(ct),useAuthAbhaStore.getState().setLinkToOrgIcon(ft),handleSendEvent({eventName:"recieved_init_identifiers",eventData:{identifier:ht||"",identifier_type:pt||""}});const gt={};if(dt&&useAuthAbhaStore.getState().setInitAbhaFlow(dt),ut&&useAuthAbhaStore.getState().setSuccessRedirect(ut),mt&&useAuthAbhaStore.getState().setAbhaRequestConsentId(mt),ot&&(gt.auth=ot),lt&&(dt==="abha-kyc"||dt==="consent")?setIndividualEnv({extraHeaders:{"X-Pt-Id":lt??""}}):lt&&dt!="abha-kyc"&&(gt["X-User-ID"]=lt),(dt==="abha-kyc"||dt==="consent")&&lt&&!(_==="androidp"||_==="patient-app-ios")){const Mt=SCREEN_NAMES.SESSION_STATUS_LOADER_SCREEN;useAuthAbhaStore.getState().setInitState({screen:[Mt],urlParams:_e})}else if(dt==="abha-kyc"&&(_==="androidp"||_==="patient-app-ios")){const Mt=SCREEN_NAMES.KYC_LOGIN_SCREEN;useAuthAbhaStore.getState().setInitState({screen:[Mt],urlParams:_e})}else if(dt==="abha-kyc"&&_==="doc-web"||_==="ext"){const Mt=SCREEN_NAMES.SESSION_STATUS_LOADER_SCREEN;useAuthAbhaStore.getState().setInitState({screen:[Mt],urlParams:_e})}else{const Mt=SCREEN_NAMES.LOGIN_OR_CREATE_ABHA;useAuthAbhaStore.getState().setInitState({screen:[Mt],urlParams:_e})}console.log("set headers in headers"),console.log("invoked initAbhaApp",gt);const yt=gt!==null&&("auth"in gt||"X-User-ID"in gt);useAuthAbhaStore.getState().setIsEkaAppLogin(yt),dt==="consent"&&useAuthAbhaStore.getState().setAbhaAuthFlowMethod(ABHA_AUTH_FLOW_METHOD.PHR_ADDRESS),(_==="doc-web"||_==="ext")&&useAuthAbhaStore.getState().setIsEkaAppLogin(!0),console.log("clientId ",_),console.log("isEkaAppLogin",useAuthAbhaStore.getState().isEkaAppLogin),_==="androiddoc"||_==="doctor-app-ios"||_==="doctor-ipad-ios"||_==="doc-web"||_==="ext"?useAuthAbhaStore.getState().setClientId("doctor"):_==="androidp"||_==="patient-app-ios"?(useAuthAbhaStore.getState().setSelectedAadhaarAuth(AADHAAR_AUTH_STATES.OTP),useAuthAbhaStore.getState().setClientId("phr")):_==="www-eka"?(useAuthAbhaStore.getState().setSelectedAadhaarAuth(AADHAAR_AUTH_STATES.OTP),useAuthAbhaStore.getState().setClientId("eka-web")):(console.log("here"),useAuthAbhaStore.getState().setClientId("phr"));let Et=!1;handleSendEvent({eventName:"init_abha_app",eventData:{platform:_,method:et||"",mobile:it||"",accessToken:ot||"",oid:lt||"",appVersion:rt||"",isEkaAppLogin:yt.toString(),container_id:$}}),onTrack("init_abha_app",{platform:_,method:et||"",mobile:it||"",accessToken:gt.auth||"",oid:gt["X-User-ID"]||"",appVersion:rt||"",isEkaAppLogin:yt.toString(),container_id:$}),(_==="androiddoc"||_==="doctor-app-ios"||_==="doctor-ipad-ios"||_==="doc-web")&&(Et=!0,useAuthAbhaStore.getState().setIsDocAppRequest(Et)),(_==="doc-web"||_==="ext")&&useAuthAbhaStore.getState().setFaceAuthEnable(!0),useAuthAbhaStore.getState().setInitAbhaAppMethod(et==="create_abha_with_mobile"?"create_abha_with_mobile":"login_with_abha"),setEnv({clientId:_,env:"DEV",...gt&&{extraHeaders:gt}}),console.log("isProd is",!1);const wt=pt&&["mobile","aadhaar_number","abha_number","phr_address"].includes(pt)?pt:void 0;handleIdentifier(ht,wt),useAuthAbhaStore.getState().setAbhaAuthFlowMethod(ABHA_AUTH_FLOW_METHOD.AADHAR_NUMBER);const Pt=()=>{useAuthAbhaStore.getState().clearAbhaAuthStore(),queryClient.removeQueries(),PopupReactNode==null||PopupReactNode.unmount(),st()},Nt=document.getElementById($);if(!Nt){const Mt=`Element with id ${$} not found`;console.error(Mt),at({error:Mt}),Pt();return}return onKYCSuccess=a.onKYCSuccess??(()=>{}),onConsentSuccess=a.onConsentSuccess??(()=>{}),onAbhaSuccess=nt??(()=>{}),PopupReactNode=createRoot(Nt),PopupReactNode.render(jsxRuntimeExports.jsx(App,{})),unMount=Pt,window.closeAbhaApp=Pt,Pt}function onOtpAutoRead(a){console.log("my_hii params",a.success,a.otp)}window.onOtpAutoRead=onOtpAutoRead;window.initAbhaApp=initAbhaApp;function onTrack(a,_={}){var et;const $=useAuthAbhaStore.getState().clientId||"unknown-platform",_e={..._,platform:$};console.log("Tracking Event:",a,_e),(et=window.curio)!=null&&et.pushToMixpanel?(console.log("Pushing to Mixpanel:",a,_e),window.curio.pushToMixpanel(a,_e)):(console.log("Curio not available. Queuing event:",a,_e),console.error("Curio not available. Could not push event to Mixpanel."))}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/abha-stg",
3
- "version": "0.1.74",
3
+ "version": "0.1.76",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "VITE_APP_MODE=DEBUG vite",