PageSourceSearch

https://www.elite.se/dist/client/assets/member-login-form.component-ObtuYAyN.js

js elite.se collected 2026-10-02 03:44:31 UTC 2,065 bytes, 1 lines download raw bytes

1import{G as e}from"./entry-client-DrEVLKbw.js";import{f as t,i as n}from"./validationPatterns-CPnea27I.js";import{t as r}from"./MyPagesApi-BSIu4V5X.js";var i={success:`SUCCESS`,error:`ERROR`},a=(a,o,s)=>{let{endpoints:c,jwtToken:l,antiforgeryToken:u,sharedI18n:d}=s.getState().shared,f=d.inputValidationResource,p=(e,t)=>e?.setAttribute(`aria-hidden`,String(t)),m=a.querySelector(`form`),h=a.querySelector(`.member-login-form__login-message-wrapper`),g=a.querySelector(`[data-login-form-error-message]`),_=a.querySelector(`[data-login-form-error500-message]`),v=a.querySelector(`[data-login-form-unavailable-account-message]`),y=[g,_,v],b=a.querySelector(`[data-login-form-submit]`),x=new r(c,l,u,t=>s.dispatch(e(t)));m.addEventListener(`input`,()=>{y.forEach(e=>p(e,!0)),p(h,!0)}),n(m,[{inputId:`member-login-form__email`,type:t.Email,messages:{empty:f.emptyInputMessage,invalid:f.invalidEmailMessage}},{inputId:`member-login-form__password`,type:t.Password,minLength:8,messages:{empty:f.emptyInputMessage,invalid:f.invalidPasswordMessage,minLength:f.minLengthMessage.replace(`{0}`,`8`)}}],async()=>{let e=()=>new URL(window.location.pathname,window.location.origin),t=()=>new URLSearchParams(window.location.search).get(`step`)?.toLowerCase()===`step6`,n=e();try{let e=window.location.search;e.length>1&&sessionStorage.setItem(`loginReturnQueryParams`,e)}catch{t()?n.searchParams.append(`step`,`step6`):new URLSearchParams(window.location.search).forEach((e,t)=>{n.searchParams.append(t,e)})}let r=new FormData(m);await C({username:r.get(`username`),password:r.get(`password`),rememberMe:r.get(`rememberMe`),returnUrl:n.toString()})});let S=e=>{b?.setAttribute(`data-loading`,e.toString())};async function C(e){y.forEach(e=>{p(e,!0)}),S(!0),await x.postLogin(e,e=>{if(e.status!==i.success)e.authorizationStatus===3?(p(h,!1),p(v,!1)):(p(h,!1),p(g,!1)),S(!1);else{let t=e?.authorizeUrl;t&&(document.cookie=`isFirstLogin=true; path=/`,location.assign(t))}},e=>{e.cause instanceof Response&&e.cause.status===500?p(_,!1):p(g,!1),p(h,!1),S(!1)})}};export{a 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.