try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fc4ecb5e-9fc7-4470-9420-fab9d009c539",e._sentryDebugIdIdentifier="sentry-dbid-fc4ecb5e-9fc7-4470-9420-fab9d009c539")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5946],{71462:function(e,t,r){r.d(t,{Z:function(){return f}});var n=r(57437),i=r(70286),s=r(66648),o=r(87138),l=r(16463),c=r(10458),a=r(76164),d=r(2265),u=r(57029);function f(){let e=(0,l.usePathname)(),[t,r]=(0,d.useState)(!1);function f(){window.innerWidth>=640&&r(!1)}return(0,d.useEffect)(()=>(window.addEventListener("resize",f),f(),()=>{window.removeEventListener("resize",f)}),[]),(0,n.jsxs)("header",{className:"flex h-[88px] w-full items-center justify-between px-10 py-6 max-sm:pl-2 max-sm:pr-3",children:[(0,n.jsx)(o.default,{href:i._j.HOME,className:"w-[92px]",children:(0,n.jsx)(s.default,{src:"/images/meto.png",alt:"Meto",className:"w-full",width:0,height:0,priority:!0,unoptimized:!0})}),e===i._j.SIGNUP?(0,n.jsxs)("div",{className:"flex items-center gap-4",children:[(0,n.jsx)("p",{className:"text-sm max-sm:hidden",children:"Already have an account?"}),(0,n.jsx)(o.default,{href:i._j.HOME,className:"flex h-10 items-center justify-center rounded-2xl border border-metoBlack px-4 text-sm hover:bg-metoGrey100 max-sm:hidden",children:"Log in"}),(0,n.jsx)(u.Button,{onClick:()=>r(!t),className:"hidden p-3 hover:bg-metoGrey100 max-sm:block",children:(0,n.jsx)(c.J4,{closed:!1})}),(0,n.jsx)(a.Z,{onClose:()=>r(!t),visible:t,containerClass:"max-w-[640px] w-full",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"flex w-full justify-end",children:(0,n.jsx)(u.Button,{onClick:()=>r(!t),className:"relative right-[13px] top-[18px] p-3 hover:bg-metoGrey100",children:(0,n.jsx)(c.J4,{closed:!0})})}),(0,n.jsxs)("div",{className:"mt-4 flex w-full flex-col items-center gap-4 p-4",children:[(0,n.jsx)("p",{className:"text-sm",children:"Already have an account?"}),(0,n.jsx)(o.default,{href:i._j.HOME,className:"flex h-10 w-full max-w-[300px] items-center justify-center rounded-2xl border border-metoBlack px-4 text-sm hover:bg-metoGrey100",children:"Log in"})]})]})})]}):(0,n.jsxs)("div",{className:"flex items-center gap-4",children:[(0,n.jsx)("p",{className:"text-sm max-sm:hidden",children:"Don’t have an account?"}),(0,n.jsx)(o.default,{href:i._j.SIGNUP,className:"flex h-10 items-center justify-center rounded-2xl border border-metoBlack px-4 text-sm hover:bg-metoGrey100 max-sm:hidden",children:"Sign up"}),(0,n.jsx)(u.Button,{onClick:()=>r(!t),className:"hidden p-3 hover:bg-metoGrey100 max-sm:block",children:(0,n.jsx)(c.J4,{closed:!1})}),(0,n.jsx)(a.Z,{onClose:()=>r(!t),visible:t,containerClass:"max-w-[640px] w-full",children:(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"flex w-full justify-end",children:(0,n.jsx)(u.Button,{onClick:()=>r(!t),className:"relative right-[13px] top-[18px] p-3 hover:bg-metoGrey100",children:(0,n.jsx)(c.J4,{closed:!0})})}),(0,n.jsxs)("div",{className:"mt-4 flex w-full flex-col items-center gap-4 p-4",children:[(0,n.jsx)("p",{className:"text-sm",children:"Don’t have an account?"}),(0,n.jsx)(o.default,{href:i._j.SIGNUP,className:"flex h-10 w-full max-w-[300px] items-center justify-center rounded-2xl border border-metoBlack px-4 text-sm hover:bg-metoGrey100",children:"Sign up"})]})]})})]})]})}},61575:function(e,t,r){r.d(t,{Z:function(){return i}});var n=r(57437);function i(e){let{text:t="Loading...",containerClass:r="",init:i=!1}=e;return(0,n.jsx)("div",{className:"flex items-center justify-center space-x-1 p-6 text-sm text-gray-700 ".concat(r),children:i?(0,n.jsx)("span",{className:"icon-[svg-spinners--90-ring-with-bg] text-[3rem]"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("svg",{fill:"none",className:"h-6 w-6 animate-spin",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{clipRule:"evenodd",d:"M15.165 8.53a.5.5 0 01-.404.58A7 7 0 1023 16a.5.5 0 011 0 8 8 0 11-9.416-7.874.5.5 0 01.58.404z",fill:"currentColor",fillRule:"evenodd"})}),(0,n.jsx)("div",{children:t})]})})}},76164:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(57437),i=r(2265),s=r(95127),o=r(9749);function l(e){let{children:t,visible:r,containerClass:l,onClose:c}=e;return(0,i.useEffect)(()=>{r?document.body.classList.add("overflow-y-hidden"):document.body.classList.remove("overflow-y-hidden")},[r]),(0,i.useEffect)(()=>()=>{document.body.classList.remove("overflow-y-hidden")},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.M,{children:r&&(0,n.jsx)(o.E.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.3},className:"fixed inset-y-0 right-0 z-[9998] overflow-y-auto bg-white shadow-lg ".concat(l),children:t})}),(0,n.jsx)(s.M,{children:r&&(0,n.jsx)(o.E.div,{onClick:()=>null==c?void 0:c(),initial:{opacity:0},animate:{opacity:.5},exit:{opacity:0},transition:{duration:.3},className:"fixed inset-0 z-40 bg-metoBlack/20"})})]})}},19840:function(e,t,r){r.d(t,{b:function(){return h},k:function(){return x}});var n=r(57437),i=r(2265),s=r(16463),o=r(61575),l=r(84604),c=r(65905),a=r(70286);let d=e=>(e||"").replace(/\/$/,""),u=e=>d(e)===d(a._j.HOME),f=e=>d(e)===d(a._j.SUBSCRIBE_ME),m=e=>d(e)===d(a._j.SIGNUP);function p(e,t){let r=!!(null==e?void 0:e.is_new_user),n=!!(null==e?void 0:e.EmailVerified)||t,i=!!(null==e?void 0:e.OnboardingStatus)||t,s=r?!!(null==e?void 0:e.OnboardingProfileStatus):t;return{isNewUser:r,emailVerified:n,completedIntro:i,completedOnboarding:s,mustOnboard:r&&!s}}function h(e){return function(t){var r,h;let x=(0,c.ZZ)(),{user:E,getUser:S,coreProfile:R}=(0,l.a)(),j=(0,s.usePathname)(),[N,I]=(0,i.useState)(!0);(0,i.useEffect)(()=>{!async function(){x.medplum.isLoading()||(x.profile&&!E&&await S(),I(!1))}()},[x.medplum,x.profile,E,S]);let v=!!(null===(r=x.profile)||void 0===r?void 0:r.active),{emailVerified:g,completedIntro:O,mustOnboard:_,completedOnboarding:w}=p(E||{},v),C=!(null===(h=null==R?void 0:R.is_premium_user)||void 0===h||h)&&w;return((0,i.useEffect)(()=>{if(N)return;let e=sessionStorage.getItem("@verificationcode")||"",t=sessionStorage.getItem("@redirectUrl");if(x.profile&&E){if(t&&C&&!u(j)&&!f(j)&&!m(j)&&d(j)!==d(t)){(0,s.redirect)(t);return}if(!g){(0,s.redirect)(e?"".concat(a._j.VERIFY,"?code=").concat(e):a._j.VERIFY);return}if(!O){(0,s.redirect)(a._j.INTRO);return}if(!v){(0,s.redirect)(a._j.INTRO_SUCCESS);return}if(_){(0,s.redirect)(a._j.ONBOARDING);return}if(C&&!(u(j)||f(j)||m(j))){(0,s.redirect)(a._j.SUBSCRIBE_ME);return}if(!u(j)){(0,s.redirect)(a._j.DASHBOARD);return}!C&&f(j)&&(0,s.redirect)(a._j.DASHBOARD)}},[N,x.profile,E,j,g,O,v,_,C,w]),N)?(0,n.jsx)(o.Z,{}):(0,n.jsx)(e,{...t})}}function x(e){return function(t){var r,h;let x=(0,s.useSearchParams)(),E=(0,s.usePathname)(),S=(0,c.ZZ)(),{user:R,getUser:j,coreProfile:N}=(0,l.a)(),[I,v]=(0,i.useState)(!0);(0,i.useEffect)(()=>{let e=x.get("code");if(e&&sessionStorage.setItem("@verificationcode",e),d(E).startsWith(d(a._j.SUBSCRIPTIONS))||f(E)){let e=x.toString()?"".concat(E,"?").concat(x.toString()):E;sessionStorage.setItem("@redirectUrl",e)}!async function(){if(!S.medplum.isLoading()){if(!S.profile){(0,s.redirect)(a._j.HOME);return}R||await j(),v(!1)}}()},[S.medplum,S.profile,x,E,R,j]);let g=!!(null===(r=S.profile)||void 0===r?void 0:r.active),{emailVerified:O,completedIntro:_,mustOnboard:w,completedOnboarding:C}=p(R||{},g),b=!(null===(h=null==N?void 0:N.is_premium_user)||void 0===h||h)&&C,y=a.LO.includes(E)&&!f(E),A=a.SD.includes(E);return((0,i.useEffect)(()=>{if(I)return;let e=sessionStorage.getItem("@redirectUrl");if(e&&b&&!u(E)&&!f(E)&&!m(E)&&d(E)!==d(e)){(0,s.redirect)(e);return}if(!O&&E!==a._j.VERIFY){(0,s.redirect)(a._j.VERIFY);return}if(O&&!_&&E!==a._j.INTRO){(0,s.redirect)(a._j.INTRO);return}if(!g&&E!==a._j.INTRO_SUCCESS){(0,s.redirect)(a._j.INTRO_SUCCESS);return}if(g&&w&&!y){(0,s.redirect)(a._j.ONBOARDING);return}if(b&&!(u(E)||f(E)||m(E))){(0,s.redirect)(a._j.SUBSCRIBE_ME);return}if(g&&C&&y||g&&C&&!A&&!u(E)&&!f(E)&&!m(E)){(0,s.redirect)(a._j.DASHBOARD);return}!b&&f(E)&&(0,s.redirect)(a._j.DASHBOARD)},[I,E,b,O,_,g,w,C,y,A]),I)?(0,n.jsx)(o.Z,{}):(0,n.jsx)(e,{...t})}}},70286:function(e,t,r){r.d(t,{LO:function(){return i},SD:function(){return s},_j:function(){return n}});let n={HOME:"/signin/",SIGNUP:"/signup/",FORGOT_PASSWORD:"/forgot-password/",RESET_PASSWORD:"/reset-password/",VERIFY:"/verify/",INTRO:"/intro/",INTRO_SUCCESS:"/intro/success/",ONBOARDING:"/onboarding/",ONBOARDING_SUCCESS:"/onboarding/success/",DASHBOARD:"/dashboard/",APPOINTMENTS:"/appointments/",PATIENTS:"/patients/",MESSAGES:"/messages/",MEDICATION:"/medication/",PROFILE:"/profile/",PROFILE_ONBOARDING:"/profile/onboarding/",BILLING:"/billing/",HELP:"https://help.meto.co/en/",SETTINGS:"/settings/",SCHEDULER:"/scheduler/",PRIVACY:"/privacy-policy",TERMS:"/terms-and-conditions",LOGOUT:"/logout/",CUSTOM_FORMS:"/custom-forms/",INVOICE_ADD:"/invoice/add/",INVOICE_EDIT:"/invoice/edit/",PATIENT_RECORD_REQUEST:"/patient-record-request/",NEW_ORDER:"/new-order/",ADD_PRESCRIPTION:"/add-prescription/",CHART_NOTE:"/chart-note/",REQUEST_LAB_TEST:"/request-lab-test/",CALENDAR_SYNC:"/calendar-sync",ONBOARDING_FORM:"/onboarding-form/",SUBSCRIPTIONS:"/subscriptions/",SUBSCRIBE:"/subscribe",REFERRALS:"/referrals",SUBSCRIBE_ME:"/subscribe-me"},i=[n.ONBOARDING,n.ONBOARDING_SUCCESS],s=[n.DASHBOARD,n.APPOINTMENTS,n.PATIENTS,n.MESSAGES,n.MEDICATION,n.PROFILE,n.PROFILE_ONBOARDING,n.BILLING,n.HELP,n.SETTINGS,n.SCHEDULER,n.CUSTOM_FORMS,n.INVOICE_ADD,n.INVOICE_EDIT,n.PATIENT_RECORD_REQUEST,n.NEW_ORDER,n.ADD_PRESCRIPTION,n.CHART_NOTE,n.REQUEST_LAB_TEST,n.CALENDAR_SYNC,n.ONBOARDING_FORM,n.SUBSCRIPTIONS,n.SUBSCRIBE,n.REFERRALS]},52985:function(e,t,r){var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))});t.Z=i},47193:function(e,t,r){var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))});t.Z=i},95127:function(e,t,r){r.d(t,{M:function(){return S}});var n=r(57437),i=r(2265),s=r(9033);function o(){let e=(0,i.useRef)(!1);return(0,s.L)(()=>(e.current=!0,()=>{e.current=!1}),[]),e}var l=r(86219),c=r(67797),a=r(30458),d=r(29791);class u extends i.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function f({children:e,isPresent:t}){let r=(0,i.useId)(),s=(0,i.useRef)(null),o=(0,i.useRef)({width:0,height:0,top:0,left:0}),{nonce:l}=(0,i.useContext)(d._);return(0,i.useInsertionEffect)(()=>{let{width:e,height:n,top:i,left:c}=o.current;if(t||!s.current||!e||!n)return;s.current.dataset.motionPopId=r;let a=document.createElement("style");return l&&(a.nonce=l),document.head.appendChild(a),a.sheet&&a.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${e}px !important; height: ${n}px !important; top: ${i}px !important; left: ${c}px !important; } `),()=>{document.head.removeChild(a)}},[t]),(0,n.jsx)(u,{isPresent:t,childRef:s,sizeRef:o,children:i.cloneElement(e,{ref:s})})}let m=({children:e,initial:t,isPresent:r,onExitComplete:s,custom:o,presenceAffectsLayout:l,mode:d})=>{let u=(0,a.h)(p),m=(0,i.useId)(),h=(0,i.useMemo)(()=>({id:m,initial:t,isPresent:r,custom:o,onExitComplete:e=>{for(let t of(u.set(e,!0),u.values()))if(!t)return;s&&s()},register:e=>(u.set(e,!1),()=>u.delete(e))}),l?[Math.random()]:[r]);return(0,i.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[r]),i.useEffect(()=>{r||u.size||!s||s()},[r]),"popLayout"===d&&(e=(0,n.jsx)(f,{isPresent:r,children:e})),(0,n.jsx)(c.O.Provider,{value:h,children:e})};function p(){return new Map}var h=r(5050),x=r(19047);let E=e=>e.key||"",S=({children:e,custom:t,initial:r=!0,onExitComplete:c,exitBeforeEnter:a,presenceAffectsLayout:d=!0,mode:u="sync"})=>{var f;(0,x.k)(!a,"Replace exitBeforeEnter with mode='wait'");let p=(0,i.useContext)(h.p).forceRender||function(){let e=o(),[t,r]=(0,i.useState)(0),n=(0,i.useCallback)(()=>{e.current&&r(t+1)},[t]);return[(0,i.useCallback)(()=>l.Wi.postRender(n),[n]),t]}()[0],S=o(),R=function(e){let t=[];return i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&t.push(e)}),t}(e),j=R,N=(0,i.useRef)(new Map).current,I=(0,i.useRef)(j),v=(0,i.useRef)(new Map).current,g=(0,i.useRef)(!0);if((0,s.L)(()=>{g.current=!1,function(e,t){e.forEach(e=>{let r=E(e);t.set(r,e)})}(R,v),I.current=j}),f=()=>{g.current=!0,v.clear(),N.clear()},(0,i.useEffect)(()=>()=>f(),[]),g.current)return(0,n.jsx)(n.Fragment,{children:j.map(e=>(0,n.jsx)(m,{isPresent:!0,initial:!!r&&void 0,presenceAffectsLayout:d,mode:u,children:e},E(e)))});j=[...j];let O=I.current.map(E),_=R.map(E),w=O.length;for(let e=0;e{if(-1!==_.indexOf(r))return;let i=v.get(r);if(!i)return;let s=O.indexOf(r),o=e;o||(o=(0,n.jsx)(m,{isPresent:!1,onExitComplete:()=>{N.delete(r);let e=Array.from(v.keys()).filter(e=>!_.includes(e));if(e.forEach(e=>v.delete(e)),I.current=R.filter(t=>{let n=E(t);return n===r||e.includes(n)}),!N.size){if(!1===S.current)return;p(),c&&c()}},custom:t,presenceAffectsLayout:d,mode:u,children:i},E(i)),N.set(r,o)),j.splice(s,0,o)}),j=j.map(e=>{let t=e.key;return N.has(t)?e:(0,n.jsx)(m,{isPresent:!0,presenceAffectsLayout:d,mode:u,children:e},E(e))}),(0,n.jsx)(n.Fragment,{children:N.size?j:j.map(e=>(0,i.cloneElement)(e))})}}}]);