@duplicati/ngclient 0.0.163 → 0.0.164

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 (77) hide show
  1. package/chunk-2CWLIRUP.js +1 -0
  2. package/{chunk-ZDBKQQ47.js → chunk-2DP4QU4T.js} +1 -1
  3. package/{chunk-2RJJX7C2.js → chunk-2QT6CZNW.js} +1 -1
  4. package/{chunk-FLSO56F3.js → chunk-2VOU6SHS.js} +1 -1
  5. package/{chunk-UYQXV7FY.js → chunk-35KH4G7Y.js} +1 -1
  6. package/{chunk-L34PDBPD.js → chunk-465L4ZG5.js} +1 -1
  7. package/{chunk-TZQE4VY2.js → chunk-4GY6ZWN5.js} +1 -1
  8. package/{chunk-G3QBP5CU.js → chunk-4Z72AON4.js} +1 -1
  9. package/{chunk-AL7GMUVT.js → chunk-5KMPTDRJ.js} +1 -1
  10. package/chunk-5RQDJUIT.js +1 -0
  11. package/chunk-732GPC5D.js +1 -0
  12. package/{chunk-KCVV72VV.js → chunk-75C77QFK.js} +1 -1
  13. package/{chunk-FEJ33TSO.js → chunk-7XXYLQEN.js} +1 -1
  14. package/{chunk-52VBZ35Q.js → chunk-ACZQPL4M.js} +1 -1
  15. package/{chunk-G6RLXZXM.js → chunk-CENUQU54.js} +1 -1
  16. package/{chunk-Q7SVWHVY.js → chunk-CZRQ3GX6.js} +1 -1
  17. package/{chunk-YOP2YAQF.js → chunk-D3LEV6WL.js} +1 -1
  18. package/{chunk-5PANYSIG.js → chunk-D7OP5FPA.js} +1 -1
  19. package/{chunk-U5APXPQC.js → chunk-DF6VTK4B.js} +1 -1
  20. package/{chunk-2ASSYS3L.js → chunk-DY4NXNVS.js} +1 -1
  21. package/{chunk-IXLGVEIK.js → chunk-E3KF5SRU.js} +2 -2
  22. package/{chunk-IDTGMCDE.js → chunk-E5E5ASXG.js} +1 -1
  23. package/{chunk-FFL4DKFK.js → chunk-E6DCTQ34.js} +1 -1
  24. package/chunk-EOKEY2WO.js +1 -0
  25. package/chunk-EVJEPFC6.js +1 -0
  26. package/{chunk-QY6647RY.js → chunk-GOFRTODH.js} +1 -1
  27. package/{chunk-OMKP4YQX.js → chunk-H4H72SDD.js} +1 -1
  28. package/{chunk-D2T243VR.js → chunk-IFCA5KWR.js} +1 -1
  29. package/{chunk-R7B32VI4.js → chunk-IKPQDSQK.js} +1 -1
  30. package/{chunk-7ZE4C4XQ.js → chunk-JPRQYGHQ.js} +1 -1
  31. package/{chunk-LC4PL7V2.js → chunk-K6IL54XE.js} +1 -1
  32. package/{chunk-JKXAMBD7.js → chunk-MCOUCF6F.js} +1 -1
  33. package/{chunk-OYO6MNWR.js → chunk-MPQNBRD5.js} +1 -1
  34. package/chunk-MSASOFXF.js +1 -0
  35. package/{chunk-Q6KQWWNZ.js → chunk-NFIJYWQI.js} +1 -1
  36. package/{chunk-YB374JOK.js → chunk-NME5JWZN.js} +1 -1
  37. package/{chunk-FO5YOQUM.js → chunk-NZDZUPC5.js} +1 -1
  38. package/{chunk-4HEWGBUJ.js → chunk-OHP7HLY2.js} +1 -1
  39. package/{chunk-QSPA3G65.js → chunk-QBHHGHBJ.js} +1 -1
  40. package/{chunk-5XN6KKQ5.js → chunk-QMHLXETS.js} +3 -3
  41. package/{chunk-3OT227W4.js → chunk-RNWKZDZM.js} +1 -1
  42. package/chunk-SXFSAK5L.js +1 -0
  43. package/{chunk-5KAFOFRJ.js → chunk-TBTQMBCJ.js} +1 -1
  44. package/chunk-TGNUULAU.js +1 -0
  45. package/{chunk-3UJSVCAS.js → chunk-URAI6X74.js} +1 -1
  46. package/{chunk-HJAQV4HF.js → chunk-VEON764K.js} +1 -1
  47. package/{chunk-YATBNEED.js → chunk-VNGJCKGG.js} +1 -1
  48. package/{chunk-5P2YZRI5.js → chunk-W2SSWLYM.js} +1 -1
  49. package/chunk-W4KOKNGU.js +1 -0
  50. package/chunk-WZAZENJC.js +1 -0
  51. package/chunk-X4KK6R3X.js +1 -0
  52. package/chunk-X5BOJXMC.js +1 -0
  53. package/chunk-XKKT2NP5.js +1 -0
  54. package/{chunk-VITGSIEL.js → chunk-XRI2BFC2.js} +1 -1
  55. package/{chunk-EBVPGAHS.js → chunk-Y4GDUNWN.js} +1 -1
  56. package/chunk-Z34TVTJN.js +1 -0
  57. package/{chunk-7V6AACW7.js → chunk-Z5W4ULWF.js} +1 -1
  58. package/{chunk-6QSMEZZ4.js → chunk-ZLLXHZQV.js} +1 -1
  59. package/index.html +2 -2
  60. package/{main-TUINGPOM.js → main-75X3EGHT.js} +1 -1
  61. package/package.json +1 -1
  62. package/styles-JSM72RCO.css +1 -0
  63. package/chunk-53OIXPHF.js +0 -1
  64. package/chunk-7I3YOHEE.js +0 -1
  65. package/chunk-7XAN363E.js +0 -1
  66. package/chunk-A4RKBIZK.js +0 -1
  67. package/chunk-AKJZOLGH.js +0 -1
  68. package/chunk-LMEZWWBD.js +0 -1
  69. package/chunk-QU7TANXU.js +0 -1
  70. package/chunk-R6CC4KYP.js +0 -1
  71. package/chunk-R7CYCJUU.js +0 -1
  72. package/chunk-RAIB7LN4.js +0 -1
  73. package/chunk-V7NZ5WF5.js +0 -1
  74. package/chunk-YPAJPRDF.js +0 -1
  75. package/chunk-YWDTUV3V.js +0 -1
  76. package/chunk-ZCH336WN.js +0 -1
  77. package/styles-FD7LUDV4.css +0 -1
@@ -0,0 +1 @@
1
+ import{a as Ct}from"./chunk-5KMPTDRJ.js";import{b as ye,c as dt,d as pt}from"./chunk-2DP4QU4T.js";import{a as ut,b as Ve,c as ct}from"./chunk-AWXWGD4T.js";import{a as _t}from"./chunk-POJT4MSX.js";import{b as re}from"./chunk-WJDMMKWE.js";import{a as rt}from"./chunk-QBHHGHBJ.js";import{a as Oe}from"./chunk-AE7T2DAH.js";import{b as lt}from"./chunk-TC7HZO7D.js";import{B as ae,G as Y,K as ot,O as le,U as st,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as se,t as Re,u as q,w as nt,z as it}from"./chunk-TGNUULAU.js";import{b as ie,d as H}from"./chunk-XUN5TTJC.js";import{$b as u,Ab as $e,Bb as xe,Bc as me,Cb as N,Db as a,Eb as l,Fb as S,H as we,Jb as B,Kb as k,Mb as x,Rc as G,Sa as r,Sc as ne,Tb as m,Ub as F,V as Ce,Vb as f,Wc as Be,Xc as ke,Yb as Ue,Yc as Fe,Zb as T,_ as A,cb as J,ea as p,fa as C,gc as ge,hb as je,hc as Ee,ic as be,kc as Se,nc as U,oc as ve,pa as E,pc as Ye,sc as L,tc as I,ub as qe,uc as w,xb as D,yb as R,zb as Ge}from"./chunk-ZBK64QS2.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class s{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||s)};static \u0275prov=Ce({token:s,factory:s.\u0275fac,providedIn:"root"})};function mt(s,t){if(s&1){let e=x();a(0,"div",24)(1,"sh-form-field")(2,"label",25),f(3,7),l(),a(4,"input",26,0),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),C(i)}),T("focus",function(){p(e);let i=be(5);return C(i.showPicker())}),l(),a(6,"sh-icon",27),U(7,"clock"),l()(),a(8,"sh-form-field"),S(9,"label",28),a(10,"input",29,1),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),C(i)}),T("focus",function(){p(e);let i=be(11);return C(i.showPicker())}),l(),a(12,"sh-icon",27),U(13,"calendar"),l()()(),a(14,"div",24)(15,"sh-form-field")(16,"label",30),f(17,8),l(),a(18,"input",31),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),C(i)}),l()(),a(19,"sh-select",32)(20,"input",33),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),C(i)}),l()()(),a(21,"sh-toggle-card",34),B(22,35),f(23,9),k(),a(24,"div",36)(25,"sh-toggle",19),m(26,10),a(27,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),C(i)}),l(),F(),l(),a(28,"sh-toggle",19),m(29,11),a(30,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),C(i)}),l(),F(),l(),a(31,"sh-toggle",19),m(32,12),a(33,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),C(i)}),l(),F(),l(),a(34,"sh-toggle",19),m(35,13),a(36,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),C(i)}),l(),F(),l(),a(37,"sh-toggle",19),m(38,14),a(39,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),C(i)}),l(),F(),l(),a(40,"sh-toggle",19),m(41,15),a(42,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),C(i)}),l(),F(),l(),a(43,"sh-toggle",19),m(44,16),a(45,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),C(i)}),l(),F(),l()()()}if(s&2){let e=u();r(4),L("ngModel",e.scheduleFields.nextTime().time),r(6),L("ngModel",e.scheduleFields.nextTime().date),r(8),L("ngModel",e.scheduleFields.runAgain().repeatValue),r(),N("options",e.unitOptions)("isClearable",!1),r(),L("ngModel",e.scheduleFields.runAgain().repeatUnit),r(),N("disallowToggle",!0),r(6),L("ngModel",e.scheduleFields.runAgain().allowedDays.mon),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.tue),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.wed),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.thu),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.fri),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.sat),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var Ft=[{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`}],ee={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 s{#e=A(Q);#t=A(H);#i=A(ie);unitOptions=Ft;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||s)};static \u0275cmp=J({type:s,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_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let d;d=$localize`Next time`;let c;c=$localize`Run again every`;let _;_=$localize`Allowed days`;let g;g=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let y;y=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let h;h=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,d,c,_,g,y,h,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",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),f(1,2),l(),a(2,"div",18)(3,"sh-toggle",19),m(4,3),a(5,"input",20),w("ngModelChange",function(o){return I(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),F(),l(),a(6,"p"),f(7,4),l()(),D(8,mt,46,14),a(9,"div",21)(10,"button",22),T("click",function(){return n.goBack()}),m(11,5),S(12,"sh-icon"),F(),l(),a(13,"button",23),T("click",function(){return n.next()}),m(14,6),S(15,"sh-icon"),F(),l()()),e&2&&(r(5),L("ngModel",n.scheduleFields.autoRun),r(3),R(n.scheduleFields.autoRun()?8:-1))},dependencies:[se,z,Ze,Te,j,oe,Y,Me,q,ae,le,st],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 Tt(s,t){if(s&1){let e=x();a(0,"sh-select",2)(1,"input",6),w("ngModelChange",function(i){p(e);let o=u();return I(o.internalPath,i)||(o.internalPath=i),C(i)}),T("ngModelChange",function(){p(e);let i=u();return C(i.updateFilter())}),l()()}if(s&2){let e=u();N("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),r(),L("ngModel",e.internalPath)}}function ht(s,t){if(s&1&&(B(0,7),U(1),k()),s&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Nt(s,t){if(s&1&&(B(0,8),U(1),k()),s&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ft(s,t){if(s&1){let e=x();a(0,"sh-form-field",3)(1,"input",6),w("ngModelChange",function(i){p(e);let o=u();return I(o.internalPath,i)||(o.internalPath=i),C(i)}),T("ngModelChange",function(){p(e);let i=u();return C(i.updateFilter())}),l(),D(2,ht,2,1,"ng-container",7),D(3,Nt,2,1,"ng-container",8),l()}if(s&2){let e,n,i=u();r(),L("ngModel",i.internalPath),r(),R(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),r(),R(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Pt=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],At=[{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:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ie=class s{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=E("");pathType=E("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=E(Pt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return At.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{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||s)};static \u0275cmp=J({type:s,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(a(0,"sh-select",0)(1,"input",1),w("ngModelChange",function(o){return I(n.pathType,o)||(n.pathType=o),o}),T("ngModelChange",function(){return n.updateFilter()}),l()(),D(2,Tt,2,4,"sh-select",2)(3,ft,4,3,"sh-form-field",3),a(4,"div",4),T("click",function(){return n.removeFilter()}),a(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;N("options",n.expressionOptions())("isClearable",!1),r(),L("ngModel",n.pathType),r(),R(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[se,z,j,oe,le,Y,q],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 Dt=["formRef"],He=()=>({standalone:!0});function Rt(s,t){if(s&1){let e=x();a(0,"sh-form-field",41)(1,"input",42),w("ngModelChange",function(i){p(e);let o=u(2);return I(o.editingPath,i)||(o.editingPath=i),C(i)}),l()(),a(2,"button",43),T("click",function(){p(e);let i=u(2);return C(i.updatePath())}),a(3,"sh-icon"),U(4,"floppy-disk"),l()(),a(5,"button",43),T("click",function(){p(e);let i=u(2);return C(i.cancelEditPath())}),a(6,"sh-icon"),U(7,"x-bold"),l()()}if(s&2){let e=u(2);r(),L("ngModel",e.editingPath),N("ngModelOptions",me(2,He))}}function Mt(s,t){if(s&1){let e=x();a(0,"sh-form-field",41),S(1,"input",44),l(),a(2,"button",43),T("click",function(){p(e);let i=u().$implicit,o=u();return C(o.editPath(i))}),a(3,"sh-icon"),U(4,"pen"),l()(),a(5,"button",43),T("click",function(){p(e);let i=u().$implicit,o=u();return C(o.removePath(i))}),a(6,"sh-icon"),U(7,"trash-simple"),l()()}if(s&2){let e=u().$implicit;qe("readonly",!0),r(),N("ngModel",e)("ngModelOptions",me(3,He))}}function Ot(s,t){if(s&1&&(a(0,"div",30),D(1,Rt,8,3)(2,Mt,8,4),l()),s&2){let e=t.$implicit,n=u();r(),R(n.oldPath()===e?1:2)}}function yt(s,t){if(s&1){let e=x();a(0,"app-new-filter",46),T("pathChange",function(i){let o=p(e).$index,d=u(2);return C(d.patchPathAt(i,o))})("remove",function(){let i=p(e).$index,o=u(2);return C(o.removePathAt(i))}),l()}if(s&2){let e=t.$implicit,n=u(2);N("path",e)("osType",n.osType()??"")}}function Lt(s,t){if(s&1&&$e(0,yt,1,2,"app-new-filter",45,Ge),s&2){let e=u();xe(e.pathArray())}}function It(s,t){if(s&1){let e=x();a(0,"div",31)(1,"app-size",47),T("ngModelChange",function(i){p(e);let o=u();return C(o.updateFilesLargerThan(i))}),l()()}if(s&2){let e=u();r(),N("ngModel",e.filesLargerThan())("ngModelOptions",me(2,He))}}var V=new De,gt=(s={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(s.path),excludes:V.group({hidden:V.control(s.excludes.hidden),system:V.control(s.excludes.system),temporary:V.control(s.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class s{#e=A(Q);#t=A(H);#i=A(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=E(null);editingPath=E(null);addingNewPath=E(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ye(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}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 n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().map((c,_)=>_===e?`${t}`:`${c}`).join("\0"),d=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(d)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),i=this.pathArray().filter((d,c)=>c!==t).join("\0"),o=[n,i].filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}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,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),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||s)};static \u0275cmp=J({type:s,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Dt,5),e&2&&Ee()},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 d;d=$localize`Source Data`;let c;c=$localize`Folder path`;let _;_=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let g;g=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let y;y=$localize`Paths`;let h;h=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let M;M=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let P;return P=$localize`Edit path`,[["formRef",""],d,c,_,g,y,h,$,K,v,W,M,Z,_e,ue,ce,[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"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","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"],[1,"small"],["type","text","placeholder",P,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=x();a(0,"form",16,0),T("submit",function(){return p(i),C(n.next())}),a(2,"div",17)(3,"h3",18),f(4,1),l(),a(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),S(8,"input",21),l(),a(9,"div",22)(10,"button",23),T("click",function(){return p(i),C(n.goBack())}),m(11,3),S(12,"sh-icon"),F(),l(),a(13,"button",24),m(14,4),S(15,"sh-icon"),F(),l()()(),a(16,"div",25)(17,"app-toggle-card",26),B(18,27),f(19,5),k(),a(20,"p",28),f(21,6),l(),a(22,"div",29),$e(23,Ot,3,1,"div",30,Ge),a(25,"div",31)(26,"sh-form-field"),S(27,"input",32),l(),a(28,"button",33),T("click",function(){return p(i),C(n.addNewPath())}),a(29,"sh-icon"),U(30,"plus"),l()()()()(),a(31,"app-toggle-card",26),B(32,27),f(33,7),k(),a(34,"p",28),f(35,8),l(),a(36,"button",34),T("click",function(){return p(i),C(n.addFilter())}),f(37,9),l(),D(38,Lt,2,0),l(),a(39,"app-toggle-card",35),B(40,27),f(41,10),k(),a(42,"p",28),f(43,11),l(),a(44,"sh-toggle",36),m(45,12),S(46,"input",37),F(),l(),a(47,"sh-toggle",36),m(48,13),S(49,"input",38),F(),l(),a(50,"sh-toggle",36),m(51,14),S(52,"input",39),F(),l(),a(53,"sh-toggle",40),T("click",function(){return p(i),C(n.toggleFilesLargerThan())}),f(54,15),l(),D(55,It,2,3,"div",31),l()()()}if(e&2){let i;N("formGroup",n.sourceDataForm),r(5),N("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),r(12),N("disallowToggle",!0),r(6),xe(n.nonFilterPaths()),r(4),N("formControl",n.newPathCtrl),r(4),N("disallowToggle",!0),r(7),R((i=n.pathSignal())!=null&&i.length?38:-1),r(),N("disallowToggle",!0),r(14),Se("active",n.filesLargerThan()),r(2),R(n.filesLargerThan()?55:-1)}},dependencies:[se,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,ae,Me,Ie,pt,Ct,dt],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}sh-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;overflow:auto}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Et="1W:1D,4W:1W,12M:1M",Q=class s{#e=A(H);#t=A(Oe);#i=A(it);#n=A(lt);#r=A(_t);#o=A(Le);generalForm=St();sourceDataForm=gt();scheduleFields={autoRun:E(ee.autoRun),nextTime:E(ee.nextTime),runAgain:E(ee.runAgain)};settings=E([]);optionsFields={remoteVolumeSize:E("50MB"),backupRetention:E("all"),backupRetentionTime:E(""),backupRetentionVersions:E(0),backupRetentionCustom:E("")};targetUrlModel=E(null);backupMetadata=E(null);isDraft=E(!1);backupId=E(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=E(!1);finishedLoading=E(!1);backupDefaults=E(null);applicationOptions=E(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=E([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#s=E("");#a=E(null);#l=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#a.asReadonly();#p=ne(()=>{let t=this.targetUrlModel(),e=this.#s(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#s.set(""),this.#a.set(null))});setTestState(t,e){this.#s.set(t),this.#a.set(e??null)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>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.#c(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#_(),this.#e.navigate(["/"]);return}this.#i.open(rt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#_(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(c=>`${c.Include?"":"-"}${c.Expression}`)??[],i=t.Settings?.find(c=>c.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],o=t.Settings?.find(c=>c.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,d={path:[...e,...n].join("\0"),excludes:{hidden:i.includes("hidden"),system:i.includes("system"),temporary:i.includes("temporary"),filesLargerThan:o===null?void 0:ye(o)}};this.sourceDataForm.patchValue(d)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(g=>g.Name==="encryption-module"),o=t.Settings?.find(g=>g.Name==="passphrase")?.Value??"",d=i?.Value&&i.Value.length?i.Value:"",c=t.Settings?.find(g=>g.Name==="compression-module")?.Value??"",_={name:t.Name??"",description:t.Description??""};e&&e!==""&&(_.name=e),n&&n!==""&&(_.description=n),d&&d!==""&&(_.encryption=d),o&&o!==""&&(_.password=o,_.repeatPassword=o),c&&c!==""&&(_.compression=c),this.generalForm.patchValue(_)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#o.fromString(t.Repeat)??null,n=this.#d(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},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,e=!1){let n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=(t.Settings??[]).map(_=>_);if(e){let _=this.#r.serverSettings()??{};Object.keys(_).filter(g=>g.startsWith("--")).forEach(g=>{i.find(h=>h.Name===g)||i.push({Name:g,Value:_[g],Filter:null})})}let o=i.filter(_=>!n.includes(_.Name)),d=i.filter(_=>n.includes(_.Name));this.settings.set(o??[]),o?.forEach(_=>{if(_.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(_.Value??"")});var c="all";d?.forEach(_=>{if(_.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(_.Value??"50MB"),_.Name==="keep-time"&&(_.Value??"")!=="")return c="time",this.optionsFields.backupRetentionTime.set(_.Value??"");if(_.Name==="keep-versions"&&(_.Value??"")!=="")return c="versions",this.optionsFields.backupRetentionVersions.set(_.Value?parseInt(_.Value):null);if(_.Name==="retention-policy"&&(_.Value??"")!=="")if(_.Value===Et)c="smart";else return c="custom",this.optionsFields.backupRetentionCustom.set(_.Value??"")}),this.optionsFields.backupRetention.set(c)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#c(){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 d=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([h,$])=>$).map(([h,$])=>h):[],c=n.path?.split("\0")??[],_=this.mapFormsToSettings(),g=Object.entries(n.excludes??{}).filter(([h,$])=>$&&h!=="filesLargerThan").map(([h])=>h),y=n.excludes?.filesLargerThan;return g.length&&_.push({Name:"--exclude-files-attributes",Value:g.join(",")}),y&&y.size!==null&&y.unit!==null&&_.push({Name:"--skip-files-larger-than",Value:`${y.size}${y.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:c.filter(h=>!(h.startsWith("-")||h.startsWith("+"))),Settings:_,Filters:c.filter(h=>h.startsWith("-")||h.startsWith("+")).map((h,$)=>({Order:$,Include:h.startsWith("+"),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:d}: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","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let d=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":d.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":d.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":d.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":d.push({Name:"retention-policy",Value:Et});break}let c=[...t,...n],_=this.settings().filter(g=>!c.includes(g.Name)).map(g=>{let y=g.Value;return typeof g.Value=="number"&&(y=g.Value.toString()),typeof g.Value=="boolean"&&(y=g.Value?"True":"False"),{Name:g.Name?.startsWith("--")?g.Name:`--${g.Name}`,Value:y}});return[...i,...o,...d,..._]}#d(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,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#_(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.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||s)};static \u0275prov=Ce({token:s,factory:s.\u0275fac,providedIn:"root"})};var wt=["formRef"];function Gt(s,t){s&1&&(a(0,"sh-alert",17),m(1,5),S(2,"sh-icon",26),F(),l())}function $t(s,t){if(s&1&&U(0),s&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function xt(s,t){if(s&1&&S(0,"sh-progress-bar",40),s&2){let e=u(3);Se("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),N("value",e.calculatePasswordStrength()*(100/5))}}function Ut(s,t){s&1&&(a(0,"span",35),f(1,10),l())}function bt(s,t){s&1&&(m(0,8,1),S(1,"sh-icon"),F())}function vt(s,t){s&1&&(m(0,8,2),S(1,"sh-icon"),F())}function Bt(s,t){s&1&&(m(0,11,1),S(1,"sh-icon",42),F())}function kt(s,t){s&1&&(m(0,11,2),S(1,"sh-icon"),F())}function Vt(s,t){if(s&1){let e=x();a(0,"button",41),T("click",function(){p(e);let i=u(3);return C(i.copyPassword())}),m(1,11),D(2,Bt,2,0)(3,kt,2,0),F(),l()}if(s&2){let e=u(3);r(2),R(e.copiedPassword()?2:3)}}function Kt(s,t){s&1&&(a(0,"sh-alert",39),f(1,12),l())}function Wt(s,t){if(s&1){let e=x();a(0,"div",30)(1,"sh-form-field")(2,"label",31),m(3,7),S(4,"sup"),F(),l(),S(5,"input",32),l(),D(6,xt,1,9,"sh-progress-bar",33),a(7,"sh-form-field"),S(8,"input",34),D(9,Ut,2,0,"span",35),l(),a(10,"div",36)(11,"button",37),T("click",function(){p(e);let i=u(2);return C(i.showPassword.set(!i.showPassword()))}),m(12,8),D(13,bt,2,0)(14,vt,2,0),F(),l(),a(15,"button",37),T("click",function(){p(e);let i=u(2);return C(i.generatePassword())}),m(16,9),S(17,"sh-icon"),F(),l(),D(18,Vt,4,1,"button",38),l(),D(19,Kt,2,0,"sh-alert",39),l()}if(s&2){let e=u(2);r(5),N("type",e.showPassword()?"text":"password"),r(),R(e.generalForm.value.password?6:-1),r(2),N("type",e.showPassword()?"text":"password"),r(),R(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),r(4),R(e.showPassword()?13:14),r(5),R(e.showCopyPassword()?18:-1),r(),R(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Xt(s,t){if(s&1&&(a(0,"sh-select",27)(1,"label",28),f(2,6),l(),S(3,"input",29),je(4,$t,1,1,"ng-template"),l(),D(5,Wt,20,7,"div",30)),s&2){let e=u();N("options",e.encryptionOptions())("isClearable",!1),r(5),R(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Jt(s,t){if(s&1&&(a(0,"button",24),m(1,13),S(2,"sh-icon"),F(),l()),s&2){let e=u();N("disabled",e.nameAndDescriptionValid()===!1)}}function Ht(s,t){if(s&1&&(a(0,"button",25),m(1,14),S(2,"sh-icon"),F(),l()),s&2){let e=u();N("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,St=(s={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(s.name,[he.required]),description:te.control(s.description),encryption:te.control(s.encryption,[ct()]),password:te.control(s.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(s.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(s.compression)}),pe={Key:"-",DisplayName:"None"},ze=class s{#e=A(H);#t=A(ie);#i=A(ut);#n=A(Q);#r=A(Oe);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=E(!1);copiedPassword=E(!1);showCopyPassword=E(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{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.#o(t??""),this.copiedPassword.set(!0)}async#o(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)}}}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||s)};static \u0275cmp=J({type:s,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,wt,5),e&2&&Ee()},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 d;d=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let _;_=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let g;g=$localize`Encryption`;let y;y=$localize`Encryption`;let h;h=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_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_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let M;M=$localize`Passwords do not match`;let Z;Z=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,d,c,_,y,K,v,W,M,Z,_e,ue,ce,["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","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",g,"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",$,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=x();a(0,"form",15,0),T("submit",function(){return p(i),C(n.next())}),a(2,"h3",16),f(3,1),l(),D(4,Gt,3,0,"sh-alert",17),a(5,"sh-form-field")(6,"label",18),m(7,2),S(8,"sup"),F(),l(),S(9,"input",19),l(),a(10,"sh-form-field")(11,"label",20),f(12,3),l(),S(13,"textarea",21),l(),D(14,Xt,6,3),a(15,"div",22)(16,"button",23),T("click",function(){return p(i),C(n.exit())}),m(17,4),S(18,"sh-icon"),F(),l(),D(19,Jt,3,1,"button",24)(20,Ht,3,1,"button",25),l()()}if(e&2){let i;N("formGroup",n.generalForm),r(4),R(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),r(10),R(n.isNew()?14:-1),r(5),R(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,ae,q,ot,nt,at],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%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{St as a,pe as b,ze as c,ee as d,Ke as e,gt as f,Je as g,Q as h};
@@ -1 +1 @@
1
- import{a as We}from"./chunk-QSPA3G65.js";import{a as Ve}from"./chunk-AE7T2DAH.js";import{b as $e}from"./chunk-TC7HZO7D.js";import{A as Re,B as Ie,G as te,I as Le,K as Ae,O as Be,V as ke,a as Oe,c as U,e as Y,i as Z,k as ye,s as ee,u as xe,y as we,z as De}from"./chunk-RAIB7LN4.js";import{ea as Fe}from"./chunk-NXROYR6L.js";import{$b as p,Ab as he,Ac as Me,B as pe,Bb as _e,Bc as Ne,Cb as O,Cc as Q,Db as c,Dc as ve,Eb as d,Fb as X,H as ne,Kc as Se,Lb as ie,Mb as L,Rc as D,Sa as h,Sc as R,Tb as ge,Ub as me,Vb as A,Wb as fe,Wc as se,Xb as Ce,Xc as C,Yc as le,Zb as x,_ as j,ac as q,bc as w,cb as J,ea as N,fa as v,gc as oe,hb as W,hc as Te,ic as re,jc as K,kc as y,n as ce,nc as b,oc as Ee,pa as P,pc as Pe,qc as be,r as H,sc as B,tc as k,ub as ue,uc as $,x as de,xb as S,yb as F}from"./chunk-ZBK64QS2.js";import{a as G,b as z}from"./chunk-EUDKD2JW.js";var qe=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Ke=["label","[prefix]","[suffix]"];function Qe(o,t){if(o&1&&b(0),o&2){let e=t.$implicit,n=p();be("",e.label,"",n.hasPerSecond()?"/s":"")}}var Ue=["throttle-upload","throttle-download"],Ye=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Ze=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},Ge=class o{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(Ye);readonly=P(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&Ue.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Ze(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Me([{provide:Oe,useExisting:o,multi:!0}])],ngContentSelectors:Ke,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,n){e&1&&(q(qe),c(0,"div",0),w(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(n.timespan,r)||(n.timespan=r),r}),d(),w(4,1),w(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(n.unit,r)||(n.unit=r),r}),d(),W(8,Qe,1,2,"ng-template"),d()),e&2&&(h(2),ue("readonly",n.readonly()||void 0),h(),O("id",n.customId()),B("ngModel",n.timespan),O("disabled",n.readonly()),h(3),K("--miw",0),O("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),h(),B("ngModel",n.unit))},dependencies:[Be,te,ee,U,ye,Y,Z],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var et=["treeContainer"],tt=["formRef"],nt=[[["label"]],[["label"]],[["input"]]],it=["label","label","input"],ot=o=>({children:o,level:0}),ze=o=>({$implicit:o}),rt=(o,t)=>({children:o,level:t}),st=()=>({maxWidth:"700px",width:"100%"}),lt=(o,t)=>t.id;function at(o,t){if(o&1){let e=L();c(0,"sh-button-group")(1,"button",19),x("click",function(){N(e);let i=p();return v(i.pathDiscoveryMethod.set("browse"))}),A(2,4),d(),c(3,"button",19),x("click",function(){N(e);let i=p();return v(i.pathDiscoveryMethod.set("path"))}),A(4,5),d()()}if(o&2){let e=p();h(),y("active",e.pathDiscoveryMethod()==="browse"),h(2),y("active",e.pathDiscoveryMethod()==="path")}}function ct(o,t){o&1&&X(0,"sh-progress-bar",12)}function dt(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-down"),d())}function pt(o,t){o&1&&X(0,"sh-icon",24)}function ut(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-right"),d())}function ht(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-open"),d())}function _t(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-user"),d())}function gt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"file"),d())}function mt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder"),d())}function ft(o,t){if(o&1&&(S(0,dt,2,0,"sh-icon",24)(1,pt,1,0,"sh-icon",24)(2,ut,2,0,"sh-icon",24),S(3,ht,2,0,"sh-icon",22)(4,_t,2,0,"sh-icon",22)(5,gt,2,0,"sh-icon",22)(6,mt,2,0,"sh-icon",22)),o&2){let e=p(2).$implicit;F(e.children.length?0:e.cls==="file"?1:2),h(3),F(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Ct(o,t){o&1&&(c(0,"sh-icon",22),b(1,"desktop-tower"),d())}function Tt(o,t){o&1&&ie(0)}function Et(o,t){if(o&1&&W(0,Tt,1,0,"ng-container",13),o&2){let e=p(2).$implicit,n=p().$implicit;p();let i=re(7);O("ngTemplateOutlet",i)("ngTemplateOutletContext",Q(5,ze,ve(2,rt,e.children,n.level+1)))}}function Pt(o,t){if(o&1){let e=L();c(0,"div",20,3),x("click",function(){N(e);let i=p().$implicit,r=p(2);return v(r.toggleNode(i.id,i))}),c(2,"div",21),S(3,ft,7,2)(4,Ct,2,0,"sh-icon",22),d(),c(5,"div",23),x("click",function(i){N(e);let r=p().$implicit,a=p(2);return v(a.toggleSelectedNode(i,r))}),b(6),d()(),S(7,Et,1,7,"ng-container")}if(o&2){let e=p().$implicit,n=p().$implicit,i=p();y("accepted",e.accepted===!0)("active",e.evalState===i.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",n.level===0),h(2),y("file",e.cls==="file"),h(),F(e.id!=="/"?3:4),h(3),Pe(" ",e.text," "),h(),F(e.children.length>0?7:-1)}}function bt(o,t){if(o&1&&S(0,Pt,8,17),o&2){let e=t.$implicit,n=p(2);F(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function Mt(o,t){if(o&1&&(c(0,"sh-list"),he(1,bt,1,1,null,null,lt),d()),o&2){let e=t.$implicit;K("padding-left",e.level*.25,"rem"),h(),_e(e.children)}}function Nt(o,t){o&1&&ie(0)}function vt(o,t){if(o&1){let e=L();c(0,"sh-toggle",25),x("click",function(){N(e);let i=p();return v(i._showHiddenNodes.set(!i._showHiddenNodes()))}),A(1,6),d()}if(o&2){let e=p();y("active",e._showHiddenNodes()),h(),fe(e.showFiles()?"files":"folders"),Ce(1)}}function St(o,t){if(o&1){let e=L();c(0,"button",26),x("click",function(){N(e);let i=p();return v(i.openCreateFolderDialog())}),A(1,7),d()}if(o&2){let e=p();O("disabled",!e.isCurrentPathFolder())}}function Ft(o,t){if(o&1){let e=L();c(0,"sh-dialog",27),$("isOpenChange",function(i){N(e);let r=p();return k(r.createFolderDialogOpen,i)||(r.createFolderDialogOpen=i),v(i)}),c(1,"header",28)(2,"h2"),A(3,8),d()(),c(4,"div",29)(5,"div"),b(6," Folder will be created under "),c(7,"pre"),b(8),d()(),c(9,"sh-form-field")(10,"textarea",30),$("ngModelChange",function(i){N(e);let r=p();return k(r.createFolderPath,i)||(r.createFolderPath=i),v(i)}),d()()(),c(11,"footer",31)(12,"button",32),x("click",function(){N(e);let i=p();return v(i.closeCreateFolderDialog(!1))}),b(13,"Cancel"),d(),c(14,"button",33),x("click",function(){N(e);let i=p();return v(i.closeCreateFolderDialog(!0))}),ge(15,9),X(16,"sh-icon"),me(),d()()()}if(o&2){let e,n=p();B("isOpen",n.createFolderDialogOpen),O("options",Ne(5,st)),h(8),Ee(n.currentPath()),h(2),B("ngModel",n.createFolderPath),h(4),O("disabled",!((e=n.createFolderPath())!=null&&e.length))}}var He=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(He||{}),M="/",ae=class o{#t=j($e);#i=j(Ve);#c=j(De);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);includes=se();excludes=se();_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=le("treeContainer");formRef=le("formRef");pathDiscoveryMethod=P("browse");isLoading=P(!1);currentPath=P("/");#o=P(null);treeSearchQuery=P("");treeNodes=P([]);pathDelimiter=D(()=>this.#i.systemInfo()?.DirectorySeparator??"");filterGroups=this.#i.filterGroups();isByBackupSettings=D(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=D(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=He;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),n=structuredClone(e);for(let l=0;l<n.length;l++){let f=n[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let _=f.slice(1,-1),g=this.filterGroups?.FilterGroups[_];if(g&&g.length){let T=g.map(E=>`-${E}`);n.splice(l,1,...T)}}}let i=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),m=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let u=this.#r(n,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:u,isIndeterminate:!1,cls:this.#e(l,m)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let u=new Map;if(!l.id)return;let f=l.id;a&&(l.accepted=!0),u.set(f,l);let _=r.length>0?i.filter(g=>g.parentPath.startsWith(f)):i;for(let g of _){if(!g.id)continue;let T=g.id;if(!g.cls||u.has(T))continue;let E=u.get(g.parentPath),V=g.hidden===!0&&t?0:this.#r(n,T,g.cls,E),I=z(G({},g),{isIndeterminate:this.isIndeterminate(n,T),evalState:V,children:[]});a&&(I.accepted=this.matchAccepts(a,I)),u.set(T,I),E&&E.children.push(I)}return l}),s});#d(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#r(t,e,n,i){if(i&&i.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),m=t.filter(u=>!u.startsWith("-")&&!u.startsWith("+")),s=t.filter(u=>u.startsWith("-")||u.startsWith("+")),l=this.multiSelect();if(m.length===0)return r;for(let u=0;u<m.length;u++){let f=m[u];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let u=0;u<s.length;u++){let f=s[u],_=f.slice(1),g=f.startsWith("-")?-1:1;if(this.#e(_,a)){if(n!=="folder")continue;if(e===_){r=g;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(n!=="folder")continue;let E=_.slice(1,-2);if(E==="")break;if(e?.includes(E+a)){r=g;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(n!=="file")continue;let E=_.slice(3,-7);if(new RegExp(E).test(e)){r=g;break}}if(_.startsWith("[")&&_.endsWith("]")){let E=_.slice(1,-1),V=this.translateCSharpRegex(E);if(new RegExp(`${V}`).test(e)){r=g;break}}if(_.startsWith("*.")){if(n!=="file"||_.replace("*.","").length===0)continue;if(this.#s(e,_,!0)){r=g;break}}if(_==="")continue;if(_===e){r=g;break}if(this.#s(e,_,!0)){r=g;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(i,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(n=>!n.startsWith("-")&&this.#e(n,this.pathDelimiter())).some(n=>n.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,n=!1){let i=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${i}${n?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let n=t.split(",");if(n.length===0)return!0;let i="."+e.id.slice(e.id.indexOf("."));return i?n.some(r=>i.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),n=this.initialNodes();e&&e.length>0?(n&&n.length>0&&this.treeNodes.set(n.map(i=>({id:i.id,leaf:i.leaf,cls:i.cls,text:i.text,iconCls:i.iconCls,fileSize:i.fileSize,resolvedpath:i.resolvedpath,parentPath:this.getParentPath(i.id??"")}))),this.#n(null,e[0])):this.#n(null,M)}}getParentPath(t){let e=this.pathDelimiter(),n=t.split(e);return n.length<=1?M:(n.pop(),n.length!==0&&n.pop(),n.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let i=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,m=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(i.includes(e.id))this.currentPath.set(i.filter(s=>s!==e.id&&!(m&&s.startsWith(a))).join("\0"));else if(i.some(s=>s==a))this.currentPath.set(i.filter(s=>s!==a).join("\0"));else{let s=m?i.filter(l=>!l.startsWith(e.id)):i;this.currentPath.set([...s,a].join("\0"))}else i.includes(e.id)?this.currentPath.set(i.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!==M&&this.#e(n,this.pathDelimiter())).some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(i=>!i.id?.startsWith(e.id)||i.id===e.id)):this.#n(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let n=this.currentPath(),i=this.#d(e),r=n+i;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#n(null,n),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let m=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=m?m[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#c.open(We,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#u(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#i.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(H(n=>n.Data??[]));{let n={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(n).pipe(H(i=>i.Files??[]))}}#a(t){return this.isByBackupSettings()?this.#h(t):this.#u(t)}#_(t){let e=this.pathDelimiter(),n=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,u)=>{let f=s.slice(0,u+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let m=a.map(s=>this.#a(s).pipe(H(l=>({status:"success",value:l,url:s})),pe(l=>ce({status:"error",value:l,url:s}))));de(m).pipe(ne(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),u=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let _=l.flatMap(T=>Array.isArray(T.value)?T.value.map(E=>z(G({},E),{parentPath:T.url})):[]),g=[...new Map([...f,..._].map(T=>[T.id,T])).values()];return this.#l(),this.hideShortcuts()?g.filter(T=>!T.id.startsWith("%")):g})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#n(t=null,e=M){let n=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ne(()=>this.isLoading.set(!1))).subscribe({next:i=>{let r=this.isByBackupSettings()?i.map(a=>({text:a.Path.split(n).filter(m=>m!=="").pop(),id:a.Path,cls:this.#e(a.Path,n)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):i;this.treeNodes.update(a=>{let m=r.map(l=>{let u=this.#e(l.id,n)?"folder":"file";return z(G({},l),{cls:u,parentPath:e})}),s=[...new Map([...a,...m].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&(oe(n.treeContainerRef,et,5),oe(n.formRef,tt,5)),e&2&&Te(2)},hostVars:2,hostBindings:function(e,n){e&2&&y("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:it,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let n;n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,i,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){if(e&1&&(q(nt),S(0,at,5,4,"sh-button-group"),c(1,"div",10),w(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,ct,1,0,"sh-progress-bar",12),W(6,Mt,3,2,"ng-template",null,1,Se)(8,Nt,1,0,"ng-container",13),d(),c(9,"div",14),S(10,vt,2,3,"sh-toggle",15),S(11,St,2,1,"button",16),d()(),c(12,"div",17,2)(14,"sh-form-field"),w(15,1,["ngProjectAs","label",5,["label"]]),w(16,2,["ngProjectAs","input",5,["input"]]),d()(),S(17,Ft,17,6,"sh-dialog",18)),e&2){let i=re(7);F(n.multiSelect()?-1:0),h(),y("hidden",n.pathDiscoveryMethod()!=="browse"),h(2),y("visualize-accepted",n.accepts()),h(2),F(n.isLoading()?5:-1),h(3),O("ngTemplateOutlet",i)("ngTemplateOutletContext",Q(15,ze,Q(13,ot,n.treeStructure()))),h(2),F(!n.accepts()&&!n.isByBackupSettings()?10:-1),h(),F(n.enableCreateFolder()?11:-1),h(),y("hidden",n.pathDiscoveryMethod()!=="path"),h(5),F(n.createFolderDialogOpen()?17:-1)}},dependencies:[Ie,Re,ke,xe,te,Le,Ae,we,Fe,ee,U,Y,Z],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};export{Ye as a,Ze as b,Ge as c,ae as d};
1
+ import{a as We}from"./chunk-QBHHGHBJ.js";import{a as Ve}from"./chunk-AE7T2DAH.js";import{b as $e}from"./chunk-TC7HZO7D.js";import{A as Re,B as Ie,G as te,I as Le,K as Ae,O as Be,V as ke,a as Oe,c as U,e as Y,i as Z,k as ye,s as ee,u as xe,y as we,z as De}from"./chunk-TGNUULAU.js";import{ea as Fe}from"./chunk-NXROYR6L.js";import{$b as u,Ab as he,Ac as Me,B as ue,Bb as _e,Bc as Ne,Cb as O,Cc as Q,Db as c,Dc as ve,Eb as d,Fb as X,H as ie,Kc as Se,Lb as ne,Mb as L,Rc as D,Sa as h,Sc as R,Tb as ge,Ub as fe,Vb as A,Wb as me,Wc as se,Xb as Ce,Xc as C,Yc as le,Zb as x,_ as j,ac as q,bc as w,cb as J,ea as N,fa as v,gc as oe,hb as W,hc as Te,ic as re,jc as K,kc as y,n as ce,nc as b,oc as Ee,pa as P,pc as Pe,qc as be,r as H,sc as B,tc as k,ub as pe,uc as $,x as de,xb as S,yb as F}from"./chunk-ZBK64QS2.js";import{a as G,b as z}from"./chunk-EUDKD2JW.js";var qe=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Ke=["label","[prefix]","[suffix]"];function Qe(o,t){if(o&1&&b(0),o&2){let e=t.$implicit,i=u();be("",e.label,"",i.hasPerSecond()?"/s":"")}}var Ue=["throttle-upload","throttle-download"],Ye=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Ze=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},Ge=class o{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(Ye);readonly=P(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&Ue.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Ze(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Me([{provide:Oe,useExisting:o,multi:!0}])],ngContentSelectors:Ke,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(q(qe),c(0,"div",0),w(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),w(4,1),w(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(i.unit,r)||(i.unit=r),r}),d(),W(8,Qe,1,2,"ng-template"),d()),e&2&&(h(2),pe("readonly",i.readonly()||void 0),h(),O("id",i.customId()),B("ngModel",i.timespan),O("disabled",i.readonly()),h(3),K("--miw",0),O("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),h(),B("ngModel",i.unit))},dependencies:[Be,te,ee,U,ye,Y,Z],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var et=["treeContainer"],tt=["formRef"],it=[[["label"]],[["label"]],[["input"]]],nt=["label","label","input"],ot=o=>({children:o,level:0}),ze=o=>({$implicit:o}),rt=(o,t)=>({children:o,level:t}),st=()=>({maxWidth:"700px",width:"100%"}),lt=(o,t)=>t.id;function at(o,t){if(o&1){let e=L();c(0,"sh-button-group")(1,"button",19),x("click",function(){N(e);let n=u();return v(n.pathDiscoveryMethod.set("browse"))}),A(2,4),d(),c(3,"button",19),x("click",function(){N(e);let n=u();return v(n.pathDiscoveryMethod.set("path"))}),A(4,5),d()()}if(o&2){let e=u();h(),y("active",e.pathDiscoveryMethod()==="browse"),h(2),y("active",e.pathDiscoveryMethod()==="path")}}function ct(o,t){o&1&&X(0,"sh-progress-bar",12)}function dt(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-down"),d())}function ut(o,t){o&1&&X(0,"sh-icon",24)}function pt(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-right"),d())}function ht(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-open"),d())}function _t(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-user"),d())}function gt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"file"),d())}function ft(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder"),d())}function mt(o,t){if(o&1&&(S(0,dt,2,0,"sh-icon",24)(1,ut,1,0,"sh-icon",24)(2,pt,2,0,"sh-icon",24),S(3,ht,2,0,"sh-icon",22)(4,_t,2,0,"sh-icon",22)(5,gt,2,0,"sh-icon",22)(6,ft,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;F(e.children.length?0:e.cls==="file"?1:2),h(3),F(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Ct(o,t){o&1&&(c(0,"sh-icon",22),b(1,"desktop-tower"),d())}function Tt(o,t){o&1&&ne(0)}function Et(o,t){if(o&1&&W(0,Tt,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=re(7);O("ngTemplateOutlet",n)("ngTemplateOutletContext",Q(5,ze,ve(2,rt,e.children,i.level+1)))}}function Pt(o,t){if(o&1){let e=L();c(0,"div",20,3),x("click",function(){N(e);let n=u().$implicit,r=u(2);return v(r.toggleNode(n.id,n))}),c(2,"div",21),S(3,mt,7,2)(4,Ct,2,0,"sh-icon",22),d(),c(5,"div",23),x("click",function(n){N(e);let r=u().$implicit,a=u(2);return v(a.toggleSelectedNode(n,r))}),b(6),d()(),S(7,Et,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();y("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),h(2),y("file",e.cls==="file"),h(),F(e.id!=="/"?3:4),h(3),Pe(" ",e.text," "),h(),F(e.children.length>0?7:-1)}}function bt(o,t){if(o&1&&S(0,Pt,8,17),o&2){let e=t.$implicit,i=u(2);F(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Mt(o,t){if(o&1&&(c(0,"sh-list"),he(1,bt,1,1,null,null,lt),d()),o&2){let e=t.$implicit;K("padding-left",e.level*.25,"rem"),h(),_e(e.children)}}function Nt(o,t){o&1&&ne(0)}function vt(o,t){if(o&1){let e=L();c(0,"sh-toggle",25),x("click",function(){N(e);let n=u();return v(n._showHiddenNodes.set(!n._showHiddenNodes()))}),A(1,6),d()}if(o&2){let e=u();y("active",e._showHiddenNodes()),h(),me(e.showFiles()?"files":"folders"),Ce(1)}}function St(o,t){if(o&1){let e=L();c(0,"button",26),x("click",function(){N(e);let n=u();return v(n.openCreateFolderDialog())}),A(1,7),d()}if(o&2){let e=u();O("disabled",!e.isCurrentPathFolder())}}function Ft(o,t){if(o&1){let e=L();c(0,"sh-dialog",27),$("isOpenChange",function(n){N(e);let r=u();return k(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),v(n)}),c(1,"header",28)(2,"h2"),A(3,8),d()(),c(4,"div",29)(5,"div"),b(6," Folder will be created under "),c(7,"pre"),b(8),d()(),c(9,"sh-form-field")(10,"textarea",30),$("ngModelChange",function(n){N(e);let r=u();return k(r.createFolderPath,n)||(r.createFolderPath=n),v(n)}),d()()(),c(11,"footer",31)(12,"button",32),x("click",function(){N(e);let n=u();return v(n.closeCreateFolderDialog(!1))}),b(13,"Cancel"),d(),c(14,"button",33),x("click",function(){N(e);let n=u();return v(n.closeCreateFolderDialog(!0))}),ge(15,9),X(16,"sh-icon"),fe(),d()()()}if(o&2){let e,i=u();B("isOpen",i.createFolderDialogOpen),O("options",Ne(5,st)),h(8),Ee(i.currentPath()),h(2),B("ngModel",i.createFolderPath),h(4),O("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var He=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(He||{}),M="/",ae=class o{#t=j($e);#n=j(Ve);#c=j(De);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);includes=se();excludes=se();_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=le("treeContainer");formRef=le("formRef");pathDiscoveryMethod=P("browse");isLoading=P(!1);currentPath=P("/");#o=P(null);treeSearchQuery=P("");treeNodes=P([]);pathDelimiter=D(()=>this.#n.systemInfo()?.DirectorySeparator??"");filterGroups=this.#n.filterGroups();isByBackupSettings=D(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=D(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=He;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),i=structuredClone(e);for(let l=0;l<i.length;l++){let m=i[l].slice(1);if(m.startsWith("{")&&m.endsWith("}")){let _=m.slice(1,-1),g=this.filterGroups?.FilterGroups[_];if(g&&g.length){let T=g.map(E=>`-${E}`);i.splice(l,1,...T)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),f=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let p=this.#r(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:p,isIndeterminate:!1,cls:this.#e(l,f)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let p=new Map;if(!l.id)return;let m=l.id;a&&(l.accepted=!0),p.set(m,l);let _=r.length>0?n.filter(g=>g.parentPath.startsWith(m)):n;for(let g of _){if(!g.id)continue;let T=g.id;if(!g.cls||p.has(T))continue;let E=p.get(g.parentPath),V=g.hidden===!0&&t?0:this.#r(i,T,g.cls,E),I=z(G({},g),{isIndeterminate:this.isIndeterminate(i,T),evalState:V,children:[]});a&&(I.accepted=this.matchAccepts(a,I)),p.set(T,I),E&&E.children.push(I)}return l}),s});#d(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#r(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),f=t.filter(p=>!p.startsWith("-")&&!p.startsWith("+")),s=t.filter(p=>p.startsWith("-")||p.startsWith("+")),l=this.multiSelect();if(f.length===0)return r;for(let p=0;p<f.length;p++){let m=f[p];if(e===m){r=1;break}if(!l||!this.#e(m,a))continue;if(e?.startsWith(m)){r=1;break}}if(s.length===0)return r;for(let p=0;p<s.length;p++){let m=s[p],_=m.slice(1),g=m.startsWith("-")?-1:1;if(this.#e(_,a)){if(i!=="folder")continue;if(e===_){r=g;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(i!=="folder")continue;let E=_.slice(1,-2);if(E==="")break;if(e?.includes(E+a)){r=g;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let E=_.slice(3,-7);if(new RegExp(E).test(e)){r=g;break}}if(_.startsWith("[")&&_.endsWith("]")){let E=_.slice(1,-1),V=this.translateCSharpRegex(E);if(new RegExp(`${V}`).test(e)){r=g;break}}if(_.startsWith("*.")){if(i!=="file"||_.replace("*.","").length===0)continue;if(this.#s(e,_,!0)){r=g;break}}if(_==="")continue;if(_===e){r=g;break}if(this.#s(e,_,!0)){r=g;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#u(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,M)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?M:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,f=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(f&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=f?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==M&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#d(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let f=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=f?f[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#c.open(We,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#u(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#p(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(H(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(H(n=>n.Files??[]))}}#a(t){return this.isByBackupSettings()?this.#h(t):this.#p(t)}#_(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,p)=>{let m=s.slice(0,p+1).join(e);m!==""&&(a.includes(m)||a.push(m))})}),this.isLoading.set(!0);let f=a.map(s=>this.#a(s).pipe(H(l=>({status:"success",value:l,url:s})),ue(l=>ce({status:"error",value:l,url:s}))));de(f).pipe(ie(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(m=>m.status==="success"),p=s.filter(m=>m.status==="error");this.treeNodes.update(m=>{let _=l.flatMap(T=>Array.isArray(T.value)?T.value.map(E=>z(G({},E),{parentPath:T.url})):[]),g=[...new Map([...m,..._].map(T=>[T.id,T])).values()];return this.#l(),this.hideShortcuts()?g.filter(T=>!T.id.startsWith("%")):g})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=M){let i=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ie(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(f=>f!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let f=r.map(l=>{let p=this.#e(l.id,i)?"folder":"file";return z(G({},l),{cls:p,parentPath:e})}),s=[...new Map([...a,...f].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(oe(i.treeContainerRef,et,5),oe(i.formRef,tt,5)),e&2&&Te(2)},hostVars:2,hostBindings:function(e,i){e&2&&y("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:nt,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(q(it),S(0,at,5,4,"sh-button-group"),c(1,"div",10),w(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,ct,1,0,"sh-progress-bar",12),W(6,Mt,3,2,"ng-template",null,1,Se)(8,Nt,1,0,"ng-container",13),d(),c(9,"div",14),S(10,vt,2,3,"sh-toggle",15),S(11,St,2,1,"button",16),d()(),c(12,"div",17,2)(14,"sh-form-field"),w(15,1,["ngProjectAs","label",5,["label"]]),w(16,2,["ngProjectAs","input",5,["input"]]),d()(),S(17,Ft,17,6,"sh-dialog",18)),e&2){let n=re(7);F(i.multiSelect()?-1:0),h(),y("hidden",i.pathDiscoveryMethod()!=="browse"),h(2),y("visualize-accepted",i.accepts()),h(2),F(i.isLoading()?5:-1),h(3),O("ngTemplateOutlet",n)("ngTemplateOutletContext",Q(15,ze,Q(13,ot,i.treeStructure()))),h(2),F(!i.accepts()&&!i.isByBackupSettings()?10:-1),h(),F(i.enableCreateFolder()?11:-1),h(),y("hidden",i.pathDiscoveryMethod()!=="path"),h(5),F(i.createFolderDialogOpen()?17:-1)}},dependencies:[Ie,Re,ke,xe,te,Le,Ae,we,Fe,ee,U,Y,Z],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};export{Ye as a,Ze as b,Ge as c,ae as d};
@@ -1 +1 @@
1
- import{a as v}from"./chunk-52VBZ35Q.js";import{h as C}from"./chunk-YPAJPRDF.js";import"./chunk-ZDBKQQ47.js";import"./chunk-AL7GMUVT.js";import"./chunk-AWXWGD4T.js";import"./chunk-OYO6MNWR.js";import"./chunk-GNJTDWT4.js";import"./chunk-AT6BXXSP.js";import{a as G}from"./chunk-KCVV72VV.js";import"./chunk-G3QBP5CU.js";import"./chunk-6Q6SSTBK.js";import"./chunk-HVB6ARTT.js";import"./chunk-FFL4DKFK.js";import"./chunk-POJT4MSX.js";import{b as h}from"./chunk-WJDMMKWE.js";import"./chunk-QSPA3G65.js";import"./chunk-AE7T2DAH.js";import"./chunk-XTFTWEJS.js";import"./chunk-SVQCV5AE.js";import{b as L}from"./chunk-TC7HZO7D.js";import{K as M,L as $,Q as I}from"./chunk-RAIB7LN4.js";import{b as N,c as O,e as B,f as b}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{$b as D,Ac as E,Cb as d,Db as s,Dc as _,Eb as u,F as f,Fb as r,Sa as n,Sc as k,Tb as c,Ub as p,_ as l,cb as R,nc as A,pc as P,xb as T,yb as g}from"./chunk-ZBK64QS2.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=D();n(),P("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=k(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=R({type:a,selectors:[["app-backup"]],features:[E([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),p(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),p(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),p(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),p(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),p(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",_(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
1
+ import{a as v}from"./chunk-ACZQPL4M.js";import{h as C}from"./chunk-2CWLIRUP.js";import"./chunk-5KMPTDRJ.js";import"./chunk-2DP4QU4T.js";import"./chunk-AWXWGD4T.js";import"./chunk-MPQNBRD5.js";import"./chunk-GNJTDWT4.js";import"./chunk-AT6BXXSP.js";import{a as G}from"./chunk-75C77QFK.js";import"./chunk-4Z72AON4.js";import"./chunk-6Q6SSTBK.js";import"./chunk-HVB6ARTT.js";import"./chunk-E6DCTQ34.js";import"./chunk-POJT4MSX.js";import{b as h}from"./chunk-WJDMMKWE.js";import"./chunk-QBHHGHBJ.js";import"./chunk-AE7T2DAH.js";import"./chunk-XTFTWEJS.js";import"./chunk-SVQCV5AE.js";import{b as L}from"./chunk-TC7HZO7D.js";import{K as M,L as $,Q as I}from"./chunk-TGNUULAU.js";import{b as N,c as O,e as B,f as b}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{$b as D,Ac as E,Cb as d,Db as s,Dc as p,Eb as u,F as f,Fb as r,Sa as n,Sc as k,Tb as c,Ub as _,_ as l,cb as R,nc as A,pc as P,xb as T,yb as g}from"./chunk-ZBK64QS2.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=D();n(),P("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=k(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=R({type:a,selectors:[["app-backup"]],features:[E([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),_(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),_(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),_(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),_(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),_(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",p(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
@@ -1 +1 @@
1
- import{d as M}from"./chunk-SVQCV5AE.js";import"./chunk-TC7HZO7D.js";import{B as P}from"./chunk-RAIB7LN4.js";import{e as E}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{Db as i,Eb as a,Gb as r,Hb as l,Ib as c,Sa as C,Vb as d,_ as u,ac as h,bc as m,cb as g,nc as T,xb as f,yb as O}from"./chunk-ZBK64QS2.js";import"./chunk-EUDKD2JW.js";var L=["*",[["","footer",""]]],v=["*","[footer]"],s=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-custom-card"]],ngContentSelectors:v,decls:11,vars:0,consts:[[1,"card"],["src","/assets/noise/auth-noise.svg",1,"noise"],[1,"header-title"],["src","/assets/duplicati/duplicati.svg","alt",""],[1,"bg"]],template:function(e,o){e&1&&(h(L),r(0,"div",0),c(1,"img",1),r(2,"header")(3,"div",2),c(4,"img",3),T(5," Duplicati "),l()(),r(6,"main"),m(7),r(8,"footer"),m(9,1),l()()(),c(10,"div",4))},styles:['[_nghost-%COMP%]{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;background-color:var(--base-2)}body.dark [_nghost-%COMP%] .card[_ngcontent-%COMP%]:before{background:radial-gradient(rgba(var(--primary-rgb-900),1),#0000 60%)}.card[_ngcontent-%COMP%]{max-width:30rem;width:100%;position:relative;z-index:100;background-color:var(--base-1);border-radius:var(--shape-5);box-shadow:var(--box-shadow-40);border:1px solid var(--base-3);overflow:hidden}.card[_ngcontent-%COMP%]:before{content:"";position:absolute;height:30rem;transform:translateY(-17.8125rem);left:0;right:0;z-index:-2;background:radial-gradient(rgb(from var(--primary-1) r g b/1),#0000 60%)}.card[_ngcontent-%COMP%] img.noise[_ngcontent-%COMP%]{position:absolute;height:30rem;width:100%;transform:translateY(-17.8125rem);left:0;right:0;z-index:-1;-webkit-mask-image:radial-gradient(#000,#0000 60%);mask-image:radial-gradient(#000,#0000 60%)}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 2rem 0;gap:.75rem;position:relative;z-index:10}.header-title[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;gap:.625rem}.header-title[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:1.75rem;filter:drop-shadow(0 2px 3px rgba(0,0,0,.3))}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:2rem;gap:2.5rem;position:relative;z-index:10}main[_ngcontent-%COMP%] footer[_ngcontent-%COMP%]{font:var(--paragraph-40);color:var(--base-9);text-align:center;text-wrap:balance}.bg[_ngcontent-%COMP%]{position:fixed;inset:0;width:100vw;height:100vh;background-image:url(/assets/backgrounds/base-bg.svg);background-size:cover;background-position:center;background-repeat:no-repeat}body.dark[_ngcontent-%COMP%] .bg[_ngcontent-%COMP%]{opacity:1}footer[_ngcontent-%COMP%]:empty{display:none}'],changeDetection:0})};function N(t,n){t&1&&(i(0,"h3"),d(1,0),a())}function y(t,n){t&1&&(i(0,"h3"),d(1,1),a(),i(2,"button",3),d(3,2),a())}var p=class t{#e=u(M);isLoggingOut=this.#e.isLoggingOut;ngOnInit(){this.#e.logout()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-logout"]],decls:3,vars:1,consts:()=>{let n;n=$localize`Logging out...`;let e;e=$localize`You have successfully logged out your being redirected to login page.`;let o;return o=$localize`Go to login page`,[n,e,o,["shButton","","routerLink","/",1,"raised","primary"]]},template:function(e,o){e&1&&(i(0,"app-custom-card"),f(1,N,2,0,"h3")(2,y,4,0),a()),e&2&&(C(),O(o.isLoggingOut()?1:2))},dependencies:[s,P,E],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{p as default};
1
+ import{d as M}from"./chunk-SVQCV5AE.js";import"./chunk-TC7HZO7D.js";import{B as P}from"./chunk-TGNUULAU.js";import{e as E}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{Db as i,Eb as a,Gb as r,Hb as l,Ib as c,Sa as C,Vb as d,_ as u,ac as h,bc as m,cb as g,nc as T,xb as f,yb as O}from"./chunk-ZBK64QS2.js";import"./chunk-EUDKD2JW.js";var L=["*",[["","footer",""]]],v=["*","[footer]"],s=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-custom-card"]],ngContentSelectors:v,decls:11,vars:0,consts:[[1,"card"],["src","/assets/noise/auth-noise.svg",1,"noise"],[1,"header-title"],["src","/assets/duplicati/duplicati.svg","alt",""],[1,"bg"]],template:function(e,o){e&1&&(h(L),r(0,"div",0),c(1,"img",1),r(2,"header")(3,"div",2),c(4,"img",3),T(5," Duplicati "),l()(),r(6,"main"),m(7),r(8,"footer"),m(9,1),l()()(),c(10,"div",4))},styles:['[_nghost-%COMP%]{height:100vh;width:100vw;display:flex;align-items:center;justify-content:center;background-color:var(--base-2)}body.dark [_nghost-%COMP%] .card[_ngcontent-%COMP%]:before{background:radial-gradient(rgba(var(--primary-rgb-900),1),#0000 60%)}.card[_ngcontent-%COMP%]{max-width:30rem;width:100%;position:relative;z-index:100;background-color:var(--base-1);border-radius:var(--shape-5);box-shadow:var(--box-shadow-40);border:1px solid var(--base-3);overflow:hidden}.card[_ngcontent-%COMP%]:before{content:"";position:absolute;height:30rem;transform:translateY(-17.8125rem);left:0;right:0;z-index:-2;background:radial-gradient(rgb(from var(--primary-1) r g b/1),#0000 60%)}.card[_ngcontent-%COMP%] img.noise[_ngcontent-%COMP%]{position:absolute;height:30rem;width:100%;transform:translateY(-17.8125rem);left:0;right:0;z-index:-1;-webkit-mask-image:radial-gradient(#000,#0000 60%);mask-image:radial-gradient(#000,#0000 60%)}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 2rem 0;gap:.75rem;position:relative;z-index:10}.header-title[_ngcontent-%COMP%]{font:var(--title-30);display:flex;align-items:center;gap:.625rem}.header-title[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{height:1.75rem;filter:drop-shadow(0 2px 3px rgba(0,0,0,.3))}main[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;padding:2rem;gap:2.5rem;position:relative;z-index:10}main[_ngcontent-%COMP%] footer[_ngcontent-%COMP%]{font:var(--paragraph-40);color:var(--base-9);text-align:center;text-wrap:balance}.bg[_ngcontent-%COMP%]{position:fixed;inset:0;width:100vw;height:100vh;background-image:url(/assets/backgrounds/base-bg.svg);background-size:cover;background-position:center;background-repeat:no-repeat}body.dark[_ngcontent-%COMP%] .bg[_ngcontent-%COMP%]{opacity:1}footer[_ngcontent-%COMP%]:empty{display:none}'],changeDetection:0})};function N(t,n){t&1&&(i(0,"h3"),d(1,0),a())}function y(t,n){t&1&&(i(0,"h3"),d(1,1),a(),i(2,"button",3),d(3,2),a())}var p=class t{#e=u(M);isLoggingOut=this.#e.isLoggingOut;ngOnInit(){this.#e.logout()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=g({type:t,selectors:[["app-logout"]],decls:3,vars:1,consts:()=>{let n;n=$localize`Logging out...`;let e;e=$localize`You have successfully logged out your being redirected to login page.`;let o;return o=$localize`Go to login page`,[n,e,o,["shButton","","routerLink","/",1,"raised","primary"]]},template:function(e,o){e&1&&(i(0,"app-custom-card"),f(1,N,2,0,"h3")(2,y,4,0),a()),e&2&&(C(),O(o.isLoggingOut()?1:2))},dependencies:[s,P,E],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{p as default};
@@ -1 +1 @@
1
- import{a as $e,b as He}from"./chunk-L34PDBPD.js";import{a as we}from"./chunk-EUVXYJ2O.js";import{a as J}from"./chunk-4HEWGBUJ.js";import"./chunk-OYO6MNWR.js";import{a as ve}from"./chunk-KCVV72VV.js";import"./chunk-G3QBP5CU.js";import"./chunk-6Q6SSTBK.js";import"./chunk-HVB6ARTT.js";import"./chunk-35ZUPRX7.js";import{a as be}from"./chunk-POJT4MSX.js";import"./chunk-WJDMMKWE.js";import"./chunk-QSPA3G65.js";import{a as Re}from"./chunk-AE7T2DAH.js";import{a as ye}from"./chunk-RIX6H2ZX.js";import"./chunk-XTFTWEJS.js";import{b as Ce,d as Ge}from"./chunk-SVQCV5AE.js";import{b as V}from"./chunk-TC7HZO7D.js";import{B as R,F as Pe,G as Ie,I as Le,P as De,X as Me,c as Te,d as me,e as he,i as Fe,r as Ee,s as Ae,t as Oe,u as M,w as Y,x as Ne,z as fe}from"./chunk-RAIB7LN4.js";import{c as pe,e as Se,f as ge}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{$b as c,Ab as te,Bb as ne,Bc as ce,Cb as O,Db as a,Eb as o,Fb as _,H as j,Jb as ie,Kb as oe,Mb as E,Rc as B,Sa as r,Sc as Q,Tb as g,Ub as C,Vb as f,Wc as ue,Yb as b,Yc as de,Zb as T,_ as S,_c as K,cb as D,ea as m,fa as h,gc as ae,hc as se,kc as U,mc as L,nc as u,oc as q,pa as A,pc as y,sc as $,tc as H,uc as w,vc as re,wc as le,xb as d,xc as x,yb as p,yc as _e,zb as ee}from"./chunk-ZBK64QS2.js";import{a as z,b as W}from"./chunk-EUDKD2JW.js";var Be=["scroller"];function Ye(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell-ringing"),o())}function Ve(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell"),o())}function Je(i,n){if(i&1&&_(0,"app-notification",8),i&2){c(2);let e=x(6);O("index",0)("notification",e.content)}}function Xe(i,n){if(i&1&&(a(0,"div",11),u(1),o()),i&2){c(3);let e=x(6);r(),y(" ",e.content.content," ")}}function ze(i,n){if(i&1&&(a(0,"sh-alert")(1,"div",10),u(2),o(),d(3,Xe,2,1,"div",11),o()),i&2){c(2);let e=x(6);L(e.content.type||"error"),r(2),q(e.content.title),r(),p(e.content.content?3:-1)}}function We(i,n){if(i&1&&(a(0,"div",6),d(1,Je,1,2,"app-notification",8)(2,ze,4,4,"sh-alert",9),o()),i&2){c();let e=x(6);r(),p(e.type==="notification"?1:2)}}function je(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,2),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleNotifications())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),_(9,"app-notifications"),o()()()()}}function qe(i,n){if(i&1&&(a(0,"div",20),u(1),o()),i&2){let e=c().$implicit;r(),y(" ",e.content," ")}}function Qe(i,n){if(i&1){let e=E();a(0,"sh-alert",18,1),T("click",function(){let s=m(e).$implicit,l=c(2);return h(l.deleteAlertByIndex(s.id))}),a(2,"div",19),u(3),o(),d(4,qe,2,1,"div",20),o()}if(i&2){let e=n.$implicit;L(e.type),O("id",e.id),r(3),q(e.title),r(),p(e.content?4:-1)}}function Ke(i,n){i&1&&(a(0,"p",17),f(1,4),o())}function Ze(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,3),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleAlerts())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),te(9,Qe,5,5,"sh-alert",16,ee,!1,Ke,2,0,"p",17),o()()()()}if(i&2){let e=c();r(9),ne(e.alertHistory())}}var xe=new Ee,k=class i{#e=S(Ne);#t=S(J);isSubmitting=A(!1);messageSent=A(!1);form=xe.group({message:xe.control("",[me.required])});notifications=this.#t.notifications;shownMessage=A(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=B(()=>this.alertHistory().filter(n=>n.isOpen).length);scroller=de("scroller");isAlertsOpen=K(!1);isNotificationsOpen=K(!1);previousHistoryCount=A(null);previousNotificationsCount=A(null);constructor(){Q(()=>{let n=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==n.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>W(z({},s),{countDown:s.countDown-1}))},1e3)):n.length&&this.previousHistoryCount()!==n.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:n[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>W(z({},s),{countDown:s.countDown-1}))},1e3))}),Q(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(n){this.#e.removeAlert(n)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ae(t.scroller,Be,5),e&2&&se()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let n;n=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],n,e,t,["shButton","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["ship-alert-title",""],["ship-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let s=E();a(0,"button",5),T("click",function(){return m(s),h(t.toggleAlerts())}),a(1,"sh-icon"),u(2,"info"),o()(),a(3,"button",5),T("click",function(){return m(s),h(t.toggleNotifications())}),d(4,Ye,2,0,"sh-icon")(5,Ve,2,0,"sh-icon"),o(),re(6),d(7,We,3,1,"div",6),d(8,je,10,0,"div",7),d(9,Ze,12,1,"div",7)}if(e&2){L(t.alertHistory().length?"error":""),r(3),L(t.notifications().length?"error":""),r(),p(t.notifications().length?4:5),r(2);let s=le(t.shownMessage());r(),p(s?7:-1),r(),p(t.isNotificationsOpen()?8:-1),r(),p(t.isAlertsOpen()?9:-1)}},dependencies:[Oe,Y,M,R,He,$e],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width: 768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function et(i,n){i&1&&(a(0,"sh-icon",14),u(1,"check"),o())}function tt(i,n){i&1&&(a(0,"sh-icon",15),u(1,"prohibit"),o())}function nt(i,n){if(i&1){let e=E();a(0,"button",20),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,5),o()}if(i&2){let e=c();U("loader",e.isUpdating())}}function it(i,n){if(i&1){let e=E();a(0,"button",21),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,6),o()}if(i&2){let e=c();U("loader",e.isUpdating()),O("disabled",!0)}}var X=class i{#e=S(V);closed=ue();isUpdating=A(!1);passphrase=A("");repeatPassphrase=A("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(j(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(j(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let n;n=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let s;s=$localize`Change passphrase`;let l;l=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,l=b(l);let P;P=$localize`Passphrase`;let I;I=$localize`Repeat passphrase`;let G;G=$localize`Not now thanks`;let v;v=$localize` Yes, update passphrase now `;let F;return F=$localize` Yes, update passphrase now `,[s,l,P,I,G,v,F,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",n,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",t,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(a(0,"header",7)(1,"h3"),f(2,0),o()(),a(3,"div",8)(4,"sh-alert",9),g(5,1),_(6,"br")(7,"br"),C(),o(),a(8,"sh-form-field")(9,"label",10),f(10,2),o(),a(11,"input",11),w("ngModelChange",function(l){return H(t.passphrase,l)||(t.passphrase=l),l}),o()(),a(12,"sh-form-field")(13,"label",12),f(14,3),o(),a(15,"input",13),w("ngModelChange",function(l){return H(t.repeatPassphrase,l)||(t.repeatPassphrase=l),l}),o(),d(16,et,2,0,"sh-icon",14)(17,tt,2,0,"sh-icon",15),o()(),a(18,"footer",16)(19,"button",17),T("click",function(){return t.cancel()}),f(20,4),o(),d(21,nt,2,2,"button",18)(22,it,2,3,"button",19),o()),e&2&&(r(11),$("ngModel",t.passphrase),r(4),O("disabled",t.passphrase().length===0),$("ngModel",t.repeatPassphrase),r(),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),U("loader",t.isUpdating()),r(2),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Ae,Te,he,Fe,Y,Ie,M,Me,R],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var ot=()=>({exact:!0});function at(i,n){i&1&&(a(0,"sh-icon",26),u(1,"x-bold"),o())}function st(i,n){i&1&&(a(0,"sh-icon",27),u(1,"list-bold"),o())}function rt(i,n){if(i&1){let e=E();ie(0,10),a(1,"button",25),T("click",function(){m(e);let s=c();return h(s.toggleNav())}),d(2,at,2,0,"sh-icon",26)(3,st,2,0,"sh-icon",27),o(),oe()}if(i&2){let e=c();r(2),p(e.isNavOpen()?2:3)}}function lt(i,n){i&1&&(a(0,"sh-icon"),u(1,"sun"),o())}function _t(i,n){i&1&&(a(0,"sh-icon"),u(1,"moon"),o())}function ct(i,n){if(i&1){let e=E();a(0,"button",28),T("click",function(){m(e);let s=c();return h(s.changeDefaultClientTo("ngax"))}),g(1,7),_(2,"sh-icon"),C(),o(),a(3,"button",28),T("click",function(){m(e);let s=c();return h(s.logout())}),g(4,8),_(5,"sh-icon"),C(),o()}}var Z=class i{#e=S(we);#t=S(V);#i=S(ve);#o=S(Ce);#a=S(fe);#s=S(J);#r=S(Ge);#l=S(be);#n=S(Re);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;sidenavType=this.#e.sidenavType;machineName=B(()=>{let n=this.#l.serverSettings();if(n&&n["--machine-name"])return n["--machine-name"];if(n&&n["machine-name"])return n["machine-name"];let e=this.#n.allOptions().find(t=>t.name==="machine-name");return e&&e.defaultValue?e.defaultValue:this.#n.systemInfo()?.MachineName??"Unknown"});ngOnInit(){return this.#s.init(),this.#i.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:n=>{let e=n["autogenerated-passphrase"]==="True",t=n["has-asked-for-password-change"]==="True";e&&!t&&this.#a.open(X,{maxWidth:"500px"})}})}toggleNav(){this.#e.toggleNav()}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(n){this.#_(n),window.location.replace(`/${n}`)}logout(){this.#r.logout()}#_(n){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+n+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-layout"]],decls:43,vars:12,consts:()=>{let n;n=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:house${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Home `;let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Add backup `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let s;s=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SH_ICON:gear${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SH_ICON: Settings `;let l;l=$localize`${"\uFFFD#32\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#32\uFFFD"}:CLOSE_TAG_SH_ICON: About Duplicati `;let P;P=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SH_ICON:files${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON: Documentation ${"\uFFFD#36\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON:`,P=b(P);let I;I=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:chats-circle${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON: Visit forum ${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON:`,I=b(I);let G;G=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skip-back${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Use old UI `;let v;return v=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:sign-out${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Log out `,[n,e,t,s,l,P,I,G,v,[3,"isOpenChange","isOpen","disableDrag"],["sidenav-closed-topbar",""],["sidenav",""],["shButton","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],["action","",1,"machine-name",3,"title"],[1,"spacer"],[1,"base-1l","primary"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["shButton","",1,"small","toggle-sidebar",3,"click"],[1,"cross"],[1,"burger"],["action","",3,"click"]]},template:function(e,t){e&1&&(a(0,"sh-sidenav",9),w("isOpenChange",function(l){return H(t.isNavOpen,l)||(t.isNavOpen=l),l}),d(1,rt,4,1,"ng-container",10),a(2,"div",11)(3,"header"),_(4,"app-logo"),a(5,"button",12),T("click",function(){return t.toggleBodyClass()}),d(6,lt,2,0,"sh-icon")(7,_t,2,0,"sh-icon"),o()(),a(8,"sh-list",13)(9,"button",14),g(10,0),_(11,"sh-icon"),C(),o(),a(12,"button",15),g(13,1),_(14,"sh-icon"),C(),o(),a(15,"button",16),g(16,2),_(17,"sh-icon"),C(),o(),a(18,"button",17),g(19,3),_(20,"sh-icon"),C(),o(),_(21,"sh-divider"),a(22,"div",18)(23,"sh-icon"),u(24,"desktop"),o(),u(25),o()(),_(26,"div",19),a(27,"sh-list",20),d(28,ct,6,0),_(29,"sh-divider"),a(30,"button",21),g(31,4),_(32,"sh-icon"),C(),o(),a(33,"a",22),g(34,5),_(35,"sh-icon")(36,"sh-icon",23),C(),o(),a(37,"a",24),g(38,6),_(39,"sh-icon")(40,"sh-icon",23),C(),o()()(),_(41,"router-outlet")(42,"app-service-hub"),o()),e&2&&(L(t.sidenavType()),$("isOpen",t.isNavOpen),O("disableDrag",!0),r(),p(t.isMobile()?1:-1),r(5),p(t.isDarkMode()?6:7),r(3),O("routerLinkActiveOptions",ce(11,ot)),r(13),O("title",_e(t.machineName())),r(3),y(" ",t.machineName()," "),r(3),p(t.relayIsEnabled()?-1:28))},dependencies:[pe,Se,ge,De,M,Le,R,Pe,k,ye],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}.toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{position:absolute;inset:auto}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}.machine-name[_ngcontent-%COMP%]{margin:0;cursor:default}"],changeDetection:0})};export{Z as default};
1
+ import{a as $e,b as He}from"./chunk-465L4ZG5.js";import{a as we}from"./chunk-EUVXYJ2O.js";import{a as J}from"./chunk-OHP7HLY2.js";import"./chunk-MPQNBRD5.js";import{a as ve}from"./chunk-75C77QFK.js";import"./chunk-4Z72AON4.js";import"./chunk-6Q6SSTBK.js";import"./chunk-HVB6ARTT.js";import"./chunk-35ZUPRX7.js";import{a as be}from"./chunk-POJT4MSX.js";import"./chunk-WJDMMKWE.js";import"./chunk-QBHHGHBJ.js";import{a as Re}from"./chunk-AE7T2DAH.js";import{a as ye}from"./chunk-RIX6H2ZX.js";import"./chunk-XTFTWEJS.js";import{b as Ce,d as Ge}from"./chunk-SVQCV5AE.js";import{b as V}from"./chunk-TC7HZO7D.js";import{B as R,F as Pe,G as Ie,I as Le,P as De,X as Me,c as Te,d as me,e as he,i as Fe,r as Ee,s as Ae,t as Oe,u as M,w as Y,x as Ne,z as fe}from"./chunk-TGNUULAU.js";import{c as pe,e as Se,f as ge}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{$b as c,Ab as te,Bb as ne,Bc as ce,Cb as O,Db as a,Eb as o,Fb as _,H as j,Jb as ie,Kb as oe,Mb as E,Rc as B,Sa as r,Sc as Q,Tb as g,Ub as C,Vb as f,Wc as ue,Yb as b,Yc as de,Zb as T,_ as S,_c as K,cb as D,ea as m,fa as h,gc as ae,hc as se,kc as U,mc as L,nc as u,oc as q,pa as A,pc as y,sc as $,tc as H,uc as w,vc as re,wc as le,xb as d,xc as x,yb as p,yc as _e,zb as ee}from"./chunk-ZBK64QS2.js";import{a as z,b as W}from"./chunk-EUDKD2JW.js";var Be=["scroller"];function Ye(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell-ringing"),o())}function Ve(i,n){i&1&&(a(0,"sh-icon"),u(1,"bell"),o())}function Je(i,n){if(i&1&&_(0,"app-notification",8),i&2){c(2);let e=x(6);O("index",0)("notification",e.content)}}function Xe(i,n){if(i&1&&(a(0,"div",11),u(1),o()),i&2){c(3);let e=x(6);r(),y(" ",e.content.content," ")}}function ze(i,n){if(i&1&&(a(0,"sh-alert")(1,"div",10),u(2),o(),d(3,Xe,2,1,"div",11),o()),i&2){c(2);let e=x(6);L(e.content.type||"error"),r(2),q(e.content.title),r(),p(e.content.content?3:-1)}}function We(i,n){if(i&1&&(a(0,"div",6),d(1,Je,1,2,"app-notification",8)(2,ze,4,4,"sh-alert",9),o()),i&2){c();let e=x(6);r(),p(e.type==="notification"?1:2)}}function je(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,2),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleNotifications())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),_(9,"app-notifications"),o()()()()}}function qe(i,n){if(i&1&&(a(0,"div",20),u(1),o()),i&2){let e=c().$implicit;r(),y(" ",e.content," ")}}function Qe(i,n){if(i&1){let e=E();a(0,"sh-alert",18,1),T("click",function(){let s=m(e).$implicit,l=c(2);return h(l.deleteAlertByIndex(s.id))}),a(2,"div",19),u(3),o(),d(4,qe,2,1,"div",20),o()}if(i&2){let e=n.$implicit;L(e.type),O("id",e.id),r(3),q(e.title),r(),p(e.content?4:-1)}}function Ke(i,n){i&1&&(a(0,"p",17),f(1,4),o())}function Ze(i,n){if(i&1){let e=E();a(0,"div",7)(1,"div",12)(2,"h6",13),g(3,3),a(4,"button",5),T("click",function(){m(e);let s=c();return h(s.toggleAlerts())}),_(5,"sh-icon"),o(),C(),o(),a(6,"div",14,0)(8,"div",15),te(9,Qe,5,5,"sh-alert",16,ee,!1,Ke,2,0,"p",17),o()()()()}if(i&2){let e=c();r(9),ne(e.alertHistory())}}var xe=new Ee,k=class i{#e=S(Ne);#t=S(J);isSubmitting=A(!1);messageSent=A(!1);form=xe.group({message:xe.control("",[me.required])});notifications=this.#t.notifications;shownMessage=A(null);shownMessageInterval=null;alertHistory=this.#e.alertHistory;alertHistoryIsOpen=this.#e.alertHistoryIsOpen;alertHistoryIsHidden=this.#e.alertHistoryIsHidden;numberOfOpenAlerts=B(()=>this.alertHistory().filter(n=>n.isOpen).length);scroller=de("scroller");isAlertsOpen=K(!1);isNotificationsOpen=K(!1);previousHistoryCount=A(null);previousNotificationsCount=A(null);constructor(){Q(()=>{let n=this.alertHistory(),e=this.notifications();if(e.length===0){this.shownMessage.set(null);return}e.length&&this.previousHistoryCount()!==n.length&&!this.isNotificationsOpen()?(this.shownMessage.set({content:e[0],countDown:3,type:"notification"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>W(z({},s),{countDown:s.countDown-1}))},1e3)):n.length&&this.previousHistoryCount()!==n.length&&!this.isAlertsOpen()&&(this.shownMessage.set({content:n[0],countDown:3,type:"alert"}),this.previousHistoryCount.set(n.length),this.shownMessageInterval=setInterval(()=>{let t=this.shownMessage();if(t?.countDown===0){this.shownMessage.set(null),this.shownMessageInterval=null;return}t!==null&&this.shownMessage.update(s=>W(z({},s),{countDown:s.countDown-1}))},1e3))}),Q(()=>{this.alertHistoryIsOpen(),this.scrollToBottom()})}resetPreviewMessage(){this.shownMessage.set(null),this.shownMessageInterval=null}toggleAlerts(){this.isAlertsOpen()?this.isAlertsOpen.set(!1):(this.isAlertsOpen.set(!0),this.isNotificationsOpen.set(!1),this.resetPreviewMessage())}toggleNotifications(){this.isNotificationsOpen.set(!this.isNotificationsOpen()),this.isAlertsOpen()&&this.isAlertsOpen.set(!1)}deleteAlertByIndex(n){this.#e.removeAlert(n)}scrollToBottom(){this.scroller()&&this.scroller()?.nativeElement&&this.scroller().nativeElement.scrollTo(0,this.scroller().nativeElement.scrollHeight)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-service-hub"]],viewQuery:function(e,t){e&1&&ae(t.scroller,Be,5),e&2&&se()},inputs:{isAlertsOpen:[1,"isAlertsOpen"],isNotificationsOpen:[1,"isNotificationsOpen"]},outputs:{isAlertsOpen:"isAlertsOpenChange",isNotificationsOpen:"isNotificationsOpenChange"},decls:10,vars:9,consts:()=>{let n;n=$localize` Notifications ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize` Alerts ${"\uFFFD#4\uFFFD"}:START_TAG_BUTTON:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_BUTTON:`;let t;return t=$localize`No alerts yet`,[["scroller",""],["alerts",""],n,e,t,["shButton","",3,"click"],[1,"preview-alert-wrap"],[1,"alert-stream-modal"],[3,"index","notification"],[3,"class"],["ship-alert-title",""],["ship-alert-content",""],[1,"alert-stream-modal-content"],[1,"paragraph-20"],[1,"alert-stream-modal-list-scroller"],[1,"alert-stream-modal-list"],[3,"class","id"],[1,"no-alerts"],[3,"click","id"],["title",""],["content",""]]},template:function(e,t){if(e&1){let s=E();a(0,"button",5),T("click",function(){return m(s),h(t.toggleAlerts())}),a(1,"sh-icon"),u(2,"info"),o()(),a(3,"button",5),T("click",function(){return m(s),h(t.toggleNotifications())}),d(4,Ye,2,0,"sh-icon")(5,Ve,2,0,"sh-icon"),o(),re(6),d(7,We,3,1,"div",6),d(8,je,10,0,"div",7),d(9,Ze,12,1,"div",7)}if(e&2){L(t.alertHistory().length?"error":""),r(3),L(t.notifications().length?"error":""),r(),p(t.notifications().length?4:5),r(2);let s=le(t.shownMessage());r(),p(s?7:-1),r(),p(t.isNotificationsOpen()?8:-1),r(),p(t.isAlertsOpen()?9:-1)}},dependencies:[Oe,Y,M,R,He,$e],styles:["[_nghost-%COMP%]{display:flex;position:fixed;gap:.5rem;bottom:1.5rem;right:1.5rem;z-index:5000}@media only screen and (max-width: 768px){[_nghost-%COMP%]{bottom:1rem;right:1rem}}[_nghost-%COMP%] h6[_ngcontent-%COMP%]{margin:0}.preview-alert-wrap[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column;min-width:15.625rem}.helpdesk-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.helpdesk-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.helpdesk-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;gap:1rem;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.helpdesk-modal-content[_ngcontent-%COMP%] .message-sent[_ngcontent-%COMP%]{padding:0 1rem 1rem;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{padding:0 1rem 1rem;display:flex;flex-direction:column;align-items:flex-end;gap:1rem}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{width:100%;text-wrap:pretty}.helpdesk-modal-content[_ngcontent-%COMP%] form[_ngcontent-%COMP%] mat-form-field[_ngcontent-%COMP%]{width:100%}.alert-stream-modal[_ngcontent-%COMP%]{position:absolute;bottom:2.6875rem;right:0;display:flex;flex-direction:column}@media only screen and (max-width: 768px){.alert-stream-modal[_ngcontent-%COMP%]{bottom:2.6875rem}}.alert-stream-modal-list-scroller[_ngcontent-%COMP%]{overflow-y:auto;max-height:18.75rem}.alert-stream-modal-list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:1rem;border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;min-width:20rem;border:1px solid var(--base-4);background-color:var(--base-1);border-radius:var(--shape-2)}.alert-stream-modal-content[_ngcontent-%COMP%] h6[_ngcontent-%COMP%]{padding:1rem;border-bottom:1px solid var(--base-4);display:flex;align-items:center;justify-content:space-between}.no-alerts[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};function et(i,n){i&1&&(a(0,"sh-icon",14),u(1,"check"),o())}function tt(i,n){i&1&&(a(0,"sh-icon",15),u(1,"prohibit"),o())}function nt(i,n){if(i&1){let e=E();a(0,"button",20),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,5),o()}if(i&2){let e=c();U("loader",e.isUpdating())}}function it(i,n){if(i&1){let e=E();a(0,"button",21),T("click",function(){m(e);let s=c();return h(s.updatePassphrase())}),f(1,6),o()}if(i&2){let e=c();U("loader",e.isUpdating()),O("disabled",!0)}}var X=class i{#e=S(V);closed=ue();isUpdating=A(!1);passphrase=A("");repeatPassphrase=A("");updatePassphrase(){this.passphrase()===this.repeatPassphrase()&&(this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"server-passphrase":this.passphrase()}}).pipe(j(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()}))}cancel(){this.isUpdating.set(!0),this.#e.patchApiV1Serversettings({requestBody:{"has-asked-for-password-change":"True"}}).pipe(j(()=>this.isUpdating.set(!1))).subscribe({next:()=>this.closed.emit()})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-change-passphrase-alert-dialog"]],outputs:{closed:"closed"},decls:23,vars:7,consts:()=>{let n;n=$localize`Enter new password`;let e;e=$localize`Repeat password`;let t;t=$localize`Password have to be filled and have to match`;let s;s=$localize`Change passphrase`;let l;l=$localize` Duplicati needs to be secured with a passphrase and a random passphrase has been generated for you. ${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK:${"[\uFFFD#6\uFFFD\uFFFD/#6\uFFFD|\uFFFD#7\uFFFD\uFFFD/#7\uFFFD]"}:LINE_BREAK: If you open Duplicati from the tray icon, you do not need a passphrase, but if you plan to open it from another location you need to set a passphrase you know. Do you want to set a passphrase now? `,l=b(l);let P;P=$localize`Passphrase`;let I;I=$localize`Repeat passphrase`;let G;G=$localize`Not now thanks`;let v;v=$localize` Yes, update passphrase now `;let F;return F=$localize` Yes, update passphrase now `,[s,l,P,I,G,v,F,["header",""],["content",""],["type","warning"],["for","password"],["type","password","name","password","autocomplete","disabled","placeholder",n,"tabindex","1",3,"ngModelChange","ngModel"],["for","repeatPassword"],["type","password","name","repeatPassword","autocomplete","disabled","placeholder",e,"tabindex","2",3,"ngModelChange","disabled","ngModel"],["suffix","",1,"sh-success"],["suffix",""],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"loader"],["shButton","","shTooltip",t,1,"raised","primary",3,"loader","disabled"],["shButton","",1,"raised","primary",3,"click"],["shButton","","shTooltip",t,1,"raised","primary",3,"click","disabled"]]},template:function(e,t){e&1&&(a(0,"header",7)(1,"h3"),f(2,0),o()(),a(3,"div",8)(4,"sh-alert",9),g(5,1),_(6,"br")(7,"br"),C(),o(),a(8,"sh-form-field")(9,"label",10),f(10,2),o(),a(11,"input",11),w("ngModelChange",function(l){return H(t.passphrase,l)||(t.passphrase=l),l}),o()(),a(12,"sh-form-field")(13,"label",12),f(14,3),o(),a(15,"input",13),w("ngModelChange",function(l){return H(t.repeatPassphrase,l)||(t.repeatPassphrase=l),l}),o(),d(16,et,2,0,"sh-icon",14)(17,tt,2,0,"sh-icon",15),o()(),a(18,"footer",16)(19,"button",17),T("click",function(){return t.cancel()}),f(20,4),o(),d(21,nt,2,2,"button",18)(22,it,2,3,"button",19),o()),e&2&&(r(11),$("ngModel",t.passphrase),r(4),O("disabled",t.passphrase().length===0),$("ngModel",t.repeatPassphrase),r(),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?16:17),r(3),U("loader",t.isUpdating()),r(2),p(t.passphrase().length!==0&&t.passphrase()===t.repeatPassphrase()?21:22))},dependencies:[Ae,Te,he,Fe,Y,Ie,M,Me,R],styles:["[_nghost-%COMP%]{display:block;--dialog-p: 1.5rem}[content][_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}"],changeDetection:0})};var ot=()=>({exact:!0});function at(i,n){i&1&&(a(0,"sh-icon",26),u(1,"x-bold"),o())}function st(i,n){i&1&&(a(0,"sh-icon",27),u(1,"list-bold"),o())}function rt(i,n){if(i&1){let e=E();ie(0,10),a(1,"button",25),T("click",function(){m(e);let s=c();return h(s.toggleNav())}),d(2,at,2,0,"sh-icon",26)(3,st,2,0,"sh-icon",27),o(),oe()}if(i&2){let e=c();r(2),p(e.isNavOpen()?2:3)}}function lt(i,n){i&1&&(a(0,"sh-icon"),u(1,"sun"),o())}function _t(i,n){i&1&&(a(0,"sh-icon"),u(1,"moon"),o())}function ct(i,n){if(i&1){let e=E();a(0,"button",28),T("click",function(){m(e);let s=c();return h(s.changeDefaultClientTo("ngax"))}),g(1,7),_(2,"sh-icon"),C(),o(),a(3,"button",28),T("click",function(){m(e);let s=c();return h(s.logout())}),g(4,8),_(5,"sh-icon"),C(),o()}}var Z=class i{#e=S(we);#t=S(V);#i=S(ve);#o=S(Ce);#a=S(fe);#s=S(J);#r=S(Ge);#l=S(be);#n=S(Re);relayIsEnabled=this.#o.relayIsEnabled;isDarkMode=this.#e.isDarkMode;isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;sidenavType=this.#e.sidenavType;machineName=B(()=>{let n=this.#l.serverSettings();if(n&&n["--machine-name"])return n["--machine-name"];if(n&&n["machine-name"])return n["machine-name"];let e=this.#n.allOptions().find(t=>t.name==="machine-name");return e&&e.defaultValue?e.defaultValue:this.#n.systemInfo()?.MachineName??"Unknown"});ngOnInit(){return this.#s.init(),this.#i.getBackups(!0),this.#t.getApiV1Serversettings().subscribe({next:n=>{let e=n["autogenerated-passphrase"]==="True",t=n["has-asked-for-password-change"]==="True";e&&!t&&this.#a.open(X,{maxWidth:"500px"})}})}toggleNav(){this.#e.toggleNav()}toggleBodyClass(){this.#e.toggleBodyClass()}changeDefaultClientTo(n){this.#_(n),window.location.replace(`/${n}`)}logout(){this.#r.logout()}#_(n){var e=new Date;e.setTime(e.getTime()+2160*60*60*1e3),document.cookie="default-client="+n+"; expires="+e.toUTCString()+"; path=/"}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=D({type:i,selectors:[["app-layout"]],decls:43,vars:12,consts:()=>{let n;n=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:house${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Home `;let e;e=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Add backup `;let t;t=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let s;s=$localize`${"\uFFFD#20\uFFFD"}:START_TAG_SH_ICON:gear${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SH_ICON: Settings `;let l;l=$localize`${"\uFFFD#32\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#32\uFFFD"}:CLOSE_TAG_SH_ICON: About Duplicati `;let P;P=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SH_ICON:files${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON: Documentation ${"\uFFFD#36\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#35\uFFFD|\uFFFD/#36\uFFFD]"}:CLOSE_TAG_SH_ICON:`,P=b(P);let I;I=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:chats-circle${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON: Visit forum ${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON_1:arrow-square-out${"[\uFFFD/#39\uFFFD|\uFFFD/#40\uFFFD]"}:CLOSE_TAG_SH_ICON:`,I=b(I);let G;G=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skip-back${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Use old UI `;let v;return v=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:sign-out${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Log out `,[n,e,t,s,l,P,I,G,v,[3,"isOpenChange","isOpen","disableDrag"],["sidenav-closed-topbar",""],["sidenav",""],["shButton","",1,"icon","small",3,"click"],[1,"base-1","primary"],["action","","routerLink","/","routerLinkActive","active",3,"routerLinkActiveOptions"],["action","","routerLink","/add-backup","routerLinkActive","active"],["action","","routerLink","/restore","routerLinkActive","active"],["action","","routerLink","/settings","routerLinkActive","active"],["action","",1,"machine-name",3,"title"],[1,"spacer"],[1,"base-1l","primary"],["action","","routerLink","/about","routerLinkActive","active"],["href","https://docs.duplicati.com","target","_blank","action",""],["suffix",""],["href","https://forum.duplicati.com","target","_blank","action",""],["shButton","",1,"small","toggle-sidebar",3,"click"],[1,"cross"],[1,"burger"],["action","",3,"click"]]},template:function(e,t){e&1&&(a(0,"sh-sidenav",9),w("isOpenChange",function(l){return H(t.isNavOpen,l)||(t.isNavOpen=l),l}),d(1,rt,4,1,"ng-container",10),a(2,"div",11)(3,"header"),_(4,"app-logo"),a(5,"button",12),T("click",function(){return t.toggleBodyClass()}),d(6,lt,2,0,"sh-icon")(7,_t,2,0,"sh-icon"),o()(),a(8,"sh-list",13)(9,"button",14),g(10,0),_(11,"sh-icon"),C(),o(),a(12,"button",15),g(13,1),_(14,"sh-icon"),C(),o(),a(15,"button",16),g(16,2),_(17,"sh-icon"),C(),o(),a(18,"button",17),g(19,3),_(20,"sh-icon"),C(),o(),_(21,"sh-divider"),a(22,"div",18)(23,"sh-icon"),u(24,"desktop"),o(),u(25),o()(),_(26,"div",19),a(27,"sh-list",20),d(28,ct,6,0),_(29,"sh-divider"),a(30,"button",21),g(31,4),_(32,"sh-icon"),C(),o(),a(33,"a",22),g(34,5),_(35,"sh-icon")(36,"sh-icon",23),C(),o(),a(37,"a",24),g(38,6),_(39,"sh-icon")(40,"sh-icon",23),C(),o()()(),_(41,"router-outlet")(42,"app-service-hub"),o()),e&2&&(L(t.sidenavType()),$("isOpen",t.isNavOpen),O("disableDrag",!0),r(),p(t.isMobile()?1:-1),r(5),p(t.isDarkMode()?6:7),r(3),O("routerLinkActiveOptions",ce(11,ot)),r(13),O("title",_e(t.machineName())),r(3),y(" ",t.machineName()," "),r(3),p(t.relayIsEnabled()?-1:28))},dependencies:[pe,Se,ge,De,M,Le,R,Pe,k,ye],styles:["[_nghost-%COMP%]{height:100vh;width:100%;overflow:hidden}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1.25rem;gap:.75rem}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}.toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{position:absolute;inset:auto}h3[title][_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}div[sidenav][_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100vh}.machine-name[_ngcontent-%COMP%]{margin:0;cursor:default}"],changeDetection:0})};export{Z as default};
@@ -1 +1 @@
1
- import{a as F}from"./chunk-4HEWGBUJ.js";import{a as Z}from"./chunk-QSPA3G65.js";import{b as Q}from"./chunk-TC7HZO7D.js";import{B as q,K as Y,w as H,x as K,z as W}from"./chunk-RAIB7LN4.js";import{b as U,d as j}from"./chunk-XUN5TTJC.js";import{$b as s,Ab as b,Bb as k,Cb as O,Db as a,Eb as l,Fb as g,Jb as y,Kb as D,Mb as f,Pa as M,Rc as P,Sa as r,Tb as G,Ub as V,Vb as _,Xc as S,Zb as u,_ as T,cb as E,ea as p,fa as I,mc as z,nc as A,oc as x,pa as v,pc as J,vc as X,wc as B,xb as d,xc as m,yb as N}from"./chunk-ZBK64QS2.js";function ne(n,t){if(n&1&&(a(0,"div",11),A(1),l()),n&2){s();let e=m(0);r(),J(" ",e.Message," ")}}function oe(n,t){if(n&1&&(a(0,"div"),G(1,1),g(2,"a",15),V(),l()),n&2){let e=s();r(2),O("href",e.downloadLink(),M)}}function ae(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=m(0);return I(i.doRepair(c.BackupID))}),_(1,2),l()}}function re(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=m(0);return I(i.doDownloadBugreport(c))}),_(1,3),l()}}function le(n,t){if(n&1&&g(0,"sh-progress-bar",17),n&2){let e,o=s(2);O("value",(e=o.serverState())==null?null:e.UpdateDownloadProgress)}}function ce(n,t){if(n&1){let e=f();a(0,"div",11),y(1),_(2,4),D(),a(3,"a",16),A(4),l(),d(5,le,1,1,"sh-progress-bar",17),a(6,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowUpdate())}),_(7,5),l()()}if(n&2){let e,o,i=s(),c=m(0);r(3),O("href",(e=i.serverState())==null?null:e.UpdateDownloadLink,M),r(),x(c.Message),r(),N(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function _e(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=m(0);return I(i.doShowLog(c.BackupID))}),_(1,6),l()}}function se(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,7),l()}}function de(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,8),l()}}var Ne={Error:"error",Warning:"warn",Information:"primary"},h=class n{#e=T(j);#a=T(U);#r=T(W);#t=T(K);#i=T(F);#n=T(Q);#o=v(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=P(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(t){return t&&Ne[t]||"primary"}doShowLog(t){this.#n.getApiV1BackupByIdIsactive({id:t}).subscribe({next:e=>{this.#e.navigate(["/backup/"+t+"/log"])},error:e=>{if(e.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(t)+""!=t&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#t.error($localize`Failed to find backup: `+e.message)}})}doRepair(t){this.#n.postApiV1BackupByIdRepair({id:t}).subscribe({next:()=>{this.#t.success($localize`Backup repaired`),this.#e.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:e=>{this.#t.error($localize`Failed to repair backup: `+e.message)}})}doShowUpdate(){this.#e.navigate(["/about/changelog"])}doShowLink(t){window.open(t,"_blank")}doDownloadBugreport(t){let e=t.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#t.error("Failed to get bug report URL: No token generated");return}let i=`${location.origin}/api/v1/bugreport/${e}?token=${o.Token}`;t.DownloadLink=i,this.#o.set(i),this.triggerDownload(i)},error:o=>{this.#t.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(t){let e=document.createElement("a");e.href=t,e.download="",e.style.display="none",document.body.appendChild(e);try{e.click()}catch{}document.body.removeChild(e)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let t;t=$localize`Dismiss`;let e;e=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let c;c=$localize`New update found:`;let L;L=$localize`Show Update`;let w;w=$localize`Show Log`;let R;R=$localize` Show Help `;let $;return $=$localize` Show Help `,[t,e,o,i,c,L,w,R,$,["ship-alert-title",""],["ship-alert-content","",1,"content"],[1,"message"],[1,"actions"],["shButton","",1,"small","outlined"],["shButton","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(e,o){if(e&1){let i=f();X(0),a(1,"sh-alert")(2,"div",9),A(3),l(),a(4,"div",10),d(5,ne,2,1,"div",11),d(6,oe,3,1,"div"),a(7,"div",12),d(8,ae,2,0,"button",13),d(9,re,2,0,"button",13),d(10,ce,8,3,"div",11),d(11,_e,2,0,"button",13),d(12,se,2,0,"button",13),d(13,de,2,0,"button",13),a(14,"button",14),u("click",function(){return p(i),I(o.deleteNotificationByIndex())}),_(15,0),l()()()()}if(e&2){let i=B(o.notification());r(),z(o.getAlertType(i.Type)),r(2),x(i.Title),r(2),N(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),N(o.downloadLink()?6:-1),r(2),N(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),N(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),N(i.Action==="update:new"?10:-1),r(),N(i.Action==="backup:show-log"?11:-1),r(),N(i.Action==="config:issue:unencrypted-database"?12:-1),r(),N(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[Y,q,H],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{margin-top:.5rem;display:flex;flex-direction:column;gap:.5rem}.message[_ngcontent-%COMP%]{max-height:12.5rem;overflow:auto}"],changeDetection:0})};var Te=(n,t)=>t.ID;function Ce(n,t){if(n&1&&g(0,"app-notification",1),n&2){let e=t.$implicit,o=t.$index;O("index",o)("notification",e)}}function pe(n,t){n&1&&(a(0,"div",2)(1,"p"),_(2,0),l()())}var ee=class n{#e=T(F);notificationFilterPredicate=S();notifications=P(()=>{let t=this.notificationFilterPredicate()?.predicate,e=this.#e.notifications();return typeof t!="function"?e:e.filter(t)});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let t;return t=$localize`No more notifications`,[t,[3,"index","notification"],[1,"notification-list"]]},template:function(e,o){e&1&&b(0,Ce,1,2,"app-notification",1,Te,!1,pe,3,0,"div",2),e&2&&k(o.notifications())},dependencies:[h],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{h as a,ee as b};
1
+ import{a as F}from"./chunk-OHP7HLY2.js";import{a as Z}from"./chunk-QBHHGHBJ.js";import{b as Q}from"./chunk-TC7HZO7D.js";import{B as q,K as Y,w as H,x as K,z as W}from"./chunk-TGNUULAU.js";import{b as U,d as j}from"./chunk-XUN5TTJC.js";import{$b as s,Ab as b,Bb as k,Cb as O,Db as a,Eb as l,Fb as m,Jb as y,Kb as D,Mb as f,Pa as M,Rc as P,Sa as r,Tb as G,Ub as V,Vb as _,Xc as S,Zb as u,_ as T,cb as E,ea as p,fa as I,mc as z,nc as A,oc as x,pa as v,pc as J,vc as X,wc as B,xb as d,xc as g,yb as N}from"./chunk-ZBK64QS2.js";function ne(n,t){if(n&1&&(a(0,"div",11),A(1),l()),n&2){s();let e=g(0);r(),J(" ",e.Message," ")}}function oe(n,t){if(n&1&&(a(0,"div"),G(1,1),m(2,"a",15),V(),l()),n&2){let e=s();r(2),O("href",e.downloadLink(),M)}}function ae(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doRepair(c.BackupID))}),_(1,2),l()}}function re(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doDownloadBugreport(c))}),_(1,3),l()}}function le(n,t){if(n&1&&m(0,"sh-progress-bar",17),n&2){let e,o=s(2);O("value",(e=o.serverState())==null?null:e.UpdateDownloadProgress)}}function ce(n,t){if(n&1){let e=f();a(0,"div",11),y(1),_(2,4),D(),a(3,"a",16),A(4),l(),d(5,le,1,1,"sh-progress-bar",17),a(6,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowUpdate())}),_(7,5),l()()}if(n&2){let e,o,i=s(),c=g(0);r(3),O("href",(e=i.serverState())==null?null:e.UpdateDownloadLink,M),r(),x(c.Message),r(),N(((o=i.serverState())==null?null:o.UpdaterState)==="Downloading"?5:-1)}}function _e(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s(),c=g(0);return I(i.doShowLog(c.BackupID))}),_(1,6),l()}}function se(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,7),l()}}function de(n,t){if(n&1){let e=f();a(0,"button",14),u("click",function(){p(e);let i=s();return I(i.doShowLink("https://docs.duplicati.com/detailed-descriptions/the-server-database"))}),_(1,8),l()}}var Ne={Error:"error",Warning:"warn",Information:"primary"},h=class n{#e=T(j);#a=T(U);#r=T(W);#t=T(K);#i=T(F);#n=T(Q);#o=v(null);serverState=this.#i.serverState;index=S.required();notification=S.required();downloadLink=P(()=>this.#o()||this.notification().DownloadLink||"");deleteNotificationByIndex(){this.#i.deleteNotification(this.index())}deleteAllNotifications(){this.#i.deleteAllNotifications()}getAlertType(t){return t&&Ne[t]||"primary"}doShowLog(t){this.#n.getApiV1BackupByIdIsactive({id:t}).subscribe({next:e=>{this.#e.navigate(["/backup/"+t+"/log"])},error:e=>{if(e.status===404){let o={title:$localize`Error`,message:$localize`The backup is missing, has it been deleted?`,confirmText:$localize`OK`,cancelText:null};parseInt(t)+""!=t&&(o={title:$localize`Error`,message:$localize`The backup was temporary and does not exist anymore, so the log data is lost`,confirmText:$localize`OK`,cancelText:null}),this.#r.open(Z,{maxWidth:"550px",width:"100%",data:o})}else this.#t.error($localize`Failed to find backup: `+e.message)}})}doRepair(t){this.#n.postApiV1BackupByIdRepair({id:t}).subscribe({next:()=>{this.#t.success($localize`Backup repaired`),this.#e.navigate(["./"],{onSameUrlNavigation:"reload",relativeTo:this.#a})},error:e=>{this.#t.error($localize`Failed to repair backup: `+e.message)}})}doShowUpdate(){this.#e.navigate(["/about/changelog"])}doShowLink(t){window.open(t,"_blank")}doDownloadBugreport(t){let e=t.Action.slice(19);this.#n.postApiV1AuthIssuetokenByOperation({operation:"bugreport"}).subscribe({next:o=>{if(!o.Token){this.#t.error("Failed to get bug report URL: No token generated");return}let i=`${location.origin}/api/v1/bugreport/${e}?token=${o.Token}`;t.DownloadLink=i,this.#o.set(i),this.triggerDownload(i)},error:o=>{this.#t.error(`Failed to get bug report URL: ${o.message}`)}})}triggerDownload(t){let e=document.createElement("a");e.href=t,e.download="",e.style.display="none",document.body.appendChild(e);try{e.click()}catch{}document.body.removeChild(e)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notification"]],inputs:{index:[1,"index"],notification:[1,"notification"]},decls:16,vars:12,consts:()=>{let t;t=$localize`Dismiss`;let e;e=$localize` If the backup file was not downloaded automatically, ${"\uFFFD#2\uFFFD"}:START_LINK:right click and choose "Save as …"${"\uFFFD/#2\uFFFD"}:CLOSE_LINK:`;let o;o=$localize`Repair`;let i;i=$localize`Download`;let c;c=$localize`New update found:`;let L;L=$localize`Show Update`;let w;w=$localize`Show Log`;let R;R=$localize` Show Help `;let $;return $=$localize` Show Help `,[t,e,o,i,c,L,w,R,$,["ship-alert-title",""],["ship-alert-content","",1,"content"],[1,"message"],[1,"actions"],["shButton","",1,"small","outlined"],["shButton","",1,"small","outlined",3,"click"],["target","_blank",3,"href"],[3,"href"],[3,"value"]]},template:function(e,o){if(e&1){let i=f();X(0),a(1,"sh-alert")(2,"div",9),A(3),l(),a(4,"div",10),d(5,ne,2,1,"div",11),d(6,oe,3,1,"div"),a(7,"div",12),d(8,ae,2,0,"button",13),d(9,re,2,0,"button",13),d(10,ce,8,3,"div",11),d(11,_e,2,0,"button",13),d(12,se,2,0,"button",13),d(13,de,2,0,"button",13),a(14,"button",14),u("click",function(){return p(i),I(o.deleteNotificationByIndex())}),_(15,0),l()()()()}if(e&2){let i=B(o.notification());r(),z(o.getAlertType(i.Type)),r(2),x(i.Title),r(2),N(i.Action!=="update:new"&&i.Action!=="update:manual"?5:-1),r(),N(o.downloadLink()?6:-1),r(2),N(i.Message!=null&&i.Message.includes("please run repair")?8:-1),r(),N(i.Action!=null&&i.Action.startsWith("bug-report:created:")&&!o.downloadLink()?9:-1),r(),N(i.Action==="update:new"?10:-1),r(),N(i.Action==="backup:show-log"?11:-1),r(),N(i.Action==="config:issue:unencrypted-database"?12:-1),r(),N(i.Action==="config:issue:windows-folder-used"?13:-1)}},dependencies:[Y,q,H],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{margin-top:.5rem;display:flex;flex-direction:column;gap:.5rem}.message[_ngcontent-%COMP%]{max-height:12.5rem;overflow:auto}"],changeDetection:0})};var Te=(n,t)=>t.ID;function Ce(n,t){if(n&1&&m(0,"app-notification",1),n&2){let e=t.$implicit,o=t.$index;O("index",o)("notification",e)}}function pe(n,t){n&1&&(a(0,"div",2)(1,"p"),_(2,0),l()())}var ee=class n{#e=T(F);notificationFilterPredicate=S();notifications=P(()=>{let t=this.notificationFilterPredicate()?.predicate,e=this.#e.notifications();return typeof t!="function"?e:e.filter(t)});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=E({type:n,selectors:[["app-notifications"]],inputs:{notificationFilterPredicate:[1,"notificationFilterPredicate"]},decls:3,vars:1,consts:()=>{let t;return t=$localize`No more notifications`,[t,[3,"index","notification"],[1,"notification-list"]]},template:function(e,o){e&1&&b(0,Ce,1,2,"app-notification",1,Te,!1,pe,3,0,"div",2),e&2&&k(o.notifications())},dependencies:[h],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.actions[_ngcontent-%COMP%]{display:flex;gap:.25rem;justify-content:flex-end}.notification-list[_ngcontent-%COMP%]{padding:1rem;display:flex;flex-direction:column;gap:1rem;text-align:center}"],changeDetection:0})};export{h as a,ee as b};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-G6RLXZXM.js";import"./chunk-DQAT6VCF.js";import{g as q}from"./chunk-R6CC4KYP.js";import"./chunk-VITGSIEL.js";import"./chunk-OMKP4YQX.js";import{b as Z}from"./chunk-L34PDBPD.js";import"./chunk-5PANYSIG.js";import"./chunk-ZDBKQQ47.js";import"./chunk-AL7GMUVT.js";import"./chunk-4HEWGBUJ.js";import{a as V}from"./chunk-OYO6MNWR.js";import"./chunk-KCVV72VV.js";import{a as H}from"./chunk-G3QBP5CU.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-HVB6ARTT.js";import"./chunk-WJDMMKWE.js";import"./chunk-QSPA3G65.js";import"./chunk-AE7T2DAH.js";import"./chunk-XTFTWEJS.js";import"./chunk-SVQCV5AE.js";import{b as B}from"./chunk-TC7HZO7D.js";import{C as W,K as X,N as z,u as J}from"./chunk-RAIB7LN4.js";import{b as w}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import{qa as k}from"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{$b as g,Cb as C,Db as i,Eb as s,Fb as R,Gc as T,Hc as d,Jb as P,Kb as m,Rc as b,Sa as a,Tb as y,Ub as D,Vb as r,Wb as v,Xb as x,_ as c,cb as A,ga as u,ha as f,nc as M,pa as I,qc as N,xb as O,yb as p}from"./chunk-ZBK64QS2.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),u(),i(1,"svg",19),R(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),u(),i(1,"svg",19),R(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),P(1,16),r(2,2),m(),O(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();a(3),p(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),T(1,"number"),T(2,"number")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(P(0),r(1,8),m())}function ne(n,t){if(n&1&&(M(0),T(1,"bytes"),T(2,"bytes")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(P(0),r(1,9),m())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),y(2,5),R(3,"sh-spinner",23),D(),s(),i(4,"div",24),R(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),O(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),O(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,S=g();a(3),v((e=S.statusData())==null?null:e.statusText),x(2),a(2),C("value",(o=S.statusData())==null?null:o.OverallProgress),a(4),p((l=S.statusData())!=null&&l.ProcessedFileCount?9:10),a(5),p((E=S.statusData())!=null&&E.ProcessedFileSize?14:15)}}var G=class n{#i=c(B);#s=c(H);#t=c(V);#n=c(q);#r=c(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=I("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#_(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=A({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let S;S=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let h;h=$localize`Files processed:`;let F;F=$localize`Size processed:`;let L;L=$localize`N/A`;let $;return $=$localize`N/A`,[t,e,o,l,E,S,h,F,L,$,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),O(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),R(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),R(11,"app-logs-live",15),s()()),e&2){let l;a(),p(o.restoreResult()!=""?1:2),a(6),C("notificationFilterPredicate",o.notificationFilterPredicate()),a(4),C("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,X,z,J,W,Z,j,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{G as default};
1
+ import{a as K}from"./chunk-CENUQU54.js";import"./chunk-DQAT6VCF.js";import{g as q}from"./chunk-SXFSAK5L.js";import"./chunk-XRI2BFC2.js";import"./chunk-H4H72SDD.js";import{b as Z}from"./chunk-465L4ZG5.js";import"./chunk-D7OP5FPA.js";import"./chunk-5KMPTDRJ.js";import"./chunk-2DP4QU4T.js";import"./chunk-OHP7HLY2.js";import{a as V}from"./chunk-MPQNBRD5.js";import"./chunk-75C77QFK.js";import{a as H}from"./chunk-4Z72AON4.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-HVB6ARTT.js";import"./chunk-WJDMMKWE.js";import"./chunk-QBHHGHBJ.js";import"./chunk-AE7T2DAH.js";import"./chunk-XTFTWEJS.js";import"./chunk-SVQCV5AE.js";import{b as B}from"./chunk-TC7HZO7D.js";import{C as W,K as X,N as z,u as J}from"./chunk-TGNUULAU.js";import{b as w}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import{qa as k}from"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{$b as g,Cb as C,Db as o,Eb as s,Fb as R,Gc as T,Hc as d,Jb as P,Kb as m,Rc as b,Sa as a,Tb as y,Ub as D,Vb as r,Wb as v,Xb as x,_ as c,cb as A,ga as u,ha as f,nc as M,pa as I,qc as N,xb as O,yb as p}from"./chunk-ZBK64QS2.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(o(0,"div",17),u(),o(1,"svg",19),R(2,"circle",20),s(),f(),o(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(o(0,"div",18),u(),o(1,"svg",19),R(2,"circle",20),s(),f(),o(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(o(0,"sh-card",10),P(1,16),r(2,2),m(),O(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();a(3),p(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),T(1,"number"),T(2,"number")),n&2){let e,i=g(2);N(" ",d(1,2,(e=i.statusData())==null?null:e.ProcessedFileCount)," of ",d(2,4,(e=i.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(P(0),r(1,8),m())}function ne(n,t){if(n&1&&(M(0),T(1,"bytes"),T(2,"bytes")),n&2){let e,i=g(2);N(" ",d(1,2,(e=i.statusData())==null?null:e.ProcessedFileSize)," of ",d(2,4,(e=i.statusData())==null?null:e.TotalFileSize)," ")}}function ie(n,t){n&1&&(P(0),r(1,9),m())}function oe(n,t){if(n&1&&(o(0,"sh-card",10)(1,"h3"),y(2,5),R(3,"sh-spinner",23),D(),s(),o(4,"div",24),R(5,"sh-progress-bar",25),o(6,"p")(7,"span"),r(8,6),s(),O(9,ee,3,6)(10,te,2,0,"ng-container"),s(),o(11,"p")(12,"span"),r(13,7),s(),O(14,ne,3,6)(15,ie,2,0,"ng-container"),s()()()),n&2){let e,i,l,E,S=g();a(3),v((e=S.statusData())==null?null:e.statusText),x(2),a(2),C("value",(i=S.statusData())==null?null:i.OverallProgress),a(4),p((l=S.statusData())!=null&&l.ProcessedFileCount?9:10),a(5),p((E=S.statusData())!=null&&E.ProcessedFileSize?14:15)}}var G=class n{#o=c(B);#s=c(H);#t=c(V);#n=c(q);#r=c(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=I("");#e=null;lastRestoreStarted=b(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#o.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(e.ID);return}this.#i(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#_(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#i(e)})}#i(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=A({type:n,selectors:[["app-restore-progress"]],decls:12,vars:6,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let i;i=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let S;S=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let h;h=$localize`Files processed:`;let F;F=$localize`Size processed:`;let L;L=$localize`N/A`;let $;return $=$localize`N/A`,[t,e,i,l,E,S,h,F,L,$,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"asSimpleList","polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,i){if(e&1&&(o(0,"section"),O(1,Y,5,1,"sh-card",10)(2,oe,16,4,"sh-card",10),o(3,"sh-card",11)(4,"h3"),r(5,0),s(),o(6,"div",12),R(7,"app-notifications",13),s()(),o(8,"sh-card",14)(9,"h3"),r(10,1),s(),R(11,"app-logs-live",15),s()()),e&2){let l;a(),p(i.restoreResult()!=""?1:2),a(6),C("notificationFilterPredicate",i.notificationFilterPredicate()),a(4),C("asSimpleList",!0)("polling",i.restoreResult()=="")("whenFilter",(l=i.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",i.backupId())}},dependencies:[K,X,z,J,W,Z,j,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{G as default};
@@ -1 +1 @@
1
- import{a as D}from"./chunk-AE7T2DAH.js";import{b as $,d as j}from"./chunk-SVQCV5AE.js";import{b}from"./chunk-TC7HZO7D.js";import{z as f}from"./chunk-RAIB7LN4.js";import{qa as L}from"./chunk-NXROYR6L.js";import{Gb as N,Gc as F,Hb as C,Ib as M,Ic as W,Q as E,Rc as p,Sa as O,Sc as G,Tb as I,Ub as _,V as h,Vb as w,Wb as A,Xb as P,_ as r,cb as R,f as m,i as k,pa as s}from"./chunk-ZBK64QS2.js";var S=class i{reconnectTimer=s(15e3);countdown=s(0);connectTimerEffect=G(()=>{let e=this.reconnectTimer();this.countdown.set(e/1e3)});interval=setInterval(()=>{if(this.countdown()<=1){this.countdown.set(this.reconnectTimer()/1e3);return}this.countdown.set(this.countdown()-1)},1e3);ngOnDestroy(){clearInterval(this.interval)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=R({type:i,selectors:[["app-disconnected-dialog"]],decls:8,vars:4,consts:()=>{let e;e=$localize`Reconnecting...`;let t;return t=$localize` The connection to the server is lost, attempting again in ${"\uFFFD#6\uFFFD"}:START_TAG_STRONG:0:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_STRONG:`,[e,t,["header",""],["content",""]]},template:function(t,n){t&1&&(N(0,"header",2)(1,"h3"),w(2,0),C()(),N(3,"div",3)(4,"p"),I(5,1),M(6,"strong"),F(7,"number"),_(),C()()),t&2&&(O(7),A(W(7,1,n.countdown(),"2.0-0")),P(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var v=class i{dialog=r(f);#t=r(b);#i=s("disconnected");#n=s(null);#e=s(-1);#c=s(0);#l=s(!1);#u=new k;connectionStatus=this.#i.asReadonly();serverState=this.#n.asReadonly();#s=void 0;duration=r($).relayIsEnabled()?"94s":"299s";start(){this.#l.set(!0),this.#u=new k,this.#o()}stop(){this.#u.next(),this.#u.complete(),this.#l.set(!1)}reconnect(){this.stop(),this.start()}reconnectIfNeeded(){this.#l()||this.reconnect()}#o(){this.#i.set("connecting"),this.#t.getApiV1Serverstate({lastEventId:this.#e(),longpoll:this.#e()>=0,duration:this.duration}).pipe(E(this.#u)).subscribe({next:e=>{e&&this.#r(e),this.#a()},error:e=>{let n=this.#c()+1,a=Math.min(5e3*n,3e4);this.#c.set(n),n>3&&this.#i.set("disconnected"),this.#s||(this.#s=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1})),this.#s.component.reconnectTimer.set(a),setTimeout(()=>{this.#o()},a)}})}#r(e){this.#i.set("connected"),this.#n.set(e),this.#e.set(e.LastEventID??-1),this.#c.set(0)}#a(){this.#l()&&this.#o()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"})};var u=!1,T=class i{#t=r(j);#i=r(D);dialog=r(f);#n=null;#e=s("disconnected");#c=s(null);#l=s(null);#u=s(null);#s=s(null);#o=void 0;#r=s({legacystatus:!0});shouldConnect=s(!0);connectionStatus=this.#e.asReadonly();serverState=this.#c.asReadonly();serverProgress=this.#l.asReadonly();subscriptions=this.#r.asReadonly();serverTaskQueue=this.#u.asReadonly();backupListState=this.#s.asReadonly();#a=null;taskCompleted=new m(e=>{this.#a=e});#h=0;start(){this.#d(),this.shouldConnect.set(!0)}#d(){let e=this.#t.token();if(!e){console.error("No access token available");return}let t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.port?`:${window.location.port}`:"";window.location.port==="4200"&&(n=":8200");let a=window.location.hostname,g=this.#i.hasWebSocketAuth()?`${t}//${a}${n}/notifications`:`${t}//${a}${n}/notifications?token=${e}`;this.#e.set("connecting"),this.#n=new WebSocket(g),this.#n.onopen=()=>{u&&console.log("WebSocket connection established"),this.#i.hasWebSocketAuth()?(this.#e.set("authenticating"),this.#n?.send(JSON.stringify({Version:1,Token:e}))):this.#p()},this.#n.onmessage=d=>{if(this.#e()==="authenticating")try{let o=JSON.parse(d.data);o.Success?(u&&console.log("WebSocket authentication successful"),this.#p()):(console.error("WebSocket authentication failed:",o.Message),this.#e.set("disconnected"));return}catch(o){console.error("Error parsing WebSocket authentication reply",o),this.#e.set("disconnected");return}try{let o=JSON.parse(d.data),l=o?.Type;if(l==="legacystatus"||l==null)u&&console.log("Received legacy status update:",o),this.#c.set(o);else if(l==="reply"){let c=o;c.Success||console.error("WebSocket reply error:",c.Message)}else if(l==="progress"){let c=o;u&&console.log("Received progress update:",c.Data),this.#l.set(c.Data)}else if(l==="taskqueue"){let c=o;u&&console.log("Received task update:",c.Data),this.#u.set(c.Data)}else if(l==="taskcompleted"){let c=o;u&&console.log("Received task completed:",c.Data),this.#a?.next(c.Data)}else if(l==="backuplist"){let c=o;u&&console.log("Received backup list update:",c.Data),this.#s.set(c.Data)}else console.warn("Unknown WebSocket message type:",l)}catch(o){console.error("Error parsing WebSocket message",o)}},this.#n.onclose=d=>{u&&console.log("WebSocket connection closed",d),this.#e.set("disconnected"),this.shouldConnect()&&(this.#o||(this.#o=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1}),this.#o.component.reconnectTimer.set(15e3)),setTimeout(()=>this.#d(),5e3))},this.#n.onerror=d=>{console.error("WebSocket error",d),this.#e.set("disconnected")}}#p(){this.#e.set("connected");let e=this.#r();Object.keys(e).length>0&&Object.entries(e).forEach(([t,n])=>{n!=null&&this.sendSubscribeRequest(t,n)}),this.#o&&this.#o.close()}stop(){this.shouldConnect.set(!1),this.#n?.close()}reconnect(){this.#n?.close(),this.start()}reconnectIfNeeded(){this.#n?.readyState!==WebSocket.OPEN&&this.reconnect()}sendSubscribeRequest(e,t){this.#n?.send(JSON.stringify({Version:1,Id:`req-${++this.#h}`,Action:"sub",Service:e,Data:t||null}))}subscribe(e,t=void 0){let n=this.#r(),a=n[e];(!a||JSON.stringify(a)!==JSON.stringify(t||!0))&&(n[e]=t||!0,this.#r.set(n),this.#e()=="connected"&&this.sendSubscribeRequest(e,t))}unsubscribe(e){let t=this.#r();t[e]&&(delete t[e],this.#r.set(t),this.#e()=="connected"&&this.#n?.send(JSON.stringify({Version:1,Id:`req-${++this.#h}`,Action:"unsub",Service:e})))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"})};var x=10,q=class i{#t=r(T);#i=r(v);#n=r(b);#e=r(D);#c=s("longpoll");#l=s(!1);#u=p(()=>this.#e.hasTaskCompletedOption()&&this.#c()==="websocket");#s={};#o=null;#r=!1;#a=[];constructor(){this.#t.subscribe("taskcompleted"),this.#t.taskCompleted.subscribe(e=>{if(this.#a.unshift(e),this.#a.length>x&&this.#a.pop(),!e.ID)return;let t=this.#s[e.ID];t&&(t.forEach(n=>{n.next(e),n.complete()}),delete this.#s[e.ID])})}connectionStatus=p(()=>this.#c()==="websocket"?this.#t.connectionStatus():this.#i.connectionStatus());isConnectionMethodSet=this.#l.asReadonly();serverState=p(()=>this.#c()==="websocket"?this.#t.serverState():this.#i.serverState());progressState=this.#t.serverProgress;taskQueueState=this.#t.serverTaskQueue;activeTaskQueueState=p(()=>this.#c()==="websocket"?this.#t.serverTaskQueue()?.map(t=>t.ID).filter(t=>t)??[]:(this.#i.serverState()?.SchedulerQueueIds??[]).map(t=>t.Item1).filter(t=>t));backupListState=p(()=>this.#t.backupListState());setConnectionMethod(e){e==="websocket"?(this.#t.reconnectIfNeeded(),this.#i.stop()):(this.#i.reconnectIfNeeded(),this.#t.stop()),this.#c.set(e),this.#l.set(!0)}getConnectionMethod(){return this.#c()}subscribe(e,t=null){this.#t.subscribe(e,t)}unsubscribe(e){this.#t.unsubscribe(e)}waitForTaskToComplete(e){return new m(t=>{let n=this.#a.find(a=>a.ID===e);if(n){t.next(n),t.complete();return}this.#s[e]=this.#s[e]||[],this.#s[e].push(t),this.#h()})}#h(){this.#r||this.#u()||(this.#r=!0,this.#d())}#d(){let e=Object.keys(this.#s).map(n=>parseInt(n,10));if(e.length===0){this.#p();return}let t=Math.min(...e);this.#n.getApiV1TaskByTaskid({taskid:t}).subscribe({next:n=>{n.TaskFinished!=null&&(this.#a.unshift(n),this.#a.length>x&&this.#a.pop(),this.#s[t].forEach(g=>{g.next(n),g.complete()}),delete this.#s[t])},complete:()=>{this.#o=window.setTimeout(()=>{this.#d()},1e3)},error:n=>{this.#o=window.setTimeout(()=>{this.#d()},3e3)}})}#p(){this.#o!==null&&(clearTimeout(this.#o),this.#o=null),this.#r=!1}static \u0275fac=function(t){return new(t||i)};static \u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"})};export{q as a};
1
+ import{a as D}from"./chunk-AE7T2DAH.js";import{b as $,d as j}from"./chunk-SVQCV5AE.js";import{b}from"./chunk-TC7HZO7D.js";import{z as f}from"./chunk-TGNUULAU.js";import{qa as L}from"./chunk-NXROYR6L.js";import{Gb as N,Gc as F,Hb as C,Ib as M,Ic as W,Q as E,Rc as p,Sa as O,Sc as G,Tb as I,Ub as _,V as h,Vb as w,Wb as A,Xb as P,_ as r,cb as R,f as m,i as k,pa as s}from"./chunk-ZBK64QS2.js";var S=class i{reconnectTimer=s(15e3);countdown=s(0);connectTimerEffect=G(()=>{let e=this.reconnectTimer();this.countdown.set(e/1e3)});interval=setInterval(()=>{if(this.countdown()<=1){this.countdown.set(this.reconnectTimer()/1e3);return}this.countdown.set(this.countdown()-1)},1e3);ngOnDestroy(){clearInterval(this.interval)}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=R({type:i,selectors:[["app-disconnected-dialog"]],decls:8,vars:4,consts:()=>{let e;e=$localize`Reconnecting...`;let t;return t=$localize` The connection to the server is lost, attempting again in ${"\uFFFD#6\uFFFD"}:START_TAG_STRONG:0:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_STRONG:`,[e,t,["header",""],["content",""]]},template:function(t,n){t&1&&(N(0,"header",2)(1,"h3"),w(2,0),C()(),N(3,"div",3)(4,"p"),I(5,1),M(6,"strong"),F(7,"number"),_(),C()()),t&2&&(O(7),A(W(7,1,n.countdown(),"2.0-0")),P(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var v=class i{dialog=r(f);#t=r(b);#i=s("disconnected");#n=s(null);#e=s(-1);#c=s(0);#l=s(!1);#u=new k;connectionStatus=this.#i.asReadonly();serverState=this.#n.asReadonly();#s=void 0;duration=r($).relayIsEnabled()?"94s":"299s";start(){this.#l.set(!0),this.#u=new k,this.#o()}stop(){this.#u.next(),this.#u.complete(),this.#l.set(!1)}reconnect(){this.stop(),this.start()}reconnectIfNeeded(){this.#l()||this.reconnect()}#o(){this.#i.set("connecting"),this.#t.getApiV1Serverstate({lastEventId:this.#e(),longpoll:this.#e()>=0,duration:this.duration}).pipe(E(this.#u)).subscribe({next:e=>{e&&this.#r(e),this.#a()},error:e=>{let n=this.#c()+1,a=Math.min(5e3*n,3e4);this.#c.set(n),n>3&&this.#i.set("disconnected"),this.#s||(this.#s=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1})),this.#s.component.reconnectTimer.set(a),setTimeout(()=>{this.#o()},a)}})}#r(e){this.#i.set("connected"),this.#n.set(e),this.#e.set(e.LastEventID??-1),this.#c.set(0)}#a(){this.#l()&&this.#o()}static \u0275fac=function(t){return new(t||i)};static \u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"})};var u=!1,T=class i{#t=r(j);#i=r(D);dialog=r(f);#n=null;#e=s("disconnected");#c=s(null);#l=s(null);#u=s(null);#s=s(null);#o=void 0;#r=s({legacystatus:!0});shouldConnect=s(!0);connectionStatus=this.#e.asReadonly();serverState=this.#c.asReadonly();serverProgress=this.#l.asReadonly();subscriptions=this.#r.asReadonly();serverTaskQueue=this.#u.asReadonly();backupListState=this.#s.asReadonly();#a=null;taskCompleted=new m(e=>{this.#a=e});#h=0;start(){this.#d(),this.shouldConnect.set(!0)}#d(){let e=this.#t.token();if(!e){console.error("No access token available");return}let t=window.location.protocol==="https:"?"wss:":"ws:",n=window.location.port?`:${window.location.port}`:"";window.location.port==="4200"&&(n=":8200");let a=window.location.hostname,g=this.#i.hasWebSocketAuth()?`${t}//${a}${n}/notifications`:`${t}//${a}${n}/notifications?token=${e}`;this.#e.set("connecting"),this.#n=new WebSocket(g),this.#n.onopen=()=>{u&&console.log("WebSocket connection established"),this.#i.hasWebSocketAuth()?(this.#e.set("authenticating"),this.#n?.send(JSON.stringify({Version:1,Token:e}))):this.#p()},this.#n.onmessage=d=>{if(this.#e()==="authenticating")try{let o=JSON.parse(d.data);o.Success?(u&&console.log("WebSocket authentication successful"),this.#p()):(console.error("WebSocket authentication failed:",o.Message),this.#e.set("disconnected"));return}catch(o){console.error("Error parsing WebSocket authentication reply",o),this.#e.set("disconnected");return}try{let o=JSON.parse(d.data),l=o?.Type;if(l==="legacystatus"||l==null)u&&console.log("Received legacy status update:",o),this.#c.set(o);else if(l==="reply"){let c=o;c.Success||console.error("WebSocket reply error:",c.Message)}else if(l==="progress"){let c=o;u&&console.log("Received progress update:",c.Data),this.#l.set(c.Data)}else if(l==="taskqueue"){let c=o;u&&console.log("Received task update:",c.Data),this.#u.set(c.Data)}else if(l==="taskcompleted"){let c=o;u&&console.log("Received task completed:",c.Data),this.#a?.next(c.Data)}else if(l==="backuplist"){let c=o;u&&console.log("Received backup list update:",c.Data),this.#s.set(c.Data)}else console.warn("Unknown WebSocket message type:",l)}catch(o){console.error("Error parsing WebSocket message",o)}},this.#n.onclose=d=>{u&&console.log("WebSocket connection closed",d),this.#e.set("disconnected"),this.shouldConnect()&&(this.#o||(this.#o=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1}),this.#o.component.reconnectTimer.set(15e3)),setTimeout(()=>this.#d(),5e3))},this.#n.onerror=d=>{console.error("WebSocket error",d),this.#e.set("disconnected")}}#p(){this.#e.set("connected");let e=this.#r();Object.keys(e).length>0&&Object.entries(e).forEach(([t,n])=>{n!=null&&this.sendSubscribeRequest(t,n)}),this.#o&&this.#o.close()}stop(){this.shouldConnect.set(!1),this.#n?.close()}reconnect(){this.#n?.close(),this.start()}reconnectIfNeeded(){this.#n?.readyState!==WebSocket.OPEN&&this.reconnect()}sendSubscribeRequest(e,t){this.#n?.send(JSON.stringify({Version:1,Id:`req-${++this.#h}`,Action:"sub",Service:e,Data:t||null}))}subscribe(e,t=void 0){let n=this.#r(),a=n[e];(!a||JSON.stringify(a)!==JSON.stringify(t||!0))&&(n[e]=t||!0,this.#r.set(n),this.#e()=="connected"&&this.sendSubscribeRequest(e,t))}unsubscribe(e){let t=this.#r();t[e]&&(delete t[e],this.#r.set(t),this.#e()=="connected"&&this.#n?.send(JSON.stringify({Version:1,Id:`req-${++this.#h}`,Action:"unsub",Service:e})))}static \u0275fac=function(t){return new(t||i)};static \u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"})};var x=10,q=class i{#t=r(T);#i=r(v);#n=r(b);#e=r(D);#c=s("longpoll");#l=s(!1);#u=p(()=>this.#e.hasTaskCompletedOption()&&this.#c()==="websocket");#s={};#o=null;#r=!1;#a=[];constructor(){this.#t.subscribe("taskcompleted"),this.#t.taskCompleted.subscribe(e=>{if(this.#a.unshift(e),this.#a.length>x&&this.#a.pop(),!e.ID)return;let t=this.#s[e.ID];t&&(t.forEach(n=>{n.next(e),n.complete()}),delete this.#s[e.ID])})}connectionStatus=p(()=>this.#c()==="websocket"?this.#t.connectionStatus():this.#i.connectionStatus());isConnectionMethodSet=this.#l.asReadonly();serverState=p(()=>this.#c()==="websocket"?this.#t.serverState():this.#i.serverState());progressState=this.#t.serverProgress;taskQueueState=this.#t.serverTaskQueue;activeTaskQueueState=p(()=>this.#c()==="websocket"?this.#t.serverTaskQueue()?.map(t=>t.ID).filter(t=>t)??[]:(this.#i.serverState()?.SchedulerQueueIds??[]).map(t=>t.Item1).filter(t=>t));backupListState=p(()=>this.#t.backupListState());setConnectionMethod(e){e==="websocket"?(this.#t.reconnectIfNeeded(),this.#i.stop()):(this.#i.reconnectIfNeeded(),this.#t.stop()),this.#c.set(e),this.#l.set(!0)}getConnectionMethod(){return this.#c()}subscribe(e,t=null){this.#t.subscribe(e,t)}unsubscribe(e){this.#t.unsubscribe(e)}waitForTaskToComplete(e){return new m(t=>{let n=this.#a.find(a=>a.ID===e);if(n){t.next(n),t.complete();return}this.#s[e]=this.#s[e]||[],this.#s[e].push(t),this.#h()})}#h(){this.#r||this.#u()||(this.#r=!0,this.#d())}#d(){let e=Object.keys(this.#s).map(n=>parseInt(n,10));if(e.length===0){this.#p();return}let t=Math.min(...e);this.#n.getApiV1TaskByTaskid({taskid:t}).subscribe({next:n=>{n.TaskFinished!=null&&(this.#a.unshift(n),this.#a.length>x&&this.#a.pop(),this.#s[t].forEach(g=>{g.next(n),g.complete()}),delete this.#s[t])},complete:()=>{this.#o=window.setTimeout(()=>{this.#d()},1e3)},error:n=>{this.#o=window.setTimeout(()=>{this.#d()},3e3)}})}#p(){this.#o!==null&&(clearTimeout(this.#o),this.#o=null),this.#r=!1}static \u0275fac=function(t){return new(t||i)};static \u0275prov=h({token:i,factory:i.\u0275fac,providedIn:"root"})};export{q as a};