@duplicati/ngclient 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/chunk-2LTGXEZS.js +1 -0
- package/{chunk-V7LHB36E.js → chunk-3B6RZWP4.js} +1 -1
- package/chunk-3DBUGAIF.js +1 -0
- package/chunk-3SP3MQEU.js +1 -0
- package/chunk-4OR2MBXM.js +1 -0
- package/{chunk-P4AWKIXG.js → chunk-6PJU5W5X.js} +1 -1
- package/chunk-74EYKZJR.js +1 -0
- package/chunk-7CGTOI24.js +1 -0
- package/chunk-7ROMUYYO.js +1 -0
- package/chunk-7YI4IDWY.js +1 -0
- package/chunk-7YM6RN2G.js +1 -0
- package/chunk-A2PI66LB.js +1 -0
- package/chunk-AVWHS36O.js +1 -0
- package/chunk-B42N6RQ3.js +1 -0
- package/{chunk-K4KGTWQK.js → chunk-BDBR5EDG.js} +1 -1
- package/{chunk-K3HFPUKT.js → chunk-BRVLVIBB.js} +1 -1
- package/chunk-CWAAKGM6.js +1 -0
- package/chunk-ER25OIRY.js +1 -0
- package/chunk-HAOKXZHF.js +1 -0
- package/{chunk-TIGGJ4KF.js → chunk-ICCENBZO.js} +1 -1
- package/chunk-KLPRJO2S.js +1 -0
- package/chunk-MYQPVSUP.js +1 -0
- package/chunk-NGPWOMCW.js +8 -0
- package/chunk-NSHVJHI5.js +1 -0
- package/chunk-NVFX5EQI.js +1 -0
- package/{chunk-OYQELNXA.js → chunk-OI46JH74.js} +2 -2
- package/{chunk-5Y47Y3RB.js → chunk-Q3B3QVNE.js} +1 -1
- package/chunk-QROBYUJD.js +2 -0
- package/{chunk-JDCFQ6PF.js → chunk-QVTIOQU4.js} +1 -1
- package/{chunk-G3ZRG5MJ.js → chunk-RH5CENQ7.js} +1 -1
- package/chunk-RIVCLGIC.js +1 -0
- package/chunk-RK3NUMZK.js +1 -0
- package/chunk-RL7JYJ4S.js +1 -0
- package/chunk-S4UXVQU2.js +1 -0
- package/chunk-SS4RWMEQ.js +1 -0
- package/chunk-SWUZR64I.js +1 -0
- package/chunk-TXPM7OPP.js +1 -0
- package/chunk-VJK4WSMT.js +1 -0
- package/chunk-WH7DPJOS.js +1 -0
- package/chunk-WQPTWFXA.js +1 -0
- package/chunk-XYN4OGS4.js +1 -0
- package/chunk-ZBL4ZWSP.js +1 -0
- package/chunk-ZUISIMKR.js +1 -0
- package/chunk-ZUVMWAQY.js +1 -0
- package/index.html +1 -1
- package/main-RMFQXRTZ.js +1 -0
- package/package.json +1 -1
- package/chunk-2AXNYUNT.js +0 -2
- package/chunk-3E64B4PC.js +0 -1
- package/chunk-4RT7DNKB.js +0 -1
- package/chunk-5SGHSZAK.js +0 -1
- package/chunk-76OEVFIM.js +0 -1
- package/chunk-AFUS3PYG.js +0 -1
- package/chunk-C52YH32J.js +0 -1
- package/chunk-CQGUEKNU.js +0 -1
- package/chunk-DCCSCFRQ.js +0 -1
- package/chunk-DJSNG6NF.js +0 -1
- package/chunk-E66JBJTH.js +0 -1
- package/chunk-H2IAZHJK.js +0 -1
- package/chunk-IDQOMEFA.js +0 -1
- package/chunk-L4EVZZOM.js +0 -1
- package/chunk-LNCAETYE.js +0 -1
- package/chunk-LSGSCARA.js +0 -1
- package/chunk-M7I5RH5L.js +0 -1
- package/chunk-MFISBPKS.js +0 -1
- package/chunk-MWB5FR2K.js +0 -1
- package/chunk-OM6QOR75.js +0 -1
- package/chunk-RBNO3K72.js +0 -8
- package/chunk-SQQXOHJO.js +0 -1
- package/chunk-SYBUINNV.js +0 -1
- package/chunk-UDWDXUOB.js +0 -1
- package/chunk-VOMOARSI.js +0 -1
- package/chunk-VSPW7AWV.js +0 -1
- package/chunk-WGKAMO4L.js +0 -1
- package/chunk-WU4K3UNC.js +0 -1
- package/chunk-YJ2MWFHK.js +0 -1
- package/chunk-YQDGW52C.js +0 -1
- package/chunk-ZE33Q6DJ.js +0 -1
- package/chunk-ZXOEQDPM.js +0 -1
- package/chunk-ZYCMR5VM.js +0 -1
- package/main-XRAHISLJ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as Ue,b as Ce}from"./chunk-MYQPVSUP.js";import{a as ge}from"./chunk-ICCENBZO.js";import{a as Ye,b as xt}from"./chunk-DNHLTHLR.js";import{b as Se}from"./chunk-6PJU5W5X.js";import{a as we,b as H,c as he,d as Y,e as J,f as Z,g as ue,i as X,j as _e,k as Le,l as ee,m as te,n as ne,o as I,q as ie}from"./chunk-ER25OIRY.js";import{a as yt}from"./chunk-WQPTWFXA.js";import{a as oe,e as fe,g as gt,i as ae,k as ze,n as Ct,o as re,r as De}from"./chunk-3SP3MQEU.js";import{a as W,c as R}from"./chunk-4OR2MBXM.js";import{a as ft}from"./chunk-ZUVMWAQY.js";import{A as lt,Ab as xe,Bb as l,Cb as G,D as ye,Db as A,Fb as ct,Hb as Q,I as st,Jb as Be,La as s,Lb as $e,O as be,Pb as dt,Ra as S,Sa as U,U as h,W as z,Ya as f,Za as $,Zb as K,_a as d,ab as pt,db as _,ea as g,eb as w,fa as C,fb as D,gb as T,hb as a,ib as o,jb as m,jc as ut,kb as k,lb as v,mb as Me,nb as F,ob as y,pb as p,sb as pe,sc as _t,tb as N,ub as mt,yb as j,zb as q}from"./chunk-NGPWOMCW.js";import{a as se,b as Re,c as rt}from"./chunk-7CGTOI24.js";var je=class t{fromString(i){if(!i)return null;let e=i.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(i,e){return`${i}${e}`}static \u0275fac=function(e){return new(e||t)};static \u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})};var ve=new I,Ve={file:{customFields:{path:{type:"file-tree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>ve.control(t??"")}}},ssh:{customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>ve.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>ve.control(t??"")},path:{type:"Path",name:"path",shortDescription:"File path on the server",longDescription:"File path on the server",formElement:t=>ve.control(t??"")}},dynamicFields:["auth-username"]},s3:{customFields:{path:{type:"Path",name:"path",shortDescription:"File path on the server",longDescription:"File path on the server",formElement:t=>ve.control(t??"")},bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>ve.control(t??"")}},dynamicFields:["use-ssl","s3-server-name","auth-username","auth-password"]},gcs:{dynamicFields:["gcs-location","gcs-storage-class","authid"]},googledrive:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"File path on the server",longDescription:"File path on the server",formElement:t=>ve.control(t??"")}},dynamicFields:["authid"]}};function Te(t,i){let e={},n={};return i.searchParams.forEach((r,c)=>{Ve[t].dynamicFields?.includes(c)?n[c]=decodeURIComponent(r):e[c]=decodeURIComponent(r)}),{advanced:e,dynamic:n}}function Ie(t){let i=t.map(([e,n])=>`${e}=${n?encodeURIComponent(n.toString()):""}`).join("&");return i?"?"+i:""}var Ee={file:{to:t=>{let i=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${i}`},from:(t,i,e)=>{let n=e.indexOf("file:///")===0,r=e.split(n?"///":"//")[1].substring(0,1)+i.hostname.substring(1);return se({destinationType:t,custom:{path:`${n?"/":""}${r}${i.pathname}`}},Te(t,i))}},ssh:{to:t=>{let i=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.server}${t.custom.port?":"+t.custom.port:""}${t.custom.path.startsWith("/")?t.custom.path:"/"+t.custom.path}${i}`},from:(t,i,e)=>se({destinationType:t,custom:{server:i.hostname,port:i.port,path:i.pathname}},Te(t,i))},s3:{to:t=>{let i=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.bucket}${t.custom.path}${i}`},from:(t,i,e)=>se({destinationType:t,custom:{path:i.pathname,bucket:i.hostname}},Te(t,i))},gcs:{to:t=>{let i=t.dynamic["gcs-location"]??"";delete t.dynamic["gcs-location"];let e=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${i}${e}`},from:(t,i,e)=>{let{advanced:n,dynamic:r}=Te(t,i);return{destinationType:t,advanced:n,dynamic:Re(se({},r),{"gcs-location":i.hostname+i.pathname})}}},googledrive:{to:t=>{let i=t.custom.path,e=Ie([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${i}${e}`},from:(t,i,e)=>{let n=e.replace("googledrive://","");return se({destinationType:t,custom:{path:n}},Te(t,i))}},fallbackMapper:{to:t=>"",from:(t,i,e)=>se({destinationType:t},Te(t,i))}};function Ne(t){let i=t.destinationType;return!i||!Ee.hasOwnProperty(i)?Ee.fallbackMapper.to(t)??"":Ee[i].to(t)??""}function ht(t){let i=URL.canParse(t),e=t.split("://")[0],n="http://"+t.split("://")[1],r=new URL(n);if(!Ee.hasOwnProperty(e))return Ee.fallbackMapper.from(e,r);if(!i)throw new Error("Invalid target path");return Ee[e].from(e,r,t)}var Tt=/[a-zA-Z0-9_\-\+\.]/,qe=class t{generate(i,e=Tt){let n=this;return Array.apply(null,{length:i}).map(()=>{let r;for(;;)if(r=String.fromCharCode(n.#e()),e.test(r))return r},this).join("")}#e(){if(window.crypto&&window.crypto.getRandomValues){let i=new Uint8Array(1);return window.crypto.getRandomValues(i),i[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let i=new Uint8Array(1);return window.msCrypto.getRandomValues(i),i[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})};var Et=["formRef"];function Nt(t,i){if(t&1&&(a(0,"option",14),l(1),o()),t&2){let e=i.$implicit;d("value",e.Key),s(),G(e.DisplayName)}}function Ot(t,i){t&1&&(a(0,"spk-icon"),l(1,"eye-slash"),o(),l(2," hide "))}function Pt(t,i){t&1&&(a(0,"spk-icon"),l(1,"eye"),o(),l(2," show "))}function Vt(t,i){t&1&&(a(0,"spk-icon",23),l(1,"check"),o())}function It(t,i){t&1&&(a(0,"spk-icon"),l(1,"copy"),o())}function Gt(t,i){if(t&1){let e=F();a(0,"button",22),y("click",function(){g(e);let r=p(3);return C(r.copyPassword())}),f(1,Vt,2,0,"spk-icon",23)(2,It,2,0,"spk-icon"),l(3),o()}if(t&2){let e=p(3);s(),_(e.copiedPassword()?1:2),s(2),A(" ",e.copiedPassword()?"Copied":"Copy"," password ")}}function At(t,i){if(t&1){let e=F();a(0,"div",15)(1,"spk-form-field")(2,"label",16),l(3,"Create a password"),o(),m(4,"input",17),o(),a(5,"spk-form-field"),m(6,"input",18),o(),a(7,"div",19)(8,"button",20),y("click",function(){g(e);let r=p(2);return C(r.showPassword.set(!r.showPassword()))}),f(9,Ot,3,0)(10,Pt,3,0),o(),a(11,"button",20),y("click",function(){g(e);let r=p(2);return C(r.generatePassword())}),a(12,"spk-icon"),l(13,"password"),o(),l(14," Generate password "),o(),f(15,Gt,4,2,"button",21),o()()}if(t&2){let e=p(2);s(4),d("type",e.showPassword()?"text":"password"),s(2),d("type",e.showPassword()?"text":"password"),s(3),_(e.showPassword()?9:10),s(6),_(e.showCopyPassword()?15:-1)}}function Rt(t,i){if(t&1&&(a(0,"spk-select",10)(1,"label",11),l(2,"Encryption"),o(),m(3,"input",12),k(4,13),D(5,Nt,2,2,"option",14,w),v(),o(),f(7,At,16,4,"div",15)),t&2){let e,n=p();d("displayValue",n.displayFn((e=n.generalForm.value.encryption)!==null&&e!==void 0?e:"")),s(5),T(n.encryptionOptions()),s(2),_(n.encryptionFieldSignal()!=="none"?7:-1)}}var Oe=new I,St=(t={name:"",description:"",encryption:"none",password:"",repeatPassword:""})=>Oe.group({name:Oe.control(t.name,[he.required]),description:Oe.control(t.description),encryption:Oe.control(t.encryption,[he.required,xt()]),password:Oe.control(t.password,[Ye(i=>i?.value.encryption!=="none",[he.required])]),repeatPassword:Oe.control(t.repeatPassword,[Ye(i=>i?.value.encryption!=="none",[he.required])])}),Ze={Key:"none",DisplayName:"None"},Je=class t{#e=h(R);#t=h(W);#n=h(qe);#i=h(M);#o=h(ge);formRef=U.required("formRef");generalForm=this.#i.generalForm;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=S(!1);copiedPassword=S(!1);showCopyPassword=S(!1);ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit()}async copyPassword(){let i=this.generalForm.controls.password.value;await this.#a(i??""),this.copiedPassword.set(!0)}async#a(i){try{await navigator.clipboard.writeText(i)}catch{try{let n=document.createElement("textarea");n.value=i,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}displayFn(i){let e=this.#o.systemInfo()?.EncryptionModules??[],n=[Ze,...e].find(r=>r.Key===i);return n?`${n.DisplayName}`:""}generatePassword(){this.copiedPassword.set(!1);let i=this.#n.generate(16);this.generalForm.controls.password.setValue(i),this.generalForm.controls.repeatPassword.setValue(i),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&j(n.formRef,Et,5),e&2&&q()},standalone:!0,features:[Q],decls:23,vars:4,consts:[["formRef",""],["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder","Your backup name","formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder","Your backup description","formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],[3,"displayValue"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder","Encryption","formControlName","encryption"],["options",""],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","placeholder","Password","formControlName","password",3,"type"],["id","repeatPassword","tabindex","5","placeholder","Repeat password","formControlName","repeatPassword",3,"type"],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]],template:function(e,n){if(e&1){let r=F();a(0,"form",1,0),y("submit",function(){return g(r),C(n.next())}),a(2,"h3",2),l(3,"General backup settings"),o(),a(4,"spk-form-field")(5,"label",3),l(6,"Backup name"),o(),m(7,"input",4),o(),a(8,"spk-form-field")(9,"label",5),l(10,"Backup description"),o(),m(11,"textarea",6),o(),f(12,Rt,8,2),a(13,"div",7)(14,"button",8),y("click",function(){return g(r),C(n.exit())}),a(15,"spk-icon"),l(16,"arrow-left"),o(),l(17," Exit "),o(),a(18,"div")(19,"button",9)(20,"spk-icon"),l(21,"arrow-right"),o(),l(22," Continue "),o()()()()}e&2&&(d("formGroup",n.generalForm),s(12),_(n.isNew()?12:-1),s(6),$("spk-tooltip-primary",n.generalForm.valid&&n.encryptionFieldSignal()==="none"||n.copiedPassword()?void 0:"Remember to copy the password"),s(),d("disabled",n.generalForm.invalid||n.encryptionFieldSignal()!=="none"&&n.showCopyPassword()&&!n.copiedPassword()))},dependencies:[ie,Z,te,ne,H,Y,J,X,ee,ae,re,fe,oe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var Mt=["formRef"];function Bt(t,i){if(t&1&&(a(0,"option",9),l(1),o()),t&2){let e=i.$implicit;d("value",e),s(),G(e)}}function $t(t,i){if(t&1&&(a(0,"option",9),l(1),o()),t&2){let e=i.$implicit;d("value",e),s(),G(e)}}function Lt(t,i){if(t&1){let e=F();a(0,"button",22),y("click",function(){let r=g(e).$implicit,c=p();return C(c.addNewOption(r))}),l(1),o()}if(t&2){let e=i.$implicit;s(),G(e.Name)}}function zt(t,i){t&1&&(a(0,"label",23),l(1,"Name"),o())}function Ut(t,i){t&1&&(a(0,"label",25),l(1,"Value"),o())}function jt(t,i){if(t&1){let e=F();a(0,"div",18)(1,"spk-form-field"),f(2,zt,2,0,"label",23),m(3,"input",24),o(),a(4,"spk-form-field"),f(5,Ut,2,0,"label",25),m(6,"input",26),o(),a(7,"button",27),y("click",function(){let r=g(e).$index,c=p();return C(c.optionsForm.controls.advancedOptions.removeAt(r))}),a(8,"spk-icon"),l(9,"x-circle"),o()()()}if(t&2){let e=i.$implicit,n=i.$index;d("formGroup",e),s(2),_(n===0?2:-1),s(3),_(n===0?5:-1)}}var me=new I,qt=["Bytes","KB","MB","GB","TB","PB"],Qt=["Local folder","Local drive","Remote drive","Cloud drive"],kt=(t={remoteVolumeSize:0,size:"GB",backupRetention:"Local folder",advancedOptions:[]})=>me.group({remoteVolumeSize:me.group({size:me.control(t.remoteVolumeSize),unit:me.control(t.size)}),backupRetention:me.control(t.backupRetention),advancedOptions:me.array([])}),et=(t,i)=>me.group({name:me.control(t),value:me.control(i)}),Xe=class t{#e=h(ge);#t=h(M);#n=h(R);#i=h(W);formRef=U.required("formRef");optionsForm=this.#t.optionsForm;sizeOptions=S(qt);rentationOptions=S(Qt);selectionAdvancedOptions=Se(this.optionsForm.controls.advancedOptions.valueChanges.pipe(st([])));advancedOptions=S(this.#e.systemInfo()?.Options??[]);nonSelectedAdvancedOptions=K(()=>this.advancedOptions().filter(i=>this.selectionAdvancedOptions()?.findIndex(e=>e.name===i.Name)===-1));addNewOption(i){this.optionsForm.controls.advancedOptions.push(et(i.Name,i.DefaultValue))}displayFn(){let i=this.advancedOptions();return e=>{let n=i.find(r=>r.Name===e);return n?`${n.Name}`:""}}goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-options"]],viewQuery:function(e,n){e&1&&j(n.formRef,Mt,5),e&2&&q()},standalone:!0,features:[Q],decls:49,vars:2,consts:[["formRef",""],[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder","Select an option...","formControlName","unit"],["options",""],[3,"value"],["href","#",1,"spk-primary"],["type","text","placeholder","Local folder or drive","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["spk-menu-item","","type","button"],["formArrayName","advancedOptions"],[1,"advanced-option",3,"formGroup"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["spk-menu-item","","type","button",3,"click"],["for","name"],["type","text","id","name","formControlName","name"],["for","value"],["type","text","id","value","formControlName","value"],["spk-button","","type","button",1,"icon",3,"click"]],template:function(e,n){if(e&1){let r=F();a(0,"form",1,0),y("submit",function(){return g(r),C(n.submit())}),a(2,"h3",2),l(3,"Options"),o(),a(4,"div",3)(5,"div",4)(6,"spk-form-field")(7,"label",5),l(8,"Remote volume size"),o(),m(9,"input",6),o(),a(10,"spk-select"),m(11,"input",7),k(12,8),D(13,Bt,2,2,"option",9,w),v(),o()(),a(15,"p"),l(16," The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. "),a(17,"a",10),l(18,"Read more"),o()()(),a(19,"spk-select")(20,"label",5),l(21,"Backup retention"),o(),m(22,"input",11),k(23,8),D(24,$t,2,2,"option",9,w),v(),o(),a(26,"app-toggle-card",12),k(27,13),l(28," Advanced options "),a(29,"spk-menu")(30,"button",14),l(31," Add advanced option "),a(32,"spk-icon"),l(33,"plus"),o()(),k(34,15),D(35,Lt,2,1,"button",16,w),v(),o(),v(),k(37,17),D(38,jt,10,3,"div",18,w),v(),o(),a(40,"div",19)(41,"button",20),y("click",function(){return g(r),C(n.goBack())}),a(42,"spk-icon"),l(43,"arrow-left"),o(),l(44," Go back "),o(),a(45,"button",21)(46,"spk-icon"),l(47,"arrow-right"),o(),l(48," Submit "),o()()()}e&2&&(d("formGroup",n.optionsForm),s(13),T(n.sizeOptions()),s(11),T(n.rentationOptions()),s(2),d("disallowToggle",!0),s(9),T(n.nonSelectedAdvancedOptions()),s(3),T(n.optionsForm.controls.advancedOptions.controls))},dependencies:[ie,Z,te,ne,H,ue,Y,J,X,ee,_e,Le,ze,re,fe,oe,ae,Ce],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Kt=["formRef"];function Wt(t,i){if(t&1&&(a(0,"option",24),l(1),o()),t&2){let e=i.$implicit;d("value",e.key),s(),G(e.label)}}function Ht(t,i){if(t&1){let e=F();a(0,"div",11)(1,"spk-form-field")(2,"label",12),l(3,"Next time"),o(),a(4,"input",13,1),y("focus",function(){g(e);let r=xe(5);return C(r.showPicker())}),o(),a(6,"spk-icon",14),l(7,"clock"),o()(),a(8,"spk-form-field"),m(9,"label",15),a(10,"input",16,2),y("focus",function(){g(e);let r=xe(11);return C(r.showPicker())}),o(),a(12,"spk-icon",14),l(13,"calendar"),o()()(),k(14,17),a(15,"div",18)(16,"spk-form-field")(17,"label",19),l(18,"Run again every"),o(),m(19,"input",20),o(),a(20,"spk-select",21),m(21,"input",22),k(22,23),D(23,Wt,2,2,"option",24,w),v(),o()(),a(25,"app-toggle-card",25),k(26,26),l(27,"Allowed days"),v(),a(28,"div",27)(29,"spk-toggle",6),l(30," Monday "),m(31,"input",28),o(),a(32,"spk-toggle",6),l(33," Tuesday "),m(34,"input",29),o(),a(35,"spk-toggle",6),l(36," Wednesday "),m(37,"input",30),o(),a(38,"spk-toggle",6),l(39," Thursday "),m(40,"input",31),o(),a(41,"spk-toggle",6),l(42," Friday "),m(43,"input",32),o(),a(44,"spk-toggle",6),l(45," Saturday "),m(46,"input",33),o(),a(47,"spk-toggle",6),l(48," Sunday "),m(49,"input",34),o()()(),v()}if(t&2){let e=p();s(20),d("displayFn",e.displayFn),s(3),T(e.unitOptions),s(2),d("disallowToggle",!0)}}var P=new I,vt=[{key:"s",label:"Seconds"},{key:"m",label:"Minutes"},{key:"h",label:"Hours"},{key:"D",label:"Days"},{key:"W",label:"Weeks"},{key:"M",label:"Months"},{key:"Y",label:"Years"}],Ft=(t={autoRun:!1,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>P.group({autoRun:P.control(t.autoRun),nextTime:P.group({time:P.control(t.nextTime.time),date:P.control(t.nextTime.date)}),runAgain:P.group({repeatValue:P.control(t.runAgain.repeatValue),repeatUnit:P.control(t.runAgain.repeatUnit),allowedDays:P.group({mon:P.control(t.runAgain.allowedDays.mon),tue:P.control(t.runAgain.allowedDays.tue),wed:P.control(t.runAgain.allowedDays.wed),thu:P.control(t.runAgain.allowedDays.thu),fri:P.control(t.runAgain.allowedDays.fri),sat:P.control(t.runAgain.allowedDays.sat),sun:P.control(t.runAgain.allowedDays.sun)})})}),tt=class t{#e=h(M);#t=h(R);#n=h(W);formRef=U.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=vt;displayFn(i){let e=vt.find(n=>n.key===i);return e?`${e.label}`:""}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-schedule"]],viewQuery:function(e,n){e&1&&j(n.formRef,Kt,5),e&2&&q()},standalone:!0,features:[Q],decls:20,vars:2,consts:[["formRef",""],["timeRef",""],["dateRef",""],[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["spkSuffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],["options",""],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]],template:function(e,n){if(e&1){let r=F();a(0,"form",3,0),y("submit",function(){return g(r),C(n.next())}),a(2,"h3",4),l(3,"Schedule"),o(),a(4,"div",5)(5,"spk-toggle",6),l(6," Automatically run backups "),m(7,"input",7),o(),a(8,"p"),l(9,"If a date was missed, the job will run as soon as possible."),o()(),f(10,Ht,50,2),a(11,"div",8)(12,"button",9),y("click",function(){return g(r),C(n.goBack())}),a(13,"spk-icon"),l(14,"arrow-left"),o(),l(15," Go back "),o(),a(16,"button",10)(17,"spk-icon"),l(18,"arrow-right"),o(),l(19," Continue "),o()()()}if(e&2){let r;d("formGroup",n.scheduleForm),s(10),_((r=n.scheduleFormSignal())!=null&&r.autoRun?-1:10)}},dependencies:[ie,Z,te,ne,H,ue,we,Y,J,X,ee,_e,ae,re,De,oe,fe,Ce],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Yt=["formRef"];function Jt(t,i){if(t&1&&(a(0,"option",21),l(1),o()),t&2){let e=i.$implicit;d("value",e),s(),G(e)}}function Zt(t,i){if(t&1&&(a(0,"div",14)(1,"spk-form-field"),m(2,"input",18),o(),a(3,"spk-select"),m(4,"input",19),k(5,20),D(6,Jt,2,2,"option",21,w),v(),o()()),t&2){let e=p(2);s(6),T(e.sizeOptions())}}function Xt(t,i){if(t&1){let e=F();a(0,"form",2,0),y("submit",function(){g(e);let r=p();return C(r.next())}),a(2,"h3",3),l(3,"Source Data"),o(),a(4,"app-file-tree",4)(5,"label",5),l(6,"Folder path"),o(),m(7,"input",6),o(),a(8,"app-toggle-card",7),k(9,8),l(10,"Exclude"),v(),a(11,"spk-toggle",9),l(12," Hidden files "),m(13,"input",10),o(),a(14,"spk-toggle",9),l(15," System files "),m(16,"input",11),o(),a(17,"spk-toggle",9),l(18," Temporary files "),m(19,"input",12),o(),a(20,"spk-toggle",13),y("click",function(){g(e);let r=p();return C(r.toggleFilesLargerThan())}),l(21," Files larger than "),o(),f(22,Zt,8,0,"div",14),o(),a(23,"div",15)(24,"button",16),y("click",function(){g(e);let r=p();return C(r.goBack())}),a(25,"spk-icon"),l(26,"arrow-left"),o(),l(27," Go back "),o(),a(28,"button",17)(29,"spk-icon"),l(30,"arrow-right"),o(),l(31," Continue "),o()()()}if(t&2){let e=p();d("formGroup",e.sourceDataForm),s(4),d("multiSelect",!0)("startingPath",e.getPath()),s(4),d("isActive",!0),s(12),pt("active",e.filesLargerThan()),s(2),_(e.filesLargerThan()?22:-1)}}var ce=new I,en=["Bytes","KB","MB","GB","TB","PB"],tn=["Contains","Does not contain","Is greater than","Is less than"];var bt=(t={path:"",excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>ce.group({path:ce.control(t.path),excludes:ce.group({hidden:ce.control(t.excludes.hidden),system:ce.control(t.excludes.system),temporary:ce.control(t.excludes.temporary),filesLargerThan:ce.group({size:ce.control(null),unit:ce.control(null)})})}),nt=class t{#e=h(M);#t=h(R);#n=h(W);formRef=U.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;destinationIsLoaded=this.#e.destinationIsLoaded;filesLargerThan=K(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=S(en);expressionOptions=S(tn);getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#n.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&j(n.formRef,Yt,5),e&2&&q()},standalone:!0,features:[Q],decls:1,vars:1,consts:[["formRef",""],[3,"formGroup"],[3,"submit","formGroup"],[1,"title-30"],[3,"multiSelect","startingPath"],["for","path"],["type","text","id","path","tabindex","4","placeholder","Path","formControlName","path"],["formGroupName","excludes",3,"isActive"],["title",""],[1,"raised","primary"],["type","checkbox","placeholder","Hidden files","formControlName","hidden"],["type","checkbox","placeholder","System files","formControlName","system"],["type","checkbox","placeholder","Temporary files","formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder","Select an option..."],["options",""],[3,"value"]],template:function(e,n){e&1&&f(0,Xt,32,7,"form",1),e&2&&_(n.destinationIsLoaded()?0:-1)},dependencies:[ie,Z,te,ne,H,ue,we,Y,J,X,ee,_e,ae,oe,fe,re,De,Ue,Ce],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}.filter-inputs[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end}.filter-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.filter-inputs[_ngcontent-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var L=new I,M=class t{#e=h(R);#t=h(ge);#n=h(ft);#i=h(je);#o=h(yt);destinationOptions=this.#t.backendModules;isDraft=S(!1);backupId=S(null);isSubmitting=S(!1);loadingBackup=S(!1);loadingDefaults=S(!0);destinationIsLoaded=S(!1);isNew=K(()=>this.backupId()==="new");backupDefaults=S(null);generalForm=St();sourceDataForm=bt();scheduleForm=Ft();destinationForm=wt();optionsForm=kt();selectedAdvancedFormPair=S([]);notSelectedAdvancedFormPair=S([]);destinationFormPair=S({oauthField:null,custom:[],dynamic:[],advanced:[]});sourceDataFormSignal=Se(this.sourceDataForm.valueChanges);destinationFormSignal=Se(this.destinationForm.valueChanges);encryptionFieldSignal=Se(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=Se(this.scheduleForm.valueChanges);encryptionOptions=K(()=>{let i=this.#t.systemInfo()?.EncryptionModules??[];return[Ze,...i]});init(i="new",e=!1){this.backupId.set(i),i!=="new"?this.getBackup(i,e):this.getDefaults()}submit(){this.isSubmitting.set(!0);let i=this.#m(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#n.postApiV1Backups({requestBody:i}).pipe(ye(()=>this.isSubmitting.set(!1))).subscribe({next:n=>{console.log("submitted res",n),this.exit()},error:n=>{console.error("submitted error",n)}}):this.#n.putApiV1BackupById({id:e,requestBody:i}).pipe(ye(()=>this.isSubmitting.set(!1))).subscribe({next:n=>{console.log("submitted res",n),this.exit()},error:n=>{console.error("submitted error",n)}})}exit(){this.#u(),this.#e.navigate(["/"])}getDefaults(){this.loadingDefaults.set(!0),this.#n.getApiV1Backupdefaults().pipe(lt(1),ye(()=>this.loadingDefaults.set(!1))).subscribe({next:i=>{this.#s(i.Schedule),this.#p(i.Backup),this.backupDefaults.set(i),this.destinationIsLoaded.set(!0)}})}getBackup(i,e=!1){this.loadingBackup.set(!0);let n=r=>{this.#s(r.Schedule??null),r.Backup&&(this.#l(r.Backup),this.#r(r.Backup),this.#a(r.Backup),this.#p(r.Backup)),this.destinationIsLoaded.set(!0)};if(e){this.isDraft.set(e);let r=this.#o.draftBackups().find(c=>c.id===i);if(!r){this.loadingBackup.set(!1),alert("Backup not found");return}n(r.data)}else this.#n.getApiV1BackupById({id:i}).pipe(ye(()=>this.loadingBackup.set(!1))).subscribe({next:n})}#a(i){let e=i.Sources??"",n=i.Filters?.map(O=>`${O.Include?"":"-"}${O.Expression}`)??[],r=i.Settings?.find(O=>O.Name==="--exclude-files-attributes")?.Value??"",c=i.Settings?.find(O=>O.Name==="--skip-files-larger-than")??null,b=c?.Value.replace(/[0-9]/g,"")??null,B=c?.Value.replace(/[^0-9]/g,"")??null,le={path:[...e,...n].join("\0"),excludes:{hiddenFiles:r.includes("hidden"),systemFiles:r.includes("system"),tempFiles:r.includes("temporary"),filesLargerThan:b&&B?{size:parseInt(B),unit:b.toUpperCase()}:null}};this.sourceDataForm.patchValue(le)}#r(i){let e=i.TargetURL?ht(i.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced})}#l(i){let e=i.Settings?.find(r=>r.Name==="encryption-module"),n=e?.Value&&e.Value.length?e.Value:"none";this.generalForm.patchValue({name:i.Name??"",description:i.Description??"",encryption:n})}#s(i){if(!i){this.scheduleForm.patchValue({autoRun:!0});return}let e=this.#i.fromString(i.Repeat)??null,r={nextTime:this.#d(i.Time),runAgain:{repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:i.AllowedDays?.includes("mon")??!1,tue:i.AllowedDays?.includes("tue")??!1,wed:i.AllowedDays?.includes("wed")??!1,thu:i.AllowedDays?.includes("thu")??!1,fri:i.AllowedDays?.includes("fri")??!1,sat:i.AllowedDays?.includes("sat")??!1,sun:i.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(r)}#p(i){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"];i.Settings?.forEach(n=>{if(n.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(n.Value??"None");n.Name&&e.includes(n.Name)||n.Name&&n.Value&&this.optionsForm.controls.advancedOptions.push(et(n.Name,n.Value))})}#m(){let i=this.generalForm.value,e=this.optionsForm.value,n=this.scheduleForm.value,r=this.sourceDataForm.value,b=this.destinationForm.value.destinations?.length?this.#c(this.destinationForm.controls.destinations):[],B=null;n.runAgain?.repeatUnit&&n.runAgain?.repeatValue&&(B=this.#i.toString(n.runAgain.repeatValue,n.runAgain.repeatUnit));let le=n.runAgain?.allowedDays?Object.entries(n.runAgain?.allowedDays).filter(([x,E])=>E).map(([x,E])=>x):[],O=r.path?.split("\0")??[],Ge=e.advancedOptions?.map(x=>({Name:x.name??null,Value:x.value&&x.value.length?x.value.toString():null}))??[],Fe=[i.encryption==="none"?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:i.encryption??null},...Ge.filter(x=>x.Name&&x.Value)],V=Object.entries(r.excludes??{}).filter(([x,E])=>E&&x!=="filesLargerThan").map(([x])=>x),u=r.excludes?.filesLargerThan;return V.length&&Fe.push({Name:"--exclude-files-attributes",Value:V.join(",")}),u&&u.size!==null&&u.unit!==null&&Fe.push({Name:"--skip-files-larger-than",Value:`${u.size}${u.unit}`}),{Backup:{Name:i.name,Description:i.description,TargetURL:b[0]??null,Sources:O.filter(x=>!x.startsWith("-")),Settings:Fe,Filters:O.filter(x=>x.startsWith("-")).map((x,E)=>({Order:E,Include:!1,Expression:x.slice(1)}))},Schedule:n.autoRun?null:{Repeat:B,Time:n.nextTime?.date?new Date(`${n.nextTime.date}T${n.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:le}}}#c(i){return i.controls.map(e=>{if(!e.controls.advanced)return Ne(e.value);let n=Object.keys(e.controls.advanced.controls).filter(r=>e.controls.advanced.controls[r].dirty);return Ne(Re(se({},e.value),{advanced:n.reduce((r,c)=>(r[c]=e.controls.advanced.controls[c].value,r),{})}))})}#d(i){if(!i||i?.indexOf("T")===-1)return{time:i??"13:00"};let e=new Date(i),n={time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`};return i.indexOf("T")!==-1&&(n.date=e.toISOString().split("T")[0]),n}addDestinationFormGroup(i,e){let n=this.destinationOptions().find(V=>V.Key===i);if(!n||!n.Options)return;let r=Ve.hasOwnProperty(i)&&Ve[i],c=r&&r.customFields?r.customFields:{},b=r&&r.dynamicFields?r.dynamicFields:[],B=r&&r.advancedFields?r.advancedFields:[],le=r&&r.oauthField?r.oauthField:null;this.destinationFormPair.set({oauthField:le,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]);let O=L.group({}),Ge=L.group({}),He=L.group({});if(c)for(i in c){let Fe=c[i],{formElement:V}=Fe,u=rt(Fe,["formElement"]);O.addControl(i,V(e?.custom[i])),this.destinationFormPair.update(x=>(x.custom.push(u),x))}for(let V=0;V<n.Options.length;V++){let u=n.Options[V];if(u.Deprecated)continue;let x=b.includes(u.Name),E=x?Ge:He;this.destinationFormPair.update(Pe=>(Pe[x?"dynamic":"advanced"].push({name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues}),Pe));let de=(x?e?.dynamic[u.Name]:e?.advanced[u.Name])??u.DefaultValue;if(u.Type==="String"||u.Type==="Password"||u.Type==="Enumeration"||u.Type==="Path"){E.addControl(u.Name,L.control(de));continue}if(u.Type==="Size"){let Pe=de.replace(/[0-9]/g,""),at=de.replace(/[^0-9]/g,"");E.addControl(u.Name,L.group({size:L.control(at?parseInt(at):50),unit:L.control(Pe?Pe.toUpperCase():"MB")}))}if(u.Type==="Integer"){E.addControl(u.Name,L.control(de?parseInt(de):0));continue}if(u.Type==="Boolean"){E.addControl(u.Name,L.control(de==="true"));continue}if(u.Type==="Flags"){E.addControl(u.Name,L.control(de??""));continue}u.Type==="Timespan"&&E.addControl(u.Name,L.control(de,[he.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]))}this.destinationForm.controls.destinations.length!==0&&this.destinationForm.controls.destinations.removeAt(0),this.destinationFormPair.update(V=>({oauthField:V.oauthField,custom:V.custom,dynamic:V.dynamic.sort((u,x)=>b.indexOf(u.name)-b.indexOf(x.name)),advanced:V.advanced.sort((u,x)=>{let E=B.indexOf(u.name),Ae=B.indexOf(x.name);return E===-1&&Ae!==-1?1:E!==-1&&Ae===-1?-1:E-Ae})})),this.notSelectedAdvancedFormPair.set(this.destinationFormPair().advanced),this.destinationForm.controls.destinations.push(Dt({key:n.Key,customGroup:O,dynamicGroup:Ge,advancedGroup:He}))}#u(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.destinationForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=be({token:t,factory:t.\u0275fac,providedIn:"root"})};var nn=["formRef"],on=(t,i,e,n)=>({destination:t,destinationType:i,index:e,formGroupName:"custom",oauthField:n}),ot=t=>({$implicit:t}),an=(t,i,e,n)=>({destination:t,destinationType:i,index:e,formGroupName:"dynamic",oauthField:n}),rn=(t,i,e,n)=>({destination:t,destinationType:i,index:e,formGroupName:"advanced",oauthField:n});function ln(t,i){if(t&1){let e=F();a(0,"p",9),y("click",function(){g(e);let r=p(2);return C(r.removeDestinationFormGroup(r.destinationCount()-1))}),l(1," Wanna select another destination? "),a(2,"span",10),l(3,"Click here"),o()()}}function sn(t,i){if(t&1){let e=F();a(0,"div",11)(1,"div",12),y("click",function(){g(e);let r=p(2);return C(r.addDestinationFormGroup("file"))}),a(2,"h3"),l(3,"File system"),o(),a(4,"p"),l(5,"Store backups on your local file system."),o()(),a(6,"div",12),y("click",function(){g(e);let r=p(2);return C(r.addDestinationFormGroup("gcs"))}),a(7,"h3"),l(8,"Google Cloud Storage"),o(),a(9,"p"),l(10,"Store backups in Google Cloud Storage."),o()(),a(11,"div",12),y("click",function(){g(e);let r=p(2);return C(r.addDestinationFormGroup("s3"))}),a(12,"h3"),l(13,"S3 compatible bucket"),o(),a(14,"p"),l(15,"Store backups in any S3 compatible bucket."),o()(),a(16,"div",12),y("click",function(){g(e);let r=p(2);return C(r.addDestinationFormGroup("ssh"))}),a(17,"h3"),l(18,"SSH"),o(),a(19,"p"),l(20,"Store backups in SSH."),o()(),a(21,"div",12),y("click",function(){g(e);let r=p(2);return C(r.addDestinationFormGroup("googledrive"))}),a(22,"h3"),l(23,"Google Drive"),o(),a(24,"p"),l(25,"Store backups in Google Drive."),o()()(),a(26,"p"),l(27,"More destinations are coming soon."),o()}}function pn(t,i){t&1&&Me(0)}function mn(t,i){if(t&1&&f(0,pn,1,0,"ng-container",15),t&2){let e,n=i.$implicit,r=i.$index;p(2);let c=xe(6),b=p(2);d("ngTemplateOutlet",c)("ngTemplateOutletContext",Be(7,ot,$e(2,on,n,(e=b.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,r,b.destinationFormPair().oauthField)))}}function cn(t,i){if(t&1&&(k(0),D(1,mn,1,9,"ng-container",null,w),v()),t&2){let e=p(3);s(),T(e.destinationFormPair().custom)}}function dn(t,i){t&1&&Me(0)}function un(t,i){if(t&1&&f(0,dn,1,0,"ng-container",15),t&2){let e,n=i.$implicit,r=i.$index;p(2);let c=xe(6),b=p(2);d("ngTemplateOutlet",c)("ngTemplateOutletContext",Be(7,ot,$e(2,an,n,(e=b.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,r,b.destinationFormPair().oauthField)))}}function _n(t,i){if(t&1&&(k(0),D(1,un,1,9,"ng-container",null,w),v()),t&2){let e=p(3);s(),T(e.destinationFormPair().dynamic)}}function fn(t,i){if(t&1){let e=F();a(0,"button",20),y("click",function(){let r=g(e).$implicit,c=p(4);return C(c.addAdvancedFormPair(r))}),l(1),o()}if(t&2){let e=i.$implicit;s(),A(" ",e.name," ")}}function gn(t,i){t&1&&Me(0)}function Cn(t,i){if(t&1&&f(0,gn,1,0,"ng-container",15),t&2){let e,n=i.$implicit,r=i.$index;p(2);let c=xe(6),b=p(2);d("ngTemplateOutlet",c)("ngTemplateOutletContext",Be(7,ot,$e(2,rn,n,(e=b.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,r,b.destinationFormPair().oauthField)))}}function yn(t,i){if(t&1&&(a(0,"app-toggle-card",14),k(1,16),l(2," Advanced options "),a(3,"spk-menu")(4,"button",17),l(5," Add advanced option "),a(6,"spk-icon"),l(7,"plus"),o()(),k(8,18),D(9,fn,2,1,"button",19,w),v(),o(),v(),k(11),D(12,Cn,1,9,"ng-container",null,w),v(),o()),t&2){let e=p(3);d("disallowToggle",!0),s(9),T(e.notSelectedAdvancedFormPair()),s(3),T(e.selectedAdvancedFormPair())}}function xn(t,i){if(t&1&&(a(0,"spk-icon",27),l(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function hn(t,i){if(t&1&&(a(0,"app-file-tree",22)(1,"label",26),l(2),f(3,xn,2,1,"spk-icon",27),o(),m(4,"input",28),o()),t&2){let e,n=p().$implicit,r=p(3);d("startingPath",r.getFormFieldValue(n.index,n.formGroupName,n.destination.name)),s(),mt("for","destination-",n.formGroupName,"-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name)}}function Sn(t,i){if(t&1&&(a(0,"spk-icon",27),l(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function kn(t,i){t&1&&(a(0,"spk-icon",29),l(1,"link"),o())}function vn(t,i){t&1&&(a(0,"spk-icon",29),l(1,"textbox"),o())}function Fn(t,i){if(t&1&&(a(0,"spk-form-field")(1,"label",26),l(2),f(3,Sn,2,1,"spk-icon",27),o(),m(4,"input",28),f(5,kn,2,0,"spk-icon",29)(6,vn,2,0,"spk-icon",29),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name),s(),_(n.destination.type==="Path"?5:6)}}function bn(t,i){if(t&1){let e=F();a(0,"span",33),y("click",function(){g(e);let r=p(2).$implicit,c=p(3);return C(c.oauthStartTokenCreation(r.destinationType))}),l(1,"AuthID"),o()}}function wn(t,i){t&1&&(a(0,"spk-icon",29),l(1,"password"),o())}function Dn(t,i){if(t&1){let e=F();a(0,"spk-icon",34),y("click",function(){g(e);let r=p(2).$implicit;return C(r.destination.showPassword=!r.destination.showPassword)}),l(1," eye "),o()}}function Tn(t,i){if(t&1){let e=F();a(0,"spk-icon",34),y("click",function(){g(e);let r=p(2).$implicit;return C(r.destination.showPassword=!r.destination.showPassword)}),l(1," eye-slash "),o()}}function En(t,i){if(t&1&&(a(0,"spk-form-field")(1,"label",26),l(2),o(),m(3,"input",30),f(4,bn,2,0,"span",31)(5,wn,2,0,"spk-icon",29)(6,Dn,2,0,"spk-icon",32)(7,Tn,2,0,"spk-icon",32),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),ct(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," -- ",n.oauthField," ",n.destinationType," ",n.destination.name," "),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name),d("type",n.destination.showPassword?"text":"password"),s(),_(n.oauthField===n.destination.name?4:5),s(2),_(n.destination.showPassword?6:7)}}function Nn(t,i){if(t&1&&(a(0,"spk-icon",27),l(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function On(t,i){if(t&1&&(a(0,"option",37),l(1),o()),t&2){let e=i.$implicit;d("value",e),s(),G(e)}}function Pn(t,i){if(t&1&&(a(0,"spk-select")(1,"label",26),l(2),f(3,Nn,2,1,"spk-icon",27),o(),m(4,"input",35),k(5,36),D(6,On,2,2,"option",37,w),v(),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name),s(2),T(n.destination.options)}}function Vn(t,i){if(t&1&&(a(0,"spk-icon",27),l(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function In(t,i){if(t&1&&(a(0,"option",37),l(1),o()),t&2){let e=i.$implicit;d("value",e),s(),G(e)}}function Gn(t,i){if(t&1&&(a(0,"div",23)(1,"label",26),l(2),f(3,Vn,2,1,"spk-icon",27),o(),a(4,"div",38)(5,"spk-form-field"),m(6,"input",39),a(7,"spk-icon",29),l(8,"resize"),o()(),a(9,"spk-select"),m(10,"label")(11,"input",40),k(12,36),D(13,In,2,2,"option",37,w),v(),o()()()),t&2){let e,n=p().$implicit,r=p(3);d("formGroupName",n.destination.name),s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(3),N("id","destination-",n.formGroupName,"-",n.index,""),s(7),T(r.sizeOptions())}}function An(t,i){if(t&1&&(a(0,"spk-icon",27),l(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Rn(t,i){if(t&1&&(a(0,"spk-form-field")(1,"label",26),l(2),f(3,An,2,1,"spk-icon",27),o(),m(4,"input",41),a(5,"spk-icon",29),l(6,"numpad"),o()()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name)}}function Mn(t,i){if(t&1&&(a(0,"spk-icon",27),l(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Bn(t,i){if(t&1&&(a(0,"spk-toggle",24)(1,"label",26),l(2),f(3,Mn,2,1,"spk-icon",27),o(),m(4,"input",42),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name)}}function $n(t,i){if(t&1&&(a(0,"spk-icon",27),l(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Ln(t,i){t&1&&(a(0,"spk-option",44),l(1,"None"),o()),t&2&&d("value","None")}function zn(t,i){if(t&1&&(a(0,"spk-option",37),l(1),m(2,"spk-checkbox",45),o()),t&2){let e=p().$implicit;d("value",e),s(),A(" ",e," ")}}function Un(t,i){if(t&1&&f(0,Ln,2,1,"spk-option",44)(1,zn,3,2,"spk-option",37),t&2){let e=i.$implicit;_(e==="None"?0:1)}}function jn(t,i){if(t&1&&(a(0,"spk-select",25)(1,"label",26),l(2),f(3,$n,2,1,"spk-icon",27),o(),m(4,"input",43),k(5,36),D(6,Un,2,1,null,null,w),v(),o()),t&2){let e,n=p().$implicit;d("selectMultiple",!0),s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),pe("formControlName",n.destination.name),s(2),T(n.destination.options)}}function qn(t,i){if(t&1&&(a(0,"spk-icon",27),l(1," question "),o()),t&2){let e=p(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Qn(t,i){if(t&1&&(a(0,"spk-form-field")(1,"label",26),l(2),f(3,qn,2,1,"spk-icon",27),o(),m(4,"input",28)(5,"span",46),o()),t&2){let e,n=p().$implicit;s(),N("for","destination-",n.formGroupName,"-",n.index,""),s(),A(" ",(e=n.destination.shortDescription)!==null&&e!==void 0?e:n.destination.name," "),s(),_(n.destination.longDescription?3:-1),s(),N("id","destination-",n.formGroupName,"-",n.index,""),pe("formControlName",n.destination.name)}}function Kn(t,i){if(t&1&&(k(0,21),f(1,hn,5,11,"app-file-tree",22)(2,Fn,7,10,"spk-form-field")(3,En,8,14,"spk-form-field")(4,Pn,8,9,"spk-select")(5,Gn,15,9,"div",23)(6,Rn,7,9,"spk-form-field")(7,Bn,5,9,"spk-toggle",24)(8,jn,8,7,"spk-select",25)(9,Qn,6,9,"spk-form-field"),v()),t&2){let e=i.$implicit;d("formGroupName",e.formGroupName),s(),_(e.destination.type==="file-tree"?1:e.destination.type==="String"||e.destination.type==="Path"?2:e.destination.type==="Password"?3:e.destination.type==="Enumeration"?4:e.destination.type==="Size"?5:e.destination.type==="Integer"?6:e.destination.type==="Boolean"?7:e.destination.type==="Flags"?8:e.destination.type==="Timespan"?9:-1)}}function Wn(t,i){if(t&1&&(k(0,5)(1,13),f(2,cn,3,0,"ng-container")(3,_n,3,0,"ng-container")(4,yn,14,1,"app-toggle-card",14)(5,Kn,10,2,"ng-template",null,1,dt),v()()),t&2){let e=p(2);s(2),_(e.destinationFormPair().custom.length?2:-1),s(),_(e.destinationFormPair().dynamic.length?3:-1),s(),_(e.destinationFormPair().advanced.length?4:-1)}}function Hn(t,i){if(t&1){let e=F();a(0,"form",3,0),y("submit",function(){g(e);let r=p();return C(r.next())}),a(2,"header")(3,"h3",4),l(4,"Backup destination"),o(),f(5,ln,4,0,"p"),o(),f(6,sn,28,0)(7,Wn,7,3,"ng-container",5),a(8,"div",6)(9,"button",7),y("click",function(){g(e);let r=p();return C(r.goBack())}),a(10,"spk-icon"),l(11,"arrow-left"),o(),l(12," Go back "),o(),a(13,"button",8)(14,"spk-icon"),l(15,"arrow-right"),o(),l(16," Continue "),o()()()}if(t&2){let e,n=p();d("formGroup",n.destinationForm),s(5),_(n.destinationCount()>0?5:-1),s(),_(n.destinationCount()===0?6:-1),s(),_(!((e=n.destinationFormSignal())==null||e.destinations==null)&&e.destinations.length?7:-1)}}var Yn=["Bytes","KB","MB","GB","TB","PB"],We=new I,wt=(t={destinations:[]})=>We.group({destinations:We.array(t.destinations)}),Dt=({key:t,customGroup:i,dynamicGroup:e,advancedGroup:n})=>We.group({destinationType:We.control(t),custom:i,dynamic:e,advanced:n}),it=class t{#e=h(R);#t=h(W);#n=h(ge);#i=h(_t);#o=h(M);formRef=U.required("formRef");sysIsLoaded=this.#n.isLoaded;destinationIsLoaded=this.#o.destinationIsLoaded;destinationForm=this.#o.destinationForm;destinationFormPair=this.#o.destinationFormPair;selectedAdvancedFormPair=this.#o.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#o.notSelectedAdvancedFormPair;destinationOptions=this.#o.destinationOptions;destinationFormSignal=this.#o.destinationFormSignal;destinationCount=K(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=S(Yn);getFormFieldValue(i,e,n){return((this.destinationForm.controls.destinations.controls?.[i]).controls?.[e]).controls[n].value}addDestinationFormGroup(i){this.#o.addDestinationFormGroup(i)}addAdvancedFormPair(i){this.selectedAdvancedFormPair.update(e=>(e.push(i),e)),this.notSelectedAdvancedFormPair.update(e=>(e=e.filter(n=>n.name!==i.name),e))}targetUrl=K(()=>{let i=this.destinationFormSignal()?.destinations?.[0];return i?Ne(i):""});mapToTargetUrl(i){return Ne(i.value)}removeDestinationFormGroup(i){this.destinationForm.controls.destinations.removeAt(i)}displayFn(i){let e=this.destinationOptions().find(n=>n.Key===i);return e?`${e.DisplayName}`:""}goBack(){this.#e.navigate(["general"],{relativeTo:this.#t.parent})}next(){this.#e.navigate(["source-data"],{relativeTo:this.#t.parent})}#a=S("https://duplicati-oauth-handler.appspot.com/").asReadonly();#r=S(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#l=S(!1);#s=S(null);keyCreation(){}oauthStartTokenCreation(i){this.#l.set(!0);let e=450,n=600,r=this.#a()+"?type="+i+"&token="+this.#r(),c=screen.width/2-e/2,b=screen.height/2-n/2,B=window.open(r,"_blank","height="+n+",width="+e+",menubar=0,status=0,titlebar=0,toolbar=0,left="+c+",top="+b);B?.addEventListener("blur",le=>{console.log("event blur",le)}),B?.addEventListener("beforeunload",le=>{console.log("event beforeunload",le),this.#i.get(this.#a()+"fetch?callback=JSON_CALLBACK",{params:{token:this.#r()}}).pipe(ye(()=>this.#l.set(!1))).subscribe({next:O=>{console.log("res",O),O?.authid&&this.#s.set(O.authid)}})})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-destination"]],viewQuery:function(e,n){e&1&&j(n.formRef,nn,5),e&2&&q()},standalone:!0,features:[Q],decls:1,vars:1,consts:[["formRef",""],["fieldTemplate",""],[3,"formGroup"],[3,"submit","formGroup"],[1,"title-30"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile",3,"click"],["formGroupName","0"],[3,"disallowToggle"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["spk-menu-item","","type","button"],["spk-menu-item","","type","button",3,"click"],[3,"formGroupName"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],[3,"for"],["spk-tooltip-right",""],["type","text",3,"id","formControlName"],["spkPrefix",""],[3,"type","id","formControlName"],["spkPrefix","",1,"link"],["spkSuffix","",1,"clickable"],["spkPrefix","",1,"link",3,"click"],["spkSuffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],["options",""],[3,"value"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"],["spkError",""]],template:function(e,n){e&1&&f(0,Hn,17,4,"form",2),e&2&&_(n.destinationOptions().length&&n.sysIsLoaded()&&n.destinationIsLoaded()?0:-1)},dependencies:[ie,Z,te,ne,H,ue,we,Y,J,X,ee,_e,Le,ut,ae,re,ze,gt,Ct,oe,De,Ce,Ue],styles:["[_nghost-%COMP%]{display:block}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[spkprefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}"],changeDetection:0})};export{wt as a,Dt as b,it as c,St as d,Ze as e,Je as f,kt as g,et as h,Xe as i,Ft as j,tt as k,bt as l,nt as m,M as n};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as M}from"./chunk-
|
|
2
|
-
`)):""),p(()=>this.isLoading.set(!1))));static \u0275fac=function(t){return new(t||n)};static \u0275cmp=m({type:n,selectors:[["app-general"]],standalone:!0,features:[v],decls:5,vars:2,consts:[[1,"indeterminate","primary"],[3,"innerHTML"]],template:function(t,s){t&1&&(d(0,D,1,0,"spk-progress-bar",0),y(1,"section")(2,"h3"),h(3,"General"),o(),r(4,"div",1),o()),t&2&&(C(s.isLoading()?0:-1),g(4),u("innerHTML",s.generalInfo(),c))},dependencies:[
|
|
1
|
+
import{b as M}from"./chunk-6PJU5W5X.js";import{l as k}from"./chunk-3SP3MQEU.js";import{c as S}from"./chunk-KLPRJO2S.js";import{a as b}from"./chunk-ZUVMWAQY.js";import{Bb as h,D as p,Ha as c,Hb as v,La as g,Ra as f,U as i,W as m,Ya as d,_a as u,db as C,hb as y,ib as o,jb as r,p as l}from"./chunk-NGPWOMCW.js";import"./chunk-7CGTOI24.js";function D(n,e){n&1&&r(0,"spk-progress-bar",0)}var a=class n{#e=i(S);#n=i(b);isLoading=f(!0);generalInfo=M(this.#n.getApiV1Acknowledgements().pipe(l(e=>e.Acknowledgements?this.#e.bypassSecurityTrustHtml(e.Acknowledgements.replace(/\r/g,`
|
|
2
|
+
`)):""),p(()=>this.isLoading.set(!1))));static \u0275fac=function(t){return new(t||n)};static \u0275cmp=m({type:n,selectors:[["app-general"]],standalone:!0,features:[v],decls:5,vars:2,consts:[[1,"indeterminate","primary"],[3,"innerHTML"]],template:function(t,s){t&1&&(d(0,D,1,0,"spk-progress-bar",0),y(1,"section")(2,"h3"),h(3,"General"),o(),r(4,"div",1),o()),t&2&&(C(s.isLoading()?0:-1),g(4),u("innerHTML",s.generalInfo(),c))},dependencies:[k],styles:["[_nghost-%COMP%]{display:block;position:relative}h3[_ngcontent-%COMP%]{font:var(--title-30)}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}spk-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}"],changeDetection:0})};export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m,b as u}from"./chunk-
|
|
1
|
+
import{a as m,b as u}from"./chunk-6PJU5W5X.js";import{C as l,I as f,Qa as v,U as b,Zb as V,_b as w,b as d,ba as I,ca as y,ja as S,k as j,n as h,q as c}from"./chunk-NGPWOMCW.js";function z(e,n,o){!n&&y(e);let i=n??b(S);return o?I(i,o):i}function C(...e){let{normalizedSources:n,hasInitValue:o,operator:i,options:r}=E(e),s=z(C,r?.injector);return o?u(c(n).pipe(i),{initialValue:r.initialValue,injector:s}):u(c(n).pipe(i),{injector:s,requireSync:!0})}function E(e){if(!e||!e.length||typeof e[0]!="object")throw new TypeError("derivedFrom needs sources");let n=typeof e[1]=="function";if(e.length==3&&!n)throw new TypeError("derivedFrom needs pipeable operator as a second argument");n||e.splice(1,0,d);let[o,i,r]=e,s=r?.initialValue!==void 0;return{normalizedSources:Object.entries(o).reduce((p,[a,t])=>{if(v(t))p[a]=m(t,{injector:r?.injector}).pipe(f(w(t)));else if(h(t))p[a]=t.pipe(l());else if(typeof t=="function"){let A=V(t);p[a]=m(A,{injector:r?.injector}).pipe(f(t()))}else p[a]=j(t).pipe(l());return p},Array.isArray(o)?[]:{}),operator:i,hasInitValue:s,options:r}}export{C as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as r}from"./chunk-BDBR5EDG.js";import"./chunk-QVTIOQU4.js";import"./chunk-4OR2MBXM.js";import"./chunk-KLPRJO2S.js";import"./chunk-ZUVMWAQY.js";import{Bb as e,Hb as l,U as a,W as i,hb as s,ib as p}from"./chunk-NGPWOMCW.js";import"./chunk-7CGTOI24.js";var o=class n{#t=a(r);ngOnInit(){this.#t.logout()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=i({type:n,selectors:[["app-logout"]],standalone:!0,features:[l],decls:3,vars:0,template:function(t,c){t&1&&(s(0,"p"),e(1,"logout works!"),p(),e(2,`,
|
|
2
|
+
`))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{O as l,U as a,nc as s,oc as r,va as o}from"./chunk-NGPWOMCW.js";var n=class i{platformId=a(o);STORAGE_VERSION="v1";APP_NAME="duplicati";getItemParsed(t,e=!1){return r(this.platformId)?null:JSON.parse(localStorage.getItem(`${this.STORAGE_VERSION}:${e?"presist-duplicati":this.APP_NAME}:${t}`)??"null")}setItemParsed(t,e,m=!1){if(!r(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${m?"presist-duplicati":this.APP_NAME}:${t}`,JSON.stringify(e))}get length(){return s(this.platformId)?localStorage.length:0}getItem(t){return r(this.platformId)?null:localStorage.getItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${t}`)??null}setItem(t,e){if(!r(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${t}`,e)}removeItem(t){r(this.platformId)||localStorage.removeItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${t}`)}clearAllNotCurrentVersion(){if(!r(this.platformId))for(var t in localStorage)t.startsWith(this.STORAGE_VERSION)||localStorage.removeItem(t)}clearAll(){r(this.platformId)||localStorage.clear()}clear(){if(!r(this.platformId))for(var t in localStorage)t.includes(this.APP_NAME)&&!t.includes(`presist-${this.APP_NAME}`)&&localStorage.removeItem(t)}key(t){return r(this.platformId)?null:localStorage.key(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac})};export{n as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as be}from"./chunk-
|
|
1
|
+
import{a as be}from"./chunk-Q3B3QVNE.js";import{a as L,b as Ce}from"./chunk-MYQPVSUP.js";import{b as q}from"./chunk-6PJU5W5X.js";import{a as me,b as V,d as E,e as T,f as P,g as ce,h as ue,i as R,l as N,m as de,n as fe,o as I,q as B}from"./chunk-ER25OIRY.js";import{a as D,e as M,l as ge,m as he,o as Fe,r as Se}from"./chunk-3SP3MQEU.js";import{a as w,c as C}from"./chunk-4OR2MBXM.js";import{a as O}from"./chunk-ZUVMWAQY.js";import{A as Y,Bb as r,D as j,Eb as re,Gb as se,Hb as x,I as Z,J as ee,La as u,Mb as le,O as te,Ob as ae,Ra as d,U as p,W as k,Ya as $,Zb as pe,_a as c,c as K,db as J,ea as f,eb as ie,fa as g,fb as oe,gb as ne,hb as i,ib as n,jb as m,kb as h,kc as _,l as Q,lb as F,nb as y,ob as S,p as U,pb as W,v as X}from"./chunk-NGPWOMCW.js";function we(l,t){l&1&&m(0,"spk-progress-bar",3)}function Oe(l,t){if(l&1&&(i(0,"option",10),r(1),le(2,"date"),n()),l&2){let e=t.$implicit;c("value",e.Version),u(),re("",e.Version,": ",ae(2,3,e.Time,"d MMM y, h:mm"),"")}}function Ve(l,t){if(l&1&&(i(0,"app-file-tree",11)(1,"label",12),r(2,"Path"),n(),m(3,"input",13),n()),l&2){let e=W(2);c("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function Ee(l,t){if(l&1&&(i(0,"spk-select",7),m(1,"input",8),h(2,9),oe(3,Oe,3,6,"option",10,ie),F(),n(),$(5,Ve,4,4,"app-file-tree",11)),l&2){let e=W();c("displayFn",e.displayFn()),u(3),ne(e.versionOptions()),u(2),J(e.rootPathLoaded()?5:-1)}}var A=new I,ke=()=>A.group({filesToRestore:A.control(""),selectedOption:A.control(null),passphrase:A.control(null)}),z=class l{#t=p(O);#e=p(b);#i=p(C);#o=p(w);#n=p(_);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;backupSettings=pe(()=>{let t=this.backupId(),e=this.selectFilesFormSignal()?.selectedOption;if(typeof e!="number"||!t)return null;let s=this.versionOptions()?.find(a=>a.Version===e)?.Time??null;return s?{id:t,time:s}:null});rootPathLoaded=d(!1);rootPath=be([this.selectFilesFormSignal,this.backupId],K(Z([null,null]),ee(([t,e])=>{let o=t?.selectedOption,s=e;if(typeof o!="number"||!s)return Q("/");let a=this.versionOptions()?.find(G=>G.Version===o);return this.#t.getApiV1BackupByIdFiles({id:s,time:a?.Time??"",prefixOnly:!1,folderContents:!0}).pipe(U(G=>(this.rootPathLoaded.set(!0),G.Files[0].Path)))})));displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(s=>s.Version?.toString()===e);return o?`${o.Version}: ${this.#n.transform(o.Time,"d MMM y, h:mm")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#o.parent})}exit(){this.#e.exit()}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=k({type:l,selectors:[["app-select-files"]],standalone:!0,features:[se([_]),x],decls:15,vars:2,consts:[["formRef",""],[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"displayFn"],["type","number","placeholder","Select an option...","formControlName","selectedOption"],["options",""],[3,"value"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]],template:function(e,o){if(e&1){let s=y();i(0,"form",1,0),S("submit",function(){return f(s),g(o.next())}),i(2,"h3",2),r(3,"Select files"),n(),$(4,we,1,0,"spk-progress-bar",3)(5,Ee,6,2),i(6,"div",4)(7,"button",5),S("click",function(){return f(s),g(o.exit())}),i(8,"spk-icon"),r(9,"arrow-left"),n(),r(10," Exit "),n(),i(11,"button",6)(12,"spk-icon"),r(13,"arrow-right"),n(),r(14," Continue "),n()()()}e&2&&(c("formGroup",o.selectFilesForm),u(4),J(o.versionOptionsLoading()?4:5))},dependencies:[B,P,de,fe,V,ce,E,T,R,N,_,L,M,D,Fe,ge],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var b=class l{#t=p(C);#e=p(O);backupId=d(null);backup=d(null);selectFilesForm=ke();optionsForm=ye();optionsFormSignal=q(this.optionsForm.valueChanges);selectFilesFormSignal=q(this.selectFilesForm.valueChanges);versionOptionsLoading=d(!1);versionOptions=d([]);isSubmitting=d(!1);init(t){this.backupId.set(t),this.#i(t,!0)}submit(){this.isSubmitting.set(!0);let t=this.backupId(),e=this.optionsForm.value,o=this.selectFilesForm.value,s=this.versionOptions()?.find(a=>a.Version===o.selectedOption);this.#e.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(a=>`${a}*`)??[],passphrase:o.passphrase??null,time:s?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(j(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.exit()},error:a=>{console.error("restore error",a)}})}exit(){this.#o(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}#i(t,e=!1){this.versionOptionsLoading.set(!0),X([this.#e.getApiV1BackupById({id:t}),this.#e.getApiV1BackupByIdFilesets({id:t})]).pipe(Y(1),j(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([o,s])=>{this.versionOptions.set(s),this.backup.set(o),e&&this.selectFilesForm.controls.selectedOption.setValue(s[0].Version)}})}#o(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||l)};static \u0275prov=te({token:l,factory:l.\u0275fac,providedIn:"root"})};var v=new I,ye=()=>v.group({restoreFrom:v.control("orignal"),restoreFromPath:v.control(""),handleExisting:v.control("overwrite"),permissions:v.control(!1)}),H=class l{#t=p(b);#e=p(C);#i=p(w);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#i.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=k({type:l,selectors:[["app-options"]],standalone:!0,features:[x],decls:41,vars:4,consts:[["formRef",""],[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]],template:function(e,o){if(e&1){let s=y();i(0,"form",1,0),S("submit",function(){return f(s),g(o.submit())}),i(2,"h3",2),r(3,"Restore options"),n(),i(4,"app-toggle-card",3),h(5,4),r(6,"Where do you want to restore files from?"),F(),i(7,"spk-radio",5),r(8," Original location "),m(9,"input",6),n(),i(10,"spk-radio",5),r(11," Pick location "),m(12,"input",7),n(),i(13,"app-file-tree",8)(14,"label",9),r(15,"Path"),n(),m(16,"input",10),n()(),i(17,"app-toggle-card",3),h(18,4),r(19,"How do you want to handle existing files?"),F(),i(20,"spk-radio",5),r(21," Overwrite "),m(22,"input",11),n(),i(23,"spk-radio",5),r(24," Save different versions with timestamp in file name "),m(25,"input",12),n()(),i(26,"app-toggle-card"),h(27,4),r(28,"Permissions"),F(),i(29,"spk-toggle",13),r(30," Restore read/write permissions "),m(31,"input",14),n()(),i(32,"div",15)(33,"button",16),S("click",function(){return f(s),g(o.goBack())}),i(34,"spk-icon"),r(35,"arrow-left"),n(),r(36," Go back "),n(),i(37,"button",17)(38,"spk-icon"),r(39,"arrow-right"),n(),r(40," Submit "),n()()()}if(e&2){let s;c("formGroup",o.optionsForm),u(4),c("disallowToggle",!0),u(9),c("disabled",((s=o.optionsFormSignal())==null?null:s.restoreFrom)!=="pickLocation"),u(4),c("disallowToggle",!0)}},dependencies:[B,P,V,me,ue,E,T,R,N,Ce,L,Se,he,M,D],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{ye as a,H as b,ke as c,z as d,b as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-RH5CENQ7.js";import"./chunk-Q3B3QVNE.js";import"./chunk-MYQPVSUP.js";import"./chunk-6PJU5W5X.js";import"./chunk-ER25OIRY.js";import"./chunk-3SP3MQEU.js";import"./chunk-4OR2MBXM.js";import"./chunk-KLPRJO2S.js";import"./chunk-ZUVMWAQY.js";import"./chunk-NGPWOMCW.js";import"./chunk-7CGTOI24.js";export{a as createRestoreOptionsForm,b as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-CWAAKGM6.js")},{path:"destination",loadComponent:()=>import("./chunk-AVWHS36O.js")},{path:"source-data",loadComponent:()=>import("./chunk-WH7DPJOS.js")},{path:"schedule",loadComponent:()=>import("./chunk-3DBUGAIF.js")},{path:"options",loadComponent:()=>import("./chunk-B42N6RQ3.js")}];export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as b,b as J}from"./chunk-DNHLTHLR.js";import{b as W}from"./chunk-6PJU5W5X.js";import{a as R,b as j,c as x,d as M,e as O,f as A,i as I,l as L,o as V,q as $}from"./chunk-ER25OIRY.js";import{a as Q}from"./chunk-WQPTWFXA.js";import{a as G,d as U,e as q,i as z,r as H}from"./chunk-3SP3MQEU.js";import{a as P,c as T,d as N}from"./chunk-4OR2MBXM.js";import"./chunk-KLPRJO2S.js";import{a as D}from"./chunk-ZUVMWAQY.js";import{Bb as i,D as g,Eb as v,Hb as _,Ib as F,J as w,La as p,Ra as d,U as s,W as C,Ya as S,Zb as h,_a as k,ab as u,db as E,hb as r,ib as n,jb as l,ob as f,sc as B}from"./chunk-NGPWOMCW.js";import"./chunk-7CGTOI24.js";var Y=()=>["/"];function Z(c,e){c&1&&(r(0,"spk-form-field")(1,"label",9),i(2,"Password"),n(),l(3,"input",10),n(),r(4,"spk-form-field")(5,"label",11),i(6,"Repeat password"),n(),l(7,"input",12),n())}var m=new V,y=class c{#t=s(D);#e=s(P);#o=s(T);#n=s(B);#i=s(Q);isExporting=d(!1);exportType=d("file");exportedCmd=d(null);exportForm=m.group({exportPasswords:m.control(!0),encryption:m.control(!1,[x.required,J()]),password:m.control("",[b(e=>e?.value.encryption,[x.required])]),repeatPassword:m.control("",[b(e=>e?.value.encryption,[x.required])])});exportFormSignal=W(this.exportForm.valueChanges);encryptionFieldSignal=h(()=>this.exportFormSignal()?.encryption??!1);activeBackup=h(()=>this.#i.backups().find(e=>e.Backup?.ID===this.#e.snapshot.params.id));submit(){this.isExporting.set(!0),this.exportType()==="file"?this.#t.postApiV1AuthIssuetokenByOperation({operation:"export"}).pipe(w(e=>{let a=o=>{let t=Object.entries(o);return t?"?"+t.map(([K,X])=>`${K}=${X}`).join("&"):""};return this.#n.get(`/api/v1/backup/${this.#e.snapshot.params.id}/export${a({exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0,token:e.Token})}`,{responseType:"blob"})}),g(()=>this.isExporting.set(!1))).subscribe({next:e=>{let o=this.activeBackup()?.Backup?.Name??"Backup",t=this.exportFormSignal()?.encryption?"aes":"json";this.downloadFile(e,`${o}.${t}`),this.#o.navigate(["/"])},error:e=>{console.log("err",e)}}):this.#t.getApiV1BackupByIdExportCmdline({id:this.#e.snapshot.params.id,exportPasswords:this.exportFormSignal()?.exportPasswords??void 0,passphrase:this.exportFormSignal()?.password??void 0}).pipe(g(()=>this.isExporting.set(!1))).subscribe({next:e=>{console.log("res",e),this.exportedCmd.set(e.Command??null)},error:e=>{console.log("err",e)}})}downloadFile(e,a){let o=window.URL.createObjectURL(e),t=document.createElement("a");t.href=o,t.download=a,t.click(),window.URL.revokeObjectURL(o)}static \u0275fac=function(a){return new(a||c)};static \u0275cmp=C({type:c,selectors:[["app-export"]],standalone:!0,features:[_],decls:31,vars:12,consts:[[1,"actions"],["spk-button","",1,"outlined",3,"routerLink"],["spk-button","",1,"raised","primary",3,"click"],["autocomplete","off",3,"formGroup"],["type","button",3,"click"],[1,"raised","primary"],["type","checkbox","formControlName","exportPasswords"],[1,"primary","raised"],["type","checkbox","formControlName","encryption"],["for","password"],["type","password","id","password","formControlName","password"],["for","repeatPassword"],["type","password","id","repeatPassword","formControlName","repeatPassword"]],template:function(a,o){if(a&1&&(r(0,"header")(1,"h3"),i(2," Export backup configuration "),r(3,"div",0)(4,"button",1)(5,"spk-icon"),i(6,"arrow-left"),n(),i(7," Back "),n(),r(8,"button",2),f("click",function(){return o.submit()}),r(9,"spk-icon"),i(10,"export"),n(),i(11," Export "),n()()(),r(12,"p"),i(13),n()(),r(14,"form",3)(15,"spk-button-group")(16,"button",4),f("click",function(){return o.exportType.set("cmd")}),r(17,"spk-icon"),i(18,"terminal-window"),n(),i(19," As command line "),n(),r(20,"button",4),f("click",function(){return o.exportType.set("file")}),r(21,"spk-icon"),i(22,"file"),n(),i(23," To file "),n()(),r(24,"spk-toggle",5),i(25," Export passwords "),l(26,"input",6),n(),r(27,"spk-toggle",7),i(28," Encrypt file "),l(29,"input",8),n(),S(30,Z,8,0),n()),a&2){let t;p(4),k("routerLink",F(11,Y)),p(4),u("loading",o.isExporting()),p(5),v("#",(t=o.activeBackup())==null||t.Backup==null?null:t.Backup.ID,": ",(t=o.activeBackup())==null||t.Backup==null?null:t.Backup.Name,""),p(),k("formGroup",o.exportForm),p(2),u("active",o.exportType()==="cmd"),p(4),u("active",o.exportType()==="file"),p(10),E(o.encryptionFieldSignal()?30:-1)}},dependencies:[$,A,j,R,M,O,I,L,N,U,H,G,z,q],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:3rem}h3[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;justify-content:space-between}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;max-width:31.25rem}"],changeDetection:0})};export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as f}from"./chunk-BDBR5EDG.js";import"./chunk-QVTIOQU4.js";import{b as d,c as C,d as h,e as b,f as y,i as v,l as F,o as S,q as w}from"./chunk-ER25OIRY.js";import{a as _,e as x,i as N}from"./chunk-3SP3MQEU.js";import{c as g}from"./chunk-4OR2MBXM.js";import"./chunk-KLPRJO2S.js";import"./chunk-ZUVMWAQY.js";import{Bb as i,Hb as c,U as o,W as m,_a as l,hb as e,ib as n,jb as p,ob as u}from"./chunk-NGPWOMCW.js";import"./chunk-7CGTOI24.js";var k=new S,r=class a{#e=o(g);#t=o(f);loginForm=k.group({pass:k.control("",C.required)});submit(){this.loginForm.value.pass&&this.#t.login(this.loginForm.value.pass).subscribe({next:()=>this.#e.navigate(["/"])})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=m({type:a,selectors:[["app-login"]],standalone:!0,features:[c],decls:8,vars:1,consts:[[3,"submit","formGroup"],[1,"login-row"],["type","password","placeholder","Enter your password","tabindex","1","formControlName","pass"],["spk-button","","type","submit",1,"raised","primary"]],template:function(t,s){t&1&&(e(0,"form",0),u("submit",function(){return s.submit()}),e(1,"div",1)(2,"spk-form-field"),p(3,"input",2),n(),e(4,"button",3),i(5," Login "),e(6,"spk-icon"),i(7,"arrow-right"),n()()()()),t&2&&l("formGroup",s.loginForm)},dependencies:[w,y,d,h,b,v,F,N,_,x],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}h3[_ngcontent-%COMP%]{font:var(--title-30)}.login-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}"],changeDetection:0})};export{r as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as P}from"./chunk-74EYKZJR.js";import"./chunk-3B6RZWP4.js";import{a as I}from"./chunk-WQPTWFXA.js";import{a as M,e as D,f as R,l as O}from"./chunk-3SP3MQEU.js";import{d as v}from"./chunk-4OR2MBXM.js";import"./chunk-KLPRJO2S.js";import{a as y}from"./chunk-ZUVMWAQY.js";import{Bb as r,Db as B,Eb as S,Hb as b,Jb as h,La as l,U as s,W as m,Ya as d,_a as k,db as f,eb as g,fb as C,gb as _,hb as i,ib as p,jb as c,pb as x}from"./chunk-NGPWOMCW.js";import"./chunk-7CGTOI24.js";var w=e=>["/restore-flow",e];function L(e,o){e&1&&c(0,"spk-progress-bar",0)}function T(e,o){if(e&1&&(i(0,"spk-card",1),c(1,"img",2),i(2,"div",3)(3,"h3"),r(4),p(),i(5,"p"),r(6),p()(),i(7,"button",4),r(8," Restore "),i(9,"spk-icon"),r(10,"arrow-right"),p()()()),e&2){let t,a,n=o.$implicit;l(4),B("Restore ",(t=n.Backup==null?null:n.Backup.Name)!==null&&t!==void 0?t:"Backup name missing",""),l(2),S(" ",(a=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString)!==null&&a!==void 0?a:"-"," / ",(a=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount)!==null&&a!==void 0?a:"-"," "),l(),k("routerLink",h(4,w,n.Backup==null?null:n.Backup.ID))}}function E(e,o){if(e&1&&C(0,T,11,6,"spk-card",1,g),e&2){let t=x();_(t.backups())}}function N(e,o){e&1&&r(0," No backups found ")}var u=class e{#e=s(I);#t=s(y);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups()}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=m({type:e,selectors:[["app-restore"]],standalone:!0,features:[b],decls:7,vars:1,consts:[[1,"indeterminate","primary"],[1,"type-a"],["src","assets/images/folder.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"]],template:function(t,a){t&1&&(c(0,"app-status-bar"),i(1,"section")(2,"h2"),r(3,"Where do you want to restore from?"),p(),d(4,L,1,0,"spk-progress-bar",0)(5,E,2,0)(6,N,1,0),p()),t&2&&(l(4),f(a.backupsLoading()?4:a.backups().length?5:6))},dependencies:[P,R,D,M,O,v],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 0;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-level-60)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{u as default};
|