@duplicati/ngclient 0.0.148 → 0.0.150

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.
@@ -1 +1 @@
1
- import{a as Y,d as nn}from"./chunk-KDYD6LMI.js";import{a as tn}from"./chunk-NJEX2N4Q.js";import{a as en}from"./chunk-6LTGTS6B.js";import{a as Ze}from"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import{a as Ye}from"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{e as Xe}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as Q,f as we,g as ze,h as Ve,j as Ue,k as Ke,o as je,p as We,w as qe,x as Je}from"./chunk-H7K35UUX.js";import{h as Qe}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as o,Ac as P,Bb as t,Cb as p,Dc as N,Ec as x,Fc as A,Gb as m,H as j,Hb as M,Hc as J,Ib as $,Jb as k,Pc as ve,Qb as s,Ra as _,Rb as u,Sb as g,Tb as h,Ub as H,Vb as W,Wb as I,Yb as F,_ as v,bb as Re,ea as D,fa as f,gb as O,gc as U,hb as ke,ic as R,lc as r,mc as Be,nc as E,oa as X,qc as Le,rb as xe,rc as Ge,sb as ye,sc as be,ub as C,vb as S,wb as w,xb as z,yb as V,zb as T,zc as q}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var _n=()=>[import("./chunk-NQ27E6KP.js").then(n=>n.NgTemplateOutlet),Q,Ue,Je,qe,import("./chunk-DKTUN7FF.js").then(n=>n.DurationFormatPipe),import("./chunk-KLW6HEOS.js").then(n=>n.BytesPipe),import("./chunk-HI4XLHO3.js").then(n=>n.RelativeTimePipe)],ln=()=>["/add-backup"],rn=()=>["/restore"],an=n=>({$implicit:n}),cn=n=>["/backup",n],sn=n=>["/restore",n],un=n=>["/backup",n,"export"],Fn=n=>["/backup",n,"delete"],dn=n=>["/backup",n,"database"],pn=n=>["/backup",n,"commandline"],gn=n=>["/backup",n,"log"];function Tn(n,i){if(n&1){let e=k();o(0,"button",51),I("click",function(){let c=D(e).$implicit,d=F(2);return f(d.sortByColumn.set(c.value))}),g(1,15),t()}if(n&2){let e=i.$implicit,a=F(2);R("active",a.orderBy()===e.value),_(),h(e.label),H(1)}}function Cn(n,i){if(n&1&&(o(0,"sh-menu",52)(1,"button",53),s(2,14),p(3,"strong")(4,"sh-icon"),u(),t(),m(5,54),z(6,Tn,2,3,"button",55,w),M(),t()),n&2){let e=F();_(4),h(e.orderBy()),H(2),_(2),V(e.sortOrderOptions())}}function Sn(n,i){if(n&1&&(o(0,"p")(1,"span"),g(2,21),t(),r(3),N(4,"relativeTime"),t()),n&2){let e=F().$implicit,a=F(4);_(3),E(" ",A(4,1,e.Schedule==null?null:e.Schedule.Time,a.timeType()==="actual")," ")}}function En(n,i){if(n&1&&(r(0),N(1,"durationFormat")),n&2){let e=F().$implicit,a=F(4);E(" ",A(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration,a.timeType()==="actual")," ")}}function mn(n,i){n&1&&(m(0),r(1,"-"),M())}function Mn(n,i){if(n&1&&(r(0),N(1,"bytes")),n&2){let e=F().$implicit;E(" ",x(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function On(n,i){n&1&&(m(0),r(1,"-"),M())}function Nn(n,i){if(n&1&&(r(0),N(1,"bytes")),n&2){let e=F().$implicit;E(" ",x(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function Dn(n,i){n&1&&(m(0),r(1,"-"),M())}function fn(n,i){n&1&&$(0)}function $n(n,i){if(n&1&&(o(0,"div",58)(1,"div",45)(2,"h3"),r(3),o(4,"sh-chip")(5,"sh-icon"),r(6),t(),r(7),t()(),o(8,"p")(9,"span"),g(10,16),t(),r(11),N(12,"relativeTime"),t(),C(13,Sn,5,4,"p"),o(14,"p")(15,"span"),g(16,17),t(),C(17,En,2,4)(18,mn,2,0,"ng-container"),t(),o(19,"p")(20,"span"),g(21,18),t(),C(22,Mn,2,3)(23,On,2,0,"ng-container"),t(),o(24,"p")(25,"span"),g(26,19),t(),C(27,Nn,2,3)(28,Dn,2,0,"ng-container"),t()(),o(29,"sh-chip",59),g(30,20),t(),o(31,"div",49),O(32,fn,1,0,"ng-container",60),t()()),n&2){let e=i.$implicit,a=F(4),c=U(51);_(3),E(" ",(e.Backup==null?null:e.Backup.Name)??a.MISSING_BACKUP_NAME," "),_(3),Be(a.getBackendIcon(e.Backup==null?null:e.Backup.TargetURL)),_(),E(" ",a.getBackendType(e.Backup==null?null:e.Backup.TargetURL)," "),_(4),E(" ",A(12,12,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupFinished,a.timeType()==="actual")," "),_(2),S(e.Schedule!=null&&e.Schedule.Time?13:-1),_(4),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDuration?17:18),_(5),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.SourceFilesSize?22:23),_(5),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.TargetFilesSize?27:28);let d=a.getBackupVersionCount(e);_(3),h(d)(d),H(30),_(2),T("ngTemplateOutlet",c)("ngTemplateOutletContext",P(15,an,e))}}function Pn(n,i){if(n&1&&z(0,$n,33,17,"div",58,w),n&2){let e=F(3);V(e.backups())}}function In(n,i){n&1&&(m(0),g(1,22),M())}function An(n,i){if(n&1&&(o(0,"div",56),C(1,Pn,2,0)(2,In,2,0,"ng-container"),t()),n&2){let e=F(2);_(),S(e.backups().length?1:2)}}function hn(n,i){n&1&&(s(0,23,1),$(1),u())}function Hn(n,i){n&1&&(s(0,24,1),$(1),u())}function Rn(n,i){n&1&&(s(0,25,1),$(1),u())}function kn(n,i){n&1&&(s(0,26,1),$(1),u())}function xn(n,i){n&1&&(s(0,27,1),$(1),u())}function yn(n,i){n&1&&(s(0,28,1),$(1),u())}function Bn(n,i){n&1&&(s(0,29,1),$(1),u())}function Ln(n,i){if(n&1&&(r(0),N(1,"relativeTime")),n&2){let e=F().$implicit,a=F(3);E(" ",A(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDate,a.timeType()==="actual")," ")}}function Gn(n,i){n&1&&(m(0),r(1,"-"),M())}function bn(n,i){if(n&1&&(r(0),N(1,"relativeTime")),n&2){let e=F().$implicit,a=F(3);E(" ",A(1,1,e.Schedule==null?null:e.Schedule.Time,a.timeType()==="actual")," ")}}function vn(n,i){n&1&&(m(0),r(1,"-"),M())}function Xn(n,i){if(n&1&&(r(0),N(1,"durationFormat")),n&2){let e=F().$implicit,a=F(3);E(" ",A(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration,a.timeType()==="actual")," ")}}function wn(n,i){n&1&&(m(0),r(1,"-"),M())}function zn(n,i){if(n&1&&(r(0),N(1,"bytes")),n&2){let e=F().$implicit;E(" ",x(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function Vn(n,i){n&1&&(m(0),r(1,"-"),M())}function Un(n,i){if(n&1&&(r(0),N(1,"bytes")),n&2){let e=F().$implicit;E(" ",x(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function Kn(n,i){n&1&&(m(0),r(1,"-"),M())}function jn(n,i){n&1&&$(0)}function Wn(n,i){if(n&1&&(o(0,"tr")(1,"td"),r(2),t(),o(3,"td"),r(4),t(),o(5,"td"),C(6,Ln,2,4)(7,Gn,2,0,"ng-container"),t(),o(8,"td"),C(9,bn,2,4)(10,vn,2,0,"ng-container"),t(),o(11,"td"),C(12,Xn,2,4)(13,wn,2,0,"ng-container"),t(),o(14,"td"),C(15,zn,2,3)(16,Vn,2,0,"ng-container"),t(),o(17,"td"),C(18,Un,2,3)(19,Kn,2,0,"ng-container"),t(),o(20,"td")(21,"span"),g(22,32),t()(),o(23,"td"),O(24,jn,1,0,"ng-container",60),t()()),n&2){let e=i.$implicit,a=F(3),c=U(51);_(2),E(" ",(e.Backup==null?null:e.Backup.Name)??a.MISSING_BACKUP_NAME," "),_(2),E(" ",a.getBackendType(e.Backup==null?null:e.Backup.TargetURL)," "),_(2),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDate?6:7),_(3),S(e.Schedule!=null&&e.Schedule.Time?9:10),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDuration?12:13),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.SourceFilesSize?15:16),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.TargetFilesSize?18:19);let d=a.getBackupVersionCount(e);_(4),h(d)(d),H(22),_(2),T("ngTemplateOutlet",c)("ngTemplateOutletContext",P(11,an,e))}}function qn(n,i){if(n&1){let e=k();o(0,"sh-table",61),be("sortByColumnChange",function(c){D(e);let d=F(2);return Ge(d.sortByColumn,c)||(d.sortByColumn=c),f(c)}),o(1,"tr",62)(2,"th",63),s(3,23),O(4,hn,2,0,"ng-container",64),u(),t(),o(5,"th",65),s(6,24),O(7,Hn,2,0,"ng-container",64),u(),t(),o(8,"th",66),s(9,25),O(10,Rn,2,0,"ng-container",64),u(),t(),o(11,"th",67),s(12,26),O(13,kn,2,0,"ng-container",64),u(),t(),o(14,"th",68),s(15,27),O(16,xn,2,0,"ng-container",64),u(),t(),o(17,"th",69),s(18,28),O(19,yn,2,0,"ng-container",64),u(),t(),o(20,"th",70),s(21,29),O(22,Bn,2,0,"ng-container",64),u(),t(),o(23,"th"),g(24,30),t(),o(25,"th"),g(26,31),t()(),z(27,Wn,25,13,"tr",null,w),t()}if(n&2){let e=F(2),a=U(53);T("data",e.backups())("loading",e.backupsLoading()),Le("sortByColumn",e.sortByColumn),_(4),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(5),V(e.backups())}}function Jn(n,i){if(n&1&&C(0,An,3,1,"div",56)(1,qn,29,10,"sh-table",57),n&2){let e=F();S(e.viewMode()==="list"?0:e.viewMode()==="details"?1:-1)}}function Qn(n,i){n&1&&(o(0,"div",71),p(1,"sh-progress-bar",72),o(2,"div",45)(3,"h3"),g(4,33),t()()())}function Yn(n,i){n&1&&g(0,34,1)}function Zn(n,i){n&1&&(o(0,"sh-icon"),r(1,"check"),t())}function et(n,i){n&1&&(o(0,"sh-icon"),r(1,"dots-three-vertical"),t())}function nt(n,i){if(n&1){let e=k();o(0,"button",73),I("click",function(){let c=D(e).$implicit,d=F();return f(d.startBackup(c.Backup==null?null:c.Backup.ID))}),s(1,34),p(2,"sh-icon"),C(3,Yn,1,0),u(),t(),o(4,"button",74)(5,"sh-icon"),r(6,"pencil-simple"),t()(),o(7,"sh-menu")(8,"button",46),C(9,Zn,2,0,"sh-icon")(10,et,2,0,"sh-icon"),t(),m(11,54),o(12,"h3",75),r(13,"Operations"),t(),o(14,"button",76),s(15,35),p(16,"sh-icon"),u(),t(),o(17,"button",76),s(18,36),p(19,"sh-icon"),u(),t(),o(20,"button",76),s(21,37),p(22,"sh-icon"),u(),t(),p(23,"sh-divider"),o(24,"h3",75),r(25,"Advanced"),t(),o(26,"button",76),s(27,38),p(28,"sh-icon"),u(),t(),o(29,"button",51),I("click",function(){let c=D(e).$implicit,d=F();return f(d.verifyFiles(c.Backup==null?null:c.Backup.ID))}),s(30,39),p(31,"sh-icon"),u(),t(),o(32,"button",51),I("click",function(){let c=D(e).$implicit,d=F();return f(d.compressBackup(c.Backup==null?null:c.Backup.ID))}),s(33,40),p(34,"sh-icon"),u(),t(),o(35,"button",76),s(36,41),p(37,"sh-icon"),u(),t(),p(38,"sh-divider"),o(39,"h3",75),r(40,"Reporting"),t(),o(41,"button",76),s(42,42),p(43,"sh-icon"),u(),t(),M(),t()}if(n&2){let e=i.$implicit,a=F();R("loader",a.startingBackup()===(e.Backup==null?null:e.Backup.ID)),_(3),S(a.viewMode()==="list"?3:-1),_(),T("routerLink",P(15,cn,e.Backup==null?null:e.Backup.ID)),_(4),R("loader",a.loadingId()===(e.Backup==null?null:e.Backup.ID))("success",a.successId()===(e.Backup==null?null:e.Backup.ID)),_(),S(a.successId()===(e.Backup==null?null:e.Backup.ID)?9:10),_(5),T("routerLink",P(17,sn,e.Backup==null?null:e.Backup.ID)),_(3),T("routerLink",P(19,un,e.Backup==null?null:e.Backup.ID)),_(3),T("routerLink",P(21,Fn,e.Backup==null?null:e.Backup.ID)),_(6),T("routerLink",P(23,dn,e.Backup==null?null:e.Backup.ID)),_(9),T("routerLink",P(25,pn,e.Backup==null?null:e.Backup.ID)),_(6),T("routerLink",P(27,gn,e.Backup==null?null:e.Backup.ID))}}function tt(n,i){n&1&&(o(0,"sh-icon",77),r(1,"funnel-simple"),t(),o(2,"sh-icon",78),r(3,"sort-ascending"),t(),o(4,"sh-icon",79),r(5,"sort-descending"),t())}var on={file:{Display:$localize`Local`,Icon:null}},Z=class n{#n=v(Qe);#t=v(en);#e=v(Ze);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=Ye("viewMode","list");sortByColumn=X(this.#e.orderBy());loadingId=X(null);successId=X(null);sortEffect=ve(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#t.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){if(!i)return"";let e=i.split("://")[0],a=Y(e);return on[a.key]?.Icon??"database"}getBackendType(i){if(!i)return"";let e=i.split("://")[0],a=Y(e);if(!a)return"";let c=on[a.key];if(c?.Display)return c.Display;if(a.key==="s3"){let d="http://null?"+i.split("?")[1],y=new URL(d).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[B,L]of Object.entries(nn))if(y.endsWith(B))return L}return a.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Re({type:n,selectors:[["app-home"]],decls:54,vars:11,consts:()=>{let i;i=$localize`Backups`;let e;e=$localize`Backups are stored in the cloud and can be restored at any time.`;let a;a=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let c;c=$localize`Restores`;let d;d=$localize`Restores allow you to restore your data from the cloud.`;let K;K=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let y;y=$localize`My backups`;let B;B=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let L;L=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ee;ee=$localize` Time: ${"\uFFFD#38\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ne;ne=$localize`Relative time`;let te;te=$localize`Actual time`;let ie;ie=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let oe;oe=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let ae;ae=$localize`Last successful backup:`;let _e;_e=$localize`Duration:`;let le;le=$localize`Source:`;let re;re=$localize`Destination:`;let G;G=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,G=W(G,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ce;ce=$localize` ${G}:ICU@@6502601490918455200: `;let se;se=$localize`Next scheduled run:`;let ue;ue=$localize`No backups founds`;let Fe;Fe=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let de;de=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let pe;pe=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let ge;ge=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Te;Te=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ce;Ce=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ee;Ee=$localize`Version`;let me;me=$localize`Actions`;let b;b=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,b=W(b,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Me;Me=$localize` ${b}:ICU@@3521773141017690117: `;let Oe;Oe=$localize`Loading backups...`;let Ne;Ne=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let De;De=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let fe;fe=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let $e;$e=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let Pe;Pe=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let Ie;Ie=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let Ae;Ae=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let he;he=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let He;return He=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],i,e,a,c,d,K,y,B,L,ee,ne,te,ie,oe,ae,_e,le,re,ce,se,ue,Fe,de,pe,ge,Te,Ce,Se,Ee,me,Me,Oe,Ne,De,fe,$e,Pe,Ie,Ae,he,He,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small"],["type","button",3,"click"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"active"],[1,"backups"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backup"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["table-header",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(e,a){if(e&1){let c=k();p(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",43),p(4,"img",44),o(5,"div",45)(6,"h3"),g(7,2),t(),o(8,"p"),g(9,3),t()(),o(10,"button",46),s(11,4),p(12,"sh-icon"),u(),t()(),o(13,"sh-card",43),p(14,"img",47),o(15,"div",45)(16,"h3"),g(17,5),t(),o(18,"p"),g(19,6),t()(),o(20,"button",46),s(21,7),p(22,"sh-icon"),u(),t()()(),o(23,"div",48)(24,"h2"),m(25),g(26,8),M(),o(27,"div",49)(28,"sh-button-group",50)(29,"button",51),I("click",function(){return D(c),f(a.viewMode.set("list"))}),s(30,9),p(31,"sh-icon"),u(),t(),o(32,"button",51),I("click",function(){return D(c),f(a.viewMode.set("details"))}),s(33,10),p(34,"sh-icon"),u(),t()(),o(35,"sh-menu",52)(36,"button",53),s(37,11),p(38,"strong")(39,"sh-icon"),u(),t(),m(40,54),o(41,"button",51),I("click",function(){return D(c),f(a.setTimeType("relative"))}),g(42,12),t(),o(43,"button",51),I("click",function(){return D(c),f(a.setTimeType("actual"))}),g(44,13),t(),M(),t(),C(45,Cn,8,1,"sh-menu",52),t()(),ke(46,Jn,2,1)(47,Qn,5,0),xe(48,46,_n,null,47),t()(),O(50,nt,44,29,"ng-template",null,0,J)(52,tt,6,0,"ng-template",null,1,J)}e&2&&(_(3),T("routerLink",q(9,ln)),_(10),T("routerLink",q(10,rn)),_(16),R("active",a.viewMode()==="list"),_(3),R("active",a.viewMode()==="details"),_(7),h(a.timeType()),H(37),_(6),S(a.viewMode()==="list"?45:-1),_(3),ye(!a.backupsLoading()))},dependencies:[Xe,tn,Ve,ze,Q,Ke,je,We,we],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}"],changeDetection:0})};export{Z as default};
1
+ import{a as Y,d as nn}from"./chunk-O2AAKP7A.js";import{a as tn}from"./chunk-NJEX2N4Q.js";import{a as en}from"./chunk-6LTGTS6B.js";import{a as Ze}from"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import{a as Ye}from"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{e as Xe}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as Q,f as we,g as ze,h as Ve,j as Ue,k as Ke,o as je,p as We,w as qe,x as Je}from"./chunk-H7K35UUX.js";import{h as Qe}from"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as o,Ac as P,Bb as t,Cb as p,Dc as N,Ec as x,Fc as A,Gb as m,H as j,Hb as M,Hc as J,Ib as $,Jb as k,Pc as ve,Qb as s,Ra as _,Rb as u,Sb as g,Tb as h,Ub as H,Vb as W,Wb as I,Yb as F,_ as v,bb as Re,ea as D,fa as f,gb as O,gc as U,hb as ke,ic as R,lc as r,mc as Be,nc as E,oa as X,qc as Le,rb as xe,rc as Ge,sb as ye,sc as be,ub as C,vb as S,wb as w,xb as z,yb as V,zb as T,zc as q}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var _n=()=>[import("./chunk-NQ27E6KP.js").then(n=>n.NgTemplateOutlet),Q,Ue,Je,qe,import("./chunk-DKTUN7FF.js").then(n=>n.DurationFormatPipe),import("./chunk-KLW6HEOS.js").then(n=>n.BytesPipe),import("./chunk-HI4XLHO3.js").then(n=>n.RelativeTimePipe)],ln=()=>["/add-backup"],rn=()=>["/restore"],an=n=>({$implicit:n}),cn=n=>["/backup",n],sn=n=>["/restore",n],un=n=>["/backup",n,"export"],Fn=n=>["/backup",n,"delete"],dn=n=>["/backup",n,"database"],pn=n=>["/backup",n,"commandline"],gn=n=>["/backup",n,"log"];function Tn(n,i){if(n&1){let e=k();o(0,"button",51),I("click",function(){let c=D(e).$implicit,d=F(2);return f(d.sortByColumn.set(c.value))}),g(1,15),t()}if(n&2){let e=i.$implicit,a=F(2);R("active",a.orderBy()===e.value),_(),h(e.label),H(1)}}function Cn(n,i){if(n&1&&(o(0,"sh-menu",52)(1,"button",53),s(2,14),p(3,"strong")(4,"sh-icon"),u(),t(),m(5,54),z(6,Tn,2,3,"button",55,w),M(),t()),n&2){let e=F();_(4),h(e.orderBy()),H(2),_(2),V(e.sortOrderOptions())}}function Sn(n,i){if(n&1&&(o(0,"p")(1,"span"),g(2,21),t(),r(3),N(4,"relativeTime"),t()),n&2){let e=F().$implicit,a=F(4);_(3),E(" ",A(4,1,e.Schedule==null?null:e.Schedule.Time,a.timeType()==="actual")," ")}}function En(n,i){if(n&1&&(r(0),N(1,"durationFormat")),n&2){let e=F().$implicit,a=F(4);E(" ",A(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration,a.timeType()==="actual")," ")}}function mn(n,i){n&1&&(m(0),r(1,"-"),M())}function Mn(n,i){if(n&1&&(r(0),N(1,"bytes")),n&2){let e=F().$implicit;E(" ",x(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function On(n,i){n&1&&(m(0),r(1,"-"),M())}function Nn(n,i){if(n&1&&(r(0),N(1,"bytes")),n&2){let e=F().$implicit;E(" ",x(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function Dn(n,i){n&1&&(m(0),r(1,"-"),M())}function fn(n,i){n&1&&$(0)}function $n(n,i){if(n&1&&(o(0,"div",58)(1,"div",45)(2,"h3"),r(3),o(4,"sh-chip")(5,"sh-icon"),r(6),t(),r(7),t()(),o(8,"p")(9,"span"),g(10,16),t(),r(11),N(12,"relativeTime"),t(),C(13,Sn,5,4,"p"),o(14,"p")(15,"span"),g(16,17),t(),C(17,En,2,4)(18,mn,2,0,"ng-container"),t(),o(19,"p")(20,"span"),g(21,18),t(),C(22,Mn,2,3)(23,On,2,0,"ng-container"),t(),o(24,"p")(25,"span"),g(26,19),t(),C(27,Nn,2,3)(28,Dn,2,0,"ng-container"),t()(),o(29,"sh-chip",59),g(30,20),t(),o(31,"div",49),O(32,fn,1,0,"ng-container",60),t()()),n&2){let e=i.$implicit,a=F(4),c=U(51);_(3),E(" ",(e.Backup==null?null:e.Backup.Name)??a.MISSING_BACKUP_NAME," "),_(3),Be(a.getBackendIcon(e.Backup==null?null:e.Backup.TargetURL)),_(),E(" ",a.getBackendType(e.Backup==null?null:e.Backup.TargetURL)," "),_(4),E(" ",A(12,12,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupFinished,a.timeType()==="actual")," "),_(2),S(e.Schedule!=null&&e.Schedule.Time?13:-1),_(4),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDuration?17:18),_(5),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.SourceFilesSize?22:23),_(5),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.TargetFilesSize?27:28);let d=a.getBackupVersionCount(e);_(3),h(d)(d),H(30),_(2),T("ngTemplateOutlet",c)("ngTemplateOutletContext",P(15,an,e))}}function Pn(n,i){if(n&1&&z(0,$n,33,17,"div",58,w),n&2){let e=F(3);V(e.backups())}}function In(n,i){n&1&&(m(0),g(1,22),M())}function An(n,i){if(n&1&&(o(0,"div",56),C(1,Pn,2,0)(2,In,2,0,"ng-container"),t()),n&2){let e=F(2);_(),S(e.backups().length?1:2)}}function hn(n,i){n&1&&(s(0,23,1),$(1),u())}function Hn(n,i){n&1&&(s(0,24,1),$(1),u())}function Rn(n,i){n&1&&(s(0,25,1),$(1),u())}function kn(n,i){n&1&&(s(0,26,1),$(1),u())}function xn(n,i){n&1&&(s(0,27,1),$(1),u())}function yn(n,i){n&1&&(s(0,28,1),$(1),u())}function Bn(n,i){n&1&&(s(0,29,1),$(1),u())}function Ln(n,i){if(n&1&&(r(0),N(1,"relativeTime")),n&2){let e=F().$implicit,a=F(3);E(" ",A(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDate,a.timeType()==="actual")," ")}}function Gn(n,i){n&1&&(m(0),r(1,"-"),M())}function bn(n,i){if(n&1&&(r(0),N(1,"relativeTime")),n&2){let e=F().$implicit,a=F(3);E(" ",A(1,1,e.Schedule==null?null:e.Schedule.Time,a.timeType()==="actual")," ")}}function vn(n,i){n&1&&(m(0),r(1,"-"),M())}function Xn(n,i){if(n&1&&(r(0),N(1,"durationFormat")),n&2){let e=F().$implicit,a=F(3);E(" ",A(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration,a.timeType()==="actual")," ")}}function wn(n,i){n&1&&(m(0),r(1,"-"),M())}function zn(n,i){if(n&1&&(r(0),N(1,"bytes")),n&2){let e=F().$implicit;E(" ",x(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function Vn(n,i){n&1&&(m(0),r(1,"-"),M())}function Un(n,i){if(n&1&&(r(0),N(1,"bytes")),n&2){let e=F().$implicit;E(" ",x(1,1,e.Backup==null||e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function Kn(n,i){n&1&&(m(0),r(1,"-"),M())}function jn(n,i){n&1&&$(0)}function Wn(n,i){if(n&1&&(o(0,"tr")(1,"td"),r(2),t(),o(3,"td"),r(4),t(),o(5,"td"),C(6,Ln,2,4)(7,Gn,2,0,"ng-container"),t(),o(8,"td"),C(9,bn,2,4)(10,vn,2,0,"ng-container"),t(),o(11,"td"),C(12,Xn,2,4)(13,wn,2,0,"ng-container"),t(),o(14,"td"),C(15,zn,2,3)(16,Vn,2,0,"ng-container"),t(),o(17,"td"),C(18,Un,2,3)(19,Kn,2,0,"ng-container"),t(),o(20,"td")(21,"span"),g(22,32),t()(),o(23,"td"),O(24,jn,1,0,"ng-container",60),t()()),n&2){let e=i.$implicit,a=F(3),c=U(51);_(2),E(" ",(e.Backup==null?null:e.Backup.Name)??a.MISSING_BACKUP_NAME," "),_(2),E(" ",a.getBackendType(e.Backup==null?null:e.Backup.TargetURL)," "),_(2),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDate?6:7),_(3),S(e.Schedule!=null&&e.Schedule.Time?9:10),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.LastBackupDuration?12:13),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.SourceFilesSize?15:16),_(3),S(!(e.Backup==null||e.Backup.Metadata==null)&&e.Backup.Metadata.TargetFilesSize?18:19);let d=a.getBackupVersionCount(e);_(4),h(d)(d),H(22),_(2),T("ngTemplateOutlet",c)("ngTemplateOutletContext",P(11,an,e))}}function qn(n,i){if(n&1){let e=k();o(0,"sh-table",61),be("sortByColumnChange",function(c){D(e);let d=F(2);return Ge(d.sortByColumn,c)||(d.sortByColumn=c),f(c)}),o(1,"tr",62)(2,"th",63),s(3,23),O(4,hn,2,0,"ng-container",64),u(),t(),o(5,"th",65),s(6,24),O(7,Hn,2,0,"ng-container",64),u(),t(),o(8,"th",66),s(9,25),O(10,Rn,2,0,"ng-container",64),u(),t(),o(11,"th",67),s(12,26),O(13,kn,2,0,"ng-container",64),u(),t(),o(14,"th",68),s(15,27),O(16,xn,2,0,"ng-container",64),u(),t(),o(17,"th",69),s(18,28),O(19,yn,2,0,"ng-container",64),u(),t(),o(20,"th",70),s(21,29),O(22,Bn,2,0,"ng-container",64),u(),t(),o(23,"th"),g(24,30),t(),o(25,"th"),g(26,31),t()(),z(27,Wn,25,13,"tr",null,w),t()}if(n&2){let e=F(2),a=U(53);T("data",e.backups())("loading",e.backupsLoading()),Le("sortByColumn",e.sortByColumn),_(4),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(3),T("ngTemplateOutlet",a),_(5),V(e.backups())}}function Jn(n,i){if(n&1&&C(0,An,3,1,"div",56)(1,qn,29,10,"sh-table",57),n&2){let e=F();S(e.viewMode()==="list"?0:e.viewMode()==="details"?1:-1)}}function Qn(n,i){n&1&&(o(0,"div",71),p(1,"sh-progress-bar",72),o(2,"div",45)(3,"h3"),g(4,33),t()()())}function Yn(n,i){n&1&&g(0,34,1)}function Zn(n,i){n&1&&(o(0,"sh-icon"),r(1,"check"),t())}function et(n,i){n&1&&(o(0,"sh-icon"),r(1,"dots-three-vertical"),t())}function nt(n,i){if(n&1){let e=k();o(0,"button",73),I("click",function(){let c=D(e).$implicit,d=F();return f(d.startBackup(c.Backup==null?null:c.Backup.ID))}),s(1,34),p(2,"sh-icon"),C(3,Yn,1,0),u(),t(),o(4,"button",74)(5,"sh-icon"),r(6,"pencil-simple"),t()(),o(7,"sh-menu")(8,"button",46),C(9,Zn,2,0,"sh-icon")(10,et,2,0,"sh-icon"),t(),m(11,54),o(12,"h3",75),r(13,"Operations"),t(),o(14,"button",76),s(15,35),p(16,"sh-icon"),u(),t(),o(17,"button",76),s(18,36),p(19,"sh-icon"),u(),t(),o(20,"button",76),s(21,37),p(22,"sh-icon"),u(),t(),p(23,"sh-divider"),o(24,"h3",75),r(25,"Advanced"),t(),o(26,"button",76),s(27,38),p(28,"sh-icon"),u(),t(),o(29,"button",51),I("click",function(){let c=D(e).$implicit,d=F();return f(d.verifyFiles(c.Backup==null?null:c.Backup.ID))}),s(30,39),p(31,"sh-icon"),u(),t(),o(32,"button",51),I("click",function(){let c=D(e).$implicit,d=F();return f(d.compressBackup(c.Backup==null?null:c.Backup.ID))}),s(33,40),p(34,"sh-icon"),u(),t(),o(35,"button",76),s(36,41),p(37,"sh-icon"),u(),t(),p(38,"sh-divider"),o(39,"h3",75),r(40,"Reporting"),t(),o(41,"button",76),s(42,42),p(43,"sh-icon"),u(),t(),M(),t()}if(n&2){let e=i.$implicit,a=F();R("loader",a.startingBackup()===(e.Backup==null?null:e.Backup.ID)),_(3),S(a.viewMode()==="list"?3:-1),_(),T("routerLink",P(15,cn,e.Backup==null?null:e.Backup.ID)),_(4),R("loader",a.loadingId()===(e.Backup==null?null:e.Backup.ID))("success",a.successId()===(e.Backup==null?null:e.Backup.ID)),_(),S(a.successId()===(e.Backup==null?null:e.Backup.ID)?9:10),_(5),T("routerLink",P(17,sn,e.Backup==null?null:e.Backup.ID)),_(3),T("routerLink",P(19,un,e.Backup==null?null:e.Backup.ID)),_(3),T("routerLink",P(21,Fn,e.Backup==null?null:e.Backup.ID)),_(6),T("routerLink",P(23,dn,e.Backup==null?null:e.Backup.ID)),_(9),T("routerLink",P(25,pn,e.Backup==null?null:e.Backup.ID)),_(6),T("routerLink",P(27,gn,e.Backup==null?null:e.Backup.ID))}}function tt(n,i){n&1&&(o(0,"sh-icon",77),r(1,"funnel-simple"),t(),o(2,"sh-icon",78),r(3,"sort-ascending"),t(),o(4,"sh-icon",79),r(5,"sort-descending"),t())}var on={file:{Display:$localize`Local`,Icon:null}},Z=class n{#n=v(Qe);#t=v(en);#e=v(Ze);MISSING_BACKUP_NAME=$localize`Backup name missing`;sortOrderOptions=this.#e.orderByOptions;orderBy=this.#e.orderBy;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;timeType=this.#e.timeType;viewMode=Ye("viewMode","list");sortByColumn=X(this.#e.orderBy());loadingId=X(null);successId=X(null);sortEffect=ve(()=>this.#e.setOrderBy(this.sortByColumn()));ngOnInit(){this.#e.getBackups(!0)}setOrderBy(i){this.#e.setOrderBy(i)}setTimeType(i){this.#e.setTimeType(i)}startBackup(i){this.#t.resumeDialogCheck(()=>this.#e.startBackup(i))}getBackendIcon(i){if(!i)return"";let e=i.split("://")[0],a=Y(e);return on[a.key]?.Icon??"database"}getBackendType(i){if(!i)return"";let e=i.split("://")[0],a=Y(e);if(!a)return"";let c=on[a.key];if(c?.Display)return c.Display;if(a.key==="s3"){let d="http://null?"+i.split("?")[1],y=new URL(d).searchParams.get("s3-server-name")?.toLowerCase()??"";for(let[B,L]of Object.entries(nn))if(y.endsWith(B))return L}return a.displayName}getBackupVersionCount(i){return parseInt(i?.Backup?.Metadata?.BackupListCount??"",10)||0}verifyFiles(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdVerify({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}compressBackup(i){this.loadingId.set(i),this.#n.postApiV1BackupByIdCompact({id:i}).pipe(j(()=>this.loadingId.set(null))).subscribe({next:()=>{this.successId.set(i),setTimeout(()=>this.successId.set(null),2e3)}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=Re({type:n,selectors:[["app-home"]],decls:54,vars:11,consts:()=>{let i;i=$localize`Backups`;let e;e=$localize`Backups are stored in the cloud and can be restored at any time.`;let a;a=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`;let c;c=$localize`Restores`;let d;d=$localize`Restores allow you to restore your data from the cloud.`;let K;K=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let y;y=$localize`My backups`;let B;B=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:rows${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: List `;let L;L=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:list${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Details `;let ee;ee=$localize` Time: ${"\uFFFD#38\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:clock${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ne;ne=$localize`Relative time`;let te;te=$localize`Actual time`;let ie;ie=$localize` Order by: ${"\uFFFD#3\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrows-down-up${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let oe;oe=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let ae;ae=$localize`Last successful backup:`;let _e;_e=$localize`Duration:`;let le;le=$localize`Source:`;let re;re=$localize`Destination:`;let G;G=$localize`{VAR_PLURAL, plural, =0 {No version yet} =1 {1 Version} other {{INTERPOLATION} Versions}}`,G=W(G,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let ce;ce=$localize` ${G}:ICU@@6502601490918455200: `;let se;se=$localize`Next scheduled run:`;let ue;ue=$localize`No backups founds`;let Fe;Fe=$localize` Backup ${"\uFFFD*4:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*4:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let de;de=$localize` Type ${"\uFFFD*7:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*7:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let pe;pe=$localize` Last backup ${"\uFFFD*10:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*10:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let ge;ge=$localize` Next run ${"\uFFFD*13:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*13:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Te;Te=$localize` Duration ${"\uFFFD*16:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*16:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ce;Ce=$localize` Source ${"\uFFFD*19:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*19:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Se;Se=$localize` Destination ${"\uFFFD*22:1\uFFFD\uFFFD#1:1\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD/#1:1\uFFFD\uFFFD/*22:1\uFFFD"}:CLOSE_TAG_NG_CONTAINER:`;let Ee;Ee=$localize`Version`;let me;me=$localize`Actions`;let b;b=$localize`{VAR_PLURAL, plural, =0 {No versions} =1 {1 Version} other {{INTERPOLATION} Versions}}`,b=W(b,{INTERPOLATION:"\uFFFD1\uFFFD",VAR_PLURAL:"\uFFFD0\uFFFD"});let Me;Me=$localize` ${b}:ICU@@3521773141017690117: `;let Oe;Oe=$localize`Loading backups...`;let Ne;Ne=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:play-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Start ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:`;let De;De=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Restore `;let fe;fe=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:export${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Export `;let $e;$e=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let Pe;Pe=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:database${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Database `;let Ie;Ie=$localize`${"\uFFFD#31\uFFFD"}:START_TAG_SH_ICON:check-square-offset${"\uFFFD/#31\uFFFD"}:CLOSE_TAG_SH_ICON: Verify files `;let Ae;Ae=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:file-archive${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Compress now `;let he;he=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:terminal-window${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Commandline `;let He;return He=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:notepad${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Log `,[["actions",""],["sortIcons",""],i,e,a,c,d,K,y,B,L,ee,ne,te,ie,oe,ae,_e,le,re,ce,se,ue,Fe,de,pe,ge,Te,Ce,Se,Ee,me,Me,Oe,Ne,De,fe,$e,Pe,Ie,Ae,he,He,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["type","button","shButton",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"actions"],[1,"small"],["type","button",3,"click"],[1,"table-overview"],["type","button","shButton","",1,"small"],["menu",""],["type","button",3,"active"],[1,"backups"],[1,"type-b",3,"data","loading","sortByColumn"],[1,"backup"],[1,"simple","success"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"type-b",3,"sortByColumnChange","data","loading","sortByColumn"],["table-header",""],["shSort","name"],[4,"ngTemplateOutlet"],["shSort","type"],["shSort","lastrun"],["shSort","nextrun"],["shSort","duration"],["shSort","sourcesize"],["shSort","destinationsize"],[1,"loading-list"],[1,"indeterminate","primary"],["shButton","",3,"click"],["type","button","shButton","",3,"routerLink"],["title",""],["type","button",3,"routerLink"],[1,"filter"],[1,"asc"],[1,"desc"]]},template:function(e,a){if(e&1){let c=k();p(0,"app-status-bar"),o(1,"section")(2,"header")(3,"sh-card",43),p(4,"img",44),o(5,"div",45)(6,"h3"),g(7,2),t(),o(8,"p"),g(9,3),t()(),o(10,"button",46),s(11,4),p(12,"sh-icon"),u(),t()(),o(13,"sh-card",43),p(14,"img",47),o(15,"div",45)(16,"h3"),g(17,5),t(),o(18,"p"),g(19,6),t()(),o(20,"button",46),s(21,7),p(22,"sh-icon"),u(),t()()(),o(23,"div",48)(24,"h2"),m(25),g(26,8),M(),o(27,"div",49)(28,"sh-button-group",50)(29,"button",51),I("click",function(){return D(c),f(a.viewMode.set("list"))}),s(30,9),p(31,"sh-icon"),u(),t(),o(32,"button",51),I("click",function(){return D(c),f(a.viewMode.set("details"))}),s(33,10),p(34,"sh-icon"),u(),t()(),o(35,"sh-menu",52)(36,"button",53),s(37,11),p(38,"strong")(39,"sh-icon"),u(),t(),m(40,54),o(41,"button",51),I("click",function(){return D(c),f(a.setTimeType("relative"))}),g(42,12),t(),o(43,"button",51),I("click",function(){return D(c),f(a.setTimeType("actual"))}),g(44,13),t(),M(),t(),C(45,Cn,8,1,"sh-menu",52),t()(),ke(46,Jn,2,1)(47,Qn,5,0),xe(48,46,_n,null,47),t()(),O(50,nt,44,29,"ng-template",null,0,J)(52,tt,6,0,"ng-template",null,1,J)}e&2&&(_(3),T("routerLink",q(9,ln)),_(10),T("routerLink",q(10,rn)),_(16),R("active",a.viewMode()==="list"),_(3),R("active",a.viewMode()==="details"),_(7),h(a.timeType()),H(37),_(6),S(a.viewMode()==="list"?45:-1),_(3),ye(!a.backupsLoading()))},dependencies:[Xe,tn,Ve,ze,Q,Ke,je,We,we],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.content[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{padding:0 2rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.sortable[_ngcontent-%COMP%]{-webkit-user-select:none;user-select:none}.sortable[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{margin-left:.5rem;font-size:1rem;justify-self:flex-end;display:none}.sortable[_ngcontent-%COMP%]:not(.sort-asc):not(.sort-desc) sh-icon.filter[_ngcontent-%COMP%]{display:block}.sortable.sort-asc[_ngcontent-%COMP%] sh-icon.asc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}.sortable.sort-desc[_ngcontent-%COMP%] sh-icon.desc[_ngcontent-%COMP%]{display:block;color:var(--base-12)}"],changeDetection:0})};export{Z as default};
@@ -1 +1 @@
1
- import{a}from"./chunk-62QANGOE.js";import"./chunk-ESUPNSKH.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as default};
1
+ import{a}from"./chunk-X7ZE7U56.js";import"./chunk-GEI2CH2J.js";import"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";export{a as default};
@@ -1,4 +1,4 @@
1
- import{a as it}from"./chunk-7IQY6U5W.js";import{a as ot}from"./chunk-TK5QY2QD.js";import{a as H,b as Je,c as Ye}from"./chunk-KDYD6LMI.js";import{h as nt}from"./chunk-VGUK4FJP.js";import{a as et,c as tt}from"./chunk-FZTPUMUC.js";import{a as B}from"./chunk-DELLEGXW.js";import{a as X}from"./chunk-VTSUHAP5.js";import{a as Qe,c as Ce,e as ge,i as fe,k as Ze,s as Te}from"./chunk-N5SC4SKW.js";import{A as je,C as qe,a as me,e as Be,g as ue,l as ze,o as Ke,p as Ue,t as Xe,z as He}from"./chunk-H7K35UUX.js";import{h as We}from"./chunk-NOPMCS2Z.js";import{ea as Re}from"./chunk-RUXCS4ZK.js";import{Ab as d,Ac as ce,Bb as _,Cb as U,Cc as pe,Gb as le,Hb as Z,Hc as ee,Ib as se,Jb as E,Oc as y,Pc as te,Qb as J,Ra as l,Rb as Y,Sb as Ae,Uc as Ie,V as G,Wb as x,Xc as ke,Y as ye,Yb as s,Zb as Oe,_ as v,_b as ve,ac as Fe,bb as re,bc as Me,cc as Ve,ea as S,f as ae,fa as h,gb as R,gc as z,ia as we,ic as de,lc as p,nc as F,oa as k,oc as _e,qc as Le,rc as be,sc as Pe,tc as b,ub as C,uc as A,vb as g,vc as c,wb as q,xb as W,yb as Q,yc as $e,zb as m,zc as Ge}from"./chunk-HNWRQABR.js";import{a as M,b as oe}from"./chunk-EUDKD2JW.js";var at=class n{#e=v(We);#t=v(Be);#n=v(X);testDestination(t,e,o,i){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i):this.testDestinationv1(t,e,o,i)}testDestinationv2(t,e,o,i){return new ae(a=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){this.emitSuccessV2(a,t,e,r);return}this.handleGenericError(a,t,e,r.Error??"Unknown error",i)},error:r=>{let u=r?.error?.body;if(u?.Data?.FolderExists===!1||u?.StatusCode==="missing-folder"){o?this.handleMissingFolder(a,t,e):this.handleGenericError(a,t,e,$localize`The remote destination folder does not exist.`,i);return}if(u?.Data?.HostCertificate){this.handleMissingCertificate(a,t,e,u.Data?.HostCertificate);return}if(u?.Data?.ReportedHostKey){this.handleIncorrectKey(a,t,e,u.Data.ReportedHostKey,u.Data.AcceptedHostKey??null);return}this.handleGenericError(a,t,e,r?.message??"Unknown error",i)}})})}testDestinationv1(t,e,o,i){return new ae(a=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:r=>{a.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:e}),a.complete()},error:r=>{this.handleDestinationErrorv1(r.message,t,e,o,i).subscribe(u=>{a.next(u)})}})})}handleMissingFolder(t,e,o){this.#t.open(B,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:i=>{if(!i){this.reportNoAction(t,e,o,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#t.open(B,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#t.open(B,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#t.open(B,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
1
+ import{a as it}from"./chunk-7IQY6U5W.js";import{a as ot}from"./chunk-TK5QY2QD.js";import{a as H,b as Je,c as Ye}from"./chunk-O2AAKP7A.js";import{h as nt}from"./chunk-VGUK4FJP.js";import{a as et,c as tt}from"./chunk-FZTPUMUC.js";import{a as B}from"./chunk-DELLEGXW.js";import{a as X}from"./chunk-VTSUHAP5.js";import{a as Qe,c as Ce,e as ge,i as fe,k as Ze,s as Te}from"./chunk-N5SC4SKW.js";import{A as je,C as qe,a as me,e as Be,g as ue,l as ze,o as Ke,p as Ue,t as Xe,z as He}from"./chunk-H7K35UUX.js";import{h as We}from"./chunk-NOPMCS2Z.js";import{ea as Re}from"./chunk-RUXCS4ZK.js";import{Ab as d,Ac as ce,Bb as _,Cb as U,Cc as pe,Gb as le,Hb as Z,Hc as ee,Ib as se,Jb as E,Oc as y,Pc as te,Qb as J,Ra as l,Rb as Y,Sb as Ae,Uc as Ie,V as G,Wb as x,Xc as ke,Y as ye,Yb as s,Zb as Oe,_ as v,_b as ve,ac as Fe,bb as re,bc as Me,cc as Ve,ea as S,f as ae,fa as h,gb as R,gc as z,ia as we,ic as de,lc as p,nc as F,oa as k,oc as _e,qc as Le,rc as be,sc as Pe,tc as b,ub as C,uc as A,vb as g,vc as c,wb as q,xb as W,yb as Q,yc as $e,zb as m,zc as Ge}from"./chunk-HNWRQABR.js";import{a as M,b as oe}from"./chunk-EUDKD2JW.js";var at=class n{#e=v(We);#t=v(Be);#n=v(X);testDestination(t,e,o,i){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,o,i):this.testDestinationv1(t,e,o,i)}testDestinationv2(t,e,o,i){return new ae(a=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){this.emitSuccessV2(a,t,e,r);return}this.handleGenericError(a,t,e,r.Error??"Unknown error",i)},error:r=>{let u=r?.error?.body;if(u?.Data?.FolderExists===!1||u?.StatusCode==="missing-folder"){o?this.handleMissingFolder(a,t,e):this.handleGenericError(a,t,e,$localize`The remote destination folder does not exist.`,i);return}if(u?.Data?.HostCertificate){this.handleMissingCertificate(a,t,e,u.Data?.HostCertificate);return}if(u?.Data?.ReportedHostKey){this.handleIncorrectKey(a,t,e,u.Data.ReportedHostKey,u.Data.AcceptedHostKey??null);return}this.handleGenericError(a,t,e,r?.message??"Unknown error",i)}})})}testDestinationv1(t,e,o,i){return new ae(a=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:r=>{a.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:e}),a.complete()},error:r=>{this.handleDestinationErrorv1(r.message,t,e,o,i).subscribe(u=>{a.next(u)})}})})}handleMissingFolder(t,e,o){this.#t.open(B,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:i=>{if(!i){this.reportNoAction(t,e,o,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:a=>{if(a.Success){this.emitSuccessV2(t,e,o,a);return}else this.handleFolderCreateFailure(t,e,o,a.Error??$localize`Unknown error`)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(t,e,o)},error:a=>{this.handleFolderCreateFailure(t,e,o,a.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,o,i){this.#t.open(B,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${i}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:o}),t.complete()}})}emitSuccessV2(t,e,o,i){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:o,anyFilesFound:!i.Data?.FolderIsEmpty,containsBackup:i.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:i.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,o){this.#t.open(B,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:o}),t.complete()}})}reportNoAction(t,e,o,i){t.next({action:"generic-error",targetUrl:e,errorMessage:i,testAgain:!1,destinationIndex:o}),t.complete()}handleMissingCertificate(t,e,o,i){this.#t.open(B,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
2
  If this is a self-signed certificate, you can choose to trust this certificate.
3
3
  The server reported the certificate hash: ${i}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:a=>{if(!a){this.reportNoAction(t,e,o,$localize`The server certificate is not trusted.`);return}t.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:i,destinationIndex:o}),t.complete()}})}handleIncorrectKey(t,e,o,i,a){a?this.#t.open(B,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
4
4
  otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
@@ -1 +1 @@
1
- import{g as ht}from"./chunk-7ZTBW6LJ.js";import{a as pt,b as Ot,c as Ct,d as mt,e as Rt}from"./chunk-QEHNEYWY.js";import"./chunk-7IQY6U5W.js";import"./chunk-K56EDP42.js";import"./chunk-TK5QY2QD.js";import{a as Dt}from"./chunk-KDYD6LMI.js";import{h as Et}from"./chunk-VGUK4FJP.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import{a as m}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as _t,e as ct,f as ut,g as Tt,i as gt,j as St,s as dt}from"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import{b as nt,d as it}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as ot,b as at,d as st,e as rt,l as Ft,o as lt}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as r,Cb as g,Gb as w,Hb as b,Jb as p,Oc as v,Qb as u,Ra as F,Rb as T,Sb as N,Tb as f,Ub as $,Vb as B,Vc as et,Wb as d,Yb as l,_ as O,bb as j,ea as _,ec as Q,fa as c,fc as q,ia as K,ic as Y,lc as I,mc as k,nc as J,oa as C,qc as A,rc as M,sc as y,ub as D,vb as E,wb as P,xb as x,yb as L,yc as Z,zb as h,zc as tt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var It=["formRef"],Nt=()=>({maxWidth:"700px",width:"100%"});function ft(i,n){if(i&1){let t=p();u(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),r(),T()}if(i&2){let t=l();F(),Y("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function $t(i,n){if(i&1){let t=p();u(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),r(),T()}}function At(i,n){i&1&&(s(0,"sh-alert"),u(1,5),g(2,"sh-icon",31),T(),r())}function Mt(i,n){i&1&&(s(0,"sh-alert",21),u(1,6),g(2,"sh-icon",31),T(),r())}function yt(i,n){if(i&1&&(s(0,"sh-alert",22),u(1,7),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),u(1,8),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function xt(i,n){if(i&1){let t=p();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),u(1,9),g(2,"strong")(3,"br")(4,"span",33),T(),r()}if(i&2){let t,o=l();F(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=p();s(0,"div",39),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),I(2),r(),s(3,"p"),I(4),r()()}if(i&2){let t=n.$implicit;F(2),k(t.displayName),F(2),k(t.description)}}function wt(i,n){if(i&1){let t=p();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),r()}if(i&2){let t=n.$implicit;F(2),J(" ",t.displayName," ")}}function bt(i,n){if(i&1&&(s(0,"div",34),x(1,Lt,5,2,"div",35,P),r(),s(3,"sh-menu",36)(4,"button",37),N(5,10),r(),w(6,19),x(7,wt,3,1,"button",38,P),b(),r()),i&2){let t=l();F(),L(t.destinationTypeOptionsFocused()),F(2),h("searchable",!0),F(4),L(t.destinationTypeOptions())}}function Bt(i,n){if(i&1){let t=p();s(0,"app-single-destination",41),y("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),r()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function kt(i,n){i&1&&(u(0,4,1),g(1,"sh-icon",28),T())}function vt(i,n){i&1&&(u(0,4,2),g(1,"sh-icon"),T())}function Gt(i,n){if(i&1){let t=p();s(0,"sh-dialog",42),y("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),N(3,11),r(),s(4,"sh-alert",22),N(5,12),r()(),s(6,"div",44)(7,"sh-form-field")(8,"textarea",45),y("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),r()()(),s(9,"footer",46)(10,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(11,"Cancel"),r(),s(12,"button",47),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),u(13,13),g(14,"sh-icon"),T(),r()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),h("options",tt(3,Nt)),F(8),A("ngModel",t.targetUrlCtrl)}}var G=class i{#i=O(it);#o=O(nt);#e=O(rt);#a=O(pt);injector=O(K);#t=O(ht);#s=O(Ot);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=C(null);targetUrlInitial=C(null);targetUrlDialogOpen=C(!1);toggleNewDestination=C(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=C(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=v(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=v(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Dt(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let R=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(m,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=j({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&Q(o.formRef,It,5),t&2&&q()},features:[Z([Et,{provide:mt,useClass:Ct}])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=B(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=B(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let R;R=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let W;W=$localize`All destinations`;let z;z=$localize`Edit target URL`;let H;H=$localize`Be careful, this will overwrite everything you have in your destination.`;let X;return X=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,R,U,V,W,z,H,X,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled","loader"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"sh-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["shButton","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=p();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),u(4,2),s(5,"div",16),D(6,ft,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),r(),w(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),r(),D(13,$t,3,0,"button",18),b(),r()(),T(),r(),D(14,At,3,0,"sh-alert")(15,Mt,3,0,"sh-alert",21)(16,yt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,xt,5,1,"p"),r(),D(19,bt,9,1),D(20,Bt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),u(23,3),g(24,"sh-icon"),T(),r(),s(25,"button",27),u(26,4),D(27,kt,2,0,"sh-icon",28)(28,vt,2,0,"sh-icon"),T(),r()()(),D(29,Gt,15,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();F(6),E(e?6:-1),F(7),E(e?13:-1),F(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),F(4),E(e?18:-1),F(),E(e?-1:19),F(),E(e?20:-1),F(5),h("disabled",o.testSignal()=="testing"||!e),F(2),E(o.testSignal()=="testing"?27:28),F(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,dt,St,_t,ct,ut,gt,Tt,Ft,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{G as default};
1
+ import{g as ht}from"./chunk-7ZTBW6LJ.js";import{a as pt,b as Ot,c as Ct,d as mt,e as Rt}from"./chunk-CMYPDFDT.js";import"./chunk-7IQY6U5W.js";import"./chunk-K56EDP42.js";import"./chunk-TK5QY2QD.js";import{a as Dt}from"./chunk-O2AAKP7A.js";import{h as Et}from"./chunk-VGUK4FJP.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import"./chunk-UIJYCGKA.js";import{a as m}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import{c as _t,e as ct,f as ut,g as Tt,i as gt,j as St,s as dt}from"./chunk-N5SC4SKW.js";import"./chunk-UKQFDBNO.js";import{b as nt,d as it}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as ot,b as at,d as st,e as rt,l as Ft,o as lt}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as r,Cb as g,Gb as w,Hb as b,Jb as p,Oc as v,Qb as u,Ra as F,Rb as T,Sb as N,Tb as f,Ub as $,Vb as B,Vc as et,Wb as d,Yb as l,_ as O,bb as j,ea as _,ec as Q,fa as c,fc as q,ia as K,ic as Y,lc as I,mc as k,nc as J,oa as C,qc as A,rc as M,sc as y,ub as D,vb as E,wb as P,xb as x,yb as L,yc as Z,zb as h,zc as tt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var It=["formRef"],Nt=()=>({maxWidth:"700px",width:"100%"});function ft(i,n){if(i&1){let t=p();u(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),r(),T()}if(i&2){let t=l();F(),Y("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function $t(i,n){if(i&1){let t=p();u(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),r(),T()}}function At(i,n){i&1&&(s(0,"sh-alert"),u(1,5),g(2,"sh-icon",31),T(),r())}function Mt(i,n){i&1&&(s(0,"sh-alert",21),u(1,6),g(2,"sh-icon",31),T(),r())}function yt(i,n){if(i&1&&(s(0,"sh-alert",22),u(1,7),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),u(1,8),g(2,"sh-icon",31),T(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function xt(i,n){if(i&1){let t=p();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),u(1,9),g(2,"strong")(3,"br")(4,"span",33),T(),r()}if(i&2){let t,o=l();F(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=p();s(0,"div",39),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),I(2),r(),s(3,"p"),I(4),r()()}if(i&2){let t=n.$implicit;F(2),k(t.displayName),F(2),k(t.description)}}function wt(i,n){if(i&1){let t=p();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),r()}if(i&2){let t=n.$implicit;F(2),J(" ",t.displayName," ")}}function bt(i,n){if(i&1&&(s(0,"div",34),x(1,Lt,5,2,"div",35,P),r(),s(3,"sh-menu",36)(4,"button",37),N(5,10),r(),w(6,19),x(7,wt,3,1,"button",38,P),b(),r()),i&2){let t=l();F(),L(t.destinationTypeOptionsFocused()),F(2),h("searchable",!0),F(4),L(t.destinationTypeOptions())}}function Bt(i,n){if(i&1){let t=p();s(0,"app-single-destination",41),y("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),r()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function kt(i,n){i&1&&(u(0,4,1),g(1,"sh-icon",28),T())}function vt(i,n){i&1&&(u(0,4,2),g(1,"sh-icon"),T())}function Gt(i,n){if(i&1){let t=p();s(0,"sh-dialog",42),y("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"h2"),N(3,11),r(),s(4,"sh-alert",22),N(5,12),r()(),s(6,"div",44)(7,"sh-form-field")(8,"textarea",45),y("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),r()()(),s(9,"footer",46)(10,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(11,"Cancel"),r(),s(12,"button",47),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),u(13,13),g(14,"sh-icon"),T(),r()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),h("options",tt(3,Nt)),F(8),A("ngModel",t.targetUrlCtrl)}}var G=class i{#i=O(it);#o=O(nt);#e=O(rt);#a=O(pt);injector=O(K);#t=O(ht);#s=O(Ot);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=C(null);targetUrlInitial=C(null);targetUrlDialogOpen=C(!1);toggleNewDestination=C(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=C(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=v(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=v(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Dt(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(m,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let R=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${R?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(m,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(m,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=j({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&Q(o.formRef,It,5),t&2&&q()},features:[Z([Et,{provide:mt,useClass:Ct}])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=B(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=B(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let R;R=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let W;W=$localize`All destinations`;let z;z=$localize`Edit target URL`;let H;H=$localize`Be careful, this will overwrite everything you have in your destination.`;let X;return X=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,R,U,V,W,z,H,X,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled","loader"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"sh-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["shButton","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=p();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),u(4,2),s(5,"div",16),D(6,ft,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),r(),w(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),r(),D(13,$t,3,0,"button",18),b(),r()(),T(),r(),D(14,At,3,0,"sh-alert")(15,Mt,3,0,"sh-alert",21)(16,yt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,xt,5,1,"p"),r(),D(19,bt,9,1),D(20,Bt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),u(23,3),g(24,"sh-icon"),T(),r(),s(25,"button",27),u(26,4),D(27,kt,2,0,"sh-icon",28)(28,vt,2,0,"sh-icon"),T(),r()()(),D(29,Gt,15,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();F(6),E(e?6:-1),F(7),E(e?13:-1),F(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),F(4),E(e?18:-1),F(),E(e?-1:19),F(),E(e?20:-1),F(5),h("disabled",o.testSignal()=="testing"||!e),F(2),E(o.testSignal()=="testing"?27:28),F(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,dt,St,_t,ct,ut,gt,Tt,Ft,lt,ot,st,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{G as default};
@@ -1 +1 @@
1
- import{a as S}from"./chunk-NJEX2N4Q.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{c as O,e as C,f as d}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{y as M}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as e,Bb as t,Cb as l,Sb as n,bb as A}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var s=class a{static \u0275fac=function(o){return new(o||a)};static \u0275cmp=A({type:a,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let _;_=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let g;g=$localize`System info`;let u;u=$localize`Server settings`;let T;T=$localize`Logs`;let c;return c=$localize`Crash log`,[_,o,r,g,u,T,c,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(l(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),l(18,"router-outlet"),t()())},dependencies:[S,M,O,C,d],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding-left:2rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{s as default};
1
+ import{a as S}from"./chunk-NJEX2N4Q.js";import"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{c as O,e as C,f as d}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{y as M}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-TDKBGGNK.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import"./chunk-6OPAGPKF.js";import{Ab as e,Bb as t,Cb as l,Sb as n,bb as A}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var s=class a{static \u0275fac=function(o){return new(o||a)};static \u0275cmp=A({type:a,selectors:[["app-about"]],decls:19,vars:0,consts:()=>{let _;_=$localize`General`;let o;o=$localize`Changelog`;let r;r=$localize`Libraries`;let g;g=$localize`System info`;let u;u=$localize`Server settings`;let T;T=$localize`Logs`;let c;return c=$localize`Crash log`,[_,o,r,g,u,T,c,[1,"content"],[1,"primary"],["tab","","routerLink","/about/general","routerLinkActive","active"],["tab","","routerLink","/about/changelog","routerLinkActive","active"],["tab","","routerLink","/about/libraries","routerLinkActive","active"],["tab","","routerLink","/about/system-info","routerLinkActive","active"],["tab","","routerLink","/about/server-settings","routerLinkActive","active"],["tab","","routerLink","/about/logs","routerLinkActive","active"],["tab","","routerLink","/about/crashlogs","routerLinkActive","active"]]},template:function(o,r){o&1&&(l(0,"app-status-bar"),e(1,"div",7)(2,"sh-tabs",8)(3,"button",9),n(4,0),t(),e(5,"button",10),n(6,1),t(),e(7,"button",11),n(8,2),t(),e(9,"button",12),n(10,3),t(),e(11,"button",13),n(12,4),t(),e(13,"button",14),n(14,5),t(),e(15,"button",15),n(16,6),t()(),e(17,"section"),l(18,"router-outlet"),t()())},dependencies:[S,M,O,C,d],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:0}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 0}.content[_ngcontent-%COMP%] sh-tabs[_ngcontent-%COMP%]{margin:0 2rem 2rem}.content[_ngcontent-%COMP%] section[_ngcontent-%COMP%]{padding:0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:2rem}"],changeDetection:0})};export{s as default};
@@ -0,0 +1 @@
1
+ import{h as d}from"./chunk-NOPMCS2Z.js";import{H as o,Oc as s,Pc as g,V as r,_ as n,oa as l}from"./chunk-HNWRQABR.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=n(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):this.clearPolling()});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(o(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let i=e.reverse(),t=this.#i(i);t>0&&this.id.set(t),this.#e.set([...i,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e),e==="Disabled"&&this.clearPolling()}#i(e){return e.reduce((i,t)=>Math.max(i,t.ID),0)}destroy(){this.logLevel.set("Disabled"),this.clearPolling()}clearPolling(){this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=r({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
@@ -1 +1 @@
1
- import{a as z}from"./chunk-ESUPNSKH.js";import{a as x,c as B,d as w,e as U,f as k}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as X,f as H,o as V}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as t,Cb as _,Gb as f,Hb as P,Jb as R,Qb as l,Ra as O,Rb as s,Sb as b,Tb as v,Ub as y,Wb as u,Yb as c,_ as T,bb as D,ea as a,fa as S,oa as $,ub as N,vb as G,zb as M}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function W(g,F){if(g&1){let n=R();i(0,"sh-menu",15)(1,"button",16),b(2,2),t(),f(3,17),i(4,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"sh-icon"),s(),t(),i(7,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"sh-icon"),s(),t(),i(10,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"sh-icon"),s(),t(),i(13,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"sh-icon"),s(),t(),i(16,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Retry"))}),l(17,7),_(18,"sh-icon"),s(),t(),i(19,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Information"))}),l(20,8),_(21,"sh-icon"),s(),t(),i(22,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"sh-icon"),s(),t(),i(25,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Warning"))}),l(26,10),_(27,"sh-icon"),s(),t(),i(28,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Error"))}),l(29,11),_(30,"sh-icon"),s(),t(),P(),t()}if(g&2){let n=c();M("openIndicator",!0),O(2),v(n.logLevelByLabel()),y(2)}}var C=class g{#n=T(w);#e=T(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=$(this.#n.url);constructor(){this.#n.events.subscribe(F=>{F instanceof x&&this.currentUrl.set(F.urlAfterRedirects)})}updateLogLevel(F){this.#e.isPolling.set(!0),this.#e.updateLogLevel(F)}static \u0275fac=function(n){return new(n||g)};static \u0275cmp=D({type:g,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let F;F=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Disabled `;let L;L=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Verbose `;let d;d=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Explicit only `;let h;h=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Profiling `;let I;I=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Retry `;let E;E=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Information `;let A;A=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Dry run `;let m;m=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON: Warning `;let p;return p=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: Error `,[F,n,o,e,L,d,h,I,E,A,m,p,[1,"filters"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"sh-button-group")(2,"button",13),l(3,0),_(4,"sh-icon"),s(),t(),i(5,"button",14),l(6,1),_(7,"sh-icon"),s(),t()(),N(8,W,31,2,"sh-menu",15),t(),_(9,"router-outlet")),n&2&&(O(8),G(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[H,X,V,B,k,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:0 2rem;margin-bottom:1.25rem}"],changeDetection:0})};export{C as default};
1
+ import{a as z}from"./chunk-GEI2CH2J.js";import{a as x,c as B,d as w,e as U,f as k}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as X,f as H,o as V}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as t,Cb as _,Gb as f,Hb as P,Jb as R,Qb as l,Ra as O,Rb as s,Sb as b,Tb as v,Ub as y,Wb as u,Yb as c,_ as T,bb as D,ea as a,fa as S,oa as $,ub as N,vb as G,zb as M}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function W(g,F){if(g&1){let n=R();i(0,"sh-menu",15)(1,"button",16),b(2,2),t(),f(3,17),i(4,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"sh-icon"),s(),t(),i(7,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"sh-icon"),s(),t(),i(10,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"sh-icon"),s(),t(),i(13,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"sh-icon"),s(),t(),i(16,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Retry"))}),l(17,7),_(18,"sh-icon"),s(),t(),i(19,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Information"))}),l(20,8),_(21,"sh-icon"),s(),t(),i(22,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"sh-icon"),s(),t(),i(25,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Warning"))}),l(26,10),_(27,"sh-icon"),s(),t(),i(28,"button",18),u("click",function(){a(n);let e=c();return S(e.updateLogLevel("Error"))}),l(29,11),_(30,"sh-icon"),s(),t(),P(),t()}if(g&2){let n=c();M("openIndicator",!0),O(2),v(n.logLevelByLabel()),y(2)}}var C=class g{#n=T(w);#e=T(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=$(this.#n.url);constructor(){this.#n.events.subscribe(F=>{F instanceof x&&this.currentUrl.set(F.urlAfterRedirects)})}updateLogLevel(F){this.#e.isPolling.set(!0),this.#e.updateLogLevel(F)}static \u0275fac=function(n){return new(n||g)};static \u0275cmp=D({type:g,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let F;F=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Disabled `;let L;L=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Verbose `;let d;d=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Explicit only `;let h;h=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Profiling `;let I;I=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Retry `;let E;E=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Information `;let A;A=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Dry run `;let m;m=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON: Warning `;let p;return p=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: Error `,[F,n,o,e,L,d,h,I,E,A,m,p,[1,"filters"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"sh-button-group")(2,"button",13),l(3,0),_(4,"sh-icon"),s(),t(),i(5,"button",14),l(6,1),_(7,"sh-icon"),s(),t()(),N(8,W,31,2,"sh-menu",15),t(),_(9,"router-outlet")),n&2&&(O(8),G(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[H,X,V,B,k,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:0 2rem;margin-bottom:1.25rem}"],changeDetection:0})};export{C as default};
@@ -1 +1 @@
1
- import{a as xt,b as Lt,c as Rt,d as Ut,e as wt}from"./chunk-QEHNEYWY.js";import"./chunk-7IQY6U5W.js";import"./chunk-TK5QY2QD.js";import{a as Pt}from"./chunk-KDYD6LMI.js";import{h as Bt}from"./chunk-VGUK4FJP.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import{a as $}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as b,e as v,f as At,g as $t,i as k,j as Mt,r as yt,s as G}from"./chunk-N5SC4SKW.js";import{b as St,d as Ct}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as U,b as ht,d as It,e as Nt,g as ft,h as Ot,l as w,o as Et}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as F,Cb as c,Gb as Ft,Hb as rt,Jb as g,Oa as it,Oc as L,Qb as u,Ra as r,Rb as _,Sb as B,Tb as z,Tc as gt,Ub as H,Uc as pt,Vb as X,Vc as mt,Wb as D,Yb as l,Zb as lt,_ as C,_b as ct,bb as f,ea as d,ec as ut,fa as T,fc as _t,ia as nt,ic as dt,lc as x,mc as W,oa as I,qc as O,rc as E,sc as A,tc as j,ub as m,uc as q,vb as S,vc as R,wb as ot,wc as Q,xb as at,yb as st,yc as Tt,zb as h,zc as Dt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var kt=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:kt,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,n){if(t&1&&(lt(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),x(4),F(),s(5,"div",4),x(6),F(),s(7,"div",5),ct(8),F()()),t&2){let i=n.destination();r(2),h("src",Q(i.icon),it)("alt",Q(i.displayName)),r(2),W(i.displayName),r(2),W(i.description)}},dependencies:[Ot],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function Kt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let i=d(t).$implicit,a=l();return T(a.setDestination.emit(i.key))}),u(2,0),c(3,"sh-icon"),_(),F()()}if(o&2){let t=e.$implicit;h("destination",t)}}var K=class o{#i=C(Lt);setDestination=gt();destinationSearchTerm=I("");destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let e=new Set(this.destinationTypeOptionsInFocus()),t=this.destinationTypeOptions(),n=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((a,N)=>{let y=e.has(a.key),P=e.has(N.key);return y&&!P?-1:!y&&P?1:0});return n?i.filter(a=>a.displayName.toLowerCase().includes(n)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let e;e=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",e,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,n){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return E(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),F()(),s(2,"div",2),at(3,Kt,4,1,"app-destination-list-item",3,ot),F()),t&2&&(r(),O("ngModel",n.destinationSearchTerm),r(2),st(n.destinationTypeOptionsFocused()))},dependencies:[M,G,b,v,k,w,ft,U],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Vt=["formRef"],zt=()=>({maxWidth:"700px",width:"100%"});function Ht(o,e){if(o&1){let t=g();u(0,1,1),s(1,"button",28),D("click",function(){d(t);let i=l();return T(i.testDestination(0,!0))}),F(),_()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function Xt(o,e){if(o&1){let t=g();u(0,1,2),s(1,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(2,"sh-icon"),F(),_()}}function Wt(o,e){if(o&1){let t=g();u(0,1,4),s(1,"button",29),D("click",function(){d(t);let i=l(2);return T(i.copyTargetUrl())}),c(2,"sh-icon"),F(),_()}}function jt(o,e){if(o&1){let t=g();u(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),Ft(4,30),s(5,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(6,"sh-icon"),F(),m(7,Wt,3,0,"button",17),rt(),F(),_()}if(o&2){l();let t=R(0);r(7),S(t?7:-1)}}function qt(o,e){o&1&&(s(0,"sh-alert"),u(1,4),c(2,"sh-icon",31),_(),F())}function Qt(o,e){o&1&&(s(0,"sh-alert",18),u(1,5),c(2,"sh-icon",31),_(),F())}function Yt(o,e){if(o&1&&(s(0,"sh-alert",19),u(1,6),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Jt(o,e){if(o&1&&(s(0,"sh-alert",20),u(1,7),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Zt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){d(t);let i=l();return T(i.removeDestination())}),B(2,8),F()()}if(o&2){l();let t=R(14);h("destination",t)}}function te(o,e){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(i){d(t);let a=l();return T(a.setDestination(i))}),F()}}function ee(o,e){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(i){d(t);let a=l();return E(a.targetUrlModel,i)||(a.targetUrlModel=i),T(i)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel)}}function ne(o,e){o&1&&(u(0,3,1),c(1,"sh-icon",26),_())}function ie(o,e){o&1&&(u(0,3,2),c(1,"sh-icon"),_())}function oe(o,e){o&1&&(s(0,"h2"),B(1,11),F())}function ae(o,e){o&1&&(s(0,"h2"),B(1,12),F())}function se(o,e){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(i){d(t);let a=l();return E(a.targetUrlDialogOpen,i)||(a.targetUrlDialogOpen=i),T(i)}),s(1,"header",35),m(2,oe,2,0,"h2")(3,ae,2,0,"h2"),s(4,"sh-alert",19),B(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(i){d(t);let a=l();return E(a.targetUrlCtrl,i)||(a.targetUrlCtrl=i),T(i)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!1))}),x(11,"Cancel"),F(),s(12,"button",39),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!0))}),u(13,10),c(14,"sh-icon"),_(),F()()()}if(o&2){let t=l(),n=R(0);O("isOpen",t.targetUrlDialogOpen),h("options",Dt(4,zt)),r(2),S(n?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new yt,we=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),be=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>V.group({destinationType:V.control(o),custom:e,dynamic:t,advanced:n}),Y=class o{#i=C(Ct);#o=C(St);#t=C(Bt);#e=C(Nt);#a=C(xt);injector=C(nt);formRef=mt.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=L(()=>{let e=this.targetUrlModel();if(!e)return null;let t=e.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=L(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let e=this.targetUrlModel();this.targetUrlCtrl.set(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!e||t===n||!t||this.#t.setTargetUrl(t)}testDestination(e,t,n){let i=this.targetUrlModel();i&&(this.#t.setTestState("testing"),this.#a.testDestination(i,e,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let N=i.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(i+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(i+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(e){this.#t.setTargetUrl(`${e}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let e=this.#t.isNew(),t=this.testSignal();if(!e){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&ut(n.formRef,Vt,5),t&2&&_t()},features:[Tt([{provide:Ut,useClass:Rt}])],decls:27,vars:11,consts:()=>{let e;e=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,e=X(e);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=X(n);let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let y;y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`Change`;let J;J=$localize`Be careful, this will overwrite everything you have in your destination.`;let Z;Z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let tt;tt=$localize`Set target URL`;let et;return et=$localize`Edit target URL`,[["formRef",""],e,t,n,i,a,N,y,P,J,Z,tt,et,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let i=g();j(0),s(1,"form",13,0),D("submit",function(){return d(i),T(n.next())}),s(3,"header")(4,"h3",14),u(5,1),s(6,"div",15),m(7,Ht,2,3,"button",16),m(8,Xt,3,0,"button",17)(9,jt,8,1,"sh-menu"),F(),_(),F(),m(10,qt,3,0,"sh-alert")(11,Qt,3,0,"sh-alert",18)(12,Yt,3,1,"sh-alert",19)(13,Jt,3,1,"sh-alert",20),j(14),m(15,Zt,3,1,"app-destination-list-item",21),F(),m(16,te,1,0,"app-destination-list"),m(17,ee,1,1,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return d(i),T(n.goBack())}),u(20,2),c(21,"sh-icon"),_(),F(),s(22,"button",25),u(23,3),m(24,ne,2,0,"sh-icon",26)(25,ie,2,0,"sh-icon"),_(),F()()(),m(26,se,15,5,"sh-dialog",27)}if(t&2){let i=q(!!n.targetUrlModel());r(7),S(i?7:-1),r(),S(i?9:8),r(2),S(n.testSignal()=="testing"?10:n.testSignal()=="success"?11:n.testSignal()=="warning"?12:n.testSignal()=="error"?13:-1),r(4);let a=q(n.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(i?-1:16),r(),S(i?17:-1),r(5),h("disabled",n.testSignal()=="testing"||!i),r(2),S(n.testSignal()=="testing"?24:25),r(2),S(n.targetUrlDialogOpen()?26:-1)}},dependencies:[wt,K,M,G,Mt,b,v,At,k,$t,w,Et,U,It,ht],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;overflow:hidden;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{we as createDestinationForm,be as createDestinationFormGroup,Y as default};
1
+ import{a as xt,b as Lt,c as Rt,d as Ut,e as wt}from"./chunk-CMYPDFDT.js";import"./chunk-7IQY6U5W.js";import"./chunk-TK5QY2QD.js";import{a as Pt}from"./chunk-O2AAKP7A.js";import{h as Bt}from"./chunk-VGUK4FJP.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-2QJC4PGQ.js";import"./chunk-O64ZZGQZ.js";import{a as $}from"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{c as b,e as v,f as At,g as $t,i as k,j as Mt,r as yt,s as G}from"./chunk-N5SC4SKW.js";import{b as St,d as Ct}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as U,b as ht,d as It,e as Nt,g as ft,h as Ot,l as w,o as Et}from"./chunk-H7K35UUX.js";import"./chunk-NOPMCS2Z.js";import"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as s,Bb as F,Cb as c,Gb as Ft,Hb as rt,Jb as g,Oa as it,Oc as L,Qb as u,Ra as r,Rb as _,Sb as B,Tb as z,Tc as gt,Ub as H,Uc as pt,Vb as X,Vc as mt,Wb as D,Yb as l,Zb as lt,_ as C,_b as ct,bb as f,ea as d,ec as ut,fa as T,fc as _t,ia as nt,ic as dt,lc as x,mc as W,oa as I,qc as O,rc as E,sc as A,tc as j,ub as m,uc as q,vb as S,vc as R,wb as ot,wc as Q,xb as at,yb as st,yc as Tt,zb as h,zc as Dt}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var kt=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:kt,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,n){if(t&1&&(lt(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),x(4),F(),s(5,"div",4),x(6),F(),s(7,"div",5),ct(8),F()()),t&2){let i=n.destination();r(2),h("src",Q(i.icon),it)("alt",Q(i.displayName)),r(2),W(i.displayName),r(2),W(i.description)}},dependencies:[Ot],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function Kt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let i=d(t).$implicit,a=l();return T(a.setDestination.emit(i.key))}),u(2,0),c(3,"sh-icon"),_(),F()()}if(o&2){let t=e.$implicit;h("destination",t)}}var K=class o{#i=C(Lt);setDestination=gt();destinationSearchTerm=I("");destinationTypeOptionsInFocus=I(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let e=new Set(this.destinationTypeOptionsInFocus()),t=this.destinationTypeOptions(),n=this.destinationSearchTerm().toLowerCase(),i=[...t].sort((a,N)=>{let y=e.has(a.key),P=e.has(N.key);return y&&!P?-1:!y&&P?1:0});return n?i.filter(a=>a.displayName.toLowerCase().includes(n)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let e;e=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",e,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,n){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return E(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),F()(),s(2,"div",2),at(3,Kt,4,1,"app-destination-list-item",3,ot),F()),t&2&&(r(),O("ngModel",n.destinationSearchTerm),r(2),st(n.destinationTypeOptionsFocused()))},dependencies:[M,G,b,v,k,w,ft,U],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Vt=["formRef"],zt=()=>({maxWidth:"700px",width:"100%"});function Ht(o,e){if(o&1){let t=g();u(0,1,1),s(1,"button",28),D("click",function(){d(t);let i=l();return T(i.testDestination(0,!0))}),F(),_()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),h("disabled",t.testSignal()=="testing")}}function Xt(o,e){if(o&1){let t=g();u(0,1,2),s(1,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(2,"sh-icon"),F(),_()}}function Wt(o,e){if(o&1){let t=g();u(0,1,4),s(1,"button",29),D("click",function(){d(t);let i=l(2);return T(i.copyTargetUrl())}),c(2,"sh-icon"),F(),_()}}function jt(o,e){if(o&1){let t=g();u(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),Ft(4,30),s(5,"button",29),D("click",function(){d(t);let i=l();return T(i.openTargetUrlDialog())}),c(6,"sh-icon"),F(),m(7,Wt,3,0,"button",17),rt(),F(),_()}if(o&2){l();let t=R(0);r(7),S(t?7:-1)}}function qt(o,e){o&1&&(s(0,"sh-alert"),u(1,4),c(2,"sh-icon",31),_(),F())}function Qt(o,e){o&1&&(s(0,"sh-alert",18),u(1,5),c(2,"sh-icon",31),_(),F())}function Yt(o,e){if(o&1&&(s(0,"sh-alert",19),u(1,6),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Jt(o,e){if(o&1&&(s(0,"sh-alert",20),u(1,7),c(2,"sh-icon",31),_(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Zt(o,e){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){d(t);let i=l();return T(i.removeDestination())}),B(2,8),F()()}if(o&2){l();let t=R(14);h("destination",t)}}function te(o,e){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(i){d(t);let a=l();return T(a.setDestination(i))}),F()}}function ee(o,e){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(i){d(t);let a=l();return E(a.targetUrlModel,i)||(a.targetUrlModel=i),T(i)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel)}}function ne(o,e){o&1&&(u(0,3,1),c(1,"sh-icon",26),_())}function ie(o,e){o&1&&(u(0,3,2),c(1,"sh-icon"),_())}function oe(o,e){o&1&&(s(0,"h2"),B(1,11),F())}function ae(o,e){o&1&&(s(0,"h2"),B(1,12),F())}function se(o,e){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(i){d(t);let a=l();return E(a.targetUrlDialogOpen,i)||(a.targetUrlDialogOpen=i),T(i)}),s(1,"header",35),m(2,oe,2,0,"h2")(3,ae,2,0,"h2"),s(4,"sh-alert",19),B(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(i){d(t);let a=l();return E(a.targetUrlCtrl,i)||(a.targetUrlCtrl=i),T(i)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!1))}),x(11,"Cancel"),F(),s(12,"button",39),D("click",function(){d(t);let i=l();return T(i.closeTargetUrlDialog(!0))}),u(13,10),c(14,"sh-icon"),_(),F()()()}if(o&2){let t=l(),n=R(0);O("isOpen",t.targetUrlDialogOpen),h("options",Dt(4,zt)),r(2),S(n?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new yt,we=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),be=({key:o,customGroup:e,dynamicGroup:t,advancedGroup:n})=>V.group({destinationType:V.control(o),custom:e,dynamic:t,advanced:n}),Y=class o{#i=C(Ct);#o=C(St);#t=C(Bt);#e=C(Nt);#a=C(xt);injector=C(nt);formRef=mt.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=I(null);targetUrlInitial=I(null);targetUrlDialogOpen=I(!1);toggleNewDestination=I(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=L(()=>{let e=this.targetUrlModel();if(!e)return null;let t=e.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=L(()=>{let e=this.selectedDestinationType();return e?{key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let e=this.targetUrlModel();this.targetUrlCtrl.set(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(e=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),n=this.targetUrlInitial();!e||t===n||!t||this.#t.setTargetUrl(t)}testDestination(e,t,n){let i=this.targetUrlModel();i&&(this.#t.setTestState("testing"),this.#a.testDestination(i,e,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),n?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){n?.();return}let N=i.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(i+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(i+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):n?.()}}))}setDestination(e){this.#t.setTargetUrl(`${e}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let e=this.#t.isNew(),t=this.testSignal();if(!e){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:n=>{n?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:n=>{n&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-destination"]],viewQuery:function(t,n){t&1&&ut(n.formRef,Vt,5),t&2&&_t()},features:[Tt([{provide:Ut,useClass:Rt}])],decls:27,vars:11,consts:()=>{let e;e=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy url to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,e=X(e);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let n;n=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,n=X(n);let i;i=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let y;y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`Change`;let J;J=$localize`Be careful, this will overwrite everything you have in your destination.`;let Z;Z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let tt;tt=$localize`Set target URL`;let et;return et=$localize`Edit target URL`,[["formRef",""],e,t,n,i,a,N,y,P,J,Z,tt,et,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,n){if(t&1){let i=g();j(0),s(1,"form",13,0),D("submit",function(){return d(i),T(n.next())}),s(3,"header")(4,"h3",14),u(5,1),s(6,"div",15),m(7,Ht,2,3,"button",16),m(8,Xt,3,0,"button",17)(9,jt,8,1,"sh-menu"),F(),_(),F(),m(10,qt,3,0,"sh-alert")(11,Qt,3,0,"sh-alert",18)(12,Yt,3,1,"sh-alert",19)(13,Jt,3,1,"sh-alert",20),j(14),m(15,Zt,3,1,"app-destination-list-item",21),F(),m(16,te,1,0,"app-destination-list"),m(17,ee,1,1,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return d(i),T(n.goBack())}),u(20,2),c(21,"sh-icon"),_(),F(),s(22,"button",25),u(23,3),m(24,ne,2,0,"sh-icon",26)(25,ie,2,0,"sh-icon"),_(),F()()(),m(26,se,15,5,"sh-dialog",27)}if(t&2){let i=q(!!n.targetUrlModel());r(7),S(i?7:-1),r(),S(i?9:8),r(2),S(n.testSignal()=="testing"?10:n.testSignal()=="success"?11:n.testSignal()=="warning"?12:n.testSignal()=="error"?13:-1),r(4);let a=q(n.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(i?-1:16),r(),S(i?17:-1),r(5),h("disabled",n.testSignal()=="testing"||!i),r(2),S(n.testSignal()=="testing"?24:25),r(2),S(n.targetUrlDialogOpen()?26:-1)}},dependencies:[wt,K,M,G,Mt,b,v,At,k,$t,w,Et,U,It,ht],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;overflow:hidden;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{we as createDestinationForm,be as createDestinationFormGroup,Y as default};
@@ -0,0 +1 @@
1
+ import{d as k,r as L}from"./chunk-N5SC4SKW.js";import{h as U}from"./chunk-NOPMCS2Z.js";import{H as C,Oc as R,V as E,_ as A,oa as z,r as S}from"./chunk-HNWRQABR.js";import{a as s,b as D}from"./chunk-EUDKD2JW.js";var h=class{constructor(t){this.loader=t}_data=z(void 0);_isLoading=!1;_loaded=!1;load(){return!this._loaded&&!this._isLoading&&(this._isLoading=!0,this.loader().pipe(C(()=>this._isLoading=!1)).subscribe(t=>{this._data.set(t),this._loaded=!0})),this._data.asReadonly()}value(){return this._data.asReadonly()}isLoading(){return this._isLoading}isLoaded(){return this._loaded}reset(){this._data.set(void 0),this._loaded=!1}};var g=class e{#e=A(U);#o=new h(()=>this.getS3Config("Providers"));#n=new h(()=>this.getS3Config("Regions"));#r=new h(()=>this.getS3Config("RegionHosts"));#i=new h(()=>this.getS3Config("StorageClasses"));#s=R(()=>{let t=this.#o.value()(),o=this.#r.value()(),r=[...t??[],...o?.map(n=>({key:`Amazon ${n.key}`,value:n.value}))??[]];return Array.from(new Map(r.map(n=>[n.value,n])).values())});#a=new h(()=>this.getStorjConfig("Satellites"));#l=new h(()=>this.getStorjConfig("AuthenticationMethods"));#c=new h(()=>this.getOpenstackConfig("Providers"));#p=new h(()=>this.getOpenstackConfig("Versions"));#u=new h(()=>this.getGcsConfig("Locations"));#m=new h(()=>this.getGcsConfig("StorageClasses"));getS3AllProviders(){return this.#o.load(),this.#r.load(),this.#s}getS3Providers(){return this.#o.load()}getS3Regions(){return this.#n.load()}getS3RegionHosts(){return this.#r.load()}getS3StorageClasses(){return this.#i.load()}getStorjSatellites(){return this.#a.load()}getStorjAuthenticationMethods(){return this.#l.load()}getOpenstackProviders(){return this.#c.load()}getOpenstackVersions(){return this.#p.load()}getGcsLocations(){return this.#u.load()}getGcsStorageClasses(){return this.#m.load()}getS3Config(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":t}}).pipe(S(o=>this.#t(o)))}createS3IamUser(t,o){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":t,"s3-password":o}})}createS3PolicyIAM(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:t}})}getStorjConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":t}}).pipe(S(o=>this.#t(o)))}getOpenstackConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":t}}).pipe(S(o=>this.#t(o)))}getGcsConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":t}}).pipe(S(o=>this.#t(o)))}#t(t){return(t.Result&&typeof t.Result=="object"&&Object.entries(t.Result).map(([o,r])=>({key:o,value:r})))??[]}static \u0275fac=function(o){return new(o||e)};static \u0275prov=E({token:e,factory:e.\u0275fac,providedIn:"root"})};var i=new L,p={type:"error",message:$localize`Using a leading slash is most likely wrong, and will result in objects being created with a leading slash in the name.`},w={description:$localize`Unknown destination type`,icon:"assets/dest-icons/file-system.png",isDefaultEntry:!0,customFields:{path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path`,formElement:e=>i.control(e??"")}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let n=o.startsWith(`${e}:///`)?o.split(`${e}:///`)[1]:o.split(`${e}://`)[1];return s({destinationType:e,custom:{path:n.split("?")[0]}},a(e,t))}}},V=[{key:"file",displayName:$localize`File system`,description:$localize`Store backups on your local file system.`,icon:"assets/dest-icons/file-system.png",customFields:{path:{type:"FolderTree",name:"path",doubleSlash:p,shortDescription:$localize`File path`,longDescription:$localize`The path to store the backup`,formElement:e=>i.control(e??""),isMandatory:!0}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let r=o.startsWith("file:///"),n=decodeURIComponent(r?o.split("file:///")[1]:o.split("file://")[1]),u=n.slice(1).startsWith(":\\")?n:"/"+n;return s({destinationType:e,custom:{path:u.split("?")[0]}},a(e,t))}}},{key:"ssh",displayName:$localize`SSH`,description:$localize`Store backups with SSH.`,icon:"assets/dest-icons/ssh.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`The server to connect to`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`The port to connect to`,formElement:e=>i.control(e??"",[k.required,k.max(65535)])},path:{type:"Path",name:"path",shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0}],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:$localize`This is a path to a private key file locally on the machine`,longDescription:$localize`This is a path to a private key file locally on the machine`},{type:"FreeText",name:"ssh-key",shortDescription:$localize`SSH private key`,longDescription:$localize`An SSH private key. Supported formats are OpenSSL, OpenSSH, PuTTY, and PEM.`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"s3",displayName:$localize`S3 Compatible`,description:$localize`Store backups in any S3 compatible bucket.`,icon:"assets/dest-icons/aws.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the S3 compatible server to connect to`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3AllProviders(),isMandatory:!0,formElement:e=>i.control(e??"")},{name:"use-ssl",order:2},{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],advancedFields:[{name:"s3-client",type:"Enumeration",loadOptions:()=>z([{key:"AWS Library",value:"aws"},{key:"MinIO Library",value:"minio"}])},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3StorageClasses()},{name:"s3-location-constraint",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3Regions()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},a(e,t))}}},{key:"gcs",displayName:$localize`Google Cloud Storage`,description:$localize`Store backups in Google Cloud Storage.`,icon:"assets/dest-icons/google-cloud.png",oauthField:"authid",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],advancedFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsLocations()},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsStorageClasses()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},a(e,t))}}},{key:"googledrive",displayName:$localize`Google Drive`,description:$localize`Store backups in Google Drive.`,icon:"assets/dest-icons/google-drive.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"pcloud",displayName:$localize`pCloud`,description:$localize`Store backups in pCloud.`,icon:"assets/dest-icons/pcloud.png",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>z([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",oauthVersion:2,isMandatory:!0}],mapper:{to:e=>{let{server:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{server:r,path:n}},a(e,t))}}},{key:"azure",displayName:$localize`Azure Blob Storage`,description:$localize`Store backups in Azure Blob Storage.`,icon:"assets/dest-icons/azure.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Container name`,longDescription:$localize`Container name`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"onedrivev2",displayName:$localize`OneDrive`,description:$localize`Store backups in OneDrive.`,icon:"assets/dest-icons/one-drive.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"od4b",displayName:$localize`OneDrive Business`,description:$localize`Store backups in OneDrive Business.`,icon:"assets/dest-icons/one-drive.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"mssp",displayName:$localize`Microsoft SharePoint`,description:$localize`Store backups in Microsoft SharePoint.`,icon:"assets/dest-icons/sharepoint.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"sharepoint",displayName:$localize`Microsoft SharePoint v2`,description:$localize`Store backups in Microsoft SharePoint.`,icon:"assets/dest-icons/sharepoint.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"site-id",isMandatory:!0},{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"dropbox",displayName:$localize`Dropbox`,description:$localize`Store backups in Dropbox.`,icon:"assets/dest-icons/dropbox.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"box",displayName:$localize`Box.com`,description:$localize`Store backups in Box.com.`,icon:"assets/dest-icons/box-com.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"jottacloud",displayName:$localize`Jottacloud`,description:$localize`Store backups in Jottacloud.`,icon:"assets/dest-icons/jottacloud.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"b2",displayName:$localize`B2 Cloud Storage`,description:$localize`Store backups in B2 Cloud Storage.`,icon:"assets/dest-icons/backblaze.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Application ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Application Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},a(e,t))}}},{key:"e2",displayName:$localize`IDrive e2`,description:$localize`Store backups in IDrive e2.`,icon:"assets/dest-icons/idrive-e2.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Access ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access Secret`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{bucket:r,path:n}},a(e,t))}}},{key:"mega",displayName:$localize`Mega.nz`,description:$localize`Store backups in Mega.nz.`,icon:"assets/dest-icons/mega-nz.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let t=e.custom.path;return c(e,null,null,t)},from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"msgroup",displayName:$localize`Microsoft Office 365 Group`,description:$localize`Store backups in Microsoft Office 365 Group.`,icon:"assets/dest-icons/office-365.png",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:$localize`Group email`,longDescription:$localize`Group email`,formElement:e=>i.control(e??"",[k.email]),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"cloudfiles",displayName:$localize`Rackspace CloudFiles`,description:$localize`Store backups in Rackspace CloudFiles.`,icon:"assets/dest-icons/rackspace.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"rclone",displayName:$localize`Rclone`,description:$localize`Store backups in Rclone.`,icon:"assets/dest-icons/rclone.png",dynamicFields:[{name:"rclone-local-repository",shortDescription:$localize`Local repository`,defaultValue:""},{name:"rclone-remote-repository",shortDescription:$localize`Remote repository`,defaultValue:""},{name:"rclone-remote-path",type:"Path",shortDescription:$localize`Path on remote repository`,defaultValue:""}],mapper:{to:e=>{let t=e.dynamic["rclone-remote-repository"],o=e.dynamic["rclone-remote-path"],r=Object.entries(e.dynamic).filter(([n])=>!["rclone-remote-repository","rclone-remote-path"].includes(n));return v(e.destinationType??"rclone",t,null,o,[...Object.entries(e.advanced),...r])},from:(e,t,o)=>{let{advanced:r,dynamic:n}=a(e,t),{server:l,path:u}=m(t);return s({destinationType:e,dynamic:s({"rclone-remote-repository":l,"rclone-remote-path":u},n)},r)}}},{key:"openstack",displayName:$localize`OpenStack Object Storage`,description:$localize`Store backups in OpenStack Object Storage.`,icon:"assets/dest-icons/open-stack.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket`,longDescription:$localize`Bucket`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:[{name:"openstack-authuri",shortDescription:$localize`Auth URI`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackProviders(),isMandatory:!0},{name:"openstack-version",shortDescription:$localize`Version`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackVersions()},{name:"openstack-domain-name",type:"Hostname",shortDescription:$localize`Domain name`},{name:"openstack-tenant-name",shortDescription:$localize`Tenant name`},{name:"openstack-region",shortDescription:$localize`Region`}],mapper:{to:e=>{let{bucket:t}=e.custom;return c(e,t,null,null)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},a(e,t))}}},{key:"webdav",displayName:$localize`WebDAV`,description:$localize`Store backups in WebDAV.`,icon:"assets/dest-icons/webdav.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`},{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"aftp",displayName:$localize`Alternative FTP`,description:$localize`Store backups in FTP.`,icon:"assets/dest-icons/ftp.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"ftp",displayName:$localize`FTP`,description:$localize`Store backups in FTP.`,icon:"assets/dest-icons/ftp.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"sia",displayName:$localize`Sia Decentrilized Cloud`,description:$localize`Store backups in Sia Decentrilized Cloud.`,icon:"assets/dest-icons/sia-cloud.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let t=e.custom.server,o=e.dynamic["sia-targetpath"],r=[...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([n])=>n!=="sia-targetpath")];return v(e.destinationType??"sia",t,null,o,r)},from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"cos",displayName:$localize`Tencent COS`,description:$localize`Store backups in Tencent COS.`,icon:"assets/dest-icons/tencent-cloud.png",customFields:{bucket:{name:"bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"cos-region",shortDescription:$localize`Region`},{name:"cos-app-id",shortDescription:$localize`COS App Id`,isMandatory:!0},{name:"cos-secret-id",shortDescription:$localize`COS Secret Id`,isMandatory:!0},{name:"cos-secret-key",shortDescription:$localize`COS Secret Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(s({},e),{advanced:D(s({},e.advanced),{"cos-bucket":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=a(e,t),n=r.advanced["cos-bucket"];return delete r.advanced["cos-bucket"],s({destinationType:e,custom:{path:d(t),bucket:n}},r)}}},{key:"tahoe",displayName:$localize`Tahoe LAFS`,description:$localize`Store backups in Tahoe LAFS.`,icon:"assets/dest-icons/tahoelafs.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"smb",displayName:$localize`Windows Share (SMB)`,description:$localize`Store backups on SMB storage.`,icon:"assets/dest-icons/smb.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},share:{type:"Hostname",name:"share",shortDescription:$localize`Share Name`,longDescription:$localize`Share Name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:["transport",{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0},"auth-domain"],mapper:{to:e=>{let{share:t,server:o,path:r}=e.custom;return c(e,o,null,M(t,r))},from:(e,t,o)=>{let{server:r,path:n}=m(t),l=n.split("/")[0],u=n.split("/").slice(1).join("/");return s({destinationType:e,custom:{server:r,share:l,path:u}},a(e,t))}}},{key:"filen",displayName:$localize`Filen.io`,description:$localize`Store backups in Filen.io.`,icon:"assets/dest-icons/filen.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filen`,longDescription:$localize`Path on Filen`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"filejump",displayName:$localize`Filejump`,description:$localize`Store backups in Filejump.`,icon:"assets/dest-icons/file-jump.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filejump`,longDescription:$localize`Path on Filejump`,formElement:e=>i.control(e??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:$localize`API Token`,longDescription:$localize`Filejump API Token`,formElement:e=>i.control(e??""),isMandatory:!0}],mapper:{to:e=>{let{path:t}=e.custom;return console.log(t),c(e,null,null,t)},from:(e,t,o)=>(console.log(t),s({destinationType:e,custom:{path:d(t)}},a(e,t)))}},{key:"storj",customKey:"storjAccessGrant",displayName:$localize`Storj Access Grant`,description:$localize`Store backups in Storj Access Grant.`,icon:"assets/dest-icons/storj.png",dynamicFields:[{name:"storj-shared-access",shortDescription:$localize`Access Grant`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p},{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0}],mapper:{to:e=>{let t={"storj-auth-method":"Acccess grant"};return`storj://storj.io/config${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=a(e,t);return delete r.advanced["storj-auth-method"],s({destinationType:e},r)}}},{key:"storj",customKey:"storjApiKey",displayName:$localize`Storj API Key`,description:$localize`Store backups in Storj API Key.`,icon:"assets/dest-icons/storj.png",dynamicFields:[{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0},{name:"storj-api-key",shortDescription:$localize`API Key`,isMandatory:!0},{name:"storj-secret",shortDescription:$localize`Secret`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p}],mapper:{to:e=>{let t={"storj-auth-method":"API key"};return`storj://storj.io/config${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=a(e,t);return delete r.advanced["storj-auth-method"],s({destinationType:e},r)}}},{key:"aliyunoss",displayName:$localize`Aliyun OSS`,description:$localize`Store backups in Aliyun OSS`,icon:"assets/dest-icons/aliyun.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in bucket`,longDescription:$localize`Path in bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"oss-endpoint",isMandatory:!0},{name:"oss-access-key-id",isMandatory:!0},{name:"oss-access-key-secret",isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(s({},e),{advanced:D(s({},e.advanced),{"oss-bucket-name":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=a(e,t),n=r.advanced["oss-bucket-name"];return delete r.advanced["oss-bucket-name"],s({destinationType:e,custom:{path:d(t),bucket:n}},r)}}}],le={".amazonaws.com":"Amazon S3",".mycloudyplace.com":"MyCloudyPlace S3",".impossibleapi.net":"Impossible Cloud S3",".scw.cloud":"Scaleway S3",".hosteurope.de":"Hosteurope S3",".dunkel.de":"Dunkel S3",".dreamhost.com":"DreamHost S3",".dincloud.com":"dinCloud S3",".polisystems.ch":"Poli Systems S3",".softlayer.net":"IBM COS (S3)",".storadera.com":"Storadera S3",".wasabisys.com":"Wasabi S3",".infomaniak.com":"Infomaniak S3",".infomaniak.cloud":"Infomaniak S3",".sakurastorage.jp":"\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 S3",".lyvecloud.seagate.com":"Seagate Lyve S3",".digitaloceanspaces.com":"DigitalOcean S3",".backblazeb2.com":"Backblaze B2 S3",".cloudian.com":"Cloudian S3",".min.io":"MinIO S3",".linodeobjects.com":"Linode S3",".bunnycdn.com":"BunnyCDN S3",".azure.com":"Microsoft Azure S3",".googleapis.com":"Google Cloud Storage S3",".ibm.com":"IBM Cloud S3",".oracle.com":"Oracle Cloud S3",".cloudflare.com":"Cloudflare S3",".alibaba.com":"Alibaba Cloud S3",".huawei.com":"Huawei Cloud S3",".tencent.com":"Tencent Cloud S3",".baidu.com":"Baidu Cloud S3",".jd.com":"JD Cloud S3",".ucloud.cn":"UCloud S3",".qiniu.com":"Qiniu Cloud S3",".aliyuncs.com":"Aliyun S3",".tcloud.com":"TCloud S3",".tencentcloudapi.com":"Tencent Cloud S3"};function c(e,t,o,r){return v(e.destinationType??"file",t,o,r,[...Object.entries(e.advanced),...Object.entries(e.dynamic)])}function v(e,t,o,r,n){let l=b(n),u=encodeURIComponent(B(t)),y=u==""?"":u+j(o),f=r??"",$=f.slice(1).startsWith(":\\")&&e=="file"?"file:///":`${e}://`,O=M(y,I(f));return`${$}${O}${l}`}function N(e){return e==null||e===""?"":e.startsWith("/")?e.substring(1):e}function M(...e){if(e.length===0)return"";if(e.length===1)return e[0]??"";let t="";for(let o of e)o==null||o===""||(t+=t.endsWith("/")||t==""?o:"/"+o);return t}function I(e){return e.split("/").map(encodeURIComponent).join("/")}function d(e){if(e==null||e==="")return"";if(typeof e=="string")try{e=new URL(e)}catch{return""}return decodeURIComponent(e.hostname??"")+decodeURIComponent(e.pathname=="/"?"":e.pathname??"")}function B(e){return e==null||e===""?"":e.endsWith("/")?e.substring(0,e.length-1):e}function j(e){return e==null||e===""?"":":"+e.toString()}function P(e){return V.find(o=>o.key===e||o.customKey===e)??V.find(o=>`${o.key}s`===e)??null??s({key:e,displayName:e},w)}function m(e){return{server:decodeURIComponent(e.hostname),port:e.port,path:N(decodeURIComponent(e.pathname))}}function a(e,t){let o={},r={},n=P(e);return t.searchParams.forEach((l,u)=>{n?.dynamicFields?.some(f=>f===u||f?.name===u)?r[u]=decodeURIComponent(l):o[u]=decodeURIComponent(l)}),{advanced:o,dynamic:r}}function b(e,t=!1){let o=e.map(([n,l])=>`${n}=${l?encodeURIComponent(l.toString()):""}`).join("&");return o?(t?"":"?")+o:""}function me(e){let t=e.destinationType??"";return P(t)?.mapper.to(e)??""}function de(e){let t=URL.canParse(e),o=e.split("://")[0],r=e.split("://")[1],n=o==="file"?"http://dummy":"http://"+r;if(!r)return null;if(r.startsWith("%")&&o==="file")return P(o).mapper.from(o,new URL("http://localhost"),e);let l=P(o),u="";`${l.key}s`===o&&(u+=n.indexOf("?")===-1?"?":"&",u+="use-ssl=true",e=l.key+e.substring(o.length));try{let y=new URL(n+u);if(y.host==="undefined")return null;let f=r.split("?")[0].split("/")[0],G=!isNaN(Number(y.host.replaceAll(".",""))),$=f.split("."),O=$.length===4&&$.every(F=>F.length&&F.length<=3&&!isNaN(Number(F))&&parseInt(F)<=255);return G&&!O?null:l.mapper.from(l.key,y,e)}catch(y){return console.error("Error while parsing target path",y),null}}export{P as a,me as b,de as c,le as d};
@@ -1 +1 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",loadComponent:()=>import("./chunk-2F6NVETW.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-POMLWQHO.js")},{path:"live",loadComponent:()=>import("./chunk-RUFE3SMI.js")}]}],t=o;export{t as default};
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",loadComponent:()=>import("./chunk-GFMGDQOH.js"),children:[{path:"",redirectTo:"stored",pathMatch:"full"},{path:"stored",loadComponent:()=>import("./chunk-POMLWQHO.js")},{path:"live",loadComponent:()=>import("./chunk-5NRWNJ4J.js")}]}],t=o;export{t as default};
@@ -1 +1 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-PDM4HXOW.js")},{path:"encryption",loadComponent:()=>import("./chunk-6EWMK5CH.js")},{path:"select-files",loadComponent:()=>import("./chunk-YTYCTAUZ.js")},{path:"options",loadComponent:()=>import("./chunk-OKM5JN2Q.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-PHH3DHN2.js")}],t=o;export{t as default};
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-EQCT6Y4K.js")},{path:"encryption",loadComponent:()=>import("./chunk-6EWMK5CH.js")},{path:"select-files",loadComponent:()=>import("./chunk-YTYCTAUZ.js")},{path:"options",loadComponent:()=>import("./chunk-OKM5JN2Q.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-ZUBWG65U.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-NTZTXGGQ.js")},{path:"destination",loadComponent:()=>import("./chunk-HQO3ARLG.js")},{path:"source-data",loadComponent:()=>import("./chunk-UIQIL2X6.js")},{path:"schedule",loadComponent:()=>import("./chunk-QCISEYZT.js")},{path:"options",loadComponent:()=>import("./chunk-4EZ4GOK5.js")}];export{o as default};
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-NTZTXGGQ.js")},{path:"destination",loadComponent:()=>import("./chunk-KAOPFWFX.js")},{path:"source-data",loadComponent:()=>import("./chunk-UIQIL2X6.js")},{path:"schedule",loadComponent:()=>import("./chunk-QCISEYZT.js")},{path:"options",loadComponent:()=>import("./chunk-4EZ4GOK5.js")}];export{o as default};
@@ -1,2 +1,2 @@
1
- import{a as R}from"./chunk-ESUPNSKH.js";import{a as A,n as D,x as F}from"./chunk-H7K35UUX.js";import{la as k}from"./chunk-RUXCS4ZK.js";import{Ab as o,Bb as i,Cb as P,Dc as y,Fc as $,Jb as N,Pc as b,Ra as l,Sb as m,Uc as L,Wb as w,Yb as d,_ as x,bb as M,ea as E,fa as O,hc as G,ic as v,lc as s,mc as u,nc as _,oa as I,ub as g,vb as p,wb as C,xb as f,yb as S,zb as T}from"./chunk-HNWRQABR.js";function V(n,t){n&1&&(o(0,"div",4),m(1,0),i())}function B(n,t){if(n&1&&(o(0,"li"),s(1),i()),n&2){let e=t.$implicit;l(),u(e)}}function U(n,t){if(n&1&&(o(0,"code")(1,"ol",15),f(2,B,2,1,"li",null,C),i()()),n&2){let e=d(2).$implicit,a=d(2);l(2),S(a.breakIntoLines(e.Exception))}}function X(n,t){if(n&1&&(o(0,"li"),s(1),i()),n&2){let e=t.$implicit;l(),u(e)}}function z(n,t){if(n&1&&(o(0,"code")(1,"ol",15),f(2,X,2,1,"li",null,C),i()()),n&2){let e=d(2).$implicit,a=d(2);l(2),S(a.breakIntoLines(e.Message))}}function W(n,t){if(n&1&&(o(0,"tr")(1,"td",12)(2,"sh-list",13)(3,"div",14),s(4),i(),o(5,"div",14),s(6),i(),o(7,"div",14),s(8),i(),o(9,"div",14),s(10),i(),o(11,"div",14),s(12),i()(),g(13,U,4,0,"code"),g(14,z,4,0,"code"),i()()),n&2){let e=d().$implicit;l(4),_("ID: ",e.ID),l(2),_("Type: ",e.Type),l(2),_("Tag: ",e.Tag),l(2),_("TaskID: ",e.TaskID),l(2),_("MessageID: ",e.MessageID),l(),p(e.Exception?13:-1),l(),p(e.Message?14:-1)}}function j(n,t){if(n&1){let e=N();o(0,"tr",10),w("click",function(){let r=E(e).$index,c=d(2);return O(c.toggleRow(r))}),o(1,"td"),s(2),y(3,"date"),i(),o(4,"td"),s(5),i(),o(6,"td",8)(7,"button",11)(8,"sh-icon"),s(9,"caret-down"),i()()()(),g(10,W,15,7,"tr")}if(n&2){let e=t.$implicit,a=t.$index,r=d(2);l(2),u($(3,5,e.When,"medium")),l(3),u(r.subStringMessage(e.Message)),l(2),v("rotated-icon",a===r.openRowIndex()),l(3),p(a===r.openRowIndex()?10:-1)}}function H(n,t){if(n&1&&(o(0,"sh-table",6)(1,"tr",7)(2,"th"),m(3,1),i(),o(4,"th"),m(5,2),i(),P(6,"th",8),i(),f(7,j,11,8,null,null,C),o(9,"div",9),m(10,3),i()()),n&2){let e=d();G("grid-template-columns","auto 1fr auto"),v("type-b",e.asSimpleList()),T("data",e.logs())("loading",e.logsLoading()),l(7),S(e.logs())}}var h=class n{#e=x(R);whenFilter=L();backupIdFilter=L();asSimpleList=L();polling=L();logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;logs=this.#e.logs;logsLoading=this.#e.logsLoading;pollingEffect=b(()=>{let t=this.polling()??!1;this.#e.isPolling.set(t)});openRowIndex=I(null);whenEffect=b(()=>{let t=this.whenFilter()??null;this.#e.setWhenFilter(t),this.#e.logLevel.set(t?"Verbose":"Disabled")});backupIdEffect=b(()=>{let t=this.backupIdFilter()??null;this.#e.setBackupIdFilter(t),this.#e.logLevel.set(t?"Verbose":"Disabled")});toggleRow(t){this.openRowIndex.set(t===this.openRowIndex()?null:t)}breakIntoLines(t){return t?t.split(`
2
- `):[]}subStringMessage(t){return t?t.substring(0,80)+"...":""}ngOnDestroy(){this.#e.destroy()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-logs-live"]],hostVars:2,hostBindings:function(e,a){e&2&&v("simple-list",a.asSimpleList())},inputs:{whenFilter:[1,"whenFilter"],backupIdFilter:[1,"backupIdFilter"],asSimpleList:[1,"asSimpleList"],polling:[1,"polling"]},decls:2,vars:1,consts:()=>{let t;t=$localize`Live logs are disabled`;let e;e=$localize`When`;let a;a=$localize`Message`;let r;return r=$localize`No data available`,[t,e,a,r,[1,"live-view-disabled"],[3,"type-b","data","loading","grid-template-columns"],[3,"data","loading"],["table-header",""],[1,"sticky-end"],["table-no-rows",""],[3,"click"],["shButton","","type","button",1,"outlined","small"],[1,"expanded-cell"],[1,"primary"],["item",""],[1,"line-numbers-ol"]]},template:function(e,a){e&1&&g(0,V,2,0,"div",4)(1,H,11,6,"sh-table",5),e&2&&p(a.logLevel()==="Disabled"?0:1)},dependencies:[F,A,D,k],styles:["[_nghost-%COMP%]{display:block}.simple-list[_nghost-%COMP%] sh-table[_ngcontent-%COMP%]{--table-td-bg: var(--base-2);height:100%}.live-view-disabled[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:18.75rem;width:100%;background-color:var(--base-2);border:1px solid var(--base-3);border-radius:var(--shape-2);font:var(--paragraph-20)}.expanded-cell[_ngcontent-%COMP%]{height:auto;grid-column:1/-1;white-space:pre-wrap;display:flex;flex-direction:column}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}sh-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre;max-width:100%}"],changeDetection:0})};export{h as a};
1
+ import{a as R}from"./chunk-GEI2CH2J.js";import{a as A,n as D,x as F}from"./chunk-H7K35UUX.js";import{la as k}from"./chunk-RUXCS4ZK.js";import{Ab as o,Bb as i,Cb as P,Dc as y,Fc as $,Jb as N,Pc as b,Ra as l,Sb as m,Uc as L,Wb as w,Yb as d,_ as x,bb as M,ea as E,fa as O,hc as G,ic as v,lc as s,mc as u,nc as _,oa as I,ub as g,vb as p,wb as C,xb as f,yb as S,zb as T}from"./chunk-HNWRQABR.js";function V(n,t){n&1&&(o(0,"div",4),m(1,0),i())}function B(n,t){if(n&1&&(o(0,"li"),s(1),i()),n&2){let e=t.$implicit;l(),u(e)}}function U(n,t){if(n&1&&(o(0,"code")(1,"ol",15),f(2,B,2,1,"li",null,C),i()()),n&2){let e=d(2).$implicit,a=d(2);l(2),S(a.breakIntoLines(e.Exception))}}function X(n,t){if(n&1&&(o(0,"li"),s(1),i()),n&2){let e=t.$implicit;l(),u(e)}}function z(n,t){if(n&1&&(o(0,"code")(1,"ol",15),f(2,X,2,1,"li",null,C),i()()),n&2){let e=d(2).$implicit,a=d(2);l(2),S(a.breakIntoLines(e.Message))}}function W(n,t){if(n&1&&(o(0,"tr")(1,"td",12)(2,"sh-list",13)(3,"div",14),s(4),i(),o(5,"div",14),s(6),i(),o(7,"div",14),s(8),i(),o(9,"div",14),s(10),i(),o(11,"div",14),s(12),i()(),g(13,U,4,0,"code"),g(14,z,4,0,"code"),i()()),n&2){let e=d().$implicit;l(4),_("ID: ",e.ID),l(2),_("Type: ",e.Type),l(2),_("Tag: ",e.Tag),l(2),_("TaskID: ",e.TaskID),l(2),_("MessageID: ",e.MessageID),l(),p(e.Exception?13:-1),l(),p(e.Message?14:-1)}}function j(n,t){if(n&1){let e=N();o(0,"tr",10),w("click",function(){let r=E(e).$index,c=d(2);return O(c.toggleRow(r))}),o(1,"td"),s(2),y(3,"date"),i(),o(4,"td"),s(5),i(),o(6,"td",8)(7,"button",11)(8,"sh-icon"),s(9,"caret-down"),i()()()(),g(10,W,15,7,"tr")}if(n&2){let e=t.$implicit,a=t.$index,r=d(2);l(2),u($(3,5,e.When,"medium")),l(3),u(r.subStringMessage(e.Message)),l(2),v("rotated-icon",a===r.openRowIndex()),l(3),p(a===r.openRowIndex()?10:-1)}}function H(n,t){if(n&1&&(o(0,"sh-table",6)(1,"tr",7)(2,"th"),m(3,1),i(),o(4,"th"),m(5,2),i(),P(6,"th",8),i(),f(7,j,11,8,null,null,C),o(9,"div",9),m(10,3),i()()),n&2){let e=d();G("grid-template-columns","auto 1fr auto"),v("type-b",e.asSimpleList()),T("data",e.logs())("loading",e.logsLoading()),l(7),S(e.logs())}}var h=class n{#e=x(R);whenFilter=L();backupIdFilter=L();asSimpleList=L();polling=L();logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;logs=this.#e.logs;logsLoading=this.#e.logsLoading;pollingEffect=b(()=>{let t=this.polling()??!1;this.#e.isPolling.set(t)});openRowIndex=I(null);whenEffect=b(()=>{let t=this.whenFilter()??null;this.#e.setWhenFilter(t),this.#e.logLevel.set(t?"Verbose":"Disabled")});backupIdEffect=b(()=>{let t=this.backupIdFilter()??null;this.#e.setBackupIdFilter(t),this.#e.logLevel.set(t?"Verbose":"Disabled")});toggleRow(t){this.openRowIndex.set(t===this.openRowIndex()?null:t)}breakIntoLines(t){return t?t.split(`
2
+ `):[]}subStringMessage(t){return t?t.substring(0,80)+"...":""}ngOnDestroy(){this.#e.destroy()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-logs-live"]],hostVars:2,hostBindings:function(e,a){e&2&&v("simple-list",a.asSimpleList())},inputs:{whenFilter:[1,"whenFilter"],backupIdFilter:[1,"backupIdFilter"],asSimpleList:[1,"asSimpleList"],polling:[1,"polling"]},decls:2,vars:1,consts:()=>{let t;t=$localize`Live logs are disabled`;let e;e=$localize`When`;let a;a=$localize`Message`;let r;return r=$localize`No data available`,[t,e,a,r,[1,"live-view-disabled"],[3,"type-b","data","loading","grid-template-columns"],[3,"data","loading"],["table-header",""],[1,"sticky-end"],["table-no-rows",""],[3,"click"],["shButton","","type","button",1,"outlined","small"],[1,"expanded-cell"],[1,"primary"],["item",""],[1,"line-numbers-ol"]]},template:function(e,a){e&1&&g(0,V,2,0,"div",4)(1,H,11,6,"sh-table",5),e&2&&p(a.logLevel()==="Disabled"?0:1)},dependencies:[F,A,D,k],styles:["[_nghost-%COMP%]{display:block;padding:0 2rem}.simple-list[_nghost-%COMP%] sh-table[_ngcontent-%COMP%]{--table-td-bg: var(--base-2);height:100%}.live-view-disabled[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;min-height:18.75rem;width:100%;background-color:var(--base-2);border:1px solid var(--base-3);border-radius:var(--shape-2);font:var(--paragraph-20)}.expanded-cell[_ngcontent-%COMP%]{height:auto;grid-column:1/-1;white-space:pre-wrap;display:flex;flex-direction:column}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}sh-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre;max-width:100%}"],changeDetection:0})};export{h as a};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-62QANGOE.js";import"./chunk-ESUPNSKH.js";import{g as J}from"./chunk-7ZTBW6LJ.js";import"./chunk-K56EDP42.js";import"./chunk-TK5QY2QD.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import{b as q}from"./chunk-DNDTLTUM.js";import"./chunk-QDFDQHU3.js";import{a as Z}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import{a as V}from"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{a as H}from"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as w}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as W,h as X,p as z,s as B}from"./chunk-H7K35UUX.js";import{h as j}from"./chunk-NOPMCS2Z.js";import{qa as k}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as s,Cb as S,Dc as d,Ec as m,Gb as u,Hb as T,Oc as b,Qb as v,Ra as _,Rb as D,Sb as r,Tb as I,Ub as x,Yb as g,_ as R,bb as y,ga as C,ha as f,lc as M,oa as L,oc as h,ub as p,vb as O,zb as P}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(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),u(1,16),r(2,2),T(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(u(0),r(1,8),T())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(u(0),r(1,9),T())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),v(2,5),S(3,"sh-spinner",23),D(),s(),i(4,"div",24),S(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),I((e=c.statusData())==null?null:e.statusText),x(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var F=class n{#i=R(j);#s=R(V);#t=R(Z);#n=R(J);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=L("");#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.#a(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.")}})}#a(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=y({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 c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let N;N=$localize`Files processed:`;let G;G=$localize`Size processed:`;let $;$=$localize`N/A`;let A;return A=$localize`N/A`,[t,e,o,l,E,c,N,G,$,A,[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"),p(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),S(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,z,B,W,X,q,H,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{F as default};
1
+ import{a as K}from"./chunk-X7ZE7U56.js";import"./chunk-GEI2CH2J.js";import{g as J}from"./chunk-7ZTBW6LJ.js";import"./chunk-K56EDP42.js";import"./chunk-TK5QY2QD.js";import"./chunk-FZTPUMUC.js";import"./chunk-DDWLL7XA.js";import"./chunk-O64ZZGQZ.js";import{b as q}from"./chunk-DNDTLTUM.js";import"./chunk-QDFDQHU3.js";import{a as Z}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import{a as V}from"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import"./chunk-RHW5QVAY.js";import"./chunk-VTSUHAP5.js";import{a as H}from"./chunk-UP5EOICU.js";import"./chunk-N5SC4SKW.js";import"./chunk-Z3EPZZGY.js";import"./chunk-UKQFDBNO.js";import{b as w}from"./chunk-LVP2TPMO.js";import"./chunk-43JMN2ZY.js";import{a as W,h as X,p as z,s as B}from"./chunk-H7K35UUX.js";import{h as j}from"./chunk-NOPMCS2Z.js";import{qa as k}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{Ab as i,Bb as s,Cb as S,Dc as d,Ec as m,Gb as u,Hb as T,Oc as b,Qb as v,Ra as _,Rb as D,Sb as r,Tb as I,Ub as x,Yb as g,_ as R,bb as y,ga as C,ha as f,lc as M,oa as L,oc as h,ub as p,vb as O,zb as P}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";function Q(n,t){n&1&&(i(0,"div",17),C(),i(1,"svg",19),S(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),C(),i(1,"svg",19),S(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),u(1,16),r(2,2),T(),p(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();_(3),O(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),d(1,"number"),d(2,"number")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(u(0),r(1,8),T())}function ne(n,t){if(n&1&&(M(0),d(1,"bytes"),d(2,"bytes")),n&2){let e,o=g(2);h(" ",m(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",m(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(u(0),r(1,9),T())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),v(2,5),S(3,"sh-spinner",23),D(),s(),i(4,"div",24),S(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),p(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),p(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,c=g();_(3),I((e=c.statusData())==null?null:e.statusText),x(2),_(2),P("value",(o=c.statusData())==null?null:o.OverallProgress),_(4),O((l=c.statusData())!=null&&l.ProcessedFileCount?9:10),_(5),O((E=c.statusData())!=null&&E.ProcessedFileSize?14:15)}}var F=class n{#i=R(j);#s=R(V);#t=R(Z);#n=R(J);#r=R(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=L("");#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.#a(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.")}})}#a(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=y({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 c;c=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let N;N=$localize`Files processed:`;let G;G=$localize`Size processed:`;let $;$=$localize`N/A`;let A;return A=$localize`N/A`,[t,e,o,l,E,c,N,G,$,A,[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"),p(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),S(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),S(11,"app-logs-live",15),s()()),e&2){let l;_(),O(o.restoreResult()!=""?1:2),_(6),P("notificationFilterPredicate",o.notificationFilterPredicate()),_(4),P("asSimpleList",!0)("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,z,B,W,X,q,H,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{F as default};
package/index.html CHANGED
@@ -63,5 +63,5 @@
63
63
  <body>
64
64
  <app-root></app-root>
65
65
  <div class="loading">Connecting ...</div>
66
- <link rel="modulepreload" href="chunk-4TDUWDRL.js"><link rel="modulepreload" href="chunk-QDFDQHU3.js"><link rel="modulepreload" href="chunk-6LTGTS6B.js"><link rel="modulepreload" href="chunk-DVDTYV66.js"><link rel="modulepreload" href="chunk-UIJYCGKA.js"><link rel="modulepreload" href="chunk-DELLEGXW.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-VTSUHAP5.js"><link rel="modulepreload" href="chunk-UP5EOICU.js"><link rel="modulepreload" href="chunk-Z3EPZZGY.js"><script src="polyfills-DNO7R5SL.js" type="module"></script><script src="main-W52VZQVY.js" type="module"></script></body>
66
+ <link rel="modulepreload" href="chunk-4TDUWDRL.js"><link rel="modulepreload" href="chunk-QDFDQHU3.js"><link rel="modulepreload" href="chunk-6LTGTS6B.js"><link rel="modulepreload" href="chunk-DVDTYV66.js"><link rel="modulepreload" href="chunk-UIJYCGKA.js"><link rel="modulepreload" href="chunk-DELLEGXW.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-VTSUHAP5.js"><link rel="modulepreload" href="chunk-UP5EOICU.js"><link rel="modulepreload" href="chunk-Z3EPZZGY.js"><script src="polyfills-DNO7R5SL.js" type="module"></script><script src="main-BICH3CVD.js" type="module"></script></body>
67
67
  </html>
@@ -1 +1 @@
1
- import{b as be,c as ve}from"./chunk-4TDUWDRL.js";import{a as he}from"./chunk-QDFDQHU3.js";import{a as I}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import{a as D}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-VTSUHAP5.js";import{a as de}from"./chunk-UP5EOICU.js";import"./chunk-Z3EPZZGY.js";import{a as b,b as v,c as ue,d as k}from"./chunk-UKQFDBNO.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-LVP2TPMO.js";import{a as ee}from"./chunk-43JMN2ZY.js";import{c as le}from"./chunk-H7K35UUX.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-NOPMCS2Z.js";import{a as ge}from"./chunk-TDKBGGNK.js";import{la as Y,qa as Z}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{a as ye}from"./chunk-DFMGS3IN.js";import{b as fe}from"./chunk-6OPAGPKF.js";import{A as x,B as G,Cb as z,H as w,Jc as q,Kc as X,N as J,P as R,Pc as Q,R as B,V as M,Y as $,_ as s,bb as _,f as W,i as j,ia as K,n as F,o as U,oa as d,r as S}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=s(b);#s=s(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ee=()=>{let e=s(k);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(v),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-FCRM5DER.js")},{path:"logout",loadComponent:()=>import("./chunk-MVNLSG6Z.js")},{path:"",canActivate:[Ee],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-AJTK6HBC.js"),children:[{path:"",loadComponent:()=>import("./chunk-ZNWZFRFW.js")},{path:"add-backup",loadComponent:()=>import("./chunk-FZHTJSDJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-M6WWZKV7.js")},{path:"backup/import",loadComponent:()=>import("./chunk-FUOS2UGQ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-GWQAMFY2.js"),loadChildren:()=>import("./chunk-UM2R35PK.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-GWQAMFY2.js"),loadChildren:()=>import("./chunk-UM2R35PK.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-QITXA3NT.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-J3ONM4TQ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-2RDLOXGA.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-2UCO57JQ.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-DLMKZACT.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-NJZSEKTD.js")},{path:"from-config",loadComponent:()=>import("./chunk-VHE3K2F5.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-HTBOWZJ4.js"),loadChildren:()=>import("./chunk-CVEBTGDK.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-HTBOWZJ4.js"),loadChildren:()=>import("./chunk-CVEBTGDK.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-HTBOWZJ4.js"),loadChildren:()=>import("./chunk-CVEBTGDK.js")},{path:"settings",loadComponent:()=>import("./chunk-LF7PTCJR.js")},{path:"about",loadComponent:()=>import("./chunk-WS76KLII.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-E66CBA5F.js")},{path:"changelog",loadComponent:()=>import("./chunk-SFSB73YO.js")},{path:"libraries",loadComponent:()=>import("./chunk-TIWH4NKT.js")},{path:"system-info",loadComponent:()=>import("./chunk-IFW3O4YJ.js")},{path:"server-settings",loadComponent:()=>import("./chunk-TKO3OH2C.js")},{path:"logs",loadChildren:()=>import("./chunk-B2D4QGDJ.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-R5RIFWZO.js")}]}]}]}]}];var P=null,Te=(e,t)=>{let o=s(k),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),V=e,H=e.headers.has("custom-proxy-check")||O===ue;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),V=e.clone({headers:c})}return t(V).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(P??=o.refreshToken().pipe(J()),P.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>P=null))):U(()=>({error:c,message:f}))}))};var Ne="1.0.0",we=`portal-proxy-client-${D()}`,Oe=1,N=class e{#o=1e3;#s=s(h);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:t,publicKey:"",clientVersion:Ne,protocolVersion:Oe},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=D(),g={from:we,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Me(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(p=>{a.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(y=>{C.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});p.next(g),p.complete()})})}var ke=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Me(o,e,t).subscribe(i)}),i}return Me(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([ke,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:ve()},he,I,fe,Z,de,Y,ge,ye]};ee(E,Ie);
1
+ import{b as be,c as ve}from"./chunk-4TDUWDRL.js";import{a as he}from"./chunk-QDFDQHU3.js";import{a as I}from"./chunk-6LTGTS6B.js";import"./chunk-DVDTYV66.js";import"./chunk-UIJYCGKA.js";import"./chunk-DELLEGXW.js";import{a as D}from"./chunk-RHW5QVAY.js";import{a as L}from"./chunk-VTSUHAP5.js";import{a as de}from"./chunk-UP5EOICU.js";import"./chunk-Z3EPZZGY.js";import{a as b,b as v,c as ue,d as k}from"./chunk-UKQFDBNO.js";import{c as ie,d as ae,g as pe,h as ce}from"./chunk-LVP2TPMO.js";import{a as ee}from"./chunk-43JMN2ZY.js";import{c as le}from"./chunk-H7K35UUX.js";import{a as te,b as oe,d as ne,e as re,f as se,i as me}from"./chunk-NOPMCS2Z.js";import{a as ge}from"./chunk-TDKBGGNK.js";import{la as Y,qa as Z}from"./chunk-RUXCS4ZK.js";import"./chunk-FPPZ4BUR.js";import{a as ye}from"./chunk-DFMGS3IN.js";import{b as fe}from"./chunk-6OPAGPKF.js";import{A as x,B as G,Cb as z,H as w,Jc as q,Kc as X,N as J,P as R,Pc as Q,R as B,V as M,Y as $,_ as s,bb as _,f as W,i as j,ia as K,n as F,o as U,oa as d,r as S}from"./chunk-HNWRQABR.js";import"./chunk-EUDKD2JW.js";var E=class e{#o=s(b);#s=s(v);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=_({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&z(0,"router-outlet")},dependencies:[ie],encapsulation:2})};var Se={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var h=new $("ENVIRONMENT");var A=class e{#o=s(me);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#o.getApiV1Webmodules().pipe(B(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ee=()=>{let e=s(k);return e.token()?!0:e.checkProxyAuthed().pipe(R(t=>t?F(!0):e.refreshToken().pipe(S(()=>!0))))},Ae=()=>{let e=s(v),t=s(I),o=s(K),n=e.relayIsEnabled()?"longpoll":"websocket",i=[o.get(L).preload(!0),o.get(L).preloadFilterGroups(!0),o.get(A).preload(!0)];return e.configLoaded===null?x(i).pipe(S(()=>n)):e.configLoaded?.pipe(R(()=>x(i)))},Re=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-FCRM5DER.js")},{path:"logout",loadComponent:()=>import("./chunk-MVNLSG6Z.js")},{path:"",canActivate:[Ee],children:[{path:"",canActivate:[Ae],loadComponent:()=>import("./chunk-AJTK6HBC.js"),children:[{path:"",loadComponent:()=>import("./chunk-3EH5RFRF.js")},{path:"add-backup",loadComponent:()=>import("./chunk-FZHTJSDJ.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-M6WWZKV7.js")},{path:"backup/import",loadComponent:()=>import("./chunk-FUOS2UGQ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-GWQAMFY2.js"),loadChildren:()=>import("./chunk-VYAOTFOO.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-GWQAMFY2.js"),loadChildren:()=>import("./chunk-VYAOTFOO.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-QITXA3NT.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-J3ONM4TQ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-2RDLOXGA.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-2UCO57JQ.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-DLMKZACT.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-NJZSEKTD.js")},{path:"from-config",loadComponent:()=>import("./chunk-VHE3K2F5.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-HTBOWZJ4.js"),loadChildren:()=>import("./chunk-UAFHVSPY.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-HTBOWZJ4.js"),loadChildren:()=>import("./chunk-UAFHVSPY.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-HTBOWZJ4.js"),loadChildren:()=>import("./chunk-UAFHVSPY.js")},{path:"settings",loadComponent:()=>import("./chunk-LF7PTCJR.js")},{path:"about",loadComponent:()=>import("./chunk-FUX6GJRD.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-E66CBA5F.js")},{path:"changelog",loadComponent:()=>import("./chunk-SFSB73YO.js")},{path:"libraries",loadComponent:()=>import("./chunk-TIWH4NKT.js")},{path:"system-info",loadComponent:()=>import("./chunk-IFW3O4YJ.js")},{path:"server-settings",loadComponent:()=>import("./chunk-TKO3OH2C.js")},{path:"logs",loadChildren:()=>import("./chunk-QLYO56NW.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-R5RIFWZO.js")}]}]}]}]}];var P=null,Te=(e,t)=>{let o=s(k),n=s(ae),i=s(b),l=s(h),r=i.getItem("locale"),u=s(le),a=be(r),p=e.url==="/api/v1/auth/login",m=e.url==="/api/v1/auth/refresh",C=e.url==="/api/v1/progressstate",g=e.url==="/api/v1/remoteoperation/test",y=e.url==="/api/v1/filesystem/validate",T=e.url.startsWith("/api/v2/"),O=o.token(),V=e,H=e.headers.has("custom-proxy-check")||O===ue;if(O&&e.url.startsWith(l.baseUrl)&&!H){let c=e.headers.set("Authorization",`Bearer ${O}`);r&&r!=="en-US"&&(c=c.set("X-Ui-Language",a)),V=e.clone({headers:c})}return t(V).pipe(S(c=>{if(c.type===4&&c.status===200&&T){let f=c.body;if(f?.Success===!1)throw{status:200,message:f?.Error??"Unknown error",error:{Error:f?.Error??"Unknown error"},body:f}}return c}),G(c=>{let f=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;return!H&&(C&&c.status===404||g||y||u.error(f),m&&c.status===401&&(o.logout(),n.navigate(["/logout"])),!p&&!m&&c.status===401)?(P??=o.refreshToken().pipe(J()),P.pipe(R(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),w(()=>P=null))):U(()=>({error:c,message:f}))}))};var Ne="1.0.0",we=`portal-proxy-client-${D()}`,Oe=1,N=class e{#o=1e3;#s=s(h);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=Q(()=>{let t=this.#i(),o=this.#l(),n=this.#a();if(!n||!t||!o||o<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},o)});utf8Atob(t){let o=Uint8Array.from(atob(t),i=>i.charCodeAt(0)),n=this.#m.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(t),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=l=>{let r=JSON.parse(l.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:t,publicKey:"",clientVersion:Ne,protocolVersion:Oe},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let i={from:we,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(t,o,n,i,l,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((a,p)=>{let m=D(),g={from:we,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:l,headers:r})},y={resolve:a,reject:p,timer:window.setTimeout(()=>{let T=this.#r[m];T&&(delete this.#r[m],T.reject("Timeout"))},u)};this.#r[m]=y,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(t){this.#e?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=M({token:e,factory:e.\u0275fac,providedIn:"root"})};function xe(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function Me(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let i=xe(t.body),l={};t.headers.keys().forEach(p=>{l[p]=t.headers.get(p)??""});let r=t.headers.get("timeout"),u=r!==null?parseInt(r):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let a=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,i,l,u);return new W(p=>{a.then(m=>{let C=new te;l!=null&&Object.keys(l).forEach(y=>{C.set(y,l[y])});let g=new oe({body:m.body,status:m.code,statusText:"OK",headers:C});p.next(g),p.complete()})})}var ke=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(h).defaultTimeout,relayWebsocket:s(N)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let i=new j;return o.relayconfigState.configLoaded.subscribe(l=>{l&&Me(o,e,t).subscribe(i)}),i}return Me(o,e,t)};var Ie={providers:[q(),pe(Re,ce()),ne(se(),re([ke,Te])),b,{provide:h,useValue:Se},{provide:X,useValue:ve()},he,I,fe,Z,de,Y,ge,ye]};ee(E,Ie);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.148",
2
+ "version": "0.0.150",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-ESUPNSKH.js DELETED
@@ -1 +0,0 @@
1
- import{h as d}from"./chunk-NOPMCS2Z.js";import{H as r,Oc as s,Pc as g,V as n,_ as o,oa as l}from"./chunk-HNWRQABR.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=o(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.logLevel()==="Disabled"?this.timerInterval=void 0:this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):(this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0)});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(r(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let t=e.reverse(),i=this.#t(t);i>0&&this.id.set(i),this.#e.set([...t,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e)}#t(e){return e.reduce((t,i)=>Math.max(t,i.ID),0)}destroy(){this.logLevel.set("Disabled"),this.timerInterval&&clearInterval(this.timerInterval)}static \u0275fac=function(t){return new(t||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
package/chunk-KDYD6LMI.js DELETED
@@ -1 +0,0 @@
1
- import{d as k,r as L}from"./chunk-N5SC4SKW.js";import{h as U}from"./chunk-NOPMCS2Z.js";import{H as C,Oc as R,V as E,_ as A,oa as z,r as S}from"./chunk-HNWRQABR.js";import{a as s,b as D}from"./chunk-EUDKD2JW.js";var h=class{constructor(t){this.loader=t}_data=z(void 0);_isLoading=!1;_loaded=!1;load(){return!this._loaded&&!this._isLoading&&(this._isLoading=!0,this.loader().pipe(C(()=>this._isLoading=!1)).subscribe(t=>{this._data.set(t),this._loaded=!0})),this._data.asReadonly()}value(){return this._data.asReadonly()}isLoading(){return this._isLoading}isLoaded(){return this._loaded}reset(){this._data.set(void 0),this._loaded=!1}};var g=class e{#e=A(U);#o=new h(()=>this.getS3Config("Providers"));#n=new h(()=>this.getS3Config("Regions"));#r=new h(()=>this.getS3Config("RegionHosts"));#i=new h(()=>this.getS3Config("StorageClasses"));#s=R(()=>{let t=this.#o.value()(),o=this.#r.value()(),r=[...t??[],...o?.map(n=>({key:`Amazon ${n.key}`,value:n.value}))??[]];return Array.from(new Map(r.map(n=>[n.value,n])).values())});#a=new h(()=>this.getStorjConfig("Satellites"));#l=new h(()=>this.getStorjConfig("AuthenticationMethods"));#c=new h(()=>this.getOpenstackConfig("Providers"));#p=new h(()=>this.getOpenstackConfig("Versions"));#u=new h(()=>this.getGcsConfig("Locations"));#m=new h(()=>this.getGcsConfig("StorageClasses"));getS3AllProviders(){return this.#o.load(),this.#r.load(),this.#s}getS3Providers(){return this.#o.load()}getS3Regions(){return this.#n.load()}getS3RegionHosts(){return this.#r.load()}getS3StorageClasses(){return this.#i.load()}getStorjSatellites(){return this.#a.load()}getStorjAuthenticationMethods(){return this.#l.load()}getOpenstackProviders(){return this.#c.load()}getOpenstackVersions(){return this.#p.load()}getGcsLocations(){return this.#u.load()}getGcsStorageClasses(){return this.#m.load()}getS3Config(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":t}}).pipe(S(o=>this.#t(o)))}createS3IamUser(t,o){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":t,"s3-password":o}})}createS3PolicyIAM(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:t}})}getStorjConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":t}}).pipe(S(o=>this.#t(o)))}getOpenstackConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":t}}).pipe(S(o=>this.#t(o)))}getGcsConfig(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":t}}).pipe(S(o=>this.#t(o)))}#t(t){return(t.Result&&typeof t.Result=="object"&&Object.entries(t.Result).map(([o,r])=>({key:o,value:r})))??[]}static \u0275fac=function(o){return new(o||e)};static \u0275prov=E({token:e,factory:e.\u0275fac,providedIn:"root"})};var i=new L,p={type:"error",message:$localize`Using a leading slash is most likely wrong, and will result in objects being created with a leading slash in the name.`},w={description:$localize`Unknown destination type`,icon:"/assets/dest-icons/file-system.png",isDefaultEntry:!0,customFields:{path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path`,formElement:e=>i.control(e??"")}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let n=o.startsWith(`${e}:///`)?o.split(`${e}:///`)[1]:o.split(`${e}://`)[1];return s({destinationType:e,custom:{path:n.split("?")[0]}},a(e,t))}}},V=[{key:"file",displayName:$localize`File system`,description:$localize`Store backups on your local file system.`,icon:"/assets/dest-icons/file-system.png",customFields:{path:{type:"FolderTree",name:"path",doubleSlash:p,shortDescription:$localize`File path`,longDescription:$localize`The path to store the backup`,formElement:e=>i.control(e??""),isMandatory:!0}},mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>{let r=o.startsWith("file:///"),n=decodeURIComponent(r?o.split("file:///")[1]:o.split("file://")[1]),u=n.slice(1).startsWith(":\\")?n:"/"+n;return s({destinationType:e,custom:{path:u.split("?")[0]}},a(e,t))}}},{key:"ssh",displayName:$localize`SSH`,description:$localize`Store backups with SSH.`,icon:"/assets/dest-icons/ssh.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`The server to connect to`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`The port to connect to`,formElement:e=>i.control(e??"",[k.required,k.max(65535)])},path:{type:"Path",name:"path",shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0}],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:$localize`This is a path to a private key file locally on the machine`,longDescription:$localize`This is a path to a private key file locally on the machine`},{type:"FreeText",name:"ssh-key",shortDescription:$localize`SSH private key`,longDescription:$localize`An SSH private key. Supported formats are OpenSSL, OpenSSH, PuTTY, and PEM.`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"s3",displayName:$localize`S3 Compatible`,description:$localize`Store backups in any S3 compatible bucket.`,icon:"/assets/dest-icons/aws.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"s3-server-name",order:1,shortDescription:$localize`Server`,longDescription:$localize`The hostname of the S3 compatible server to connect to`,type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3AllProviders(),isMandatory:!0,formElement:e=>i.control(e??"")},{name:"use-ssl",order:2},{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],advancedFields:[{name:"s3-client",type:"Enumeration",loadOptions:()=>z([{key:"AWS Library",value:"aws"},{key:"MinIO Library",value:"minio"}])},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3StorageClasses()},{name:"s3-location-constraint",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getS3Regions()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},a(e,t))}}},{key:"gcs",displayName:$localize`Google Cloud Storage`,description:$localize`Store backups in Google Cloud Storage.`,icon:"/assets/dest-icons/google-cloud.png",oauthField:"authid",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],advancedFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsLocations()},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(g).getGcsStorageClasses()}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},a(e,t))}}},{key:"googledrive",displayName:$localize`Google Drive`,description:$localize`Store backups in Google Drive.`,icon:"/assets/dest-icons/google-drive.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"pcloud",displayName:$localize`pCloud`,description:$localize`Store backups in pCloud.`,icon:"/assets/dest-icons/pcloud.png",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>z([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Folder path`,longDescription:$localize`Folder path`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",type:"Password",oauthVersion:2,isMandatory:!0}],mapper:{to:e=>{let{server:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{server:r,path:n}},a(e,t))}}},{key:"azure",displayName:$localize`Azure Blob Storage`,description:$localize`Store backups in Azure Blob Storage.`,icon:"/assets/dest-icons/azure.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Container name`,longDescription:$localize`Container name`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"onedrivev2",displayName:$localize`OneDrive`,description:$localize`Store backups in OneDrive.`,icon:"/assets/dest-icons/one-drive.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"od4b",displayName:$localize`OneDrive Business`,description:$localize`Store backups in OneDrive Business.`,icon:"/assets/dest-icons/one-drive.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"mssp",displayName:$localize`Microsoft SharePoint`,description:$localize`Store backups in Microsoft SharePoint.`,icon:"/assets/dest-icons/sharepoint.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Account name`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access key`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"sharepoint",displayName:$localize`Microsoft SharePoint v2`,description:$localize`Store backups in Microsoft SharePoint.`,icon:"/assets/dest-icons/sharepoint.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"site-id",isMandatory:!0},{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"dropbox",displayName:$localize`Dropbox`,description:$localize`Store backups in Dropbox.`,icon:"/assets/dest-icons/dropbox.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"box",displayName:$localize`Box.com`,description:$localize`Store backups in Box.com.`,icon:"/assets/dest-icons/box-com.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"jottacloud",displayName:$localize`Jottacloud`,description:$localize`Store backups in Jottacloud.`,icon:"/assets/dest-icons/jottacloud.png",oauthField:"authid",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"b2",displayName:$localize`B2 Cloud Storage`,description:$localize`Store backups in B2 Cloud Storage.`,icon:"/assets/dest-icons/backblaze.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Application ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Application Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},a(e,t))}}},{key:"e2",displayName:$localize`IDrive e2`,description:$localize`Store backups in IDrive e2.`,icon:"/assets/dest-icons/idrive-e2.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,longDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"String",name:"path",doubleSlash:p,shortDescription:$localize`Path in the bucket`,longDescription:$localize`Path in the bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Access ID`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Access Secret`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom;return c(e,t,null,o)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{bucket:r,path:n}},a(e,t))}}},{key:"mega",displayName:$localize`Mega.nz`,description:$localize`Store backups in Mega.nz.`,icon:"/assets/dest-icons/mega-nz.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let t=e.custom.path;return c(e,null,null,t)},from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"msgroup",displayName:$localize`Microsoft Office 365 Group`,description:$localize`Store backups in Microsoft Office 365 Group.`,icon:"/assets/dest-icons/office-365.png",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:$localize`Group email`,longDescription:$localize`Group email`,formElement:e=>i.control(e??"",[k.email]),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"authid",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"cloudfiles",displayName:$localize`Rackspace CloudFiles`,description:$localize`Store backups in Rackspace CloudFiles.`,icon:"/assets/dest-icons/rackspace.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"rclone",displayName:$localize`Rclone`,description:$localize`Store backups in Rclone.`,icon:"/assets/dest-icons/rclone.png",dynamicFields:[{name:"rclone-local-repository",shortDescription:$localize`Local repository`,defaultValue:""},{name:"rclone-remote-repository",shortDescription:$localize`Remote repository`,defaultValue:""},{name:"rclone-remote-path",type:"Path",shortDescription:$localize`Path on remote repository`,defaultValue:""}],mapper:{to:e=>{let t=e.dynamic["rclone-remote-repository"],o=e.dynamic["rclone-remote-path"],r=Object.entries(e.dynamic).filter(([n])=>!["rclone-remote-repository","rclone-remote-path"].includes(n));return v(e.destinationType??"rclone",t,null,o,[...Object.entries(e.advanced),...r])},from:(e,t,o)=>{let{advanced:r,dynamic:n}=a(e,t),{server:l,path:u}=m(t);return s({destinationType:e,dynamic:s({"rclone-remote-repository":l,"rclone-remote-path":u},n)},r)}}},{key:"openstack",displayName:$localize`OpenStack Object Storage`,description:$localize`Store backups in OpenStack Object Storage.`,icon:"/assets/dest-icons/open-stack.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket`,longDescription:$localize`Bucket`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:[{name:"openstack-authuri",shortDescription:$localize`Auth URI`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackProviders(),isMandatory:!0},{name:"openstack-version",shortDescription:$localize`Version`,type:"Enumeration",loadOptions:e=>e.get(g).getOpenstackVersions()},{name:"openstack-domain-name",type:"Hostname",shortDescription:$localize`Domain name`},{name:"openstack-tenant-name",shortDescription:$localize`Tenant name`},{name:"openstack-region",shortDescription:$localize`Region`}],mapper:{to:e=>{let{bucket:t}=e.custom;return c(e,t,null,null)},from:(e,t,o)=>{let{server:r,path:n}=m(t);return s({destinationType:e,custom:{path:n,bucket:r}},a(e,t))}}},{key:"webdav",displayName:$localize`WebDAV`,description:$localize`Store backups in WebDAV.`,icon:"/assets/dest-icons/webdav.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`},{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"aftp",displayName:$localize`Alternative FTP`,description:$localize`Store backups in FTP.`,icon:"/assets/dest-icons/ftp.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"ftp",displayName:$localize`FTP`,description:$localize`Store backups in FTP.`,icon:"/assets/dest-icons/ftp.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,doubleSlash:{type:"warning",message:$localize`Using a leading slash makes the path absolute, pointing to the root of the filesystem.`},formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:$localize`Username`,isMandatory:!0},{name:"auth-password",shortDescription:$localize`Password`,isMandatory:!0}],mapper:{to:e=>{let{port:t,server:o,path:r}=e.custom;return c(e,o,t,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"sia",displayName:$localize`Sia Decentrilized Cloud`,description:$localize`Store backups in Sia Decentrilized Cloud.`,icon:"/assets/dest-icons/sia-cloud.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let t=e.custom.server,o=e.dynamic["sia-targetpath"],r=[...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([n])=>n!=="sia-targetpath")];return v(e.destinationType??"sia",t,null,o,r)},from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"cos",displayName:$localize`Tencent COS`,description:$localize`Store backups in Tencent COS.`,icon:"/assets/dest-icons/tencent-cloud.png",customFields:{bucket:{name:"bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"cos-region",shortDescription:$localize`Region`},{name:"cos-app-id",shortDescription:$localize`COS App Id`,isMandatory:!0},{name:"cos-secret-id",shortDescription:$localize`COS Secret Id`,isMandatory:!0},{name:"cos-secret-key",shortDescription:$localize`COS Secret Key`,isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(s({},e),{advanced:D(s({},e.advanced),{"cos-bucket":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=a(e,t),n=r.advanced["cos-bucket"];return delete r.advanced["cos-bucket"],s({destinationType:e,custom:{path:d(t),bucket:n}},r)}}},{key:"tahoe",displayName:$localize`Tahoe LAFS`,description:$localize`Store backups in Tahoe LAFS.`,icon:"/assets/dest-icons/tahoelafs.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},port:{type:"Integer",name:"port",shortDescription:$localize`Port`,longDescription:$localize`Port`,formElement:e=>i.control(e??"")},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:$localize`Use SSL`}],mapper:{to:e=>{let{server:t,port:o,path:r}=e.custom;return c(e,t,o,r)},from:(e,t,o)=>{let{server:r,port:n,path:l}=m(t);return s({destinationType:e,custom:{server:r,port:n,path:l}},a(e,t))}}},{key:"smb",displayName:$localize`Windows Share (SMB)`,description:$localize`Store backups on SMB storage.`,icon:"/assets/dest-icons/smb.png",customFields:{server:{type:"Hostname",name:"server",shortDescription:$localize`Server`,longDescription:$localize`Server`,formElement:e=>i.control(e??""),isMandatory:!0},share:{type:"Hostname",name:"share",shortDescription:$localize`Share Name`,longDescription:$localize`Share Name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on server`,longDescription:$localize`Path on server`,formElement:e=>i.control(e??"")}},dynamicFields:["transport",{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0},"auth-domain"],mapper:{to:e=>{let{share:t,server:o,path:r}=e.custom;return c(e,o,null,M(t,r))},from:(e,t,o)=>{let{server:r,path:n}=m(t),l=n.split("/")[0],u=n.split("/").slice(1).join("/");return s({destinationType:e,custom:{server:r,share:l,path:u}},a(e,t))}}},{key:"filen",displayName:$localize`Filen.io`,description:$localize`Store backups in Filen.io.`,icon:"/assets/dest-icons/filen.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filen`,longDescription:$localize`Path on Filen`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"auth-username",isMandatory:!0},{name:"auth-password",isMandatory:!0}],mapper:{to:e=>c(e,null,null,e.custom.path),from:(e,t,o)=>s({destinationType:e,custom:{path:d(t)}},a(e,t))}},{key:"filejump",displayName:$localize`Filejump`,description:$localize`Store backups in Filejump.`,icon:"/assets/dest-icons/file-jump.png",customFields:{path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path on Filejump`,longDescription:$localize`Path on Filejump`,formElement:e=>i.control(e??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:$localize`API Token`,longDescription:$localize`Filejump API Token`,formElement:e=>i.control(e??""),isMandatory:!0}],mapper:{to:e=>{let{path:t}=e.custom;return console.log(t),c(e,null,null,t)},from:(e,t,o)=>(console.log(t),s({destinationType:e,custom:{path:d(t)}},a(e,t)))}},{key:"storj",customKey:"storjAccessGrant",displayName:$localize`Storj Access Grant`,description:$localize`Store backups in Storj Access Grant.`,icon:"/assets/dest-icons/storj.png",dynamicFields:[{name:"storj-shared-access",shortDescription:$localize`Access Grant`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p},{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0}],mapper:{to:e=>{let t={"storj-auth-method":"Acccess grant"};return`storj://storj.io/config${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=a(e,t);return delete r.advanced["storj-auth-method"],s({destinationType:e},r)}}},{key:"storj",customKey:"storjApiKey",displayName:$localize`Storj API Key`,description:$localize`Store backups in Storj API Key.`,icon:"/assets/dest-icons/storj.png",dynamicFields:[{name:"storj-satellite",shortDescription:$localize`Satellite`,type:"Enumeration",loadOptions:e=>e.get(g).getStorjSatellites(),isMandatory:!0},{name:"storj-api-key",shortDescription:$localize`API Key`,isMandatory:!0},{name:"storj-secret",shortDescription:$localize`Secret`,isMandatory:!0},{name:"storj-bucket",type:"Bucketname",shortDescription:$localize`Bucket`,isMandatory:!0},{name:"storj-folder",type:"Path",shortDescription:$localize`Path on server`,doubleSlash:p}],mapper:{to:e=>{let t={"storj-auth-method":"API key"};return`storj://storj.io/config${b([...Object.entries(e.advanced),...Object.entries(e.dynamic),...Object.entries(t)])}`},from:(e,t,o)=>{let r=a(e,t);return delete r.advanced["storj-auth-method"],s({destinationType:e},r)}}},{key:"aliyunoss",displayName:$localize`Aliyun OSS`,description:$localize`Store backups in Aliyun OSS`,icon:"/assets/dest-icons/aliyun.png",customFields:{bucket:{type:"Bucketname",name:"bucket",shortDescription:$localize`Bucket name`,formElement:e=>i.control(e??""),isMandatory:!0},path:{type:"Path",name:"path",doubleSlash:p,shortDescription:$localize`Path in bucket`,longDescription:$localize`Path in bucket`,formElement:e=>i.control(e??"")}},dynamicFields:[{name:"oss-endpoint",isMandatory:!0},{name:"oss-access-key-id",isMandatory:!0},{name:"oss-access-key-secret",isMandatory:!0}],mapper:{to:e=>{let{bucket:t,path:o}=e.custom,r=D(s({},e),{advanced:D(s({},e.advanced),{"oss-bucket-name":t})});return c(r,null,null,o)},from:(e,t,o)=>{let r=a(e,t),n=r.advanced["oss-bucket-name"];return delete r.advanced["oss-bucket-name"],s({destinationType:e,custom:{path:d(t),bucket:n}},r)}}}],le={".amazonaws.com":"Amazon S3",".mycloudyplace.com":"MyCloudyPlace S3",".impossibleapi.net":"Impossible Cloud S3",".scw.cloud":"Scaleway S3",".hosteurope.de":"Hosteurope S3",".dunkel.de":"Dunkel S3",".dreamhost.com":"DreamHost S3",".dincloud.com":"dinCloud S3",".polisystems.ch":"Poli Systems S3",".softlayer.net":"IBM COS (S3)",".storadera.com":"Storadera S3",".wasabisys.com":"Wasabi S3",".infomaniak.com":"Infomaniak S3",".infomaniak.cloud":"Infomaniak S3",".sakurastorage.jp":"\u3055\u304F\u3089\u306E\u30AF\u30E9\u30A6\u30C9 S3",".lyvecloud.seagate.com":"Seagate Lyve S3",".digitaloceanspaces.com":"DigitalOcean S3",".backblazeb2.com":"Backblaze B2 S3",".cloudian.com":"Cloudian S3",".min.io":"MinIO S3",".linodeobjects.com":"Linode S3",".bunnycdn.com":"BunnyCDN S3",".azure.com":"Microsoft Azure S3",".googleapis.com":"Google Cloud Storage S3",".ibm.com":"IBM Cloud S3",".oracle.com":"Oracle Cloud S3",".cloudflare.com":"Cloudflare S3",".alibaba.com":"Alibaba Cloud S3",".huawei.com":"Huawei Cloud S3",".tencent.com":"Tencent Cloud S3",".baidu.com":"Baidu Cloud S3",".jd.com":"JD Cloud S3",".ucloud.cn":"UCloud S3",".qiniu.com":"Qiniu Cloud S3",".aliyuncs.com":"Aliyun S3",".tcloud.com":"TCloud S3",".tencentcloudapi.com":"Tencent Cloud S3"};function c(e,t,o,r){return v(e.destinationType??"file",t,o,r,[...Object.entries(e.advanced),...Object.entries(e.dynamic)])}function v(e,t,o,r,n){let l=b(n),u=encodeURIComponent(B(t)),y=u==""?"":u+j(o),f=r??"",$=f.slice(1).startsWith(":\\")&&e=="file"?"file:///":`${e}://`,O=M(y,I(f));return`${$}${O}${l}`}function N(e){return e==null||e===""?"":e.startsWith("/")?e.substring(1):e}function M(...e){if(e.length===0)return"";if(e.length===1)return e[0]??"";let t="";for(let o of e)o==null||o===""||(t+=t.endsWith("/")||t==""?o:"/"+o);return t}function I(e){return e.split("/").map(encodeURIComponent).join("/")}function d(e){if(e==null||e==="")return"";if(typeof e=="string")try{e=new URL(e)}catch{return""}return decodeURIComponent(e.hostname??"")+decodeURIComponent(e.pathname=="/"?"":e.pathname??"")}function B(e){return e==null||e===""?"":e.endsWith("/")?e.substring(0,e.length-1):e}function j(e){return e==null||e===""?"":":"+e.toString()}function P(e){return V.find(o=>o.key===e||o.customKey===e)??V.find(o=>`${o.key}s`===e)??null??s({key:e,displayName:e},w)}function m(e){return{server:decodeURIComponent(e.hostname),port:e.port,path:N(decodeURIComponent(e.pathname))}}function a(e,t){let o={},r={},n=P(e);return t.searchParams.forEach((l,u)=>{n?.dynamicFields?.some(f=>f===u||f?.name===u)?r[u]=decodeURIComponent(l):o[u]=decodeURIComponent(l)}),{advanced:o,dynamic:r}}function b(e,t=!1){let o=e.map(([n,l])=>`${n}=${l?encodeURIComponent(l.toString()):""}`).join("&");return o?(t?"":"?")+o:""}function me(e){let t=e.destinationType??"";return P(t)?.mapper.to(e)??""}function de(e){let t=URL.canParse(e),o=e.split("://")[0],r=e.split("://")[1],n=o==="file"?"http://dummy":"http://"+r;if(!r)return null;if(r.startsWith("%")&&o==="file")return P(o).mapper.from(o,new URL("http://localhost"),e);let l=P(o),u="";`${l.key}s`===o&&(u+=n.indexOf("?")===-1?"?":"&",u+="use-ssl=true",e=l.key+e.substring(o.length));try{let y=new URL(n+u);if(y.host==="undefined")return null;let f=r.split("?")[0].split("/")[0],G=!isNaN(Number(y.host.replaceAll(".",""))),$=f.split("."),O=$.length===4&&$.every(F=>F.length&&F.length<=3&&!isNaN(Number(F))&&parseInt(F)<=255);return G&&!O?null:l.mapper.from(l.key,y,e)}catch(y){return console.error("Error while parsing target path",y),null}}export{P as a,me as b,de as c,le as d};