import{b,c as L,d as N,e as M,h as k,m as v,p as P,q as O,s as x}from"./chunk-25A34CYL.js";import{c as S}from"./chunk-EEWVYRVF.js";import"./chunk-F7TB6D2I.js";import{c as y}from"./chunk-EMAOG2GJ.js";import"./chunk-CKZXQWC5.js";import{a as E,b as F,g as G,l as T}from"./chunk-KYG6FTJ2.js";import"./chunk-BE77QZG7.js";import"./chunk-OXZWBTVI.js";import{Ab as t,Bb as i,Cb as p,D as c,Qa as m,Sb as w,X as s,db as g,fc as n,ib as f,rb as h,ta as l,tb as _,wb as C}from"./chunk-5ONOZUNN.js";import"./chunk-C6Q5SG76.js";function A(r,e){r&1&&(t(0,"spk-alert",1),n(1," Remember to enter a password, if you can't remember the password open the duplicati client on the machine in question and make sure you open it through the tray icon then go into settings to change the password. "),i())}var u=new O,d=class r{#e=s(y);#t=s(S);failedLogin=l(!1);isLoading=l(!1);loginForm=u.group({user:u.control(""),pass:u.control("",L.required)});submit(){let e=this.loginForm.value.pass;this.loginForm.value.user||e&&(this.isLoading.set(!0),this.#t.login(e).pipe(c(()=>{this.isLoading.set(!1),this.failedLogin.set(!0)})).subscribe({next:()=>this.#e.navigate(["/"])}))}static \u0275fac=function(o){return new(o||r)};static \u0275cmp=g({type:r,selectors:[["app-login"]],decls:15,vars:4,consts:()=>{let e;return e=$localize`Enter your password`,[[3,"submit","formGroup"],["type","warning"],[1,"login-row"],["type","text","hidden","","autocomplete","off","name","username","formControlName","user"],["for","password"],["href","https://docs.duplicati.com/detailed-descriptions/duplicati-access-password","target","_blank","rel","noopener noreferrer"],["type","password","name","password","autocomplete","current-password","placeholder",e,"tabindex","1","formControlName","pass"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(o,a){o&1&&(t(0,"form",0),w("submit",function(){return a.submit()}),f(1,A,2,0,"spk-alert",1),t(2,"div",2),p(3,"input",3),t(4,"spk-form-field")(5,"label",4),n(6," Password "),t(7,"a",5)(8,"spk-icon"),n(9,"question"),i()()(),p(10,"input",6),i(),t(11,"button",7),n(12," Login "),t(13,"spk-icon"),n(14,"arrow-right"),i()()()()),o&2&&(h("formGroup",a.loginForm),m(),C(a.failedLogin()?1:-1),m(10),_("loader",a.isLoading()))},dependencies:[x,k,b,N,M,v,P,T,E,G,F],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{width:100vw;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.5rem}spk-alert[_ngcontent-%COMP%]{max-width:20rem;margin:0 auto}h3[_ngcontent-%COMP%]{font:var(--title-30)}.login-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}"],changeDetection:0})};export{d as default};
