@duplicati/ngclient 0.0.100 → 0.0.101

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{f as a,g as b,h as c}from"./chunk-SYZYJSXM.js";import"./chunk-LBZ753XE.js";import"./chunk-XH2A67YP.js";import"./chunk-ISRMJKPG.js";import"./chunk-DNHLTHLR.js";import"./chunk-3V622MYY.js";import"./chunk-WCLOWI5G.js";import"./chunk-PX6A6XCQ.js";import"./chunk-RHW5QVAY.js";import"./chunk-JJQARMUD.js";import"./chunk-I3TLRILF.js";import"./chunk-2SGDSXNW.js";import"./chunk-XQKR67WI.js";import"./chunk-CEOO3F5U.js";import"./chunk-K3CYM6ID.js";import"./chunk-M7VDIUGU.js";import"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
1
+ import{f as a,g as b,h as c}from"./chunk-6UVVDGKQ.js";import"./chunk-LBZ753XE.js";import"./chunk-XH2A67YP.js";import"./chunk-ISRMJKPG.js";import"./chunk-DNHLTHLR.js";import"./chunk-3V622MYY.js";import"./chunk-WCLOWI5G.js";import"./chunk-MM22YS5Z.js";import"./chunk-RHW5QVAY.js";import"./chunk-JJQARMUD.js";import"./chunk-I3TLRILF.js";import"./chunk-2SGDSXNW.js";import"./chunk-XQKR67WI.js";import"./chunk-CEOO3F5U.js";import"./chunk-K3CYM6ID.js";import"./chunk-M7VDIUGU.js";import"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1,3 +1,3 @@
1
- import{a as Fe}from"./chunk-TLY4PQBT.js";import{m as L}from"./chunk-SYZYJSXM.js";import{a as Se}from"./chunk-LBZ753XE.js";import"./chunk-XH2A67YP.js";import{a as Ee}from"./chunk-ISRMJKPG.js";import"./chunk-DNHLTHLR.js";import{a as D}from"./chunk-3V622MYY.js";import"./chunk-WCLOWI5G.js";import"./chunk-PX6A6XCQ.js";import{a as fe}from"./chunk-SFWQDWHT.js";import"./chunk-ZP273LXY.js";import"./chunk-D5WIWFNP.js";import"./chunk-WSLU6K4D.js";import"./chunk-UJZB6UQE.js";import"./chunk-RHW5QVAY.js";import{c as le,e as se,f as me,h as de,i as _e,m as pe,n as ce,o as ue,q as Ce,r as ge,s as Me,t as Ne}from"./chunk-JJQARMUD.js";import"./chunk-3UJUWE5B.js";import{b as Z,d as J,e as Q}from"./chunk-I3TLRILF.js";import"./chunk-2SGDSXNW.js";import{a as te,g as ne,k as oe,l as ie,p as ae,t as re}from"./chunk-XQKR67WI.js";import{a as Y,b as ee}from"./chunk-CEOO3F5U.js";import"./chunk-K3CYM6ID.js";import"./chunk-O6GWHO26.js";import"./chunk-M7VDIUGU.js";import"./chunk-BWYJMRKB.js";import{Db as S,Eb as E,Fb as c,Gb as X,Hb as V,Jb as W,Kb as g,Na as s,Ob as j,W as C,Za as B,ba as N,bc as P,ca as f,cb as v,cc as T,dc as I,hc as H,ic as k,kb as u,mb as x,pb as G,qb as w,ra as F,rb as U,sb as K,tb as r,ub as o,vb as l,wb as A,xb as O,yc as q,zb as z}from"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";var Ae=()=>[],Oe=()=>["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","no-encryption"];function Pe(m,t){m&1&&l(0,"spk-progress-bar",13)}function Te(m,t){if(m&1&&(r(0,"spk-form-field"),l(1,"input",36),o()),m&2){let e=t.$implicit,n=t.$index;s(),j("id","filter-",n,""),u("formControl",e)}}function Ie(m,t){if(m&1){let e=z();r(0,"form",14)(1,"spk-select",15)(2,"label",16),c(3,1),o(),l(4,"input",17),o(),r(5,"spk-form-field")(6,"label",18),c(7,2),o(),l(8,"textarea",19),o(),r(9,"spk-form-field")(10,"label",20),c(11,3),o(),l(12,"textarea",21),o()(),r(13,"spk-divider"),c(14,4),o(),r(15,"form",14)(16,"spk-form-field")(17,"label",22),c(18,5),o(),l(19,"input",23),o(),r(20,"spk-form-field")(21,"label",24),c(22,6),o(),l(23,"input",25),o(),r(24,"app-toggle-card",26),A(25,27),c(26,7),O(),A(27,28),U(28,Te,2,3,"spk-form-field",null,w),O(),o()(),r(30,"div",29)(31,"app-size",30),I("ngModelChange",function(i){N(e);let d=g();return T(d.optionsFields.remoteVolumeSize,i)||(d.optionsFields.remoteVolumeSize=i),f(i)}),r(32,"label",31),c(33,8),o()()(),r(34,"p"),S(35,9),l(36,"a",32),E(),o(),r(37,"app-options-list",33),I("optionsChange",function(i){N(e);let d=g();return T(d.settings,i)||(d.settings=i),f(i)}),o(),r(38,"div",34)(39,"button",35),W("click",function(){N(e);let i=g();return f(i.submit())}),S(40,10),l(41,"spk-icon"),E(),o()()}if(m&2){let e,n=g();u("formGroup",n.baseCmdForm),s(),u("options",(e=n.commandOptions())!==null&&e!==void 0?e:k(13,Ae))("inlineSearch",!0),s(14),u("formGroup",n.standardFields),s(9),u("disallowToggle",!0),s(4),K(n.standardFields.controls.filters.controls),s(3),u("customId","size"),P("ngModel",n.optionsFields.remoteVolumeSize),s(6),P("options",n.settings),u("hasFreeTextSettings",!0)("hiddenOptions",k(14,Oe)),s(2),x("loader",n.isSubmitting()),s(2),X(n.baseCmdForm.value.command),V(40)}}var p=new ge,ke=["Bytes","KB","MB","GB","TB","PB"],$=class m{#e=C(L);#t=C(ee);#n=C(J);#o=C(Z);#i=C(Y);#a=D(this.#o.params);commandOptions=D(this.#i.getApiV1Commandline());sizeOptions=F(ke);isSubmitting=F(!1);optionsFields=this.#e.optionsFields;standardFields=p.group({"backup-id":p.control(""),"backup-name":p.control(""),dbpath:p.control(""),filters:p.array([])});baseCmdForm=p.group({command:p.control("backup"),targetUrl:p.control(""),arguments:p.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#r=q(()=>{let t=this.#a()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(p.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",n=t.arguments?.split(`
1
+ import{a as Fe}from"./chunk-TLY4PQBT.js";import{m as L}from"./chunk-6UVVDGKQ.js";import{a as Se}from"./chunk-LBZ753XE.js";import"./chunk-XH2A67YP.js";import{a as Ee}from"./chunk-ISRMJKPG.js";import"./chunk-DNHLTHLR.js";import{a as D}from"./chunk-3V622MYY.js";import"./chunk-WCLOWI5G.js";import"./chunk-MM22YS5Z.js";import{a as fe}from"./chunk-SFWQDWHT.js";import"./chunk-ZP273LXY.js";import"./chunk-D5WIWFNP.js";import"./chunk-WSLU6K4D.js";import"./chunk-UJZB6UQE.js";import"./chunk-RHW5QVAY.js";import{c as le,e as se,f as me,h as de,i as _e,m as pe,n as ce,o as ue,q as Ce,r as ge,s as Me,t as Ne}from"./chunk-JJQARMUD.js";import"./chunk-3UJUWE5B.js";import{b as Z,d as J,e as Q}from"./chunk-I3TLRILF.js";import"./chunk-2SGDSXNW.js";import{a as te,g as ne,k as oe,l as ie,p as ae,t as re}from"./chunk-XQKR67WI.js";import{a as Y,b as ee}from"./chunk-CEOO3F5U.js";import"./chunk-K3CYM6ID.js";import"./chunk-O6GWHO26.js";import"./chunk-M7VDIUGU.js";import"./chunk-BWYJMRKB.js";import{Db as S,Eb as E,Fb as c,Gb as X,Hb as V,Jb as W,Kb as g,Na as s,Ob as j,W as C,Za as B,ba as N,bc as P,ca as f,cb as v,cc as T,dc as I,hc as H,ic as k,kb as u,mb as x,pb as G,qb as w,ra as F,rb as U,sb as K,tb as r,ub as o,vb as l,wb as A,xb as O,yc as q,zb as z}from"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";var Ae=()=>[],Oe=()=>["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","no-encryption"];function Pe(m,t){m&1&&l(0,"spk-progress-bar",13)}function Te(m,t){if(m&1&&(r(0,"spk-form-field"),l(1,"input",36),o()),m&2){let e=t.$implicit,n=t.$index;s(),j("id","filter-",n,""),u("formControl",e)}}function Ie(m,t){if(m&1){let e=z();r(0,"form",14)(1,"spk-select",15)(2,"label",16),c(3,1),o(),l(4,"input",17),o(),r(5,"spk-form-field")(6,"label",18),c(7,2),o(),l(8,"textarea",19),o(),r(9,"spk-form-field")(10,"label",20),c(11,3),o(),l(12,"textarea",21),o()(),r(13,"spk-divider"),c(14,4),o(),r(15,"form",14)(16,"spk-form-field")(17,"label",22),c(18,5),o(),l(19,"input",23),o(),r(20,"spk-form-field")(21,"label",24),c(22,6),o(),l(23,"input",25),o(),r(24,"app-toggle-card",26),A(25,27),c(26,7),O(),A(27,28),U(28,Te,2,3,"spk-form-field",null,w),O(),o()(),r(30,"div",29)(31,"app-size",30),I("ngModelChange",function(i){N(e);let d=g();return T(d.optionsFields.remoteVolumeSize,i)||(d.optionsFields.remoteVolumeSize=i),f(i)}),r(32,"label",31),c(33,8),o()()(),r(34,"p"),S(35,9),l(36,"a",32),E(),o(),r(37,"app-options-list",33),I("optionsChange",function(i){N(e);let d=g();return T(d.settings,i)||(d.settings=i),f(i)}),o(),r(38,"div",34)(39,"button",35),W("click",function(){N(e);let i=g();return f(i.submit())}),S(40,10),l(41,"spk-icon"),E(),o()()}if(m&2){let e,n=g();u("formGroup",n.baseCmdForm),s(),u("options",(e=n.commandOptions())!==null&&e!==void 0?e:k(13,Ae))("inlineSearch",!0),s(14),u("formGroup",n.standardFields),s(9),u("disallowToggle",!0),s(4),K(n.standardFields.controls.filters.controls),s(3),u("customId","size"),P("ngModel",n.optionsFields.remoteVolumeSize),s(6),P("options",n.settings),u("hasFreeTextSettings",!0)("hiddenOptions",k(14,Oe)),s(2),x("loader",n.isSubmitting()),s(2),X(n.baseCmdForm.value.command),V(40)}}var p=new ge,ke=["Bytes","KB","MB","GB","TB","PB"],$=class m{#e=C(L);#t=C(ee);#n=C(J);#o=C(Z);#i=C(Y);#a=D(this.#o.params);commandOptions=D(this.#i.getApiV1Commandline());sizeOptions=F(ke);isSubmitting=F(!1);optionsFields=this.#e.optionsFields;standardFields=p.group({"backup-id":p.control(""),"backup-name":p.control(""),dbpath:p.control(""),filters:p.array([])});baseCmdForm=p.group({command:p.control("backup"),targetUrl:p.control(""),arguments:p.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#r=q(()=>{let t=this.#a()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(p.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",n=t.arguments?.split(`
2
2
  `)??[],i=this.standardFields.value,d=i.filters??[],M=[t.command,e,...n,`--backup-name=${i["backup-name"]}`,`--dbpath=${i.dbpath}`,`--backup-id=${i["backup-id"]}`,...d.filter(a=>a).map(a=>a.startsWith("-")?`--exclude=${a?.slice(1)}`:`--include=${a}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(a=>a.Name.startsWith("--")?`${a.Name}=${a.Value}`:`--${a.Name}=${a.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:M}).subscribe(a=>{a.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",a.ID])})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
3
  `)??""})}static \u0275fac=function(e){return new(e||m)};static \u0275cmp=B({type:m,selectors:[["app-commandline"]],features:[H([L])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_ICON: Back `;let e;e=$localize`Command`;let n;n=$localize`TargetUrl`;let i;i=$localize`Commandline Arguments`;let d;d=$localize`Advanced options`;let M;M=$localize`Backup ID`;let a;a=$localize`Backup Name`;let h;h=$localize`Filters`;let b;b=$localize`Remote volume size`;let R;R=$localize` The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. ${"\uFFFD#36\uFFFD"}:START_LINK:Read more${"\uFFFD/#36\uFFFD"}:CLOSE_LINK:`;let y;return y=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SPK_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,n,i,d,M,a,h,b,R,y,[1,"back"],["type","button","spk-button","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["id","arguments","autocomplete","off","formControlName","arguments"],["for","backup-id"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],["href","#",1,"spk-primary"],[3,"optionsChange","options","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["spk-button","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,n){e&1&&(l(0,"app-status-bar"),r(1,"section")(2,"div",11)(3,"button",12),S(4,0),l(5,"spk-icon"),E(),o()(),v(6,Pe,1,0,"spk-progress-bar",13)(7,Ie,42,15),o()),e&2&&(s(6),G(n.finishedLoading()?7:6))},dependencies:[Me,_e,le,se,me,de,fe,Fe,Ee,Ne,pe,ce,Ce,ue,Q,ie,ne,oe,re,ae,te,Se],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}"],changeDetection:0})};export{$ as default};
@@ -0,0 +1,8 @@
1
+ import{a as zt,b as Wt}from"./chunk-LBZ753XE.js";import{a as pt}from"./chunk-XH2A67YP.js";import{a as Xe}from"./chunk-ISRMJKPG.js";import{a as Pt,b as Xt}from"./chunk-DNHLTHLR.js";import{a as K}from"./chunk-3V622MYY.js";import{a as it}from"./chunk-WCLOWI5G.js";import{a as ke}from"./chunk-MM22YS5Z.js";import{b as Kt}from"./chunk-RHW5QVAY.js";import{b as be,c as de,d as _e,e as Fe,f as Ge,g as rt,h as at,i as Le,j as Ue,m as st,n as Ve,o as lt,p as Ht,q as Be,r as ge,s as Ke,t as He}from"./chunk-JJQARMUD.js";import{b as Ee,d as pe}from"./chunk-I3TLRILF.js";import{A as ot,a as ce,b as tt,d as Ut,e as Vt,g as Ie,l as ue,o as Bt,p as nt,t as me,z as ve}from"./chunk-XQKR67WI.js";import{b as xe}from"./chunk-CEOO3F5U.js";import{c as Lt}from"./chunk-K3CYM6ID.js";import{i as Gt}from"./chunk-M7VDIUGU.js";import{$b as vt,D as je,Db as D,Eb as E,Fb as w,Gb as ft,Hb as Tt,Ib as Ne,Jb as N,Kb as c,Na as l,Nb as le,Pb as It,Q as De,Qb as V,Ua as Me,Vb as Re,W as R,Wb as we,Xb as ie,Yb as S,Za as se,Zb as Dt,_b as H,ba as F,bc as W,ca as g,cb as C,cc as j,dc as q,ec as Et,fc as yt,ga as xt,gc as At,ic as bt,jc as Qe,kb as u,lc as Ye,mb as Pe,na as St,oa as ht,p as We,pb as T,pc as Je,qb as te,ra as P,rb as ne,sb as oe,tb as s,ub as a,vb as d,wb as X,xb as z,xc as L,yb as qe,yc as et,zb as I}from"./chunk-XGARKXE4.js";import{a as A,c as wt}from"./chunk-7CGTOI24.js";var ct=class e{fromString(n){if(!n)return null;let t=n.match(/(\d+)([smhDWMY])/);return t&&{value:parseInt(t[1]),unit:t[2]}}toString(n,t){return`${n}${t}`}static \u0275fac=function(t){return new(t||e)};static \u0275prov=De({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ce=class e{#n=R(xe);s3Providers=K(this.getS3Config("Providers"));s3Regions=K(this.getS3Config("Regions"));s3RegionHosts=K(this.getS3Config("RegionHosts"));s3StorageClasses=K(this.getS3Config("StorageClasses"));storjSatellites=K(this.getStorjConfig("Satellites"));storjAuthenticationMethods=K(this.getStorjConfig("AuthenticationMethods"));openstackProviders=K(this.getOpenstackConfig("Providers"));openstackVersions=K(this.getOpenstackConfig("Versions"));gcsLocations=K(this.getGcsConfig("Locations"));gcsStorageClasses=K(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(We(t=>this.#e(t)))}createS3IamUser(n,t){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":t}})}createS3PolicyIAM(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(We(t=>this.#e(t)))}getOpenstackConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(We(t=>this.#e(t)))}getGcsConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(We(t=>this.#e(t)))}#e(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([t,o])=>({key:t,value:o})))??[]}static \u0275fac=function(t){return new(t||e)};static \u0275prov=De({token:e,factory:e.\u0275fac,providedIn:"root"})};function Ae(e){return e==null?"":":"+e.toString()}function Q(e){return e==null?"":e.startsWith("/")?e:"/"+e}function k(e,n){let t={},o={},i=he.find(r=>r.key===e);return n.searchParams.forEach((r,p)=>{i?.dynamicFields?.some(f=>f===p||f?.name===p)?o[p]=decodeURIComponent(r):t[p]=decodeURIComponent(r)}),{advanced:t,dynamic:o}}function O(e,n=!1){let t=e.map(([i,r])=>`${i}=${r?encodeURIComponent(r.toString()):""}`).join("&");return t?(n?"":"?")+t:""}function ut(e){let n=e.destinationType,t=he.find(o=>o.customKey===n||o.key===n);if(!t)throw new Error("Invalid destination type");return t?.mapper.to(e)??""}function Nt(e){let n=URL.canParse(e),t=e.split("://")[0],o=e.split("://")[1],i="http://"+o;if(o.startsWith("%")&&t==="file")return he.find(r=>r.customKey===t||r.key===t)?.mapper.from(t,new URL("http://localhost"),e);try{let r=new URL(i);return he.find(p=>p.customKey===t||p.key===t)?.mapper.from(t,r,e)}catch(r){console.error("Error while parsing target path",r)}if(!n)throw new Error("Invalid target path");return null}var _=new ge,he=[{key:"file",displayName:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:e=>_.control(e??"")}},mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>{let i=t.startsWith("file:///")?t.split("file:///")[1]:t.split("file://")[1],r=i.startsWith("%"),m=i.slice(1).startsWith(":\\")||r?i:"/"+i;return A({destinationType:e,custom:{path:m}},k(e,n))}}},{key:"ssh",displayName:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:e=>_.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:e=>_.control(e??"",[_e.required,_e.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>_.control(e??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Ae(t)+Q(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"s3",displayName:"S3 compatible bucket",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>_.control(e??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Ce).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Ce).s3StorageClasses}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+Q(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},k(e,n))}},{key:"gcs",displayName:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Ce).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Ce).gcsStorageClasses},"authid"],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"googledrive",displayName:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>_.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"pcloud",displayName:"pCloud",description:"Store backups in pCloud.",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>P([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>_.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{server:t,path:o}=e.custom;return`${e.destinationType}://${t+Q(o)+n}`},from:(e,n,t)=>{let o=n.pathname.replace(/^\//,"");return A({destinationType:e,custom:{server:n.hostname,path:o}},k(e,n))}}},{key:"azure",displayName:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",shortDescription:"Container name",longDescription:"Container name",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"onedrivev2",displayName:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Ae(t)+Q(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Ae(t)+Q(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"sharepoint",displayName:"Microsoft SharePoint v2",description:"Store backups in Microsoft SharePoint.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"dropbox",displayName:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"box",displayName:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"jottacloud",displayName:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"b2",displayName:"B2 Cloud Storage",description:"Store backups in B2 Cloud Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+Q(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{bucket:n.hostname,path:decodeURIComponent(n.pathname)}},k(e,n))}},{key:"e2",displayName:"IDrive e2",description:"Store backups in IDrive e2.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+Q(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{bucket:n.hostname,path:n.pathname}},k(e,n))}},{key:"mega",displayName:"Mega.nz",description:"Store backups in Mega.nz.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"msgroup",displayName:"Microsoft Office 365 Group",description:"Store backups in Microsoft Office 365 Group.",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:"Group email",longDescription:"Group email",formElement:e=>_.control(e??"",[_e.email])},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Ae(t)+Q(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"rclone",displayName:"Rclone",description:"Store backups in Rclone.",dynamicFields:[{name:"rclone-local-repository",shortDescription:"Local repository",defaultValue:""},{name:"rclone-remote-repository",shortDescription:"Remote repository",defaultValue:""},{name:"rclone-remote-path",shortDescription:"Path on remote repository",defaultValue:""}],mapper:{to:e=>{let n=e.dynamic["rclone-remote-repository"],t=e.dynamic["rclone-remote-path"],o=Object.entries(e.dynamic).filter(([r])=>!["rclone-remote-repository","rclone-remote-path"].includes(r)),i=O([...Object.entries(e.advanced),...o]);return`${e.destinationType}://${n}/${t+i}`},from:(e,n,t)=>{let{advanced:o,dynamic:i}=k(e,n);return A({destinationType:e,dynamic:A({"rclone-remote-repository":n.hostname,"rclone-remote-path":n.pathname},i)},o)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:e=>e.get(Ce).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:e=>e.get(Ce).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{bucket:t}=e.custom;return`${e.destinationType}://${t+n}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},k(e,n))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=e.dynamic["use-ssl"],r=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([p])=>p!=="use-ssl")]);return`${e.destinationType}${i?"s":""}://${t+Ae(n)+Q(o)+r}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([r])=>r!=="use-ssl")]);return`${e.destinationType}://${t+Ae(n)+Q(o)+i}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"sia",displayName:"Sia Decentrilized Cloud",description:"Store backups in Sia Decentrilized Cloud.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let n=e.custom.server,t=e.dynamic["sia-targetpath"],o=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([i])=>i!=="sia-targetpath")]);return`${e.destinationType}://${n+Q(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname}},k(e,n))}},{key:"cos",displayName:"Tencent COS",description:"Store backups in Tencent COS.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"cos-bucket",shortDescription:"Bucket",order:1},{name:"cos-region",shortDescription:"Region",order:2},{name:"cos-app-id",shortDescription:"COS App Id",order:3},{name:"cos-secret-id",shortDescription:"COS Secret Id",order:4},{name:"cos-secret-key",shortDescription:"COS Secret Key",order:5}],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([o])=>o!=="cos-targetpath")]);return`${e.destinationType}://${n+t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname}},k(e,n))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")},username:{type:"String",name:"username",shortDescription:"Username",longDescription:"Username",formElement:e=>_.control(e??"")},password:{type:"Password",name:"password",shortDescription:"Password",longDescription:"Password",formElement:e=>_.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:e=>{let{port:n,server:t,path:o,username:i,password:r}=e.custom,p={"auth-username":i,"auth-password":r},m=e.dynamic["use-ssl"],f=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([$])=>$!=="use-ssl"),...Object.entries(p)]);return`${e.destinationType}${m?"s":""}://${t+Ae(n)+Q(o)+f}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"cifs",displayName:"CIFS",description:"Store backups in CIFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>_.control(e??"")},share:{type:"String",name:"share",shortDescription:"Share Name",longDescription:"Share Name",formElement:e=>_.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>_.control(e??"")}},dynamicFields:["transport","auth-username","auth-password","auth-domain"],mapper:{to:e=>{let{share:n,server:t,path:o,username:i,password:r}=e.custom,p={"auth-username":i,"auth-password":r},m=new Map([...Object.entries(p),...Object.entries(e.advanced),...Object.entries(e.dynamic)]),f=O(Array.from(m));return`${e.destinationType}://${t+Q(n)+Q(o)+f}`},from:(e,n,t)=>{let o=n.pathname.split("/")[1],i=n.pathname.split("/").slice(2).join("/");return A({destinationType:e,custom:{server:n.hostname,share:o,path:i}},k(e,n))}}},{key:"filen",displayName:"Filen.io",description:"Store backups in Filen.io.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filen",longDescription:"Path on Filen",formElement:e=>_.control(e??"")}},dynamicFields:["auth-username","auth-password"],mapper:{to:e=>{let{path:n,username:t,password:o}=e.custom,i={"auth-username":t,"auth-password":o},r=new Map([...Object.entries(i),...Object.entries(e.advanced),...Object.entries(e.dynamic)]),p=O(Array.from(r));return`${e.destinationType}://${n+p}`},from:(e,n,t)=>{let o=n.hostname??"";return n.pathname&&o!==""&&n.pathname[0]!="/"&&(o+="/"),o+=n.pathname,A({destinationType:e,custom:{path:o}},k(e,n))}}},{key:"filejump",displayName:"Filejump",description:"Store backups in Filejump.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filejump",longDescription:"Path on Filejump",formElement:e=>_.control(e??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:"API Token",longDescription:"Filejump API Token",formElement:e=>_.control(e??"")}],mapper:{to:e=>{let{path:n,username:t,password:o,apitoken:i}=e.custom,r=(i||"").trim()===""?{"auth-username":t,"auth-password":o}:{"api-token":i},p=new Map([...Object.entries(r),...Object.entries(e.advanced),...Object.entries(e.dynamic)]),m=O(Array.from(p));return`${e.destinationType}://${n+m}`},from:(e,n,t)=>{let o=n.hostname??"";return n.pathname&&o!==""&&n.pathname[0]!="/"&&(o+="/"),o+=n.pathname,A({destinationType:e,custom:{path:o}},k(e,n))}}},{key:"storj",customKey:"storjAccessGrant",displayName:"Storj Access Grant",description:"Store backups in Storj Access Grant.",dynamicFields:[{name:"storj-shared-access",shortDescription:"Access Grant"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:e=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${O([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>A({destinationType:e},k(e,n))}},{key:"storj",customKey:"storjApiKey",displayName:"Storj API Key",description:"Store backups in Storj API Key.",dynamicFields:[{name:"storj-satellite",shortDescription:"Satellite",type:"Enumeration",loadOptions:e=>e.get(Ce).storjSatellites},{name:"storj-api-key",shortDescription:"API Key"},{name:"storj-secret",shortDescription:"Secret"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:e=>`storj://storj.io/config?storj-auth-method=API%20key&${O([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>A({destinationType:e},k(e,n))}}];var jt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,mt=class e{generate(n,t=jt){let o;do o=this.generatePassword(n,t);while(this.calculatePasswordStrength(o)<5);return o}generatePassword(n,t=jt){return Array.apply(null,{length:n}).map(()=>{let o;for(;;)if(o=String.fromCharCode(Kt()),t.test(o))return o},this).join("")}calculatePasswordStrength(n){let t=1;return n.length>=8&&t++,n.match(/[a-z]/)&&n.match(/[A-Z]/)&&t++,n.match(/\d+/)&&t++,n.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=De({token:e,factory:e.\u0275fac,providedIn:"root"})};var tn=["formRef"];function nn(e,n){if(e&1&&S(0),e&2){let t=n.$implicit;H(" ",t.DisplayName," ")}}function on(e,n){if(e&1&&d(0,"spk-progress-bar",37),e&2){let t=c(3);Pe("error",t.calculatePasswordStrength()===1)("warn",t.calculatePasswordStrength()===2)("primary",t.calculatePasswordStrength()===4)("success",t.calculatePasswordStrength()===5),u("value",t.calculatePasswordStrength()*(100/5))}}function rn(e,n){e&1&&(s(0,"span",32),w(1,9),a())}function an(e,n){e&1&&(D(0,7,1),d(1,"spk-icon"),E())}function sn(e,n){e&1&&(D(0,7,2),d(1,"spk-icon"),E())}function ln(e,n){e&1&&(D(0,10,1),d(1,"spk-icon",39),E())}function pn(e,n){e&1&&(D(0,10,2),d(1,"spk-icon"),E())}function cn(e,n){if(e&1){let t=I();s(0,"button",38),N("click",function(){F(t);let i=c(3);return g(i.copyPassword())}),D(1,10),C(2,ln,2,0)(3,pn,2,0),E(),a()}if(e&2){let t=c(3);l(2),T(t.copiedPassword()?2:3)}}function un(e,n){e&1&&(s(0,"spk-alert",36),w(1,11),a())}function mn(e,n){if(e&1){let t=I();s(0,"div",27)(1,"spk-form-field")(2,"label",28),D(3,6),d(4,"sup"),E(),a(),d(5,"input",29),a(),C(6,on,1,9,"spk-progress-bar",30),s(7,"spk-form-field"),d(8,"input",31),C(9,rn,2,0,"span",32),a(),s(10,"div",33)(11,"button",34),N("click",function(){F(t);let i=c(2);return g(i.showPassword.set(!i.showPassword()))}),D(12,7),C(13,an,2,0)(14,sn,2,0),E(),a(),s(15,"button",34),N("click",function(){F(t);let i=c(2);return g(i.generatePassword())}),D(16,8),d(17,"spk-icon"),E(),a(),C(18,cn,4,1,"button",35),a(),C(19,un,2,0,"spk-alert",36),a()}if(e&2){let t=c(2);l(5),u("type",t.showPassword()?"text":"password"),l(),T(t.generalForm.value.password?6:-1),l(2),u("type",t.showPassword()?"text":"password"),l(),T(t.generalForm.value.repeatPassword&&t.generalForm.value.repeatPassword!==t.generalForm.value.password?9:-1),l(4),T(t.showPassword()?13:14),l(5),T(t.showCopyPassword()?18:-1),l(),T(t.generalForm.value.password&&t.generalForm.value.password===t.generalForm.value.repeatPassword?19:-1)}}function dn(e,n){if(e&1&&(s(0,"spk-select",24)(1,"label",25),w(2,5),a(),d(3,"input",26),C(4,nn,1,1,"ng-template"),a(),C(5,mn,20,7,"div",27)),e&2){let t=c();u("options",t.encryptionOptions())("isClearable",!1),l(5),T(t.encryptionFieldSignal()!==""?5:-1)}}function _n(e,n){if(e&1&&(s(0,"button",22),D(1,12),d(2,"spk-icon"),E(),a()),e&2){let t=c();u("disabled",t.generalForm.invalid)}}function Fn(e,n){if(e&1&&(s(0,"spk-tooltip",23)(1,"button",22),D(2,13),d(3,"spk-icon"),E(),a()()),e&2){let t=c();u("disabled",!(t.showCopyPassword()&&!t.copiedPassword())),l(),u("disabled",t.generalForm.invalid||t.showCopyPassword()&&!t.copiedPassword())}}var ze=new ge,qt=(e={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>ze.group({name:ze.control(e.name,[_e.required]),description:ze.control(e.description),encryption:ze.control(e.encryption,[Xt()]),password:ze.control(e.password,[Pt(n=>n?.value.encryption!=="",[_e.required])]),repeatPassword:ze.control(e.repeatPassword,[Pt(n=>n?.value.encryption!=="",[_e.required])])}),Ot={Key:"",DisplayName:"None"},kt=class e{#n=R(pe);#e=R(Ee);#o=R(mt);#i=R(Se);#t=R(it);formRef=Me.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=P(!1);copiedPassword=P(!1);showCopyPassword=P(!1);encryptionEffect=et(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=L(()=>{let t=this.generalFormSignal()?.password??"";return this.#o.calculatePasswordStrength(t)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit()}async copyPassword(){let n=this.generalForm.controls.password.value;await this.#r(n??""),this.copiedPassword.set(!0)}async#r(n){try{await navigator.clipboard.writeText(n)}catch{try{let o=document.createElement("textarea");o.value=n,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}catch(o){console.error("Failed to copy text: ",o)}}}displayFn(){let n=this.#t.systemInfo()?.EncryptionModules??[];return t=>{let o=[Ot,...n].find(i=>i.Key===t);return o?`${o.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#o.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#n.navigate(["destination"],{relativeTo:this.#e.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=se({type:e,selectors:[["app-general"]],viewQuery:function(t,o){t&1&&Re(o.formRef,tn,5),t&2&&we()},decls:20,vars:3,consts:()=>{let n;n=$localize`Your backup name`;let t;t=$localize`Your backup description`;let o;o=$localize`General backup settings`;let i;i=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let m;m=$localize`Encryption`;let f;f=$localize`Encryption`;let $;$=$localize`Password`;let U;U=$localize`Repeat password`;let x;x=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=Ne(v);let B;B=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let Z;Z=$localize`Passwords do not match`;let Y;Y=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Y=Ne(Y);let h;h=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let y;y=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let G;return G=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],o,i,r,p,f,x,v,B,Z,Y,h,y,G,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",t,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",m,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",$,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",U,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(t,o){if(t&1){let i=I();s(0,"form",14,0),N("submit",function(){return F(i),g(o.next())}),s(2,"h3",15),w(3,1),a(),s(4,"spk-form-field")(5,"label",16),D(6,2),d(7,"sup"),E(),a(),d(8,"input",17),a(),s(9,"spk-form-field")(10,"label",18),w(11,3),a(),d(12,"textarea",19),a(),C(13,dn,6,3),s(14,"div",20)(15,"button",21),N("click",function(){return F(i),g(o.exit())}),D(16,4),d(17,"spk-icon"),E(),a(),C(18,_n,3,1,"button",22)(19,Fn,4,2,"spk-tooltip",23),a()()}t&2&&(u("formGroup",o.generalForm),l(13),T(o.isNew()?13:-1),l(5),T(o.encryptionFieldSignal()===""?18:19))},dependencies:[He,Le,de,Fe,Ge,Ve,Be,ue,me,Ie,ce,nt,tt,ot],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};function gn(e,n){if(e&1){let t=I();s(0,"div",24)(1,"spk-form-field")(2,"label",25),w(3,7),a(),s(4,"input",26,0),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.nextTime().time,i)||(r.scheduleFields.nextTime().time=i),g(i)}),N("focus",function(){F(t);let i=ie(5);return g(i.showPicker())}),a(),s(6,"spk-icon",27),S(7,"clock"),a()(),s(8,"spk-form-field"),d(9,"label",28),s(10,"input",29,1),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.nextTime().date,i)||(r.scheduleFields.nextTime().date=i),g(i)}),N("focus",function(){F(t);let i=ie(11);return g(i.showPicker())}),a(),s(12,"spk-icon",27),S(13,"calendar"),a()()(),s(14,"div",24)(15,"spk-form-field")(16,"label",30),w(17,8),a(),s(18,"input",31),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().repeatValue,i)||(r.scheduleFields.runAgain().repeatValue=i),g(i)}),a()(),s(19,"spk-select",32)(20,"input",33),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().repeatUnit,i)||(r.scheduleFields.runAgain().repeatUnit=i),g(i)}),a()()(),s(21,"app-toggle-card",34),X(22,35),w(23,9),z(),s(24,"div",36)(25,"spk-toggle",19),D(26,10),s(27,"input",20),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().allowedDays.mon,i)||(r.scheduleFields.runAgain().allowedDays.mon=i),g(i)}),a(),E(),a(),s(28,"spk-toggle",19),D(29,11),s(30,"input",20),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().allowedDays.tue,i)||(r.scheduleFields.runAgain().allowedDays.tue=i),g(i)}),a(),E(),a(),s(31,"spk-toggle",19),D(32,12),s(33,"input",20),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().allowedDays.wed,i)||(r.scheduleFields.runAgain().allowedDays.wed=i),g(i)}),a(),E(),a(),s(34,"spk-toggle",19),D(35,13),s(36,"input",20),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().allowedDays.thu,i)||(r.scheduleFields.runAgain().allowedDays.thu=i),g(i)}),a(),E(),a(),s(37,"spk-toggle",19),D(38,14),s(39,"input",20),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().allowedDays.fri,i)||(r.scheduleFields.runAgain().allowedDays.fri=i),g(i)}),a(),E(),a(),s(40,"spk-toggle",19),D(41,15),s(42,"input",20),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().allowedDays.sat,i)||(r.scheduleFields.runAgain().allowedDays.sat=i),g(i)}),a(),E(),a(),s(43,"spk-toggle",19),D(44,16),s(45,"input",20),q("ngModelChange",function(i){F(t);let r=c();return j(r.scheduleFields.runAgain().allowedDays.sun,i)||(r.scheduleFields.runAgain().allowedDays.sun=i),g(i)}),a(),E(),a()()()}if(e&2){let t=c();l(4),W("ngModel",t.scheduleFields.nextTime().time),l(6),W("ngModel",t.scheduleFields.nextTime().date),l(8),W("ngModel",t.scheduleFields.runAgain().repeatValue),l(),u("options",t.unitOptions)("isClearable",!1),l(),W("ngModel",t.scheduleFields.runAgain().repeatUnit),l(),u("disallowToggle",!0),l(6),W("ngModel",t.scheduleFields.runAgain().allowedDays.mon),l(3),W("ngModel",t.scheduleFields.runAgain().allowedDays.tue),l(3),W("ngModel",t.scheduleFields.runAgain().allowedDays.wed),l(3),W("ngModel",t.scheduleFields.runAgain().allowedDays.thu),l(3),W("ngModel",t.scheduleFields.runAgain().allowedDays.fri),l(3),W("ngModel",t.scheduleFields.runAgain().allowedDays.sat),l(3),W("ngModel",t.scheduleFields.runAgain().allowedDays.sun)}}var Cn=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],Oe={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},$t=class e{#n=R(Se);#e=R(pe);#o=R(Ee);unitOptions=Cn;scheduleFields=this.#n.scheduleFields;goBack(){this.#e.navigate(["source-data"],{relativeTo:this.#o.parent})}next(){this.#e.navigate(["options"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=se({type:e,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let n;n=$localize`Schedule`;let t;t=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let o;o=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let r;r=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let p;p=$localize`Next time`;let m;m=$localize`Run again every`;let f;f=$localize`Allowed days`;let $;$=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let x;x=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let Y;return Y=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],n,t,o,i,r,p,m,f,$,U,x,v,B,Z,Y,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(t,o){t&1&&(s(0,"h3",17),w(1,2),a(),s(2,"div",18)(3,"spk-toggle",19),D(4,3),s(5,"input",20),q("ngModelChange",function(r){return j(o.scheduleFields.autoRun,r)||(o.scheduleFields.autoRun=r),r}),a(),E(),a(),s(6,"p"),w(7,4),a()(),C(8,gn,46,14),s(9,"div",21)(10,"button",22),N("click",function(){return o.goBack()}),D(11,5),d(12,"spk-icon"),E(),a(),s(13,"button",23),N("click",function(){return o.next()}),D(14,6),d(15,"spk-icon"),E(),a()()),t&2&&(l(5),W("ngModel",o.scheduleFields.autoRun),l(3),T(o.scheduleFields.autoRun()?8:-1))},dependencies:[Ke,de,Ue,be,Fe,at,ue,ve,ce,Ie,me,Xe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Sn(e,n){if(e&1){let t=I();s(0,"spk-select",0)(1,"input",4),N("ngModelChange",function(i){F(t);let r=c(2);return g(r.updateStateExpression(i))}),a()()}if(e&2){let t,o=c(2);u("options",o.fileGroupOptions())("isClearable",!1),l(),u("ngModel",(t=o.pathState())==null?null:t.expression)}}function hn(e,n){if(e&1){let t=I();s(0,"spk-form-field")(1,"input",4),N("ngModelChange",function(i){F(t);let r=c(2);return g(r.updateStateExpression(i))}),a()()}if(e&2){let t,o=c(2);l(),u("ngModel",(t=o.pathState())==null?null:t.expression)}}function fn(e,n){if(e&1){let t=I();s(0,"spk-select",0)(1,"input",1),N("ngModelChange",function(i){F(t);let r=c();return g(r.updateStateType(i))}),a()(),C(2,Sn,2,3,"spk-select",0)(3,hn,2,1,"spk-form-field"),s(4,"div",2),N("click",function(){F(t);let i=c();return g(i.removeFilter())}),s(5,"spk-icon",3),S(6,"x-circle"),a()()}if(e&2){let t,o,i=c();u("options",i.expressionOptions())("isClearable",!1),l(),u("ngModel",(t=i.pathState())==null?null:t.type),l(),T(((o=i.pathState())==null?null:o.type)==="-FileGroup"||((o=i.pathState())==null?null:o.type)==="+FileGroup"?2:3)}}var Qt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Tn=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],Ft=class e{path=ht.required();osType=ht();pathChange=St();remove=St();expressionOptions=P(Qt);fileGroupOptions=P(Tn);pathState=P(null);typeState=L(()=>{let n=this.pathState();return n?n.type:null});pathEffect=et(()=>{let n=this.path(),t=n.slice(1),o=n.startsWith("-")?"-":"+",i=this.osType()==="Windows",r=i?"\\":"/",p=t.startsWith("%");return t===""?this.pathState.set({type:"-Unknown",path:"___none___",expression:""}):p&&t.endsWith(r)||i&&t.slice(2).startsWith("\\")&&t.endsWith("\\")||t.startsWith(r)&&t.endsWith(r)?this.pathState.set({type:`${o}Folder`,path:t,expression:t}):t.startsWith("*")&&t.endsWith(`*${r}`)?this.pathState.set({type:`${o}FolderNameIncludes`,path:t,expression:t.slice(1,-2)}):t.startsWith("[.*")&&t.endsWith(`[^\\${r}]*]`)?this.pathState.set({type:`${o}FileNameIncludes`,path:t,expression:t.slice(3,-7)}):t.startsWith("{")&&t.endsWith("}")?this.pathState.set({type:`${o}FileGroup`,path:t,expression:t.slice(1,-1)}):t.startsWith("[")&&t.endsWith("]")?this.pathState.set({type:`${o}Regex`,path:t,expression:t.slice(1,-1)}):t.startsWith("*.")?this.pathState.set({type:`${o}Extension`,path:t,expression:t.slice(2)}):this.pathState.set({type:`${o}Expression`,path:t,expression:t})});updateStateType(n){this.pathState.update(t=>(t.type=n,t.path=this.#e(t),t)),this.#n()}updateStateExpression(n){this.pathState.update(t=>(t.expression=n,t.path=this.#e(t),t)),this.#n()}#n(){setTimeout(()=>this.pathChange.emit(this.pathState().path))}#e(n){let t=n.type.slice(0,1),o=n.type.slice(1),i=this.osType()==="Windows",r=i?"\\":"/",m=i&&!n.expression.startsWith("%")?n.expression.slice(2):n.expression,f=n.path.startsWith("%");if(o==="Unknown")return`${t}${n.expression}`;if(o==="Folder"){let $=f||m.startsWith(r),U=m.endsWith(r);return U&&$?`${t}${n.expression}`:U?`${t}${n.expression}${r}`:$?`${t}${r}${n.expression}`:`${t}${r}${n.expression}${r}`}return o==="FolderNameIncludes"?`${t}*${n.expression}*${r}`:o==="FileNameIncludes"?`${t}[.*${n.expression}[^\\${r}]*]`:o==="FileGroup"?`${t}{${n.expression}}`:o==="Regex"?`${t}[${n.expression}]`:o==="Extension"?`${t}*.${n.expression}`:`${t}${n.expression}`}removeFilter(){this.remove.emit()}displayFn(n){let t=Qt.find(o=>o.value===n);return t?t.key:""}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=se({type:e,selectors:[["app-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let n;return n=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(t,o){t&1&&C(0,fn,7,4),t&2&&T(o.pathState()?0:-1)},dependencies:[Ke,de,Fe,at,ce,ue,me],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] spk-form-field[_ngcontent-%COMP%]{min-width:110px}[_nghost-%COMP%] spk-form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:110px}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Dn=["formRef"];function En(e,n){if(e&1){let t=I();s(0,"app-filter",42),N("pathChange",function(i){let r=F(t).$index,p=c(2);return g(p.patchPathAt(i,r))})("remove",function(){let i=F(t).$index,r=c(2);return g(r.removePathAt(i))}),a()}if(e&2){let t,o=n.$implicit,i=c(2);u("path",o)("osType",(t=i.osType())!==null&&t!==void 0?t:"")}}function yn(e,n){if(e&1&&ne(0,En,1,2,"app-filter",41,te),e&2){let t=c();oe(t.pathArray())}}function An(e,n){if(e&1&&(s(0,"div",40)(1,"spk-form-field"),d(2,"input",43),a(),s(3,"spk-select",44),d(4,"input",45),a()()),e&2){let t=c();l(3),u("options",t.sizeOptions())("isClearable",!1)}}var fe=new ge,Pn=["Bytes","KB","MB","GB","TB","PB"],Yt=(e={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>fe.group({path:fe.control(e.path),excludes:fe.group({hidden:fe.control(e.excludes.hidden),system:fe.control(e.excludes.system),temporary:fe.control(e.excludes.temporary),filesLargerThan:fe.group({size:fe.control(null),unit:fe.control(null)})})}),Mt=class e{#n=R(Se);#e=R(pe);#o=R(Ee);formRef=Me.required("formRef");sourceDataForm=this.#n.sourceDataForm;sourceDataFormSignal=this.#n.sourceDataFormSignal;newPathCtrl=new rt("");filesLargerThan=L(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=P(Pn);osType=this.#n.osType;pathSignal=K(this.sourceDataForm.controls.path.valueChanges);pathArray=L(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+")||n==="___none___")??[]);addFilter(n="-*"){let t=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${t}\0${n}`)}patchPathAt(n,t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),r=this.pathArray().map((p,m)=>m===t?`${n}`:`${p}`).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${r}`)}removePathAt(n){let o=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${i}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value,t=this.newPathCtrl.value;this.sourceDataForm.controls.path.setValue(`${n}\0${t}`),this.newPathCtrl.setValue("")}goBack(){this.#e.navigate(["destination"],{relativeTo:this.#o.parent})}next(){this.#e.navigate(["schedule"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=se({type:e,selectors:[["app-source-data"]],viewQuery:function(t,o){t&1&&Re(o.formRef,Dn,5),t&2&&we()},decls:55,vars:12,consts:()=>{let n;n=$localize`Path`;let t;t=$localize`Add a direct path`;let o;o=$localize`Hidden files`;let i;i=$localize`System files`;let r;r=$localize`Temporary files`;let p;p=$localize`Source Data`;let m;m=$localize`Folder path`;let f;f=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let $;$=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let U;U=$localize`Source Data`;let x;x=$localize`Add Path`;let v;v=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let Z;Z=$localize`Customize your filters.`;let Y;Y=$localize`Add filter`;let h;h=$localize`Exclude`;let y;y=$localize`Choose if there’s any files you want to exclude.`;let G;G=$localize` Hidden files ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let M;M=$localize` System files ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Temporary files ${"\uFFFD#51\uFFFD\uFFFD/#51\uFFFD"}:TAG_INPUT:`;let re;re=$localize` Files larger than `;let ee;return ee=$localize`Select an option...`,[["formRef",""],p,m,f,$,U,x,v,B,Z,Y,h,y,G,M,J,re,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",n,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"row-inputs"],["type","text","placeholder",t,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",o,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",r,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",ee]]},template:function(t,o){if(t&1){let i=I();s(0,"form",17,0),N("submit",function(){return F(i),g(o.next())}),s(2,"div",18)(3,"h3",19),w(4,1),a(),s(5,"app-file-tree",20)(6,"label",21),w(7,2),a(),d(8,"input",22),a(),s(9,"div",23)(10,"button",24),N("click",function(){return F(i),g(o.goBack())}),D(11,3),d(12,"spk-icon"),E(),a(),s(13,"button",25),D(14,4),d(15,"spk-icon"),E(),a()()(),s(16,"div",26)(17,"h3",19),w(18,5),a(),s(19,"app-toggle-card",27),X(20,28),w(21,6),z(),s(22,"p",29),w(23,7),a(),s(24,"div",30)(25,"spk-form-field"),d(26,"input",31),a(),s(27,"button",32),N("click",function(){return F(i),g(o.addNewPath())}),s(28,"spk-icon"),S(29,"plus"),a()()()(),s(30,"app-toggle-card",27),X(31,28),w(32,8),z(),s(33,"p",29),w(34,9),a(),s(35,"button",33),N("click",function(){return F(i),g(o.addFilter())}),w(36,10),a(),C(37,yn,2,0),a(),s(38,"app-toggle-card",34),X(39,28),w(40,11),z(),s(41,"p",29),w(42,12),a(),s(43,"spk-toggle",35),D(44,13),d(45,"input",36),E(),a(),s(46,"spk-toggle",35),D(47,14),d(48,"input",37),E(),a(),s(49,"spk-toggle",35),D(50,15),d(51,"input",38),E(),a(),s(52,"spk-toggle",39),N("click",function(){return F(i),g(o.toggleFilesLargerThan())}),w(53,16),a(),C(54,An,5,2,"div",40),a()()()}if(t&2){let i;u("formGroup",o.sourceDataForm),l(5),u("multiSelect",!0)("startingPath",o.getPath())("showFiles",!0),l(14),u("disallowToggle",!0),l(7),u("formControl",o.newPathCtrl),l(4),u("disallowToggle",!0),l(7),T((i=o.pathSignal())!=null&&i.length?37:-1),l(),u("disallowToggle",!0),l(14),Pe("active",o.filesLargerThan()),l(2),T(o.filesLargerThan()?54:-1)}},dependencies:[Ke,Le,de,Ue,be,Fe,Ge,He,st,Ve,Be,lt,ue,ce,Ie,ve,me,pt,Xe,Ft],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var Jt="1W:1D,4W:1W,12M:1M",Te=new ge,Se=class e{#n=R(pe);#e=R(it);#o=R(xe);#i=R(ct);generalForm=qt();sourceDataForm=Yt();scheduleFields={autoRun:P(Oe.autoRun),nextTime:P(Oe.nextTime),runAgain:P(Oe.runAgain)};destinationForm=Zt();settings=P([]);optionsFields={remoteVolumeSize:P("50MB"),backupRetention:P("all"),backupRetentionTime:P(""),backupRetentionVersions:P(0),backupRetentionCustom:P("")};isDraft=P(!1);backupId=P(null);isSubmitting=P(!1);finishedLoading=P(!1);backupDefaults=P(null);isNew=L(()=>this.backupId()==="new");osType=L(()=>this.#e.systemInfo()?.OSType);selectedOptions=P([]);selectedAdvancedFormPair=P([]);destinationFormPair=P({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=L(()=>{let n=this.destinationFormPair()?.advanced??[],t=this.selectedAdvancedFormPair()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});selectedHttpOptions=P([]);notSelectedHttpOptions=L(()=>{let n=this.httpOptions(),t=this.selectedHttpOptions()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});sourceDataFormSignal=K(this.sourceDataForm.valueChanges);destinationFormSignal=K(this.destinationForm.valueChanges);generalFormSignal=K(this.generalForm.valueChanges);encryptionFieldSignal=K(this.generalForm.controls.encryption.valueChanges);destinationOptions=L(()=>this.#e.backendModules()??[]);httpOptions=L(()=>this.#e.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#t)??[]);advancedOptions=L(()=>this.#e.systemInfo()?.Options?.map(this.#t)??[]);#t(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=L(()=>{let n=this.#e.systemInfo()?.EncryptionModules??[];return[Ot,...n]});nonSelectedOptions=L(()=>this.advancedOptions().sort((n,t)=>n?.name&&t?.name?n?.name.localeCompare(t?.name):0).filter(n=>this.selectedOptions()?.findIndex(t=>t.name===n.name)===-1));addAdvancedFormPairByName(n,t,o){let i=this.notSelectedAdvancedFormPair().find(r=>r.name===n);i&&this.addAdvancedFormPair(i,t,o)}addHttpOptionByName(n,t,o){let i=this.notSelectedHttpOptions().find(r=>r.name===n);i&&this.addHttpOption(i,t,o)}addAdvancedFormPair(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,r=o??n.defaultValue;this.createFormField(i,n,r),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,r=o??n.defaultValue;this.createFormField(i,n,r),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(i=>i.name===n.name)!==-1?this.selectedAdvancedFormPair.update(i=>(i=i.filter(r=>r.name!==n.name),i)):this.selectedHttpOptions.update(i=>(i=i.filter(r=>r.name!==n.name),i))}removeHttpOption(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(o=>(o=o.filter(i=>i.name!==n.name),o))}submit(){this.isSubmitting.set(!0);let n=this.#l(),t=this.backupId();t==="new"||!t||this.isDraft()?this.#o.postApiV1Backups({requestBody:n}).pipe(je(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{this.exit()},error:o=>{}}):this.#o.putApiV1BackupById({id:t,requestBody:n}).pipe(je(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{this.exit()},error:o=>{}})}exit(){this.#c(),this.#n.navigate(["/"])}updateFieldsFromTargetUrl(n){this.#r(),setTimeout(()=>{this.#s(n)})}#r(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(n){let t=n.Sources??"",o=n.Filters?.map(m=>`${m.Include?"":"-"}${m.Expression}`)??[],i=n.Settings?.find(m=>m.Name==="--exclude-files-attributes")?.Value??"",r=n.Settings?.find(m=>m.Name==="--skip-files-larger-than")??null,p={path:[...t,...o].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:r?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(p)}mapDestinationToForm(n){let t=n.TargetURL?Nt(n.TargetURL):null;t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}#s(n){let t=Nt(n);t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}mapGeneralToForm(n){let t=n.Settings?.find(r=>r.Name==="encryption-module"),o=t?.Value&&t.Value.length?t.Value:"",i={name:n.Name??"",description:n.Description??""};o&&o!==""&&(i.encryption=o),this.generalForm.patchValue(i)}mapScheduleToForm(n){if(!n){this.scheduleFields.autoRun.set(!1);return}let t=this.#i.fromString(n.Repeat)??null,o=this.#p(n.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>A(A({},i),o)),this.scheduleFields.runAgain.set({repeatValue:t?.value??1,repeatUnit:t?.unit??"D",allowedDays:{mon:n.AllowedDays?.includes("mon")??!1,tue:n.AllowedDays?.includes("tue")??!1,wed:n.AllowedDays?.includes("wed")??!1,thu:n.AllowedDays?.includes("thu")??!1,fri:n.AllowedDays?.includes("fri")??!1,sat:n.AllowedDays?.includes("sat")??!1,sun:n.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(n){let t=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","keep-time","keep-versions","retention-policy"],o=n.Settings?.filter(p=>!t.includes(p.Name)),i=n.Settings?.filter(p=>t.includes(p.Name));this.settings.set(o??[]),o?.forEach(p=>{if(p.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(p.Value??"")});var r="all";i?.forEach(p=>{if(console.log("x",p.Name),p.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(p.Value??"50MB"),p.Name==="keep-time"&&(p.Value??"")!=="")return r="time",this.optionsFields.backupRetentionTime.set(p.Value??"");if(p.Name==="keep-versions"&&(p.Value??"")!=="")return r="versions",this.optionsFields.backupRetentionVersions.set(p.Value?parseInt(p.Value):null);if(p.Name==="retention-policy"&&(p.Value??"")!=="")if(p.Value===Jt)r="smart";else return r="custom",this.optionsFields.backupRetentionCustom.set(p.Value??"")}),this.optionsFields.backupRetention.set(r)}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#l(){let n=this.generalForm.value,t=this.getScheduleFormValue(),o=this.sourceDataForm.value,r=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],p=null;t.runAgain?.repeatUnit&&t.runAgain?.repeatValue&&(p=this.#i.toString(t.runAgain.repeatValue,t.runAgain.repeatUnit));let m=t.runAgain?.allowedDays?Object.entries(t.runAgain?.allowedDays).filter(([v,B])=>B).map(([v,B])=>v):[],f=o.path?.split("\0")??[],$=this.mapFormsToSettings(),U=Object.entries(o.excludes??{}).filter(([v,B])=>B&&v!=="filesLargerThan").map(([v])=>v),x=o.excludes?.filesLargerThan;return U.length&&$.push({Name:"--exclude-files-attributes",Value:U.join(",")}),x&&x.size!==null&&x.unit!==null&&$.push({Name:"--skip-files-larger-than",Value:`${x.size}${x.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:r[0]??null,Sources:f.filter(v=>!v.startsWith("-")),Settings:$,Filters:f.filter(v=>v.startsWith("-")).map((v,B)=>({Order:B,Include:!1,Expression:v.slice(1)}))},Schedule:t.autoRun?{Repeat:p,Time:t.nextTime?.date?new Date(`${t.nextTime.date}T${t.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:m}:null}}mapFormsToSettings(n=[]){let t=this.generalForm.value,o=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","keep-time","keep-versions","retention-policy","dblock-size"],i=[{Name:"--no-encryption",Value:"True"}];t.encryption!==""&&(i=[{Name:"encryption-module",Value:t.encryption??null},{Name:"passphrase",Value:t.password??null}]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:Jt});break}let p=[...n,...o],m=this.settings().filter(f=>!p.includes(f.Name)).map(f=>{let $=f.Value;return typeof f.Value=="number"&&($=f.Value.toString()),typeof f.Value=="boolean"&&($=f.Value?"True":"False"),{Name:f.Name,Value:$}});return[...i,...r,...m]}#a(n){return n.controls.map(t=>ut(t.value))}#p(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let t=new Date(n);return{time:`${(""+t.getHours()).padStart(2,"0")}:${(""+t.getMinutes()).padStart(2,"0")}`,date:t.toISOString().split("T")[0]}}createFormField(n,t,o){if(t.type==="String"||t.type==="FileTree"||t.type==="FolderTree"||t.type==="Password"||t.type==="Enumeration"||t.type==="NonValidatedSelectableString"||t.type==="Path"){n.addControl(t.name,Te.control(o));return}if(t.type==="Size"){n.addControl(t.name,Te.control(o));return}if(t.type==="Integer"){n.addControl(t.name,Te.control(o?parseInt(o):0));return}if(t.type==="Boolean"){n.addControl(t.name,Te.control(o==="true"||o==="True"));return}if(t.type==="Flags"){n.addControl(t.name,Te.control(o??""));return}if(t.type==="Timespan"||t.type==="DateTime"){n.addControl(t.name,Te.control(o,[_e.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,t,o=!1){let i=he.find(h=>h.customKey===n||h.key===n),r=i?.key,p=this.destinationOptions().find(h=>h.Key===r),m=this.httpOptions();if(!p||!p.Options)return;let f=i&&i.oauthField?i.oauthField:null,$=i&&i.customFields?i.customFields:{},U=i&&i.dynamicFields?i.dynamicFields:[],x=i&&i.advancedFields?i.advancedFields:[],v=i&&i.ignoredAdvancedFields?i.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:f,custom:[],dynamic:[],advanced:[]});let B=Te.group({}),Z=Te.group({}),Y=Te.group({});$&&Object.entries($).forEach(([h,y],G)=>{let re=y,{formElement:M}=re,J=wt(re,["formElement"]);B.addControl(h,M(t?.custom[h])),this.destinationFormPair.update(ee=>(ee.custom.push(A({order:900+G},J)),ee))});for(let h=0;h<p.Options.length;h++){let y=p.Options[h];if(y.Deprecated)continue;let G=U.find(M=>M===y.Name||M.name===y.Name);if(G){let M=G&&typeof G!="string",J=M?G?.defaultValue??y.DefaultValue:y.DefaultValue,re={name:y.Name,type:y.Type,shortDescription:y.ShortDescription??void 0,longDescription:y.LongDescription??void 0,options:y.ValidValues,order:900+h},ee=M?A(A({},re),G):re,Ze=t?.dynamic[y.Name]??J??y.DefaultValue;this.createFormField(Z,ee,Ze),this.destinationFormPair.update($e=>($e.dynamic.push(ee),$e))}else{if(v.find(ae=>ae===y.Name))continue;let J=x.find(ae=>ae===y.Name||ae.name===y.Name),re=J&&typeof J!="string",ee=t?.advanced[y.Name],b=ee??y.DefaultValue,Ze={name:y.Name,type:y.Type,shortDescription:y.ShortDescription??void 0,longDescription:y.LongDescription??void 0,options:y.ValidValues,defaultValue:b,order:900+h},$e=re?A(A({},Ze),J):Ze;o&&ee&&(this.createFormField(Y,$e,b),this.selectedAdvancedFormPair.update(ae=>(ae.push($e),ae))),this.destinationFormPair.update(ae=>(ae.advanced.push($e),ae))}}for(let h=0;h<m.length;h++){let y=m[h],G=t?.advanced[y.name],M=G??y.defaultValue;o&&G&&(this.createFormField(Y,y,M),this.selectedHttpOptions.update(J=>(J.push(y),J)))}this.destinationFormPair.update(h=>({oauthField:h.oauthField,custom:h.custom.sort((y,G)=>y.order-G.order),dynamic:h.dynamic.sort((y,G)=>y.order-G.order),advanced:h.advanced.sort((y,G)=>y.order-G.order)})),this.destinationForm.controls.destinations.push(en({key:i?.customKey??n,customGroup:B,dynamicGroup:Z,advancedGroup:Y}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(Oe.autoRun),this.scheduleFields.nextTime.set(Oe.nextTime),this.scheduleFields.runAgain.set(Oe.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([])}static \u0275fac=function(t){return new(t||e)};static \u0275prov=De({token:e,factory:e.\u0275fac,providedIn:"root"})};var Nn=["formRef"],kn=(e,n,t,o)=>({index:e,formView:n,formGroupName:"custom",destinationType:t,oauthField:o}),Ct=e=>({$implicit:e}),On=(e,n,t,o)=>({index:e,formView:n,formGroupName:"dynamic",destinationType:t,oauthField:o}),$n=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",destinationType:t,oauthField:o}),Mn=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:t,oauthField:o}),Rn=()=>({maxWidth:"700px",width:"100%"});function wn(e,n){e&1&&(D(0,5,2),d(1,"spk-icon"),E())}function xn(e,n){e&1&&w(0,5,3)}function In(e,n){if(e&1){let t=I();D(0,5,1),s(1,"button",21),N("click",function(){F(t);let i=c();return g(i.testDestination())}),C(2,wn,2,0)(3,xn,1,0),a(),E()}if(e&2){let t=c();l(),Pe("success",t.successfulTest()),l(),T(t.successfulTest()?2:3)}}function vn(e,n){if(e&1){let t=I();s(0,"p",27),N("click",function(){F(t);let i=c();return g(i.removeDestinationFormGroup(i.destinationCount()-1))}),D(1,8),d(2,"span",28),E(),a()}}function bn(e,n){if(e&1){let t=I();s(0,"div",34),N("click",function(){let i=F(t).$implicit,r=c(2);return g(r.addDestinationFormGroup(i.key))}),s(1,"h3"),S(2),a(),s(3,"p"),S(4),a()()}if(e&2){let t=n.$implicit;l(2),Dt(t.displayName),l(2),Dt(t.description)}}function Gn(e,n){if(e&1){let t=I();s(0,"button",35,1),N("click",function(){let i=F(t).$implicit,r=c(2);return g(r.addDestinationFormGroup(i.key))}),S(2),a()}if(e&2){let t=n.$implicit;l(2),H(" ",t.displayName," ")}}function Ln(e,n){if(e&1&&(s(0,"div",29),ne(1,bn,5,2,"div",30,te),a(),s(3,"spk-menu",31)(4,"button",32),w(5,9),a(),X(6,20),ne(7,Gn,3,1,"button",33,te),z(),a()),e&2){let t=c();l(),oe(t.destinationTypeOptionsFocused()),l(2),u("searchable",!0),l(4),oe(t.destinationTypeOptionsNotFocused())}}function Un(e,n){e&1&&qe(0)}function Vn(e,n){if(e&1&&C(0,Un,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=ie(29),p=c();u("ngTemplateOutlet",r)("ngTemplateOutletContext",Qe(7,Ct,Ye(2,kn,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function Bn(e,n){e&1&&qe(0)}function Kn(e,n){if(e&1&&C(0,Bn,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=ie(29),p=c();u("ngTemplateOutlet",r)("ngTemplateOutletContext",Qe(7,Ct,Ye(2,On,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function Hn(e,n){if(e&1){let t=I();D(0,10,1),s(1,"button",35,1),N("click",function(){let i=F(t).$implicit,r=c(2);return g(r.addAdvancedFormPair(i,0))}),a(),E()}if(e&2){let t=n.$implicit;l(),ft(t.name),Tt(0)}}function Xn(e,n){e&1&&qe(0)}function zn(e,n){if(e&1&&C(0,Xn,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=ie(29),p=c();u("ngTemplateOutlet",r)("ngTemplateOutletContext",Qe(7,Ct,Ye(2,$n,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function Wn(e,n){if(e&1){let t=I();D(0,11,1),s(1,"button",35,1),N("click",function(){let i=F(t).$implicit,r=c(2);return g(r.addHttpOption(i,0))}),a(),E()}if(e&2){let t=n.$implicit;l(),ft(t.name),Tt(0)}}function jn(e,n){e&1&&qe(0)}function qn(e,n){if(e&1&&C(0,jn,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=ie(29),p=c();u("ngTemplateOutlet",r)("ngTemplateOutletContext",Qe(7,Ct,Ye(2,Mn,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function Qn(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function Yn(e,n){if(e&1&&(s(0,"app-file-tree",43)(1,"label",47),S(2),C(3,Qn,3,1,"spk-tooltip",48),a(),d(4,"input",49),a()),e&2){let t,o=c().$implicit,i=c(2);u("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name))("accepts",o.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),T(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),le("formControlName",o.formView.name)}}function Jn(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function Zn(e,n){if(e&1&&(s(0,"app-file-tree",44)(1,"label",47),S(2),C(3,Jn,3,1,"spk-tooltip",48),a(),d(4,"input",49),a()),e&2){let t,o=c().$implicit,i=c(2);u("hideShortcuts",!0)("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name)),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),T(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),le("formControlName",o.formView.name)}}function eo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function to(e,n){e&1&&(s(0,"spk-icon",51),S(1,"link"),a())}function no(e,n){e&1&&(s(0,"spk-icon",51),S(1,"envelope"),a())}function oo(e,n){e&1&&(s(0,"spk-icon",51),S(1,"textbox"),a())}function io(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),S(2),C(3,eo,3,1,"spk-tooltip",48),a(),d(4,"input",50),C(5,to,2,0,"spk-icon",51)(6,no,2,0,"spk-icon",51)(7,oo,2,0,"spk-icon",51),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),T(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),le("formControlName",o.formView.name),u("type",o.formView.type==="Email"?"email":"text"),l(),T(o.formView.type==="Path"?5:o.formView.type==="Email"?6:7)}}function ro(e,n){if(e&1){let t=I();s(0,"span",55),N("click",function(){F(t);let i=c(2).$implicit,r=c(2);return g(r.oauthStartTokenCreation(i.destinationType))}),S(1,"AuthID"),a()}}function ao(e,n){e&1&&(s(0,"spk-icon",51),S(1,"password"),a())}function so(e,n){if(e&1){let t=I();s(0,"spk-icon",56),N("click",function(){F(t);let i=c(2).$implicit;return g(i.formView.showPassword=!i.formView.showPassword)}),S(1," eye "),a()}}function lo(e,n){if(e&1){let t=I();s(0,"spk-icon",56),N("click",function(){F(t);let i=c(2).$implicit;return g(i.formView.showPassword=!i.formView.showPassword)}),S(1," eye-slash "),a()}}function po(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),S(2),a(),d(3,"input",52),C(4,ro,2,0,"span",53)(5,ao,2,0,"spk-icon",51)(6,so,2,0,"spk-icon",54)(7,lo,2,0,"spk-icon",54),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),le("formControlName",o.formView.name),u("type",o.formView.showPassword?"text":"password"),l(),T(o.oauthField===o.formView.name?4:5),l(2),T(o.formView.showPassword?6:7)}}function co(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(3).$implicit;u("message",t.formView.longDescription)}}function uo(e,n){if(e&1&&S(0),e&2){let t=n.$implicit;H(" ",t," ")}}function mo(e,n){if(e&1&&(s(0,"spk-select",57)(1,"label",47),S(2),C(3,co,3,1,"spk-tooltip",48),a(),d(4,"input",49),a(),C(5,uo,1,1,"ng-template",null,3,Je)),e&2){let t,o=ie(6);c();let i=At(0),r=c().$implicit;u("options",i)("isClearable",!1)("optionTemplate",o),l(),V("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),H(" ",(t=r.formView.shortDescription)!==null&&t!==void 0?t:r.formView.name," "),l(),T(r.formView.longDescription?3:-1),l(),V("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),le("formControlName",r.formView.name)}}function _o(e,n){if(e&1&&(Et(0),C(1,mo,7,14)),e&2){let t=c().$implicit,o=yt(t.formView.loadOptions?t.formView.loadOptions(c(2).injector)():t.formView.options);l(),T(o?1:-1)}}function Fo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(3).$implicit;u("message",t.formView.longDescription)}}function go(e,n){if(e&1&&S(0),e&2){let t=n.$implicit;vt(" ",t.key," ",t.value?"("+t.value+")":""," ")}}function Co(e,n){if(e&1&&(s(0,"spk-select",59)(1,"label",47),S(2),C(3,Fo,3,1,"spk-tooltip",48),a(),d(4,"input",49),a(),C(5,go,1,2,"ng-template",null,4,Je)),e&2){let t,o=ie(6);c();let i=At(0),r=c().$implicit;u("options",i)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",o),l(),V("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),H(" ",(t=r.formView.shortDescription)!==null&&t!==void 0?t:r.formView.name," "),l(),T(r.formView.longDescription?3:-1),l(),V("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),le("formControlName",r.formView.name)}}function So(e,n){e&1&&d(0,"spk-progress-bar",58)}function ho(e,n){if(e&1&&(Et(0),C(1,Co,7,15)(2,So,1,0,"spk-progress-bar",58)),e&2){let t=c().$implicit,o=yt(t.formView.loadOptions?t.formView.loadOptions(c(2).injector)():t.formView.options);l(),T(o?1:2)}}function fo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function To(e,n){if(e&1&&(s(0,"app-size",45)(1,"label",47),S(2),C(3,fo,3,1,"spk-tooltip",48),a()()),e&2){let t,o=c().$implicit;u("inputType",o.Name)("formControlName",o.formView.name)("customId",`destination-{{ item.formGroupName }}-{{ item.index }}-{{
2
+ item.asHttpOptions ? 'http' : 'other'
3
+ }}`),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),T(o.formView.longDescription?3:-1)}}function Do(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function Eo(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),S(2),C(3,Do,3,1,"spk-tooltip",48),a(),d(4,"input",60),s(5,"spk-icon",51),S(6,"numpad"),a()()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),T(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),le("formControlName",o.formView.name)}}function yo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function Ao(e,n){if(e&1&&(s(0,"spk-toggle",46)(1,"label",47),S(2),C(3,yo,3,1,"spk-tooltip",48),a(),d(4,"input",61),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),T(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),le("formControlName",o.formView.name)}}function Po(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function No(e,n){if(e&1&&S(0),e&2){let t=n.$implicit;H(" ",t," ")}}function ko(e,n){if(e&1&&(s(0,"spk-select",62)(1,"label",47),S(2),C(3,Po,3,1,"spk-tooltip",48),a(),d(4,"input",63),a(),C(5,No,1,1,"ng-template",null,4,Je)),e&2){let t,o=ie(6),i=c().$implicit;u("options",i.formView.options)("selectMultiple",!0)("optionTemplate",o),l(),It("for","destination-",i.formGroupName,"-",i.index,""),l(),H(" ",(t=i.formView.shortDescription)!==null&&t!==void 0?t:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),le("formControlName",i.formView.name)}}function Oo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),S(2,"question"),a()()),e&2){let t=c(2).$implicit;u("message",t.formView.longDescription)}}function $o(e,n){if(e&1&&(s(0,"app-timespan",45)(1,"label",47),S(2),C(3,Oo,3,1,"spk-tooltip",48),a()()),e&2){let t,o=c().$implicit;u("inputType",o.formView.name)("formControlName",o.formView.name)("customId","destination-"+o.formGroupName+"-"+o.index+"-"+(o.asHttpOptions?"http":"other")),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),T(o.formView.longDescription?3:-1)}}function Mo(e,n){if(e&1){let t=I();s(0,"button",64),N("click",function(){F(t);let i=c().$implicit,r=c(2);return g(r.removeFormView(i.formView,0))}),s(1,"spk-icon"),S(2,"x-circle"),a()()}}function Ro(e,n){if(e&1&&(s(0,"div",41),X(1,42),C(2,Yn,5,17,"app-file-tree",43)(3,Zn,5,13,"app-file-tree",44)(4,io,8,13,"spk-form-field")(5,po,8,13,"spk-form-field")(6,_o,2,2)(7,ho,3,2)(8,To,4,9,"app-size",45)(9,Eo,7,11,"spk-form-field")(10,Ao,5,11,"spk-toggle",46)(11,ko,7,9)(12,$o,4,9,"app-timespan",45),z(),C(13,Mo,3,0,"button",32),a()),e&2){let t=n.$implicit;Pe("single-field",t.formGroupName!=="advanced"),l(),u("formGroupName",t.formGroupName),l(),T(t.formView.type==="FileTree"?2:t.formView.type==="FolderTree"?3:t.formView.type==="String"||t.formView.type==="Path"||t.formView.type==="Email"?4:t.formView.type==="Password"?5:t.formView.type==="Enumeration"?6:t.formView.type==="NonValidatedSelectableString"?7:t.formView.type==="Size"?8:t.formView.type==="Integer"?9:t.formView.type==="Boolean"?10:t.formView.type==="Flags"?11:t.formView.type==="Timespan"||t.formView.type==="DateTime"?12:-1),l(11),T(t.formGroupName==="advanced"?13:-1)}}function wo(e,n){if(e&1&&(X(0,22)(1,36),ne(2,Vn,1,9,"ng-container",null,te),ne(4,Kn,1,9,"ng-container",null,te),s(6,"app-toggle-card",37),X(7,38),D(8,10),s(9,"spk-menu",31)(10,"button",39),d(11,"spk-icon"),a(),X(12,20),ne(13,Hn,3,1,"button",33,te),z(),a(),E(),z(),ne(15,zn,1,9,"ng-container",null,te),a(),s(17,"app-toggle-card",37),X(18,38),D(19,11),s(20,"spk-menu",31)(21,"button",39),d(22,"spk-icon"),a(),X(23,20),ne(24,Wn,3,1,"button",33,te),z(),a(),E(),z(),ne(26,qn,1,9,"ng-container",null,te),a(),C(28,Ro,14,5,"ng-template",null,2,Je),z()()),e&2){let t=c();l(2),oe(t.destinationFormPair().custom),l(2),oe(t.destinationFormPair().dynamic),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",t.notSelectedAdvancedFormPair().length===0),l(3),oe(t.notSelectedAdvancedFormPair()),l(2),oe(t.selectedAdvancedFormPair()),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",t.notSelectedHttpOptions().length===0),l(3),oe(t.notSelectedHttpOptions()),l(2),oe(t.selectedHttpOptions())}}function xo(e,n){if(e&1){let t=I();s(0,"spk-dialog",65),q("isOpenChange",function(i){F(t);let r=c();return j(r.targetUrlDialogOpen,i)||(r.targetUrlDialogOpen=i),g(i)}),s(1,"header",66)(2,"h2"),w(3,12),a(),s(4,"spk-alert",67),w(5,13),a()(),s(6,"div",68)(7,"spk-form-field"),d(8,"textarea",69),a()(),s(9,"footer",70)(10,"button",24),N("click",function(){F(t);let i=c();return g(i.closeTargetUrlDialog(!1))}),S(11,"Cancel"),a(),s(12,"button",71),N("click",function(){F(t);let i=c();return g(i.closeTargetUrlDialog(!0))}),D(13,14),d(14,"spk-icon"),E(),a()()()}if(e&2){let t=c();W("isOpen",t.targetUrlDialogOpen),u("options",bt(3,Rn)),l(8),u("formControl",t.targetUrlCtrl)}}var gt=new ge,Zt=(e={destinations:[]})=>gt.group({destinations:gt.array(e.destinations)}),en=({key:e,customGroup:n,dynamicGroup:t,advancedGroup:o})=>gt.group({destinationType:gt.control(e),custom:n,dynamic:t,advanced:o}),Rt=class e{#n=R(pe);#e=R(Ee);#o=R(Lt);#i=R(xe);#t=R(Se);#r=R(Vt);injector=R(xt);formRef=Me.required("formRef");destinationForm=this.#t.destinationForm;destinationFormPair=this.#t.destinationFormPair;selectedAdvancedFormPair=this.#t.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#t.notSelectedAdvancedFormPair;selectedHttpOptions=this.#t.selectedHttpOptions;notSelectedHttpOptions=this.#t.notSelectedHttpOptions;destinationOptions=this.#t.destinationOptions;destinationFormSignal=this.#t.destinationFormSignal;destinationCount=L(()=>this.destinationFormSignal()?.destinations?.length??0);successfulTest=P(!1);destinationTypeOptionsInFocus=P(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=P(he.map(n=>({key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description})));destinationTypeOptionsFocused=L(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(i=>i.key===o))});destinationTypeOptionsNotFocused=L(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(o=>!n.includes(o.key))});getFormFieldValue(n,t,o){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[t]).controls[o].value}addDestinationFormGroup(n){this.#t.addDestinationFormGroup(n)}addAdvancedFormPair(n,t){this.#t.addAdvancedFormPair(n,t)}removeFormView(n,t){this.#t.removeAdvancedFormPair(n,t)}addHttpOption(n,t){this.#t.addHttpOption(n,t)}targetUrl=L(()=>this.#t.getCurrentTargetUrl()[0]);targetUrlCtrl=new rt;targetUrlInitial=P(null);targetUrlDialogOpen=P(!1);openTargetUrlDialog(){let t=this.#t.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(t),this.targetUrlInitial.set(t),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl.value,o=this.targetUrlInitial();!n||t===o||this.#t.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let o=this.#t.getCurrentTargetUrl()[n];o&&this.#i.postApiV1RemoteoperationTest({requestBody:{path:o}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:i=>{let r=i.error.error.Error;if(this.successfulTest.set(!1),r==="missing-folder"){this.#r.open(ke,{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:p=>{p&&this.#i.postApiV1RemoteoperationCreate({requestBody:{path:o}}).subscribe({next:()=>{this.#r.open(ke,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{this.testDestination(n)}})}})}});return}if(r.startsWith("incorrect-cert:")){let p=r.split("incorrect-cert:")[1];this.#r.open(ke,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
4
+ If this is a self-signed certificate, you can choose to trust this certificate.
5
+ The server reported the certificate hash: ${p}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:m=>{m&&this.#t.addHttpOptionByName("accept-specified-ssl-hash",p)}});return}if(r.startsWith("incorrect-host-key:")){let p=r.split('incorrect-host-key:"')[1].split('",')[0],m=r.split('accepted-host-key:"')[1].split('",')[0];m?this.#r.open(ke,{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,
6
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
7
+ Do you want to REPLACE your CURRENT host key ${m}
8
+ with the REPORTED host key: ${p}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:f=>{f&&this.#t.addAdvancedFormPairByName("ssh-fingerprint",n,p)}}):this.#r.open(ke,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${p}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:f=>{f&&this.#t.addAdvancedFormPairByName("ssh-fingerprint",n,p)}});return}this.#r.open(ke,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:r,cancelText:$localize`OK`},closed:p=>{}})}})}mapToTargetUrl(n){return ut(n.value)}removeDestinationFormGroup(n){this.destinationForm.controls.destinations.removeAt(n)}displayFn(n){let t=this.destinationOptions().find(o=>o.Key===n);return t?`${t.DisplayName}`:""}goBack(){this.#n.navigate(["general"],{relativeTo:this.#e.parent})}next(){this.#n.navigate(["source-data"],{relativeTo:this.#e.parent})}#s=P("https://duplicati-oauth-handler.appspot.com/").asReadonly();#l=P(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#a=P(!1);#p=P(null);keyCreation(){}oauthStartTokenCreation(n){this.#a.set(!0);let t=450,o=600,i=this.#s()+"?type="+n+"&token="+this.#l(),r=screen.width/2-t/2,p=screen.height/2-o/2,m=window.open(i,"_blank","height="+o+",width="+t+",menubar=0,status=0,titlebar=0,toolbar=0,left="+r+",top="+p);m?.addEventListener("blur",f=>{console.log("event blur",f)}),m?.addEventListener("beforeunload",f=>{console.log("event beforeunload",f),this.#o.get(this.#s()+"fetch?callback=JSON_CALLBACK",{params:{token:this.#l()}}).pipe(je(()=>this.#a.set(!1))).subscribe({next:$=>{console.log("res",$),$?.authid&&this.#p.set($.authid)}})})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=se({type:e,selectors:[["app-destination"]],viewQuery:function(t,o){t&1&&Re(o.formRef,Nn,5),t&2&&we()},decls:24,vars:6,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=Ne(n);let t;t=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let o;o=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize` Want to select another destination? ${"\uFFFD#2\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPAN:`;let r;r=$localize`Other destinations`;let p;p=$localize` Advanced options ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#10\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#12\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_MENU:`,p=Ne(p);let m;m=$localize` Http options ${"\uFFFD#20\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON: Add http option ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#23\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*25:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_MENU:`,m=Ne(m);let f;f=$localize`Edit target URL`;let $;$=$localize` Be careful, this will overwrite everything you have in your destination. `;let U;return U=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],["fieldTemplate",""],["enumOptionTemplate",""],["optionTemplate",""],n,t,o,i,r,p,m,f,$,U,[3,"submit","formGroup"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],["formGroupName","0"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small",3,"disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","startingPath"],[3,"inputType","formControlName","customId"],[1,"primary","raised"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],[3,"type","id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"formControlName"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"formControl"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let i=I();s(0,"form",15,0),N("submit",function(){return F(i),g(o.next())}),s(2,"header")(3,"h3",16),D(4,5),s(5,"div",17),C(6,In,4,3,"button",18),s(7,"spk-menu")(8,"button",19),d(9,"spk-icon"),a(),X(10,20),s(11,"button",21),N("click",function(){return F(i),g(o.openTargetUrlDialog())}),d(12,"spk-icon"),a(),z(),a()(),E(),a(),C(13,vn,3,0,"p"),a(),C(14,Ln,9,1)(15,wo,30,6,"ng-container",22),s(16,"div",23)(17,"button",24),N("click",function(){return F(i),g(o.goBack())}),D(18,6),d(19,"spk-icon"),E(),a(),s(20,"button",25),D(21,7),d(22,"spk-icon"),E(),a()()(),C(23,xo,15,4,"spk-dialog",26)}if(t&2){let i;u("formGroup",o.destinationForm),l(6),T(o.destinationCount()>0?6:-1),l(7),T(o.destinationCount()>0?13:-1),l(),T(o.destinationCount()===0?14:-1),l(),T(!((i=o.destinationFormSignal())==null||i.destinations==null)&&i.destinations.length?15:-1),l(8),T(o.targetUrlDialogOpen()?23:-1)}},dependencies:[He,Le,de,Ue,be,Fe,Ge,st,Ve,Be,lt,Ht,Gt,ue,Bt,ce,ve,ot,Ut,tt,me,nt,Wt,Xe,pt,zt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}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;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{ut as a,he as b,Zt as c,en as d,Rt as e,qt as f,Ot as g,kt as h,Oe as i,$t as j,Yt as k,Mt as l,Se as m};
@@ -0,0 +1,8 @@
1
+ import{g as Yt}from"./chunk-BA7NYTFR.js";import{a as Qt,b as Jt,m as tt}from"./chunk-6UVVDGKQ.js";import{a as Xt,b as qt}from"./chunk-LBZ753XE.js";import{a as Wt}from"./chunk-XH2A67YP.js";import{a as jt}from"./chunk-ISRMJKPG.js";import"./chunk-DNHLTHLR.js";import"./chunk-3V622MYY.js";import"./chunk-WCLOWI5G.js";import{a as b}from"./chunk-MM22YS5Z.js";import"./chunk-ZP273LXY.js";import"./chunk-D5WIWFNP.js";import"./chunk-WSLU6K4D.js";import"./chunk-UJZB6UQE.js";import"./chunk-RHW5QVAY.js";import{b as wt,c as At,e as vt,f as Pt,g as Vt,i as bt,j as Mt,m as Gt,n as Bt,o as Lt,p as Ut,q as Ht,r as Kt,t as zt}from"./chunk-JJQARMUD.js";import"./chunk-3UJUWE5B.js";import{b as ft,d as Dt}from"./chunk-I3TLRILF.js";import"./chunk-2SGDSXNW.js";import{A as $t,a as Et,b as Ot,d as xt,e as kt,l as Rt,o as Nt,p as ht,t as yt,z as It}from"./chunk-XQKR67WI.js";import{b as St}from"./chunk-CEOO3F5U.js";import{c as gt}from"./chunk-K3CYM6ID.js";import{i as Ct}from"./chunk-M7VDIUGU.js";import{$b as ct,D as it,Db as O,Eb as x,Fb as G,Gb as q,Hb as j,Ib as H,Jb as f,Kb as p,Na as o,Nb as N,Pb as lt,Qb as T,Ua as at,Vb as st,W as y,Wb as pt,Xb as P,Yb as c,Za as rt,Zb as Q,_b as D,ba as C,bc as _t,ca as g,cb as m,cc as mt,dc as Ft,ec as J,fc as Y,ga as ot,gc as Z,hc as ut,ic as dt,jc as B,kb as _,lc as L,mb as X,pb as u,pc as U,qb as I,ra as R,rb as $,sb as w,tb as s,ub as r,vb as d,wb as A,xb as v,xc as K,yb as M,yc as Tt,zb as S}from"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";var Zt=["formRef"],te=(n,i,t,e)=>({index:n,formView:i,formGroupName:"custom",destinationType:t,oauthField:e}),W=n=>({$implicit:n}),ee=(n,i,t,e)=>({index:n,formView:i,formGroupName:"dynamic",destinationType:t,oauthField:e}),ne=(n,i,t,e)=>({index:n,formView:i,formGroupName:"advanced",destinationType:t,oauthField:e}),ie=(n,i,t,e)=>({index:n,formView:i,formGroupName:"advanced",asHttpOptions:!0,destinationType:t,oauthField:e}),oe=()=>({maxWidth:"700px",width:"100%"});function ae(n,i){n&1&&(O(0,5,2),d(1,"spk-icon"),x())}function re(n,i){n&1&&G(0,5,3)}function le(n,i){if(n&1){let t=S();O(0,5,1),s(1,"button",21),f("click",function(){C(t);let a=p();return g(a.testDestination())}),m(2,ae,2,0)(3,re,1,0),r(),x()}if(n&2){let t=p();o(),X("success",t.successfulTest()),o(),u(t.successfulTest()?2:3)}}function se(n,i){if(n&1){let t=S();s(0,"p",27),f("click",function(){C(t);let a=p();return g(a.removeDestinationFormGroup(a.destinationCount()-1))}),O(1,8),d(2,"span",28),x(),r()}}function pe(n,i){if(n&1){let t=S();s(0,"div",34),f("click",function(){let a=C(t).$implicit,l=p(2);return g(l.addDestinationFormGroup(a.key))}),s(1,"h3"),c(2),r(),s(3,"p"),c(4),r()()}if(n&2){let t=i.$implicit;o(2),Q(t.displayName),o(2),Q(t.description)}}function ce(n,i){if(n&1){let t=S();s(0,"button",35,1),f("click",function(){let a=C(t).$implicit,l=p(2);return g(l.addDestinationFormGroup(a.key))}),c(2),r()}if(n&2){let t=i.$implicit;o(2),D(" ",t.displayName," ")}}function _e(n,i){if(n&1&&(s(0,"div",29),$(1,pe,5,2,"div",30,I),r(),s(3,"spk-menu",31)(4,"button",32),G(5,9),r(),A(6,20),$(7,ce,3,1,"button",33,I),v(),r()),n&2){let t=p();o(),w(t.destinationTypeOptionsFocused()),o(2),_("searchable",!0),o(4),w(t.destinationTypeOptionsNotFocused())}}function me(n,i){n&1&&M(0)}function Fe(n,i){if(n&1&&m(0,me,1,0,"ng-container",40),n&2){let t,e=i.$implicit,a=i.$index;p();let l=P(29),F=p();_("ngTemplateOutlet",l)("ngTemplateOutletContext",B(7,W,L(2,te,a,e,(t=F.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,F.destinationFormPair().oauthField)))}}function ue(n,i){n&1&&M(0)}function de(n,i){if(n&1&&m(0,ue,1,0,"ng-container",40),n&2){let t,e=i.$implicit,a=i.$index;p();let l=P(29),F=p();_("ngTemplateOutlet",l)("ngTemplateOutletContext",B(7,W,L(2,ee,a,e,(t=F.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,F.destinationFormPair().oauthField)))}}function Te(n,i){if(n&1){let t=S();O(0,10,1),s(1,"button",35,1),f("click",function(){let a=C(t).$implicit,l=p(2);return g(l.addAdvancedFormPair(a,0))}),r(),x()}if(n&2){let t=i.$implicit;o(),q(t.name),j(0)}}function Ce(n,i){n&1&&M(0)}function ge(n,i){if(n&1&&m(0,Ce,1,0,"ng-container",40),n&2){let t,e=i.$implicit,a=i.$index;p();let l=P(29),F=p();_("ngTemplateOutlet",l)("ngTemplateOutletContext",B(7,W,L(2,ne,a,e,(t=F.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,F.destinationFormPair().oauthField)))}}function fe(n,i){if(n&1){let t=S();O(0,11,1),s(1,"button",35,1),f("click",function(){let a=C(t).$implicit,l=p(2);return g(l.addHttpOption(a,0))}),r(),x()}if(n&2){let t=i.$implicit;o(),q(t.name),j(0)}}function De(n,i){n&1&&M(0)}function Se(n,i){if(n&1&&m(0,De,1,0,"ng-container",40),n&2){let t,e=i.$implicit,a=i.$index;p();let l=P(29),F=p();_("ngTemplateOutlet",l)("ngTemplateOutletContext",B(7,W,L(2,ie,a,e,(t=F.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,F.destinationFormPair().oauthField)))}}function Ee(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(2).$implicit;_("message",t.formView.longDescription)}}function Oe(n,i){if(n&1&&(s(0,"app-file-tree",43)(1,"label",47),c(2),m(3,Ee,3,1,"spk-tooltip",48),r(),d(4,"input",49),r()),n&2){let t,e=p().$implicit,a=p(2);_("startingPath",a.getFormFieldValue(0,e.formGroupName,e.formView.name))("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),o(),T("for","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),o(),D(" ",(t=e.formView.shortDescription)!==null&&t!==void 0?t:e.formView.name," "),o(),u(e.formView.longDescription?3:-1),o(),T("id","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),N("formControlName",e.formView.name)}}function xe(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(2).$implicit;_("message",t.formView.longDescription)}}function ke(n,i){if(n&1&&(s(0,"app-file-tree",44)(1,"label",47),c(2),m(3,xe,3,1,"spk-tooltip",48),r(),d(4,"input",49),r()),n&2){let t,e=p().$implicit,a=p(2);_("hideShortcuts",!0)("startingPath",a.getFormFieldValue(0,e.formGroupName,e.formView.name)),o(),T("for","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),o(),D(" ",(t=e.formView.shortDescription)!==null&&t!==void 0?t:e.formView.name," "),o(),u(e.formView.longDescription?3:-1),o(),T("id","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),N("formControlName",e.formView.name)}}function Re(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(2).$implicit;_("message",t.formView.longDescription)}}function Ne(n,i){n&1&&(s(0,"spk-icon",51),c(1,"link"),r())}function he(n,i){n&1&&(s(0,"spk-icon",51),c(1,"envelope"),r())}function ye(n,i){n&1&&(s(0,"spk-icon",51),c(1,"textbox"),r())}function Ie(n,i){if(n&1&&(s(0,"spk-form-field")(1,"label",47),c(2),m(3,Re,3,1,"spk-tooltip",48),r(),d(4,"input",50),m(5,Ne,2,0,"spk-icon",51)(6,he,2,0,"spk-icon",51)(7,ye,2,0,"spk-icon",51),r()),n&2){let t,e=p().$implicit;o(),T("for","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),o(),D(" ",(t=e.formView.shortDescription)!==null&&t!==void 0?t:e.formView.name," "),o(),u(e.formView.longDescription?3:-1),o(),T("id","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),N("formControlName",e.formView.name),_("type",e.formView.type==="Email"?"email":"text"),o(),u(e.formView.type==="Path"?5:e.formView.type==="Email"?6:7)}}function $e(n,i){if(n&1){let t=S();s(0,"span",55),f("click",function(){C(t);let a=p(2).$implicit,l=p(2);return g(l.oauthStartTokenCreation(a.destinationType))}),c(1,"AuthID"),r()}}function we(n,i){n&1&&(s(0,"spk-icon",51),c(1,"password"),r())}function Ae(n,i){if(n&1){let t=S();s(0,"spk-icon",56),f("click",function(){C(t);let a=p(2).$implicit;return g(a.formView.showPassword=!a.formView.showPassword)}),c(1," eye "),r()}}function ve(n,i){if(n&1){let t=S();s(0,"spk-icon",56),f("click",function(){C(t);let a=p(2).$implicit;return g(a.formView.showPassword=!a.formView.showPassword)}),c(1," eye-slash "),r()}}function Pe(n,i){if(n&1&&(s(0,"spk-form-field")(1,"label",47),c(2),r(),d(3,"input",52),m(4,$e,2,0,"span",53)(5,we,2,0,"spk-icon",51)(6,Ae,2,0,"spk-icon",54)(7,ve,2,0,"spk-icon",54),r()),n&2){let t,e=p().$implicit;o(),T("for","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),o(),D(" ",(t=e.formView.shortDescription)!==null&&t!==void 0?t:e.formView.name," "),o(),T("id","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),N("formControlName",e.formView.name),_("type",e.formView.showPassword?"text":"password"),o(),u(e.oauthField===e.formView.name?4:5),o(2),u(e.formView.showPassword?6:7)}}function Ve(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(3).$implicit;_("message",t.formView.longDescription)}}function be(n,i){if(n&1&&c(0),n&2){let t=i.$implicit;D(" ",t," ")}}function Me(n,i){if(n&1&&(s(0,"spk-select",57)(1,"label",47),c(2),m(3,Ve,3,1,"spk-tooltip",48),r(),d(4,"input",49),r(),m(5,be,1,1,"ng-template",null,3,U)),n&2){let t,e=P(6);p();let a=Z(0),l=p().$implicit;_("options",a)("isClearable",!1)("optionTemplate",e),o(),T("for","destination-",l.formGroupName,"-",l.index,"-",l.asHttpOptions?"http":"other",""),o(),D(" ",(t=l.formView.shortDescription)!==null&&t!==void 0?t:l.formView.name," "),o(),u(l.formView.longDescription?3:-1),o(),T("id","destination-",l.formGroupName,"-",l.index,"-",l.asHttpOptions?"http":"other",""),N("formControlName",l.formView.name)}}function Ge(n,i){if(n&1&&(J(0),m(1,Me,7,14)),n&2){let t=p().$implicit,e=Y(t.formView.loadOptions?t.formView.loadOptions(p(2).injector)():t.formView.options);o(),u(e?1:-1)}}function Be(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(3).$implicit;_("message",t.formView.longDescription)}}function Le(n,i){if(n&1&&c(0),n&2){let t=i.$implicit;ct(" ",t.key," ",t.value?"("+t.value+")":""," ")}}function Ue(n,i){if(n&1&&(s(0,"spk-select",59)(1,"label",47),c(2),m(3,Be,3,1,"spk-tooltip",48),r(),d(4,"input",49),r(),m(5,Le,1,2,"ng-template",null,4,U)),n&2){let t,e=P(6);p();let a=Z(0),l=p().$implicit;_("options",a)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),o(),T("for","destination-",l.formGroupName,"-",l.index,"-",l.asHttpOptions?"http":"other",""),o(),D(" ",(t=l.formView.shortDescription)!==null&&t!==void 0?t:l.formView.name," "),o(),u(l.formView.longDescription?3:-1),o(),T("id","destination-",l.formGroupName,"-",l.index,"-",l.asHttpOptions?"http":"other",""),N("formControlName",l.formView.name)}}function He(n,i){n&1&&d(0,"spk-progress-bar",58)}function Ke(n,i){if(n&1&&(J(0),m(1,Ue,7,15)(2,He,1,0,"spk-progress-bar",58)),n&2){let t=p().$implicit,e=Y(t.formView.loadOptions?t.formView.loadOptions(p(2).injector)():t.formView.options);o(),u(e?1:2)}}function ze(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(2).$implicit;_("message",t.formView.longDescription)}}function We(n,i){if(n&1&&(s(0,"app-size",45)(1,"label",47),c(2),m(3,ze,3,1,"spk-tooltip",48),r()()),n&2){let t,e=p().$implicit;_("inputType",e.Name)("formControlName",e.formView.name)("customId",`destination-{{ item.formGroupName }}-{{ item.index }}-{{
2
+ item.asHttpOptions ? 'http' : 'other'
3
+ }}`),o(),T("for","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),o(),D(" ",(t=e.formView.shortDescription)!==null&&t!==void 0?t:e.formView.name," "),o(),u(e.formView.longDescription?3:-1)}}function Xe(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(2).$implicit;_("message",t.formView.longDescription)}}function qe(n,i){if(n&1&&(s(0,"spk-form-field")(1,"label",47),c(2),m(3,Xe,3,1,"spk-tooltip",48),r(),d(4,"input",60),s(5,"spk-icon",51),c(6,"numpad"),r()()),n&2){let t,e=p().$implicit;o(),T("for","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),o(),D(" ",(t=e.formView.shortDescription)!==null&&t!==void 0?t:e.formView.name," "),o(),u(e.formView.longDescription?3:-1),o(),T("id","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),N("formControlName",e.formView.name)}}function je(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(2).$implicit;_("message",t.formView.longDescription)}}function Qe(n,i){if(n&1&&(s(0,"spk-toggle",46)(1,"label",47),c(2),m(3,je,3,1,"spk-tooltip",48),r(),d(4,"input",61),r()),n&2){let t,e=p().$implicit;o(),T("for","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),o(),D(" ",(t=e.formView.shortDescription)!==null&&t!==void 0?t:e.formView.name," "),o(),u(e.formView.longDescription?3:-1),o(),T("id","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),N("formControlName",e.formView.name)}}function Je(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(2).$implicit;_("message",t.formView.longDescription)}}function Ye(n,i){if(n&1&&c(0),n&2){let t=i.$implicit;D(" ",t," ")}}function Ze(n,i){if(n&1&&(s(0,"spk-select",62)(1,"label",47),c(2),m(3,Je,3,1,"spk-tooltip",48),r(),d(4,"input",63),r(),m(5,Ye,1,1,"ng-template",null,4,U)),n&2){let t,e=P(6),a=p().$implicit;_("options",a.formView.options)("selectMultiple",!0)("optionTemplate",e),o(),lt("for","destination-",a.formGroupName,"-",a.index,""),o(),D(" ",(t=a.formView.shortDescription)!==null&&t!==void 0?t:a.formView.name," "),o(),u(a.formView.longDescription?3:-1),o(),N("formControlName",a.formView.name)}}function tn(n,i){if(n&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),c(2,"question"),r()()),n&2){let t=p(2).$implicit;_("message",t.formView.longDescription)}}function en(n,i){if(n&1&&(s(0,"app-timespan",45)(1,"label",47),c(2),m(3,tn,3,1,"spk-tooltip",48),r()()),n&2){let t,e=p().$implicit;_("inputType",e.formView.name)("formControlName",e.formView.name)("customId","destination-"+e.formGroupName+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),o(),T("for","destination-",e.formGroupName,"-",e.index,"-",e.asHttpOptions?"http":"other",""),o(),D(" ",(t=e.formView.shortDescription)!==null&&t!==void 0?t:e.formView.name," "),o(),u(e.formView.longDescription?3:-1)}}function nn(n,i){if(n&1){let t=S();s(0,"button",64),f("click",function(){C(t);let a=p().$implicit,l=p(2);return g(l.removeFormView(a.formView,0))}),s(1,"spk-icon"),c(2,"x-circle"),r()()}}function on(n,i){if(n&1&&(s(0,"div",41),A(1,42),m(2,Oe,5,17,"app-file-tree",43)(3,ke,5,13,"app-file-tree",44)(4,Ie,8,13,"spk-form-field")(5,Pe,8,13,"spk-form-field")(6,Ge,2,2)(7,Ke,3,2)(8,We,4,9,"app-size",45)(9,qe,7,11,"spk-form-field")(10,Qe,5,11,"spk-toggle",46)(11,Ze,7,9)(12,en,4,9,"app-timespan",45),v(),m(13,nn,3,0,"button",32),r()),n&2){let t=i.$implicit;X("single-field",t.formGroupName!=="advanced"),o(),_("formGroupName",t.formGroupName),o(),u(t.formView.type==="FileTree"?2:t.formView.type==="FolderTree"?3:t.formView.type==="String"||t.formView.type==="Path"||t.formView.type==="Email"?4:t.formView.type==="Password"?5:t.formView.type==="Enumeration"?6:t.formView.type==="NonValidatedSelectableString"?7:t.formView.type==="Size"?8:t.formView.type==="Integer"?9:t.formView.type==="Boolean"?10:t.formView.type==="Flags"?11:t.formView.type==="Timespan"||t.formView.type==="DateTime"?12:-1),o(11),u(t.formGroupName==="advanced"?13:-1)}}function an(n,i){if(n&1&&(A(0,22)(1,36),$(2,Fe,1,9,"ng-container",null,I),$(4,de,1,9,"ng-container",null,I),s(6,"app-toggle-card",37),A(7,38),O(8,10),s(9,"spk-menu",31)(10,"button",39),d(11,"spk-icon"),r(),A(12,20),$(13,Te,3,1,"button",33,I),v(),r(),x(),v(),$(15,ge,1,9,"ng-container",null,I),r(),s(17,"app-toggle-card",37),A(18,38),O(19,11),s(20,"spk-menu",31)(21,"button",39),d(22,"spk-icon"),r(),A(23,20),$(24,fe,3,1,"button",33,I),v(),r(),x(),v(),$(26,Se,1,9,"ng-container",null,I),r(),m(28,on,14,5,"ng-template",null,2,U),v()()),n&2){let t=p();o(2),w(t.destinationFormPair().custom),o(2),w(t.destinationFormPair().dynamic),o(2),_("disallowToggle",!0),o(3),_("searchable",!0),o(),_("disabled",t.notSelectedAdvancedFormPair().length===0),o(3),w(t.notSelectedAdvancedFormPair()),o(2),w(t.selectedAdvancedFormPair()),o(2),_("disallowToggle",!0),o(3),_("searchable",!0),o(),_("disabled",t.notSelectedHttpOptions().length===0),o(3),w(t.notSelectedHttpOptions()),o(2),w(t.selectedHttpOptions())}}function rn(n,i){if(n&1){let t=S();s(0,"spk-dialog",65),Ft("isOpenChange",function(a){C(t);let l=p();return mt(l.targetUrlDialogOpen,a)||(l.targetUrlDialogOpen=a),g(a)}),s(1,"header",66)(2,"h2"),G(3,12),r(),s(4,"spk-alert",67),G(5,13),r()(),s(6,"div",68)(7,"spk-form-field"),d(8,"textarea",69),r()(),s(9,"footer",70)(10,"button",24),f("click",function(){C(t);let a=p();return g(a.closeTargetUrlDialog(!1))}),c(11,"Cancel"),r(),s(12,"button",71),f("click",function(){C(t);let a=p();return g(a.closeTargetUrlDialog(!0))}),O(13,14),d(14,"spk-icon"),x(),r()()()}if(n&2){let t=p();_t("isOpen",t.targetUrlDialogOpen),_("options",dt(3,oe)),o(8),_("formControl",t.targetUrlCtrl)}}var z=new Kt,An=(n={destinations:[]})=>z.group({destinations:z.array(n.destinations)}),vn=({key:n,customGroup:i,dynamicGroup:t,advancedGroup:e})=>z.group({destinationType:z.control(n),custom:i,dynamic:t,advanced:e}),et=class n{#l=y(Dt);#s=y(ft);#p=y(gt);#t=y(tt);#i=y(St);#e=y(kt);#n=y(Yt);injector=y(ot);formRef=at.required("formRef");destinationForm=this.#t.destinationForm;destinationFormPair=this.#t.destinationFormPair;selectedAdvancedFormPair=this.#t.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#t.notSelectedAdvancedFormPair;selectedHttpOptions=this.#t.selectedHttpOptions;notSelectedHttpOptions=this.#t.notSelectedHttpOptions;destinationOptions=this.#t.destinationOptions;destinationFormSignal=this.#t.destinationFormSignal;destinationCount=K(()=>this.destinationFormSignal()?.destinations?.length??0);successfulTest=R(!1);destinationTypeOptionsInFocus=R(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=R(Jt.map(i=>({key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description})));destinationTypeOptionsFocused=K(()=>{let i=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return i.map(e=>t.find(a=>a.key===e))});destinationTypeOptionsNotFocused=K(()=>{let i=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(e=>!i.includes(e.key))});targetUrlEffect=Tt(()=>{if(this.destinationFormSignal(),this.destinationForm.valid){let i=this.#t.getCurrentTargetUrl();this.#n.updateTargetUrl(i[0])}else this.#n.updateTargetUrl(null)});ngOnInit(){let i=this.#n.destinationTargetUrl();i&&this.#t.updateFieldsFromTargetUrl(i)}getFormFieldValue(i,t,e){return((this.destinationForm.controls.destinations.controls?.[i]).controls?.[t]).controls[e].value}addDestinationFormGroup(i){this.#t.addDestinationFormGroup(i)}addAdvancedFormPair(i,t){this.#t.addAdvancedFormPair(i,t)}removeFormView(i,t){this.#t.removeAdvancedFormPair(i,t)}addHttpOption(i,t){this.#t.addHttpOption(i,t)}targetUrlCtrl=new Vt;targetUrlInitial=R(null);targetUrlDialogOpen=R(!1);openTargetUrlDialog(){let t=this.#t.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(t),this.targetUrlInitial.set(t),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl.value,e=this.targetUrlInitial();!i||t===e||this.#t.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(i=0){let e=this.#t.getCurrentTargetUrl()[i];e&&this.#i.postApiV1RemoteoperationTest({requestBody:{path:e}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:a=>{let l=a.error.error.Error;if(l==="missing-folder"&&this.#e.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:F=>{F&&this.#i.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.#e.open(b,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{this.testDestination(i)}})}})}}),l.startsWith("incorrect-cert:")){let F=l.split("incorrect-cert:")[1];this.#e.open(b,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
4
+ If this is a self-signed certificate, you can choose to trust this certificate.
5
+ The server reported the certificate hash: ${F}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:E=>{E&&this.#t.addHttpOptionByName("accept-specified-ssl-hash",F)}})}if(l.startsWith("incorrect-host-key:")){let F=l.split('incorrect-host-key:"')[1].split('",')[0],E=l.split('accepted-host-key:"')[1].split('",')[0];E?this.#e.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,
6
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
7
+ Do you want to REPLACE your CURRENT host key ${E}
8
+ with the REPORTED host key: ${F}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:k=>{k&&this.#t.addAdvancedFormPairByName("ssh-fingerprint",i,F)}}):this.#e.open(b,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${F}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:k=>{k&&this.#t.addAdvancedFormPairByName("ssh-fingerprint",i,F)}})}}})}mapToTargetUrl(i){return Qt(i.value)}removeDestinationFormGroup(i){this.destinationForm.controls.destinations.removeAt(i)}displayFn(i){let t=this.destinationOptions().find(e=>e.Key===i);return t?`${t.DisplayName}`:""}goBack(){this.#n.exit()}next(){this.#l.navigate(["encryption"],{relativeTo:this.#s.parent})}#o=R("https://duplicati-oauth-handler.appspot.com/").asReadonly();#a=R(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#r=R(!1);#c=R(null);keyCreation(){}oauthStartTokenCreation(i){this.#r.set(!0);let t=450,e=600,a=this.#o()+"?type="+i+"&token="+this.#a(),l=screen.width/2-t/2,F=screen.height/2-e/2,E=window.open(a,"_blank","height="+e+",width="+t+",menubar=0,status=0,titlebar=0,toolbar=0,left="+l+",top="+F);E?.addEventListener("blur",k=>{console.log("event blur",k)}),E?.addEventListener("beforeunload",k=>{console.log("event beforeunload",k),this.#p.get(this.#o()+"fetch?callback=JSON_CALLBACK",{params:{token:this.#a()}}).pipe(it(()=>this.#r.set(!1))).subscribe({next:V=>{console.log("res",V),V?.authid&&this.#c.set(V.authid)}})})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=rt({type:n,selectors:[["app-restore-destination"]],viewQuery:function(t,e){t&1&&st(e.formRef,Zt,5),t&2&&pt()},features:[ut([tt])],decls:24,vars:6,consts:()=>{let i;i=$localize` Backup placement ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,i=H(i);let t;t=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let e;e=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let a;a=$localize` Want to select another destination? ${"\uFFFD#2\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPAN:`;let l;l=$localize`Other destinations`;let F;F=$localize` Advanced options ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#10\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#12\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_MENU:`,F=H(F);let E;E=$localize` Http options ${"\uFFFD#20\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON: Add http option ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#23\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*25:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_MENU:`,E=H(E);let k;k=$localize`Edit target URL`;let V;V=$localize` Be careful, this will overwrite everything you have in your destination. `;let nt;return nt=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],["fieldTemplate",""],["enumOptionTemplate",""],["optionTemplate",""],i,t,e,a,l,F,E,k,V,nt,[3,"submit","formGroup"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],["formGroupName","0"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small",3,"disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","startingPath"],[3,"inputType","formControlName","customId"],[1,"primary","raised"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],[3,"type","id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"formControlName"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"formControl"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,e){if(t&1){let a=S();s(0,"form",15,0),f("submit",function(){return C(a),g(e.next())}),s(2,"header")(3,"h3",16),O(4,5),s(5,"div",17),m(6,le,4,3,"button",18),s(7,"spk-menu")(8,"button",19),d(9,"spk-icon"),r(),A(10,20),s(11,"button",21),f("click",function(){return C(a),g(e.openTargetUrlDialog())}),d(12,"spk-icon"),r(),v(),r()(),x(),r(),m(13,se,3,0,"p"),r(),m(14,_e,9,1)(15,an,30,6,"ng-container",22),s(16,"div",23)(17,"button",24),f("click",function(){return C(a),g(e.goBack())}),O(18,6),d(19,"spk-icon"),x(),r(),s(20,"button",25),O(21,7),d(22,"spk-icon"),x(),r()()(),m(23,rn,15,4,"spk-dialog",26)}if(t&2){let a;_("formGroup",e.destinationForm),o(6),u(e.destinationCount()>0?6:-1),o(7),u(e.destinationCount()>0?13:-1),o(),u(e.destinationCount()===0?14:-1),o(),u(!((a=e.destinationFormSignal())==null||a.destinations==null)&&a.destinations.length?15:-1),o(8),u(e.targetUrlDialogOpen()?23:-1)}},dependencies:[zt,bt,At,Mt,wt,vt,Pt,Gt,Bt,Ht,Lt,Ut,Ct,Rt,Nt,Et,It,$t,xt,Ot,yt,ht,qt,Xt,jt,Wt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}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}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}"],changeDetection:0})};export{An as createDestinationForm,vn as createDestinationFormGroup,et as default};
@@ -1 +1 @@
1
- import"./chunk-7CGTOI24.js";var t=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-HFRBCV47.js")},{path:"encryption",loadComponent:()=>import("./chunk-2VHTET54.js")},{path:"select-files",loadComponent:()=>import("./chunk-YTJB3DGU.js")},{path:"options",loadComponent:()=>import("./chunk-7QUJNAXH.js")}],o=t;export{o as default};
1
+ import"./chunk-7CGTOI24.js";var t=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-CQTSWNP2.js")},{path:"encryption",loadComponent:()=>import("./chunk-2VHTET54.js")},{path:"select-files",loadComponent:()=>import("./chunk-YTJB3DGU.js")},{path:"options",loadComponent:()=>import("./chunk-7QUJNAXH.js")}],o=t;export{o as default};
@@ -0,0 +1 @@
1
+ import{Jb as x,Kb as l,Na as n,Yb as r,Za as T,Zb as m,ba as f,ca as _,cb as u,na as g,oa as D,pb as s,tb as i,ub as o,xc as b,zb as C}from"./chunk-XGARKXE4.js";import{a as p}from"./chunk-7CGTOI24.js";function v(e,a){if(e&1&&(i(0,"p"),r(1),o()),e&2){let t=l();n(),m(t._data().message)}}function y(e,a){if(e&1){let t=C();i(0,"button",5),x("click",function(){f(t);let d=l();return _(d.close("cancel"))}),r(1),o()}if(e&2){let t=l();n(),m(t._data().cancelText)}}function h(e,a){if(e&1){let t=C();i(0,"button",6),x("click",function(){f(t);let d=l();return _(d.close("confirm"))}),r(1),o()}if(e&2){let t=l();n(),m(t._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},k=class e{data=D();_data=b(()=>p(p({},w),this.data()));closed=g();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=T({type:e,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["spk-button","",1,""],["spk-button","",1,"raised","primary"],["spk-button","",1,"",3,"click"],["spk-button","",1,"raised","primary",3,"click"]],template:function(t,c){t&1&&(i(0,"header",0)(1,"h3"),r(2),o()(),i(3,"div",1),u(4,v,2,1,"p"),o(),i(5,"footer",2),u(6,y,2,1,"button",3)(7,h,2,1,"button",4),o()),t&2&&(n(2),m(c._data().title),n(2),s(c._data().message?4:-1),n(2),s(c._data().cancelText?6:-1),n(),s(c._data().confirmText?7:-1))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{k as a};