hplx-feature-library 1.0.299 → 1.0.301
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/{APIAction-BgGlVURt.cjs → APIAction-4R25WW2g.cjs} +1 -1
- package/dist/{APIAction-C4GFv-ck.js → APIAction-CMfpd8Bv.js} +1 -1
- package/dist/CommonTypes-Bg9068wC.cjs +1 -0
- package/dist/CommonTypes-BzMrYraH.js +5 -0
- package/dist/PatientAddEdit/index.js +1 -1
- package/dist/{PatientAddEdit-D3R1OpAK.js → PatientAddEdit-B7fjeZlX.js} +31 -30
- package/dist/PatientAddEdit-WITRBHBI.cjs +7 -0
- package/dist/PatientPopup/index.js +1 -1
- package/dist/{PatientPopupContainer-CiG65wai.js → PatientPopupContainer-DuTcUe0x.js} +44 -43
- package/dist/{PatientPopupContainer-J3yRTsFc.cjs → PatientPopupContainer-niKHN__m.cjs} +7 -7
- package/dist/{PrintModal-BbP9sQ08.js → PrintModal-007mwtDw.js} +3 -3
- package/dist/{PrintModal-DUHc2_7D.cjs → PrintModal-DAu_emtt.cjs} +5 -5
- package/dist/SearchPatients/index.js +1 -1
- package/dist/SearchPatients-COBd6WAT.cjs +1 -0
- package/dist/{SearchPatients-D9McylH4.js → SearchPatients-D1PQUJ9C.js} +8 -7
- package/dist/UserProfile/index.js +1 -1
- package/dist/UserProfile-DoatDBHd.cjs +14 -0
- package/dist/{UserProfile-_JHPLC6G.js → UserProfile-HbBoPcvx.js} +4 -3
- package/dist/{common-utils-BMUxEK3j.js → common-utils-CNR4r7ZZ.js} +453 -456
- package/dist/common-utils-DvxWGiX-.cjs +6 -0
- package/dist/index.js +5 -5
- package/dist/print-pdf/index.js +1 -1
- package/dist/types/ApiResponseTypes.d.ts +0 -2
- package/package.json +1 -1
- package/dist/PatientAddEdit-CpgM_oWm.cjs +0 -7
- package/dist/SearchPatients-CWqWZLfl.cjs +0 -1
- package/dist/UserProfile-s5c0-7H7.cjs +0 -14
- package/dist/common-utils-yiZUv58F.cjs +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";const W=require("./CommonConstant-BUchL6Rc.cjs"),M=require("./dayjs.min-BawXyS7V.cjs");function We(e,t){return function(){return e.apply(t,arguments)}}const{toString:bt}=Object.prototype,{getPrototypeOf:ge}=Object,{iterator:oe,toStringTag:Ke}=Symbol,ie=(e=>t=>{const n=bt.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),N=e=>(e=e.toLowerCase(),t=>ie(t)===e),ae=e=>t=>typeof t===e,{isArray:H}=Array,$=ae("undefined");function K(e){return e!==null&&!$(e)&&e.constructor!==null&&!$(e.constructor)&&O(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Ye=N("ArrayBuffer");function wt(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Ye(e.buffer),t}const gt=ae("string"),O=ae("function"),ve=ae("number"),Y=e=>e!==null&&typeof e=="object",Et=e=>e===!0||e===!1,te=e=>{if(ie(e)!=="object")return!1;const t=ge(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Ke in e)&&!(oe in e)},St=e=>{if(!Y(e)||K(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Rt=N("Date"),Tt=N("File"),Ot=N("Blob"),At=N("FileList"),xt=e=>Y(e)&&O(e.pipe),Ct=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||O(e.append)&&((t=ie(e))==="formdata"||t==="object"&&O(e.toString)&&e.toString()==="[object FormData]"))},Pt=N("URLSearchParams"),[Nt,Dt,Ft,_t]=["ReadableStream","Request","Response","Headers"].map(N),Ut=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function v(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),H(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(K(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let c;for(r=0;r<i;r++)c=o[r],t.call(null,e[c],c,e)}}function Xe(e,t){if(K(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const j=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ge=e=>!$(e)&&e!==j;function me(){const{caseless:e,skipUndefined:t}=Ge(this)&&this||{},n={},r=(s,o)=>{const i=e&&Xe(n,o)||o;te(n[i])&&te(s)?n[i]=me(n[i],s):te(s)?n[i]=me({},s):H(s)?n[i]=s.slice():(!t||!$(s))&&(n[i]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&v(arguments[s],r);return n}const Lt=(e,t,n,{allOwnKeys:r}={})=>(v(t,(s,o)=>{n&&O(s)?e[o]=We(s,n):e[o]=s},{allOwnKeys:r}),e),Bt=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),jt=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},kt=(e,t,n,r)=>{let s,o,i;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)i=s[o],(!r||r(i,e,t))&&!c[i]&&(t[i]=e[i],c[i]=!0);e=n!==!1&&ge(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},qt=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},It=e=>{if(!e)return null;if(H(e))return e;let t=e.length;if(!ve(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},Mt=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&ge(Uint8Array)),$t=(e,t)=>{const r=(e&&e[oe]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},Ht=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},zt=N("HTMLFormElement"),Jt=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),De=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vt=N("RegExp"),Ze=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};v(n,(s,o)=>{let i;(i=t(s,o,e))!==!1&&(r[o]=i||s)}),Object.defineProperties(e,r)},Wt=e=>{Ze(e,(t,n)=>{if(O(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(O(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Kt=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return H(e)?r(e):r(String(e).split(t)),n},Yt=()=>{},vt=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Xt(e){return!!(e&&O(e.append)&&e[Ke]==="FormData"&&e[oe])}const Gt=e=>{const t=new Array(10),n=(r,s)=>{if(Y(r)){if(t.indexOf(r)>=0)return;if(K(r))return r;if(!("toJSON"in r)){t[s]=r;const o=H(r)?[]:{};return v(r,(i,c)=>{const d=n(i,s+1);!$(d)&&(o[c]=d)}),t[s]=void 0,o}}return r};return n(e,0)},Zt=N("AsyncFunction"),Qt=e=>e&&(Y(e)||O(e))&&O(e.then)&&O(e.catch),Qe=((e,t)=>e?setImmediate:t?((n,r)=>(j.addEventListener("message",({source:s,data:o})=>{s===j&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),j.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",O(j.postMessage)),en=typeof queueMicrotask<"u"?queueMicrotask.bind(j):typeof process<"u"&&process.nextTick||Qe,tn=e=>e!=null&&O(e[oe]),a={isArray:H,isArrayBuffer:Ye,isBuffer:K,isFormData:Ct,isArrayBufferView:wt,isString:gt,isNumber:ve,isBoolean:Et,isObject:Y,isPlainObject:te,isEmptyObject:St,isReadableStream:Nt,isRequest:Dt,isResponse:Ft,isHeaders:_t,isUndefined:$,isDate:Rt,isFile:Tt,isBlob:Ot,isRegExp:Vt,isFunction:O,isStream:xt,isURLSearchParams:Pt,isTypedArray:Mt,isFileList:At,forEach:v,merge:me,extend:Lt,trim:Ut,stripBOM:Bt,inherits:jt,toFlatObject:kt,kindOf:ie,kindOfTest:N,endsWith:qt,toArray:It,forEachEntry:$t,matchAll:Ht,isHTMLForm:zt,hasOwnProperty:De,hasOwnProp:De,reduceDescriptors:Ze,freezeMethods:Wt,toObjectSet:Kt,toCamelCase:Jt,noop:Yt,toFiniteNumber:vt,findKey:Xe,global:j,isContextDefined:Ge,isSpecCompliantForm:Xt,toJSONObject:Gt,isAsyncFn:Zt,isThenable:Qt,setImmediate:Qe,asap:en,isIterable:tn};function y(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}a.inherits(y,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a.toJSONObject(this.config),code:this.code,status:this.status}}});const et=y.prototype,tt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{tt[e]={value:e}});Object.defineProperties(y,tt);Object.defineProperty(et,"isAxiosError",{value:!0});y.from=(e,t,n,r,s,o)=>{const i=Object.create(et);a.toFlatObject(e,i,function(l){return l!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return y.call(i,c,d,n,r,s),e&&i.cause==null&&Object.defineProperty(i,"cause",{value:e,configurable:!0}),i.name=e&&e.name||"Error",o&&Object.assign(i,o),i};const nn=null;function ye(e){return a.isPlainObject(e)||a.isArray(e)}function nt(e){return a.endsWith(e,"[]")?e.slice(0,-2):e}function Fe(e,t,n){return e?e.concat(t).map(function(s,o){return s=nt(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function rn(e){return a.isArray(e)&&!e.some(ye)}const sn=a.toFlatObject(a,{},null,function(t){return/^is[A-Z]/.test(t)});function ce(e,t,n){if(!a.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=a.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,p){return!a.isUndefined(p[m])});const r=n.metaTokens,s=n.visitor||l,o=n.dots,i=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&a.isSpecCompliantForm(t);if(!a.isFunction(s))throw new TypeError("visitor must be a function");function f(u){if(u===null)return"";if(a.isDate(u))return u.toISOString();if(a.isBoolean(u))return u.toString();if(!d&&a.isBlob(u))throw new y("Blob is not supported. Use a Buffer instead.");return a.isArrayBuffer(u)||a.isTypedArray(u)?d&&typeof Blob=="function"?new Blob([u]):Buffer.from(u):u}function l(u,m,p){let g=u;if(u&&!p&&typeof u=="object"){if(a.endsWith(m,"{}"))m=r?m:m.slice(0,-2),u=JSON.stringify(u);else if(a.isArray(u)&&rn(u)||(a.isFileList(u)||a.endsWith(m,"[]"))&&(g=a.toArray(u)))return m=nt(m),g.forEach(function(E,T){!(a.isUndefined(E)||E===null)&&t.append(i===!0?Fe([m],T,o):i===null?m:m+"[]",f(E))}),!1}return ye(u)?!0:(t.append(Fe(p,m,o),f(u)),!1)}const h=[],b=Object.assign(sn,{defaultVisitor:l,convertValue:f,isVisitable:ye});function S(u,m){if(!a.isUndefined(u)){if(h.indexOf(u)!==-1)throw Error("Circular reference detected in "+m.join("."));h.push(u),a.forEach(u,function(g,x){(!(a.isUndefined(g)||g===null)&&s.call(t,g,a.isString(x)?x.trim():x,m,b))===!0&&S(g,m?m.concat(x):[x])}),h.pop()}}if(!a.isObject(e))throw new TypeError("data must be an object");return S(e),t}function _e(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ee(e,t){this._pairs=[],e&&ce(e,this,t)}const rt=Ee.prototype;rt.append=function(t,n){this._pairs.push([t,n])};rt.toString=function(t){const n=t?function(r){return t.call(this,r,_e)}:_e;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function on(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function st(e,t,n){if(!t)return e;const r=n&&n.encode||on;a.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=a.isURLSearchParams(t)?t.toString():new Ee(t,n).toString(r),o){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class Ue{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){a.forEach(this.handlers,function(r){r!==null&&t(r)})}}const ot={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},an=typeof URLSearchParams<"u"?URLSearchParams:Ee,cn=typeof FormData<"u"?FormData:null,ln=typeof Blob<"u"?Blob:null,un={isBrowser:!0,classes:{URLSearchParams:an,FormData:cn,Blob:ln},protocols:["http","https","file","blob","url","data"]},Se=typeof window<"u"&&typeof document<"u",be=typeof navigator=="object"&&navigator||void 0,fn=Se&&(!be||["ReactNative","NativeScript","NS"].indexOf(be.product)<0),dn=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",pn=Se&&window.location.href||"http://localhost",hn=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Se,hasStandardBrowserEnv:fn,hasStandardBrowserWebWorkerEnv:dn,navigator:be,origin:pn},Symbol.toStringTag,{value:"Module"})),R={...hn,...un};function mn(e,t){return ce(e,new R.classes.URLSearchParams,{visitor:function(n,r,s,o){return R.isNode&&a.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function yn(e){return a.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function bn(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function it(e){function t(n,r,s,o){let i=n[o++];if(i==="__proto__")return!0;const c=Number.isFinite(+i),d=o>=n.length;return i=!i&&a.isArray(s)?s.length:i,d?(a.hasOwnProp(s,i)?s[i]=[s[i],r]:s[i]=r,!c):((!s[i]||!a.isObject(s[i]))&&(s[i]=[]),t(n,r,s[i],o)&&a.isArray(s[i])&&(s[i]=bn(s[i])),!c)}if(a.isFormData(e)&&a.isFunction(e.entries)){const n={};return a.forEachEntry(e,(r,s)=>{t(yn(r),s,n,0)}),n}return null}function wn(e,t,n){if(a.isString(e))try{return(t||JSON.parse)(e),a.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const X={transitional:ot,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=a.isObject(t);if(o&&a.isHTMLForm(t)&&(t=new FormData(t)),a.isFormData(t))return s?JSON.stringify(it(t)):t;if(a.isArrayBuffer(t)||a.isBuffer(t)||a.isStream(t)||a.isFile(t)||a.isBlob(t)||a.isReadableStream(t))return t;if(a.isArrayBufferView(t))return t.buffer;if(a.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return mn(t,this.formSerializer).toString();if((c=a.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return ce(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),wn(t)):t}],transformResponse:[function(t){const n=this.transitional||X.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(a.isResponse(t)||a.isReadableStream(t))return t;if(t&&a.isString(t)&&(r&&!this.responseType||s)){const i=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(i)throw c.name==="SyntaxError"?y.from(c,y.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:R.classes.FormData,Blob:R.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};a.forEach(["delete","get","head","post","put","patch"],e=>{X.headers[e]={}});const gn=a.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),En=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
2
|
+
`).forEach(function(i){s=i.indexOf(":"),n=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!n||t[n]&&gn[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Le=Symbol("internals");function V(e){return e&&String(e).trim().toLowerCase()}function ne(e){return e===!1||e==null?e:a.isArray(e)?e.map(ne):String(e)}function Sn(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Rn=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function de(e,t,n,r,s){if(a.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!a.isString(t)){if(a.isString(r))return t.indexOf(r)!==-1;if(a.isRegExp(r))return r.test(t)}}function Tn(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function On(e,t){const n=a.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,i){return this[r].call(this,t,s,o,i)},configurable:!0})})}let A=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,d,f){const l=V(d);if(!l)throw new Error("header name must be a non-empty string");const h=a.findKey(s,l);(!h||s[h]===void 0||f===!0||f===void 0&&s[h]!==!1)&&(s[h||d]=ne(c))}const i=(c,d)=>a.forEach(c,(f,l)=>o(f,l,d));if(a.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(a.isString(t)&&(t=t.trim())&&!Rn(t))i(En(t),n);else if(a.isObject(t)&&a.isIterable(t)){let c={},d,f;for(const l of t){if(!a.isArray(l))throw TypeError("Object iterator must return a key-value pair");c[f=l[0]]=(d=c[f])?a.isArray(d)?[...d,l[1]]:[d,l[1]]:l[1]}i(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=V(t),t){const r=a.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return Sn(s);if(a.isFunction(n))return n.call(this,s,r);if(a.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=V(t),t){const r=a.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||de(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(i){if(i=V(i),i){const c=a.findKey(r,i);c&&(!n||de(r,r[c],c,n))&&(delete r[c],s=!0)}}return a.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||de(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return a.forEach(this,(s,o)=>{const i=a.findKey(r,o);if(i){n[i]=ne(s),delete n[o];return}const c=t?Tn(o):String(o).trim();c!==o&&delete n[o],n[c]=ne(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return a.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&a.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
3
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[Le]=this[Le]={accessors:{}}).accessors,s=this.prototype;function o(i){const c=V(i);r[c]||(On(s,i),r[c]=!0)}return a.isArray(t)?t.forEach(o):o(t),this}};A.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);a.reduceDescriptors(A.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});a.freezeMethods(A);function pe(e,t){const n=this||X,r=t||n,s=A.from(r.headers);let o=r.data;return a.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function at(e){return!!(e&&e.__CANCEL__)}function z(e,t,n){y.call(this,e??"canceled",y.ERR_CANCELED,t,n),this.name="CanceledError"}a.inherits(z,y,{__CANCEL__:!0});function ct(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new y("Request failed with status code "+n.status,[y.ERR_BAD_REQUEST,y.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function An(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xn(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,i;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),l=r[o];i||(i=f),n[s]=d,r[s]=f;let h=o,b=0;for(;h!==s;)b+=n[h++],h=h%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),f-i<t)return;const S=l&&f-l;return S?Math.round(b*1e3/S):void 0}}function Cn(e,t){let n=0,r=1e3/t,s,o;const i=(f,l=Date.now())=>{n=l,s=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const l=Date.now(),h=l-n;h>=r?i(f,l):(s=f,o||(o=setTimeout(()=>{o=null,i(s)},r-h)))},()=>s&&i(s)]}const se=(e,t,n=3)=>{let r=0;const s=xn(50,250);return Cn(o=>{const i=o.loaded,c=o.lengthComputable?o.total:void 0,d=i-r,f=s(d),l=i<=c;r=i;const h={loaded:i,total:c,progress:c?i/c:void 0,bytes:d,rate:f||void 0,estimated:f&&c&&l?(c-i)/f:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(h)},n)},Be=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},je=e=>(...t)=>a.asap(()=>e(...t)),Pn=R.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,R.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(R.origin),R.navigator&&/(msie|trident)/i.test(R.navigator.userAgent)):()=>!0,Nn=R.hasStandardBrowserEnv?{write(e,t,n,r,s,o,i){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];a.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),a.isString(r)&&c.push(`path=${r}`),a.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),a.isString(i)&&c.push(`SameSite=${i}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Dn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Fn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function lt(e,t,n){let r=!Dn(t);return e&&(r||n==!1)?Fn(e,t):t}const ke=e=>e instanceof A?{...e}:e;function q(e,t){t=t||{};const n={};function r(f,l,h,b){return a.isPlainObject(f)&&a.isPlainObject(l)?a.merge.call({caseless:b},f,l):a.isPlainObject(l)?a.merge({},l):a.isArray(l)?l.slice():l}function s(f,l,h,b){if(a.isUndefined(l)){if(!a.isUndefined(f))return r(void 0,f,h,b)}else return r(f,l,h,b)}function o(f,l){if(!a.isUndefined(l))return r(void 0,l)}function i(f,l){if(a.isUndefined(l)){if(!a.isUndefined(f))return r(void 0,f)}else return r(void 0,l)}function c(f,l,h){if(h in t)return r(f,l);if(h in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(f,l,h)=>s(ke(f),ke(l),h,!0)};return a.forEach(Object.keys({...e,...t}),function(l){const h=d[l]||s,b=h(e[l],t[l],l);a.isUndefined(b)&&h!==c||(n[l]=b)}),n}const ut=e=>{const t=q({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:i,auth:c}=t;if(t.headers=i=A.from(i),t.url=st(lt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&i.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),a.isFormData(n)){if(R.hasStandardBrowserEnv||R.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if(a.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([l,h])=>{f.includes(l.toLowerCase())&&i.set(l,h)})}}if(R.hasStandardBrowserEnv&&(r&&a.isFunction(r)&&(r=r(t)),r||r!==!1&&Pn(t.url))){const d=s&&o&&Nn.read(o);d&&i.set(s,d)}return t},_n=typeof XMLHttpRequest<"u",Un=_n&&function(e){return new Promise(function(n,r){const s=ut(e);let o=s.data;const i=A.from(s.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:f}=s,l,h,b,S,u;function m(){S&&S(),u&&u(),s.cancelToken&&s.cancelToken.unsubscribe(l),s.signal&&s.signal.removeEventListener("abort",l)}let p=new XMLHttpRequest;p.open(s.method.toUpperCase(),s.url,!0),p.timeout=s.timeout;function g(){if(!p)return;const E=A.from("getAllResponseHeaders"in p&&p.getAllResponseHeaders()),P={data:!c||c==="text"||c==="json"?p.responseText:p.response,status:p.status,statusText:p.statusText,headers:E,config:e,request:p};ct(function(C){n(C),m()},function(C){r(C),m()},P),p=null}"onloadend"in p?p.onloadend=g:p.onreadystatechange=function(){!p||p.readyState!==4||p.status===0&&!(p.responseURL&&p.responseURL.indexOf("file:")===0)||setTimeout(g)},p.onabort=function(){p&&(r(new y("Request aborted",y.ECONNABORTED,e,p)),p=null)},p.onerror=function(T){const P=T&&T.message?T.message:"Network Error",L=new y(P,y.ERR_NETWORK,e,p);L.event=T||null,r(L),p=null},p.ontimeout=function(){let T=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const P=s.transitional||ot;s.timeoutErrorMessage&&(T=s.timeoutErrorMessage),r(new y(T,P.clarifyTimeoutError?y.ETIMEDOUT:y.ECONNABORTED,e,p)),p=null},o===void 0&&i.setContentType(null),"setRequestHeader"in p&&a.forEach(i.toJSON(),function(T,P){p.setRequestHeader(P,T)}),a.isUndefined(s.withCredentials)||(p.withCredentials=!!s.withCredentials),c&&c!=="json"&&(p.responseType=s.responseType),f&&([b,u]=se(f,!0),p.addEventListener("progress",b)),d&&p.upload&&([h,S]=se(d),p.upload.addEventListener("progress",h),p.upload.addEventListener("loadend",S)),(s.cancelToken||s.signal)&&(l=E=>{p&&(r(!E||E.type?new z(null,e,p):E),p.abort(),p=null)},s.cancelToken&&s.cancelToken.subscribe(l),s.signal&&(s.signal.aborted?l():s.signal.addEventListener("abort",l)));const x=An(s.url);if(x&&R.protocols.indexOf(x)===-1){r(new y("Unsupported protocol "+x+":",y.ERR_BAD_REQUEST,e));return}p.send(o||null)})},Ln=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(f){if(!s){s=!0,c();const l=f instanceof Error?f:this.reason;r.abort(l instanceof y?l:new z(l instanceof Error?l.message:l))}};let i=t&&setTimeout(()=>{i=null,o(new y(`timeout ${t} of ms exceeded`,y.ETIMEDOUT))},t);const c=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>a.asap(c),d}},Bn=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},jn=async function*(e,t){for await(const n of kn(e))yield*Bn(n,t)},kn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},qe=(e,t,n,r)=>{const s=jn(e,t);let o=0,i,c=d=>{i||(i=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:l}=await s.next();if(f){c(),d.close();return}let h=l.byteLength;if(n){let b=o+=h;n(b)}d.enqueue(new Uint8Array(l))}catch(f){throw c(f),f}},cancel(d){return c(d),s.return()}},{highWaterMark:2})},Ie=64*1024,{isFunction:ee}=a,qn=(({Request:e,Response:t})=>({Request:e,Response:t}))(a.global),{ReadableStream:Me,TextEncoder:$e}=a.global,He=(e,...t)=>{try{return!!e(...t)}catch{return!1}},In=e=>{e=a.merge.call({skipUndefined:!0},qn,e);const{fetch:t,Request:n,Response:r}=e,s=t?ee(t):typeof fetch=="function",o=ee(n),i=ee(r);if(!s)return!1;const c=s&&ee(Me),d=s&&(typeof $e=="function"?(u=>m=>u.encode(m))(new $e):async u=>new Uint8Array(await new n(u).arrayBuffer())),f=o&&c&&He(()=>{let u=!1;const m=new n(R.origin,{body:new Me,method:"POST",get duplex(){return u=!0,"half"}}).headers.has("Content-Type");return u&&!m}),l=i&&c&&He(()=>a.isReadableStream(new r("").body)),h={stream:l&&(u=>u.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(u=>{!h[u]&&(h[u]=(m,p)=>{let g=m&&m[u];if(g)return g.call(m);throw new y(`Response type '${u}' is not supported`,y.ERR_NOT_SUPPORT,p)})});const b=async u=>{if(u==null)return 0;if(a.isBlob(u))return u.size;if(a.isSpecCompliantForm(u))return(await new n(R.origin,{method:"POST",body:u}).arrayBuffer()).byteLength;if(a.isArrayBufferView(u)||a.isArrayBuffer(u))return u.byteLength;if(a.isURLSearchParams(u)&&(u=u+""),a.isString(u))return(await d(u)).byteLength},S=async(u,m)=>{const p=a.toFiniteNumber(u.getContentLength());return p??b(m)};return async u=>{let{url:m,method:p,data:g,signal:x,cancelToken:E,timeout:T,onDownloadProgress:P,onUploadProgress:L,responseType:C,headers:ue,withCredentials:G="same-origin",fetchOptions:Oe}=ut(u),Ae=t||fetch;C=C?(C+"").toLowerCase():"text";let Z=Ln([x,E&&E.toAbortSignal()],T),J=null;const B=Z&&Z.unsubscribe&&(()=>{Z.unsubscribe()});let xe;try{if(L&&f&&p!=="get"&&p!=="head"&&(xe=await S(ue,g))!==0){let U=new n(m,{method:"POST",body:g,duplex:"half"}),I;if(a.isFormData(g)&&(I=U.headers.get("content-type"))&&ue.setContentType(I),U.body){const[fe,Q]=Be(xe,se(je(L)));g=qe(U.body,Ie,fe,Q)}}a.isString(G)||(G=G?"include":"omit");const D=o&&"credentials"in n.prototype,Ce={...Oe,signal:Z,method:p.toUpperCase(),headers:ue.normalize().toJSON(),body:g,duplex:"half",credentials:D?G:void 0};J=o&&new n(m,Ce);let _=await(o?Ae(J,Oe):Ae(m,Ce));const Pe=l&&(C==="stream"||C==="response");if(l&&(P||Pe&&B)){const U={};["status","statusText","headers"].forEach(Ne=>{U[Ne]=_[Ne]});const I=a.toFiniteNumber(_.headers.get("content-length")),[fe,Q]=P&&Be(I,se(je(P),!0))||[];_=new r(qe(_.body,Ie,fe,()=>{Q&&Q(),B&&B()}),U)}C=C||"text";let yt=await h[a.findKey(h,C)||"text"](_,u);return!Pe&&B&&B(),await new Promise((U,I)=>{ct(U,I,{data:yt,headers:A.from(_.headers),status:_.status,statusText:_.statusText,config:u,request:J})})}catch(D){throw B&&B(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new y("Network Error",y.ERR_NETWORK,u,J),{cause:D.cause||D}):y.from(D,D&&D.code,u,J)}}},Mn=new Map,ft=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let i=o.length,c=i,d,f,l=Mn;for(;c--;)d=o[c],f=l.get(d),f===void 0&&l.set(d,f=c?new Map:In(t)),l=f;return f};ft();const Re={http:nn,xhr:Un,fetch:{get:ft}};a.forEach(Re,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const ze=e=>`- ${e}`,$n=e=>a.isFunction(e)||e===null||e===!1;function Hn(e,t){e=a.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let i=0;i<n;i++){r=e[i];let c;if(s=r,!$n(r)&&(s=Re[(c=String(r)).toLowerCase()],s===void 0))throw new y(`Unknown adapter '${c}'`);if(s&&(a.isFunction(s)||(s=s.get(t))))break;o[c||"#"+i]=s}if(!s){const i=Object.entries(o).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?i.length>1?`since :
|
|
4
|
+
`+i.map(ze).join(`
|
|
5
|
+
`):" "+ze(i[0]):"as no adapter specified";throw new y("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const dt={getAdapter:Hn,adapters:Re};function he(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new z(null,e)}function Je(e){return he(e),e.headers=A.from(e.headers),e.data=pe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),dt.getAdapter(e.adapter||X.adapter,e)(e).then(function(r){return he(e),r.data=pe.call(e,e.transformResponse,r),r.headers=A.from(r.headers),r},function(r){return at(r)||(he(e),r&&r.response&&(r.response.data=pe.call(e,e.transformResponse,r.response),r.response.headers=A.from(r.response.headers))),Promise.reject(r)})}const pt="1.13.1",le={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{le[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ve={};le.transitional=function(t,n,r){function s(o,i){return"[Axios v"+pt+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,c)=>{if(t===!1)throw new y(s(i," has been removed"+(n?" in "+n:"")),y.ERR_DEPRECATED);return n&&!Ve[i]&&(Ve[i]=!0,console.warn(s(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,i,c):!0}};le.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function zn(e,t,n){if(typeof e!="object")throw new y("options must be an object",y.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],i=t[o];if(i){const c=e[o],d=c===void 0||i(c,o,e);if(d!==!0)throw new y("option "+o+" must be "+d,y.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new y("Unknown option "+o,y.ERR_BAD_OPTION)}}const re={assertOptions:zn,validators:le},F=re.validators;let k=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ue,response:new Ue}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
6
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=q(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&re.assertOptions(r,{silentJSONParsing:F.transitional(F.boolean),forcedJSONParsing:F.transitional(F.boolean),clarifyTimeoutError:F.transitional(F.boolean)},!1),s!=null&&(a.isFunction(s)?n.paramsSerializer={serialize:s}:re.assertOptions(s,{encode:F.function,serialize:F.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),re.assertOptions(n,{baseUrl:F.spelling("baseURL"),withXsrfToken:F.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=o&&a.merge(o.common,o[n.method]);o&&a.forEach(["delete","get","head","post","put","patch","common"],u=>{delete o[u]}),n.headers=A.concat(i,o);const c=[];let d=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(d=d&&m.synchronous,c.unshift(m.fulfilled,m.rejected))});const f=[];this.interceptors.response.forEach(function(m){f.push(m.fulfilled,m.rejected)});let l,h=0,b;if(!d){const u=[Je.bind(this),void 0];for(u.unshift(...c),u.push(...f),b=u.length,l=Promise.resolve(n);h<b;)l=l.then(u[h++],u[h++]);return l}b=c.length;let S=n;for(;h<b;){const u=c[h++],m=c[h++];try{S=u(S)}catch(p){m.call(this,p);break}}try{l=Je.call(this,S)}catch(u){return Promise.reject(u)}for(h=0,b=f.length;h<b;)l=l.then(f[h++],f[h++]);return l}getUri(t){t=q(this.defaults,t);const n=lt(t.baseURL,t.url,t.allowAbsoluteUrls);return st(n,t.params,t.paramsSerializer)}};a.forEach(["delete","get","head","options"],function(t){k.prototype[t]=function(n,r){return this.request(q(r||{},{method:t,url:n,data:(r||{}).data}))}});a.forEach(["post","put","patch"],function(t){function n(r){return function(o,i,c){return this.request(q(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}k.prototype[t]=n(),k.prototype[t+"Form"]=n(!0)});let Jn=class ht{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(c=>{r.subscribe(c),o=c}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},t(function(o,i,c){r.reason||(r.reason=new z(o,i,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new ht(function(s){t=s}),cancel:t}}};function Vn(e){return function(n){return e.apply(null,n)}}function Wn(e){return a.isObject(e)&&e.isAxiosError===!0}const we={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(we).forEach(([e,t])=>{we[t]=e});function mt(e){const t=new k(e),n=We(k.prototype.request,t);return a.extend(n,k.prototype,t,{allOwnKeys:!0}),a.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return mt(q(e,s))},n}const w=mt(X);w.Axios=k;w.CanceledError=z;w.CancelToken=Jn;w.isCancel=at;w.VERSION=pt;w.toFormData=ce;w.AxiosError=y;w.Cancel=w.CanceledError;w.all=function(t){return Promise.all(t)};w.spread=Vn;w.isAxiosError=Wn;w.mergeConfig=q;w.AxiosHeaders=A;w.formToJSON=e=>it(a.isHTMLForm(e)?new FormData(e):e);w.getAdapter=dt.getAdapter;w.HttpStatusCode=we;w.default=w;const{Axios:yr,AxiosError:br,CanceledError:wr,isCancel:gr,CancelToken:Er,VERSION:Sr,all:Rr,Cancel:Tr,isAxiosError:Or,spread:Ar,toFormData:xr,AxiosHeaders:Cr,HttpStatusCode:Pr,formToJSON:Nr,getAdapter:Dr,mergeConfig:Fr}=w,Te={timeout:60*1e3,headers:{Accept:"application/json","Content-Type":"application/json"}},Kn=(e="",t)=>{const n=w.create({...Te,baseURL:W.BASE_URLS[t].rearch_url});return n.interceptors.request.use(r=>(e&&r.headers&&(r.headers.Authorization=`Bearer ${e}`),r),r=>Promise.reject(r)),n.interceptors.response.use(r=>r,r=>{const{response:s,request:o}=r||{};return Promise.reject(s||o)}),n},Yn=(e="",t)=>{const n=w.create({...Te,baseURL:W.BASE_URLS[t].rearch_url});return n.interceptors.request.use(r=>(e&&r.headers&&(r.headers.Authorization=`Bearer ${e}`),r),r=>Promise.reject(r)),n.interceptors.response.use(r=>r,r=>{const{response:s,request:o}=r||{};return Promise.reject(s||o)}),n},vn=(e="",t)=>{const n=w.create({...Te,baseURL:W.BASE_URLS[t].php_url});return n.interceptors.request.use(r=>(e&&r.headers&&(r.headers.Authorization=`Bearer ${e}`),r),r=>Promise.reject(r)),n.interceptors.response.use(r=>r,r=>{const{response:s,request:o}=r||{};return Promise.reject(s||o)}),n},Xn=e=>{window.location.href=e},Gn=e=>{const{origin:t}=window.location;window.location.href=`${t}/md/viewPatientDashboard.php?pid=${e}`},Zn=e=>{const t=[];if(e.length)for(const n of e)t.push({title:n,value:n});return t},Qn=e=>{const t=[];if(e.length)for(const n of e)t.push({doctor_id:n.doctor_id?n.doctor_id:"",doctor_name:n.doctor_name?n.doctor_name:"",label:n.doctor_name?n.doctor_name:"",specialist:n.specialist||""});return t},er=e=>{try{JSON.parse(e)}catch(t){return console.log("Error parsing JSON:",t),!1}return!0},tr=(e,t)=>{if(t?.length){const n=t.toLowerCase();if(e&&(n==="day"||n==="days"||n==="weeks"||n==="months"||n==="years")){e=e?e.toString():"";const r=M.dayjs().subtract(Number(e.replace(/[^0-9]/g,"")),n);return M.dayjs(r).format("YYYY-MM-DD")}return null}return null},nr=e=>{switch(e){case"0":return"M";case"1":return"F";case"2":return"O";default:return"O"}},rr=e=>{const t=W.genderList.find(n=>n.value===e);return t&&t.text?t.text.slice(0,1):""},sr=e=>{let t="";return new RegExp("^[0-9]{10}$").test(e)?{isError:!1,msg:t}:(e.length<10?t="Please enter 10 digit number":e.length>10?t="Invalid phone number. Should have at most 10 digits.":/^\d+$/.test(e)?t="Please enter 10 digit number":t="Invalid phone number. Should contain only digits.",{isError:!0,msg:t})},or=e=>e?new Date(e).toString()!=="Invalid Date":!1;function ir(e){const t=M.dayjs(e).format("YYYY-MM-DD"),n=new Date(t),s=Math.abs(new Date().getTime()-n.getTime()),o=Math.ceil(s/(1e3*60*60*24));if(o<=7)return`${o} days`;if(o<=30)return`${Math.floor(o/7)} weeks`;if(o<=365)return`${Math.floor(o/30)} months`;{const i=Math.floor(o/365);return isNaN(i)?"":`${i} years`}}const ar=(e,t=300)=>{let n=null;return function(...r){n&&clearTimeout(n),n=setTimeout(()=>{n=null,e.apply(this,r)},t)}},cr=(e,t)=>{if(t?.length){const n=t.toLowerCase();if(e&&(n==="day"||n==="days"||n==="weeks"||n==="months"||n==="years")){e=e?e.toString():"";const r=M.dayjs().subtract(Number(e.replace(/[^0-9]/g,"")),n);return M.dayjs(r).format("YYYY-MM-DD")}return null}return null},lr=()=>{const{title:e,subTitle:t,type:n,time:r}=W.UnauthorizedAccessMessage;typeof window.showToast=="function"&&window.showToast(e,t,n,r)};function ur(e=""){return e?e.charAt(0).toUpperCase()+e.slice(1):""}const fr=(e="",t="")=>{const n=e.split(" ")[0].toLowerCase();window.location.href=`${window.location.origin}/subscription/${n}/${t}`},dr=(e,t="")=>{const n=t?.length&&t?.trim()?t?.trim():"";try{if(typeof e=="string"&&e?.length&&e?.trim()){const r=e.replace(/\s+/g," ").trim().split(" ");return r?.length?{duration:r[0]||"",durationType:r[1]?.length?r[1]:n||""}:{duration:"",durationType:""}}return{duration:e?`${e}`:"",durationType:n}}catch(r){return console.log(r,"getDurationFormat"),{duration:"",durationType:""}}},pr=(e,t)=>`${M.dayjs(new Date(e?.replace(/[Z[\]]/g,""))).format(t)}`;exports.ReArchAPI=Yn;exports.calculateAge=ir;exports.calculateDOB=cr;exports.calculateDate=tr;exports.capitalizeFirstLetter=ur;exports.debounceFn=ar;exports.formatDateTimeAtUtils=pr;exports.getDurationFormat=dr;exports.getGender=rr;exports.getGenderKey=nr;exports.goToPage=Xn;exports.goToPatientDashboard=Gn;exports.handle401Status=lr;exports.hplxAPI=Kn;exports.hplxPHPAPI=vn;exports.isJson=er;exports.isValidDate=or;exports.parseReferredByDocList=Qn;exports.parseThroughChannelList=Zn;exports.redirectionToSubscription=fr;exports.validateMobileNo=sr;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { P as r } from "./PediatricsCalculatorTable-CXALqwAy.js";
|
|
2
|
-
import { P as e } from "./PatientPopupContainer-
|
|
2
|
+
import { P as e } from "./PatientPopupContainer-DuTcUe0x.js";
|
|
3
3
|
import { A as i } from "./Attachments-KDvUuiBM.js";
|
|
4
|
-
import { P } from "./PatientAddEdit-
|
|
5
|
-
import { S as m } from "./SearchPatients-
|
|
4
|
+
import { P } from "./PatientAddEdit-B7fjeZlX.js";
|
|
5
|
+
import { S as m } from "./SearchPatients-D1PQUJ9C.js";
|
|
6
6
|
import { N as n } from "./NineDots-BvxC-xGI.js";
|
|
7
|
-
import { U as d } from "./UserProfile-
|
|
8
|
-
import { P as c } from "./PrintModal-
|
|
7
|
+
import { U as d } from "./UserProfile-HbBoPcvx.js";
|
|
8
|
+
import { P as c } from "./PrintModal-007mwtDw.js";
|
|
9
9
|
import { A as u } from "./AllInvestigationsTable-Dl5e6_Wk.js";
|
|
10
10
|
export {
|
|
11
11
|
u as AllInvestigations,
|
package/dist/print-pdf/index.js
CHANGED
|
@@ -270,11 +270,9 @@ export interface ENV_PARAMS {
|
|
|
270
270
|
token: string;
|
|
271
271
|
enc_token?: string;
|
|
272
272
|
envName: E_ENVIRONMENT;
|
|
273
|
-
ATTACHMENT_BUCKET_DEV_NAME?: string;
|
|
274
273
|
ATTACHMENT_BUCKET_NAME?: string;
|
|
275
274
|
fontBaseUrl?: string;
|
|
276
275
|
IMGREP_DIRECTORY?: string;
|
|
277
|
-
IMGREP_DIRECTORY_DEV?: string;
|
|
278
276
|
window_var?: Partial<GlobalWindow>;
|
|
279
277
|
enable_rearch?: string;
|
|
280
278
|
MEDIA_URL?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("./index-D5vZvm7Z.cjs");;/* empty css */const at=require("./index-CZONCDCp.cjs"),a=require("react"),st=require("./index.esm-BdlMQ1M7.cjs"),oe=require("./dayjs.min-BawXyS7V.cjs"),h=require("./common-utils-yiZUv58F.cjs"),x=require("./CommonConstant-BUchL6Rc.cjs"),B=require("./APIAction-BgGlVURt.cjs"),lt=()=>e.jsxRuntimeExports.jsx("div",{className:"hfl-h-0 hfl-w-full hfl-border-1 hfl-border-Gray-200"}),Yt=({conflicts:R,handleAddPatient:_,redirectAction:G})=>{const[C,b]=a.useState(!1);return e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-mx-[20%] hfl-my-5 hfl-text-center",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:"hfl-text-Error-700",children:"Patient/s with similar information already exists in your Clinic. To continue with an existing patient click on “Continue."})}),e.jsxRuntimeExports.jsxs("table",{className:"hfl-mx-7",children:[e.jsxRuntimeExports.jsx("thead",{children:e.jsxRuntimeExports.jsxs("tr",{className:"hfl-w-full",children:[e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[40px] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"#"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"Name"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"Phone No"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"Email"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-border hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-flex hfl-items-center hfl-text-Gray-500",children:"Branch"})}),e.jsxRuntimeExports.jsx("th",{className:"hfl-w-[20%] hfl-max-w-[40px] hfl-rounded-tl hfl-rounded-tr hfl-border-b hfl-border-r hfl-border-Blue_gray-100 hfl-bg-Blue_gray-50 hfl-px-2 hfl-py-[6px]"})]})}),R.map((o,f)=>e.jsxRuntimeExports.jsxs("tr",{className:"hfl-w-full hfl-border-1 hfl-border-Gray-100",children:[e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-800",children:f+1})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-800",children:o.org_person_name||o.name})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-500",children:o.org_person_phone||o.phone})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-500",children:o.org_person_email||o.email})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:" hfl-flex hfl-items-center hfl-text-Gray-500",children:"In Same Branch"})}),e.jsxRuntimeExports.jsx("td",{className:"hfl-flex hfl-items-center hfl-justify-center hfl-border-Blue_gray-100 hfl-px-2 hfl-py-[6px] ",children:window.role_id=="11"&&e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",size:"sm",textField:"Continue",className:"hfl-text-Primary-700",onClick:()=>h.goToPatientDashboard(o.person_role_id)})})]}))]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-my-7 hfl-flex hfl-items-center hfl-justify-center",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:"hfl-text-Success-800",children:"If your patient is not in the above list"})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-justify-center",children:e.jsxRuntimeExports.jsx(e.Ku,{disabled:C,hierarchy:"Primary",size:"xl",textField:"Create As New Patient",className:"hfl-bg-Primary-700",onClick:()=>{b(!0),_(!0,G)}})})]})};function Wt(R){const{editPatient:_,setEditPatient:G,createAsNew:C,setCreateAsNew:b}=R,o=()=>_?"Primary":"Secondary",f=()=>C?"Primary":"Secondary";return e.jsxRuntimeExports.jsxs("div",{className:"hfl-mt-6 hfl-flex hfl-h-20 hfl-w-full hfl-items-center hfl-justify-center hfl-gap-4 hfl-border-1 hfl-border-Error-200 hfl-bg-Error-25",children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text md",className:"hfl-text-Error-700",children:"Are you updating"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:o(),size:"lg",textField:"Exisitng Patient",onClick:()=>{G(!0),b(!1)}}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text md",className:"hfl-text-Error-700",children:"or creating a"}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:f(),size:"lg",textField:"New Patient",onClick:()=>{b(!0),G(!1)}})]})}const De=15,rt=3,Kt=({isOpen:R,onClose:_,onSubmit:G,otpErrorMsg:C,setOtpErrorMsg:b,optHeading:o,otpSubHeading:f,veriftButtonTitle:m,resendOtp:J})=>{const[$,w]=a.useState(""),[F,p]=a.useState(De),[se,I]=a.useState(!1),[z,Y]=a.useState(0);a.useEffect(()=>{R&&(w(""),b(""),p(De),I(!1),Y(0))},[R,b]),a.useEffect(()=>{if(F>0&&R){const O=setInterval(()=>{p(W=>W-1)},1e3);return()=>clearInterval(O)}else F===0&&R&&I(!0)},[F,R]);const he=O=>{O.preventDefault(),String($).length===6&&G($)},de=O=>{C&&b("");const W=O.target.value;/^\d*$/.test(W)&&w(W)},fe=()=>{se&&z<rt&&(J(),Y(O=>O+1),p(De),I(!1))};return e.jsxRuntimeExports.jsxs(at.Modal,{isOpen:R,onRequestClose:_,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",zIndex:1032},content:{maxWidth:"400px",maxHeight:"350px",display:"flex",flexDirection:"column",justifyContent:"center",padding:"24px",margin:"auto",borderRadius:"12px"}},ariaHideApp:!1,children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-end hfl-justify-end",children:e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Tertiary-Grey",icon:"Only",iconFile:"hx_close",onClick:_,size:"md",textField:""})}),e.jsxRuntimeExports.jsxs("form",{className:"hfl-z-5 hfl-relative hfl-flex hfl-h-full hfl-flex-col hfl-items-center hfl-justify-center hfl-text-center",onSubmit:he,children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Semibold",type:"Text lg",children:o}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text sm",className:"hfl-mx-auto hfl-w-[290px] hfl-pt-2 hfl-text-Gray-500",children:f}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mx-auto hfl-max-h-[150px] hfl-w-[315px] hfl-py-5",children:e.jsxRuntimeExports.jsx(e.wu,{inputProps:{autoFocus:!0,value:$,pattern:"[0-9]+",onChange:de},size:"xs",digits:6,errorMsg:C})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mb-4 hfl-h-4",children:z>=rt?e.jsxRuntimeExports.jsx(e.bi,{type:"Text sm",variant:"Regular",className:"hfl-text-Error-500",children:"Maximum resend attempts reached."}):se?e.jsxRuntimeExports.jsx(e.bi,{variant:"Semibold",type:"Text sm",className:"hfl-cursor-pointer hfl-text-Primary-700 hfl-underline",onClick:fe,children:"Resend OTP"}):e.jsxRuntimeExports.jsxs(e.bi,{type:"Text sm",variant:"Regular",className:"hfl-text-Gray-500",children:["Resend OTP in 00:",F<10?`0${F}`:F]})}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:m,disabled:String($).length<6})]})]})},Zt=R=>{const{closeModal:_,modalIsOpen:G,pref:C,variable:b}=R,{window_var:o,token:f,envName:m}=b,[J,$]=a.useState(!1),[w,F]=a.useState({}),[p,se]=a.useState(!1),[I,z]=a.useState(null),[Y,he]=a.useState(!0),[de,fe]=a.useState(!1),[O,W]=a.useState([]),[Te,K]=a.useState(!1),[P,le]=a.useState(""),[g,nt]=a.useState(),[j,u]=a.useState({name:"",phone:"",age:"",gender:"",email:"",aadhar_number:""}),[re,it]=a.useState([]),[ae,H]=a.useState({name:!1,phone:!1}),[ce,ot]=a.useState([]),[ue,ht]=a.useState([]),[pe,dt]=a.useState([]),[ft,xe]=a.useState(!1),[ct,me]=a.useState(!1),[ut,ge]=a.useState(!1),[_e,pt]=a.useState([]),[k,xt]=a.useState(!1),[s,L]=a.useState({name:"",phone:"",dob:"",gender:"",honorific:"",patient_preferred_language:C?.visit_pad_json?JSON.parse(C?.visit_pad_json)?.defaultLanguage?.rows:"",age:"",age_selector:"years",blood_group:"",email:"",address:"",city:"",existingBidStr:"",pincode:"",ref_doc_name:"",ref_doc_spec:"",temp_appnt_id:"",throughChannel:"",refDocId:"",careOf:"",phoneSecondary:"",occupation:"",tag:"",phone_otp:"",regAsNew:"",image_link:"",marital_status:"",spouse_blood_group:"",married_since:"",spouse_name:"",org_person_dob:"",aadhar_number:"",custom_fields:[]}),[mt,gt]=a.useState([]),{name:ke,phone:A,age:N,dob:M,gender:Ae}=s,[Be,Oe]=a.useState(!1),[_t,je]=a.useState(s.gender),[S,Le]=a.useState("Years"),[Me,Ge]=a.useState(""),[Fe,be]=a.useState(!1),[jt,bt]=a.useState([]),v=(t,l,r,n)=>{bt([{id:1,title:t,description:l,type:r,duration:n}])},q=a.useRef(null),Ie=a.useRef(null),[ze,X]=a.useState(!1),[yt,ye]=a.useState(!1),[Et,He]=a.useState(!1),[Ve,Ee]=a.useState(!1),[qe,Re]=a.useState(!1),[ne,Rt]=a.useState(),D=g&&g.visit_pad_json&&h.isJson(g.visit_pad_json)&&JSON.parse(g.visit_pad_json),Ue=h.debounceFn((...t)=>{const[l,r]=t;At(l,r)}),i=a.useCallback((t,l)=>{ye(!1),L(r=>({...r,[t]:l})),(t==="name"||t==="phone"&&l.length>=3)&&Ue(t,l)},[Ue]),vt=t=>{i("throughChannel",t.value.trim()),xe(!1)},T=a.useMemo(()=>ne?.branch_details?.enable_mobile_otp=="1",[ne?.branch_details?.enable_mobile_otp]),Ct=t=>{i("occupation",t.trim()),me(!1)},wt=t=>{i("city",t.trim()),ge(!1)},Pt=t=>{const{value:l}=t.target,r=Dt(l);ot(r)},Nt=t=>{const{value:l}=t.target,r=Tt(l);ht(r)},St=t=>{const{value:l}=t.target,r=kt(l);pt(r)},Dt=t=>{if(pe?.length){let l=pe;return t?.length&&(l=pe.filter(r=>r.title.toLowerCase().includes(t.toLowerCase()))),l}else return[]},Tt=t=>{if(x.OccupationList?.length){let l=x.OccupationList;return t?.length&&(l=x.OccupationList.filter(r=>r.toLowerCase().includes(t.toLowerCase()))),l}else return[]},kt=t=>{if(x.CityList?.length){let l=x.CityList;return t?.length&&(l=x.CityList.filter(r=>r.toLowerCase().includes(t.toLowerCase()))),l}else return[]},$e=a.useRef(null),ie=a.useRef(null),ve=a.useRef(null),Ye=window.location?.pathname.includes("/frontdesk");a.useEffect(()=>{const t=h.calculateDOB(s.age,S);t&&L(l=>({...l,dob:t}))},[S,s.age]);const Ce=a.useCallback(t=>{je(t),i("gender",t),u(l=>({...l,gender:""}))},[i]),We=t=>{($e.current&&!$e.current.contains(t.target)||ie.current&&!ie.current.contains(t.target))&&H({name:!1,phone:!1}),ve.current&&!ve.current.contains(t.target)&&be(!1)},Ke=a.useCallback(()=>{le(s.image_link),K(!1),X(!1)},[s.image_link]),Ze=a.useCallback(async()=>{const t=await B.getBranchPreferences("patient_config",o?.org_branch_id_for_seg?.toString()||"",{token:f,envName:m});Rt(t)},[f,m,o?.org_branch_id_for_seg]);a.useEffect(()=>(document.addEventListener("mousedown",We),()=>{document.removeEventListener("mousedown",We)}),[]),a.useEffect(()=>{o.doctor_speciality==="Gynaecologist"&&!s.gender&&Ce("1")},[s.gender,Ce,o.doctor_speciality]),a.useEffect(()=>{s.image_link&&Ke(),s.honorific&&Ge(s.honorific)},[s.honorific,s.image_link,Ke]),a.useEffect(()=>{Ye&&Oe(!0)},[Ye]),a.useEffect(()=>{Ze()},[Ze]),a.useEffect(()=>{(async()=>{nt(C);try{const t=await B.getReferredByList({token:f,envName:m}),{total_ref_doc_details:l,through_channel:r}=t;l.length&>(h.parseReferredByDocList(l)),r.length&&dt(h.parseThroughChannelList(r))}catch(t){console.log("ERROR",t)}})()},[C,f,m]);const At=async(t,l)=>{const r={branch_id:o?.org_branch_id_for_seg||"",doctor_id:o?.person_id_for_seg||"",doctor_role_id:o?.doctor_role_id_for_seg||"",term:encodeURIComponent(l),limit:30},n=await B.getPatientList(r,{token:f,envName:m});if(!n){H({name:!1,phone:!1});return}!n.apiError&&Number(n.total_persons)>0?(it(n.persons),H(t==="name"?{...ae,name:!0}:{...ae,phone:!0})):H({name:!1,phone:!1})},U=a.useCallback(async()=>{if(!T||!Y)return;Re(!0),(await B.patientConsentSendOTP(A,b)).apiError?v("OTP Failed","Unable to send OTP. Please try again.","Error",3e3):v("Success","OTP sent successfully","Success",1500)},[T,Y,A,b]),Bt=a.useCallback(async t=>{(await B.patientConsentOTPVerification(A,t,b)).apiError?v("Invalid OTP","Please enter correct OTP","Error",3e3):(xt(!0),v("Success","OTP verified successfully","Success",1500),Re(!1))},[A,b]),we=t=>{switch(t){case"Appointment":return"#Appnt";default:return""}},Pe=t=>{switch(t){case"Bill":case"Appointment":return"emrPatientPopUp.php?pid=";default:return h.EAPP_ROUTES.visitpad+"?pid="}},Ot=a.useCallback(t=>{const l=r=>{L({name:r?.name||"",phone:r?.phone_number||"",gender:r?.gender||"",honorific:r?.honorific||"",patient_preferred_language:r?.patient_preferred_language||"",ref_doc_spec:r?.ref_doc_spec||"",age:r?.age.toString()||"",age_selector:"2",dob:r.org_person_dob||"",org_person_dob:r.org_person_dob||"",blood_group:r?.blood_group||"",email:r?.email||"",address:r?.address||"",city:r?.city||"",existingBidStr:r?.org_person_bid_str||"",pincode:r?.pincode||"",ref_doc_name:r?.ref_doc_name||"",temp_appnt_id:"",throughChannel:r?.through_channel||"",refDocId:r?.ref_doc_id||"",careOf:r?.care_of||"",phoneSecondary:r?.phone_secondary||"",occupation:r?.occupation||"",tag:r?.tag||"",phone_otp:"",regAsNew:"",image_link:r?.image_link||"",marital_status:r.marital_status||"",spouse_blood_group:r.spouse_blood_group||"",married_since:r.married_since||"",spouse_name:r.spouse_name||"",aadhar_number:r.aadhar_number||"",custom_fields:r.custom_fields||[]}),je(r?.gender)};B.getPatientDetails({callback:l,payload:t,token_env:{token:f,envName:m}})},[m,f]),Z=a.useCallback((t="")=>{const l=t?.toLowerCase();return M!==""?"":N!==""&&Number(N)<0&&M===""?"Invalid Age":l==="weeks"&&N!==""&&Number(N)<5907||l==="days"&&N!==""&&Number(N)<9999||l==="months"&&N!==""&&Number(N)<1358||l==="years"&&N!==""&&Number(N)<114?"":"Invalid Age"},[M,N]),Je=async t=>{He(!0);const l={branch_id:o?.org_branch_id_for_seg?.toString()||"",person_id:o?.person_id_for_seg||"",person_role_id:o?.doctor_role_id_for_seg||"",patient_role_id:t.person_role_id||""};Ot(l),H({name:!1,phone:!1}),fe(!0),F(t)},Xe=a.useCallback(()=>{let t=!0;return s.name?s.name.length<2&&(u(l=>({...l,name:"Enter at least 2 letters "})),t=!1):(u(l=>({...l,name:"Enter the Name of the Patient"})),t=!1),(g&&g.phone_number_length&&s.phone.length!==10||s.phone.length&&s.phone.length!==10)&&(u(l=>({...l,phone:"Please enter 10 digit number"})),t=!1),s.aadhar_number&&s.aadhar_number.length!=12&&(u(l=>({...l,aadhar_number:"Please enter 12 digit aadhar number"})),t=!1),Z(S).length&&M?.length===0&&(u(l=>({...l,age:"Invalid Age."})),t=!1),Ae===""&&(u(l=>({...l,gender:"Select Gender"})),t=!1),j.email.length&&(s.email&&!st.create$6().email().isValidSync(s.email)&&u(l=>({...l,email:"Email format is wrong"})),t=!1),t},[s.name,s.phone.length,s.aadhar_number,s.email,g,Z,S,M?.length,Ae,j.email.length]),Q=a.useCallback(async(t,l)=>{const r=new FormData;r.append("pid",t),r.append("bidstr",l),r.append("imgData",P);const n=await B.addPatientImage(r,{token:f,envName:m});n.apiError&&v("Error",n.apiError,"Error",3e3)},[P,m,f]),Qe=a.useCallback(async t=>{const l=new FormData;l.append("pid",t);const r=await B.deletePatientImage(l,{token:f,envName:m});r.apiError&&v("Error",r.apiError,"Error",3e3)},[m,f]),Ne=a.useCallback(async(t,l)=>{try{if(!Xe()){v("Invalid form","Please fill in the required fields","Error",3e3);return}if(T&&!k&&!p){v("Consent Required","Please provide patient consent.","Error",3e3);return}const n=new FormData;n.append("name",s.name),n.append("phone",s.phone),n.append("gender",h.getGenderKey(s.gender)),n.append("honorific",s.honorific),n.append("patient_preferred_language",s.patient_preferred_language),n.append("age",M&&M.length?M:h.calculateDate(s?.age,S)||""),n.append("age_selector",s.age_selector),n.append("blood_group",s.blood_group),n.append("email",s.email),n.append("address",s.address),n.append("city",s.city),n.append("existing_bid_str",s.existingBidStr),n.append("pincode",s.pincode),n.append("ref_doc_id",s.refDocId),n.append("ref_doc_name",s.ref_doc_name),n.append("ref_doc_spec",s.ref_doc_spec),n.append("through_channel",s.throughChannel),n.append("care_of",s.careOf),n.append("phone_secondary",s.phoneSecondary),n.append("occupation",s.occupation),n.append("tag",s.tag),n.append("marital_status",s.marital_status),n.append("married_since",s.married_since),n.append("spouse_name",s.spouse_name),n.append("spouse_blood_group",s.spouse_blood_group),n.append("aadhar_number",s.aadhar_number),n.append("custom_fields",JSON.stringify(s.custom_fields||[])),t&&n.append("reg_as_new","1");const c=Object.fromEntries(n.entries()),y=Object.fromEntries(Object.entries(c).map(([te,$t])=>[te,String($t)])),E={...y,custom_fields:JSON.parse(y.custom_fields||"[]"),doctor_role_id:o.doctor_role_id_for_seg||"",doctor_id:o.person_id_for_seg||"",org_branch_id:o.org_branch_id_for_seg||"",source:"emr",ip:""},d=await B.addPatientDetails(E,{token:f,envName:m});if(d.apiError)v("Error",d.apiError,"Error",3e3),ye(!1);else{if(t){try{P&&await Q(d.person_role_id.toString(),d.org_person_bid_str.toString())}catch(te){console.log(te)}l!=="Rx"&&D&&D?.mode_of_patient_popup?.include=="1"&&typeof window.patientPopupHandler<"u"?window.patientPopupHandler("addpatient",d.person_role_id.toString(),d.person_id.toString(),g,D,l):h.goToPage(Pe(l)+d.person_role_id.toString()+we(l)),_();return}else{try{P&&await Q(d.person_role_id.toString(),d.org_person_bid_str.toString())}catch(te){console.log(te)}ee()}d?.conflicts?.length>0?($(!0),W(d.conflicts)):_(),Array.isArray(d?.person)||v("Success","Patient Added Successfully","Success",3e3),d!=null&&!d?.conflicts?.length&&d?.person_role_id&&(l!=="Rx"&&D&&D?.mode_of_patient_popup?.include=="1"&&typeof window.patientPopupHandler<"u"?window.patientPopupHandler("addpatient",d.person_role_id.toString(),d.person_id.toString(),g,D,l):h.goToPage(Pe(l)+d.person_role_id.toString()+we(l)),_())}}catch(r){console.log(r)}},[Xe,T,k,p,s,M,S,o,f,m,D,_,P,Q,g]),Lt=()=>{try{const t={"/md/viewRemoteAppointments.php":["onlineConsultationHead","bannerPopupWrap","calendarViewClassDiv"],[h.EAPP_ROUTES.consultations]:["onlineConsultationHead","newPaddingMarginEMR","bannerPopupWrap","consultations_mfe"],[h.EAPP_ROUTES.appointments]:["appointments_mfe"]},l=window.location?.pathname||"",r=t[l];if(!r?.length)return;const n=document.getElementById("react_emr_mfe"),c=document.getElementById("react_curtains_mfe"),y=document.querySelector(".offlineEMR3");[n,c,y].forEach(E=>{E&&E.classList.contains("hidden")&&E.classList.remove("hidden")});for(const E of r){const d=document.getElementsByClassName(E);d.length&&!d[0].classList.contains("hidden")&&d[0].classList.add("hidden")}}catch(t){console.error("Error in manipulating DOM:",t)}},et=a.useCallback(async t=>{const l={patient_id:w?.person_id,honorific:s?.honorific,name:s?.name,gender:s?.gender,age:s?.age,org_person_dob:s?.dob?s.dob:h.calculateDate(s?.age,S)||void 0,phone_number:s?.phone,email:s?.email,blood_group:s?.blood_group,patient_preferred_language:s?.patient_preferred_language,address:s?.address,city:s?.city,pincode:s?.pincode,org_person_bid_str:s?.existingBidStr,ref_doc_name:s?.ref_doc_name,ref_doc_spec:s?.ref_doc_spec,through_channel:s?.throughChannel,ref_doc_id:s?.refDocId,care_of:s?.careOf,phone_secondary:s?.phoneSecondary,occupation:s?.occupation,tag:s?.tag,marital_status:s.marital_status,married_since:s.married_since,spouse_name:s.spouse_name,spouse_blood_group:s.spouse_blood_group,image_link:s?.image_link,remote_consultation_id:"0",oc_status:!1,aadhar_number:s?.aadhar_number,person_role_id:o.doctor_role_id_for_seg||"",person_id:o.person_id_for_seg||"",branch_id:o.org_branch_id_for_seg||""},r=await B.updatePatientDetails(l,{token:f,envName:m});if(p){r&&ye(!1);const{message:n,status:c}=r||{};if(c){v("Patient Edited","Patient Edited Successfully","Success",1500);try{s?.image_link&&!P?Qe(w?.person_role_id):P&&Ve&&(Ee(!1),await Q(w?.person_role_id,s?.existingBidStr))}catch(y){console.log(y)}t!=="Rx"&&D&&D?.mode_of_patient_popup?.include=="1"&&typeof window.patientPopupHandler<"u"?window.patientPopupHandler("addpatient",w?.person_role_id,w?.person_id,g,D,t):h.goToPage(Pe(t)+w?.person_role_id?.toString()+we(t)),_()}else v("Patient Not Edited",n||"Patient Not Edited","Failure",1500)}},[w?.person_id,w?.person_role_id,s,S,o,f,m,p,D,_,P,Ve,Qe,Q,g]),Mt=async()=>{try{K(!1);const t=await navigator.mediaDevices.getUserMedia({video:!0});q.current&&(q.current.srcObject=t),X(!0)}catch(t){console.error("Error accessing camera:",t)}},Gt=()=>{const t=Ie.current,l=q.current;if(t&&l){t.width=l.videoWidth,t.height=l.videoHeight;const r=t.getContext("2d");if(r){r.drawImage(l,0,0,t.width,t.height);const n=t.toDataURL();le(n),K(!1),X(!1),ee()}}},Ft=()=>{document.getElementById("upload-local-file")?.click()},It=t=>{K(!1),X(!1);const l=t.target.files?.[0];if(!l)return;const r=new FileReader;r.readAsDataURL(l),r.onloadend=()=>{const n=r.result;n&&le(n.toString()),t.target.value=""}},tt=()=>{K(!0),le(""),X(!1),ee()},ee=()=>{if(q.current){const t=q.current.srcObject;t instanceof MediaStream&&t.getTracks().forEach(l=>l.stop()),q.current.srcObject=null}},zt=a.useMemo(()=>[...ne?.patient_config?.custom_fields||[]].sort((r,n)=>r.sort-n.sort).map(r=>{const n=s.custom_fields?.find(c=>c.id===r.id);return{...r,value:n?.value||"",title:n?.value?n?.title:r.title}}),[ne?.patient_config?.custom_fields,s.custom_fields]),Se=(t,l,r)=>{L(n=>{const c=n.custom_fields?.length?n.custom_fields.map(E=>E.id===t?{...E,value:r}:E):[];return c.some(E=>E.id===t)||c.push({id:t,value:r,title:l}),{...n,custom_fields:c}})},Ht=()=>zt?.map(t=>{const{id:l,type:r,value:n,title:c}=t||{};if(!l||!r||!c)return null;switch(r){case"text":return e.jsxRuntimeExports.jsx(e.Pi,{label:c,labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:n||"",placeholder:`Enter ${c}`,onChange:y=>{Se(l,c,y.target.value)}},width:"22em"},l);case"date":return e.jsxRuntimeExports.jsx(e.ZC,{label:c,placeholder:`Select ${c}`,selectDate:n?new Date(n):null,dateVar:y=>{Se(l,c,y.toDateString()||"")},isborderRequired:!0,width:"22em",clearDate:y=>{Se(l,c,y)},openUp:!0,backSpaceClearDate:!0},l);default:return null}}),V=a.useCallback(t=>{z(t),p?et(t):Ne(!1,t)},[p,et,Ne]),Vt=a.useCallback(()=>{if(T&&!p&&!k){z("Rx"),U();return}V("Rx")},[T,p,k,U,V]),qt=a.useCallback(()=>{if(T&&!p&&!k){z("Bill"),U();return}V("Bill")},[T,p,k,U,V]),Ut=a.useCallback(()=>{if(T&&!p&&!k){z("Appointment"),U();return}V("Appointment")},[T,p,k,U,V]);return a.useEffect(()=>{k&&I&&(V(I),z(null))},[k,I,V]),e.jsxRuntimeExports.jsx(at.Modal,{isOpen:G,onRequestClose:()=>{ee(),_()},shouldCloseOnOverlayClick:!1,style:{content:{zIndex:1030,padding:"0px",maxWidth:"840px",maxHeight:"624px",margin:"auto",borderRadius:"12px"},overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",zIndex:1030}},children:e.jsxRuntimeExports.jsxs("div",{id:"add-patient-modal",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-h-16 hfl-w-full hfl-flex-row hfl-items-center hfl-justify-between hfl-border-b-1 hfl-border-b-Gray-200 hfl-px-6",id:"add-patient-header","data-qa":"testid_addPatient",children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text xl",children:J?"Patient(s) with Same phone number or Email":"Add New Patient"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-items-center",children:e.jsxRuntimeExports.jsx("span",{className:"hx_close hfl-ml-4 hover:hfl-cursor-pointer",onClick:()=>{ee(),_()}})})]}),J?e.jsxRuntimeExports.jsx(Yt,{conflicts:O,handleAddPatient:Ne,redirectAction:I,manipulateExistingDOM:Lt}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-min-h-[400px] hfl-px-10 hfl-py-5",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between",children:[e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Patient Name*",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",prefix:e.jsxRuntimeExports.jsxs("div",{ref:ve,className:"-hfl-ml-2 hfl-flex hfl-w-16 hfl-items-center hfl-justify-between hfl-bg-Gray-50",onClick:()=>be(t=>!t),children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text md",className:"hfl-px-1 hfl-py-1 hfl-text-Gray-700",children:Me}),!Me.length&&e.jsxRuntimeExports.jsx("div",{className:`${Fe?"hx_up":"hx_down"} -hfl-mr-2`})]}),errorMsg:j.name?j.name:void 0,inputProps:{type:"text",value:ke,placeholder:"Enter Name",onChange:t=>{i("name",t.target.value)},onBlur:()=>{const t=!(s.name.length>0);s.name.length>0&&s.name.length<2&&!Et?u(l=>({...l,name:"Enter at least 2 letters "})):u(l=>({...l,name:t?"Enter the Name of the Patient":""})),He(!1),H({name:!1,phone:!1})}},start_icon:"hx_person",width:"16em"}),Fe&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-[1000] hfl-mt-[2px] hfl-flex hfl-h-[270px] hfl-w-20 hfl-flex-col hfl-overflow-y-auto hfl-rounded-lg hfl-border-1 hfl-border-Gray-300 hfl-bg-White",style:{boxShadow:"0px 24px 48px -12px rgba(16, 24, 40, 0.18)"},children:x.HonorificList.map(t=>e.jsxRuntimeExports.jsx(e.ki,{className:"hfl-text-Primary-700",label:t.label,onSelect:()=>{Ge(t.label),be(!1),je(t.gender),i("honorific",t.label),i("gender",t.gender),L(l=>({...l,gender:t.gender,honorific:t.label}))}}))}),ae.name&&ke.length>0&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-absolute hfl-z-[1000] hfl-mt-[2px] hfl-flex hfl-w-[350px] hfl-flex-col hfl-space-y-2 hfl-rounded-lg hfl-border-1 hfl-border-Gray-300 hfl-bg-White hfl-px-[16px] hfl-py-[10px]",style:{boxShadow:"0px 24px 48px -12px rgba(16, 24, 40, 0.18)"},ref:ie,children:[e.jsxRuntimeExports.jsx(e.bi,{className:"hfl-text-Primary-600",variant:"Regular",type:"Text md",children:"Existing Patients"}),re&&re?.slice(0,7)?.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-cursor-pointer hfl-items-center hfl-justify-between hfl-gap-[36px]",onMouseDown:()=>Je(t),children:[e.jsxRuntimeExports.jsxs(e.bi,{variant:"Regular",type:"Text md",className:"hfl-px-1 hfl-py-1 hfl-text-Gray-700",children:[t?.org_person_name?.length>13?t?.org_person_name?.substring(0,11)+"...":t?.org_person_name,`(${t.ageStr||h.calculateAge(t.age)}, ${h.getGender(parseInt(t.org_person_gender.toString()))})`]}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text sm",className:"hfl-text-Gray-500",children:t.org_person_phone||""})]},t?.person_role_id))]})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-end hfl-gap-3",children:e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:`Phone Number ${g&&g.phone_number_length?"*":""}`,labelColor:"hfl-text-Gray-600",labelSize:"Text sm",errorMsg:j.phone?j.phone:void 0,inputProps:{maxLength:10,value:A,placeholder:"Enter Number",onChange:t=>{i("phone",t.target.value.replace(/[^0-9]/g,""))},onBlur:()=>{const{isError:t=!1,msg:l=""}=g&&g.phone_number_length||A?h.validateMobileNo(A):{};u(r=>({...r,phone:t?l:""})),H({name:!1,phone:!1})}},width:"21em",start_icon:"hx_phone"}),ae.phone&&A.length>0&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-absolute hfl-z-[1000] hfl-mt-[2px] hfl-flex hfl-w-[350px] hfl-flex-col hfl-space-y-2 hfl-rounded-lg hfl-border-1 hfl-border-Gray-300 hfl-bg-White hfl-px-[24px] hfl-py-[10px]",style:{boxShadow:"0px 24px 48px -12px rgba(16, 24, 40, 0.18)"},ref:ie,children:[e.jsxRuntimeExports.jsx(e.bi,{className:"hfl-text-Primary-600",variant:"Regular",type:"Text md",children:"Existing Patients"}),re&&re?.slice(0,7)?.map(t=>e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-cursor-pointer hfl-items-center hfl-justify-between hfl-gap-[36px]",onMouseDown:()=>Je(t),children:[e.jsxRuntimeExports.jsxs(e.bi,{variant:"Regular",type:"Text md",className:"hfl-px-1 hfl-py-1 hfl-text-Gray-700",children:[t.org_person_name?.length>13?t.org_person_name?.substring(0,11)+"...":t.org_person_name,`(${t.ageStr||h.calculateAge(t.age)}, ${h.getGender(parseInt(t.org_person_gender.toString()))})`]}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text sm",className:"hfl-text-Gray-500",children:t.org_person_phone})]},t?.person_role_id))]})]})})]}),T&&!p&&qe&&e.jsxRuntimeExports.jsx(Kt,{isOpen:qe,onClose:()=>Re(!1),onSubmit:t=>Bt(t),optHeading:"Verify with a OTP",otpSubHeading:`Please enter the OTP shared on ${A}`,veriftButtonTitle:"Verify OTP",resendOtp:U,otpErrorMsg:"",setOtpErrorMsg:()=>{}}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-justify-between hfl-space-x-2 hfl-pt-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-h-[40px] hfl-space-y-1",children:[e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-pb-[1px] hfl-text-Gray-600",children:"Gender*"}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx(e.ju,{className:`!hfl-h-[40px] hfl-w-44 ${j.gender?"hfl-border-Error-300":""}`,options:[{label:"M",value:"0"},{label:"F",value:"1"},{label:"Other",value:"2"}],value:_t,onChange:t=>Ce(t),disabled:!1}),!!j.gender&&e.jsxRuntimeExports.jsx("div",{className:"hfl-font-inter hfl-text-1 hfl-font-inter-0 hfl-leading-10 hfl-tracking-1 hfl-text-Error-500",children:j.gender})]})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-space-x-1",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-space-y-2",children:e.jsxRuntimeExports.jsx(e.tj,{label:"Age or DOB*",className:"hfl-w-20",classNamedoubleInput:"hfl-relative",suffixClassName:"hfl-w-16 hfl-border-0",suffixDropdownClassName:"hfl-ml-[80px]",input1value:s.age,input2value:S,end_icon:"hx_down",errorMsg:j.age?j.age:void 0,inputProps:{type:"number",min:0,maxLength:3,placeholder:"Age",onChange:t=>{i("age",t.target.value.replace(/[^0-9]/g,"")),L(l=>({...l,dob:""}))},onBlur:()=>{u(t=>({...t,age:Z(S)}))}},onlySuffixDropdownItemsAllowed:!0,suffixInputProps:{placeholder:"Select format"},suffixOptions:[{label:"Years",value:"years"},{label:"Weeks",value:"weeks"},{label:"Months",value:"months"},{label:"Days",value:"days"}],handleValChange:t=>{i("age",t),u(l=>({...l,age:Z(S)}))},handleSuffixValChange:t=>{Le(t),u(l=>({...l,age:Z(t)}))},onSuffixDropdownClick:t=>{Le(t.label),L(l=>({...l,age_selector:t.value,dob:""})),u(l=>({...l,age:Z(t.value)}))}})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mt-[24px] hfl-space-y-1",children:e.jsxRuntimeExports.jsx(e.ZC,{className:"hfl-relative",placeholder:"DOB",width:"8em",height:"!hfl-h-[40px]",label:"",labelSize:"Text sm",labelColor:"hfl-text-Gray-700",selectDate:s?.dob&&h.isValidDate(new Date(s?.dob))?new Date(oe.dayjs(new Date(s?.dob)).format("DD-MMM-YYYY")):"",dateVar:t=>{L(l=>({...l,dob:oe.dayjs(t).format("YYYY-MM-DD"),age:""})),u(l=>({...l,age:""}))},isborderRequired:!0,maxDate:new Date})})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-space-y-1",children:e.jsxRuntimeExports.jsx(e.Ap,{value:{label:s?.patient_preferred_language?x.DefinedLanguages[s.patient_preferred_language]:"English"},placeholder:"English",label:"Preferred Language",onChange:t=>{i("patient_preferred_language",t.value)},options:Object.keys(x.DefinedLanguages).map(t=>({label:x.DefinedLanguages[t],value:t})),className:"!hfl-h-[40px] hfl-w-[200px]","data-qa":"dropdown-language"})})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-justify-between hfl-pb-6 hfl-pt-6",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-w-6/12 hfl-flex-col ",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"City",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.city,placeholder:"Enter City",onChange:t=>{i("city",t.target.value),ge(!0),St(t)},onBlur:t=>{t.stopPropagation(),ge(!1)}},width:23.5+"em"}),ut&&_e&&_e.length>0&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-10 hfl-mt-1 hfl-max-h-80 hfl-w-full hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Blue_gray-200 hfl-bg-Indigo-25 hfl-shadow-md ",children:_e.map(t=>e.jsxRuntimeExports.jsx(e.ki,{label:t,className:"hfl-text-Primary-700",onSelect:()=>wt(t)}))})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-pt-4",children:e.jsxRuntimeExports.jsx(e.Pi,{className:"hfl-mb-3",label:"Pin",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.pincode,placeholder:"Enter Pin",onChange:t=>{i("pincode",t.target.value)}},width:22.5+"em"})})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-h-full hfl-flex-col",style:{height:"100%"},children:e.jsxRuntimeExports.jsx(e.bu,{className:"hfl-w-[355px]",label:"Address",inputProps:{value:s?.address,placeholder:"Enter Address",onChange:t=>{i("address",t.target.value)}},isDynamicHeight:!0,"data-qa":"enter-address"})})]}),de?e.jsxRuntimeExports.jsx(Wt,{setEditPatient:se,editPatient:p,createAsNew:Y,setCreateAsNew:he}):e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}),Be?e.jsxRuntimeExports.jsxs("div",{className:"",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-stroke-Gray-200 hfl-stroke-1 hfl-pb-6",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx("span",{className:"hfl-absolute hfl-left-0 hfl-right-0 hfl-top-1/2 hfl-h-px hfl-bg-Gray-200"}),e.jsxRuntimeExports.jsx("span",{className:"hfl-relative hfl-bg-White hfl-px-4",children:e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text sm",className:"hfl-ml-2 hfl-inline hfl-bg-White hfl-text-Gray-400",children:"Marital Status"})})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-pt-4",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-space-x-1",children:[e.jsxRuntimeExports.jsx("div",{className:"hfl-space-y-2",children:e.jsxRuntimeExports.jsx(e.Ap,{value:{label:s.marital_status&&x.MARITAL_STATUS.find(t=>t===s.marital_status)||""},placeholder:"Marital Status",label:"Marital Status",onChange:t=>{i("marital_status",t.label)},options:x.MARITAL_STATUS.map(t=>({label:t,value:t})),className:"!hfl-h-[40px] hfl-w-[200px]","data-qa":"marital-status"})}),e.jsxRuntimeExports.jsx("div",{className:"hfl-mt-[24px] hfl-flex hfl-space-y-2",children:e.jsxRuntimeExports.jsx(e.ZC,{className:"hfl-relative",placeholder:"Since",width:"8em",height:"!hfl-h-[40px]",label:"",labelSize:"Text sm",labelColor:"hfl-text-Gray-700",selectDate:s?.married_since&&h.isValidDate(new Date(s?.married_since))?new Date(oe.dayjs(new Date(s?.married_since)).format("DD-MMM-YYYY")):"",dateVar:t=>{L(l=>({...l,married_since:oe.dayjs(t).format("YYYY-MM-DD")}))},isborderRequired:!0,maxDate:new Date})})]}),e.jsxRuntimeExports.jsx(e.Ap,{label:"Blood Group",placeholder:"Enter blood group",value:{label:s.blood_group&&x.bloodGroups.find(t=>t.value===s.blood_group)?.label||"Blood group"},onChange:t=>{i("blood_group",t.value)},options:x.bloodGroups,className:"!hfl-h-11 hfl-w-[370px]","data-qa":"blood-group"})]}),s?.marital_status!==x.MARITAL_STATUS[0]&&e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-pt-4",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Spouse Name",start_icon:"hx_person",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s.spouse_name,placeholder:"Enter Spouse Name",onChange:t=>{i("spouse_name",t.target.value)}},width:"21em"}),e.jsxRuntimeExports.jsx(e.Ap,{label:"Spouse Blood Group",placeholder:"Enter blood group",value:{label:s.spouse_blood_group?x.bloodGroups.find(t=>t.value===s.spouse_blood_group)?.label||"Spouse Blood group":"Blood group"},onChange:t=>{i("spouse_blood_group",t.value)},options:x.bloodGroups,className:"!hfl-h-11 hfl-w-[370px]","data-qa":"blood-group"})]})]}),e.jsxRuntimeExports.jsx(lt,{}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between hfl-pt-6",children:e.jsxRuntimeExports.jsx(e.tj,{classNameDatePicker:"hfl-relative",classNamedoubleInput:"hfl-relative",label:"Referred By",input1value:s.ref_doc_name,input2value:s.ref_doc_spec,end_icon:"hx_down",inputProps:{placeholder:"Doctor Name"},suffixInputProps:{placeholder:"Speciality"},className:"hfl-w-48",suffixClassName:"hfl-w-[100px]",suffixDropdownClassName:"hfl-ml-[160px]",options:mt,suffixOptions:x.SpecialityList,handleValChange:t=>{i("ref_doc_name",t)},handleSuffixValChange:t=>{i("ref_doc_spec",t.value)},onDropdownClick:t=>{i("ref_doc_name",t.doctor_name),i("refDocId",t.doctor_id),i("ref_doc_spec",t.specialist)},onSuffixDropdownClick:t=>{i("ref_doc_spec",t.value)}})}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-justify-between hfl-pb-6 hfl-pt-4",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Existing ID (if any)",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.existingBidStr,placeholder:"Enter ID",onChange:t=>{i("existingBidStr",t.target.value)}},width:"23em"}),e.jsxRuntimeExports.jsx(e.Pi,{label:"Email",showEmailSuggestions:!0,labelColor:"hfl-text-Gray-600",errorMsg:j.email?j.email:void 0,labelSize:"Text sm",start_icon:"hx_mail",inputProps:{value:s.email,placeholder:"Enter Email",onChange:t=>{i("email",t.target.value.trim())},onBlur:t=>{t.target.value&&!st.create$6().email().isValidSync(t.target.value)?u(l=>({...l,email:"Email format is wrong"})):u(l=>({...l,email:""}))}},width:20.5+"em"})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-inline-flex hfl-flex-row hfl-flex-wrap hfl-justify-between hfl-gap-y-6 hfl-py-6",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-1 hfl-flex-row hfl-justify-between",children:[e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Channel (How did the patient hear about you?)",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.throughChannel,placeholder:"Enter Channel",onChange:t=>{i("throughChannel",t.target.value),xe(!0),Pt(t)},onBlur:t=>{t.stopPropagation(),xe(!1)}},width:"22em"}),ft&&ce&&ce.length>0&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-10 hfl-mt-1 hfl-max-h-80 hfl-w-full hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Blue_gray-200 hfl-bg-Indigo-25 hfl-shadow-md ",children:ce.map(t=>{const{title:l,...r}=t;return e.jsxRuntimeExports.jsx(e.ki,{label:l,className:"hfl-text-Primary-700",...r,onSelect:()=>vt({value:t.value})},t.value)})})]}),e.jsxRuntimeExports.jsx(e.Pi,{label:"C/O",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.careOf,placeholder:"Enter C/O",onChange:t=>{i("careOf",t.target.value)}},width:"22em"})]}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-relative",children:[e.jsxRuntimeExports.jsx(e.Pi,{label:"Occupation",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s?.occupation,placeholder:"Enter Occupation",onChange:t=>{i("occupation",t.target.value),me(!0),Nt(t)},onBlur:t=>{t.stopPropagation(),me(!1)}},width:"22em"}),ct&&ue&&ue.length>0&&e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-10 hfl-mt-1 hfl-max-h-80 hfl-w-full hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Blue_gray-200 hfl-bg-Indigo-25 hfl-shadow-md ",children:ue.map(t=>e.jsxRuntimeExports.jsx(e.ki,{label:t,className:"hfl-text-Primary-700",onSelect:()=>Ct(t)}))})]}),e.jsxRuntimeExports.jsx(e.Pi,{label:"Tag",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s.tag,placeholder:"Enter Tag",onChange:t=>{i("tag",t.target.value)}},width:"22em"}),e.jsxRuntimeExports.jsx(e.Pi,{label:"Mobile 2",labelColor:"hfl-text-Gray-600",labelSize:"Text sm",inputProps:{value:s.phoneSecondary,maxLength:10,placeholder:"Enter Secondary Number",onChange:t=>{i("phoneSecondary",t.target.value.replace(/[^0-9]/g,""))}},width:"22em"}),e.jsxRuntimeExports.jsx(e.Pi,{label:"Aadhar Number",labelColor:"hfl-text-Gray-600",errorMsg:j.aadhar_number?j.aadhar_number:void 0,labelSize:"Text sm",inputProps:{value:s.aadhar_number,placeholder:"Aadhar Card Number",maxLength:12,onChange:t=>{i("aadhar_number",t.target.value)},onBlur:()=>{u(t=>({...t,aadhar_number:s.aadhar_number&&s.aadhar_number.length!=12?"Please enter 12 digit aadhar number":""}))}},width:"22em"}),e.jsxRuntimeExports.jsx("div",{className:"hfl-grid hfl-grid-cols-2 hfl-gap-x-11 hfl-gap-y-6",children:Ht()})]}),e.jsxRuntimeExports.jsx(lt,{}),e.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-col hfl-items-start hfl-justify-start hfl-pt-3",children:e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-h-[153px] hfl-w-[200px] hfl-items-center hfl-justify-center
|
|
2
|
-
hfl-rounded-3xl hfl-border-4
|
|
3
|
-
hfl-border-White hfl-bg-Primary-50 hfl-shadow-lg`,children:[e.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-flex-col hfl-items-center hfl-justify-between
|
|
4
|
-
${Te?"":"hfl-hidden"}`,children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Camera",className:"hfl-mb-2",onClick:Mt,icon:"Left",iconFile:"hx_camera"}),e.jsxRuntimeExports.jsxs("div",{children:[e.jsxRuntimeExports.jsx("input",{id:"upload-local-file",type:"file",style:{display:"none"},accept:"image/*",onChange:It}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",size:"lg",textField:"Upload",icon:"Left",iconFile:"hx_image-add",onClick:Ft})]})]}),e.jsxRuntimeExports.jsxs("div",{className:`hfl-relative hfl-flex
|
|
5
|
-
${ze?"":"hfl-hidden"}`,children:[e.jsxRuntimeExports.jsx("canvas",{ref:Ie,style:{display:"none"}}),e.jsxRuntimeExports.jsx("video",{ref:q,className:"hfl-object-fit hfl-h-full hfl-w-full hfl-rounded-3xl",autoPlay:!0}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-absolute hfl-bottom-0 hfl-left-0 hfl-right-0 hfl-flex hfl-justify-around",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Cancel",className:"hfl-mb-2 hfl-bg-Error-600 hover:hfl-bg-Error-700",onClick:tt}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Primary",size:"lg",textField:"Capture",className:"hfl-mb-2 hfl-bg-Primary-600",onClick:Gt})]})]}),e.jsxRuntimeExports.jsx("div",{className:Te||P||ze?"hfl-hidden":"",onClick:()=>{Ee(!0),K(!0)},"data-qa":"profile-img",children:e.jsxRuntimeExports.jsxs("svg",{width:"76",height:"72",viewBox:"0 0 76 72",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxRuntimeExports.jsx("path",{opacity:"0.4",d:"M75.375 26.0477V57.1667C75.6016 59.1092 75.3857 61.0778 74.7434 62.925C74.1011 64.7722 73.0491 66.4501 71.6663 67.8329C70.2834 69.2158 68.6055 70.2678 66.7583 70.9101C64.9111 71.5524 62.9425 71.7683 61 71.5417H15C13.0575 71.7683 11.0889 71.5524 9.2417 70.9101C7.3945 70.2678 5.71661 69.2158 4.33373 67.8329C2.95086 66.4501 1.89887 64.7722 1.25659 62.925C0.614305 61.0778 0.398381 59.1092 0.624996 57.1667V18.8333C0.398381 16.8908 0.614305 14.9222 1.25659 13.075C1.89887 11.2278 2.95086 9.54994 4.33373 8.16707C5.71661 6.7842 7.3945 5.73221 9.2417 5.08992C11.0889 4.44764 13.0575 4.23172 15 4.45833H48.7333C48.9029 4.46277 49.0695 4.50469 49.221 4.58109C49.3725 4.65748 49.5052 4.76645 49.6096 4.90019C49.7141 5.03393 49.7876 5.18911 49.825 5.35462C49.8624 5.52013 49.8626 5.69187 49.8258 5.8575C48.9214 10.3365 49.831 14.9913 52.355 18.8004C54.879 22.6094 58.8112 25.2613 63.2885 26.1742C66.8321 26.8826 70.5088 26.4602 73.7995 24.9667C73.975 24.8968 74.1649 24.8712 74.3526 24.8921C74.5403 24.9131 74.72 24.9799 74.8757 25.0868C75.0314 25.1936 75.1584 25.3372 75.2455 25.5048C75.3326 25.6724 75.3771 25.8588 75.375 26.0477Z",fill:"#396CE8"}),e.jsxRuntimeExports.jsx("path",{d:"M69.2877 46.2877L52.2217 29.2217C51.4989 28.5016 50.5202 28.0973 49.5 28.0973C48.4798 28.0973 47.5011 28.5016 46.7783 29.2217L27.8417 48.1583C27.4834 48.5095 27.0017 48.7062 26.5 48.7062C25.9983 48.7062 25.5166 48.5095 25.1583 48.1583L21.555 44.555C20.8322 43.835 19.8536 43.4307 18.8333 43.4307C17.8131 43.4307 16.8344 43.835 16.1117 44.555L6.71233 53.9543C6.49661 54.1698 6.37527 54.4621 6.375 54.767V57.1667C6.375 63.2233 8.94333 65.7917 15 65.7917H61C67.0567 65.7917 69.625 63.2233 69.625 57.1667V47.1003C69.6247 46.7954 69.5034 46.5031 69.2877 46.2877Z",fill:"#396CE8"}),e.jsxRuntimeExports.jsx("path",{d:"M22.6667 31.2917C22.0374 31.2939 21.4139 31.1722 20.8317 30.9335C20.2494 30.6948 19.7199 30.3438 19.2734 29.9004C18.3715 29.005 17.8623 27.7881 17.8577 26.5172C17.8532 25.2464 18.3536 24.0258 19.249 23.124C20.1444 22.2221 21.3613 21.7129 22.6322 21.7083H22.6667C23.9375 21.7083 25.1563 22.2132 26.0549 23.1118C26.9535 24.0104 27.4583 25.2292 27.4583 26.5C27.4583 27.7708 26.9535 28.9896 26.0549 29.8882C25.1563 30.7868 23.9375 31.2917 22.6667 31.2917Z",fill:"#396CE8"}),e.jsxRuntimeExports.jsx("path",{d:"M74.5317 7.21833L68.7817 1.46833C68.2421 0.930873 67.5116 0.629108 66.75 0.629108C65.9884 0.629108 65.2579 0.930873 64.7183 1.46833L58.9683 7.21833C58.4605 7.76333 58.184 8.48418 58.1972 9.229C58.2103 9.97382 58.512 10.6845 59.0388 11.2112C59.5655 11.738 60.2762 12.0397 61.021 12.0528C61.7658 12.066 62.4867 11.7895 63.0317 11.2817L63.875 10.4422V18.8333C63.875 19.5958 64.1779 20.3271 64.7171 20.8663C65.2562 21.4054 65.9875 21.7083 66.75 21.7083C67.5125 21.7083 68.2438 21.4054 68.7829 20.8663C69.3221 20.3271 69.625 19.5958 69.625 18.8333V10.4422L70.4683 11.2817C71.0133 11.7895 71.7342 12.066 72.479 12.0528C73.2238 12.0397 73.9345 11.738 74.4612 11.2112C74.988 10.6845 75.2897 9.97382 75.3028 9.229C75.316 8.48418 75.0395 7.76333 74.5317 7.21833Z",fill:"#396CE8"})]})}),e.jsxRuntimeExports.jsxs("div",{className:`hfl-relative hfl-h-full hfl-w-full
|
|
6
|
-
${P?"":"hfl-hidden"}`,children:[e.jsxRuntimeExports.jsx("img",{src:P,alt:"ProfilePicturePreview",className:"hfl-h-full hfl-w-full hfl-rounded-3xl hfl-object-cover"}),e.jsxRuntimeExports.jsx("div",{className:`hfl-absolute hfl-right-2 hfl-top-2 hfl-flex hfl-h-[40px]
|
|
7
|
-
hfl-w-[40px] hfl-cursor-pointer hfl-items-center hfl-justify-center hfl-rounded-full hfl-bg-White`,onClick:()=>{Ee(!0),tt()},children:e.jsxRuntimeExports.jsx("i",{className:"hx_delete hfl-text-[22px]"})})]})]})})]}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-row hfl-items-center hfl-justify-center",children:[e.jsxRuntimeExports.jsxs(e.bi,{variant:"Regular",type:"Text md",children:["If you want to add more details,"," "]}),e.jsxRuntimeExports.jsx(e.bi,{variant:"Medium",type:"Text md",className:"hfl-cursor-pointer hfl-text-Primary-700",onClick:()=>{Oe(!0)},children:"Click Here"})]})]}),e.jsxRuntimeExports.jsx("div",{className:`${Be?"":"hfl-flex hfl-w-full"} hfl-sticky hfl-bottom-0 hfl-bg-White`,children:J?e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{}):e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-h-[118px] hfl-w-full hfl-flex-col hfl-items-center hfl-justify-center hfl-gap-1",style:{boxShadow:"-3px -1px 4px rgba(0, 0, 0, 0.25)"},children:[window.location?.href.indexOf("/frontdesk")==-1&&e.jsxRuntimeExports.jsx(e.Ku,{disabled:yt,hierarchy:"Primary",size:"sm",textField:"Add & Create Rx",className:"hfl-bg-Primary-600",onClick:Vt}),e.jsxRuntimeExports.jsx("div",{children:window.location?.href.indexOf("/frontdesk")==-1&&e.jsxRuntimeExports.jsx(e.bi,{variant:"Regular",type:"Text sm",children:"or"})}),e.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-start hfl-gap-2",children:[e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",size:"sm",textField:"Add & Create Bill",className:"hfl-w-[190px] hfl-flex-1 hfl-justify-center hfl-text-Primary-700",onClick:qt}),e.jsxRuntimeExports.jsx(e.Ku,{hierarchy:"Secondary",size:"sm",textField:"Add & Create Appointment",className:"hfl-w-[190px] hfl-flex-1 hfl-justify-center hfl-text-Primary-700",onClick:Ut})]}),e.jsxRuntimeExports.jsx("div",{className:"hfl-absolute hfl-z-[100]",children:e.jsxRuntimeExports.jsx(e.qh,{toastList:jt})})]})})]})})};exports.PatientAddEdit=Zt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const t=require("./index-D5vZvm7Z.cjs"),s=require("react"),J=require("./APIAction-BgGlVURt.cjs"),V=require("./useMediaQuery-D4SIgdMW.cjs"),f=require("./common-utils-yiZUv58F.cjs"),X=Math.abs(window.orientation||0)===90,Y=k=>{const{addPatientHandler:C,disabled:x,manipulateExistingDOM:D,onPatientSelect:y,showSearchBar:A,setShowSearchBar:a,variable:T,hideUpcomingAppnts:d=!1}=k,{window_var:o,token:v,envName:E}=T,[h,p]=s.useState(!1),u=s.useRef(null),m=s.useRef(null),[G,L]=s.useState(0),[U,l]=s.useState([]),F=6,[b,R]=s.useState(""),[B,O]=s.useState([]),[$,S]=s.useState(d),[q,N]=s.useState([]),c=V.useMediaQuery("(max-width: 1024px)"),_=(e,n,r,i)=>{O([{id:1,title:e,description:n,type:r,duration:i}])},g=s.useCallback(async e=>{try{const n={branch_id:o?.org_branch_id_for_seg||"",doctor_id:o?.person_id_for_seg||"",doctor_role_id:o?.doctor_role_id_for_seg||"",term:encodeURIComponent(e),limit:30},r=await J.getPatientList(n,{envName:E,token:v});if(!r){l([]),_("Error","No response received from server","Error",3e3);return}const i=r,P=window.filteredUpcomingAppts||[];if(i.apiError){l([]),_("Error",i.apiError,"Error",3e3);return}i?.persons?.length?(l(i.persons),p(!0),L(Number(i.total_persons))):l([]),P?.length&&!d?(S(!1),N(P.slice(0,5))):(S(!0),N([]))}catch(n){console.error(n),_("Error","Something went wrong while fetching patients","Error",3e3)}},[E,v,o?.doctor_role_id_for_seg,o?.org_branch_id_for_seg,o?.person_id_for_seg,d]),z=s.useMemo(()=>f.debounceFn(e=>{g(e)},500),[g]),H=e=>{const n=e.currentTarget.value.trim();(!isNaN(Number(n.charAt(0)))||n.length>=2)&&z(n)},M=()=>{h||g(b)},Q=()=>{x||p(e=>!e)},j=s.useCallback(e=>{m.current&&h&&!m.current.contains(e.target)&&(p(!1),l([]))},[h]);s.useEffect(()=>(document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)),[j,h]);const I=e=>{window.location.href.indexOf("/frontdesk")!==-1?window.patientPopupHandlerFromFD(e.patient_role_id,e.patient_person_id):f.goToPage(`viewPatientDashboard.php?pid=${e.patient_role_id}`)},K=async e=>{let n=!0;if(typeof window.beforePatientChange=="function"&&window.location.pathname==f.EAPP_ROUTES.visitpad&&(n=window.beforePatientChange()),p(!1),l([]),!n)return;if(y){y(e);return}window.patient_role_id=e.person_role_id!=="0"?e.person_role_id.toString():"0",window.patient_person_id=e.person_id!=="0"?e.person_id.toString():"0";const r=(e.person_role_id==="0",e.person_role_id);if(r&&(D?.(),window.location.href.indexOf("/frontdesk")!==-1)){window.patientPopupHandlerFromFD(r,e.person_id);return}f.goToPage(`viewPatientDashboard.php?pid=${r}`)},W=()=>{Q(),C(),R("")},w=s.useCallback(e=>{u.current&&!u.current.contains(e.target)&&c&&a(!1)},[c,a]);return s.useEffect(()=>(document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)),[w]),t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[A?t.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-items-center hfl-justify-center hfl-rounded-full hfl-bg-Blue-900 hfl-text-1 hfl-text-White ${x?"hfl-pointer-events-none hfl-opacity-60":""}`,title:x?"Low internet speed. Feature available only in online mode":"Search Patient",children:[t.jsxRuntimeExports.jsx("input",{ref:u,type:"text",placeholder:"Search Patient 🔍",className:`hfl-rounded-full hfl-border-none hfl-bg-Blue-900 hfl-py-2 hfl-pl-4 ${c&&!X?"xxs:hfl-w-[400px]":"hfl-min-w-[150px]"} sm:hfl-w-full`,"data-qa":"testid_patientSearch",value:b,onKeyUp:H,onChange:e=>R(e.target.value),onClick:M,onBlur:()=>c&&a(!1)}),c&&t.jsxRuntimeExports.jsx("div",{className:"hx_close hfl-cursor-pointer hfl-pr-4",onClick:()=>a(e=>!e)})]}):t.jsxRuntimeExports.jsxs("div",{onClick:()=>a(e=>!e),className:"hfl-flex hfl-cursor-pointer hfl-flex-col hfl-items-center xs:hfl-mr-1 md:hfl-mr-0",children:[t.jsxRuntimeExports.jsx("i",{className:"hx_search",style:{fontSize:"18px"}}),t.jsxRuntimeExports.jsx(t.bi,{variant:"Regular",type:"Text md",children:"Search"})]}),t.jsxRuntimeExports.jsx(t.qh,{toastList:B}),t.jsxRuntimeExports.jsxs("div",{ref:m,className:`hfl-absolute hfl-right-[255px] hfl-top-[50px] hfl-max-h-[400px] hfl-w-[430px] hfl-min-w-[430px] hfl-overflow-y-auto hfl-rounded-lg hfl-border hfl-border-Gray-300 hfl-bg-White hfl-text-Gray-700 hfl-shadow-md ${h?"hfl-block":"hfl-hidden"}`,children:[!$&&t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col",children:[t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-py-[10px] ",children:[t.jsxRuntimeExports.jsx(t.bi,{className:"hfl-px-[12px] hfl-text-Gray-400",variant:"Semibold",type:"Text xs",children:"Upcoming Appointments"}),t.jsxRuntimeExports.jsx("a",{href:"viewPatientAppointments.php",children:t.jsxRuntimeExports.jsx("i",{className:"hx_r-open hfl-text-Primary-700"})})]}),q?.map((e,n)=>t.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-cursor-pointer hfl-justify-between hfl-px-[12px] hfl-py-[4px] hover:hfl-bg-Blue_gray-200 ${n%2===1?"":"hfl-bg-Gray-100"}`,onClick:()=>I(e),children:[t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-min-w-[92px] hfl-items-center hfl-justify-center hfl-rounded-lg hfl-border hfl-border-Gray-100 hfl-bg-White_20 hfl-p-2",children:t.jsxRuntimeExports.jsx(t.bi,{className:"hfl-whitespace-nowrap hfl-text-Gray-500",variant:"Regular",type:"Text lg",children:e.appnt_time})}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-px-3",children:[t.jsxRuntimeExports.jsx(t.bi,{variant:"Regular",type:"Text md",className:"hfl-text-Gray-700",children:e.org_person_name}),t.jsxRuntimeExports.jsx(t.bi,{variant:"Regular",type:"Text sm",className:"hfl-text-Gray-500",children:e.org_person_phone})]}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-items-center",children:t.jsxRuntimeExports.jsx("i",{className:"hx_play-filled hfl-text-Gray-300"})})]},e.patient_role_id))]}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col",children:[t.jsxRuntimeExports.jsx(t.bi,{style:{fontSize:"14px"},variant:"Semibold",type:"Text sm",className:"hfl-px-[12px] hfl-py-[8px] hfl-text-Primary-600",children:"Patients List"}),t.jsxRuntimeExports.jsx("div",{className:"hfl-max-h-[40vh] hfl-overflow-y-auto hfl-overflow hfl-scrollbar-hide",children:U?.map((e,n)=>t.jsxRuntimeExports.jsxs("div",{className:`hfl-cursor-pointer hfl-px-[11px] hfl-py-[12px] hfl-leading-9 hover:hfl-bg-Blue_gray-200 ${n%2===1?"":"hfl-bg-Gray-100"}`,onClick:()=>K(e),children:[t.jsxRuntimeExports.jsx(t.bi,{variant:"Regular",type:"Text sm",className:"hfl-inline hfl-uppercase hfl-text-Gray-700",style:{fontSize:"14px"},children:e.org_person_bid_str?e.org_person_bid_str+": ":""}),t.jsxRuntimeExports.jsxs(t.bi,{variant:"Medium",type:"Text sm",className:" hfl-inline hfl-capitalize hfl-text-Gray-700",style:{fontSize:"14px"},children:[e.org_person_name," ",t.jsxRuntimeExports.jsxs("div",{className:"hfl-inline-block",children:["(",e.ageStr.split(" ")[0],", ",f.getGender(Number(e.org_person_gender)),")"]})," "]}),t.jsxRuntimeExports.jsx(t.bi,{variant:"Regular",type:"Text sm",className:"hfl-inline-block hfl-text-Gray-700",style:{fontSize:"14px"},children:e.org_person_phone?`Ph: ${e.org_person_phone}`:""})]},e.person_role_id))})]}),G<F&&t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-justify-center",id:"newPatientAdd",children:t.jsxRuntimeExports.jsx(t.Ku,{hierarchy:"Secondary",icon:"Left",iconFile:"hx_add",onClick:W,size:"lg",textField:"Create New Patient",className:"hfl-flex hfl-w-full hfl-justify-center"})})]})]})};exports.SearchPatients=Y;
|