PageSourceSearch

https://dashboard.morvo.co.uk/assets/Login-DQDd0NT3.js

js morvo.co.uk collected 2026-10-01 12:13:37 UTC 9,693 bytes, 1 lines download raw bytes

1import{r as t,j as e,a0 as re,Y as O,a1 as Q,a2 as ae,a3 as D,a4 as ne,a5 as oe,w as ce,a6 as K,W as ie,V as le,U as P,a7 as q,N as W,h as G,F as X,a8 as de,a9 as Y,aa as ue,L as V,q as $,I as J,B as fe}from"./index-Dmg69QaJ.js";import{C as me}from"./card-BwIY_KKB.js";import{l as he}from"./auth-validation-BKaxuYkg.js";import{M as pe}from"./MFAChallenge-Eyf9sYd4.js";import{b as xe,B as be,n as ge}from"./mfaGate-BYnIH208.js";import"./types-By9teAtI.js";import"./input-otp-DNNIsII5.js";import"./loader-circle-DdAFOx8A.js";var Ce=Object.defineProperty,I=(s,r)=>Ce(s,"name",{value:r,configurable:!0}),U="Checkbox",[ve,Ae]=ne(U),[ke,H]=ve(U);function Z(s){const{__scopeCheckbox:r,checked:i,children:d,defaultChecked:u,disabled:b,form:o,name:h,onCheckedChange:a,required:l,value:v="on",internal_do_not_use_render:g}=s,[f,C]=oe({prop:i,defaultProp:u??!1,onChange:a,caller:U}),[p,k]=t.useState(null),[_,N]=t.useState(null),E=t.useRef(!1),[n,m]=t.useReducer(w=>w+1,0),j=p?!!o||!!p.closest("form"):!0,B={checked:f,disabled:b,setChecked:C,control:p,setControl:k,name:h,form:o,value:v,hasConsumerStoppedPropagationRef:E,userInteractionCount:n,onUserInteraction:m,required:l,defaultChecked:S(u)?!1:u,isFormControl:j,bubbleInput:_,setBubbleInput:N};return e.jsx(ke,{scope:r,...B,children:te(g)?g(B):d})}I(Z,"CheckboxProvider");var je="CheckboxTrigger",we=t.forwardRef(I(function({__scopeCheckbox:r,onKeyDown:i,onClick:d,...u},b){const{control:o,value:h,disabled:a,checked:l,required:v,setControl:g,setChecked:f,hasConsumerStoppedPropagationRef:C,onUserInteraction:p,isFormControl:k,bubbleInput:_}=H(je,r),N=Q(b,g),E=t.useRef(l);return t.useEffect(()=>{const n=o?.form;if(n){const m=I(()=>f(E.current),"reset");return n.addEventListener("reset",m),()=>n.removeEventListener("reset",m)}},[o,f]),e.jsx(O.button,{type:"button",role:"checkbox","aria-checked":S(l)?"mixed":l,"aria-required":v,"data-state":z(l),"data-disabled":a?"":void 0,disabled:a,value:h,...u,ref:N,onKeyDown:D(i,n=>{n.key==="Enter"&&n.preventDefault()}),onClick:D(d,n=>{p(),f(m=>S(m)?!0:!m),_&&k&&(C.current=n.isPropagationStopped(),C.current||n.stopPropagation())})})},"CheckboxTrigger")),ee=t.forwardRef(I(function(r,i){const{__scopeCheckbox:d,name:u,checked:b,defaultChecked:o,required:h,disabled:a,value:l,onCheckedChange:v,form:g,...f}=r;return e.jsx(Z,{__scopeCheckbox:d,checked:b,defaultChecked:o,disabled:a,required:h,onCheckedChange:v,name:u,form:g,value:l,internal_do_not_use_render:({isFormControl:C})=>e.jsxs(e.Fragment,{children:[e.jsx(we,{...f,ref:i,__scopeCheckbox:d}),C&&e.jsx(Ie,{__scopeCheckbox:d})]})})},"Checkbox")),ye="CheckboxIndicator",Ne=t.forwardRef(I(function(r,i){const{__scopeCheckbox:d,forceMount:u,...b}=r,o=H(ye,d);return e.jsx(re,{present:u||S(o.checked)||o.checked===!0,children:e.jsx(O.span,{"data-state":z(o.checked),"data-disabled":o.disabled?"":void 0,...b,ref:i,style:{pointerEvents:"none",...r.style}})})},"CheckboxIndicator")),Se="CheckboxBubbleInput",Ie=t.forwardRef(I(function({__scopeCheckbox:r,onClick:i,...d},u){const{control:b,hasConsumerStoppedPropagationRef:o,userInteractionCount:h,checked:a,defaultChecked:l,required:v,disabled:g,name:f,value:C,form:p,bubbleInput:k,setBubbleInput:_}=H(Se,r),N=Q(u,_),E=ae(b),n=t.useRef(!1),m=t.useRef(a),j=t.useRef(h);t.useEffect(()=>{const w=k;if(!w)return;const T=window.HTMLInputElement.prototype,x=Object.getOwnPropertyDescriptor(T,"checked").set,F=h!==j.current;j.current=h;const R=m.current!==a;m.current=a;const A=!(F&&o.current);if(R&&x){n.current=!F;const M=new Event("click",{bubbles:A});w.indeterminate=S(a),x.call(w,S(a)?!1:a),w.dispatchEvent(M),n.current=!1}},[k,a,o,h]);const B=t.useRef(S(a)?!1:a);return e.jsx(O.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??B.current,required:v,disabled:g,name:f,value:C,form:p,...d,tabIndex:-1,ref:N,onClick:D(i,w=>{n.current&&w.stopPropagation()}),style:{...d.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})},"CheckboxBubbleInput"));function te(s){return typeof s=="function"}I(te,"isFunction");function S(s){return s==="indeterminate"}I(S,"isIndeterminate");function z(s){return S(s)?"indeterminate":s?"checked":"unchecked"}I(z,"getState");const se=t.forwardRef(({className:s,...r},i)=>e.jsx(ee,{ref:i,className:K("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",s),...r,children:e.jsx(Ne,{className:K("flex items-center justify-center text-current"),children:e.jsx(ce,{className:"h-4 w-4"})})}));
1se.displayName=ee.displayName;const Te=()=>{const s=ie(),{toast:r}=le(),[i,d]=t.useState(""),[u,b]=t.useState(""),[o,h]=t.useState(!1),[a,l]=t.useState(!1),[v,g]=t.useState(!1),[f,C]=t.useState({}),p=t.useRef(!1),k=t.useRef(!1),[_,N]=t.useState(!1),[E,n]=t.useState(null),[m,j]=t.useState(!1);t.useEffect(()=>{let c=!1;return(async()=>{const{data:{session:x}}=await P.auth.getSession();if(!x)return;const F=await P.auth.mfa.getAuthenticatorAssuranceLevel().then(y=>y.data,()=>null),R=xe(x.access_token,(()=>{try{return sessionStorage.getItem(be)}catch{return null}})());if(c||!ge(F)||R)return;const{data:A}=await P.auth.mfa.listFactors(),M=A?.totp?.find(y=>y.status==="verified");c||!M||(j(!0),n(M.id),N(!0))})(),()=>{c=!0}},[]),t.useEffect(()=>{const{data:{subscription:c}}=P.auth.onAuthStateChange((x,F)=>{k.current&&(m||F&&x==="SIGNED_IN"&&(q(p.current),s("/account")))});return()=>c.unsubscribe()},[s,m]);const B=async c=>{c.preventDefault(),C({});const x=he.safeParse({email:i,password:u});if(!x.success){const y={};x.error.errors.forEach(L=>{L.path[0]==="email"&&(y.email=L.message),L.path[0]==="password"&&(y.password=L.message)}),C(y);return}l(!0),j(!0),k.current=!0,p.current=o;const{data:F,error:R}=await P.auth.signInWithPassword({email:x.data.email,password:x.data.password});if(R){j(!1);const L=R.code==="user_banned"||R.message.toLowerCase().includes("banned")?"Trial has ended, please contact Morvo support to reactivate your account":R.message;r({title:"Error",description:L,variant:"destructive"}),l(!1);return}const{data:A}=await P.auth.mfa.listFactors(),M=A?.totp?.find(y=>y.status==="verified");M?(n(M.id),N(!0),l(!1)):(j(!1),q(p.current),s("/account"),l(!1))},w=()=>{q(p.current),s("/account")},T=async()=>{j(!1),k.current=!1,await P.auth.signOut(),N(!1),n(null)};return _&&E?e.jsxs("div",{className:"min-h-screen",children:[e.jsx(W,{}),e.jsxs("div",{className:"min-h-screen flex items-center justify-center relative p-4 pt-24",children:[e.jsx("img",{src:G,alt:"",className:"absolute inset-0 w-full h-full object-cover","aria-hidden":"true"}),e.jsx("div",{className:"relative z-10 w-full flex items-center justify-center",children:e.jsx(pe,{factorId:E,onSuccess:w,onCancel:T,showCancel:!0})})]}),e.jsx(X,{})]}):e.jsxs("div",{className:"min-h-screen",children:[e.jsx(W,{}),e.jsxs("div",{className:"min-h-screen flex items-center justify-center relative p-4 pt-24",children:[e.jsx("img",{src:G,alt:"",className:"absolute inset-0 w-full h-full object-cover","aria-hidden":"true"}),e.jsx("div",{className:"relative z-10 w-full flex items-center justify-center",children:e.jsxs(me,{className:"w-full max-w-md p-8",children:[e.jsxs("div",{className:"text-center mb-8",children:[de()?e.jsx("a",{href:ue("/"),className:"inline-block mb-6",children:e.jsx("img",{src:Y,alt:"Morvo",className:"h-10 mx-auto"})}):e.jsx(V,{to:"/",className:"inline-block mb-6",children:e.jsx("img",{src:Y,alt:"Morvo",className:"h-10 mx-auto"})}),e.jsx("h1",{className:"text-2xl font-bold mb-2",children:"Welcome back"}),e.jsx("p",{className:"text-muted-foreground",children:"Sign in to your account"})]}),e.jsxs("form",{onSubmit:B,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx($,{htmlFor:"email",children:"Email"}),e.jsx(J,{id:"email",type:"email",value:i,onChange:c=>d(c.target.value),className:"mt-1",maxLength:255,required:!0}),f.email&&e.jsx("p",{className:"text-sm text-destructive mt-1",children:f.email})]}),e.jsxs("div",{children:[e.jsx($,{htmlFor:"password",children:"Password"}),e.jsx(J,{id:"password",type:"password",value:u,onChange:c=>b(c.target.value),className:"mt-1",maxLength:128,required:!0}),f.password&&e.jsx("p",{className:"text-sm text-destructive mt-1",children:f.password})]}),e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsx(se,{id:"remember-me",checked:o,onCheckedChange:c=>h(c===!0)}),e.jsx("span",{className:"text-muted-foreground",children:"Remember me"})]}),e.jsx("button",{type:"button",disabled:v,onClick:async()=>{if(!i){r({title:"Email required",description:"Please enter your email address first",variant:"destructive"});return}g(!0);const{error:c}=await P.functions.invoke("send-password-reset",{body:{email:i,siteOrigin:window.location.origin}});g(!1),r(c?{title:"Error",description:c.message||"Failed to send reset email",variant:"destructive"}:{title:"Check your email",description:"We've sent you a password reset link from [email protected]"})},className:"text-primary hover:underline disabled:opacity-50",children:v?"Sending...":"Forgot password?"})]}),e.jsx(fe,{type:"submit",disabled:a,className:"w-full bg-gradient-primary",children:a?"Signing In...":"Sign In"})]}),e.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-6",children:["Don't have an account?"," ",e.jsx(V,{to:"/signup/create",className:"text-primary hover:underline",children:"Sign up"})]})]})})]}),e.jsx(X,{})]})};export{Te as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.