@eka-care/abha-stg 0.0.40 → 0.0.41
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.
- package/dist/sdk/abha/js/abha.js +1 -1
- package/package.json +1 -1
package/dist/sdk/abha/js/abha.js
CHANGED
|
@@ -14,7 +14,7 @@ var Oo=a=>{throw TypeError(a)};var Bs=(a,_,$)=>_.has(a)||Oo("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$8=Symbol.for("react.fragment"),m$3=Object.prototype.hasOwnProperty,n$3=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$3.current}}reactJsxRuntime_production_min.Fragment=l$8;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))(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))(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))(QUEUE_CARD_ACTIONS||{});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.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://ndhm.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="",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,...$})},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 it,at;!nt.get("client-id")&&!_e&&nt.set("client-id",GET_CLIENT_ID()),rt&&!nt.get("auth")&&nt.set("auth",rt);const st=GET_EXTRA_HEADERS();st&&Object.keys(st).forEach(ot=>{nt.set(ot,st[ot])});const ct=await fetch(a,{..._,headers:nt});return window&&(at=window.location.pathname,it=nt.get("client-id")),ct.status===401&&$&&await refreshToken()?await fetchWrapper(a,_,!1):(ct.status>401&&sendApiFailedEvent({url:a,params:{responseStatus:ct.status}}),ct)}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,it,at;androidRefreshCB.push(rt),(at=(it=(nt=window==null?void 0:window.webkit)==null?void 0:nt.messageHandlers)==null?void 0:it.statusCodeHandler)==null||at.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 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 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 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 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 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 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:it,pincode:at,txn_id:st}){const ct=new Headers;ct.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:it,month_of_birth:tt,pincode:at,year_of_birth:rt},txn_id:st}),pt={method:"POST",headers:ct,body:ot,redirect:"follow",credentials:"include"};try{const ht=GET_NDHM_HOST();return await(await fetchWrapper(`${ht}/abdm/na/v1/registration/mobile/create-phr`,pt)).json()}catch(ht){console.error("postAbdmRegisterMobileCreatePhr error =>",ht)}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:it,pincode:at}){const st=new Headers;st.append("Content-Type","application/json");const ct=JSON.stringify({abha_address:a,profile:{address:_,day_of_birth:et,first_name:$,gender:nt,last_name:_e,middle_name:it,month_of_birth:tt,pincode:at,year_of_birth:rt}}),ot={method:"POST",headers:st,body:ct,redirect:"follow",credentials:"include"};try{const pt=GET_NDHM_HOST();return await(await fetchWrapper(`${pt}/abdm/v1/profile/eka`,ot)).json()}catch(pt){console.error("postAbdmProfileEka error =>",pt)}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 reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
|
|
17
|
+
*/var f$3=reactExports,k$3=Symbol.for("react.element"),l$8=Symbol.for("react.fragment"),m$3=Object.prototype.hasOwnProperty,n$3=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$3.current}}reactJsxRuntime_production_min.Fragment=l$8;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))(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))(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))(QUEUE_CARD_ACTIONS||{});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.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="",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,...$})},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 it,at;!nt.get("client-id")&&!_e&&nt.set("client-id",GET_CLIENT_ID()),rt&&!nt.get("auth")&&nt.set("auth",rt);const st=GET_EXTRA_HEADERS();st&&Object.keys(st).forEach(ot=>{nt.set(ot,st[ot])});const ct=await fetch(a,{..._,headers:nt});return window&&(at=window.location.pathname,it=nt.get("client-id")),ct.status===401&&$&&await refreshToken()?await fetchWrapper(a,_,!1):(ct.status>401&&sendApiFailedEvent({url:a,params:{responseStatus:ct.status}}),ct)}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,it,at;androidRefreshCB.push(rt),(at=(it=(nt=window==null?void 0:window.webkit)==null?void 0:nt.messageHandlers)==null?void 0:it.statusCodeHandler)==null||at.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 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 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 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 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 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 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:it,pincode:at,txn_id:st}){const ct=new Headers;ct.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:it,month_of_birth:tt,pincode:at,year_of_birth:rt},txn_id:st}),pt={method:"POST",headers:ct,body:ot,redirect:"follow",credentials:"include"};try{const ht=GET_NDHM_HOST();return await(await fetchWrapper(`${ht}/abdm/na/v1/registration/mobile/create-phr`,pt)).json()}catch(ht){console.error("postAbdmRegisterMobileCreatePhr error =>",ht)}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:it,pincode:at}){const st=new Headers;st.append("Content-Type","application/json");const ct=JSON.stringify({abha_address:a,profile:{address:_,day_of_birth:et,first_name:$,gender:nt,last_name:_e,middle_name:it,month_of_birth:tt,pincode:at,year_of_birth:rt}}),ot={method:"POST",headers:st,body:ct,redirect:"follow",credentials:"include"};try{const pt=GET_NDHM_HOST();return await(await fetchWrapper(`${pt}/abdm/v1/profile/eka`,ot)).json()}catch(pt){console.error("postAbdmProfileEka error =>",pt)}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 reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/**
|
|
18
18
|
* @license React
|
|
19
19
|
* scheduler.production.min.js
|
|
20
20
|
*
|