import{B as e,Ft as t,H as n,It as r,Mt as i,O as a,Q as o,W as s,Z as c,_t as l,at as u,c as d,d as f,ft as p,ht as m,jt as h,l as g,mt as _,ot as v,pt as y,s as b,st as x,tt as S,x as C,yt as w}from"../chunks/BA99CCI5.js";import{t as T}from"../chunks/BJ4akexL.js";import"../chunks/xihTtKlq.js";import"../chunks/DGo8yE5j.js";import{t as E}from"../chunks/BDqLURZS.js";import{t as D}from"../chunks/3rupxGJ5.js";import{t as O}from"../chunks/BjTZeLXW.js";import{t as k}from"../chunks/B66v-P2b.js";import{n as A}from"../chunks/DCkiND_92.js";import{t as j}from"../chunks/DCohNkHF.js";import{t as M}from"../chunks/qMgSkqkC.js";var N=new Set([`$$slots`,`$$events`,`$$legacy`]);function P(e,t){let n=d(t,N),r=[[`path`,{d:`m10 17 5-5-5-5`}],[`path`,{d:`M15 12H3`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`}]];D(e,g({name:`log-in`},()=>n,{get iconNode(){return r}}))}var F=s(`<form method="POST" class="space-y-6"><!> <!> <!></form>`),I=s(`<!> <div class="flex min-h-screen items-center justify-center bg-neutral-100 p-4 dark:bg-neutral-900"><div class="w-full max-w-sm"><div class="mb-8 flex items-center gap-4"><img alt="Profilarr logo" class="h-12 w-12"/> <div><h1 class="text-xl font-bold text-neutral-900 dark:text-neutral-50">Welcome back</h1> <p class="text-sm text-neutral-600 dark:text-neutral-400">Sign in to continue.</p></div></div> <!></div></div>`,1);function L(s,d){i(d,!1);let g=b(d,`data`,8),D=b(d,`form`,8),N=m(!1),L=m(D()?.username??``),R=m(``);u(()=>(c(D()),T),()=>{D()?.error&&T.add(`error`,D().error)}),v(),f();var z=I(),B=y(z);j(B,{title:`Login`});var V=_(B,2),H=p(V),U=p(H),W=p(U);t(2),r(U);var G=_(U,2),K=e=>{k(e,{href:`/auth/oidc/login`,variant:`primary`,size:`md`,fullWidth:!0,get icon(){return O},text:`Sign in with SSO`})},q=e=>{var t=F(),i=p(t);M(i,{name:`username`,label:`Username`,hideLabel:!0,type:`text`,placeholder:`Username`,autocomplete:`username`,get value(){return o(L)},set value(e){l(L,e)},$$legacy:!0});var s=_(i,2);M(s,{name:`password`,label:`Password`,hideLabel:!0,type:`password`,placeholder:`Password`,autocomplete:`current-password`,private_:!0,get value(){return o(R)},set value(e){l(R,e)},$$legacy:!0});var c=_(s,2);{let e=w(()=>o(N)?`Signing In...`:`Sign In`);k(c,{type:`submit`,variant:`primary`,size:`md`,fullWidth:!0,get icon(){return P},get text(){return o(e)},get disabled(){return o(N)}})}r(t),a(t,(e,t)=>A?.(e,t),()=>()=>(l(N,!0),async({update:e})=>{await e({reset:!1}),l(N,!1)})),n(e,t)};e(G,e=>{c(g()),S(()=>g().authMode===`oidc`)?e(K):e(q,-1)}),r(H),r(V),x(()=>C(W,`src`,E)),n(s,z),h()}export{L as component};