@duplicati/ngclient 0.0.133 → 0.0.134

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.
Files changed (80) hide show
  1. package/{chunk-3EVYTAP3.js → chunk-3UUTPGTW.js} +1 -1
  2. package/{chunk-HPZ6HLJE.js → chunk-4VPA3END.js} +1 -1
  3. package/chunk-4WUC2NLU.js +1 -0
  4. package/{chunk-KAKRPBPP.js → chunk-5XSYLFRW.js} +1 -1
  5. package/{chunk-WCMRN2KQ.js → chunk-62DY5NTG.js} +1 -1
  6. package/chunk-6HFJTYBK.js +1 -0
  7. package/{chunk-4MAZCWVO.js → chunk-7J7GUBLS.js} +1 -1
  8. package/{chunk-F66HJES7.js → chunk-B6DE3TTE.js} +1 -1
  9. package/{chunk-Q2YREFUE.js → chunk-BC3MLJH3.js} +1 -1
  10. package/chunk-BHSG643V.js +1 -0
  11. package/{chunk-LSNBRSNG.js → chunk-CFESUDFC.js} +1 -1
  12. package/{chunk-B3N2KM6G.js → chunk-CRALFIWB.js} +1 -1
  13. package/chunk-DE64A2ZS.js +1 -0
  14. package/{chunk-Y4VREVFM.js → chunk-EQS67O4J.js} +1 -1
  15. package/{chunk-X7GQQCVS.js → chunk-EVINCUTE.js} +1 -1
  16. package/{chunk-YPAIKA7K.js → chunk-EWZGGCZ7.js} +1 -1
  17. package/{chunk-2VN6VG4I.js → chunk-FATQ7BT6.js} +1 -1
  18. package/chunk-FZTQVXG4.js +1 -0
  19. package/chunk-HD37ILAE.js +6 -0
  20. package/{chunk-TVOVJS5N.js → chunk-HE5L47WR.js} +1 -1
  21. package/{chunk-PETCW5PK.js → chunk-HLBBIEIQ.js} +1 -1
  22. package/chunk-HMK6M2N7.js +1 -0
  23. package/{chunk-EBYGIC45.js → chunk-HWUEL5ZO.js} +1 -1
  24. package/{chunk-VNTD2QIZ.js → chunk-IDAED3OA.js} +1 -1
  25. package/{chunk-32H7KC5E.js → chunk-IPC6G72N.js} +1 -1
  26. package/{chunk-DLVU5GHR.js → chunk-JDCGGJ7O.js} +1 -1
  27. package/chunk-JHVU3HSL.js +1 -0
  28. package/{chunk-A7BFGBWF.js → chunk-NZD6UMYZ.js} +1 -1
  29. package/{chunk-EGCW3WY7.js → chunk-O3JEFNCL.js} +1 -1
  30. package/chunk-OHEFY2D6.js +1 -0
  31. package/{chunk-XHUQCM6F.js → chunk-OTM4ZTG4.js} +1 -1
  32. package/{chunk-WZIEF5KL.js → chunk-PSPK4OPB.js} +1 -1
  33. package/{chunk-XKDJSEMU.js → chunk-SAISKISU.js} +1 -1
  34. package/chunk-SMNWIGMY.js +1 -0
  35. package/chunk-SSMDFXE3.js +1 -0
  36. package/chunk-TTFJPAWM.js +1 -0
  37. package/{chunk-SUMEJCXQ.js → chunk-UWF5JLY2.js} +1 -1
  38. package/{chunk-VWH7EODO.js → chunk-UZTRBMWL.js} +1 -1
  39. package/{chunk-NUL6XFC4.js → chunk-V6WRFB7W.js} +1 -1
  40. package/{chunk-XBP565VF.js → chunk-VFVXE2DC.js} +1 -1
  41. package/{chunk-LXZXQU7D.js → chunk-VG6LA5R3.js} +1 -1
  42. package/{chunk-UD32EXWK.js → chunk-VVJBMGZR.js} +1 -1
  43. package/chunk-WESN3ZUC.js +1 -0
  44. package/chunk-XZWXLEK2.js +3 -0
  45. package/{chunk-X4NRDSTJ.js → chunk-Y4IRFRVB.js} +1 -1
  46. package/{chunk-BD5AB4OK.js → chunk-Y7OD7PZG.js} +1 -1
  47. package/{chunk-MVJXYZIV.js → chunk-YW7YXFSC.js} +1 -1
  48. package/{chunk-TKOD3RB3.js → chunk-ZQYPQTU3.js} +2 -2
  49. package/{chunk-CHCHAUQD.js → chunk-ZUXVEXBA.js} +1 -1
  50. package/index.html +1 -1
  51. package/locale/messages.cs.json +15 -2
  52. package/locale/messages.da.json +36 -25
  53. package/locale/messages.de.json +169 -77
  54. package/locale/messages.en_GB.json +13 -2
  55. package/locale/messages.es.json +13 -2
  56. package/locale/messages.fr.json +14 -2
  57. package/locale/messages.it.json +184 -157
  58. package/locale/messages.ja_JP.json +16 -2
  59. package/locale/messages.nl_NL.json +184 -157
  60. package/locale/messages.pl.json +13 -2
  61. package/locale/messages.pt.json +12 -2
  62. package/locale/messages.pt_BR.json +13 -2
  63. package/locale/messages.zh-Hans.json +459 -0
  64. package/locale/messages.zh_CN.json +157 -157
  65. package/{main-BQ3NFYOR.js → main-RQTAFLAT.js} +1 -1
  66. package/package.json +1 -1
  67. package/chunk-2YHX57UE.js +0 -1
  68. package/chunk-7RNTRIB4.js +0 -3
  69. package/chunk-7V6ZELYA.js +0 -1
  70. package/chunk-ACVXVBJ2.js +0 -1
  71. package/chunk-AUWIW323.js +0 -1
  72. package/chunk-BWJZ3AMO.js +0 -1
  73. package/chunk-EK2B2CO4.js +0 -1
  74. package/chunk-FX2XKS5C.js +0 -1
  75. package/chunk-GQTJISMN.js +0 -1
  76. package/chunk-MOOM536C.js +0 -1
  77. package/chunk-PTFQBTH3.js +0 -1
  78. package/chunk-T27DQWUZ.js +0 -1
  79. package/chunk-UUOPMSDB.js +0 -1
  80. package/chunk-VFFFKPK4.js +0 -6
@@ -1 +1 @@
1
- import{g as D}from"./chunk-4MAZCWVO.js";import{a as X}from"./chunk-LSNBRSNG.js";import{h as x}from"./chunk-PTFQBTH3.js";import"./chunk-EBYGIC45.js";import"./chunk-ZIJ7ZEHR.js";import"./chunk-5RPDEEQ3.js";import{a as g}from"./chunk-67XQIEG5.js";import"./chunk-A7BFGBWF.js";import"./chunk-F66HJES7.js";import"./chunk-XBP565VF.js";import"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-2YHX57UE.js";import"./chunk-3Q5JEF3K.js";import"./chunk-ZCT7SRIM.js";import"./chunk-OQHMS5HM.js";import{a as I,b as G,c as W,d as h,e as y,f as v}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{q as w,v as K}from"./chunk-DNBOZ26J.js";import"./chunk-XD6MBGQY.js";import"./chunk-HPZ6HLJE.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-DLVU5GHR.js";import{Gc as N,Hb as _,Ib as F,Oa as l,Ob as E,X as c,_a as $,_b as L,la as A,pb as O,pc as M,qb as k,qc as T,rc as R,ub as r,vb as t,wb as n,xb as a}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],z=()=>["/restore-from-files/encryption"],B=()=>["/restore-from-files/select-files"],U=()=>["/restore-from-files/options"],j=e=>["/restore-draft",e,"select-files"],H=e=>["/restore-draft",e,"options"],V=e=>["/restore",e,"select-files"],q=e=>["/restore",e,"options"],J=e=>["/restore",e,"progress"];function Q(e,i){e&1&&(t(0,"div",9),_(1,0),a(2,"spk-radio"),F(),n(),t(3,"div",9),_(4,1),a(5,"spk-radio"),F(),n(),t(6,"div",9),_(7,2),a(8,"spk-radio"),F(),n(),t(9,"div",9),_(10,3),a(11,"spk-radio"),F(),n()),e&2&&(r("routerLink",T(4,b)),l(3),r("routerLink",T(5,z)),l(3),r("routerLink",T(6,B)),l(3),r("routerLink",T(7,U)))}function Y(e,i){if(e&1&&(t(0,"div",9),_(1,4),a(2,"spk-radio"),F(),n(),t(3,"div",9),_(4,5),a(5,"spk-radio"),F(),n()),e&2){let o=E();r("routerLink",R(2,j,o.backupId())),l(3),r("routerLink",R(4,H,o.backupId()))}}function Z(e,i){if(e&1&&(t(0,"div",9),_(1,6),a(2,"spk-radio"),F(),n(),t(3,"div",9),_(4,7),a(5,"spk-radio"),F(),n()),e&2){let o=E();r("routerLink",R(2,V,o.backupId())),l(3),r("routerLink",R(4,q,o.backupId()))}}function ee(e,i){if(e&1&&(t(0,"div",9),_(1,8),a(2,"spk-radio"),F(),n()),e&2){let o=E();r("routerLink",R(1,J,o.backupId()))}}var f=class e{#o=c(G);#t=c(h);#e=c(D);#n=g(this.#o.params);#i=g(this.#o.url);#a=g(this.#o.children[0].url);backupId=this.#e.backupId;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;isProgressPage=A(!1);paramsChanged=N(()=>{let i=this.#a(),o=this.#n()?.id,s=!!this.#i()?.find(S=>S.path==="restore-draft"),p=!!this.#i()?.find(S=>S.path==="restore-from-files"),u=!!i?.find(S=>S.path==="progress");this.isProgressPage.set(u),this.#e.init(o,p,p||s)});ngOnInit(){this.#t.events.subscribe(i=>{if(i instanceof I){let o=i.urlAfterRedirects;this.isProgressPage.set(o.includes("progress"))}})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=$({type:e,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(o,s){o&2&&L("full-width",s.isProgressPage())},features:[M([D,x])],decls:8,vars:2,consts:()=>{let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let o;o=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Encryption `;let s;s=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let p;p=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let u;u=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let S;S=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let P;P=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let C;C=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let m;return m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Progress `,[i,o,s,p,u,S,P,C,m,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(o,s){o&1&&(a(0,"app-status-bar"),t(1,"spk-stepper"),O(2,Q,12,8)(3,Y,6,6)(4,Z,6,6),O(5,ee,3,3,"div",9),n(),t(6,"section"),a(7,"router-outlet"),n()),o&2&&(l(2),k(s.isFileRestore()?2:s.isDraft()?3:4),l(3),k(s.isProgressPage()?5:-1))},dependencies:[K,w,X,W,y,v],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}spk-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{f as default};
1
+ import{g as D}from"./chunk-7J7GUBLS.js";import{a as X}from"./chunk-CFESUDFC.js";import{h as x}from"./chunk-DE64A2ZS.js";import"./chunk-HWUEL5ZO.js";import"./chunk-ZIJ7ZEHR.js";import"./chunk-5RPDEEQ3.js";import{a as g}from"./chunk-67XQIEG5.js";import"./chunk-NZD6UMYZ.js";import"./chunk-B6DE3TTE.js";import"./chunk-VFVXE2DC.js";import"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-BHSG643V.js";import"./chunk-3Q5JEF3K.js";import"./chunk-ZCT7SRIM.js";import"./chunk-OQHMS5HM.js";import{a as I,b as G,c as W,d as h,e as y,f as v}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{q as w,v as K}from"./chunk-DNBOZ26J.js";import"./chunk-XD6MBGQY.js";import"./chunk-4VPA3END.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-JDCGGJ7O.js";import{Gc as N,Hb as _,Ib as F,Oa as l,Ob as E,X as c,_a as $,_b as L,la as A,pb as O,pc as M,qb as k,qc as T,rc as R,ub as r,vb as t,wb as n,xb as a}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var b=()=>["/restore-from-files/destination"],z=()=>["/restore-from-files/encryption"],B=()=>["/restore-from-files/select-files"],U=()=>["/restore-from-files/options"],j=e=>["/restore-draft",e,"select-files"],H=e=>["/restore-draft",e,"options"],V=e=>["/restore",e,"select-files"],q=e=>["/restore",e,"options"],J=e=>["/restore",e,"progress"];function Q(e,i){e&1&&(t(0,"div",9),_(1,0),a(2,"spk-radio"),F(),n(),t(3,"div",9),_(4,1),a(5,"spk-radio"),F(),n(),t(6,"div",9),_(7,2),a(8,"spk-radio"),F(),n(),t(9,"div",9),_(10,3),a(11,"spk-radio"),F(),n()),e&2&&(r("routerLink",T(4,b)),l(3),r("routerLink",T(5,z)),l(3),r("routerLink",T(6,B)),l(3),r("routerLink",T(7,U)))}function Y(e,i){if(e&1&&(t(0,"div",9),_(1,4),a(2,"spk-radio"),F(),n(),t(3,"div",9),_(4,5),a(5,"spk-radio"),F(),n()),e&2){let o=E();r("routerLink",R(2,j,o.backupId())),l(3),r("routerLink",R(4,H,o.backupId()))}}function Z(e,i){if(e&1&&(t(0,"div",9),_(1,6),a(2,"spk-radio"),F(),n(),t(3,"div",9),_(4,7),a(5,"spk-radio"),F(),n()),e&2){let o=E();r("routerLink",R(2,V,o.backupId())),l(3),r("routerLink",R(4,q,o.backupId()))}}function ee(e,i){if(e&1&&(t(0,"div",9),_(1,8),a(2,"spk-radio"),F(),n()),e&2){let o=E();r("routerLink",R(1,J,o.backupId()))}}var f=class e{#o=c(G);#t=c(h);#e=c(D);#n=g(this.#o.params);#i=g(this.#o.url);#a=g(this.#o.children[0].url);backupId=this.#e.backupId;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;isProgressPage=A(!1);paramsChanged=N(()=>{let i=this.#a(),o=this.#n()?.id,s=!!this.#i()?.find(S=>S.path==="restore-draft"),p=!!this.#i()?.find(S=>S.path==="restore-from-files"),u=!!i?.find(S=>S.path==="progress");this.isProgressPage.set(u),this.#e.init(o,p,p||s)});ngOnInit(){this.#t.events.subscribe(i=>{if(i instanceof I){let o=i.urlAfterRedirects;this.isProgressPage.set(o.includes("progress"))}})}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=$({type:e,selectors:[["app-restore-flow"]],hostVars:2,hostBindings:function(o,s){o&2&&L("full-width",s.isProgressPage())},features:[M([D,x])],decls:8,vars:2,consts:()=>{let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let o;o=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Encryption `;let s;s=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let p;p=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let u;u=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let S;S=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let P;P=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let C;C=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `;let m;return m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_RADIO: Progress `,[i,o,s,p,u,S,P,C,m,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(o,s){o&1&&(a(0,"app-status-bar"),t(1,"spk-stepper"),O(2,Q,12,8)(3,Y,6,6)(4,Z,6,6),O(5,ee,3,3,"div",9),n(),t(6,"section"),a(7,"router-outlet"),n()),o&2&&(l(2),k(s.isFileRestore()?2:s.isDraft()?3:4),l(3),k(s.isProgressPage()?5:-1))},dependencies:[K,w,X,W,y,v],styles:["[_nghost-%COMP%]{display:block}.full-width[_nghost-%COMP%] section[_ngcontent-%COMP%]{max-width:62.5rem}spk-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{f as default};
@@ -1 +1 @@
1
- import{la as o}from"./chunk-GP2W7XZF.js";import{a as s}from"./chunk-DLVU5GHR.js";import{X as e,bb as n}from"./chunk-67YRCRMI.js";var m=class i{#t=e(s);#r=e(o);convertTimestamp(t){let r=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/.exec(t);if(r){let[a,p,f,c,d,u,h]=r;return`${p}-${f}-${c}T${d}:${u}:${h}Z`}return t}transform(t,r=!1,...a){return t?r?this.#r.transform(t,"short"):(this.#t.locale(),typeof t=="string"&&(t=this.convertTimestamp(t)),this.#t(t).fromNow()):"N/A"}static \u0275fac=function(r){return new(r||i)};static \u0275pipe=n({name:"relativeTime",type:i,pure:!0})};export{m as a};
1
+ import{la as o}from"./chunk-GP2W7XZF.js";import{a as s}from"./chunk-JDCGGJ7O.js";import{X as e,bb as n}from"./chunk-67YRCRMI.js";var m=class i{#t=e(s);#r=e(o);convertTimestamp(t){let r=/^(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})(\d{2})Z$/.exec(t);if(r){let[a,p,f,c,d,u,h]=r;return`${p}-${f}-${c}T${d}:${u}:${h}Z`}return t}transform(t,r=!1,...a){return t?r?this.#r.transform(t,"short"):(this.#t.locale(),typeof t=="string"&&(t=this.convertTimestamp(t)),this.#t(t).fromNow()):"N/A"}static \u0275fac=function(r){return new(r||i)};static \u0275pipe=n({name:"relativeTime",type:i,pure:!0})};export{m as a};
@@ -0,0 +1 @@
1
+ import{a as dt,b as Dt,c as mt}from"./chunk-HD37ILAE.js";import"./chunk-L6BZ6TEU.js";import"./chunk-5MMV45NA.js";import"./chunk-JHVU3HSL.js";import{h as gt}from"./chunk-DE64A2ZS.js";import"./chunk-HWUEL5ZO.js";import"./chunk-ZIJ7ZEHR.js";import"./chunk-5RPDEEQ3.js";import"./chunk-67XQIEG5.js";import{a as b}from"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-BHSG643V.js";import{c as st,e as Ft,f as lt,g as ct,i as ut,j as _t,r as pt,s as Tt}from"./chunk-ZCT7SRIM.js";import{b as Z,d as tt}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{a as et,b as nt,d as it,e as ot,l as at,o as rt}from"./chunk-DNBOZ26J.js";import"./chunk-XD6MBGQY.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import{Bb as d,F as L,Fc as $,Hb as D,Ib as m,Jb as N,Kb as z,Lb as X,Mb as W,Mc as J,Nb as _,Oa as F,Ob as l,Wb as j,X as p,Xb as H,_a as V,_b as Q,ba as c,bc as O,ca as u,cc as U,dc as q,fa as K,gc as k,hc as E,ic as A,la as T,pb as S,qb as f,qc as Y,rb as P,sb as M,tb as h,ub as I,vb as a,wb as r,xb as g,yb as x,zb as B}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var Ct=["formRef"],St=()=>({maxWidth:"700px",width:"100%"});function ft(o,i){o&1&&(D(0,2,2),g(1,"spk-icon"),m())}function Nt(o,i){o&1&&N(0,2,3)}function Ot(o,i){if(o&1){let t=d();D(0,2,1),a(1,"button",16),_("click",function(){c(t);let e=l();return u(e.testDestination())}),S(2,ft,2,0)(3,Nt,1,0),r(),m()}if(o&2){let t=l();F(),Q("loader",t.testLoading())("success",t.successfulTest()),F(),f(t.successfulTest()?2:3)}}function It(o,i){if(o&1){let t=d();a(0,"p",22),_("click",function(){c(t);let e=l();return u(e.removeDestination())}),D(1,5),g(2,"strong")(3,"br")(4,"span",23),m(),r()}if(o&2){let t,n=l();F(4),z((t=n.selectedDestinationType())==null?null:t.displayName),X(1)}}function kt(o,i){if(o&1){let t=d();a(0,"div",29),_("click",function(){let e=c(t).$implicit,s=l(2);return u(s.setDestination(e.key))}),a(1,"h3"),O(2),r(),a(3,"p"),O(4),r()()}if(o&2){let t=i.$implicit;F(2),U(t.displayName),F(2),U(t.description)}}function Et(o,i){if(o&1){let t=d();a(0,"button",30,1),_("click",function(){let e=c(t).$implicit,s=l(2);return u(s.setDestination(e.key))}),O(2),r()}if(o&2){let t=i.$implicit;F(2),q(" ",t.displayName," ")}}function At(o,i){if(o&1&&(a(0,"div",24),M(1,kt,5,2,"div",25,P),r(),a(3,"spk-menu",26)(4,"button",27),N(5,6),r(),x(6,15),M(7,Et,3,1,"button",28,P),B(),r()),o&2){let t=l();F(),h(t.destinationTypeOptionsFocused()),F(2),I("searchable",!0),F(4),h(t.destinationTypeOptionsNotFocused())}}function $t(o,i){if(o&1){let t=d();a(0,"app-single-destination",31),A("targetUrlChange",function(e){c(t);let s=l();return E(s.targetUrlModel,e)||(s.targetUrlModel=e),u(e)}),r()}if(o&2){let t=l();k("targetUrl",t.targetUrlModel),I("useBackupState",!0)}}function yt(o,i){if(o&1){let t=d();a(0,"spk-dialog",32),A("isOpenChange",function(e){c(t);let s=l();return E(s.targetUrlDialogOpen,e)||(s.targetUrlDialogOpen=e),u(e)}),a(1,"header",33)(2,"h2"),N(3,7),r(),a(4,"spk-alert",34),N(5,8),r()(),a(6,"div",35)(7,"spk-form-field")(8,"textarea",36),A("ngModelChange",function(e){c(t);let s=l();return E(s.targetUrlCtrl,e)||(s.targetUrlCtrl=e),u(e)}),r()()(),a(9,"footer",37)(10,"button",19),_("click",function(){c(t);let e=l();return u(e.closeTargetUrlDialog(!1))}),O(11,"Cancel"),r(),a(12,"button",38),_("click",function(){c(t);let e=l();return u(e.closeTargetUrlDialog(!0))}),D(13,9),g(14,"spk-icon"),m(),r()()()}if(o&2){let t=l();k("isOpen",t.targetUrlDialogOpen),I("options",Y(3,St)),F(8),k("ngModel",t.targetUrlCtrl)}}var y=new pt,jt=(o={destinations:[]})=>y.group({destinations:y.array(o.destinations)}),Ht=({key:o,customGroup:i,dynamicGroup:t,advancedGroup:n})=>y.group({destinationType:y.control(o),custom:i,dynamic:t,advanced:n}),R=class o{#e=p(tt);#n=p(Z);#t=p(gt);#o=p(Dt);#i=p(ot);#a=p(dt);injector=p(K);formRef=J.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=T(null);targetUrlInitial=T(null);targetUrlDialogOpen=T(!1);toggleNewDestination=T(!0);successfulTest=T(!1);testLoading=T(!1);destinationTypeOptionsInFocus=T(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#o.destinationTypeOptions;destinationTypeOptionsFocused=$(()=>{let i=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return i.map(n=>t.find(e=>e.key===n))});selectedDestinationType=$(()=>{let i=this.#t.targetUrlModel();if(!i)return null;let t=i.split("://")[0];return this.destinationTypeOptions().find(e=>t===e.key)});destinationTypeOptionsNotFocused=$(()=>{let i=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(n=>!i.includes(n.key))});openTargetUrlDialog(){let i=this.#t.targetUrlModel();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!i||t===n||!t||this.#t.setTargetUrl(t)}testDestination(i=0){let t=this.#t.targetUrlModel();t&&(this.testLoading.set(!0),this.#a.testDestination(t,i,!0).pipe(L(()=>this.testLoading.set(!1))).subscribe({next:n=>{if(n.action==="success"){this.#t.isNew()&&(n.containsBackup===!0?this.#i.open(b,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}}):n.anyFilesFound===!0&&this.#i.open(b,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}})),this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3);return}if(n.action==="generic-error"){this.successfulTest.set(!1);return}let e=t.includes("?");n.action==="trust-cert"&&this.#t.setTargetUrl(t+`${e?"&":"?"}accept-specified-ssl-hash=${n.certData}`),n.action==="approve-host-key"&&this.#t.setTargetUrl(t+`${e?"&":"?"}ssh-fingerprint=${n.reportedHostKey}`),n.testAgain&&this.testDestination(n.destinationIndex)}}))}setDestination(i){this.#t.setTargetUrl(`${i}://`)}removeDestination(){this.#t.setTargetUrl(null)}goBack(){this.#e.navigate(["general"],{relativeTo:this.#n.parent})}next(){this.#t.isNew()||this.#t.submit(!0),this.#e.navigate(["source-data"],{relativeTo:this.#n.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=V({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&j(n.formRef,Ct,5),t&2&&H()},decls:24,vars:5,consts:()=>{let i;i=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,i=W(i);let t;t=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let n;n=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let e;e=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let s;s=$localize`Other destinations`;let w;w=$localize`Edit target URL`;let G;G=$localize` Be careful, this will overwrite everything you have in your destination. `;let v;return v=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],i,t,n,e,s,w,G,v,[3,"submit"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"loader","success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let e=d();a(0,"form",10,0),_("submit",function(){return c(e),u(n.next())}),a(2,"header")(3,"h3",11),D(4,2),a(5,"div",12),S(6,Ot,4,5,"button",13),a(7,"spk-menu")(8,"button",14),g(9,"spk-icon"),r(),x(10,15),a(11,"button",16),_("click",function(){return c(e),u(n.openTargetUrlDialog())}),g(12,"spk-icon"),r(),B(),r()(),m(),r(),S(13,It,5,1,"p"),r(),S(14,At,9,1),S(15,$t,1,2,"app-single-destination",17),a(16,"div",18)(17,"button",19),_("click",function(){return c(e),u(n.goBack())}),D(18,3),g(19,"spk-icon"),m(),r(),a(20,"button",20),D(21,4),g(22,"spk-icon"),m(),r()()(),S(23,yt,15,4,"spk-dialog",21)}if(t&2){let e=!!n.targetUrlModel();F(6),f(e?6:-1),F(7),f(e?13:-1),F(),f(e?-1:14),F(),f(e?15:-1),F(8),f(n.targetUrlDialogOpen()?23:-1)}},dependencies:[mt,Tt,_t,st,Ft,lt,ut,ct,at,rt,et,it,nt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.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-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{jt as createDestinationForm,Ht as createDestinationFormGroup,R as default};
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-4MAZCWVO.js";import"./chunk-EBYGIC45.js";import"./chunk-ZIJ7ZEHR.js";import"./chunk-67XQIEG5.js";import"./chunk-FC45TEB6.js";import"./chunk-2YHX57UE.js";import"./chunk-ZCT7SRIM.js";import"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import"./chunk-DNBOZ26J.js";import"./chunk-XD6MBGQY.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-7J7GUBLS.js";import"./chunk-HWUEL5ZO.js";import"./chunk-ZIJ7ZEHR.js";import"./chunk-67XQIEG5.js";import"./chunk-FC45TEB6.js";import"./chunk-BHSG643V.js";import"./chunk-ZCT7SRIM.js";import"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import"./chunk-DNBOZ26J.js";import"./chunk-XD6MBGQY.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1 +1 @@
1
- import{a as W}from"./chunk-LSNBRSNG.js";import"./chunk-A7BFGBWF.js";import{a as z}from"./chunk-F66HJES7.js";import"./chunk-XBP565VF.js";import"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-2YHX57UE.js";import"./chunk-3Q5JEF3K.js";import"./chunk-ZCT7SRIM.js";import"./chunk-OQHMS5HM.js";import{e as S}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{a as g,g as E,h as R,k as G,p as w}from"./chunk-DNBOZ26J.js";import{h as X}from"./chunk-XD6MBGQY.js";import"./chunk-HPZ6HLJE.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-DLVU5GHR.js";import{Hb as y,Ib as A,Jb as s,Kb as I,Lb as B,Oa as a,Ob as d,X as u,_a as T,bc as r,db as O,ec as L,mb as M,nb as P,pb as F,qb as N,qc as m,rb as x,rc as v,sb as $,tb as D,ub as _,vb as t,wb as i,xb as l,yb as b,zb as h}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var j=()=>[R,E,g,S],K=()=>["/restore-from-files"],q=()=>["/restore/from-config"],V=n=>["/restore",n];function H(n,o){if(n&1&&(t(0,"spk-card",5),l(1,"img",10),t(2,"div",7)(3,"h3"),s(4,1),i(),t(5,"p"),r(6),i()(),t(7,"button",8),y(8,2),l(9,"spk-icon"),A(),i()()),n&2){let e=o.$implicit;a(4),I((e.Backup==null?null:e.Backup.Name)??"Backup name missing"),B(4),a(2),L(" ",(e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceSizeString)??"-"," / ",(e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.BackupListCount)??"-"," "),a(),_("routerLink",v(4,V,e.Backup==null?null:e.Backup.ID))}}function J(n,o){if(n&1&&$(0,H,10,6,"spk-card",5,x),n&2){let e=d(2);D(e.backups())}}function Q(n,o){n&1&&(b(0),s(1,3),h())}function U(n,o){if(n&1&&F(0,J,2,0)(1,Q,2,0,"ng-container"),n&2){let e=d();N(e.backups().length?0:1)}}function Y(n,o){n&1&&(t(0,"div",11),l(1,"spk-progress-bar",12),t(2,"div",7)(3,"h3"),s(4,4),i()()())}var f=class n{#e=u(z);#t=u(X);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=T({type:n,selectors:[["app-restore"]],decls:32,vars:5,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let e;e=$localize`Restore ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let p;p=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let k;k=$localize`No backups founds`;let C;return C=$localize`Loading backups...`,[o,e,p,k,C,[1,"type-a"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(e,p){e&1&&(l(0,"app-status-bar"),t(1,"section")(2,"h2"),s(3,0),i(),t(4,"spk-card",5),l(5,"img",6),t(6,"div",7)(7,"h3"),r(8,"Direct restore from backup files"),i(),t(9,"p"),r(10,"Point to your backup files and restore from there."),i()(),t(11,"button",8),r(12," Start "),t(13,"spk-icon"),r(14,"play-circle"),i()()(),t(15,"spk-card",5),l(16,"img",9),t(17,"div",7)(18,"h3"),r(19,"Restore from configuration"),i(),t(20,"p"),r(21,"Load destination from an exported job or a storage provider"),i()(),t(22,"button",8),r(23," Start "),t(24,"spk-icon"),r(25,"play-circle"),i()()(),t(26,"spk-divider"),r(27,"Or existing"),i(),O(28,U,2,1)(29,Y,5,0),M(30,28,j,null,29),i()),e&2&&(a(11),_("routerLink",m(3,K)),a(11),_("routerLink",m(4,q)),a(8),P(!p.backupsLoading()))},dependencies:[W,R,E,G,g,w,S],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 1rem;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-8)}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{f as default};
1
+ import{a as W}from"./chunk-CFESUDFC.js";import"./chunk-NZD6UMYZ.js";import{a as z}from"./chunk-B6DE3TTE.js";import"./chunk-VFVXE2DC.js";import"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-BHSG643V.js";import"./chunk-3Q5JEF3K.js";import"./chunk-ZCT7SRIM.js";import"./chunk-OQHMS5HM.js";import{e as S}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{a as g,g as E,h as R,k as G,p as w}from"./chunk-DNBOZ26J.js";import{h as X}from"./chunk-XD6MBGQY.js";import"./chunk-4VPA3END.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-JDCGGJ7O.js";import{Hb as y,Ib as A,Jb as s,Kb as I,Lb as B,Oa as a,Ob as d,X as u,_a as T,bc as r,db as O,ec as L,mb as M,nb as P,pb as F,qb as N,qc as m,rb as x,rc as v,sb as $,tb as D,ub as _,vb as t,wb as i,xb as l,yb as b,zb as h}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var j=()=>[R,E,g,S],K=()=>["/restore-from-files"],q=()=>["/restore/from-config"],V=n=>["/restore",n];function H(n,o){if(n&1&&(t(0,"spk-card",5),l(1,"img",10),t(2,"div",7)(3,"h3"),s(4,1),i(),t(5,"p"),r(6),i()(),t(7,"button",8),y(8,2),l(9,"spk-icon"),A(),i()()),n&2){let e=o.$implicit;a(4),I((e.Backup==null?null:e.Backup.Name)??"Backup name missing"),B(4),a(2),L(" ",(e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceSizeString)??"-"," / ",(e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.BackupListCount)??"-"," "),a(),_("routerLink",v(4,V,e.Backup==null?null:e.Backup.ID))}}function J(n,o){if(n&1&&$(0,H,10,6,"spk-card",5,x),n&2){let e=d(2);D(e.backups())}}function Q(n,o){n&1&&(b(0),s(1,3),h())}function U(n,o){if(n&1&&F(0,J,2,0)(1,Q,2,0,"ng-container"),n&2){let e=d();N(e.backups().length?0:1)}}function Y(n,o){n&1&&(t(0,"div",11),l(1,"spk-progress-bar",12),t(2,"div",7)(3,"h3"),s(4,4),i()()())}var f=class n{#e=u(z);#t=u(X);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=T({type:n,selectors:[["app-restore"]],decls:32,vars:5,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let e;e=$localize`Restore ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let p;p=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let k;k=$localize`No backups founds`;let C;return C=$localize`Loading backups...`,[o,e,p,k,C,[1,"type-a"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(e,p){e&1&&(l(0,"app-status-bar"),t(1,"section")(2,"h2"),s(3,0),i(),t(4,"spk-card",5),l(5,"img",6),t(6,"div",7)(7,"h3"),r(8,"Direct restore from backup files"),i(),t(9,"p"),r(10,"Point to your backup files and restore from there."),i()(),t(11,"button",8),r(12," Start "),t(13,"spk-icon"),r(14,"play-circle"),i()()(),t(15,"spk-card",5),l(16,"img",9),t(17,"div",7)(18,"h3"),r(19,"Restore from configuration"),i(),t(20,"p"),r(21,"Load destination from an exported job or a storage provider"),i()(),t(22,"button",8),r(23," Start "),t(24,"spk-icon"),r(25,"play-circle"),i()()(),t(26,"spk-divider"),r(27,"Or existing"),i(),O(28,U,2,1)(29,Y,5,0),M(30,28,j,null,29),i()),e&2&&(a(11),_("routerLink",m(3,K)),a(11),_("routerLink",m(4,q)),a(8),P(!p.backupsLoading()))},dependencies:[W,R,E,G,g,w,S],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 1rem;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-8)}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{f as default};
@@ -0,0 +1 @@
1
+ import{a}from"./chunk-4VPA3END.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-JDCGGJ7O.js";import"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";export{a as RelativeTimePipe};
@@ -1 +1 @@
1
- import{a as Q}from"./chunk-EBYGIC45.js";import{a as Be}from"./chunk-ZIJ7ZEHR.js";import{a as oe}from"./chunk-67XQIEG5.js";import{a as te}from"./chunk-FC45TEB6.js";import{a as J}from"./chunk-2YHX57UE.js";import{b as Ae,c as y,e as L,f as $,i as ve,j as b,l as we,o as D,q as A,r as v,s as Ge,t as w}from"./chunk-ZCT7SRIM.js";import{b as R,d as N}from"./chunk-DQM3ATT4.js";import{A as De,a as I,e as Me,g as k,l as ye,p as Le,q as $e,t as be}from"./chunk-DNBOZ26J.js";import{h as M}from"./chunk-XD6MBGQY.js";import{la as H}from"./chunk-GP2W7XZF.js";import{B as Fe,Bb as B,E as ee,F as T,Gc as q,Hb as u,Ib as F,J as me,Jb as E,Kb as Te,Lb as Ee,N as Se,Nb as O,O as X,Oa as m,Ob as x,S as de,X as p,_a as h,_b as Oe,ba as f,bc as j,ca as C,db as ge,ec as fe,gc as Ce,hc as Re,i as _e,ic as Ne,la as _,o as ce,pb as z,pc as Pe,qb as Y,qc as he,ub as S,uc as Ie,vb as r,wb as l,wc as ke,x as Z,xb as c,y as ue,yb as K,zb as U}from"./chunk-67YRCRMI.js";var xe=new v,Xe=()=>xe.group({passphrase:xe.control("")}),ie=class a{#t=p(M);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[{Name:"--no-encryption",Value:"true"}];e&&(t=[{Name:"--passphrase",Value:e}]),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(T(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-restore-encryption"]],decls:12,vars:1,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let o;return o=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,o,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",3),O("submit",function(){return t.next()}),r(1,"spk-form-field")(2,"label",4),E(3,0),l(),c(4,"input",5),l(),r(5,"div",6)(6,"button",7),O("click",function(){return t.back()}),u(7,1),c(8,"spk-icon"),F(),l(),r(9,"button",8),u(10,2),c(11,"spk-icon"),F(),l()()()),e&2&&S("formGroup",t.encryptionForm)},dependencies:[w,b,y,L,$,D,A,ye,I,k],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 Ke=()=>({standalone:!0});function Ue(a,i){a&1&&c(0,"spk-progress-bar",7)}function je(a,i){if(a&1&&(r(0,"div",14),j(1),Ie(2,"date"),l()),a&2){let e=i.$implicit;m(),fe("",e.Version,": ",ke(2,2,e.Time,"medium"))}}function qe(a,i){a&1&&c(0,"spk-progress-bar",7)}function He(a,i){if(a&1&&(r(0,"app-file-tree",13)(1,"label",15),E(2,4),l(),c(3,"input",16),l()),a&2){let e=x(2);S("rootPaths",e.rootPaths())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function Je(a,i){if(a&1){let e=B();r(0,"spk-select",11),O("cleared",function(){f(e);let o=x();return C(o.abortLoading())}),r(1,"input",12),Ne("ngModelChange",function(o){f(e);let n=x();return Re(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),ge(2,je,3,5,"ng-template"),l(),z(3,qe,1,0,"spk-progress-bar",7),z(4,He,4,4,"app-file-tree",13)}if(a&2){let e=x();S("options",e.versionOptions())("isClearable",!1),m(),Ce("ngModel",e.selectOption),S("ngModelOptions",he(6,Ke)),m(2),Y(e.isDraft()||e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),m(),Y(e.showFileTree()?4:-1)}}var se=new v,ze=()=>se.group({filesToRestore:se.control(""),passphrase:se.control(null)}),re=class a{#t=p(M);#e=p(P);#o=p(J);#n=p(N);#i=p(R);#s=p(H);#r=null;#a=null;selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);loadingRootPath=_(!1);isRepairing=_(!1);loadingEffect=q(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=q(()=>{let i=this.backupId(),e=this.isRepairing(),t=this.selectOption();if(!t||!i)return;let n=this.versionOptions()?.find(d=>d.Version===parseInt(t))?.Time??null;if(!n||e)return;let s={id:i+"",time:n};this.backupSettings.set(s),this.getRootPath(s)});repairEffect=q(()=>{let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#a===n)return;this.#a=n,this.isRepairing.set(!0),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(X(this.abortLoading$),T(()=>{this.#a=null})).subscribe(s=>{let d=s.ID;var G=window.setInterval(()=>{this.#t.getApiV1TaskByTaskid({taskid:d}).subscribe(W=>{W.Status==="Completed"&&(clearInterval(G),this.isRepairing.set(!1))})},1e3)})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#r===t||(this.#r=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(X(this.abortLoading$),T(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#r=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?this.rootPaths.set(n):this.rootPaths.set(["/"])}}):this.#t.getApiV1BackupByIdFiles(e).pipe(X(this.abortLoading$),T(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?this.rootPaths.set(n):this.rootPaths.set(["/"])}}))}abortLoading$=new _e;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#s.transform(t.Time,"medium")}`:""}}next(){this.#n.navigate(["options"],{relativeTo:this.#i.parent})}back(){this.#e.isFileRestore()?this.#n.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-select-files"]],features:[Pe([H])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize`Select an option...`;let n;return n=$localize`Path`,[["formRef",""],i,e,t,n,[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"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","backupSettings","multiSelect","showFiles"],[1,"custom-option"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=B();r(0,"form",5,0),O("submit",function(){return f(o),C(t.next())}),r(2,"h3",6),E(3,1),l(),z(4,Ue,1,0,"spk-progress-bar",7)(5,Je,5,7),r(6,"div",8)(7,"button",9),O("click",function(){return f(o),C(t.back())}),u(8,2),c(9,"spk-icon"),F(),l(),r(10,"button",10),u(11,3),c(12,"spk-icon"),F(),l()()()}e&2&&(S("formGroup",t.selectFilesForm),m(4),Y(t.versionOptionsLoading()?4:5),m(5),Te(t.isFileRestore()?"Back":"Exit"),Ee(8))},dependencies:[Ge,b,y,L,$,ve,w,D,A,H,Q,k,I,be,Le],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 P=class a{#t=p(N);#e=p(R);#o=p(J);#n=p(Me);#i=p(M);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=ze();optionsForm=Ye();encryptionForm=Xe();optionsFormSignal=oe(this.optionsForm.valueChanges);selectFilesFormSignal=oe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isDraft=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);init(i,e=!1,t=!1){this.backupId.set(i),this.isFileRestore.set(e),this.isDraft.set(t),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId(),e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>`${s}*`)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(T(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#t.navigate(["./progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(te,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#s(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Fe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?ce(()=>t):ue(1e3).pipe(Se(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?Z([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(ee(1),T(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);this.versionOptions.set((o.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",d=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(d=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(d=$localize`The backup storage folder was not found.`),s&&(d=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(te,{data:{title:$localize`Failed to load backup filesets`,message:d,confirmText:$localize`OK`,cancelText:void 0},closed:G=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):Z([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(me(3))]).pipe(ee(1),T(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#s(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=de({token:a,factory:a.\u0275fac,providedIn:"root"})};var V=new v,Ye=()=>V.group({restoreFrom:V.control("orignal"),restoreFromPath:V.control(""),handleExisting:V.control("overwrite"),permissions:V.control(!1)}),ae=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-advanced-options-settings"]],decls:39,vars:6,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let d;d=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let G;G=$localize`Permissions`;let W;W=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let le;le=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let pe;return pe=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,d,G,W,le,pe,[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,t){if(e&1){let o=B();r(0,"form",12,0),O("submit",function(){return f(o),C(t.submit())}),r(2,"h3",13),E(3,1),l(),r(4,"app-toggle-card",14),K(5,15),E(6,2),U(),r(7,"spk-radio",16),u(8,3),c(9,"input",17),F(),l(),r(10,"spk-radio",16),u(11,4),c(12,"input",18),F(),l(),r(13,"app-file-tree",19)(14,"label",20),j(15,"Path"),l(),c(16,"input",21),l()(),r(17,"app-toggle-card",14),K(18,15),E(19,5),U(),r(20,"spk-radio",16),u(21,6),c(22,"input",22),F(),l(),r(23,"spk-radio",16),u(24,7),c(25,"input",23),F(),l()(),r(26,"app-toggle-card"),K(27,15),E(28,8),U(),r(29,"spk-toggle",24),u(30,9),c(31,"input",25),F(),l()(),r(32,"div",26)(33,"button",27),O("click",function(){return f(o),C(t.goBack())}),u(34,10),c(35,"spk-icon"),F(),l(),r(36,"button",28),u(37,11),c(38,"spk-icon"),F(),l()()()}if(e&2){let o;S("formGroup",t.optionsForm),m(4),S("disallowToggle",!0),m(9),S("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation"),m(4),S("disallowToggle",!0),m(19),Oe("loader",t.isSubmitting())}},dependencies:[w,b,y,Ae,we,L,$,D,A,Be,Q,De,$e,k,I],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,ae as b,Xe as c,ie as d,ze as e,re as f,P as g};
1
+ import{a as Q}from"./chunk-HWUEL5ZO.js";import{a as Be}from"./chunk-ZIJ7ZEHR.js";import{a as oe}from"./chunk-67XQIEG5.js";import{a as te}from"./chunk-FC45TEB6.js";import{a as J}from"./chunk-BHSG643V.js";import{b as Ae,c as y,e as L,f as $,i as ve,j as b,l as we,o as D,q as A,r as v,s as Ge,t as w}from"./chunk-ZCT7SRIM.js";import{b as R,d as N}from"./chunk-DQM3ATT4.js";import{A as De,a as I,e as Me,g as k,l as ye,p as Le,q as $e,t as be}from"./chunk-DNBOZ26J.js";import{h as M}from"./chunk-XD6MBGQY.js";import{la as H}from"./chunk-GP2W7XZF.js";import{B as Fe,Bb as B,E as ee,F as T,Gc as q,Hb as u,Ib as F,J as me,Jb as E,Kb as Te,Lb as Ee,N as Se,Nb as O,O as X,Oa as m,Ob as x,S as de,X as p,_a as h,_b as Oe,ba as f,bc as j,ca as C,db as ge,ec as fe,gc as Ce,hc as Re,i as _e,ic as Ne,la as _,o as ce,pb as z,pc as Pe,qb as Y,qc as he,ub as S,uc as Ie,vb as r,wb as l,wc as ke,x as Z,xb as c,y as ue,yb as K,zb as U}from"./chunk-67YRCRMI.js";var xe=new v,Xe=()=>xe.group({passphrase:xe.control("")}),ie=class a{#t=p(M);#e=p(P);#o=p(N);#n=p(R);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=_(!1);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[{Name:"--no-encryption",Value:"true"}];e&&(t=[{Name:"--passphrase",Value:e}]),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(T(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#o.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#o.navigate(["encryption"],{relativeTo:this.#n.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-restore-encryption"]],decls:12,vars:1,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let o;return o=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `,[e,t,o,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",3),O("submit",function(){return t.next()}),r(1,"spk-form-field")(2,"label",4),E(3,0),l(),c(4,"input",5),l(),r(5,"div",6)(6,"button",7),O("click",function(){return t.back()}),u(7,1),c(8,"spk-icon"),F(),l(),r(9,"button",8),u(10,2),c(11,"spk-icon"),F(),l()()()),e&2&&S("formGroup",t.encryptionForm)},dependencies:[w,b,y,L,$,D,A,ye,I,k],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 Ke=()=>({standalone:!0});function Ue(a,i){a&1&&c(0,"spk-progress-bar",7)}function je(a,i){if(a&1&&(r(0,"div",14),j(1),Ie(2,"date"),l()),a&2){let e=i.$implicit;m(),fe("",e.Version,": ",ke(2,2,e.Time,"medium"))}}function qe(a,i){a&1&&c(0,"spk-progress-bar",7)}function He(a,i){if(a&1&&(r(0,"app-file-tree",13)(1,"label",15),E(2,4),l(),c(3,"input",16),l()),a&2){let e=x(2);S("rootPaths",e.rootPaths())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function Je(a,i){if(a&1){let e=B();r(0,"spk-select",11),O("cleared",function(){f(e);let o=x();return C(o.abortLoading())}),r(1,"input",12),Ne("ngModelChange",function(o){f(e);let n=x();return Re(n.selectOption,o)||(n.selectOption=o),C(o)}),l(),ge(2,je,3,5,"ng-template"),l(),z(3,qe,1,0,"spk-progress-bar",7),z(4,He,4,4,"app-file-tree",13)}if(a&2){let e=x();S("options",e.versionOptions())("isClearable",!1),m(),Ce("ngModel",e.selectOption),S("ngModelOptions",he(6,Ke)),m(2),Y(e.isDraft()||e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),m(),Y(e.showFileTree()?4:-1)}}var se=new v,ze=()=>se.group({filesToRestore:se.control(""),passphrase:se.control(null)}),re=class a{#t=p(M);#e=p(P);#o=p(J);#n=p(N);#i=p(R);#s=p(H);#r=null;#a=null;selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isDraft=this.#e.isDraft;isFileRestore=this.#e.isFileRestore;showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);loadingRootPath=_(!1);isRepairing=_(!1);loadingEffect=q(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=q(()=>{let i=this.backupId(),e=this.isRepairing(),t=this.selectOption();if(!t||!i)return;let n=this.versionOptions()?.find(d=>d.Version===parseInt(t))?.Time??null;if(!n||e)return;let s={id:i+"",time:n};this.backupSettings.set(s),this.getRootPath(s)});repairEffect=q(()=>{let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#a===n)return;this.#a=n,this.isRepairing.set(!0),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(X(this.abortLoading$),T(()=>{this.#a=null})).subscribe(s=>{let d=s.ID;var G=window.setInterval(()=>{this.#t.getApiV1TaskByTaskid({taskid:d}).subscribe(W=>{W.Status==="Completed"&&(clearInterval(G),this.isRepairing.set(!1))})},1e3)})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#r===t||(this.#r=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(X(this.abortLoading$),T(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#r=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?this.rootPaths.set(n):this.rootPaths.set(["/"])}}):this.#t.getApiV1BackupByIdFiles(e).pipe(X(this.abortLoading$),T(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?this.rootPaths.set(n):this.rootPaths.set(["/"])}}))}abortLoading$=new _e;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#s.transform(t.Time,"medium")}`:""}}next(){this.#n.navigate(["options"],{relativeTo:this.#i.parent})}back(){this.#e.isFileRestore()?this.#n.navigate(["encryption"],{relativeTo:this.#i.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-select-files"]],features:[Pe([H])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize`Select an option...`;let n;return n=$localize`Path`,[["formRef",""],i,e,t,n,[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"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","backupSettings","multiSelect","showFiles"],[1,"custom-option"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=B();r(0,"form",5,0),O("submit",function(){return f(o),C(t.next())}),r(2,"h3",6),E(3,1),l(),z(4,Ue,1,0,"spk-progress-bar",7)(5,Je,5,7),r(6,"div",8)(7,"button",9),O("click",function(){return f(o),C(t.back())}),u(8,2),c(9,"spk-icon"),F(),l(),r(10,"button",10),u(11,3),c(12,"spk-icon"),F(),l()()()}e&2&&(S("formGroup",t.selectFilesForm),m(4),Y(t.versionOptionsLoading()?4:5),m(5),Te(t.isFileRestore()?"Back":"Exit"),Ee(8))},dependencies:[Ge,b,y,L,$,ve,w,D,A,H,Q,k,I,be,Le],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 P=class a{#t=p(N);#e=p(R);#o=p(J);#n=p(Me);#i=p(M);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);selectFilesForm=ze();optionsForm=Ye();encryptionForm=Xe();optionsFormSignal=oe(this.optionsForm.valueChanges);selectFilesFormSignal=oe(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isDraft=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);init(i,e=!1,t=!1){this.backupId.set(i),this.isFileRestore.set(e),this.isDraft.set(t),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup(!0)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId(),e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>`${s}*`)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(T(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.#t.navigate(["./progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#n.open(te,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#s(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Fe(t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder";return o||n||s||e===0?ce(()=>t):ue(1e3).pipe(Se(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(i=!1){let e=this.backupId();this.versionOptionsLoading.set(!0),this.#o.hasV2ListOperations()?Z([this.#i.getApiV1BackupById({id:e}),this.loadFilesetsWithRetryv2(e)]).pipe(ee(1),T(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{if(o.Error)throw new Error(o.Error);this.versionOptions.set((o.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)},error:t=>{let o=t?.error?.body?.StatusCode==="EncryptedStorageNoPassphrase",n=t?.error?.body?.StatusCode==="FolderMissing",s=t?.error?.body?.StatusCode==="EmptyRemoteFolder",d=$localize`An error occurred while loading the backup filesets: ${t.message}`;o&&(d=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(d=$localize`The backup storage folder was not found.`),s&&(d=$localize`The backup storage folder does not contain any filesets.`),this.#n.open(te,{data:{title:$localize`Failed to load backup filesets`,message:d,confirmText:$localize`OK`,cancelText:void 0},closed:G=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):Z([this.#i.getApiV1BackupById({id:e}),this.#i.getApiV1BackupByIdFilesets({id:e}).pipe(me(3))]).pipe(ee(1),T(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([t,o])=>{this.versionOptions.set(o.map(n=>({Version:n.Version??-1,IsFullBackup:(n.IsFullBackup??1)==1,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(t)}})}#s(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=de({token:a,factory:a.\u0275fac,providedIn:"root"})};var V=new v,Ye=()=>V.group({restoreFrom:V.control("orignal"),restoreFromPath:V.control(""),handleExisting:V.control("overwrite"),permissions:V.control(!1)}),ae=class a{#t=p(P);#e=p(N);#o=p(R);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=h({type:a,selectors:[["app-advanced-options-settings"]],decls:39,vars:6,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let d;d=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let G;G=$localize`Permissions`;let W;W=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let le;le=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let pe;return pe=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,d,G,W,le,pe,[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,t){if(e&1){let o=B();r(0,"form",12,0),O("submit",function(){return f(o),C(t.submit())}),r(2,"h3",13),E(3,1),l(),r(4,"app-toggle-card",14),K(5,15),E(6,2),U(),r(7,"spk-radio",16),u(8,3),c(9,"input",17),F(),l(),r(10,"spk-radio",16),u(11,4),c(12,"input",18),F(),l(),r(13,"app-file-tree",19)(14,"label",20),j(15,"Path"),l(),c(16,"input",21),l()(),r(17,"app-toggle-card",14),K(18,15),E(19,5),U(),r(20,"spk-radio",16),u(21,6),c(22,"input",22),F(),l(),r(23,"spk-radio",16),u(24,7),c(25,"input",23),F(),l()(),r(26,"app-toggle-card"),K(27,15),E(28,8),U(),r(29,"spk-toggle",24),u(30,9),c(31,"input",25),F(),l()(),r(32,"div",26)(33,"button",27),O("click",function(){return f(o),C(t.goBack())}),u(34,10),c(35,"spk-icon"),F(),l(),r(36,"button",28),u(37,11),c(38,"spk-icon"),F(),l()()()}if(e&2){let o;S("formGroup",t.optionsForm),m(4),S("disallowToggle",!0),m(9),S("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation"),m(4),S("disallowToggle",!0),m(19),Oe("loader",t.isSubmitting())}},dependencies:[w,b,y,Ae,we,L,$,D,A,Be,Q,De,$e,k,I],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,ae as b,Xe as c,ie as d,ze as e,re as f,P as g};
@@ -1 +1 @@
1
- import{a as B}from"./chunk-XBP565VF.js";import{a as b}from"./chunk-RHW5QVAY.js";import{a as h}from"./chunk-2YHX57UE.js";import{a as d}from"./chunk-OQHMS5HM.js";import{h as k}from"./chunk-XD6MBGQY.js";import{E as s,F as n,Fc as p,Gc as o,P as u,S as c,X as i,la as a}from"./chunk-67YRCRMI.js";var m="backupListOrderBy",f="backupListShowActualTimes",S=[{value:"id",label:$localize`Backup ID`},{value:"name",label:$localize`Backup name`},{value:"lastrun",label:$localize`Last run time`},{value:"nextrun",label:$localize`Next run time`},{value:"schedule",label:$localize`Is scheduled`},{value:"backend",label:$localize`Destination type`},{value:"sourcesize",label:$localize`Source size`},{value:"destinationsize",label:$localize`Destination size`},{value:"duration",label:$localize`Duration`},{value:"-id",label:$localize`Backup ID (decending)`},{value:"-name",label:$localize`Backup name (decending)`},{value:"-lastrun",label:$localize`Last run time (decending)`},{value:"-nextrun",label:$localize`Next run time (decending)`},{value:"-schedule",label:$localize`Is scheduled (decending)`},{value:"-backend",label:$localize`Destination type (decending)`},{value:"-sourcesize",label:$localize`Source size (decending)`},{value:"-destinationsize",label:$localize`Destination size (decending)`},{value:"-duration",label:$localize`Duration (decending)`}],y=class l{#i=i(d);#l=i(k);#o=i(h);#e=i(B);#u=null;#t=a([]);#a=a([]);#r=a(!1);#n=a(null);#d=a(null);#c=a(this.#i.getItemParsed(f,!0)??"relative");#s=a(this.#i.getItemParsed(m,!0)??"id");orderByOptions=a(S);orderBy=this.#s.asReadonly();backups=this.#a.asReadonly();timeType=this.#c.asReadonly();backupsLoading=this.#r.asReadonly();startingBackup=this.#n.asReadonly();deletingBackup=this.#d.asReadonly();draftBackups=this.#t.asReadonly();#p=p(()=>this.#o.hasBackupListSubscribeOption()&&this.#e.getConnectionMethod()==="websocket");#k=o(()=>{let e=this.#e.backupListState();e&&this.#a.set(e)});addDraftBackup(e){let t=b();return this.#t.set([...this.#t(),{id:t,data:e}]),t}setOrderBy(e){this.#i.setItemParsed(m,e,!0),this.#s.set(e),this.#e.isConnectionMethodSet()&&(this.#p()?this.#e.subscribe("backuplist",e):this.getBackups(!0))}setTimeType(e){this.#i.setItemParsed(f,e,!0),this.#c.set(e)}removeDraftBackupById(e){this.#t.set(this.#t().filter(t=>t.id!==e))}getBackupById(e){return this.#a().find(t=>t.Backup?.ID===e)??null}getBackups(e=!1){if(!this.#e.isConnectionMethodSet())return;if(this.#p()){this.#e.subscribe("backuplist",this.#s());return}let t=this.#u,r=Date.now(),g=t&&r-t<15*60*1e3;t&&r-t<100||!e&&g&&this.#a().length||(this.#u=r,this.#r.set(!0),this.#l.getApiV1Backups({orderBy:this.#s()}).pipe(s(1),u(v=>this.#a.set(v)),n(()=>this.#r.set(!1))).subscribe())}startBackup(e){this.#n.set(e),this.#l.postApiV1BackupByIdStart({id:e}).pipe(s(1),u(()=>this.getBackups(!0)),n(()=>this.#n.set(null))).subscribe()}deleteBackup(e){return this.#l.deleteApiV1BackupById(e).pipe(s(1))}static \u0275fac=function(t){return new(t||l)};static \u0275prov=c({token:l,factory:l.\u0275fac,providedIn:"root"})};export{y as a};
1
+ import{a as B}from"./chunk-VFVXE2DC.js";import{a as b}from"./chunk-RHW5QVAY.js";import{a as h}from"./chunk-BHSG643V.js";import{a as d}from"./chunk-OQHMS5HM.js";import{h as k}from"./chunk-XD6MBGQY.js";import{E as s,F as n,Fc as p,Gc as o,P as u,S as c,X as i,la as a}from"./chunk-67YRCRMI.js";var m="backupListOrderBy",f="backupListShowActualTimes",S=[{value:"id",label:$localize`Backup ID`},{value:"name",label:$localize`Backup name`},{value:"lastrun",label:$localize`Last run time`},{value:"nextrun",label:$localize`Next run time`},{value:"schedule",label:$localize`Is scheduled`},{value:"backend",label:$localize`Destination type`},{value:"sourcesize",label:$localize`Source size`},{value:"destinationsize",label:$localize`Destination size`},{value:"duration",label:$localize`Duration`},{value:"-id",label:$localize`Backup ID (decending)`},{value:"-name",label:$localize`Backup name (decending)`},{value:"-lastrun",label:$localize`Last run time (decending)`},{value:"-nextrun",label:$localize`Next run time (decending)`},{value:"-schedule",label:$localize`Is scheduled (decending)`},{value:"-backend",label:$localize`Destination type (decending)`},{value:"-sourcesize",label:$localize`Source size (decending)`},{value:"-destinationsize",label:$localize`Destination size (decending)`},{value:"-duration",label:$localize`Duration (decending)`}],y=class l{#i=i(d);#l=i(k);#o=i(h);#e=i(B);#u=null;#t=a([]);#a=a([]);#r=a(!1);#n=a(null);#d=a(null);#c=a(this.#i.getItemParsed(f,!0)??"relative");#s=a(this.#i.getItemParsed(m,!0)??"id");orderByOptions=a(S);orderBy=this.#s.asReadonly();backups=this.#a.asReadonly();timeType=this.#c.asReadonly();backupsLoading=this.#r.asReadonly();startingBackup=this.#n.asReadonly();deletingBackup=this.#d.asReadonly();draftBackups=this.#t.asReadonly();#p=p(()=>this.#o.hasBackupListSubscribeOption()&&this.#e.getConnectionMethod()==="websocket");#k=o(()=>{let e=this.#e.backupListState();e&&this.#a.set(e)});addDraftBackup(e){let t=b();return this.#t.set([...this.#t(),{id:t,data:e}]),t}setOrderBy(e){this.#i.setItemParsed(m,e,!0),this.#s.set(e),this.#e.isConnectionMethodSet()&&(this.#p()?this.#e.subscribe("backuplist",e):this.getBackups(!0))}setTimeType(e){this.#i.setItemParsed(f,e,!0),this.#c.set(e)}removeDraftBackupById(e){this.#t.set(this.#t().filter(t=>t.id!==e))}getBackupById(e){return this.#a().find(t=>t.Backup?.ID===e)??null}getBackups(e=!1){if(!this.#e.isConnectionMethodSet())return;if(this.#p()){this.#e.subscribe("backuplist",this.#s());return}let t=this.#u,r=Date.now(),g=t&&r-t<15*60*1e3;t&&r-t<100||!e&&g&&this.#a().length||(this.#u=r,this.#r.set(!0),this.#l.getApiV1Backups({orderBy:this.#s()}).pipe(s(1),u(v=>this.#a.set(v)),n(()=>this.#r.set(!1))).subscribe())}startBackup(e){this.#n.set(e),this.#l.postApiV1BackupByIdStart({id:e}).pipe(s(1),u(()=>this.getBackups(!0)),n(()=>this.#n.set(null))).subscribe()}deleteBackup(e){return this.#l.deleteApiV1BackupById(e).pipe(s(1))}static \u0275fac=function(t){return new(t||l)};static \u0275prov=c({token:l,factory:l.\u0275fac,providedIn:"root"})};export{y as a};
@@ -1 +1 @@
1
- import{b as re}from"./chunk-67XQIEG5.js";import{a as ne}from"./chunk-F66HJES7.js";import"./chunk-XBP565VF.js";import{a as ie}from"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-2YHX57UE.js";import{a as te}from"./chunk-3Q5JEF3K.js";import{b as oe,e as ae,i as le,s as _e}from"./chunk-ZCT7SRIM.js";import"./chunk-OQHMS5HM.js";import{d as q,e as H}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{a as J,e as Q,g as Y,i as Z}from"./chunk-DNBOZ26J.js";import{h as ee}from"./chunk-XD6MBGQY.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import{B as y,Bb as g,F as O,Fc as B,Jb as c,Kb as D,Lb as S,Lc as j,Mb as F,Nb as x,Oa as r,Ob as p,X as E,_a as $,_b as I,ba as C,bc as u,ca as m,gc as h,hc as L,ic as M,jc as w,kc as G,la as P,lc as X,n as U,pb as f,qb as T,qc as v,r as K,rc as z,ub as A,uc as V,vb as i,wb as o,xc as W}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var ce=l=>["/backup",l,"export"],se=()=>["/"];function ue(l,_){if(l&1){let t=g();i(0,"section")(1,"h4"),c(2,4),o(),i(3,"p"),c(4,5),o(),i(5,"spk-checkbox",11),u(6," Delete local database "),i(7,"input",12),M("ngModelChange",function(e){C(t);let a=p();return L(a.deleteLocalDb,e)||(a.deleteLocalDb=e),m(e)}),o()()()}if(l&2){let t=p();r(7),h("ngModel",t.deleteLocalDb)}}function Ee(l,_){if(l&1){let t=g();i(0,"section")(1,"h4"),c(2,6),o(),i(3,"p"),c(4,7),V(5,"bytes"),o(),i(6,"spk-checkbox",11),u(7," Delete remote files "),i(8,"input",12),M("ngModelChange",function(e){C(t);let a=p();return L(a.deleteRemoteFiles,e)||(a.deleteRemoteFiles=e),m(e)}),o()()()}if(l&2){let t=p(),n=X(0),e=(n==null||n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFileSize)??0;r(5),D(t.fileCount())(t.fileCount())(W(5,4,e,!0,!0)),S(4),r(3),h("ngModel",t.deleteRemoteFiles)}}var b=class l{#t=E(ee);#n=E(Q);#e=E(ne);#i=E(q);id=j.required();backup=B(()=>this.#e.getBackupById(this.id()));noLocalDbResource=re({params:()=>({dbPath:this.backup()?.Backup?.DBPath}),stream:({params:_})=>this.#t.postApiV1FilesystemValidate({requestBody:{path:_.dbPath}}).pipe(K(()=>!0),y(()=>U(!1)))});fileCount=B(()=>parseInt(this.backup()?.Backup?.Metadata?.TargetFileCount??"0",10));deleteLocalDb=P(!1);deleteRemoteFiles=P(!1);isDeleting=P(!1);deleteBackup(){let _=this.id(),t=this.deleteLocalDb(),n=this.deleteRemoteFiles();this.isDeleting.set(!0),this.#n.open(ie,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete this backup?`,confirmText:$localize`Delete backup`,cancelText:$localize`Cancel`},closed:e=>{e&&this.#e.deleteBackup({id:_,deleteLocalDb:t,deleteRemoteFiles:n}).pipe(O(()=>this.isDeleting.set(!1))).subscribe({next:()=>{this.#i.navigate(["/"])}})}})}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=$({type:l,selectors:[["app-delete-backup"]],inputs:{id:[1,"id"]},decls:19,vars:11,consts:()=>{let _;_=$localize`Delete backup: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let t;t=$localize`Export configuration`;let n;n=$localize`If you want to use the backup later, you can export the configuration before deleting it.`;let e;e=$localize`Cancel`;let a;a=$localize`Delete local database`;let k;k=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. When deleting a backup, you can also delete the local database without affecting the ability to restore the remote files. If you are using the local database for backups from the commandline, you should keep the database. `;let N;N=$localize`Delete remote files`;let d;d=$localize`{VAR_PLURAL, plural, =1 {1 file} other {{INTERPOLATION} files}}`,d=F(d,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let R;return R=$localize` Delete ${d}:ICU@@2159106180826349718: (${"\uFFFD2\uFFFD"}:INTERPOLATION_1:) from the remote storage? `,[_,t,n,e,a,k,N,R,["spk-button","",3,"routerLink"],[1,"actions"],["spk-button","",1,"raised","error",3,"click"],[1,"primary","raised"],["type","checkbox",3,"ngModelChange","ngModel"]]},template:function(t,n){if(t&1){let e=g();w(0),i(1,"h3"),c(2,0),o(),f(3,ue,8,1,"section"),i(4,"section")(5,"h4"),c(6,1),o(),i(7,"p"),c(8,2),o(),i(9,"button",8),u(10," Export configuration "),i(11,"spk-icon"),u(12,"caret-right"),o()()(),f(13,Ee,9,8,"section"),i(14,"div",9)(15,"button",8),c(16,3),o(),i(17,"button",10),x("click",function(){return C(e),m(n.deleteBackup())}),u(18,"Delete backup"),o()()}if(t&2){let e=G(n.backup()),a=n.noLocalDbResource.value();r(2),D(e==null||e.Backup==null?null:e.Backup.Name),S(2),r(),T(a?3:-1),r(6),A("routerLink",z(8,ce,n.id())),r(4),T(a?13:-1),r(2),A("routerLink",v(10,se)),r(2),I("loader",n.isDeleting())}},dependencies:[Z,Y,J,te,_e,oe,ae,le,H],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:2.5rem;max-width:43.75rem}section[_ngcontent-%COMP%]{padding:2rem 0;display:flex;align-items:flex-start;flex-direction:column}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0}h4[_ngcontent-%COMP%]{font:var(--paragraph-20);margin-bottom:.5rem}p[_ngcontent-%COMP%]{margin-bottom:1rem}.actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;padding:2rem 0}"],changeDetection:0})};export{b as default};
1
+ import{b as re}from"./chunk-67XQIEG5.js";import{a as ne}from"./chunk-B6DE3TTE.js";import"./chunk-VFVXE2DC.js";import{a as ie}from"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-BHSG643V.js";import{a as te}from"./chunk-3Q5JEF3K.js";import{b as oe,e as ae,i as le,s as _e}from"./chunk-ZCT7SRIM.js";import"./chunk-OQHMS5HM.js";import{d as q,e as H}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{a as J,e as Q,g as Y,i as Z}from"./chunk-DNBOZ26J.js";import{h as ee}from"./chunk-XD6MBGQY.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import{B as y,Bb as g,F as O,Fc as B,Jb as c,Kb as D,Lb as S,Lc as j,Mb as F,Nb as x,Oa as r,Ob as p,X as E,_a as $,_b as I,ba as C,bc as u,ca as m,gc as h,hc as L,ic as M,jc as w,kc as G,la as P,lc as X,n as U,pb as f,qb as T,qc as v,r as K,rc as z,ub as A,uc as V,vb as i,wb as o,xc as W}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var ce=l=>["/backup",l,"export"],se=()=>["/"];function ue(l,_){if(l&1){let t=g();i(0,"section")(1,"h4"),c(2,4),o(),i(3,"p"),c(4,5),o(),i(5,"spk-checkbox",11),u(6," Delete local database "),i(7,"input",12),M("ngModelChange",function(e){C(t);let a=p();return L(a.deleteLocalDb,e)||(a.deleteLocalDb=e),m(e)}),o()()()}if(l&2){let t=p();r(7),h("ngModel",t.deleteLocalDb)}}function Ee(l,_){if(l&1){let t=g();i(0,"section")(1,"h4"),c(2,6),o(),i(3,"p"),c(4,7),V(5,"bytes"),o(),i(6,"spk-checkbox",11),u(7," Delete remote files "),i(8,"input",12),M("ngModelChange",function(e){C(t);let a=p();return L(a.deleteRemoteFiles,e)||(a.deleteRemoteFiles=e),m(e)}),o()()()}if(l&2){let t=p(),n=X(0),e=(n==null||n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetFileSize)??0;r(5),D(t.fileCount())(t.fileCount())(W(5,4,e,!0,!0)),S(4),r(3),h("ngModel",t.deleteRemoteFiles)}}var b=class l{#t=E(ee);#n=E(Q);#e=E(ne);#i=E(q);id=j.required();backup=B(()=>this.#e.getBackupById(this.id()));noLocalDbResource=re({params:()=>({dbPath:this.backup()?.Backup?.DBPath}),stream:({params:_})=>this.#t.postApiV1FilesystemValidate({requestBody:{path:_.dbPath}}).pipe(K(()=>!0),y(()=>U(!1)))});fileCount=B(()=>parseInt(this.backup()?.Backup?.Metadata?.TargetFileCount??"0",10));deleteLocalDb=P(!1);deleteRemoteFiles=P(!1);isDeleting=P(!1);deleteBackup(){let _=this.id(),t=this.deleteLocalDb(),n=this.deleteRemoteFiles();this.isDeleting.set(!0),this.#n.open(ie,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete this backup?`,confirmText:$localize`Delete backup`,cancelText:$localize`Cancel`},closed:e=>{e&&this.#e.deleteBackup({id:_,deleteLocalDb:t,deleteRemoteFiles:n}).pipe(O(()=>this.isDeleting.set(!1))).subscribe({next:()=>{this.#i.navigate(["/"])}})}})}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=$({type:l,selectors:[["app-delete-backup"]],inputs:{id:[1,"id"]},decls:19,vars:11,consts:()=>{let _;_=$localize`Delete backup: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let t;t=$localize`Export configuration`;let n;n=$localize`If you want to use the backup later, you can export the configuration before deleting it.`;let e;e=$localize`Cancel`;let a;a=$localize`Delete local database`;let k;k=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. When deleting a backup, you can also delete the local database without affecting the ability to restore the remote files. If you are using the local database for backups from the commandline, you should keep the database. `;let N;N=$localize`Delete remote files`;let d;d=$localize`{VAR_PLURAL, plural, =1 {1 file} other {{INTERPOLATION} files}}`,d=F(d,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let R;return R=$localize` Delete ${d}:ICU@@2159106180826349718: (${"\uFFFD2\uFFFD"}:INTERPOLATION_1:) from the remote storage? `,[_,t,n,e,a,k,N,R,["spk-button","",3,"routerLink"],[1,"actions"],["spk-button","",1,"raised","error",3,"click"],[1,"primary","raised"],["type","checkbox",3,"ngModelChange","ngModel"]]},template:function(t,n){if(t&1){let e=g();w(0),i(1,"h3"),c(2,0),o(),f(3,ue,8,1,"section"),i(4,"section")(5,"h4"),c(6,1),o(),i(7,"p"),c(8,2),o(),i(9,"button",8),u(10," Export configuration "),i(11,"spk-icon"),u(12,"caret-right"),o()()(),f(13,Ee,9,8,"section"),i(14,"div",9)(15,"button",8),c(16,3),o(),i(17,"button",10),x("click",function(){return C(e),m(n.deleteBackup())}),u(18,"Delete backup"),o()()}if(t&2){let e=G(n.backup()),a=n.noLocalDbResource.value();r(2),D(e==null||e.Backup==null?null:e.Backup.Name),S(2),r(),T(a?3:-1),r(6),A("routerLink",z(8,ce,n.id())),r(4),T(a?13:-1),r(2),A("routerLink",v(10,se)),r(2),I("loader",n.isDeleting())}},dependencies:[Z,Y,J,te,_e,oe,ae,le,H],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;padding:2.5rem;max-width:43.75rem}section[_ngcontent-%COMP%]{padding:2rem 0;display:flex;align-items:flex-start;flex-direction:column}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0}h4[_ngcontent-%COMP%]{font:var(--paragraph-20);margin-bottom:.5rem}p[_ngcontent-%COMP%]{margin-bottom:1rem}.actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;gap:.5rem;padding:2rem 0}"],changeDetection:0})};export{b as default};
@@ -0,0 +1 @@
1
+ import{h as c}from"./chunk-XD6MBGQY.js";import{F as a,Fc as e,P as p,S as u,X as l,la as o}from"./chunk-67YRCRMI.js";var m=class r{#e=l(c);isLoaded=o(!1);systemInfo=o(null);filterGroups=o(null);backendModules=e(()=>this.systemInfo()?.BackendModules??[]);allOptionsGrouped=e(()=>{let s={displayName:"Default",options:this.systemInfo()?.Options?.map(this.#s)??[]},t=this.systemInfo()?.GenericModules?.map(i=>({displayName:i.DisplayName??i.Key,options:i.Options?.map(this.#s)??[]}))??[],n=this.systemInfo()?.CompressionModules?.map(i=>({displayName:i.DisplayName??i.Key,options:i.Options?.map(this.#s)??[]}))??[],d=this.systemInfo()?.EncryptionModules?.map(i=>({displayName:i.DisplayName??i.Key,options:i.Options?.map(this.#s)??[]}))??[];return[s,...t,...n,...d]});allOptions=e(()=>this.allOptionsGrouped().reduce((s,t)=>[...s,...t.options],[]));hasWebSocket=e(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:websocket"));hasV2ListOperations=e(()=>{let s=this.systemInfo()?.APIExtensions??[];return s.includes("v2:backup:list-filesets")&&s.includes("v2:backup:list-folder")});hasV2TestOperations=e(()=>(this.systemInfo()?.APIExtensions??[]).includes("v2:destination:test"));hasProgressSubscribeOption=e(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:progress"));hasTaskSubscribeOption=e(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:taskqueue"));hasBackupListSubscribeOption=e(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:subscribe:backuplist"));hasWebSocketAuth=e(()=>(this.systemInfo()?.APIExtensions??[]).includes("v1:websocket:authenticate"));defaultOAuthUrl=e(()=>{let s=this.systemInfo()?.DefaultOAuthURL??"https://duplicati-oauth-handler.appspot.com/";return s.endsWith("/refresh")?s.slice(0,-8):s});defaultOAuthUrlV2=e(()=>{let s=this.systemInfo()?.DefaultOAuthURLv2??"https://oauth-service.duplicati.com/";return s.endsWith("/refresh")?s.slice(0,-8):s});preload(s=!1){let t=this.#e.getApiV1Systeminfo().pipe(p(n=>{this.systemInfo.set(n)}),a(()=>this.isLoaded.set(!0)));if(s)return t;t.subscribe()}preloadFilterGroups(s=!1){let t=this.#e.getApiV1SysteminfoFiltergroups().pipe(p(n=>{this.filterGroups.set(n)}),a(()=>this.isLoaded.set(!0)));if(s)return t;t.subscribe()}#s(s){return{name:s.Name,type:s.Type,shortDescription:s.ShortDescription??void 0,longDescription:s.LongDescription??void 0,deprecatedDescription:s.Deprecated??!1?s.DeprecationMessage??void 0:void 0,options:s.ValidValues,defaultValue:s.DefaultValue}}static \u0275fac=function(t){return new(t||r)};static \u0275prov=u({token:r,factory:r.\u0275fac,providedIn:"root"})};export{m as a};
@@ -1 +1 @@
1
- import{a as Ce}from"./chunk-A7BFGBWF.js";import{a as ge}from"./chunk-F66HJES7.js";import{a as me}from"./chunk-XBP565VF.js";import{a as de}from"./chunk-2YHX57UE.js";import{c as Ee,e as Oe,i as fe,k as Ae,s as v}from"./chunk-ZCT7SRIM.js";import{b as oe}from"./chunk-OQHMS5HM.js";import{a as ae,b as se,e as le,g as re,i as _e,l as pe,p as ue,q as Se,s as ce,t as Te}from"./chunk-DNBOZ26J.js";import{h as A}from"./chunk-XD6MBGQY.js";import{a as Pe}from"./chunk-HPZ6HLJE.js";import{la as ie}from"./chunk-GP2W7XZF.js";import{Bb as k,F as L,Fc as y,Hb as E,Ib as O,Jb as u,Kc as $,Mb as Q,Nb as S,Oa as r,Ob as d,X as T,Zb as ee,_a as f,_b as m,ba as N,bc as g,ca as M,dc as G,ec as z,gc as h,hc as b,ic as B,la as c,pb as I,qb as D,rb as Z,sb as q,tb as J,ub as R,uc as X,vb as s,vc as te,wb as l,wc as ne,xb as C}from"./chunk-67YRCRMI.js";function ke(a,n){if(a&1){let i=k();s(0,"spk-radio",10),S("click",function(){let t=N(i).$implicit,o=d();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=d();m("active",e.pauseOption()===i.value),r(),G(" ",i.label," ")}}var he=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],x=class a{#e=T(A);pauseOptions=c(he);closed=$();isSubmitting=c(!1);pauseTransfers=c(!1);pauseOption=c(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(L(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),u(2,0),l()(),s(3,"div",6)(4,"div",7),q(5,ke,2,3,"spk-radio",8,Z),l(),s(7,"div",9)(8,"spk-checkbox",10),S("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),u(9,1),l(),s(10,"spk-alert",11),u(11,2),l()()(),s(12,"footer",12)(13,"button",13),S("click",function(){return e.closed.emit()}),u(14,3),l(),s(15,"button",14),S("click",function(){return e.submit()}),u(16,4),l()()),i&2&&(r(5),J(e.pauseOptions()),r(3),m("active",e.pauseTransfers()),r(7),m("loader",e.isSubmitting()))},dependencies:[v,Se,_e,se],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},be=["mbps","gbps"],Ie=8,V=1024,w=V*1024,W=w*1024,Y=W*1024,De=Y*1024,Be={B:1,KB:V,MB:w,GB:W,TB:Y,PB:De},ye=1e3,K=ye*1e3,H=K*1e3,Ue=[{threshold:De,unitPrefix:"PByte"},{threshold:Y,unitPrefix:"TByte"},{threshold:W,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:V,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],U=class a{#e=T(A);closed=$();isSubmitting=c(!1);sizeOptions=c([...be]);maxUpload=c(0);maxDownload=c(0);maxUploadUnit=c("mbps");maxDownloadUnit=c("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(Be[i.toUpperCase()]||w)*Ie;return t===0?{value:0,unit:"mbps"}:t>=H?{value:parseFloat((t/H).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/K).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*H;break;case"mbps":e=n*K;break}let t=e/Ie;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:_}of Ue)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:_};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],p=this.convertToBitsPerSecondUnits(o,_);this.maxUpload.set(p.value),this.maxUploadUnit.set(p.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],p=this.convertToBitsPerSecondUnits(o,_);this.maxDownload.set(p.value),this.maxDownloadUnit.set(p.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,_=this.maxDownloadUnit();if(e>0){let{valueForApi:p,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(e,t),F=Me[P];F?n=`${p}${F}`:console.error(`Invalid unit prefix for API submission (upload): ${P}. Defaulting to empty string.`)}if(o){let{valueForApi:p,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(o,_),F=Me[P];F?i=`${p}${F}`:console.error(`Invalid unit prefix for API submission (download): ${P}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(L(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:p=>{console.error("Failed to submit throttle settings:",p)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let _;return _=$localize` Update settings `,[n,i,e,t,o,_,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),u(2,0),l(),s(3,"p"),u(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),u(9,2),l(),s(10,"spk-form-field")(11,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),B("ngModelChange",function(o){return b(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"spk-select",10)(13,"input",11),B("ngModelChange",function(o){return b(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),u(16,3),l(),s(17,"spk-form-field")(18,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),B("ngModelChange",function(o){return b(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"spk-select",10)(20,"input",11),B("ngModelChange",function(o){return b(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),S("click",function(){return e.closed.emit(!1)}),u(23,4),l(),s(24,"button",14),S("click",function(){return e.submit()}),u(25,5),l()()),i&2&&(r(11),h("ngModel",e.maxUpload),r(),R("isClearable",!1)("options",e.sizeOptions()),r(),h("ngModel",e.maxUploadUnit),r(5),h("ngModel",e.maxDownload),r(),R("isClearable",!1)("options",e.sizeOptions()),r(),h("ngModel",e.maxDownloadUnit),r(4),m("loader",e.isSubmitting()))},dependencies:[v,Ee,Ae,Oe,fe,pe,Te],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] spk-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] spk-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Le(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"spk-progress-bar",11)),a&2){let i=d();r(),z("",i.statusData().actionText," - ",i.statusData().statusText),r(),R("value",i.statusData().progress*100)}}function Ge(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"spk-icon"),g(3,"clock"),l(),g(4),X(5,"relativeTime"),X(6,"date"),l()),a&2){let i,e=d();r(),G(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),r(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function $e(a,n){a&1&&(s(0,"div",7),u(1,1),l())}function ve(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"spk-spinner"),O(),l()),a&2&&(r(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function xe(a,n){if(a&1){let i=k();s(0,"button",10),S("click",function(){N(i);let t=d(2);return M(t.abort())}),E(1,3),C(2,"spk-icon"),O(),l()}}function we(a,n){if(a&1){let i=k();s(0,"button",10),S("click",function(){N(i);let t=d(2);return M(t.stop())}),E(1,4),C(2,"spk-icon"),O(),l()}}function ze(a,n){if(a&1&&I(0,xe,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=d();D(i.isStopping()?0:1)}}function Xe(a,n){a&1&&(E(0,0,1),C(1,"spk-icon"),O())}function He(a,n){a&1&&(E(0,0,2),C(1,"spk-icon"),O())}var Re=new Date,j=class a{#e=T(A);#t=T(Ce);#n=T(le);#a=T(ge);#s=T(oe);#l=T(de);#i=T(me);minsAgo=Re.setMinutes(Re.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=y(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=y(()=>this.runningTask()==this.#o());#o=c(-1);pgState=y(()=>this.#i.serverState());nextBackup=y(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(U,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(x,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["spk-button","",3,"click"],[1,"raised","primary",3,"value"],["spk-button",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),I(2,Le,3,3)(3,Ge,7,8,"div",7)(4,$e,2,0,"div",7)(5,ve,3,4,"div",8),l(),s(6,"div",9),I(7,ze,2,1),s(8,"button",10),S("click",function(){return e.pauseResume()}),E(9,0),I(10,Xe,2,0)(11,He,2,0),O(),l(),s(12,"button",10),S("click",function(){return e.openThrottleSettingsDialog()}),s(13,"spk-icon"),g(14,"speedometer"),l()()()()),i&2){let t;r(2),D((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),r(5),D(e.runningTask()?7:-1),r(),m("loader",e.isResuming()),r(2),D(e.clientIsRunning()?10:11)}},dependencies:[ue,Pe,ie,ae,re,ce],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
1
+ import{a as Ce}from"./chunk-NZD6UMYZ.js";import{a as ge}from"./chunk-B6DE3TTE.js";import{a as me}from"./chunk-VFVXE2DC.js";import{a as de}from"./chunk-BHSG643V.js";import{c as Ee,e as Oe,i as fe,k as Ae,s as v}from"./chunk-ZCT7SRIM.js";import{b as oe}from"./chunk-OQHMS5HM.js";import{a as ae,b as se,e as le,g as re,i as _e,l as pe,p as ue,q as Se,s as ce,t as Te}from"./chunk-DNBOZ26J.js";import{h as A}from"./chunk-XD6MBGQY.js";import{a as Pe}from"./chunk-4VPA3END.js";import{la as ie}from"./chunk-GP2W7XZF.js";import{Bb as k,F as L,Fc as y,Hb as E,Ib as O,Jb as u,Kc as $,Mb as Q,Nb as S,Oa as r,Ob as d,X as T,Zb as ee,_a as f,_b as m,ba as N,bc as g,ca as M,dc as G,ec as z,gc as h,hc as b,ic as B,la as c,pb as I,qb as D,rb as Z,sb as q,tb as J,ub as R,uc as X,vb as s,vc as te,wb as l,wc as ne,xb as C}from"./chunk-67YRCRMI.js";function ke(a,n){if(a&1){let i=k();s(0,"spk-radio",10),S("click",function(){let t=N(i).$implicit,o=d();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=d();m("active",e.pauseOption()===i.value),r(),G(" ",i.label," ")}}var he=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],x=class a{#e=T(A);pauseOptions=c(he);closed=$();isSubmitting=c(!1);pauseTransfers=c(!1);pauseOption=c(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(L(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),u(2,0),l()(),s(3,"div",6)(4,"div",7),q(5,ke,2,3,"spk-radio",8,Z),l(),s(7,"div",9)(8,"spk-checkbox",10),S("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),u(9,1),l(),s(10,"spk-alert",11),u(11,2),l()()(),s(12,"footer",12)(13,"button",13),S("click",function(){return e.closed.emit()}),u(14,3),l(),s(15,"button",14),S("click",function(){return e.submit()}),u(16,4),l()()),i&2&&(r(5),J(e.pauseOptions()),r(3),m("active",e.pauseTransfers()),r(7),m("loader",e.isSubmitting()))},dependencies:[v,Se,_e,se],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},be=["mbps","gbps"],Ie=8,V=1024,w=V*1024,W=w*1024,Y=W*1024,De=Y*1024,Be={B:1,KB:V,MB:w,GB:W,TB:Y,PB:De},ye=1e3,K=ye*1e3,H=K*1e3,Ue=[{threshold:De,unitPrefix:"PByte"},{threshold:Y,unitPrefix:"TByte"},{threshold:W,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:V,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],U=class a{#e=T(A);closed=$();isSubmitting=c(!1);sizeOptions=c([...be]);maxUpload=c(0);maxDownload=c(0);maxUploadUnit=c("mbps");maxDownloadUnit=c("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(Be[i.toUpperCase()]||w)*Ie;return t===0?{value:0,unit:"mbps"}:t>=H?{value:parseFloat((t/H).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/K).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*H;break;case"mbps":e=n*K;break}let t=e/Ie;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:_}of Ue)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:_};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],p=this.convertToBitsPerSecondUnits(o,_);this.maxUpload.set(p.value),this.maxUploadUnit.set(p.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),_=t[2],p=this.convertToBitsPerSecondUnits(o,_);this.maxDownload.set(p.value),this.maxDownloadUnit.set(p.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,_=this.maxDownloadUnit();if(e>0){let{valueForApi:p,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(e,t),F=Me[P];F?n=`${p}${F}`:console.error(`Invalid unit prefix for API submission (upload): ${P}. Defaulting to empty string.`)}if(o){let{valueForApi:p,unitPrefixForApi:P}=this.convertFromBitsPerSecondUnits(o,_),F=Me[P];F?i=`${p}${F}`:console.error(`Invalid unit prefix for API submission (download): ${P}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(L(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:p=>{console.error("Failed to submit throttle settings:",p)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let _;return _=$localize` Update settings `,[n,i,e,t,o,_,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["spk-button","",3,"click"],["spk-button","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),u(2,0),l(),s(3,"p"),u(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),u(9,2),l(),s(10,"spk-form-field")(11,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),B("ngModelChange",function(o){return b(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"spk-select",10)(13,"input",11),B("ngModelChange",function(o){return b(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),u(16,3),l(),s(17,"spk-form-field")(18,"input",9),S("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),B("ngModelChange",function(o){return b(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"spk-select",10)(20,"input",11),B("ngModelChange",function(o){return b(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),S("click",function(){return e.closed.emit(!1)}),u(23,4),l(),s(24,"button",14),S("click",function(){return e.submit()}),u(25,5),l()()),i&2&&(r(11),h("ngModel",e.maxUpload),r(),R("isClearable",!1)("options",e.sizeOptions()),r(),h("ngModel",e.maxUploadUnit),r(5),h("ngModel",e.maxDownload),r(),R("isClearable",!1)("options",e.sizeOptions()),r(),h("ngModel",e.maxDownloadUnit),r(4),m("loader",e.isSubmitting()))},dependencies:[v,Ee,Ae,Oe,fe,pe,Te],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] spk-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] spk-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Le(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"spk-progress-bar",11)),a&2){let i=d();r(),z("",i.statusData().actionText," - ",i.statusData().statusText),r(),R("value",i.statusData().progress*100)}}function Ge(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"spk-icon"),g(3,"clock"),l(),g(4),X(5,"relativeTime"),X(6,"date"),l()),a&2){let i,e=d();r(),G(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),r(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function $e(a,n){a&1&&(s(0,"div",7),u(1,1),l())}function ve(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"spk-spinner"),O(),l()),a&2&&(r(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function xe(a,n){if(a&1){let i=k();s(0,"button",10),S("click",function(){N(i);let t=d(2);return M(t.abort())}),E(1,3),C(2,"spk-icon"),O(),l()}}function we(a,n){if(a&1){let i=k();s(0,"button",10),S("click",function(){N(i);let t=d(2);return M(t.stop())}),E(1,4),C(2,"spk-icon"),O(),l()}}function ze(a,n){if(a&1&&I(0,xe,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=d();D(i.isStopping()?0:1)}}function Xe(a,n){a&1&&(E(0,0,1),C(1,"spk-icon"),O())}function He(a,n){a&1&&(E(0,0,2),C(1,"spk-icon"),O())}var Re=new Date,j=class a{#e=T(A);#t=T(Ce);#n=T(le);#a=T(ge);#s=T(oe);#l=T(de);#i=T(me);minsAgo=Re.setMinutes(Re.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=y(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=y(()=>this.runningTask()==this.#o());#o=c(-1);pgState=y(()=>this.#i.serverState());nextBackup=y(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(U,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(x,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=f({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["spk-button","",3,"click"],[1,"raised","primary",3,"value"],["spk-button",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),I(2,Le,3,3)(3,Ge,7,8,"div",7)(4,$e,2,0,"div",7)(5,ve,3,4,"div",8),l(),s(6,"div",9),I(7,ze,2,1),s(8,"button",10),S("click",function(){return e.pauseResume()}),E(9,0),I(10,Xe,2,0)(11,He,2,0),O(),l(),s(12,"button",10),S("click",function(){return e.openThrottleSettingsDialog()}),s(13,"spk-icon"),g(14,"speedometer"),l()()()()),i&2){let t;r(2),D((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),r(5),D(e.runningTask()?7:-1),r(),m("loader",e.isResuming()),r(2),D(e.clientIsRunning()?10:11)}},dependencies:[ue,Pe,ie,ae,re,ce],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
@@ -1 +1 @@
1
- import{a as R}from"./chunk-2YHX57UE.js";import{a as w,n as D}from"./chunk-DNBOZ26J.js";import"./chunk-XD6MBGQY.js";import{ea as b}from"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import{Ab as u,Bb as M,Fc as A,Jb as P,Nb as k,Oa as l,Ob as s,X as O,Yb as C,Zb as E,_a as h,_b as S,ba as x,bc as a,ca as T,cc as N,db as m,la as _,pb as d,qb as f,rc as p,sb as I,sc as F,tb as v,ub as g,vb as c,wb as r,yc as $}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var V=e=>({children:e,level:0}),Y=e=>({$implicit:e}),j=(e,t)=>({children:e,level:t}),z=(e,t)=>t.id;function B(e,t){if(e&1&&(c(0,"spk-icon"),a(1,"caret-down"),r()),e&2){let n=s().$implicit;S("open",n.isOpen())}}function G(e,t){e&1&&(c(0,"spk-icon"),a(1,"dot"),r())}function U(e,t){e&1&&u(0)}function X(e,t){if(e&1&&m(0,U,1,0,"ng-container",3),e&2){let n=s().$implicit,o=s().$implicit;s();let i=C(3);g("ngTemplateOutlet",i)("ngTemplateOutletContext",p(5,Y,F(2,j,n.children,o.level+1)))}}function q(e,t){if(e&1){let n=M();c(0,"div",4,1),k("click",function(){let i=x(n).$implicit,L=s(2);return T(i.children.length>0&&L.toggleNode(i))}),d(2,B,2,2,"spk-icon",5)(3,G,2,0,"spk-icon"),c(4,"div",6),a(5),r()(),d(6,X,1,7,"ng-container")}if(e&2){let n=t.$implicit;S("cannot-toggle",n.children.length===0)("open",n.isOpen()),l(2),f(n.children.length>0?2:3),l(3),N(n.text),l(),f(n.isOpen()?6:-1)}}function H(e,t){if(e&1&&(c(0,"spk-list"),I(1,q,7,7,null,null,z),r()),e&2){let n=t.$implicit;E("padding-left",n.level*.25,"rem"),l(),v(n.children)}}function J(e,t){e&1&&u(0)}var y=class e{#e=O(R);treeStructure=A(()=>{let t=this.#e.systemInfo();return this.processObject(t,0)});toggleNode(t){t.isOpen.update(n=>!n)}processObject(t,n){let o=[];for(let i in t)typeof t[i]=="object"?o.push({id:i,text:i,children:this.processObject(t[i],n+1),level:n,isOpen:_(!1)}):o.push({id:i,text:`${i}: ${t[i]}`,children:[],level:n,isOpen:_(!1)});return o}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=h({type:e,selectors:[["app-server-settings"]],decls:5,vars:6,consts:()=>{let t;return t=$localize`System info`,[["recursiveTree",""],["treeNode",""],t,[4,"ngTemplateOutlet","ngTemplateOutletContext"],["action","",3,"click"],[3,"open"],[1,"text"]]},template:function(n,o){if(n&1&&(c(0,"h3"),P(1,2),r(),m(2,H,3,2,"ng-template",null,0,$)(4,J,1,0,"ng-container",3)),n&2){let i=C(3);l(4),g("ngTemplateOutlet",i)("ngTemplateOutletContext",p(4,Y,p(2,V,o.treeStructure())))}},dependencies:[D,w,b],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}spk-icon[_ngcontent-%COMP%]{font-size:1rem}spk-list[_ngcontent-%COMP%]{padding:0}spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0}spk-list[_ngcontent-%COMP%] [action].cannot-toggle[_ngcontent-%COMP%]{cursor:initial}"],changeDetection:0})};export{y as default};
1
+ import{a as R}from"./chunk-BHSG643V.js";import{a as w,n as D}from"./chunk-DNBOZ26J.js";import"./chunk-XD6MBGQY.js";import{ea as b}from"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import{Ab as u,Bb as M,Fc as A,Jb as P,Nb as k,Oa as l,Ob as s,X as O,Yb as C,Zb as E,_a as h,_b as S,ba as x,bc as a,ca as T,cc as N,db as m,la as _,pb as d,qb as f,rc as p,sb as I,sc as F,tb as v,ub as g,vb as c,wb as r,yc as $}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";var V=e=>({children:e,level:0}),Y=e=>({$implicit:e}),j=(e,t)=>({children:e,level:t}),z=(e,t)=>t.id;function B(e,t){if(e&1&&(c(0,"spk-icon"),a(1,"caret-down"),r()),e&2){let n=s().$implicit;S("open",n.isOpen())}}function G(e,t){e&1&&(c(0,"spk-icon"),a(1,"dot"),r())}function U(e,t){e&1&&u(0)}function X(e,t){if(e&1&&m(0,U,1,0,"ng-container",3),e&2){let n=s().$implicit,o=s().$implicit;s();let i=C(3);g("ngTemplateOutlet",i)("ngTemplateOutletContext",p(5,Y,F(2,j,n.children,o.level+1)))}}function q(e,t){if(e&1){let n=M();c(0,"div",4,1),k("click",function(){let i=x(n).$implicit,L=s(2);return T(i.children.length>0&&L.toggleNode(i))}),d(2,B,2,2,"spk-icon",5)(3,G,2,0,"spk-icon"),c(4,"div",6),a(5),r()(),d(6,X,1,7,"ng-container")}if(e&2){let n=t.$implicit;S("cannot-toggle",n.children.length===0)("open",n.isOpen()),l(2),f(n.children.length>0?2:3),l(3),N(n.text),l(),f(n.isOpen()?6:-1)}}function H(e,t){if(e&1&&(c(0,"spk-list"),I(1,q,7,7,null,null,z),r()),e&2){let n=t.$implicit;E("padding-left",n.level*.25,"rem"),l(),v(n.children)}}function J(e,t){e&1&&u(0)}var y=class e{#e=O(R);treeStructure=A(()=>{let t=this.#e.systemInfo();return this.processObject(t,0)});toggleNode(t){t.isOpen.update(n=>!n)}processObject(t,n){let o=[];for(let i in t)typeof t[i]=="object"?o.push({id:i,text:i,children:this.processObject(t[i],n+1),level:n,isOpen:_(!1)}):o.push({id:i,text:`${i}: ${t[i]}`,children:[],level:n,isOpen:_(!1)});return o}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=h({type:e,selectors:[["app-server-settings"]],decls:5,vars:6,consts:()=>{let t;return t=$localize`System info`,[["recursiveTree",""],["treeNode",""],t,[4,"ngTemplateOutlet","ngTemplateOutletContext"],["action","",3,"click"],[3,"open"],[1,"text"]]},template:function(n,o){if(n&1&&(c(0,"h3"),P(1,2),r(),m(2,H,3,2,"ng-template",null,0,$)(4,J,1,0,"ng-container",3)),n&2){let i=C(3);l(4),g("ngTemplateOutlet",i)("ngTemplateOutletContext",p(4,Y,p(2,V,o.treeStructure())))}},dependencies:[D,w,b],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}spk-icon[_ngcontent-%COMP%]{font-size:1rem}spk-list[_ngcontent-%COMP%]{padding:0}spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0}spk-list[_ngcontent-%COMP%] [action].cannot-toggle[_ngcontent-%COMP%]{cursor:initial}"],changeDetection:0})};export{y as default};
@@ -0,0 +1 @@
1
+ import{a as ut}from"./chunk-HWUEL5ZO.js";import{a as Re}from"./chunk-ZIJ7ZEHR.js";import{a as rt,b as Ve,c as _t}from"./chunk-5RPDEEQ3.js";import{a as ae}from"./chunk-67XQIEG5.js";import{a as ot}from"./chunk-FC45TEB6.js";import{a as Ee}from"./chunk-BHSG643V.js";import{b as Te,c as Q,d as fe,e as Z,f as Ae,h as lt,i as oe,j as he,k as Pe,n as at,o as Ne,p as st,q as De,r as Me,s as le,t as ye}from"./chunk-ZCT7SRIM.js";import{b as ne,d as H}from"./chunk-DQM3ATT4.js";import{A as Se,C as nt,a as j,b as Je,e as et,g as ie,l as q,p as tt,t as Y}from"./chunk-DNBOZ26J.js";import{h as it}from"./chunk-XD6MBGQY.js";import{Bb as x,F as we,Fc as w,Gc as me,Hb as g,Ib as C,Jb as T,Kc as Be,Lc as ve,Mb as Ue,Mc as Fe,Nb as F,Oa as r,Ob as u,S as pe,Wb as de,X as D,Xb as ge,Yb as Ge,_a as z,_b as Ce,ba as c,bc as L,ca as p,cc as xe,db as Ye,dc as Ze,gc as R,hc as O,ic as $,la as m,ob as Qe,pb as M,qb as y,qc as be,rb as ke,sb as Ie,tb as Le,ub as E,vb as a,wb as s,xb as d,yb as B,zb as v}from"./chunk-67YRCRMI.js";import{a as G,b as W}from"./chunk-EUDKD2JW.js";var Oe=class l{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||l)};static \u0275prov=pe({token:l,factory:l.\u0275fac,providedIn:"root"})};function Ct(l,t){if(l&1){let e=x();a(0,"div",24)(1,"spk-form-field")(2,"label",25),T(3,7),s(),a(4,"input",26,0),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),p(i)}),F("focus",function(){c(e);let i=Ge(5);return p(i.showPicker())}),s(),a(6,"spk-icon",27),L(7,"clock"),s()(),a(8,"spk-form-field"),d(9,"label",28),a(10,"input",29,1),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),p(i)}),F("focus",function(){c(e);let i=Ge(11);return p(i.showPicker())}),s(),a(12,"spk-icon",27),L(13,"calendar"),s()()(),a(14,"div",24)(15,"spk-form-field")(16,"label",30),T(17,8),s(),a(18,"input",31),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),p(i)}),s()(),a(19,"spk-select",32)(20,"input",33),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),p(i)}),s()()(),a(21,"app-toggle-card",34),B(22,35),T(23,9),v(),a(24,"div",36)(25,"spk-toggle",19),g(26,10),a(27,"input",20),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),p(i)}),s(),C(),s(),a(28,"spk-toggle",19),g(29,11),a(30,"input",20),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),p(i)}),s(),C(),s(),a(31,"spk-toggle",19),g(32,12),a(33,"input",20),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),p(i)}),s(),C(),s(),a(34,"spk-toggle",19),g(35,13),a(36,"input",20),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),p(i)}),s(),C(),s(),a(37,"spk-toggle",19),g(38,14),a(39,"input",20),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),p(i)}),s(),C(),s(),a(40,"spk-toggle",19),g(41,15),a(42,"input",20),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),p(i)}),s(),C(),s(),a(43,"spk-toggle",19),g(44,16),a(45,"input",20),$("ngModelChange",function(i){c(e);let o=u();return O(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),p(i)}),s(),C(),s()()()}if(l&2){let e=u();r(4),R("ngModel",e.scheduleFields.nextTime().time),r(6),R("ngModel",e.scheduleFields.nextTime().date),r(8),R("ngModel",e.scheduleFields.runAgain().repeatValue),r(),E("options",e.unitOptions)("isClearable",!1),r(),R("ngModel",e.scheduleFields.runAgain().repeatUnit),r(),E("disallowToggle",!0),r(6),R("ngModel",e.scheduleFields.runAgain().allowedDays.mon),r(3),R("ngModel",e.scheduleFields.runAgain().allowedDays.tue),r(3),R("ngModel",e.scheduleFields.runAgain().allowedDays.wed),r(3),R("ngModel",e.scheduleFields.runAgain().allowedDays.thu),r(3),R("ngModel",e.scheduleFields.runAgain().allowedDays.fri),r(3),R("ngModel",e.scheduleFields.runAgain().allowedDays.sat),r(3),R("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var mt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],te={autoRun:!0,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}}},Ke=class l{#e=D(J);#t=D(H);#i=D(ne);unitOptions=mt;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=z({type:l,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let _;_=$localize`Next time`;let S;S=$localize`Run again every`;let A;A=$localize`Allowed days`;let k;k=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let h;h=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let I;I=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let b;b=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let X;return X=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,_,S,A,k,U,h,I,K,b,X,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(a(0,"h3",17),T(1,2),s(),a(2,"div",18)(3,"spk-toggle",19),g(4,3),a(5,"input",20),$("ngModelChange",function(o){return O(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),s(),C(),s(),a(6,"p"),T(7,4),s()(),M(8,Ct,46,14),a(9,"div",21)(10,"button",22),F("click",function(){return n.goBack()}),g(11,5),d(12,"spk-icon"),C(),s(),a(13,"button",23),F("click",function(){return n.next()}),g(14,6),d(15,"spk-icon"),C(),s()()),e&2&&(r(5),R("ngModel",n.scheduleFields.autoRun),r(3),y(n.scheduleFields.autoRun()?8:-1))},dependencies:[le,Q,Pe,Te,Z,oe,q,Se,j,ie,Y,Re],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;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})};function Ft(l,t){if(l&1&&(B(0,4),L(1),v()),l&2){let e,n=u();r(),xe((e=n.currentExpressionOption())==null?null:e.startsWith)}}function St(l,t){if(l&1&&(B(0,5),L(1),v()),l&2){let e,n=u();r(),xe((e=n.currentExpressionOption())==null?null:e.endsWith)}}var Et=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],$e=class l{path=ve.required();osType=ve();pathChange=Be();remove=Be();internalPath=m("");pathType=m("-Expression");currentExpressionOption=w(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});expressionOptions=w(()=>{let e=this.osType()==="Windows"?"\\":"/";return Et.map(n=>n.value==="-Folder"||n.value==="+Folder"?W(G({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?W(G({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?W(G({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?W(G({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?W(G({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?W(G({},n),{startsWith:"*.",endsWith:""}):W(G({},n),{startsWith:"",endsWith:""}))});pathEffect=me(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=z({type:l,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:9,vars:6,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"expression-input"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""],[1,"filter-removal",3,"click"],[1,"spk-primary"]]},template:function(e,n){if(e&1&&(a(0,"spk-select",0)(1,"input",1),$("ngModelChange",function(o){return O(n.pathType,o)||(n.pathType=o),o}),F("ngModelChange",function(){return n.updateFilter()}),s()(),a(2,"spk-form-field",2)(3,"input",3),$("ngModelChange",function(o){return O(n.internalPath,o)||(n.internalPath=o),o}),F("ngModelChange",function(){return n.updateFilter()}),s(),M(4,Ft,2,1,"ng-container",4),M(5,St,2,1,"ng-container",5),s(),a(6,"div",6),F("click",function(){return n.removeFilter()}),a(7,"spk-icon",7),L(8,"x-circle"),s()()),e&2){let i,o;E("options",n.expressionOptions())("isClearable",!1),r(),R("ngModel",n.pathType),r(2),R("ngModel",n.internalPath),r(),y(!((i=n.currentExpressionOption())==null||i.startsWith==null)&&i.startsWith.length?4:-1),r(),y(!((o=n.currentExpressionOption())==null||o.endsWith==null)&&o.endsWith.length?5:-1)}},dependencies:[le,Q,Z,oe,Y,q,j],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Tt=["formRef"],ct=()=>({standalone:!0});function ft(l,t){if(l&1){let e=x();a(0,"spk-form-field",42)(1,"input",43),$("ngModelChange",function(i){c(e);let o=u(2);return O(o.editingPath,i)||(o.editingPath=i),p(i)}),s()(),a(2,"button",44),F("click",function(){c(e);let i=u(2);return p(i.updatePath())}),a(3,"spk-icon"),L(4,"floppy-disk"),s()(),a(5,"button",44),F("click",function(){c(e);let i=u(2);return p(i.cancelEditPath())}),a(6,"spk-icon"),L(7,"x-bold"),s()()}if(l&2){let e=u(2);r(),R("ngModel",e.editingPath),E("ngModelOptions",be(2,ct))}}function At(l,t){if(l&1){let e=x();a(0,"spk-form-field",42),d(1,"input",45),s(),a(2,"button",44),F("click",function(){c(e);let i=u().$implicit,o=u();return p(o.editPath(i))}),a(3,"spk-icon"),L(4,"pen"),s()(),a(5,"button",44),F("click",function(){c(e);let i=u().$implicit,o=u();return p(o.removePath(i))}),a(6,"spk-icon"),L(7,"trash-simple"),s()()}if(l&2){let e=u().$implicit;Qe("readonly",!0),r(),E("ngModel",e)("ngModelOptions",be(3,ct))}}function ht(l,t){if(l&1&&(a(0,"div",30),M(1,ft,8,3)(2,At,8,4),s()),l&2){let e=t.$implicit,n=u();r(),y(n.oldPath()===e?1:2)}}function Pt(l,t){if(l&1){let e=x();a(0,"app-new-filter",47),F("pathChange",function(i){let o=c(e).$index,_=u(2);return p(_.patchPathAt(i,o))})("remove",function(){let i=c(e).$index,o=u(2);return p(o.removePathAt(i))}),s()}if(l&2){let e=t.$implicit,n=u(2);E("path",e)("osType",n.osType()??"")}}function Nt(l,t){if(l&1&&Ie(0,Pt,1,2,"app-new-filter",46,ke),l&2){let e=u();Le(e.pathArray())}}function Dt(l,t){if(l&1&&(a(0,"div",41)(1,"spk-form-field"),d(2,"input",48),s(),a(3,"spk-select",49),d(4,"input",50),s()()),l&2){let e=u();r(3),E("options",e.sizeOptions())("isClearable",!1)}}var V=new Me,Mt=["Bytes","KB","MB","GB","TB","PB"],pt=(l={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(l.path),excludes:V.group({hidden:V.control(l.excludes.hidden),system:V.control(l.excludes.system),temporary:V.control(l.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),ze=class l{#e=D(J);#t=D(H);#i=D(ne);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new lt("");filesLargerThan=w(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=m(Mt);osType=this.#e.osType;pathSignal=ae(this.sourceDataForm.controls.path.valueChanges);pathArray=w(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=w(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=m(null);editingPath=m(null);addingNewPath=m(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let e=this.sourceDataForm.controls.path.value??"",n=e.indexOf(t);if(n===-1)return;let i=n===0?t:"\0"+t,o=e.replace(i,"");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${t}`)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(_=>!_.startsWith("-")&&!_.startsWith("+")).join("\0"),o=this.pathArray().map((_,S)=>S===e?`${t}`:`${_}`).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${o}`)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(o=>!o.startsWith("-")&&!o.startsWith("+")).join("\0"),i=this.pathArray().filter((o,_)=>_!==t).join("\0");this.sourceDataForm.controls.path.setValue(`${n}\0${i}`)}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})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value;this.sourceDataForm.controls.path.setValue(`${t}\0${e}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=z({type:l,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&de(n.formRef,Tt,5),e&2&&ge()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let _;_=$localize`Source Data`;let S;S=$localize`Folder path`;let A;A=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let k;k=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let U;U=$localize`Paths`;let h;h=$localize`Add a path directly from your machine.`;let I;I=$localize`Filters`;let K;K=$localize`Customize your filters.`;let b;b=$localize`Add filter`;let X;X=$localize`Exclude`;let N;N=$localize`Choose if there’s any files you want to exclude.`;let ee;ee=$localize` Hidden files ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let re;re=$localize` System files ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Temporary files ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files larger than `;let f;f=$localize`Edit path`;let qe;return qe=$localize`Select an option...`,[["formRef",""],_,S,A,k,U,h,I,K,b,X,N,ee,re,_e,ue,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"small"],["type","text","placeholder",f,3,"ngModelChange","ngModel","ngModelOptions"],["spk-button","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",qe]]},template:function(e,n){if(e&1){let i=x();a(0,"form",16,0),F("submit",function(){return c(i),p(n.next())}),a(2,"div",17)(3,"h3",18),T(4,1),s(),a(5,"app-file-tree",19)(6,"label",20),T(7,2),s(),d(8,"input",21),s(),a(9,"div",22)(10,"button",23),F("click",function(){return c(i),p(n.goBack())}),g(11,3),d(12,"spk-icon"),C(),s(),a(13,"button",24),g(14,4),d(15,"spk-icon"),C(),s()()(),a(16,"div",25)(17,"app-toggle-card",26),B(18,27),T(19,5),v(),a(20,"p",28),T(21,6),s(),a(22,"div",29),Ie(23,ht,3,1,"div",30,ke),a(25,"div",31)(26,"spk-form-field"),d(27,"input",32),s(),a(28,"button",33),F("click",function(){return c(i),p(n.addNewPath())}),a(29,"spk-icon"),L(30,"plus"),s()()()()(),a(31,"app-toggle-card",26),B(32,27),T(33,7),v(),a(34,"p",28),T(35,8),s(),a(36,"button",34),F("click",function(){return c(i),p(n.addFilter())}),T(37,9),s(),M(38,Nt,2,0),s(),a(39,"app-toggle-card",35),B(40,27),T(41,10),v(),a(42,"p",28),T(43,11),s(),a(44,"spk-toggle",36),g(45,12),d(46,"input",37),C(),s(),a(47,"spk-toggle",36),g(48,13),d(49,"input",38),C(),s(),a(50,"spk-toggle",36),g(51,14),d(52,"input",39),C(),s(),a(53,"spk-toggle",40),F("click",function(){return c(i),p(n.toggleFilesLargerThan())}),T(54,15),s(),M(55,Dt,5,2,"div",41),s()()()}if(e&2){let i;E("formGroup",n.sourceDataForm),r(5),E("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),r(12),E("disallowToggle",!0),r(6),Le(n.nonFilterPaths()),r(4),E("formControl",n.newPathCtrl),r(4),E("disallowToggle",!0),r(7),y((i=n.pathSignal())!=null&&i.length?38:-1),r(),E("disallowToggle",!0),r(14),Ce("active",n.filesLargerThan()),r(2),y(n.filesLargerThan()?55:-1)}},dependencies:[le,he,Q,Pe,Te,Z,Ae,oe,ye,at,Ne,De,st,q,j,ie,Se,Y,$e,ut,Re],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}spk-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var dt="1W:1D,4W:1W,12M:1M",J=class l{#e=D(H);#t=D(Ee);#i=D(et);#n=D(it);#o=D(Oe);generalForm=gt();sourceDataForm=pt();scheduleFields={autoRun:m(te.autoRun),nextTime:m(te.nextTime),runAgain:m(te.runAgain)};settings=m([]);optionsFields={remoteVolumeSize:m("50MB"),backupRetention:m("all"),backupRetentionTime:m(""),backupRetentionVersions:m(0),backupRetentionCustom:m("")};targetUrlModel=m(null);isDraft=m(!1);backupId=m(null);backupName=w(()=>this.generalFormSignal()?.name??"");isSubmitting=m(!1);finishedLoading=m(!1);backupDefaults=m(null);applicationOptions=m(null);isNew=w(()=>this.backupId()==="new");osType=w(()=>this.#t.systemInfo()?.OSType);selectedOptions=m([]);sourceDataFormSignal=ae(this.sourceDataForm.valueChanges);generalFormSignal=ae(this.generalForm.valueChanges);encryptionFieldSignal=ae(this.generalForm.controls.encryption.valueChanges);advancedOptions=w(()=>this.#t.systemInfo()?.Options?.map(this.#l)??[]);#l(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=w(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[He,...t]});nonSelectedOptions=w(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#s(),n=this.backupId();n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{t||this.exit(!1)},error:i=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{t||this.exit(!1)},error:i=>{}})}exit(t){if(!t){this.#a(),this.#e.navigate(["/"]);return}this.#i.open(ot,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#a(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(S=>`${S.Include?"":"-"}${S.Expression}`)??[],i=t.Settings?.find(S=>S.Name==="--exclude-files-attributes")?.Value??"",o=t.Settings?.find(S=>S.Name==="--skip-files-larger-than")??null,_={path:[...e,...n].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:o?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(_)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Settings?.find(_=>_.Name==="encryption-module"),n=t.Settings?.find(_=>_.Name==="passphrase")?.Value??"",i=e?.Value&&e.Value.length?e.Value:"",o={name:t.Name??"",description:t.Description??""};i&&i!==""&&(o.encryption=i),n&&n!==""&&(o.password=n,o.repeatPassword=n),this.generalForm.patchValue(o)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#o.fromString(t.Repeat)??null,n=this.#r(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>G(G({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],n=t.Settings?.filter(_=>!e.includes(_.Name)),i=t.Settings?.filter(_=>e.includes(_.Name));this.settings.set(n??[]),n?.forEach(_=>{if(_.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(_.Value??"")});var o="all";i?.forEach(_=>{if(_.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(_.Value??"50MB"),_.Name==="keep-time"&&(_.Value??"")!=="")return o="time",this.optionsFields.backupRetentionTime.set(_.Value??"");if(_.Name==="keep-versions"&&(_.Value??"")!=="")return o="versions",this.optionsFields.backupRetentionVersions.set(_.Value?parseInt(_.Value):null);if(_.Name==="retention-policy"&&(_.Value??"")!=="")if(_.Value===dt)o="smart";else return o="custom",this.optionsFields.backupRetentionCustom.set(_.Value??"")}),this.optionsFields.backupRetention.set(o)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#s(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#o.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let _=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([h,I])=>I).map(([h,I])=>h):[],S=n.path?.split("\0")??[],A=this.mapFormsToSettings(),k=Object.entries(n.excludes??{}).filter(([h,I])=>I&&h!=="filesLargerThan").map(([h])=>h),U=n.excludes?.filesLargerThan;return k.length&&A.push({Name:"--exclude-files-attributes",Value:k.join(",")}),U&&U.size!==null&&U.unit!==null&&A.push({Name:"--skip-files-larger-than",Value:`${U.size}${U.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:S.filter(h=>!h.startsWith("-")),Settings:A,Filters:S.filter(h=>h.startsWith("-")).map((h,I)=>({Order:I,Include:!1,Expression:h.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:_}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":o.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":o.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":o.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":o.push({Name:"retention-policy",Value:dt});break}let _=[...t,...n],S=this.settings().filter(A=>!_.includes(A.Name)).map(A=>{let k=A.Value;return typeof A.Value=="number"&&(k=A.Value.toString()),typeof A.Value=="boolean"&&(k=A.Value?"True":"False"),{Name:A.Name,Value:k}});return[...i,...o,...S]}#r(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t){this.targetUrlModel.set(t)}#a(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(te.autoRun),this.scheduleFields.nextTime.set(te.nextTime),this.scheduleFields.runAgain.set(te.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||l)};static \u0275prov=pe({token:l,factory:l.\u0275fac,providedIn:"root"})};var yt=["formRef"];function Rt(l,t){l&1&&(a(0,"spk-alert",17),g(1,5),d(2,"spk-icon",26),C(),s())}function Ot(l,t){if(l&1&&L(0),l&2){let e=t.$implicit;Ze(" ",e.DisplayName," ")}}function $t(l,t){if(l&1&&d(0,"spk-progress-bar",40),l&2){let e=u(3);Ce("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),E("value",e.calculatePasswordStrength()*(100/5))}}function wt(l,t){l&1&&(a(0,"span",35),T(1,10),s())}function kt(l,t){l&1&&(g(0,8,1),d(1,"spk-icon"),C())}function It(l,t){l&1&&(g(0,8,2),d(1,"spk-icon"),C())}function Lt(l,t){l&1&&(g(0,11,1),d(1,"spk-icon",42),C())}function Ut(l,t){l&1&&(g(0,11,2),d(1,"spk-icon"),C())}function Gt(l,t){if(l&1){let e=x();a(0,"button",41),F("click",function(){c(e);let i=u(3);return p(i.copyPassword())}),g(1,11),M(2,Lt,2,0)(3,Ut,2,0),C(),s()}if(l&2){let e=u(3);r(2),y(e.copiedPassword()?2:3)}}function xt(l,t){l&1&&(a(0,"spk-alert",39),T(1,12),s())}function bt(l,t){if(l&1){let e=x();a(0,"div",30)(1,"spk-form-field")(2,"label",31),g(3,7),d(4,"sup"),C(),s(),d(5,"input",32),s(),M(6,$t,1,9,"spk-progress-bar",33),a(7,"spk-form-field"),d(8,"input",34),M(9,wt,2,0,"span",35),s(),a(10,"div",36)(11,"button",37),F("click",function(){c(e);let i=u(2);return p(i.showPassword.set(!i.showPassword()))}),g(12,8),M(13,kt,2,0)(14,It,2,0),C(),s(),a(15,"button",37),F("click",function(){c(e);let i=u(2);return p(i.generatePassword())}),g(16,9),d(17,"spk-icon"),C(),s(),M(18,Gt,4,1,"button",38),s(),M(19,xt,2,0,"spk-alert",39),s()}if(l&2){let e=u(2);r(5),E("type",e.showPassword()?"text":"password"),r(),y(e.generalForm.value.password?6:-1),r(2),E("type",e.showPassword()?"text":"password"),r(),y(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),r(4),y(e.showPassword()?13:14),r(5),y(e.showCopyPassword()?18:-1),r(),y(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Bt(l,t){if(l&1&&(a(0,"spk-select",27)(1,"label",28),T(2,6),s(),d(3,"input",29),Ye(4,Ot,1,1,"ng-template"),s(),M(5,bt,20,7,"div",30)),l&2){let e=u();E("options",e.encryptionOptions())("isClearable",!1),r(5),y(e.encryptionFieldSignal()!==""?5:-1)}}function vt(l,t){if(l&1&&(a(0,"button",24),g(1,13),d(2,"spk-icon"),C(),s()),l&2){let e=u();E("disabled",e.nameAndDescriptionValid()===!1)}}function Vt(l,t){if(l&1&&(a(0,"button",25),g(1,14),d(2,"spk-icon"),C(),s()),l&2){let e=u();E("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var se=new Me,gt=(l={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>se.group({name:se.control(l.name,[fe.required]),description:se.control(l.description),encryption:se.control(l.encryption,[_t()]),password:se.control(l.password,[Ve(t=>t?.value.encryption!=="",[fe.required])]),repeatPassword:se.control(l.repeatPassword,[Ve(t=>t?.value.encryption!=="",[fe.required])])}),He={Key:"",DisplayName:"None"},je=class l{#e=D(H);#t=D(ne);#i=D(rt);#n=D(J);#o=D(Ee);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=m(!1);copiedPassword=m(!1);showCopyPassword=m(!1);encryptionEffect=me(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=w(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=w(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#l(t??""),this.copiedPassword.set(!0)}async#l(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}displayFn(){let t=this.#o.systemInfo()?.EncryptionModules??[];return e=>{let n=[He,...t].find(i=>i.Key===e);return n?`${n.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=z({type:l,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&de(n.formRef,yt,5),e&2&&ge()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let _;_=$localize`Backup description`;let S;S=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let A;A=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Encrypted backup `;let k;k=$localize`Encryption`;let U;U=$localize`Encryption`;let h;h=$localize`Password`;let I;I=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let b;b=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,b=Ue(b);let X;X=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let N;N=$localize`Passwords do not match`;let ee;ee=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,ee=Ue(ee);let re;re=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let _e;_e=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let ue;return ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],i,o,_,S,A,U,K,b,X,N,ee,re,_e,ue,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["spk-button","","type","submit","spkTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",k,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",I,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,n){if(e&1){let i=x();a(0,"form",15,0),F("submit",function(){return c(i),p(n.next())}),a(2,"h3",16),T(3,1),s(),M(4,Rt,3,0,"spk-alert",17),a(5,"spk-form-field")(6,"label",18),g(7,2),d(8,"sup"),C(),s(),d(9,"input",19),s(),a(10,"spk-form-field")(11,"label",20),T(12,3),s(),d(13,"textarea",21),s(),M(14,Bt,6,3),a(15,"div",22)(16,"button",23),F("click",function(){return c(i),p(n.exit())}),g(17,4),d(18,"spk-icon"),C(),s(),M(19,vt,3,1,"button",24)(20,Vt,3,1,"button",25),s()()}if(e&2){let i;E("formGroup",n.generalForm),r(4),y(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),r(10),y(n.isNew()?14:-1),r(5),y(n.encryptionFieldSignal()===""||!n.isNew()?19:20)}},dependencies:[ye,he,Q,Z,Ae,Ne,De,q,Y,ie,j,tt,Je,nt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.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-8)}"],changeDetection:0})};export{gt as a,He as b,je as c,te as d,Ke as e,pt as f,ze as g,J as h};
@@ -1 +1 @@
1
- import{a as m}from"./chunk-A7BFGBWF.js";import{h as u}from"./chunk-XD6MBGQY.js";import{B as h,E as s,F as p,Gc as N,P as d,S as l,X as r,la as o,n as c,x as f}from"./chunk-67YRCRMI.js";var b=class a{#e=r(u);#s=r(m);serverState=this.#s.serverState;serverStateEffect=N(()=>{let t=this.#s.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#o=-1;#a=o(!1);#t=o([]);#i=o([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#o!==t&&(this.#o=t,this.getNotifications())}getNotifications(){this.#a.set(!0),this.#e.getApiV1Notifications().pipe(s(1),d(t=>this.#t.set(t)),p(()=>this.#a.set(!1))).subscribe()}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(s(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(s(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(h(()=>c(e))));f(i).pipe(s(1)).subscribe({next:e=>{let v=e.filter(n=>n!=null&&"ID"in n);this.#t.set(v),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||a)};static \u0275prov=l({token:a,factory:a.\u0275fac,providedIn:"root"})};export{b as a};
1
+ import{a as m}from"./chunk-NZD6UMYZ.js";import{h as u}from"./chunk-XD6MBGQY.js";import{B as h,E as s,F as p,Gc as N,P as d,S as l,X as r,la as o,n as c,x as f}from"./chunk-67YRCRMI.js";var b=class a{#e=r(u);#s=r(m);serverState=this.#s.serverState;serverStateEffect=N(()=>{let t=this.#s.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#o=-1;#a=o(!1);#t=o([]);#i=o([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#o!==t&&(this.#o=t,this.getNotifications())}getNotifications(){this.#a.set(!0),this.#e.getApiV1Notifications().pipe(s(1),d(t=>this.#t.set(t)),p(()=>this.#a.set(!1))).subscribe()}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(s(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(s(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(h(()=>c(e))));f(i).pipe(s(1)).subscribe({next:e=>{let v=e.filter(n=>n!=null&&"ID"in n);this.#t.set(v),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||a)};static \u0275prov=l({token:a,factory:a.\u0275fac,providedIn:"root"})};export{b as a};
@@ -1 +1 @@
1
- import{a}from"./chunk-WZIEF5KL.js";import"./chunk-DLVU5GHR.js";import"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";export{a as DurationFormatPipe};
1
+ import{a}from"./chunk-PSPK4OPB.js";import"./chunk-JDCGGJ7O.js";import"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";export{a as DurationFormatPipe};
@@ -1 +1 @@
1
- import{a as ae}from"./chunk-LSNBRSNG.js";import{a as te}from"./chunk-67XQIEG5.js";import"./chunk-A7BFGBWF.js";import{a as Q}from"./chunk-F66HJES7.js";import"./chunk-XBP565VF.js";import"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-2YHX57UE.js";import"./chunk-3Q5JEF3K.js";import{c as Y,e as Z,i as x,s as ee}from"./chunk-ZCT7SRIM.js";import"./chunk-OQHMS5HM.js";import{b as z,e as q}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{a as H,g as W,l as j}from"./chunk-DNBOZ26J.js";import{h as J}from"./chunk-XD6MBGQY.js";import"./chunk-HPZ6HLJE.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-DLVU5GHR.js";import{E as g,F as d,Fc as k,Gc as h,Hb as r,Ib as p,Jb as F,Kb as K,Lb as L,N as E,Nb as u,Oa as s,X as D,_a as y,_b as P,ac as U,bc as C,gc as w,hc as X,ic as V,la as c,pb as v,qb as G,r as O,ub as A,vb as i,wb as a,xb as l}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";function ie(S,t){S&1&&(i(0,"spk-icon",18),C(1,"check"),a())}function ne(S,t){S&1&&(i(0,"spk-icon",18),C(1,"warning"),a())}var m=class S{#a=D(z);#i=D(Q);#e=D(J);#t="";backupId=te(this.#a.params.pipe(O(t=>t.id)));activeBackup=k(()=>{let t=this.#i.backups().find(_=>_.Backup?.ID===this.backupId());return this.#t=t?.Backup?.DBPath??"",t});backupFilePath=c("");lastValidatedPath=c("");isValidatedPath=k(()=>this.lastValidatedPath()===this.backupFilePath());pathHasChanged=k(()=>this.backupFilePath()!==this.#t);backupFilePathEffect=h(()=>{let t=this.backupFilePath();t!==""&&this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).subscribe({next:()=>this.lastValidatedPath.set(t)})});isRestoring=c(!1);isRepairing=c(!1);isDeleting=c(!1);isSavingDbPath=c(!1);isSavingAndRepairing=c(!1);isMovingDb=c(!1);activeBackupEffect=h(()=>{let t=this.activeBackup();if(!t)return;let _=t.Backup?.DBPath??"";this.backupFilePath.set(_)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),d(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),d(()=>this.isDeleting.set(!1))).subscribe(()=>this.lastValidatedPath.set(""))}restoreDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),E(()=>this.#e.postApiV1BackupByIdRepair({id:this.backupId()})),d(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t)}saveDatabasePath(){this.isSavingDbPath.set(!0),this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(d(()=>this.isSavingDbPath.set(!1))).subscribe()}saveAndRepairDatabasePath(){this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(E(()=>this.#e.postApiV1BackupByIdRepair({id:this.backupId()})),d(()=>this.isSavingAndRepairing.set(!1)))}moveDatabasePath(){this.isMovingDb.set(!0),this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(d(()=>this.isMovingDb.set(!1))).subscribe()}static \u0275fac=function(_){return new(_||S)};static \u0275cmp=y({type:S,selectors:[["app-database"]],decls:46,vars:18,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let _;_=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let n;n=$localize`Maintenance`;let T;T=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. `;let b;b=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Repair `;let f;f=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let B;B=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore (delete and repair) `;let I;I=$localize`Placement`;let M;M=$localize`${"\uFFFD#36\uFFFD"}:START_TAG_SPK_ICON:backspace${"\uFFFD/#36\uFFFD"}:CLOSE_TAG_SPK_ICON: Reset `;let N;N=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:floppy-disk${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON: Save `;let $;$=$localize`${"\uFFFD#42\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#42\uFFFD"}:CLOSE_TAG_SPK_ICON: Save & Repair `;let R;return R=$localize`${"\uFFFD#45\uFFFD"}:START_TAG_SPK_ICON:flow-arrow${"\uFFFD/#45\uFFFD"}:CLOSE_TAG_SPK_ICON: Move existing database `,[t,_,e,n,T,b,f,B,I,M,N,$,R,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],[1,"actions","maintenance"],["spk-button","",3,"click","disabled"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[1,"actions","placement"]]},template:function(_,e){if(_&1&&(l(0,"app-status-bar"),i(1,"section")(2,"div",13)(3,"button",14),r(4,0),l(5,"spk-icon"),p(),a()(),i(6,"article")(7,"h1"),F(8,1),a(),i(9,"p"),F(10,2),a()(),i(11,"article")(12,"h2"),F(13,3),a(),i(14,"p"),F(15,4),a(),i(16,"div",15)(17,"button",16),u("click",function(){return e.repairDatabase()}),r(18,5),l(19,"spk-icon"),p(),a(),i(20,"button",16),u("click",function(){return e.deleteDatabase()}),r(21,6),l(22,"spk-icon"),p(),a(),i(23,"button",16),u("click",function(){return e.restoreDatabase()}),r(24,7),l(25,"spk-icon"),p(),a()()(),i(26,"article")(27,"h2"),F(28,8),a(),i(29,"spk-form-field")(30,"input",17),V("ngModelChange",function(T){return X(e.backupFilePath,T)||(e.backupFilePath=T),T}),a(),v(31,ie,2,0,"spk-icon",18)(32,ne,2,0,"spk-icon",18),a(),i(33,"div",19)(34,"button",16),u("click",function(){return e.resetDatabasePath()}),r(35,9),l(36,"spk-icon"),p(),a(),i(37,"button",16),u("click",function(){return e.saveDatabasePath()}),r(38,10),l(39,"spk-icon"),p(),a(),i(40,"button",16),u("click",function(){return e.saveAndRepairDatabasePath()}),r(41,11),l(42,"spk-icon"),p(),a(),i(43,"button",16),u("click",function(){return e.moveDatabasePath()}),r(44,12),l(45,"spk-icon"),p(),a()()()()),_&2){let n;s(8),K((n=e.activeBackup())==null||n.Backup==null?null:n.Backup.Name),L(8),s(9),P("loader",e.isRepairing()),A("disabled",!e.isValidatedPath()),s(3),P("loader",e.isDeleting()),A("disabled",!e.isValidatedPath()),s(3),P("loader",e.isRestoring()),A("disabled",e.pathHasChanged()),s(6),U(e.isValidatedPath()?"success":"error"),s(),w("ngModel",e.backupFilePath),s(),G(e.isValidatedPath()?31:32),s(3),A("disabled",!e.pathHasChanged()),s(3),A("disabled",!e.pathHasChanged()),s(3),A("disabled",!e.pathHasChanged()),s(3),A("disabled",!e.pathHasChanged())}},dependencies:[ee,Y,Z,x,ae,W,j,H,q],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{m as default};
1
+ import{a as ae}from"./chunk-CFESUDFC.js";import{a as te}from"./chunk-67XQIEG5.js";import"./chunk-NZD6UMYZ.js";import{a as Q}from"./chunk-B6DE3TTE.js";import"./chunk-VFVXE2DC.js";import"./chunk-FC45TEB6.js";import"./chunk-RHW5QVAY.js";import"./chunk-BHSG643V.js";import"./chunk-3Q5JEF3K.js";import{c as Y,e as Z,i as x,s as ee}from"./chunk-ZCT7SRIM.js";import"./chunk-OQHMS5HM.js";import{b as z,e as q}from"./chunk-DQM3ATT4.js";import"./chunk-BSRYIN2F.js";import{a as H,g as W,l as j}from"./chunk-DNBOZ26J.js";import{h as J}from"./chunk-XD6MBGQY.js";import"./chunk-4VPA3END.js";import"./chunk-GP2W7XZF.js";import"./chunk-WIDMAJIO.js";import"./chunk-JDCGGJ7O.js";import{E as g,F as d,Fc as k,Gc as h,Hb as r,Ib as p,Jb as F,Kb as K,Lb as L,N as E,Nb as u,Oa as s,X as D,_a as y,_b as P,ac as U,bc as C,gc as w,hc as X,ic as V,la as c,pb as v,qb as G,r as O,ub as A,vb as i,wb as a,xb as l}from"./chunk-67YRCRMI.js";import"./chunk-EUDKD2JW.js";function ie(S,t){S&1&&(i(0,"spk-icon",18),C(1,"check"),a())}function ne(S,t){S&1&&(i(0,"spk-icon",18),C(1,"warning"),a())}var m=class S{#a=D(z);#i=D(Q);#e=D(J);#t="";backupId=te(this.#a.params.pipe(O(t=>t.id)));activeBackup=k(()=>{let t=this.#i.backups().find(_=>_.Backup?.ID===this.backupId());return this.#t=t?.Backup?.DBPath??"",t});backupFilePath=c("");lastValidatedPath=c("");isValidatedPath=k(()=>this.lastValidatedPath()===this.backupFilePath());pathHasChanged=k(()=>this.backupFilePath()!==this.#t);backupFilePathEffect=h(()=>{let t=this.backupFilePath();t!==""&&this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).subscribe({next:()=>this.lastValidatedPath.set(t)})});isRestoring=c(!1);isRepairing=c(!1);isDeleting=c(!1);isSavingDbPath=c(!1);isSavingAndRepairing=c(!1);isMovingDb=c(!1);activeBackupEffect=h(()=>{let t=this.activeBackup();if(!t)return;let _=t.Backup?.DBPath??"";this.backupFilePath.set(_)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),d(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),d(()=>this.isDeleting.set(!1))).subscribe(()=>this.lastValidatedPath.set(""))}restoreDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),E(()=>this.#e.postApiV1BackupByIdRepair({id:this.backupId()})),d(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t)}saveDatabasePath(){this.isSavingDbPath.set(!0),this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(d(()=>this.isSavingDbPath.set(!1))).subscribe()}saveAndRepairDatabasePath(){this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(E(()=>this.#e.postApiV1BackupByIdRepair({id:this.backupId()})),d(()=>this.isSavingAndRepairing.set(!1)))}moveDatabasePath(){this.isMovingDb.set(!0),this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:this.backupFilePath()}}).pipe(d(()=>this.isMovingDb.set(!1))).subscribe()}static \u0275fac=function(_){return new(_||S)};static \u0275cmp=y({type:S,selectors:[["app-database"]],decls:46,vars:18,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let _;_=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let n;n=$localize`Maintenance`;let T;T=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. `;let b;b=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Repair `;let f;f=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Delete `;let B;B=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SPK_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SPK_ICON: Restore (delete and repair) `;let I;I=$localize`Placement`;let M;M=$localize`${"\uFFFD#36\uFFFD"}:START_TAG_SPK_ICON:backspace${"\uFFFD/#36\uFFFD"}:CLOSE_TAG_SPK_ICON: Reset `;let N;N=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SPK_ICON:floppy-disk${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SPK_ICON: Save `;let $;$=$localize`${"\uFFFD#42\uFFFD"}:START_TAG_SPK_ICON:wrench${"\uFFFD/#42\uFFFD"}:CLOSE_TAG_SPK_ICON: Save & Repair `;let R;return R=$localize`${"\uFFFD#45\uFFFD"}:START_TAG_SPK_ICON:flow-arrow${"\uFFFD/#45\uFFFD"}:CLOSE_TAG_SPK_ICON: Move existing database `,[t,_,e,n,T,b,f,B,I,M,N,$,R,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],[1,"actions","maintenance"],["spk-button","",3,"click","disabled"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[1,"actions","placement"]]},template:function(_,e){if(_&1&&(l(0,"app-status-bar"),i(1,"section")(2,"div",13)(3,"button",14),r(4,0),l(5,"spk-icon"),p(),a()(),i(6,"article")(7,"h1"),F(8,1),a(),i(9,"p"),F(10,2),a()(),i(11,"article")(12,"h2"),F(13,3),a(),i(14,"p"),F(15,4),a(),i(16,"div",15)(17,"button",16),u("click",function(){return e.repairDatabase()}),r(18,5),l(19,"spk-icon"),p(),a(),i(20,"button",16),u("click",function(){return e.deleteDatabase()}),r(21,6),l(22,"spk-icon"),p(),a(),i(23,"button",16),u("click",function(){return e.restoreDatabase()}),r(24,7),l(25,"spk-icon"),p(),a()()(),i(26,"article")(27,"h2"),F(28,8),a(),i(29,"spk-form-field")(30,"input",17),V("ngModelChange",function(T){return X(e.backupFilePath,T)||(e.backupFilePath=T),T}),a(),v(31,ie,2,0,"spk-icon",18)(32,ne,2,0,"spk-icon",18),a(),i(33,"div",19)(34,"button",16),u("click",function(){return e.resetDatabasePath()}),r(35,9),l(36,"spk-icon"),p(),a(),i(37,"button",16),u("click",function(){return e.saveDatabasePath()}),r(38,10),l(39,"spk-icon"),p(),a(),i(40,"button",16),u("click",function(){return e.saveAndRepairDatabasePath()}),r(41,11),l(42,"spk-icon"),p(),a(),i(43,"button",16),u("click",function(){return e.moveDatabasePath()}),r(44,12),l(45,"spk-icon"),p(),a()()()()),_&2){let n;s(8),K((n=e.activeBackup())==null||n.Backup==null?null:n.Backup.Name),L(8),s(9),P("loader",e.isRepairing()),A("disabled",!e.isValidatedPath()),s(3),P("loader",e.isDeleting()),A("disabled",!e.isValidatedPath()),s(3),P("loader",e.isRestoring()),A("disabled",e.pathHasChanged()),s(6),U(e.isValidatedPath()?"success":"error"),s(),w("ngModel",e.backupFilePath),s(),G(e.isValidatedPath()?31:32),s(3),A("disabled",!e.pathHasChanged()),s(3),A("disabled",!e.pathHasChanged()),s(3),A("disabled",!e.pathHasChanged()),s(3),A("disabled",!e.pathHasChanged())}},dependencies:[ee,Y,Z,x,ae,W,j,H,q],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{m as default};