@duplicati/ngclient 0.0.172 → 0.0.173

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{a as Ue}from"./chunk-W2UO5LKI.js";import{a as Ye}from"./chunk-GS5QK7LF.js";import{d as se}from"./chunk-VKR5DJQG.js";import{a as Xe}from"./chunk-PJAWWLYW.js";import{a as Je}from"./chunk-RECKKS2S.js";import{b as _e}from"./chunk-I2RHQQ3J.js";import{a as L}from"./chunk-F2QQDU4N.js";import{a as U}from"./chunk-XE5OMGTJ.js";import{b as Y}from"./chunk-KBGIIJMM.js";import{B as X,H as we,L as Be,M as xe,P as Ve,V as We,W as ze,b as ve,c as G,e as k,f as w,i as Ae,j as B,l as Ge,o as x,q as V,r as W,s as ke,t as z,u as J,z as ne}from"./chunk-LFRGO2IP.js";import{b as h,d as R}from"./chunk-LEZL7BSL.js";import{la as oe}from"./chunk-6DB3NZXR.js";import{$b as v,Ac as ye,B as Oe,Bc as be,Cb as T,Db as r,Eb as l,F as j,Fb as c,Gc as ae,H as O,Hc as $e,Ic as De,Jb as $,Kb as D,L as Ce,Mb as q,P as Ne,Q as Z,Ra as d,Rc as le,Sc as A,Tb as S,Ub as g,V as fe,Vb as E,Wb as Re,Xb as Pe,Zb as C,_,bb as M,da as N,ea as f,gb as he,i as Ee,kc as Ie,nc as K,o as me,oa as p,pc as Le,qc as Me,sc as ee,tc as te,uc as ie,wb as y,x as re,xb as b,y as Fe}from"./chunk-FAM42SZT.js";var He=new W,Ke=()=>He.group({passphrase:He.control("")}),pe=class a{#t=_(Y);#e=_(P);#n=_(R);#o=_(h);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=p(!1);settings=p([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),C("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),E(3,0),l(),c(4,"input",6),l(),r(5,"sh-toggle-card"),$(6,7),E(7,1),D(),r(8,"app-options-list",8),ie("optionsChange",function(n){return te(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),C("click",function(){return t.back()}),S(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),S(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(T("formGroup",t.encryptionForm),d(8),ee("options",t.settings),T("hasFreeTextSettings",!0))},dependencies:[z,B,G,k,w,x,V,we,J,X,We,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var et=()=>({standalone:!0});function tt(a,i){a&1&&c(0,"sh-progress-bar",8)}function it(a,i){if(a&1&&(K(0),ae(1,"bytes")),a&2){let e=v().$implicit;Le(" (",$e(1,1,e.FileSizes),") ")}}function ot(a,i){a&1&&(r(0,"span",16),E(1,4),l())}function nt(a,i){if(a&1&&(r(0,"div",15),K(1),ae(2,"date"),y(3,it,2,3),y(4,ot,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),Me(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function st(a,i){a&1&&c(0,"sh-progress-bar",8)}function rt(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),E(2,5),l(),c(3,"input",18),l()),a&2){let e=v(2);T("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function at(a,i){if(a&1){let e=q();r(0,"sh-select",12),C("cleared",function(){N(e);let o=v();return f(o.abortLoading())}),r(1,"input",13),ie("ngModelChange",function(o){N(e);let n=v();return te(n.selectOption,o)||(n.selectOption=o),f(o)}),l(),he(2,nt,5,7,"ng-template"),l(),y(3,st,1,0,"sh-progress-bar",8),y(4,rt,4,5,"app-file-tree",14)}if(a&2){let e=v();T("options",e.versionOptions())("isClearable",!1),d(),ee("ngModel",e.selectOption),T("ngModelOptions",be(6,et)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new W,Qe=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=_(Y);#e=_(P);#n=_(Xe);#o=_(U);#i=_(R);#s=_(h);#l=_(oe);#a=null;#_=null;#r=p([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=p(!1);backupSettings=p(null);rootPaths=p([]);initialNodes=p([]);loadingRootPath=p(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=p({});loadingEffect=A(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=A(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(Q=>Q.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,F=o[u];if(this.needsDatabaseRepair()&&(!F||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=A(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Z(this.abortLoading$),O(()=>{this.#_=null})).subscribe(s=>{let u=s.ID;this.#n.waitForTaskToComplete(u).pipe(j(1)).subscribe(()=>{this.#r.update(F=>F.filter(I=>I!==n)),this.loadedVersions.update(F=>(F[n]=!0,F))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ee;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[ye([oe])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",6,0),C("submit",function(){return N(o),f(t.next())}),r(2,"h3",7),E(3,1),l(),y(4,tt,1,0,"sh-progress-bar",8)(5,at,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return N(o),f(t.back())}),S(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),S(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(T("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Re(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[ke,B,G,k,w,Ae,z,x,V,se,X,J,Ve,Be,oe,Je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=_(R);#e=_(h);#n=_(U);#o=_(ne);#i=_(Y);backupId=p(null);backup=p(null);destinationTargetUrl=p(null);selectFilesForm=Qe();optionsForm=Ze();encryptionForm=Ke();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=p(null);versionOptionsLoading=p(!1);versionOptions=p([]);isSubmitting=p(!1);isFileRestore=p(!1);isFullWidthPage=p(!1);#s=p("");#l=p(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=A(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup()}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#o.open(L,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#o.open(L,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#p(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode??t?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?me(()=>t):Fe(1e3).pipe(Ne(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(){let i=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:i}),this.loadFilesetsWithRetryv2(i)]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{if(t.Error)throw new Error(t.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(L,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#t.navigate(["/backup",i,"database"])}});return}this.versionOptions.set((t.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let t=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=t==="EncryptedStorageNoPassphrase",n=t==="FolderMissing",s=t==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(L,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:F=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:i}),this.#i.getApiV1BackupByIdFilesets({id:i}).pipe(Ce(3))]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{this.versionOptions.set(t.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#p(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=fe({token:a,factory:a.\u0275fac,providedIn:"root"})};var H=new W,Ze=()=>H.group({restoreFrom:H.control("original"),restoreFromPath:H.control(""),handleExisting:H.control("overwrite"),permissions:H.control(!1),includeMetadata:H.control(!0)}),Se=class a{#t=_(P);#e=_(R);#n=_(h);#o=_(U);#i=_(ne);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let i=this.#t.selectFilesFormSignal()?.filesToRestore??[];if(i.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(i[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(L,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#t.submit()}});return}this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let F;F=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Te;return Te=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,F,I,Q,ge,Te,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",13,0),C("submit",function(){return N(o),f(t.submit())}),r(2,"h3",14),E(3,1),l(),r(4,"app-toggle-card",15),$(5,16),E(6,2),D(),r(7,"sh-radio",17),S(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),S(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),K(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),$(18,16),E(19,5),D(),r(20,"sh-radio",17),S(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),S(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),$(27,16),E(28,8),D(),r(29,"sh-toggle",25),S(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),S(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),C("click",function(){return N(o),f(t.goBack())}),S(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),S(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;T("formGroup",t.optionsForm),d(4),T("disallowToggle",!0),d(9),T("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),T("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[z,B,G,ve,Ge,k,w,x,V,Ye,se,ze,xe,X,J],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Ze as a,Se as b,Ke as c,pe as d,Qe as e,de as f,P as g};
1
+ import{a as Ue}from"./chunk-C7RFWM7I.js";import{a as Ye}from"./chunk-GS5QK7LF.js";import{d as se}from"./chunk-FUE2VIJ7.js";import{a as Xe}from"./chunk-PJAWWLYW.js";import{a as Je}from"./chunk-RECKKS2S.js";import{b as _e}from"./chunk-I2RHQQ3J.js";import{a as L}from"./chunk-F2QQDU4N.js";import{a as U}from"./chunk-XE5OMGTJ.js";import{b as Y}from"./chunk-KBGIIJMM.js";import{B as X,H as we,L as Be,M as xe,P as Ve,V as We,W as ze,b as ve,c as G,e as k,f as w,i as Ae,j as B,l as Ge,o as x,q as V,r as W,s as ke,t as z,u as J,z as ne}from"./chunk-LFRGO2IP.js";import{b as h,d as R}from"./chunk-LEZL7BSL.js";import{la as oe}from"./chunk-6DB3NZXR.js";import{$b as v,Ac as ye,B as Oe,Bc as be,Cb as T,Db as r,Eb as l,F as j,Fb as c,Gc as ae,H as O,Hc as $e,Ic as De,Jb as $,Kb as D,L as Ce,Mb as q,P as Ne,Q as Z,Ra as d,Rc as le,Sc as A,Tb as S,Ub as g,V as fe,Vb as E,Wb as Re,Xb as Pe,Zb as C,_,bb as M,da as N,ea as f,gb as he,i as Ee,kc as Ie,nc as K,o as me,oa as p,pc as Le,qc as Me,sc as ee,tc as te,uc as ie,wb as y,x as re,xb as b,y as Fe}from"./chunk-FAM42SZT.js";var He=new W,Ke=()=>He.group({passphrase:He.control("")}),pe=class a{#t=_(Y);#e=_(P);#n=_(R);#o=_(h);encryptionForm=this.#e.encryptionForm;creatingTemporaryBackup=p(!1);settings=p([]);next(){let i=this.#e.destinationTargetUrl();if(!i)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,t=[];e?t.push({Name:"--passphrase",Value:e}):t.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),t.push({Name:n,Value:o.Value??""}))}),this.#t.postApiV1Backups({requestBody:{Backup:{TargetURL:i,Settings:t}},temporary:!0}).pipe(O(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#e.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-restore-encryption"]],decls:16,vars:3,consts:()=>{let i;i=$localize`Enter backup passphrase if defined.`;let e;e=$localize`Password`;let t;t=$localize`Advanced options`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let n;return n=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `,[e,t,o,n,[3,"submit","formGroup"],["for","password"],["type","password","id","password","placeholder",i,"formControlName","passphrase"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){e&1&&(r(0,"form",4),C("submit",function(){return t.next()}),r(1,"sh-form-field")(2,"label",5),E(3,0),l(),c(4,"input",6),l(),r(5,"sh-toggle-card"),$(6,7),E(7,1),D(),r(8,"app-options-list",8),ie("optionsChange",function(n){return te(t.settings,n)||(t.settings=n),n}),l()(),r(9,"div",9)(10,"button",10),C("click",function(){return t.back()}),S(11,2),c(12,"sh-icon"),g(),l(),r(13,"button",11),S(14,3),c(15,"sh-icon"),g(),l()()()),e&2&&(T("formGroup",t.encryptionForm),d(8),ee("options",t.settings),T("hasFreeTextSettings",!0))},dependencies:[z,B,G,k,w,x,V,we,J,X,We,Ue],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var et=()=>({standalone:!0});function tt(a,i){a&1&&c(0,"sh-progress-bar",8)}function it(a,i){if(a&1&&(K(0),ae(1,"bytes")),a&2){let e=v().$implicit;Le(" (",$e(1,1,e.FileSizes),") ")}}function ot(a,i){a&1&&(r(0,"span",16),E(1,4),l())}function nt(a,i){if(a&1&&(r(0,"div",15),K(1),ae(2,"date"),y(3,it,2,3),y(4,ot,2,0,"span",16),l()),a&2){let e=i.$implicit;d(),Me(" ",e.Version,": ",De(2,4,e.Time,"medium")," "),d(2),b(e.FileSizes?3:-1),d(),b(e.IsFullBackup===!1?4:-1)}}function st(a,i){a&1&&c(0,"sh-progress-bar",8)}function rt(a,i){if(a&1&&(r(0,"app-file-tree",14)(1,"label",17),E(2,5),l(),c(3,"input",18),l()),a&2){let e=v(2);T("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function at(a,i){if(a&1){let e=q();r(0,"sh-select",12),C("cleared",function(){N(e);let o=v();return f(o.abortLoading())}),r(1,"input",13),ie("ngModelChange",function(o){N(e);let n=v();return te(n.selectOption,o)||(n.selectOption=o),f(o)}),l(),he(2,nt,5,7,"ng-template"),l(),y(3,st,1,0,"sh-progress-bar",8),y(4,rt,4,5,"app-file-tree",14)}if(a&2){let e=v();T("options",e.versionOptions())("isClearable",!1),d(),ee("ngModel",e.selectOption),T("ngModelOptions",be(6,et)),d(2),b(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),b(e.showFileTree()?4:-1)}}var ue=new W,Qe=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class a{#t=_(Y);#e=_(P);#n=_(Xe);#o=_(U);#i=_(R);#s=_(h);#l=_(oe);#a=null;#_=null;#r=p([]);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;selectOption=this.#e.selectOption;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;isFileRestore=this.#e.isFileRestore;needsDatabaseRepair=le(()=>this.#e.backup()?.Backup?.IsTemporary??!0);showFileTree=p(!1);backupSettings=p(null);rootPaths=p([]);initialNodes=p([]);loadingRootPath=p(!1);isRepairing=le(()=>this.#r().length>0);loadedVersions=p({});loadingEffect=A(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let t=e[0].Version;this.selectOption.set(t.toString())}});backupSettingsEffect=A(()=>{let i=this.backupId(),e=this.selectOption(),t=this.isRepairing(),o=this.loadedVersions();if(!e||!i)return;let s=this.versionOptions()?.find(Q=>Q.Version===parseInt(e))?.Time??null;if(!s)return;let u=`${i}+${s}`,F=o[u];if(this.needsDatabaseRepair()&&(!F||t))return;let I={id:i+"",time:s};this.backupSettings.set(I),this.getRootPath(I)});repairEffect=A(()=>{if(!this.needsDatabaseRepair())return;let i=this.selectOption(),e=this.versionOptions();if(i){let t=e.find(s=>s.Version===parseInt(i));if(t===void 0)return;let o=this.backupId(),n=`${o}+${t.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(s=>[...s,n]),this.#t.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:t.Time}}).pipe(Z(this.abortLoading$),O(()=>{this.#_=null})).subscribe(s=>{let u=s.ID;this.#n.waitForTaskToComplete(u).pipe(j(1)).subscribe(()=>{this.#r.update(F=>F.filter(I=>I!==n)),this.loadedVersions.update(F=>(F[n]=!0,F))})})}});getRootPath(i){let e={id:i.id+"",time:i.time,prefixOnly:!0,folderContents:!1},t=i.id+"";this.isRepairing()||this.#a===t||(this.#a=t,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#t.postApiV2BackupListFolder({requestBody:{BackupId:i.id,Time:i.time,Paths:null,PageSize:0,Page:0}}).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#a=null})).subscribe({next:o=>{let n=(o.Data??[]).map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#t.getApiV1BackupByIdFiles(e).pipe(Z(this.abortLoading$),O(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(s=>s.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ee;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let i=this.versionOptions();return e=>{if(!e)return"";let t=i?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return t?`${t.Version}: ${this.#l.transform(t.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#e.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#e.exit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-select-files"]],features:[ye([oe])],decls:13,vars:3,consts:()=>{let i;i=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let t;t=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let s;return s=$localize`Path`,[["formRef",""],i,e,t,n,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles"],[1,"custom-option"],[1,"partial"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",6,0),C("submit",function(){return N(o),f(t.next())}),r(2,"h3",7),E(3,1),l(),y(4,tt,1,0,"sh-progress-bar",8)(5,at,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return N(o),f(t.back())}),S(8,2),c(9,"sh-icon"),g(),l(),r(10,"button",11),S(11,3),c(12,"sh-icon"),g(),l()()()}e&2&&(T("formGroup",t.selectFilesForm),d(4),b(t.versionOptionsLoading()?4:5),d(5),Re(t.isFileRestore()?"Back":"Exit"),Pe(8))},dependencies:[ke,B,G,k,w,Ae,z,x,V,se,X,J,Ve,Be,oe,Je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var P=class a{#t=_(R);#e=_(h);#n=_(U);#o=_(ne);#i=_(Y);backupId=p(null);backup=p(null);destinationTargetUrl=p(null);selectFilesForm=Qe();optionsForm=Ze();encryptionForm=Ke();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=p(null);versionOptionsLoading=p(!1);versionOptions=p([]);isSubmitting=p(!1);isFileRestore=p(!1);isFullWidthPage=p(!1);#s=p("");#l=p(null);#a=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#l.asReadonly();#_=A(()=>{let i=this.destinationTargetUrl(),e=this.#s(),t=this.#a;this.#a=i,!(e==="testing"||t===null||t===i)&&(this.#s.set(""),this.#l.set(null))});init(i,e=!1){this.backupId.set(i),this.isFileRestore.set(e),e&&this.#t.navigate(["/restore-from-files/destination"]),e||this.getBackup()}setTestState(i,e){this.#s.set(i),this.#l.set(e??null)}updateTargetUrl(i){this.destinationTargetUrl.set(i)}submit(){this.isSubmitting.set(!0);let i=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:t=>{this.#r(t.ID??"")},error:t=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${t.message}`)}):this.#r(i??"")}showErrorDialog(i){this.#o.open(L,{data:{title:$localize`Error occured`,message:i,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#r(i){let e=this.optionsForm.value,t=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(s=>s.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:i??"",requestBody:{paths:t.filesToRestore?.split("\0").map(s=>s.endsWith("/")||s.endsWith("\\")?`${s}*`:s)??[],passphrase:t.passphrase??null,time:n?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(O(()=>this.isSubmitting.set(!1))).subscribe({next:s=>{this.#t.navigate([`./${s.ID}`,"progress"],{relativeTo:this.#e})},error:s=>{console.error("restore error",s)}})}exit(){this.#o.open(L,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:i=>{i&&(this.#p(),this.#t.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(i,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:i}}).pipe(Oe(t=>{let o=t?.error?.body?.StatusCode??t?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?me(()=>t):Fe(1e3).pipe(Ne(()=>this.loadFilesetsWithRetryv2(i,e-1)))}))}getBackup(){let i=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?re([this.#i.getApiV1BackupById({id:i}),this.loadFilesetsWithRetryv2(i)]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{if(t.Error)throw new Error(t.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(L,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#t.navigate(["/backup",i,"database"])}});return}this.versionOptions.set((t.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let t=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=t==="EncryptedStorageNoPassphrase",n=t==="FolderMissing",s=t==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),s&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(L,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:F=>{this.#t.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):re([this.#i.getApiV1BackupById({id:i}),this.#i.getApiV1BackupByIdFilesets({id:i}).pipe(Ce(3))]).pipe(j(1),O(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,t])=>{this.versionOptions.set(t.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#p(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||a)};static \u0275prov=fe({token:a,factory:a.\u0275fac,providedIn:"root"})};var H=new W,Ze=()=>H.group({restoreFrom:H.control("original"),restoreFromPath:H.control(""),handleExisting:H.control("saveTimestamp"),permissions:H.control(!1),includeMetadata:H.control(!0)}),Se=class a{#t=_(P);#e=_(R);#n=_(h);#o=_(U);#i=_(ne);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let i=this.#t.selectFilesFormSignal()?.filesToRestore??[];if(i.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(i[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(L,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#t.submit()}});return}this.#t.submit()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=M({type:a,selectors:[["app-advanced-options-settings"]],decls:42,vars:7,consts:()=>{let i;i=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let t;t=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let o;o=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let n;n=$localize`How do you want to handle existing files?`;let s;s=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let F;F=$localize`Metadata settings`;let I;I=$localize` Restore file metadata ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Restore read/write permissions ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let Te;return Te=$localize`${"\uFFFD#41\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#41\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `,[["formRef",""],i,e,t,o,n,s,u,F,I,Q,ge,Te,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"]]},template:function(e,t){if(e&1){let o=q();r(0,"form",13,0),C("submit",function(){return N(o),f(t.submit())}),r(2,"h3",14),E(3,1),l(),r(4,"app-toggle-card",15),$(5,16),E(6,2),D(),r(7,"sh-radio",17),S(8,3),c(9,"input",18),g(),l(),r(10,"sh-radio",17),S(11,4),c(12,"input",19),g(),l(),r(13,"app-file-tree",20)(14,"label",21),K(15,"Path"),l(),c(16,"input",22),l()(),r(17,"app-toggle-card",15),$(18,16),E(19,5),D(),r(20,"sh-radio",17),S(21,6),c(22,"input",23),g(),l(),r(23,"sh-radio",17),S(24,7),c(25,"input",24),g(),l()(),r(26,"app-toggle-card"),$(27,16),E(28,8),D(),r(29,"sh-toggle",25),S(30,9),c(31,"input",26),g(),l(),r(32,"sh-toggle",25),S(33,10),c(34,"input",27),g(),l()(),r(35,"div",28)(36,"button",29),C("click",function(){return N(o),f(t.goBack())}),S(37,11),c(38,"sh-icon"),g(),l(),r(39,"button",30),S(40,12),c(41,"sh-icon"),g(),l()()()}if(e&2){let o;T("formGroup",t.optionsForm),d(4),T("disallowToggle",!0),d(9),T("disabled",((o=t.optionsFormSignal())==null?null:o.restoreFrom)!=="pickLocation")("enableCreateFolder",!0),d(4),T("disallowToggle",!0),d(22),Ie("loader",t.isSubmitting())}},dependencies:[z,B,G,ve,Ge,k,w,x,V,Ye,se,ze,xe,X,J],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{Ze as a,Se as b,Ke as c,pe as d,Qe as e,de as f,P as g};
@@ -1 +1 @@
1
- import{a as Ge,b as we,c as Ue}from"./chunk-N6SGM2XM.js";import"./chunk-OLOFMEQN.js";import{a as Le}from"./chunk-4BGVLUYV.js";import{j as xe}from"./chunk-ZOO7P75U.js";import"./chunk-GS5QK7LF.js";import"./chunk-VKR5DJQG.js";import"./chunk-BTVYI2KD.js";import"./chunk-6Q6SSTBK.js";import"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import{a as $}from"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-KBGIIJMM.js";import{B as k,C as ye,H as v,K as Re,c as G,e as w,f as he,g as Oe,i as U,j as fe,r as Ae,s as b,u as B,w as Pe,y as Me,z as $e}from"./chunk-LFRGO2IP.js";import{b as Ee,d as De}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as c,Ab as ce,Bb as _e,Bc as Fe,Cb as N,Db as s,Eb as r,Fb as _,Jb as Te,Kb as de,Mb as m,Oa as re,Ra as l,Rc as L,Tb as g,Ub as u,Vb as D,Wb as z,Wc as me,Xb as J,Xc as Ne,Yb as ge,Yc as Ie,Zb as p,_ as I,ac as ue,bb as O,bc as Ce,da as T,ea as d,gc as pe,hc as Se,ia as se,nc as f,oa as h,oc as X,sc as A,tc as P,uc as M,vc as H,wb as S,wc as j,xb as F,xc as x,yb as le,yc as W}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var ke=["*"],y=class n{destination=Ne.required();static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:ke,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(e,o){if(e&1&&(ue(),s(0,"sh-card",0)(1,"div",1),_(2,"img",2),r(),s(3,"div",3),f(4),r(),s(5,"div",4),f(6),r(),s(7,"div",5),Ce(8),r()()),e&2){let t=o.destination();l(2),N("src",W(t.icon),re)("alt",W(t.displayName)),l(2),X(t.displayName),l(2),X(t.description)}},dependencies:[ye],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function Ke(n,i){if(n&1){let e=m();s(0,"app-destination-list-item",3)(1,"button",4),p("click",function(){let t=T(e).$implicit,a=c();return d(a.setDestination.emit(t.key))}),g(2,0),_(3,"sh-icon"),u(),r()()}if(n&2){let e=i.$implicit;N("destination",e)}}var K=class n{#i=I(we);setDestination=me();destinationSearchTerm=h("");destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let i=this.destinationTypeOptions(),e=this.destinationSearchTerm().toLowerCase(),o=[...i].sort((t,a)=>{let E=t.sortOrder??0,R=a.sortOrder??0;return E!==R?R-E:t.displayName.localeCompare(a.displayName)}).filter(t=>(t.sortOrder??0)>=0);return e?o.filter(t=>t.searchTerms.toLowerCase().includes(e)):o});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let i;i=$localize`Search for destination...`;let e;return e=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[e,["type","text","placeholder",i,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(e,o){e&1&&(s(0,"sh-form-field")(1,"input",1),M("ngModelChange",function(a){return P(o.destinationSearchTerm,a)||(o.destinationSearchTerm=a),a}),r()(),s(2,"div",2),ce(3,Ke,4,1,"app-destination-list-item",3,le),r()),e&2&&(l(),A("ngModel",o.destinationSearchTerm),l(2),_e(o.destinationTypeOptionsFocused()))},dependencies:[y,b,G,w,U,v,k,B],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Ve=["formRef"],ze=()=>({maxWidth:"700px",width:"100%"});function Je(n,i){n&1&&D(0,4,1)}function Xe(n,i){n&1&&D(0,4,2)}function He(n,i){if(n&1){let e=m();s(0,"button",35),p("click",function(){T(e);let t=c();return d(t.testDestination(0,!0))}),g(1,4),S(2,Je,1,0)(3,Xe,1,0),u(),r()}if(n&2){let e=c();N("disabled",e.testSignal()=="testing"),l(2),F(e.testSignal()=="testing"?2:3)}}function je(n,i){if(n&1){let e=m();s(0,"button",36),p("click",function(){T(e);let t=c();return d(t.openTargetUrlDialog())}),g(1,5),_(2,"sh-icon"),u(),r()}}function We(n,i){if(n&1){let e=m();s(0,"button",36),p("click",function(){T(e);let t=c(2);return d(t.copyTargetUrl())}),g(1,7),_(2,"sh-icon"),u(),r()}}function qe(n,i){if(n&1){let e=m();s(0,"sh-menu")(1,"button",24)(2,"sh-icon"),f(3,"dots-three-vertical"),r()(),Te(4,37),s(5,"button",36),p("click",function(){T(e);let t=c();return d(t.openTargetUrlDialog())}),g(6,6),_(7,"sh-icon"),u(),r(),S(8,We,3,0,"button",24),de(),r()}if(n&2){c();let e=x(0);l(8),F(e?8:-1)}}function Qe(n,i){n&1&&(s(0,"sh-alert"),g(1,8),_(2,"sh-icon",38),u(),r())}function Ye(n,i){n&1&&(s(0,"sh-alert",25),g(1,9),_(2,"sh-icon",38),u(),r())}function Ze(n,i){if(n&1&&(s(0,"sh-alert",26),g(1,10),_(2,"sh-icon",38),u(),r()),n&2){let e=c();l(2),z(e.testErrorMessage()),J(1)}}function et(n,i){if(n&1&&(s(0,"sh-alert",27),g(1,11),_(2,"sh-icon",38),u(),r()),n&2){let e=c();l(2),z(e.testErrorMessage()),J(1)}}function tt(n,i){if(n&1){let e=m();s(0,"app-destination-list-item",28)(1,"button",31),p("click",function(){T(e);let t=c();return d(t.removeDestination())}),D(2,12),r()()}if(n&2){c();let e=x(18);N("destination",e)}}function nt(n,i){if(n&1){let e=m();s(0,"app-destination-list",39),p("setDestination",function(t){T(e);let a=c();return d(a.setDestination(t))}),r()}}function it(n,i){if(n&1){let e=m();s(0,"app-single-destination",40),M("targetUrlChange",function(t){T(e);let a=c();return P(a.targetUrlModel,t)||(a.targetUrlModel=t),d(t)}),r()}if(n&2){let e=c();A("targetUrl",e.targetUrlModel),N("useBackupState",!0)}}function ot(n,i){n&1&&(g(0,3,1),_(1,"sh-icon",33),u())}function at(n,i){n&1&&(g(0,3,2),_(1,"sh-icon"),u())}function st(n,i){n&1&&(s(0,"h2"),D(1,15),r())}function rt(n,i){n&1&&(s(0,"h2"),D(1,16),r())}function lt(n,i){if(n&1){let e=m();s(0,"sh-dialog",41),M("isOpenChange",function(t){T(e);let a=c();return P(a.targetUrlDialogOpen,t)||(a.targetUrlDialogOpen=t),d(t)}),s(1,"header",42)(2,"div",43),S(3,st,2,0,"h2")(4,rt,2,0,"h2"),s(5,"sh-alert",26),D(6,13),r()()(),s(7,"div",44)(8,"sh-form-field")(9,"textarea",45),M("ngModelChange",function(t){T(e);let a=c();return P(a.targetUrlCtrl,t)||(a.targetUrlCtrl=t),d(t)}),r()()(),s(10,"footer",46)(11,"button",31),p("click",function(){T(e);let t=c();return d(t.closeTargetUrlDialog(!1))}),f(12,"Cancel"),r(),s(13,"button",47),p("click",function(){T(e);let t=c();return d(t.closeTargetUrlDialog(!0))}),g(14,14),_(15,"sh-icon"),u(),r()()()}if(n&2){let e=c(),o=x(0);A("isOpen",e.targetUrlDialogOpen),N("options",Fe(4,ze)),l(3),F(o?4:3),l(6),A("ngModel",e.targetUrlCtrl)}}var V=new Ae,Ut=(n={destinations:[]})=>V.group({destinations:V.array(n.destinations)}),bt=({key:n,customGroup:i,dynamicGroup:e,advancedGroup:o})=>V.group({destinationType:V.control(n),custom:i,dynamic:e,advanced:o}),q=class n{#i=I(De);#o=I(Ee);#e=I(xe);#t=I($e);#a=I(Ge);injector=I(se);formRef=Ie.required("formRef");targetUrlModel=this.#e.targetUrlModel;targetUrlCtrl=h(null);targetUrlInitial=h(null);targetUrlDialogOpen=h(!1);toggleNewDestination=h(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;selectedDestinationType=L(()=>{let i=this.targetUrlModel();if(!i)return null;let e=i.split("://")[0];return Le(e)??null});selectedDestinationTypeOption=L(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let i=this.targetUrlModel();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),o=this.targetUrlInitial();!i||e===o||!e||this.#e.setTargetUrl(e)}testDestination(i,e,o){let t=this.targetUrlModel();t&&(this.#e.setTestState("testing"),this.#a.testDestination(t,this.#e.backupId(),i,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),this.#e.isNew()&&(a.containsBackup===!0?(this.#e.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),e||this.#t.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#e.setTestState("warning",$localize`The remote destination contains unknown files.`),e||this.#t.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),o?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let E=t.includes("?");a.action==="trust-cert"&&this.#e.setTargetUrl(t+`${E?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.setTargetUrl(t+`${E?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):o?.()}}))}setDestination(i){this.#e.setTargetUrl(`${i}://`,!0)}removeDestination(){this.#e.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.#e.isNew(),e=this.testSignal();if(!i){this.#n();return}if(e===""){this.#t.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:o=>{o?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(e!=="success"){this.#t.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:o=>{o&&this.#n()}});return}this.#n()}#n(){this.#e.isNew()||this.#e.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-destination"]],viewQuery:function(e,o){e&1&&pe(o.formRef,Ve,5),e&2&&Se()},decls:31,vars:11,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*28:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*29:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*29:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=ge(o);let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Testing... ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let E;E=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let R;R=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let Q;Q=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let Y;Y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let Z;Z=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let ee;ee=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let te;te=$localize`Change`;let ne;ne=$localize`Be careful, this will overwrite everything you have in your destination.`;let ie;ie=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let oe;oe=$localize`Set target URL`;let ae;return ae=$localize`Edit target URL`,[["formRef",""],i,e,o,t,a,E,R,Q,Y,Z,ee,te,ne,ie,oe,ae,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,o){if(e&1){let t=m();H(0),s(1,"form",17,0),p("submit",function(){return T(t),d(o.next())}),s(3,"div",18),_(4,"input",19)(5,"input",20),r(),s(6,"header")(7,"h3",21)(8,"span"),D(9,1),r(),s(10,"div",22),S(11,He,4,2,"button",23),S(12,je,3,0,"button",24)(13,qe,9,1,"sh-menu"),r()(),S(14,Qe,3,0,"sh-alert")(15,Ye,3,0,"sh-alert",25)(16,Ze,3,1,"sh-alert",26)(17,et,3,1,"sh-alert",27),H(18),S(19,tt,3,1,"app-destination-list-item",28),r(),S(20,nt,1,0,"app-destination-list"),S(21,it,1,2,"app-single-destination",29),s(22,"div",30)(23,"button",31),p("click",function(){return T(t),d(o.goBack())}),g(24,2),_(25,"sh-icon"),u(),r(),s(26,"button",32),g(27,3),S(28,ot,2,0,"sh-icon",33)(29,at,2,0,"sh-icon"),u(),r()()(),S(30,lt,16,5,"sh-dialog",34)}if(e&2){let t=j(!!o.targetUrlModel());l(11),F(t?11:-1),l(),F(t?13:12),l(2),F(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),l(4);let a=j(o.selectedDestinationTypeOption());l(),F(a?19:-1),l(),F(t?-1:20),l(),F(t?21:-1),l(5),N("disabled",o.testSignal()=="testing"||!t),l(2),F(o.testSignal()=="testing"?28:29),l(2),F(o.targetUrlDialogOpen()?30:-1)}},dependencies:[Ue,K,y,b,fe,G,w,he,U,Oe,k,v,Re,B,Me,Pe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{Ut as createDestinationForm,bt as createDestinationFormGroup,q as default};
1
+ import{a as Ge,b as we,c as Ue}from"./chunk-JVBEGJUJ.js";import"./chunk-OLOFMEQN.js";import{a as Le}from"./chunk-4BGVLUYV.js";import{j as xe}from"./chunk-SIXGJYNI.js";import"./chunk-GS5QK7LF.js";import"./chunk-FUE2VIJ7.js";import"./chunk-BTVYI2KD.js";import"./chunk-6Q6SSTBK.js";import"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import{a as $}from"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-KBGIIJMM.js";import{B as k,C as ye,H as v,K as Re,c as G,e as w,f as he,g as Oe,i as U,j as fe,r as Ae,s as b,u as B,w as Pe,y as Me,z as $e}from"./chunk-LFRGO2IP.js";import{b as Ee,d as De}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as c,Ab as ce,Bb as _e,Bc as Fe,Cb as N,Db as s,Eb as r,Fb as _,Jb as Te,Kb as de,Mb as m,Oa as re,Ra as l,Rc as L,Tb as g,Ub as u,Vb as D,Wb as z,Wc as me,Xb as J,Xc as Ne,Yb as ge,Yc as Ie,Zb as p,_ as I,ac as ue,bb as O,bc as Ce,da as T,ea as d,gc as pe,hc as Se,ia as se,nc as f,oa as h,oc as X,sc as A,tc as P,uc as M,vc as H,wb as S,wc as j,xb as F,xc as x,yb as le,yc as W}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var ke=["*"],y=class n{destination=Ne.required();static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:ke,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(e,o){if(e&1&&(ue(),s(0,"sh-card",0)(1,"div",1),_(2,"img",2),r(),s(3,"div",3),f(4),r(),s(5,"div",4),f(6),r(),s(7,"div",5),Ce(8),r()()),e&2){let t=o.destination();l(2),N("src",W(t.icon),re)("alt",W(t.displayName)),l(2),X(t.displayName),l(2),X(t.description)}},dependencies:[ye],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function Ke(n,i){if(n&1){let e=m();s(0,"app-destination-list-item",3)(1,"button",4),p("click",function(){let t=T(e).$implicit,a=c();return d(a.setDestination.emit(t.key))}),g(2,0),_(3,"sh-icon"),u(),r()()}if(n&2){let e=i.$implicit;N("destination",e)}}var K=class n{#i=I(we);setDestination=me();destinationSearchTerm=h("");destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=L(()=>{let i=this.destinationTypeOptions(),e=this.destinationSearchTerm().toLowerCase(),o=[...i].sort((t,a)=>{let E=t.sortOrder??0,R=a.sortOrder??0;return E!==R?R-E:t.displayName.localeCompare(a.displayName)}).filter(t=>(t.sortOrder??0)>=0);return e?o.filter(t=>t.searchTerms.toLowerCase().includes(e)):o});static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let i;i=$localize`Search for destination...`;let e;return e=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[e,["type","text","placeholder",i,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(e,o){e&1&&(s(0,"sh-form-field")(1,"input",1),M("ngModelChange",function(a){return P(o.destinationSearchTerm,a)||(o.destinationSearchTerm=a),a}),r()(),s(2,"div",2),ce(3,Ke,4,1,"app-destination-list-item",3,le),r()),e&2&&(l(),A("ngModel",o.destinationSearchTerm),l(2),_e(o.destinationTypeOptionsFocused()))},dependencies:[y,b,G,w,U,v,k,B],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var Ve=["formRef"],ze=()=>({maxWidth:"700px",width:"100%"});function Je(n,i){n&1&&D(0,4,1)}function Xe(n,i){n&1&&D(0,4,2)}function He(n,i){if(n&1){let e=m();s(0,"button",35),p("click",function(){T(e);let t=c();return d(t.testDestination(0,!0))}),g(1,4),S(2,Je,1,0)(3,Xe,1,0),u(),r()}if(n&2){let e=c();N("disabled",e.testSignal()=="testing"),l(2),F(e.testSignal()=="testing"?2:3)}}function je(n,i){if(n&1){let e=m();s(0,"button",36),p("click",function(){T(e);let t=c();return d(t.openTargetUrlDialog())}),g(1,5),_(2,"sh-icon"),u(),r()}}function We(n,i){if(n&1){let e=m();s(0,"button",36),p("click",function(){T(e);let t=c(2);return d(t.copyTargetUrl())}),g(1,7),_(2,"sh-icon"),u(),r()}}function qe(n,i){if(n&1){let e=m();s(0,"sh-menu")(1,"button",24)(2,"sh-icon"),f(3,"dots-three-vertical"),r()(),Te(4,37),s(5,"button",36),p("click",function(){T(e);let t=c();return d(t.openTargetUrlDialog())}),g(6,6),_(7,"sh-icon"),u(),r(),S(8,We,3,0,"button",24),de(),r()}if(n&2){c();let e=x(0);l(8),F(e?8:-1)}}function Qe(n,i){n&1&&(s(0,"sh-alert"),g(1,8),_(2,"sh-icon",38),u(),r())}function Ye(n,i){n&1&&(s(0,"sh-alert",25),g(1,9),_(2,"sh-icon",38),u(),r())}function Ze(n,i){if(n&1&&(s(0,"sh-alert",26),g(1,10),_(2,"sh-icon",38),u(),r()),n&2){let e=c();l(2),z(e.testErrorMessage()),J(1)}}function et(n,i){if(n&1&&(s(0,"sh-alert",27),g(1,11),_(2,"sh-icon",38),u(),r()),n&2){let e=c();l(2),z(e.testErrorMessage()),J(1)}}function tt(n,i){if(n&1){let e=m();s(0,"app-destination-list-item",28)(1,"button",31),p("click",function(){T(e);let t=c();return d(t.removeDestination())}),D(2,12),r()()}if(n&2){c();let e=x(18);N("destination",e)}}function nt(n,i){if(n&1){let e=m();s(0,"app-destination-list",39),p("setDestination",function(t){T(e);let a=c();return d(a.setDestination(t))}),r()}}function it(n,i){if(n&1){let e=m();s(0,"app-single-destination",40),M("targetUrlChange",function(t){T(e);let a=c();return P(a.targetUrlModel,t)||(a.targetUrlModel=t),d(t)}),r()}if(n&2){let e=c();A("targetUrl",e.targetUrlModel),N("useBackupState",!0)}}function ot(n,i){n&1&&(g(0,3,1),_(1,"sh-icon",33),u())}function at(n,i){n&1&&(g(0,3,2),_(1,"sh-icon"),u())}function st(n,i){n&1&&(s(0,"h2"),D(1,15),r())}function rt(n,i){n&1&&(s(0,"h2"),D(1,16),r())}function lt(n,i){if(n&1){let e=m();s(0,"sh-dialog",41),M("isOpenChange",function(t){T(e);let a=c();return P(a.targetUrlDialogOpen,t)||(a.targetUrlDialogOpen=t),d(t)}),s(1,"header",42)(2,"div",43),S(3,st,2,0,"h2")(4,rt,2,0,"h2"),s(5,"sh-alert",26),D(6,13),r()()(),s(7,"div",44)(8,"sh-form-field")(9,"textarea",45),M("ngModelChange",function(t){T(e);let a=c();return P(a.targetUrlCtrl,t)||(a.targetUrlCtrl=t),d(t)}),r()()(),s(10,"footer",46)(11,"button",31),p("click",function(){T(e);let t=c();return d(t.closeTargetUrlDialog(!1))}),f(12,"Cancel"),r(),s(13,"button",47),p("click",function(){T(e);let t=c();return d(t.closeTargetUrlDialog(!0))}),g(14,14),_(15,"sh-icon"),u(),r()()()}if(n&2){let e=c(),o=x(0);A("isOpen",e.targetUrlDialogOpen),N("options",Fe(4,ze)),l(3),F(o?4:3),l(6),A("ngModel",e.targetUrlCtrl)}}var V=new Ae,Ut=(n={destinations:[]})=>V.group({destinations:V.array(n.destinations)}),bt=({key:n,customGroup:i,dynamicGroup:e,advancedGroup:o})=>V.group({destinationType:V.control(n),custom:i,dynamic:e,advanced:o}),q=class n{#i=I(De);#o=I(Ee);#e=I(xe);#t=I($e);#a=I(Ge);injector=I(se);formRef=Ie.required("formRef");targetUrlModel=this.#e.targetUrlModel;targetUrlCtrl=h(null);targetUrlInitial=h(null);targetUrlDialogOpen=h(!1);toggleNewDestination=h(!0);testSignal=this.#e.testSignal;testErrorMessage=this.#e.testErrorMessage;selectedDestinationType=L(()=>{let i=this.targetUrlModel();if(!i)return null;let e=i.split("://")[0];return Le(e)??null});selectedDestinationTypeOption=L(()=>{let i=this.selectedDestinationType();return i?{key:i.customKey??i.key,customKey:i.customKey??null,displayName:i.displayName,description:i.description,icon:i.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let i=this.targetUrlModel();this.targetUrlCtrl.set(i),this.targetUrlInitial.set(i),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl(),o=this.targetUrlInitial();!i||e===o||!e||this.#e.setTargetUrl(e)}testDestination(i,e,o){let t=this.targetUrlModel();t&&(this.#e.setTestState("testing"),this.#a.testDestination(t,this.#e.backupId(),i,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#e.setTestState("success"),this.#e.isNew()&&(a.containsBackup===!0?(this.#e.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),e||this.#t.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#e.setTestState("warning",$localize`The remote destination contains unknown files.`),e||this.#t.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),o?.();return}if(this.#e.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let E=t.includes("?");a.action==="trust-cert"&&this.#e.setTargetUrl(t+`${E?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#e.setTargetUrl(t+`${E?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,e):o?.()}}))}setDestination(i){this.#e.setTargetUrl(`${i}://`,!0)}removeDestination(){this.#e.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let i=this.#e.isNew(),e=this.testSignal();if(!i){this.#n();return}if(e===""){this.#t.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:o=>{o?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#t.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(e!=="success"){this.#t.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:o=>{o&&this.#n()}});return}this.#n()}#n(){this.#e.isNew()||this.#e.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-destination"]],viewQuery:function(e,o){e&1&&pe(o.formRef,Ve,5),e&2&&Se()},decls:31,vars:11,consts:()=>{let i;i=$localize`Backup destination`;let e;e=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*28:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*29:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*29:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=ge(o);let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Testing... ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Set target URL `;let E;E=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Edit target URL `;let R;R=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:copy${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard `;let Q;Q=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let Y;Y=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let Z;Z=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let ee;ee=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let te;te=$localize`Change`;let ne;ne=$localize`Be careful, this will overwrite everything you have in your destination.`;let ie;ie=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`;let oe;oe=$localize`Set target URL`;let ae;return ae=$localize`Edit target URL`,[["formRef",""],i,e,o,t,a,E,R,Q,Y,Z,ee,te,ne,ie,oe,ae,["autocomplete","off",3,"submit"],[2,"position","absolute","left","-9999px","width","1px","height","1px","overflow","hidden"],["type","text","name","fake_email","tabindex","-1"],["type","password","name","fake_password","tabindex","-1"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,o){if(e&1){let t=m();H(0),s(1,"form",17,0),p("submit",function(){return T(t),d(o.next())}),s(3,"div",18),_(4,"input",19)(5,"input",20),r(),s(6,"header")(7,"h3",21)(8,"span"),D(9,1),r(),s(10,"div",22),S(11,He,4,2,"button",23),S(12,je,3,0,"button",24)(13,qe,9,1,"sh-menu"),r()(),S(14,Qe,3,0,"sh-alert")(15,Ye,3,0,"sh-alert",25)(16,Ze,3,1,"sh-alert",26)(17,et,3,1,"sh-alert",27),H(18),S(19,tt,3,1,"app-destination-list-item",28),r(),S(20,nt,1,0,"app-destination-list"),S(21,it,1,2,"app-single-destination",29),s(22,"div",30)(23,"button",31),p("click",function(){return T(t),d(o.goBack())}),g(24,2),_(25,"sh-icon"),u(),r(),s(26,"button",32),g(27,3),S(28,ot,2,0,"sh-icon",33)(29,at,2,0,"sh-icon"),u(),r()()(),S(30,lt,16,5,"sh-dialog",34)}if(e&2){let t=j(!!o.targetUrlModel());l(11),F(t?11:-1),l(),F(t?13:12),l(2),F(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),l(4);let a=j(o.selectedDestinationTypeOption());l(),F(a?19:-1),l(),F(t?-1:20),l(),F(t?21:-1),l(5),N("disabled",o.testSignal()=="testing"||!t),l(2),F(o.testSignal()=="testing"?28:29),l(2),F(o.targetUrlDialogOpen()?30:-1)}},dependencies:[Ue,K,y,b,fe,G,w,he,U,Oe,k,v,Re,B,Me,Pe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{Ut as createDestinationForm,bt as createDestinationFormGroup,q as default};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-3L2HST7Q.js";import"./chunk-W2UO5LKI.js";import"./chunk-OLOFMEQN.js";import"./chunk-4BGVLUYV.js";import"./chunk-GS5QK7LF.js";import"./chunk-VKR5DJQG.js";import"./chunk-PJAWWLYW.js";import"./chunk-RECKKS2S.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-TJ3WIU6Q.js";import"./chunk-KBGIIJMM.js";import"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreOptionsForm,b as default};
1
+ import{a,b}from"./chunk-2B562XFN.js";import"./chunk-C7RFWM7I.js";import"./chunk-OLOFMEQN.js";import"./chunk-4BGVLUYV.js";import"./chunk-GS5QK7LF.js";import"./chunk-FUE2VIJ7.js";import"./chunk-PJAWWLYW.js";import"./chunk-RECKKS2S.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-TJ3WIU6Q.js";import"./chunk-KBGIIJMM.js";import"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreOptionsForm,b as default};
@@ -1 +1 @@
1
- import{a as v}from"./chunk-XDECUOQ5.js";import{j as C}from"./chunk-ZOO7P75U.js";import"./chunk-GS5QK7LF.js";import"./chunk-VKR5DJQG.js";import"./chunk-BTVYI2KD.js";import"./chunk-DU5QSRYH.js";import"./chunk-D2DI6ZER.js";import"./chunk-M77IE672.js";import{a as G}from"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import"./chunk-W4QCGFNO.js";import"./chunk-L4GZJLYK.js";import"./chunk-LJQN4G2O.js";import{b as h}from"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import"./chunk-TJ3WIU6Q.js";import{b as L}from"./chunk-KBGIIJMM.js";import{L as M,M as $,R as I}from"./chunk-LFRGO2IP.js";import{b as N,c as O,e as B,f as b}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as D,Ac as E,Cb as d,Db as s,Dc as p,Eb as u,F as f,Fb as r,Ra as n,Sc as k,Tb as c,Ub as _,_ as l,bb as R,nc as A,pc as P,wb as T,xb as g}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=D();n(),P("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=k(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=R({type:a,selectors:[["app-backup"]],features:[E([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),_(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),_(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),_(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),_(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),_(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",p(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
1
+ import{a as v}from"./chunk-XDECUOQ5.js";import{j as C}from"./chunk-SIXGJYNI.js";import"./chunk-GS5QK7LF.js";import"./chunk-FUE2VIJ7.js";import"./chunk-BTVYI2KD.js";import"./chunk-DU5QSRYH.js";import"./chunk-D2DI6ZER.js";import"./chunk-M77IE672.js";import{a as G}from"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import"./chunk-W4QCGFNO.js";import"./chunk-L4GZJLYK.js";import"./chunk-LJQN4G2O.js";import{b as h}from"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import"./chunk-TJ3WIU6Q.js";import{b as L}from"./chunk-KBGIIJMM.js";import{L as M,M as $,R as I}from"./chunk-LFRGO2IP.js";import{b as N,c as O,e as B,f as b}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as D,Ac as E,Cb as d,Db as s,Dc as p,Eb as u,F as f,Fb as r,Ra as n,Sc as k,Tb as c,Ub as _,_ as l,bb as R,nc as A,pc as P,wb as T,xb as g}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=D();n(),P("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=k(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=R({type:a,selectors:[["app-backup"]],features:[E([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),_(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),_(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),_(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),_(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),_(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",p(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",p(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
@@ -1 +1 @@
1
- import{h as a,i as b}from"./chunk-ZOO7P75U.js";import"./chunk-GS5QK7LF.js";import"./chunk-VKR5DJQG.js";import"./chunk-BTVYI2KD.js";import"./chunk-6Q6SSTBK.js";import"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-KBGIIJMM.js";import"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";export{a as createSourceDataForm,b as default};
1
+ import{h as a,i as b}from"./chunk-SIXGJYNI.js";import"./chunk-GS5QK7LF.js";import"./chunk-FUE2VIJ7.js";import"./chunk-BTVYI2KD.js";import"./chunk-6Q6SSTBK.js";import"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-KBGIIJMM.js";import"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";export{a as createSourceDataForm,b as default};
@@ -1,2 +1,2 @@
1
- import{a as ue}from"./chunk-OLOFMEQN.js";import{d as me}from"./chunk-4BGVLUYV.js";import{c as de,d as Ce}from"./chunk-VKR5DJQG.js";import{a as ce}from"./chunk-XE5OMGTJ.js";import{B as oe,H as re,K as ae,P as le,V as _e,W as se,Y as pe,b as W,c as Y,e as Z,i as ee,k as te,s as ne,u as ie}from"./chunk-LFRGO2IP.js";import{ea as Q}from"./chunk-6DB3NZXR.js";import{$b as _,Ab as E,Bb as P,Bc as j,Cb as c,Db as a,Eb as l,Fb as I,Jb as v,Kb as V,Kc as R,Lb as S,Mb as g,Ra as s,Rc as k,Tb as b,Ub as $,Vb as J,Xc as G,Zb as u,_ as K,_c as q,bb as H,da as d,ea as C,gb as f,ic as T,kc as B,nc as m,oa as N,oc as A,pc as D,vc as X,wb as h,wc as z,xb as O,xc as x,yb as M}from"./chunk-FAM42SZT.js";import{a as w,b as L}from"./chunk-EUDKD2JW.js";var ge=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var xe=()=>({updateOn:"blur"});function Se(t,i){if(t&1){let e=g();a(0,"button",13),u("click",function(){d(e);let n=_();return C(n.showTextArea.set(!1))}),b(1,5),I(2,"sh-icon"),$(),l()}}function he(t,i){if(t&1){let e=g();a(0,"button",17,0),u("click",function(){let n=d(e).$implicit,r=_(3);return C(r.addSetting(n))}),a(2,"div",18)(3,"p"),m(4),l(),m(5),l()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),s(4),A(e.shortDescription),s(),D(" ",e.name," ")}}function Oe(t,i){if(t&1&&(a(0,"h3",9),m(1),l(),E(2,he,6,4,"button",16,M)),t&2){let e=i.$implicit;s(),A(e.displayName),s(),P(e.options)}}function Fe(t,i){if(t&1){let e=g();a(0,"sh-menu")(1,"button",19)(2,"sh-icon"),m(3,"dots-three-vertical"),l()(),v(4,15),a(5,"button",13),u("click",function(){d(e);let n=_(2);return C(n.addFreeTextSetting())}),b(6,7),I(7,"sh-icon"),$(),l(),a(8,"button",20),u("click",function(){d(e);let n=_(2);return C(n.showTextArea.set(!0))}),a(9,"sh-icon"),m(10,"link"),l(),m(11," Edit contents as text "),l(),V(),l()}}function we(t,i){if(t&1&&(a(0,"sh-menu",14)(1,"button",11),b(2,6),I(3,"sh-icon"),$(),l(),v(4,15),E(5,Oe,4,1,null,null,M),V(),l(),h(7,Fe,12,0,"sh-menu")),t&2){let e=_();c("searchable",!0),s(5),P(e.nonSelectedOptionsGrouped()),s(2),O(e.hasFreeTextSettings()?7:-1)}}function ye(t,i){if(t&1){let e=g();a(0,"textarea",21),u("ngModelChange",function(n){d(e);let r=_();return C(r.updateSettingsFromText(n))}),l()}if(t&2){let e=_();c("ngModel",e.settingsAsText())("ngModelOptions",j(2,xe))}}function Ie(t,i){t&1&&(a(0,"div",22),m(1,"Add a setting above to get started."),l())}function Ve(t,i){t&1&&(a(0,"sh-icon",30),m(1," warning-octagon "),l())}function Le(t,i){if(t&1&&(a(0,"sh-icon",31),m(1,"archive"),l()),t&2){let e=_(2).$implicit;c("shTooltip",e.FormView.deprecatedDescription)}}function Ne(t,i){if(t&1&&(a(0,"sh-icon",32),m(1,"question"),l()),t&2){let e=_(2).$implicit;c("shTooltip",e.FormView.longDescription)}}function Me(t,i){if(t&1&&(h(0,Ve,2,0,"sh-icon",30),a(1,"span"),m(2),l(),h(3,Le,2,1,"sh-icon",31)(4,Ne,2,1,"sh-icon",32)),t&2){let e=_().$implicit,o=x(1);O(o?0:-1),s(),B("deprecated",e.FormView.deprecatedDescription),s(),A(e.FormView.shortDescription),s(),O(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Ee(t,i){t&1&&S(0)}function Pe(t,i){if(t&1){let e=g();a(0,"div",24)(1,"label"),f(2,Ee,1,0,"ng-container",33),l(),a(3,"div")(4,"sh-form-field")(5,"input",34),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateFreeTextSettingName(r,n))}),l(),a(6,"sh-icon",35),m(7,"rectangle-dashed"),l()()(),a(8,"div")(9,"sh-form-field")(10,"input",34),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l(),a(11,"sh-icon",35),m(12,"textbox"),l()()()()}if(t&2){let e=_().$implicit,o=T(3);s(2),c("ngTemplateOutlet",o),s(3),c("ngModel",e.Name),s(5),c("ngModel",e.Value())}}function ve(t,i){t&1&&S(0)}function be(t,i){if(t&1){let e=g();a(0,"app-file-tree",25)(1,"label",36),f(2,ve,1,0,"ng-container",33),l(),a(3,"input",37),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);c("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function $e(t,i){if(t&1){let e=g();a(0,"app-file-tree",26),I(1,"label",36),a(2,"input",37),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()()}if(t&2){let e=_().$implicit,o=x(0);c("startingPath",e.Value()),s(),c("for",o),s(),c("id",o)("ngModel",e.Value())}}function Ae(t,i){t&1&&S(0)}function De(t,i){t&1&&(a(0,"sh-icon",35),m(1,"link"),l())}function Re(t,i){t&1&&(a(0,"sh-icon",35),m(1,"hard-drives"),l())}function ke(t,i){t&1&&(a(0,"sh-icon",35),m(1,"jar"),l())}function Ge(t,i){t&1&&(a(0,"sh-icon",35),m(1,"envelope"),l())}function Be(t,i){t&1&&(a(0,"sh-icon",35),m(1,"textbox"),l())}function ze(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",36),f(2,Ae,1,0,"ng-container",33),l(),a(3,"input",38),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l(),h(4,De,2,0,"sh-icon",35)(5,Re,2,0,"sh-icon",35)(6,ke,2,0,"sh-icon",35)(7,Ge,2,0,"sh-icon",35)(8,Be,2,0,"sh-icon",35),l()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),s(),O(e.FormView.type==="Path"?4:e.FormView.type==="Hostname"?5:e.FormView.type==="Bucketname"?6:e.FormView.type==="Email"?7:8)}}function Ue(t,i){t&1&&S(0)}function Ke(t,i){if(t&1){let e=g();a(0,"sh-icon",41),u("click",function(){d(e);let n=_(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye "),l()}}function He(t,i){if(t&1){let e=g();a(0,"sh-icon",41),u("click",function(){d(e);let n=_(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye-slash "),l()}}function Je(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",36),f(2,Ue,1,0,"ng-container",33),l(),a(3,"input",39),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l(),a(4,"sh-icon",35),m(5,"password"),l(),h(6,Ke,2,0,"sh-icon",40)(7,He,2,0,"sh-icon",40),l()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),s(3),O(e.showPassword?6:7)}}function Xe(t,i){t&1&&S(0)}function je(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;D(" ",e," ")}}function qe(t,i){if(t&1){let e=g();a(0,"sh-select",42)(1,"label",36),f(2,Xe,1,0,"ng-container",33),l(),a(3,"input",37),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()(),f(4,je,1,1,"ng-template",null,2,R)}if(t&2){let e=T(5),o=_().$implicit,n=T(3),r=x(0);c("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),s(),c("for",r),s(),c("ngTemplateOutlet",n),s(),c("id",r)("ngModel",o.Value())}}function Qe(t,i){t&1&&S(0)}function We(t,i){if(t&1){let e=g();a(0,"app-size",43),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),a(1,"label",36),f(2,Qe,1,0,"ng-container",33),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),s(),c("for",n),s(),c("ngTemplateOutlet",o)}}function Ye(t,i){t&1&&S(0)}function Ze(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",36),f(2,Ye,1,0,"ng-container",33),l(),a(3,"input",44),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l(),a(4,"sh-icon",35),m(5,"numpad"),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function et(t,i){t&1&&S(0)}function tt(t,i){if(t&1){let e=g();a(0,"sh-toggle",28)(1,"label",36),f(2,et,1,0,"ng-container",33),l(),a(3,"input",45),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function nt(t,i){t&1&&S(0)}function it(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;D(" ",e," ")}}function ot(t,i){if(t&1){let e=g();a(0,"sh-select",46)(1,"label",36),f(2,nt,1,0,"ng-container",33),l(),a(3,"input",47),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()(),f(4,it,1,1,"ng-template",null,3,R)}if(t&2){let e=T(5),o=_().$implicit,n=T(3),r=x(0);c("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),s(),c("for",r),s(),c("ngTemplateOutlet",n),s(),c("ngModel",o.Value())}}function rt(t,i){t&1&&S(0)}function at(t,i){if(t&1){let e=g();a(0,"app-timespan",43),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),a(1,"label",36),f(2,rt,1,0,"ng-container",33),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),s(),c("for",n),s(),c("ngTemplateOutlet",o)}}function lt(t,i){if(t&1){let e=g();X(0)(1),f(2,Me,5,5,"ng-template",null,1,R),a(4,"div",23),h(5,Pe,13,3,"div",24)(6,be,4,9,"app-file-tree",25)(7,$e,3,4,"app-file-tree",26)(8,ze,9,6,"sh-form-field")(9,Je,8,6,"sh-form-field")(10,qe,6,7)(11,We,3,5,"app-size",27)(12,Ze,6,4,"sh-form-field")(13,tt,4,4,"sh-toggle",28)(14,ot,6,6)(15,at,3,5,"app-timespan",27),a(16,"button",29),u("click",function(){let n=d(e).$implicit,r=_(2);return C(r.removeSetting(n))}),a(17,"sh-icon"),m(18,"x-bold"),l()()()}if(t&2){let e=i.$implicit,o=i.$index,n=_(2);z("destination-"+e.Name+o),s(),z(n.inAppOptions(e.Name)),s(4),O(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function _t(t,i){if(t&1&&(h(0,Ie,2,0,"div",22),E(1,lt,19,3,null,null,M)),t&2){let e=_();O(e.selectedSettings().length===0?0:-1),s(),P(e.selectedSettings())}}var fe=class t{#e=K(ce);options=q.required();hiddenOptions=G([]);hasFreeTextSettings=G(!1);applicationOptions=G();showTextArea=N(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=k(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let r=this.allOptions().find(F=>F.name===n.Name?.replace("--","")),p=n.Value??"";if(r&&i.includes(r.name))return null;if(r){if(r.type==="Boolean"&&(p=this.isTrue(p)),r.type==="Integer"&&(p=parseInt(p)||0),r.type==="Enumeration"&&r.options){let y=p?.trim().toLowerCase(),U=r.options.find(Te=>(Te??"").trim().toLocaleLowerCase()===y);U&&(p=U)}let F=ge.find(y=>y.name===r?.name);return F&&(r=w(w({},r),F)),L(w({},n),{Value:N(p),FormView:r})}else if(this.hasFreeTextSettings())return L(w({},n),{Value:N(p),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=k(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>L(w({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=k(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
- `));updateSettingsFromText(i){if(typeof i!="string")return;let e=me(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(p=>p.Name===i.Name);if(i.FormView.type==="Boolean")return n[r].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[r].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let p=e?.trim().toLowerCase()??"",F=i.FormView.options.find(y=>(y??"").trim().toLocaleLowerCase()===p);if(F)return n[r].Value=F,n}return n[r].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(p=>p.Name===i.Name);return n[r].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=H({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:9,vars:3,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let r;return r=$localize`By adding this option it will override the matching global option`,[["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disallowToggle"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],[1,"option-col"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","remove-btn",3,"click"],["shTooltip",r,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],[3,"ngModelChange","type","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"]]},template:function(e,o){e&1&&(a(0,"sh-toggle-card",8),v(1,9)(2),J(3,4),V(),a(4,"div",10),h(5,Se,3,0,"button",11)(6,we,8,2),l(),V(),h(7,ye,1,3,"textarea",12)(8,_t,3,1),l()),e&2&&(c("disallowToggle",!0),s(5),O(o.showTextArea()?5:6),s(2),O(o.showTextArea()?7:8))},dependencies:[ne,Y,te,W,Z,ee,Ce,de,ue,Q,_e,re,oe,ae,pe,ie,le,se],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr 2.5rem;gap:.5rem;position:relative;z-index:1}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.option-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{fe as a};
1
+ import{a as ue}from"./chunk-OLOFMEQN.js";import{d as me}from"./chunk-4BGVLUYV.js";import{c as de,d as Ce}from"./chunk-FUE2VIJ7.js";import{a as ce}from"./chunk-XE5OMGTJ.js";import{B as oe,H as re,K as ae,P as le,V as _e,W as se,Y as pe,b as W,c as Y,e as Z,i as ee,k as te,s as ne,u as ie}from"./chunk-LFRGO2IP.js";import{ea as Q}from"./chunk-6DB3NZXR.js";import{$b as _,Ab as E,Bb as P,Bc as j,Cb as c,Db as a,Eb as l,Fb as V,Jb as v,Kb as I,Kc as k,Lb as S,Mb as g,Ra as s,Rc as G,Tb as b,Ub as $,Vb as J,Xc as B,Zb as u,_ as K,_c as q,bb as H,da as d,ea as C,gb as f,ic as T,kc as A,nc as m,oa as N,oc as D,pc as R,vc as X,wb as h,wc as z,xb as O,xc as x,yb as M}from"./chunk-FAM42SZT.js";import{a as w,b as L}from"./chunk-EUDKD2JW.js";var ge=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var xe=()=>({updateOn:"blur"});function Se(t,i){if(t&1){let e=g();a(0,"button",13),u("click",function(){d(e);let n=_();return C(n.showTextArea.set(!1))}),b(1,5),V(2,"sh-icon"),$(),l()}}function he(t,i){if(t&1){let e=g();a(0,"button",17,0),u("click",function(){let n=d(e).$implicit,r=_(3);return C(r.addSetting(n))}),a(2,"div",18)(3,"p"),m(4),l(),m(5),l()()}if(t&2){let e=i.$implicit;A("deprecated",e.deprecatedDescription),s(4),D(e.shortDescription),s(),R(" ",e.name," ")}}function Oe(t,i){if(t&1&&(a(0,"h3",9),m(1),l(),E(2,he,6,4,"button",16,M)),t&2){let e=i.$implicit;s(),D(e.displayName),s(),P(e.options)}}function Fe(t,i){if(t&1){let e=g();a(0,"sh-menu")(1,"button",19)(2,"sh-icon"),m(3,"dots-three-vertical"),l()(),v(4,15),a(5,"button",13),u("click",function(){d(e);let n=_(2);return C(n.addFreeTextSetting())}),b(6,7),V(7,"sh-icon"),$(),l(),a(8,"button",20),u("click",function(){d(e);let n=_(2);return C(n.showTextArea.set(!0))}),a(9,"sh-icon"),m(10,"link"),l(),m(11," Edit contents as text "),l(),I(),l()}}function we(t,i){if(t&1&&(a(0,"sh-menu",14)(1,"button",11),b(2,6),V(3,"sh-icon"),$(),l(),v(4,15),E(5,Oe,4,1,null,null,M),I(),l(),h(7,Fe,12,0,"sh-menu")),t&2){let e=_();c("searchable",!0),s(5),P(e.nonSelectedOptionsGrouped()),s(2),O(e.hasFreeTextSettings()?7:-1)}}function ye(t,i){if(t&1){let e=g();a(0,"textarea",21),u("ngModelChange",function(n){d(e);let r=_();return C(r.updateSettingsFromText(n))}),l()}if(t&2){let e=_();c("ngModel",e.settingsAsText())("ngModelOptions",j(2,xe))}}function Ve(t,i){t&1&&(a(0,"div",22),m(1,"Add a setting above to get started."),l())}function Ie(t,i){t&1&&(a(0,"sh-icon",30),m(1," warning-octagon "),l())}function Le(t,i){if(t&1&&(a(0,"sh-icon",31),m(1,"archive"),l()),t&2){let e=_(2).$implicit;c("shTooltip",e.FormView.deprecatedDescription)}}function Ne(t,i){if(t&1&&(a(0,"sh-icon",32),m(1,"question"),l()),t&2){let e=_(2).$implicit;c("shTooltip",e.FormView.longDescription)}}function Me(t,i){if(t&1&&(h(0,Ie,2,0,"sh-icon",30),a(1,"span"),m(2),l(),h(3,Le,2,1,"sh-icon",31)(4,Ne,2,1,"sh-icon",32)),t&2){let e=_().$implicit,o=x(1);O(o?0:-1),s(),A("deprecated",e.FormView.deprecatedDescription),s(),D(e.FormView.shortDescription),s(),O(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function Ee(t,i){t&1&&S(0)}function Pe(t,i){if(t&1){let e=g();a(0,"div",24)(1,"label"),f(2,Ee,1,0,"ng-container",33),l(),a(3,"div")(4,"sh-form-field")(5,"input",34),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateFreeTextSettingName(r,n))}),l(),a(6,"sh-icon",35),m(7,"rectangle-dashed"),l()()(),a(8,"div")(9,"sh-form-field")(10,"input",34),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l(),a(11,"sh-icon",35),m(12,"textbox"),l()()()()}if(t&2){let e=_().$implicit,o=T(3);s(2),c("ngTemplateOutlet",o),s(3),c("ngModel",e.Name),s(5),c("ngModel",e.Value())}}function ve(t,i){t&1&&S(0)}function be(t,i){if(t&1){let e=g();a(0,"app-file-tree",25)(1,"label",36),f(2,ve,1,0,"ng-container",33),l(),a(3,"input",37),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);c("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function $e(t,i){if(t&1){let e=g();a(0,"app-file-tree",26),V(1,"label",36),a(2,"input",37),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()()}if(t&2){let e=_().$implicit,o=x(0);c("startingPath",e.Value()),s(),c("for",o),s(),c("id",o)("ngModel",e.Value())}}function Ae(t,i){t&1&&S(0)}function De(t,i){t&1&&(a(0,"sh-icon",35),m(1,"link"),l())}function Re(t,i){t&1&&(a(0,"sh-icon",35),m(1,"hard-drives"),l())}function ke(t,i){t&1&&(a(0,"sh-icon",35),m(1,"jar"),l())}function Ge(t,i){t&1&&(a(0,"sh-icon",35),m(1,"envelope"),l())}function Be(t,i){t&1&&(a(0,"sh-icon",35),m(1,"textbox"),l())}function ze(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",36),f(2,Ae,1,0,"ng-container",33),l(),a(3,"input",38),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l(),h(4,De,2,0,"sh-icon",35)(5,Re,2,0,"sh-icon",35)(6,ke,2,0,"sh-icon",35)(7,Ge,2,0,"sh-icon",35)(8,Be,2,0,"sh-icon",35),l()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),s(),O(e.FormView.type==="Path"?4:e.FormView.type==="Hostname"?5:e.FormView.type==="Bucketname"?6:e.FormView.type==="Email"?7:8)}}function Ue(t,i){t&1&&S(0)}function Ke(t,i){if(t&1){let e=g();a(0,"sh-icon",41),u("click",function(){d(e);let n=_(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye "),l()}}function He(t,i){if(t&1){let e=g();a(0,"sh-icon",41),u("click",function(){d(e);let n=_(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye-slash "),l()}}function Je(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",36),f(2,Ue,1,0,"ng-container",33),l(),a(3,"input",39),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l(),a(4,"sh-icon",35),m(5,"password"),l(),h(6,Ke,2,0,"sh-icon",40)(7,He,2,0,"sh-icon",40),l()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),s(3),O(e.showPassword?6:7)}}function Xe(t,i){t&1&&S(0)}function je(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;R(" ",e," ")}}function qe(t,i){if(t&1){let e=g();a(0,"sh-select",42)(1,"label",36),f(2,Xe,1,0,"ng-container",33),l(),a(3,"input",37),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()(),f(4,je,1,1,"ng-template",null,2,k)}if(t&2){let e=T(5),o=_().$implicit,n=T(3),r=x(0);c("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),s(),c("for",r),s(),c("ngTemplateOutlet",n),s(),c("id",r)("ngModel",o.Value())}}function Qe(t,i){t&1&&S(0)}function We(t,i){if(t&1){let e=g();a(0,"app-size",43),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),a(1,"label",36),f(2,Qe,1,0,"ng-container",33),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),s(),c("for",n),s(),c("ngTemplateOutlet",o)}}function Ye(t,i){t&1&&S(0)}function Ze(t,i){if(t&1){let e=g();a(0,"sh-form-field")(1,"label",36),f(2,Ye,1,0,"ng-container",33),l(),a(3,"input",44),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l(),a(4,"sh-icon",35),m(5,"numpad"),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function et(t,i){t&1&&S(0)}function tt(t,i){if(t&1){let e=g();a(0,"sh-toggle",28)(1,"label",36),f(2,et,1,0,"ng-container",33),l(),a(3,"input",45),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);s(),c("for",n),s(),c("ngTemplateOutlet",o),s(),c("id",n)("ngModel",e.Value())}}function nt(t,i){t&1&&S(0)}function it(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;R(" ",e," ")}}function ot(t,i){if(t&1){let e=g();a(0,"sh-select",46)(1,"label",36),f(2,nt,1,0,"ng-container",33),l(),a(3,"input",47),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),l()(),f(4,it,1,1,"ng-template",null,3,k)}if(t&2){let e=T(5),o=_().$implicit,n=T(3),r=x(0);c("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),s(),c("for",r),s(),c("ngTemplateOutlet",n),s(),c("ngModel",o.Value())}}function rt(t,i){t&1&&S(0)}function at(t,i){if(t&1){let e=g();a(0,"app-timespan",43),u("ngModelChange",function(n){d(e);let r=_().$implicit,p=_(2);return C(p.updateSettingValue(r,n))}),a(1,"label",36),f(2,rt,1,0,"ng-container",33),l()()}if(t&2){let e=_().$implicit,o=T(3),n=x(0);c("inputType",e.Name)("ngModel",e.Value())("customId",n),s(),c("for",n),s(),c("ngTemplateOutlet",o)}}function lt(t,i){if(t&1){let e=g();X(0)(1),f(2,Me,5,5,"ng-template",null,1,k),a(4,"div",23),h(5,Pe,13,3,"div",24)(6,be,4,9,"app-file-tree",25)(7,$e,3,4,"app-file-tree",26)(8,ze,9,6,"sh-form-field")(9,Je,8,6,"sh-form-field")(10,qe,6,7)(11,We,3,5,"app-size",27)(12,Ze,6,4,"sh-form-field")(13,tt,4,4,"sh-toggle",28)(14,ot,6,6)(15,at,3,5,"app-timespan",27),a(16,"button",29),u("click",function(){let n=d(e).$implicit,r=_(2);return C(r.removeSetting(n))}),a(17,"sh-icon"),m(18,"x-bold"),l()()()}if(t&2){let e=i.$implicit,o=i.$index,n=_(2);z("destination-"+e.Name+o),s(),z(n.inAppOptions(e.Name)),s(3),A("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),s(),O(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function _t(t,i){if(t&1&&(h(0,Ve,2,0,"div",22),E(1,lt,19,5,null,null,M)),t&2){let e=_();O(e.selectedSettings().length===0?0:-1),s(),P(e.selectedSettings())}}var fe=class t{#e=K(ce);options=q.required();hiddenOptions=B([]);hasFreeTextSettings=B(!1);applicationOptions=B();showTextArea=N(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=G(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let r=this.allOptions().find(F=>F.name===n.Name?.replace("--","")),p=n.Value??"";if(r&&i.includes(r.name))return null;if(r){if(r.type==="Boolean"&&(p=this.isTrue(p)),r.type==="Integer"&&(p=parseInt(p)||0),r.type==="Enumeration"&&r.options){let y=p?.trim().toLowerCase(),U=r.options.find(Te=>(Te??"").trim().toLocaleLowerCase()===y);U&&(p=U)}let F=ge.find(y=>y.name===r?.name);return F&&(r=w(w({},r),F)),L(w({},n),{Value:N(p),FormView:r})}else if(this.hasFreeTextSettings())return L(w({},n),{Value:N(p),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=G(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>L(w({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=G(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
+ `));updateSettingsFromText(i){if(typeof i!="string")return;let e=me(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(p=>p.Name===i.Name);if(i.FormView.type==="Boolean")return n[r].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[r].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let p=e?.trim().toLowerCase()??"",F=i.FormView.options.find(y=>(y??"").trim().toLocaleLowerCase()===p);if(F)return n[r].Value=F,n}return n[r].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],r=n.findIndex(p=>p.Name===i.Name);return n[r].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=H({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:9,vars:3,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let r;return r=$localize`By adding this option it will override the matching global option`,[["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disallowToggle"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],[1,"option-col"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","small","remove-btn",3,"click"],["shTooltip",r,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],[3,"ngModelChange","type","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"]]},template:function(e,o){e&1&&(a(0,"sh-toggle-card",8),v(1,9)(2),J(3,4),I(),a(4,"div",10),h(5,Se,3,0,"button",11)(6,we,8,2),l(),I(),h(7,ye,1,3,"textarea",12)(8,_t,3,1),l()),e&2&&(c("disallowToggle",!0),s(5),O(o.showTextArea()?5:6),s(2),O(o.showTextArea()?7:8))},dependencies:[ne,Y,te,W,Z,ee,Ce,de,ue,Q,_e,re,oe,ae,pe,ie,le,se],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;position:relative;z-index:1;max-width:32.5rem;width:100%}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.field-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{max-width:28rem;width:100%}.field-row.align-remove-start[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-start}.option-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{fe as a};
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-3L2HST7Q.js";import"./chunk-W2UO5LKI.js";import"./chunk-OLOFMEQN.js";import"./chunk-4BGVLUYV.js";import"./chunk-GS5QK7LF.js";import"./chunk-VKR5DJQG.js";import"./chunk-PJAWWLYW.js";import"./chunk-RECKKS2S.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-TJ3WIU6Q.js";import"./chunk-KBGIIJMM.js";import"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-2B562XFN.js";import"./chunk-C7RFWM7I.js";import"./chunk-OLOFMEQN.js";import"./chunk-4BGVLUYV.js";import"./chunk-GS5QK7LF.js";import"./chunk-FUE2VIJ7.js";import"./chunk-PJAWWLYW.js";import"./chunk-RECKKS2S.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-TJ3WIU6Q.js";import"./chunk-KBGIIJMM.js";import"./chunk-LFRGO2IP.js";import"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1 +1 @@
1
- import{a as _e}from"./chunk-W2UO5LKI.js";import{a as le}from"./chunk-OLOFMEQN.js";import"./chunk-4BGVLUYV.js";import{j as ae}from"./chunk-ZOO7P75U.js";import"./chunk-GS5QK7LF.js";import{a as ie,b as oe,c as se}from"./chunk-VKR5DJQG.js";import"./chunk-BTVYI2KD.js";import"./chunk-6Q6SSTBK.js";import"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-KBGIIJMM.js";import{B as ee,H as ne,P as te,c as H,e as q,i as Y,k as j,s as Q,u as Z}from"./chunk-LFRGO2IP.js";import{b as W,d as V}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as p,Bc as U,Cb as O,Db as t,Eb as o,Fb as m,Mb as h,Ra as c,Rc as J,Tb as S,Ub as C,Vb as r,Yc as X,Zb as I,_ as g,bb as z,da as N,ea as P,gc as v,hc as x,kc as K,oa as B,sc as u,tc as d,uc as T,wb as E,xb as f}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var re=["formRef"],ce=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function pe(a,l){a&1&&(S(0,1,1),m(1,"sh-icon",20),C())}function ue(a,l){a&1&&(t(0,"p",21),r(1,6),o())}function de(a,l){a&1&&(t(0,"p"),r(1,7),o())}function Te(a,l){if(a&1){let n=h();t(0,"p"),r(1,8),o(),t(2,"app-timespan",18),T("ngModelChange",function(s){N(n);let i=p();return d(i.optionsFields.backupRetentionTime,s)||(i.optionsFields.backupRetentionTime=s),P(s)}),t(3,"label",30),r(4,9),o()()}if(a&2){let n=p();c(2),O("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function Se(a,l){if(a&1){let n=h();t(0,"p"),r(1,10),o(),t(2,"sh-form-field")(3,"label",31),r(4,11),o(),t(5,"input",32),T("ngModelChange",function(s){N(n);let i=p();return d(i.optionsFields.backupRetentionVersions,s)||(i.optionsFields.backupRetentionVersions=s),P(s)}),o()()}if(a&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Ce(a,l){a&1&&(t(0,"p"),r(1,12),o())}function Oe(a,l){if(a&1){let n=h();t(0,"p"),r(1,13),o(),t(2,"sh-form-field")(3,"p"),r(4,14),o(),t(5,"label",33),r(6,15),o(),t(7,"input",34),T("ngModelChange",function(s){N(n);let i=p();return d(i.optionsFields.backupRetentionCustom,s)||(i.optionsFields.backupRetentionCustom=s),P(s)}),o()()}if(a&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var me=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],ge=1024*1024*1024*2,Ne=1024*1024*5,F=class a{#e=g(ae);#n=g(V);#t=g(W);formRef=X.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=B(me);exceededVolumeSize=J(()=>{let{size:l,unit:n}=oe(this.optionsFields.remoteVolumeSize());if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,ie.findIndex(s=>s.value===n));return e>ge||e<Ne});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=z({type:a,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,re,5),n&2&&x()},decls:30,vars:16,consts:()=>{let l;l=$localize`Options`;let n;n=$localize` Remote volume size ${"\uFFFD*7:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*7:1\uFFFD"}:CLOSE_BLOCK_IF:`;let e;e=$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#11\uFFFD"}:START_LINK: Read more ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-square-out${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#11\uFFFD"}:CLOSE_LINK:`;let s;s=$localize`Backup retention`;let i;i=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let M;M=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let R;R=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let A;A=$localize`Nothing will be deleted. The backup size will grow with each change.`;let b;b=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let y;y=$localize`Time to keep versions`;let $;$=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let k;k=$localize`Number of versions`;let L;L=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let w;w=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let G;G=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let D;return D=$localize`Retention expression`,[l,n,e,s,i,M,R,A,b,y,$,k,L,w,G,D,[1,"title-30"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],[1,"warning"],[1,"warn"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"sh-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch","isClearable"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(t(0,"section")(1,"h3",16),r(2,0),o(),t(3,"div",17)(4,"app-size",18),T("ngModelChange",function(i){return d(e.optionsFields.remoteVolumeSize,i)||(e.optionsFields.remoteVolumeSize=i),i}),t(5,"label",19),S(6,1),E(7,pe,2,0,"sh-icon",20),C(),o()(),E(8,ue,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),m(12,"sh-icon",23),o(),C(),o()(),t(13,"sh-select",24)(14,"label",19),r(15,3),o(),t(16,"input",25),T("ngModelChange",function(i){return d(e.optionsFields.backupRetention,i)||(e.optionsFields.backupRetention=i),i}),o()(),E(17,de,2,0,"p")(18,Te,5,2)(19,Se,6,1)(20,Ce,2,0,"p")(21,Oe,8,1),t(22,"app-options-list",26),T("optionsChange",function(i){return d(e.settings,i)||(e.settings=i),i}),o(),t(23,"div",27)(24,"button",28),I("click",function(){return e.goBack()}),S(25,4),m(26,"sh-icon"),C(),o(),t(27,"button",29),I("click",function(){return e.submit()}),S(28,5),m(29,"sh-icon"),C(),o()()()),n&2&&(c(4),O("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),f(e.exceededVolumeSize()?7:-1),c(),f(e.exceededVolumeSize()?8:-1),c(5),O("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),f(e.optionsFields.backupRetention()==="all"?17:e.optionsFields.backupRetention()==="time"?18:e.optionsFields.backupRetention()==="versions"?19:e.optionsFields.backupRetention()==="smart"?20:e.optionsFields.backupRetention()==="custom"?21:-1),c(5),u("options",e.settings),O("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",U(15,ce)),c(5),K("loader",e.isSubmitting()))},dependencies:[Q,H,j,q,Y,_e,se,le,ee,Z,te,ne],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}section[_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-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{F as default};
1
+ import{a as _e}from"./chunk-C7RFWM7I.js";import{a as le}from"./chunk-OLOFMEQN.js";import"./chunk-4BGVLUYV.js";import{j as ae}from"./chunk-SIXGJYNI.js";import"./chunk-GS5QK7LF.js";import{a as ie,b as oe,c as se}from"./chunk-FUE2VIJ7.js";import"./chunk-BTVYI2KD.js";import"./chunk-6Q6SSTBK.js";import"./chunk-LJQN4G2O.js";import"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-KBGIIJMM.js";import{B as ee,H as ne,P as te,c as H,e as q,i as Y,k as j,s as Q,u as Z}from"./chunk-LFRGO2IP.js";import{b as W,d as V}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as p,Bc as U,Cb as O,Db as t,Eb as o,Fb as m,Mb as h,Ra as c,Rc as J,Tb as S,Ub as C,Vb as r,Yc as X,Zb as I,_ as g,bb as z,da as N,ea as P,gc as v,hc as x,kc as K,oa as B,sc as u,tc as d,uc as T,wb as E,xb as f}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var re=["formRef"],ce=()=>["--skip-files-larger-than","dblock-size","encryption-module","no-encryption","--no-encryption","compression-module","--exclude-files-attributes","keep-time","keep-versions","retention-policy"];function pe(a,l){a&1&&(S(0,1,1),m(1,"sh-icon",20),C())}function ue(a,l){a&1&&(t(0,"p",21),r(1,6),o())}function de(a,l){a&1&&(t(0,"p"),r(1,7),o())}function Te(a,l){if(a&1){let n=h();t(0,"p"),r(1,8),o(),t(2,"app-timespan",18),T("ngModelChange",function(s){N(n);let i=p();return d(i.optionsFields.backupRetentionTime,s)||(i.optionsFields.backupRetentionTime=s),P(s)}),t(3,"label",30),r(4,9),o()()}if(a&2){let n=p();c(2),O("customId","backupRetentionTime"),u("ngModel",n.optionsFields.backupRetentionTime)}}function Se(a,l){if(a&1){let n=h();t(0,"p"),r(1,10),o(),t(2,"sh-form-field")(3,"label",31),r(4,11),o(),t(5,"input",32),T("ngModelChange",function(s){N(n);let i=p();return d(i.optionsFields.backupRetentionVersions,s)||(i.optionsFields.backupRetentionVersions=s),P(s)}),o()()}if(a&2){let n=p();c(5),u("ngModel",n.optionsFields.backupRetentionVersions)}}function Ce(a,l){a&1&&(t(0,"p"),r(1,12),o())}function Oe(a,l){if(a&1){let n=h();t(0,"p"),r(1,13),o(),t(2,"sh-form-field")(3,"p"),r(4,14),o(),t(5,"label",33),r(6,15),o(),t(7,"input",34),T("ngModelChange",function(s){N(n);let i=p();return d(i.optionsFields.backupRetentionCustom,s)||(i.optionsFields.backupRetentionCustom=s),P(s)}),o()()}if(a&2){let n=p();c(7),u("ngModel",n.optionsFields.backupRetentionCustom)}}var me=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],ge=1024*1024*1024*2,Ne=1024*1024*5,F=class a{#e=g(ae);#n=g(V);#t=g(W);formRef=X.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=B(me);exceededVolumeSize=J(()=>{let{size:l,unit:n}=oe(this.optionsFields.remoteVolumeSize());if(l==null||n===null||n===void 0)return!1;let e=l*Math.pow(1024,ie.findIndex(s=>s.value===n));return e>ge||e<Ne});goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){this.#e.submit()}static \u0275fac=function(n){return new(n||a)};static \u0275cmp=z({type:a,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,re,5),n&2&&x()},decls:30,vars:16,consts:()=>{let l;l=$localize`Options`;let n;n=$localize` Remote volume size ${"\uFFFD*7:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*7:1\uFFFD"}:CLOSE_BLOCK_IF:`;let e;e=$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#11\uFFFD"}:START_LINK: Read more ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-square-out${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#11\uFFFD"}:CLOSE_LINK:`;let s;s=$localize`Backup retention`;let i;i=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#26\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let M;M=$localize`${"\uFFFD#29\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let R;R=$localize` The chosen size is outside the recommended range. This may cause performance issues, excessively large temporary files or other problems. `;let A;A=$localize`Nothing will be deleted. The backup size will grow with each change.`;let b;b=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let y;y=$localize`Time to keep versions`;let $;$=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let k;k=$localize`Number of versions`;let L;L=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let w;w=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let G;G=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let D;return D=$localize`Retention expression`,[l,n,e,s,i,M,R,A,b,y,$,k,L,w,G,D,[1,"title-30"],[1,"remote-volume-wrap"],[3,"ngModelChange","customId","ngModel"],["for","size"],[1,"warning"],[1,"warn"],["href","https://forum.duplicati.com/t/choosing-sizes-in-duplicati/17683","target","_blank",1,"sh-primary"],["suffix",""],["value","value","label","name",3,"options","inlineSearch","isClearable"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(t(0,"section")(1,"h3",16),r(2,0),o(),t(3,"div",17)(4,"app-size",18),T("ngModelChange",function(i){return d(e.optionsFields.remoteVolumeSize,i)||(e.optionsFields.remoteVolumeSize=i),i}),t(5,"label",19),S(6,1),E(7,pe,2,0,"sh-icon",20),C(),o()(),E(8,ue,2,0,"p",21),t(9,"p"),S(10,2),t(11,"a",22),m(12,"sh-icon",23),o(),C(),o()(),t(13,"sh-select",24)(14,"label",19),r(15,3),o(),t(16,"input",25),T("ngModelChange",function(i){return d(e.optionsFields.backupRetention,i)||(e.optionsFields.backupRetention=i),i}),o()(),E(17,de,2,0,"p")(18,Te,5,2)(19,Se,6,1)(20,Ce,2,0,"p")(21,Oe,8,1),t(22,"app-options-list",26),T("optionsChange",function(i){return d(e.settings,i)||(e.settings=i),i}),o(),t(23,"div",27)(24,"button",28),I("click",function(){return e.goBack()}),S(25,4),m(26,"sh-icon"),C(),o(),t(27,"button",29),I("click",function(){return e.submit()}),S(28,5),m(29,"sh-icon"),C(),o()()()),n&2&&(c(4),O("customId","size"),u("ngModel",e.optionsFields.remoteVolumeSize),c(3),f(e.exceededVolumeSize()?7:-1),c(),f(e.exceededVolumeSize()?8:-1),c(5),O("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),c(3),u("ngModel",e.optionsFields.backupRetention),c(),f(e.optionsFields.backupRetention()==="all"?17:e.optionsFields.backupRetention()==="time"?18:e.optionsFields.backupRetention()==="versions"?19:e.optionsFields.backupRetention()==="smart"?20:e.optionsFields.backupRetention()==="custom"?21:-1),c(5),u("options",e.settings),O("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",U(15,ce)),c(5),K("loader",e.isSubmitting()))},dependencies:[Q,H,j,q,Y,_e,se,le,ee,Z,te,ne],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:37.5rem;padding:2.5rem}section[_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-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{F as default};
@@ -0,0 +1 @@
1
+ import{a as We}from"./chunk-F2QQDU4N.js";import{a as Ve}from"./chunk-XE5OMGTJ.js";import{b as $e}from"./chunk-KBGIIJMM.js";import{A as Re,B as Ie,H as te,J as Le,L as Ae,P as Be,W as ke,a as Oe,c as U,e as Y,i as Z,k as ye,s as ee,u as xe,y as we,z as De}from"./chunk-LFRGO2IP.js";import{ea as Fe}from"./chunk-6DB3NZXR.js";import{$b as p,Ab as he,Ac as Me,B as pe,Bb as _e,Bc as Ne,Cb as O,Cc as Q,Db as c,Dc as ve,Eb as d,Fb as X,H as ie,Kc as Se,Lb as ne,Mb as L,Ra as h,Rc as D,Sc as R,Tb as ge,Ub as fe,Vb as A,Wb as me,Wc as se,Xb as Ce,Xc as C,Yc as le,Zb as x,_ as j,ac as q,bb as J,bc as w,da as N,ea as v,gb as W,gc as oe,hc as Te,ic as re,jc as K,kc as y,n as ce,nc as b,oa as P,oc as Ee,pc as Pe,qc as be,r as H,sc as B,tb as ue,tc as k,uc as $,wb as S,x as de,xb as F}from"./chunk-FAM42SZT.js";import{a as G,b as z}from"./chunk-EUDKD2JW.js";var qe=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Ke=["label","[prefix]","[suffix]"];function Qe(o,t){if(o&1&&b(0),o&2){let e=t.$implicit,i=p();be("",e.label,"",i.hasPerSecond()?"/s":"")}}var Ue=["throttle-upload","throttle-download"],Ye=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Ze=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},Ge=class o{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(Ye);readonly=P(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&Ue.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Ze(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Me([{provide:Oe,useExisting:o,multi:!0}])],ngContentSelectors:Ke,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(q(qe),c(0,"div",0),w(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),w(4,1),w(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(i.unit,r)||(i.unit=r),r}),d(),W(8,Qe,1,2,"ng-template"),d()),e&2&&(h(2),ue("readonly",i.readonly()||void 0),h(),O("id",i.customId()),B("ngModel",i.timespan),O("disabled",i.readonly()),h(3),K("--miw",0),O("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),h(),B("ngModel",i.unit))},dependencies:[Be,te,ee,U,ye,Y,Z],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var et=["treeContainer"],tt=["formRef"],it=[[["label"]],[["label"]],[["input"]]],nt=["label","label","input"],ot=o=>({children:o,level:0}),ze=o=>({$implicit:o}),rt=(o,t)=>({children:o,level:t}),st=()=>({maxWidth:"700px",width:"100%"}),lt=(o,t)=>t.id;function at(o,t){if(o&1){let e=L();c(0,"sh-button-group",10)(1,"button",20),x("click",function(){N(e);let n=p();return v(n.pathDiscoveryMethod.set("browse"))}),A(2,4),d(),c(3,"button",20),x("click",function(){N(e);let n=p();return v(n.pathDiscoveryMethod.set("path"))}),A(4,5),d()()}if(o&2){let e=p();h(),y("active",e.pathDiscoveryMethod()==="browse"),h(2),y("active",e.pathDiscoveryMethod()==="path")}}function ct(o,t){o&1&&X(0,"sh-progress-bar",13)}function dt(o,t){o&1&&(c(0,"sh-icon",25),b(1,"caret-down"),d())}function pt(o,t){o&1&&X(0,"sh-icon",25)}function ut(o,t){o&1&&(c(0,"sh-icon",25),b(1,"caret-right"),d())}function ht(o,t){o&1&&(c(0,"sh-icon",23),b(1,"folder-open"),d())}function _t(o,t){o&1&&(c(0,"sh-icon",23),b(1,"folder-user"),d())}function gt(o,t){o&1&&(c(0,"sh-icon",23),b(1,"file"),d())}function ft(o,t){o&1&&(c(0,"sh-icon",23),b(1,"folder"),d())}function mt(o,t){if(o&1&&(S(0,dt,2,0,"sh-icon",25)(1,pt,1,0,"sh-icon",25)(2,ut,2,0,"sh-icon",25),S(3,ht,2,0,"sh-icon",23)(4,_t,2,0,"sh-icon",23)(5,gt,2,0,"sh-icon",23)(6,ft,2,0,"sh-icon",23)),o&2){let e=p(2).$implicit;F(e.children.length?0:e.cls==="file"?1:2),h(3),F(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Ct(o,t){o&1&&(c(0,"sh-icon",23),b(1,"desktop-tower"),d())}function Tt(o,t){o&1&&ne(0)}function Et(o,t){if(o&1&&W(0,Tt,1,0,"ng-container",14),o&2){let e=p(2).$implicit,i=p().$implicit;p();let n=re(7);O("ngTemplateOutlet",n)("ngTemplateOutletContext",Q(5,ze,ve(2,rt,e.children,i.level+1)))}}function Pt(o,t){if(o&1){let e=L();c(0,"div",21,3),x("click",function(){N(e);let n=p().$implicit,r=p(2);return v(r.toggleNode(n.id,n))}),c(2,"div",22),S(3,mt,7,2)(4,Ct,2,0,"sh-icon",23),d(),c(5,"div",24),x("click",function(n){N(e);let r=p().$implicit,a=p(2);return v(a.toggleSelectedNode(n,r))}),b(6),d()(),S(7,Et,1,7,"ng-container")}if(o&2){let e=p().$implicit,i=p().$implicit,n=p();y("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),h(2),y("file",e.cls==="file"),h(),F(e.id!=="/"?3:4),h(3),Pe(" ",e.text," "),h(),F(e.children.length>0?7:-1)}}function bt(o,t){if(o&1&&S(0,Pt,8,17),o&2){let e=t.$implicit,i=p(2);F(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Mt(o,t){if(o&1&&(c(0,"sh-list"),he(1,bt,1,1,null,null,lt),d()),o&2){let e=t.$implicit;K("padding-left",e.level*.25,"rem"),h(),_e(e.children)}}function Nt(o,t){o&1&&ne(0)}function vt(o,t){if(o&1){let e=L();c(0,"sh-toggle",26),x("click",function(){N(e);let n=p();return v(n._showHiddenNodes.set(!n._showHiddenNodes()))}),A(1,6),d()}if(o&2){let e=p();y("active",e._showHiddenNodes()),h(),me(e.showFiles()?"files":"folders"),Ce(1)}}function St(o,t){if(o&1){let e=L();c(0,"button",27),x("click",function(){N(e);let n=p();return v(n.openCreateFolderDialog())}),A(1,7),d()}if(o&2){let e=p();O("disabled",!e.isCurrentPathFolder())}}function Ft(o,t){if(o&1){let e=L();c(0,"sh-dialog",28),$("isOpenChange",function(n){N(e);let r=p();return k(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),v(n)}),c(1,"header",29)(2,"h2"),A(3,8),d()(),c(4,"div",30)(5,"div"),b(6," Folder will be created under "),c(7,"pre"),b(8),d()(),c(9,"sh-form-field")(10,"textarea",31),$("ngModelChange",function(n){N(e);let r=p();return k(r.createFolderPath,n)||(r.createFolderPath=n),v(n)}),d()()(),c(11,"footer",32)(12,"button",33),x("click",function(){N(e);let n=p();return v(n.closeCreateFolderDialog(!1))}),b(13,"Cancel"),d(),c(14,"button",34),x("click",function(){N(e);let n=p();return v(n.closeCreateFolderDialog(!0))}),ge(15,9),X(16,"sh-icon"),fe(),d()()()}if(o&2){let e,i=p();B("isOpen",i.createFolderDialogOpen),O("options",Ne(5,st)),h(8),Ee(i.currentPath()),h(2),B("ngModel",i.createFolderPath),h(4),O("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var He=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(He||{}),M="/",ae=class o{#t=j($e);#n=j(Ve);#c=j(De);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);includes=se();excludes=se();_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=le("treeContainer");formRef=le("formRef");pathDiscoveryMethod=P("browse");isLoading=P(!1);currentPath=P("/");#o=P(null);treeSearchQuery=P("");treeNodes=P([]);pathDelimiter=D(()=>this.#n.systemInfo()?.DirectorySeparator??"");filterGroups=this.#n.filterGroups();isByBackupSettings=D(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=D(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=He;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),i=structuredClone(e);for(let l=0;l<i.length;l++){let m=i[l].slice(1);if(m.startsWith("{")&&m.endsWith("}")){let _=m.slice(1,-1),g=this.filterGroups?.FilterGroups[_];if(g&&g.length){let T=g.map(E=>`-${E}`);i.splice(l,1,...T)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),f=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let u=this.#r(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:u,isIndeterminate:!1,cls:this.#e(l,f)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let u=new Map;if(!l.id)return;let m=l.id;a&&(l.accepted=!0),u.set(m,l);let _=r.length>0?n.filter(g=>g.parentPath.startsWith(m)):n;for(let g of _){if(!g.id)continue;let T=g.id;if(!g.cls||u.has(T))continue;let E=u.get(g.parentPath),V=g.hidden===!0&&t?0:this.#r(i,T,g.cls,E),I=z(G({},g),{isIndeterminate:this.isIndeterminate(i,T),evalState:V,children:[]});a&&(I.accepted=this.matchAccepts(a,I)),u.set(T,I),E&&E.children.push(I)}return l}),s});#d(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#r(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),f=t.filter(u=>!u.startsWith("-")&&!u.startsWith("+")),s=t.filter(u=>u.startsWith("-")||u.startsWith("+")),l=this.multiSelect();if(f.length===0)return r;for(let u=0;u<f.length;u++){let m=f[u];if(e===m){r=1;break}if(!l||!this.#e(m,a))continue;if(e?.startsWith(m)){r=1;break}}if(s.length===0)return r;for(let u=0;u<s.length;u++){let m=s[u],_=m.slice(1),g=m.startsWith("-")?-1:1;if(this.#e(_,a)){if(i!=="folder")continue;if(e===_){r=g;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(i!=="folder")continue;let E=_.slice(1,-2);if(E==="")break;if(e?.includes(E+a)){r=g;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let E=_.slice(3,-7);if(new RegExp(E).test(e)){r=g;break}}if(_.startsWith("[")&&_.endsWith("]")){let E=_.slice(1,-1),V=this.translateCSharpRegex(E);if(new RegExp(`${V}`).test(e)){r=g;break}}if(_.startsWith("*.")){if(i!=="file"||_.replace("*.","").length===0)continue;if(this.#s(e,_,!0)){r=g;break}}if(_==="")continue;if(_===e){r=g;break}if(this.#s(e,_,!0)){r=g;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,M)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?M:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,f=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(f&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=f?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==M&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#d(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let f=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=f?f[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#c.open(We,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#u(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(H(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(H(n=>n.Files??[]))}}#a(t){return this.isByBackupSettings()?this.#h(t):this.#u(t)}#_(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,u)=>{let m=s.slice(0,u+1).join(e);m!==""&&(a.includes(m)||a.push(m))})}),this.isLoading.set(!0);let f=a.map(s=>this.#a(s).pipe(H(l=>({status:"success",value:l,url:s})),pe(l=>ce({status:"error",value:l,url:s}))));de(f).pipe(ie(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(m=>m.status==="success"),u=s.filter(m=>m.status==="error");this.treeNodes.update(m=>{let _=l.flatMap(T=>Array.isArray(T.value)?T.value.map(E=>z(G({},E),{parentPath:T.url})):[]),g=[...new Map([...m,..._].map(T=>[T.id,T])).values()];return this.#l(),this.hideShortcuts()?g.filter(T=>!T.id.startsWith("%")):g})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=M){let i=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ie(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(f=>f!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let f=r.map(l=>{let u=this.#e(l.id,i)?"folder":"file";return z(G({},l),{cls:u,parentPath:e})}),s=[...new Map([...a,...f].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(oe(i.treeContainerRef,et,5),oe(i.formRef,tt,5)),e&2&&Te(2)},hostVars:2,hostBindings:function(e,i){e&2&&y("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:nt,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"type-b","small"],[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(q(it),S(0,at,5,4,"sh-button-group",10),c(1,"div",11),w(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",12,0),S(5,ct,1,0,"sh-progress-bar",13),W(6,Mt,3,2,"ng-template",null,1,Se)(8,Nt,1,0,"ng-container",14),d(),c(9,"div",15),S(10,vt,2,3,"sh-toggle",16),S(11,St,2,1,"button",17),d()(),c(12,"div",18,2)(14,"sh-form-field"),w(15,1,["ngProjectAs","label",5,["label"]]),w(16,2,["ngProjectAs","input",5,["input"]]),d()(),S(17,Ft,17,6,"sh-dialog",19)),e&2){let n=re(7);F(i.multiSelect()?-1:0),h(),y("hidden",i.pathDiscoveryMethod()!=="browse"),h(2),y("visualize-accepted",i.accepts()),h(2),F(i.isLoading()?5:-1),h(3),O("ngTemplateOutlet",n)("ngTemplateOutletContext",Q(15,ze,Q(13,ot,i.treeStructure()))),h(2),F(!i.accepts()&&!i.isByBackupSettings()?10:-1),h(),F(i.enableCreateFolder()?11:-1),h(),y("hidden",i.pathDiscoveryMethod()!=="path"),h(5),F(i.createFolderDialogOpen()?17:-1)}},dependencies:[Ie,Re,ke,xe,te,Le,Ae,we,Fe,ee,U,Y,Z],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};export{Ye as a,Ze as b,Ge as c,ae as d};
@@ -1,3 +1,3 @@
1
- import{a as Me}from"./chunk-W2UO5LKI.js";import"./chunk-OLOFMEQN.js";import"./chunk-4BGVLUYV.js";import{a as ge}from"./chunk-XDECUOQ5.js";import{j as F}from"./chunk-ZOO7P75U.js";import{a as Ee}from"./chunk-GS5QK7LF.js";import"./chunk-VKR5DJQG.js";import"./chunk-BTVYI2KD.js";import{a as Ne}from"./chunk-DU5QSRYH.js";import"./chunk-D2DI6ZER.js";import"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import"./chunk-W4QCGFNO.js";import"./chunk-L4GZJLYK.js";import"./chunk-LJQN4G2O.js";import{b as A}from"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import"./chunk-TJ3WIU6Q.js";import{a as pe,b as ue}from"./chunk-KBGIIJMM.js";import{B as me,G as _e,H as de,L as ce,P as Ce,c as Q,e as Y,f as Z,j as ee,n as te,o as ne,p as oe,q as ie,r as ae,s as re,t as se,u as le}from"./chunk-LFRGO2IP.js";import{b as j,d as H,e as q}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as g,Ab as B,Ac as V,Bb as G,Bc as z,Cb as u,Db as a,Eb as n,Fb as r,Jb as S,Kb as T,Mb as k,Ra as m,Sc as W,Tb as f,Ub as O,Vb as c,Wb as y,Xb as v,Zb as U,_ as p,bb as D,da as E,ea as M,kc as x,oa as L,sc as w,tc as K,uc as J,wb as R,xb as $,yb as b,zc as X}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var Se=()=>["backup"];function Te(s,t){s&1&&r(0,"sh-progress-bar",11)}function fe(s,t){if(s&1&&(a(0,"sh-form-field"),r(1,"input",30),n()),s&2){let e=t.$implicit,l=t.$index;m(),u("id",X("filter-",l))("formControl",e)}}function Oe(s,t){if(s&1){let e=k();a(0,"form",12)(1,"sh-select",13)(2,"label",14),c(3,1),n(),r(4,"input",15),n(),a(5,"sh-form-field")(6,"label",16),c(7,2),n(),r(8,"textarea",17),n(),a(9,"sh-form-field")(10,"label",18),c(11,3),n(),r(12,"textarea",19),n()(),a(13,"sh-divider"),c(14,4),n(),a(15,"form",12)(16,"sh-form-field")(17,"label",20),c(18,5),n(),r(19,"input",21),n(),a(20,"sh-form-field")(21,"label",22),c(22,6),n(),r(23,"input",23),n(),a(24,"app-toggle-card",24),S(25,25),c(26,7),T(),S(27,26),B(28,fe,2,3,"sh-form-field",null,b),T(),n()(),a(30,"app-options-list",27),J("optionsChange",function(i){E(e);let C=g();return K(C.settings,i)||(C.settings=i),M(i)}),n(),a(31,"div",28)(32,"button",29),U("click",function(){E(e);let i=g();return M(i.submit())}),f(33,8),r(34,"sh-icon"),O(),n()()}if(s&2){let e=g();u("formGroup",e.baseCmdForm),m(),u("options",e.commandOptions()??z(10,Se))("inlineSearch",!0),m(14),u("formGroup",e.standardFields),m(9),u("disallowToggle",!0),m(4),G(e.standardFields.controls.filters.controls),m(2),w("options",e.settings),u("hasFreeTextSettings",!0),m(2),x("loader",e.isSubmitting()),m(2),y(e.baseCmdForm.value.command),v(33)}}var _=new ae,P=class s{#e=p(F);#t=p(ue);#n=p(H);#o=p(j);#i=p(pe);#a=p(Ne);#r=A(this.#o.params);commandOptions=A(this.#i.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=_.group({"backup-id":_.control(""),"backup-name":_.control(""),dbpath:_.control(""),filters:_.array([])});baseCmdForm=_.group({command:_.control("backup"),targetUrl:_.control(""),arguments:_.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#l=W(()=>{let t=this.#r()?.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.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),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(_.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#s())}#s(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",l=t.arguments?.split(`
1
+ import{a as Me}from"./chunk-C7RFWM7I.js";import"./chunk-OLOFMEQN.js";import"./chunk-4BGVLUYV.js";import{a as ge}from"./chunk-XDECUOQ5.js";import{j as F}from"./chunk-SIXGJYNI.js";import{a as Ee}from"./chunk-GS5QK7LF.js";import"./chunk-FUE2VIJ7.js";import"./chunk-BTVYI2KD.js";import{a as Ne}from"./chunk-DU5QSRYH.js";import"./chunk-D2DI6ZER.js";import"./chunk-M77IE672.js";import"./chunk-I5AKUAZF.js";import"./chunk-PJAWWLYW.js";import"./chunk-6Q6SSTBK.js";import"./chunk-RECKKS2S.js";import"./chunk-W4QCGFNO.js";import"./chunk-L4GZJLYK.js";import"./chunk-LJQN4G2O.js";import{b as A}from"./chunk-I2RHQQ3J.js";import"./chunk-F2QQDU4N.js";import"./chunk-XE5OMGTJ.js";import"./chunk-T6C2OUI5.js";import"./chunk-TJ3WIU6Q.js";import{a as pe,b as ue}from"./chunk-KBGIIJMM.js";import{B as me,G as _e,H as de,L as ce,P as Ce,c as Q,e as Y,f as Z,j as ee,n as te,o as ne,p as oe,q as ie,r as ae,s as re,t as se,u as le}from"./chunk-LFRGO2IP.js";import{b as j,d as H,e as q}from"./chunk-LEZL7BSL.js";import"./chunk-4MEL5WTX.js";import"./chunk-5K64UNNB.js";import"./chunk-6DB3NZXR.js";import"./chunk-FPPZ4BUR.js";import{$b as g,Ab as B,Ac as V,Bb as G,Bc as z,Cb as u,Db as a,Eb as n,Fb as r,Jb as S,Kb as T,Mb as k,Ra as m,Sc as W,Tb as f,Ub as O,Vb as c,Wb as y,Xb as v,Zb as U,_ as p,bb as D,da as E,ea as M,kc as x,oa as L,sc as w,tc as K,uc as J,wb as R,xb as $,yb as b,zc as X}from"./chunk-FAM42SZT.js";import"./chunk-EUDKD2JW.js";var Se=()=>["backup"];function Te(s,t){s&1&&r(0,"sh-progress-bar",11)}function fe(s,t){if(s&1&&(a(0,"sh-form-field"),r(1,"input",30),n()),s&2){let e=t.$implicit,l=t.$index;m(),u("id",X("filter-",l))("formControl",e)}}function Oe(s,t){if(s&1){let e=k();a(0,"form",12)(1,"sh-select",13)(2,"label",14),c(3,1),n(),r(4,"input",15),n(),a(5,"sh-form-field")(6,"label",16),c(7,2),n(),r(8,"textarea",17),n(),a(9,"sh-form-field")(10,"label",18),c(11,3),n(),r(12,"textarea",19),n()(),a(13,"sh-divider"),c(14,4),n(),a(15,"form",12)(16,"sh-form-field")(17,"label",20),c(18,5),n(),r(19,"input",21),n(),a(20,"sh-form-field")(21,"label",22),c(22,6),n(),r(23,"input",23),n(),a(24,"app-toggle-card",24),S(25,25),c(26,7),T(),S(27,26),B(28,fe,2,3,"sh-form-field",null,b),T(),n()(),a(30,"app-options-list",27),J("optionsChange",function(i){E(e);let C=g();return K(C.settings,i)||(C.settings=i),M(i)}),n(),a(31,"div",28)(32,"button",29),U("click",function(){E(e);let i=g();return M(i.submit())}),f(33,8),r(34,"sh-icon"),O(),n()()}if(s&2){let e=g();u("formGroup",e.baseCmdForm),m(),u("options",e.commandOptions()??z(10,Se))("inlineSearch",!0),m(14),u("formGroup",e.standardFields),m(9),u("disallowToggle",!0),m(4),G(e.standardFields.controls.filters.controls),m(2),w("options",e.settings),u("hasFreeTextSettings",!0),m(2),x("loader",e.isSubmitting()),m(2),y(e.baseCmdForm.value.command),v(33)}}var _=new ae,P=class s{#e=p(F);#t=p(ue);#n=p(H);#o=p(j);#i=p(pe);#a=p(Ne);#r=A(this.#o.params);commandOptions=A(this.#i.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=_.group({"backup-id":_.control(""),"backup-name":_.control(""),dbpath:_.control(""),filters:_.array([])});baseCmdForm=_.group({command:_.control("backup"),targetUrl:_.control(""),arguments:_.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#l=W(()=>{let t=this.#r()?.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.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),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(_.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#s())}#s(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",l=t.arguments?.split(`
2
2
  `).filter(o=>o.length>0)??[],i=this.standardFields.value,C=i.filters??[],N=[t.command,e,...l,`--backup-name=${i["backup-name"]}`,`--dbpath=${i.dbpath}`,`--backup-id=${i["backup-id"]}`,...C.filter(o=>o).map(o=>o.startsWith("-")?`--exclude=${o?.slice(1)}`:`--include=${o}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(o=>`${o.Name.startsWith("--")?"":"--"}${o.Name}=${o.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:N}).subscribe(o=>{o.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",o.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||s)};static \u0275cmp=D({type:s,selectors:[["app-commandline"]],features:[V([F])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`Command`;let l;l=$localize`TargetUrl`;let i;i=$localize`Commandline Arguments`;let C;C=$localize`Advanced options`;let N;N=$localize`Backup ID`;let o;o=$localize`Backup Name`;let I;I=$localize`Filters`;let h;return h=$localize`${"\uFFFD#34\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#34\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,l,i,C,N,o,I,h,[1,"back"],["type","button","shButton","","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"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,l){e&1&&(r(0,"app-status-bar"),a(1,"section")(2,"div",9)(3,"button",10),f(4,0),r(5,"sh-icon"),O(),n()(),R(6,Te,1,0,"sh-progress-bar",11)(7,Oe,35,11),n()),e&2&&(m(6),$(l.finishedLoading()?7:6))},dependencies:[re,ee,Q,Y,Z,ge,Me,Ee,se,te,ne,ie,oe,q,de,me,_e,Ce,ce,le],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}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}"],changeDetection:0})};export{P as default};