@duplicati/ngclient 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{a as y}from"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-PIDBEXSZ.js";import"./chunk-5XX7BU4I.js";import{sa as S}from"./chunk-5ZK3D2RS.js";import{Eb as n,Fb as o,Ra as f,Sb as a,X as m,fb as p,ic as r,jc as _,vc as l,wc as c}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var i=class s{#e=m(y);systemInfo=this.#e.systemInfo;static \u0275fac=function(e){return new(e||s)};static \u0275cmp=p({type:s,selectors:[["app-system-info"]],decls:5,vars:3,consts:()=>{let t;return t=$localize`System info`,[t]},template:function(e,d){e&1&&(n(0,"h3"),a(1,0),o(),n(2,"pre"),r(3),l(4,"json"),o()),e&2&&(f(3),_(c(4,1,d.systemInfo())))},dependencies:[S],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:p2r(0 0 20)}"],changeDetection:0})};export{i as default};
1
+ import{a as y}from"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-PIDBEXSZ.js";import"./chunk-5XX7BU4I.js";import{sa as S}from"./chunk-5ZK3D2RS.js";import{Eb as n,Fb as o,Ra as f,Sb as a,X as m,fb as p,ic as r,jc as _,vc as l,wc as c}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var i=class s{#e=m(y);systemInfo=this.#e.systemInfo;static \u0275fac=function(e){return new(e||s)};static \u0275cmp=p({type:s,selectors:[["app-system-info"]],decls:5,vars:3,consts:()=>{let t;return t=$localize`System info`,[t]},template:function(e,d){e&1&&(n(0,"h3"),a(1,0),o(),n(2,"pre"),r(3),l(4,"json"),o()),e&2&&(f(3),_(c(4,1,d.systemInfo())))},dependencies:[S],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:p2r(0 0 20)}"],changeDetection:0})};export{i as default};
@@ -1 +1 @@
1
- import{a as k}from"./chunk-W6WGCBBX.js";import"./chunk-QZCTOSPE.js";import"./chunk-PIDBEXSZ.js";import{a as T,g as M,h as f}from"./chunk-EHV3OZDB.js";import{Y as S}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Eb as e,Fb as n,Gb as _,Qb as s,Ra as c,Rb as l,Sb as i,fb as D,rc as d,vb as r}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var E=()=>["/backup/new"],F=()=>["/backup/import"],u=class C{static \u0275fac=function(t){return new(t||C)};static \u0275cmp=D({type:C,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let p;p=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import you can adjust the setings.`;let m;return m=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[a,t,p,A,g,P,m,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["spk-button","",1,"raised","primary",3,"routerLink"]]},template:function(t,p){t&1&&(_(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"spk-card",8),_(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),s(12,3),_(13,"spk-icon"),l(),n()(),e(14,"spk-card",8),_(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),s(21,6),_(22,"spk-icon"),l(),n()()()()),t&2&&(c(11),r("routerLink",d(2,E)),c(9),r("routerLink",d(3,F)))},dependencies:[k,M,f,T,S],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:700px}spk-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}spk-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:300px}spk-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
1
+ import{a as k}from"./chunk-SZ4NLIO2.js";import"./chunk-QZCTOSPE.js";import"./chunk-PIDBEXSZ.js";import{a as T,g as M,h as f}from"./chunk-EHV3OZDB.js";import{Y as S}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Eb as e,Fb as n,Gb as _,Qb as s,Ra as c,Rb as l,Sb as i,fb as D,rc as d,vb as r}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var E=()=>["/backup/new"],F=()=>["/backup/import"],u=class C{static \u0275fac=function(t){return new(t||C)};static \u0275cmp=D({type:C,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let p;p=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import you can adjust the setings.`;let m;return m=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[a,t,p,A,g,P,m,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["spk-button","",1,"raised","primary",3,"routerLink"]]},template:function(t,p){t&1&&(_(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"spk-card",8),_(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),s(12,3),_(13,"spk-icon"),l(),n()(),e(14,"spk-card",8),_(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),s(21,6),_(22,"spk-icon"),l(),n()()()()),t&2&&(c(11),r("routerLink",d(2,E)),c(9),r("routerLink",d(3,F)))},dependencies:[k,M,f,T,S],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:700px}spk-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}spk-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:300px}spk-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
@@ -1 +1 @@
1
- import{j as a,k as b}from"./chunk-4UJICSQB.js";import"./chunk-QSMEC63O.js";import"./chunk-DNHLTHLR.js";import"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createScheduleForm,b as default};
1
+ import{j as a,k as b}from"./chunk-L6DT3BQG.js";import"./chunk-DE2AAZUP.js";import"./chunk-DNHLTHLR.js";import"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createScheduleForm,b as default};
@@ -1 +1 @@
1
- import{a as ue}from"./chunk-UUMKHH4F.js";import{s as ge}from"./chunk-7SJHYZC5.js";import{a as pe}from"./chunk-PIDBEXSZ.js";import{a as D,f as he,k as _e,l as fe,n as me,v as Ce}from"./chunk-EHV3OZDB.js";import{ia as de}from"./chunk-5ZK3D2RS.js";import{Ab as P,Cb as te,Db as ne,E as V,Eb as p,Fb as u,Gb as ie,Jb as X,Kb as I,Kc as B,Mc as k,Ra as h,Sb as A,Tb as oe,Ub as re,Wb as O,X as H,Xb as g,Yb as L,Za as y,Zb as x,_a as q,ab as Z,ea as w,fa as N,fb as R,fc as Q,gc as se,hc as z,ic as b,kc as le,lb as v,qa as G,ra as m,sc as W,tc as ae,v as Y,vb as K,wb as ee,xb as E,yc as ce}from"./chunk-MR4RE3IB.js";import{a as $,b as j}from"./chunk-C6Q5SG76.js";var Me=["treeContainer"],ye=["formRef"],Oe=[[["label"]],[["label"]],[["input"]]],Se=["label","label","input"],Fe=(i,t)=>t.id,we=i=>({children:i,level:0}),ve=i=>({$implicit:i}),Ne=(i,t)=>({children:i,level:t});function ke(i,t){if(i&1){let e=I();p(0,"spk-button-group")(1,"button",13),O("click",function(){w(e);let s=g();return N(s.pathDiscoveryMethod.set("browse"))}),A(2,4),u(),p(3,"button",13),O("click",function(){w(e);let s=g();return N(s.pathDiscoveryMethod.set("path"))}),A(4,5),u()()}if(i&2){let e=g();h(),E("active",e.pathDiscoveryMethod()==="browse"),h(2),E("active",e.pathDiscoveryMethod()==="path")}}function Re(i,t){i&1&&ie(0,"spk-progress-bar",9)}function Ie(i,t){i&1&&(p(0,"spk-icon",16),b(1,"folder-open"),u())}function Ae(i,t){i&1&&(p(0,"spk-icon"),b(1,"file"),u())}function Le(i,t){i&1&&(p(0,"spk-icon",16),b(1,"folder"),u())}function We(i,t){if(i&1&&v(0,Ie,2,0,"spk-icon",16)(1,Ae,2,0,"spk-icon")(2,Le,2,0,"spk-icon",16),i&2){let e=g(2).$implicit;P(e.children.length?0:e.cls==="file"?1:2)}}function Be(i,t){i&1&&(p(0,"spk-icon",16),b(1,"desktop-tower"),u())}function De(i,t){i&1&&X(0)}function $e(i,t){if(i&1&&v(0,De,1,0,"ng-container",10),i&2){let e=g(2).$implicit,n=g().$implicit;g();let s=z(7);K("ngTemplateOutlet",s)("ngTemplateOutletContext",W(5,ve,ae(2,Ne,e.children,n.level+1)))}}function je(i,t){if(i&1){let e=I();p(0,"div",14,3),O("click",function(){w(e);let s=g().$implicit,o=g(2);return N(o.toggleNode(s.id,s))}),p(2,"div",15),v(3,We,3,1)(4,Be,2,0,"spk-icon",16),u(),p(5,"div",17),O("click",function(s){w(e);let o=g().$implicit,r=g(2);return N(r.toggleSelectedNode(s,o))}),b(6),u()(),v(7,$e,1,7,"ng-container")}if(i&2){let e=g().$implicit,n=g(2);E("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden),h(3),P(e.id!=="/"?3:4),h(3),le(" ",e.text," "),h(),P(e.children.length>0?7:-1)}}function Ve(i,t){if(i&1&&v(0,je,8,13),i&2){let e=t.$implicit,n=g(2);P(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function He(i,t){if(i&1&&(p(0,"spk-list"),te(1,Ve,1,1,null,null,Fe),u()),i&2){let e=t.$implicit;ee("padding-left",e.level*.5,"rem"),h(),ne(e.children)}}function Ge(i,t){i&1&&X(0)}function qe(i,t){if(i&1){let e=I();p(0,"spk-toggle",18),O("click",function(){w(e);let s=g();return N(s._showHiddenNodes.set(!s._showHiddenNodes()))}),A(1,6),u()}if(i&2){let e=g();E("active",e._showHiddenNodes()),h(),oe(e.showFiles()?"files":"folders"),re(1)}}var Ee=(o=>(o[o.ExcludedByParent=-2]="ExcludedByParent",o[o.Excluded=-1]="Excluded",o[o.None=0]="None",o[o.Included=1]="Included",o[o.IncludedByParent=2]="IncludedByParent",o))(Ee||{}),U=class i{#t=H(pe);#r=H(ue);multiSelect=m(!1);disabled=m(!1);showFiles=m(!1);selectFiles=m(!1);accepts=m(null);startingPath=m(null);rootPath=m(void 0);backupSettings=m(null);showHiddenNodes=m(!1);includes=G();excludes=G();_showHiddenNodes=y(!1);treeContainerRef=q("treeContainer");formRef=q("formRef");pathDiscoveryMethod=y("browse");isLoading=y(!1);currentPath=y("/");#e=y(null);treeSearchQuery=y("");treeNodes=y([]);filterGroups=this.#r.filterGroups();isByBackupSettings=B(()=>this.rootPath()&&this.backupSettings()?.id&&this.backupSettings()?.time);searchableTreeNodes=B(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Ee;treeStructure=B(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(a=>a!==""&&a!=="/"),n=structuredClone(e);for(let a=0;a<n.length;a++){let _=n[a].slice(1);if(_.startsWith("{")&&_.endsWith("}")){let f=_.slice(1,-1),d=this.filterGroups?.FilterGroups[f];if(d&&d.length){let M=d.map(T=>`-${T}`);n.splice(a,1,...M)}}}let s=this.searchableTreeNodes(),o=new Map,r=this.rootPath(),C=this.accepts(),l=r?{id:r,resolvedpath:r,text:r?.replaceAll("/",""),parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}:{id:"/",resolvedpath:"/",text:"Computer",parentPath:"",children:[],evalState:0,isIndeterminate:!1};C&&(l.accepted=!0),o.set("/",l);for(let a of s){let _=a.id.replace(r??"","").split("/").filter(Boolean),f="",d=l;for(let M of _){if(f+="/"+M,!o.has(f)){let T=a.hidden===!0&&t?0:this.#s(n,a.id,a.cls,d),S={id:a.id,isIndeterminate:this.isIndeterminate(n,a.id),evalState:T,parentPath:f,resolvedpath:a.id?.startsWith("%")?a.resolvedpath+"/":f,hidden:a.hidden,text:a.text,cls:a.cls,children:[]};C&&(S.accepted=this.matchAccepts(C,S)),o.set(f,S),d.children.push(S)}d=o.get(f)}}return[l]});#s(t,e,n,s){if(s.evalState===-1)return-2;let o=0,r=t.filter(l=>!l.startsWith("-")&&!l.startsWith("+")),C=t.filter(l=>l.startsWith("-")||l.startsWith("+"));if(r.length===0)return o;for(let l=0;l<r.length;l++){let a=r[l];if(e?.startsWith(a)){o=1;break}}if(C.length===0)return o;for(let l=0;l<C.length;l++){let a=C[l],c=a.slice(1),_=a.startsWith("-")?"exclude":"include";if(c.startsWith("/")&&c.endsWith("/")){if(n!=="folder")continue;if(e===c){o=_==="include"?1:-1;break}}if(c.startsWith("*")&&c.endsWith("*/")){if(n!=="folder")continue;let d=c.slice(1,-2);if(d==="")break;if(e?.includes(d+"/")){o=_==="include"?1:-1;break}}if(c.startsWith("[.*")&&c.endsWith("[^\\/]*]")){if(n!=="file")continue;let d=c.slice(3,-7);if(new RegExp(d).test(e)){o=_==="include"?1:-1;break}}if(c.startsWith("[")&&c.endsWith("]")){let d=c.slice(1,-1),M=this.translateCSharpRegex(d);if(new RegExp(`${M}`).test(e)){o=_==="include"?1:-1;break}}if(c.startsWith("*.")){if(n!=="file"||c.replace("*.","").length===0)continue;if(this.#n(e,c,!0)){o=_==="include"?1:-1;break}}if(c==="")continue;if(this.#n(e,c,!0)){o=_==="include"?1:-1;break}}return o}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(s,o,r)=>`(${r})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.some(n=>n.startsWith(e))}#n(t,e,n=!1){let s=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${s}${n?"$":""}`).test(t)}showHiddenNodesEffect=k(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=k(()=>{let t=this.pathDiscoveryMethod(),e=this.#e();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id==="/")return!0;let n=t.split(",");if(n.length===0)return!0;let s="."+e.id.slice(e.id.indexOf("."));return s?n.some(o=>s.endsWith(o)):!1}currentPathEffect=k(()=>{let t=this.#e();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=k(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#l(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.#e.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();t?(this.currentPath.set(t),this.#d(t)):this.#o(null,this.rootPath())}toggleSelectedNode(t,e){if(e.id==="/"||(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 s=this.currentPath().split("\0").filter(r=>r!==""&&r!=="/"),o=this.isChildOfSelected(e)?`-${e.id}`:e.id;this.multiSelect()?s.includes(e.id)?this.currentPath.set(s.filter(r=>r!==e.id).join("\0")):s.some(r=>r.startsWith(o))?this.currentPath.set(s.filter(r=>r!==o).join("\0")):this.currentPath.set([...s,o].join("\0")):s.includes(e.id)?this.currentPath.set(s.filter(r=>r!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!=="/").some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(s=>!s.id?.startsWith(e.id)||s.id===e.id)):this.#o(e,t))}#l(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}#a(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#c(t){let e=this.backupSettings(),n={id:e.id,time:e.time,prefixOnly:!1,folderContents:!0};return t&&(n.filter="@"+t),this.#t.getApiV1BackupByIdFiles(n)}#i(t){return this.isByBackupSettings()?this.#c(t):this.#a(t)}#d(t){let e=t.split("\0").filter(r=>r.startsWith("-")).map(r=>r.slice(1,-1)),n=t.split("\0").filter(r=>!r.startsWith("-")).filter(Boolean),s=n.map(r=>r.split("/").filter(Boolean)),o=[this.rootPath()??"/"];s.forEach(r=>{r.forEach((C,l)=>{let a=r.slice(0,l+1).join("/"),c=a.startsWith("%")?a:"/"+a;o.includes(c)||o.push(c)})}),this.isLoading.set(!0),Y([...o.map(r=>this.#i(r))]).pipe(V(()=>this.isLoading.set(!1))).subscribe({next:r=>{this.treeNodes.update(C=>{let l=r.flatMap(c=>c.map(_=>{let f=_.id,d=f&&f.split("/").filter(Boolean).slice(0,-1).join("/"),T="/"+(f&&f.split("/").filter(Boolean).join("/")),S=n.findIndex(F=>this.multiSelect()?T.startsWith(F):T===F)>-1,Pe=n.findIndex(F=>F===f)>-1,Te=e.findIndex(F=>F===T)>-1;return j($({},_),{parentPath:d.startsWith("%")?d:"/"+d,isSelected:S&&!Te||Pe})}));return[...new Map([...C,...l].map(c=>[c.resolvedpath??c.id,c])).values()]})}})}#o(t=null,e="/"){this.isLoading.set(!0),this.#i(e).pipe(V(()=>this.isLoading.set(!1))).subscribe({next:n=>{let s=this.isByBackupSettings()?n.Files.map(o=>({text:o.Path.split("/").filter(r=>r!=="").pop(),id:o.Path,cls:o.Path.endsWith("/")?"folder":"file",leaf:t!==null,resolvedpath:o.Path,hidden:!1})):n;this.treeNodes.update(o=>{let r=s.map(l=>{let a=l.id.startsWith("%")&&l.id.endsWith("%")||l.id.endsWith("/")?"folder":"file";return j($({},l),{cls:a,parentPath:e})});return[...new Map([...o,...r].map(l=>[l.resolvedpath??l.id,l])).values()]})}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=R({type:i,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&(Q(n.treeContainerRef,Me,5),Q(n.formRef,ye,5)),e&2&&se(2)},hostVars:2,hostBindings:function(e,n){e&2&&E("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPath:[1,"rootPath"],backupSettings:[1,"backupSettings"],showHiddenNodes:[1,"showHiddenNodes"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:Se,decls:15,vars:15,consts:()=>{let t;t=$localize` Browser path `;let e;e=$localize` Manually type path `;let n;return n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"primary","raised","browse-files-toggle",3,"active"],[1,"form-field"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"spk-primary"],[1,"text",3,"click"],[1,"primary","raised","browse-files-toggle",3,"click"]]},template:function(e,n){if(e&1&&(L(Oe),v(0,ke,5,4,"spk-button-group"),p(1,"div",7),x(2,0,["ngProjectAs","label",5,["label"]]),p(3,"div",8,0),v(5,Re,1,0,"spk-progress-bar",9)(6,He,3,2,"ng-template",null,1,ce)(8,Ge,1,0,"ng-container",10),u(),v(9,qe,2,3,"spk-toggle",11),u(),p(10,"div",12,2)(12,"spk-form-field"),x(13,1,["ngProjectAs","label",5,["label"]]),x(14,2,["ngProjectAs","input",5,["input"]]),u()()),e&2){let s=z(7);P(n.multiSelect()?-1:0),h(),E("hidden",n.pathDiscoveryMethod()!=="browse"),h(2),E("visualize-accepted",n.accepts()),h(2),P(n.isLoading()?5:-1),h(3),K("ngTemplateOutlet",s)("ngTemplateOutletContext",W(13,ve,W(11,we,n.treeStructure()))),h(),P(n.accepts()?-1:9),h(),E("hidden",n.pathDiscoveryMethod()!=="path")}},dependencies:[he,Ce,D,_e,fe,me,de,ge],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%] spk-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-level-40);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-level-10);position:relative}.browse-files[_ngcontent-%COMP%] spk-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%] spk-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-level-30);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:.25rem;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:var(--base-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] spk-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%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-level-60R)}.hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var Ke=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],Xe=["[title]","[description]","[action]","*"];function Qe(i,t){i&1&&b(0,"Title")}function ze(i,t){i&1&&(p(0,"spk-icon"),b(1,"caret-down"),u())}var J=class i{isActive=Z(!1);disallowToggle=m(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=R({type:i,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,n){e&2&&E("active",n.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:Xe,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(e,n){e&1&&(L(Ke),p(0,"header")(1,"div",0)(2,"h3",1),O("click",function(){return n.disallowToggle()||n.toggle()}),x(3,0,null,Qe,1,0),v(5,ze,2,0,"spk-icon"),u(),x(6,1),u(),p(7,"div",2),x(8,2),u()(),p(9,"div",3),x(10,3),u()),e&2&&(h(5),P(n.disallowToggle()?-1:5))},dependencies:[D],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-level-20)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};export{U as a,J as b};
1
+ import{a as ue}from"./chunk-V7APGUBT.js";import{s as ge}from"./chunk-7SJHYZC5.js";import{a as pe}from"./chunk-PIDBEXSZ.js";import{a as D,f as he,k as _e,l as fe,n as me,v as Ce}from"./chunk-EHV3OZDB.js";import{ia as de}from"./chunk-5ZK3D2RS.js";import{Ab as P,Cb as te,Db as ne,E as V,Eb as p,Fb as u,Gb as ie,Jb as X,Kb as I,Kc as B,Mc as k,Ra as h,Sb as A,Tb as oe,Ub as re,Wb as O,X as H,Xb as g,Yb as L,Za as y,Zb as x,_a as q,ab as Z,ea as w,fa as N,fb as R,fc as Q,gc as se,hc as z,ic as b,kc as le,lb as v,qa as G,ra as m,sc as W,tc as ae,v as Y,vb as K,wb as ee,xb as E,yc as ce}from"./chunk-MR4RE3IB.js";import{a as $,b as j}from"./chunk-C6Q5SG76.js";var Me=["treeContainer"],ye=["formRef"],Oe=[[["label"]],[["label"]],[["input"]]],Se=["label","label","input"],Fe=(i,t)=>t.id,we=i=>({children:i,level:0}),ve=i=>({$implicit:i}),Ne=(i,t)=>({children:i,level:t});function ke(i,t){if(i&1){let e=I();p(0,"spk-button-group")(1,"button",13),O("click",function(){w(e);let s=g();return N(s.pathDiscoveryMethod.set("browse"))}),A(2,4),u(),p(3,"button",13),O("click",function(){w(e);let s=g();return N(s.pathDiscoveryMethod.set("path"))}),A(4,5),u()()}if(i&2){let e=g();h(),E("active",e.pathDiscoveryMethod()==="browse"),h(2),E("active",e.pathDiscoveryMethod()==="path")}}function Re(i,t){i&1&&ie(0,"spk-progress-bar",9)}function Ie(i,t){i&1&&(p(0,"spk-icon",16),b(1,"folder-open"),u())}function Ae(i,t){i&1&&(p(0,"spk-icon"),b(1,"file"),u())}function Le(i,t){i&1&&(p(0,"spk-icon",16),b(1,"folder"),u())}function We(i,t){if(i&1&&v(0,Ie,2,0,"spk-icon",16)(1,Ae,2,0,"spk-icon")(2,Le,2,0,"spk-icon",16),i&2){let e=g(2).$implicit;P(e.children.length?0:e.cls==="file"?1:2)}}function Be(i,t){i&1&&(p(0,"spk-icon",16),b(1,"desktop-tower"),u())}function De(i,t){i&1&&X(0)}function $e(i,t){if(i&1&&v(0,De,1,0,"ng-container",10),i&2){let e=g(2).$implicit,n=g().$implicit;g();let s=z(7);K("ngTemplateOutlet",s)("ngTemplateOutletContext",W(5,ve,ae(2,Ne,e.children,n.level+1)))}}function je(i,t){if(i&1){let e=I();p(0,"div",14,3),O("click",function(){w(e);let s=g().$implicit,o=g(2);return N(o.toggleNode(s.id,s))}),p(2,"div",15),v(3,We,3,1)(4,Be,2,0,"spk-icon",16),u(),p(5,"div",17),O("click",function(s){w(e);let o=g().$implicit,r=g(2);return N(r.toggleSelectedNode(s,o))}),b(6),u()(),v(7,$e,1,7,"ng-container")}if(i&2){let e=g().$implicit,n=g(2);E("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden),h(3),P(e.id!=="/"?3:4),h(3),le(" ",e.text," "),h(),P(e.children.length>0?7:-1)}}function Ve(i,t){if(i&1&&v(0,je,8,13),i&2){let e=t.$implicit,n=g(2);P(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function He(i,t){if(i&1&&(p(0,"spk-list"),te(1,Ve,1,1,null,null,Fe),u()),i&2){let e=t.$implicit;ee("padding-left",e.level*.5,"rem"),h(),ne(e.children)}}function Ge(i,t){i&1&&X(0)}function qe(i,t){if(i&1){let e=I();p(0,"spk-toggle",18),O("click",function(){w(e);let s=g();return N(s._showHiddenNodes.set(!s._showHiddenNodes()))}),A(1,6),u()}if(i&2){let e=g();E("active",e._showHiddenNodes()),h(),oe(e.showFiles()?"files":"folders"),re(1)}}var Ee=(o=>(o[o.ExcludedByParent=-2]="ExcludedByParent",o[o.Excluded=-1]="Excluded",o[o.None=0]="None",o[o.Included=1]="Included",o[o.IncludedByParent=2]="IncludedByParent",o))(Ee||{}),U=class i{#t=H(pe);#r=H(ue);multiSelect=m(!1);disabled=m(!1);showFiles=m(!1);selectFiles=m(!1);accepts=m(null);startingPath=m(null);rootPath=m(void 0);backupSettings=m(null);showHiddenNodes=m(!1);includes=G();excludes=G();_showHiddenNodes=y(!1);treeContainerRef=q("treeContainer");formRef=q("formRef");pathDiscoveryMethod=y("browse");isLoading=y(!1);currentPath=y("/");#e=y(null);treeSearchQuery=y("");treeNodes=y([]);filterGroups=this.#r.filterGroups();isByBackupSettings=B(()=>this.rootPath()&&this.backupSettings()?.id&&this.backupSettings()?.time);searchableTreeNodes=B(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Ee;treeStructure=B(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(a=>a!==""&&a!=="/"),n=structuredClone(e);for(let a=0;a<n.length;a++){let _=n[a].slice(1);if(_.startsWith("{")&&_.endsWith("}")){let f=_.slice(1,-1),d=this.filterGroups?.FilterGroups[f];if(d&&d.length){let M=d.map(T=>`-${T}`);n.splice(a,1,...M)}}}let s=this.searchableTreeNodes(),o=new Map,r=this.rootPath(),C=this.accepts(),l=r?{id:r,resolvedpath:r,text:r?.replaceAll("/",""),parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}:{id:"/",resolvedpath:"/",text:"Computer",parentPath:"",children:[],evalState:0,isIndeterminate:!1};C&&(l.accepted=!0),o.set("/",l);for(let a of s){let _=a.id.replace(r??"","").split("/").filter(Boolean),f="",d=l;for(let M of _){if(f+="/"+M,!o.has(f)){let T=a.hidden===!0&&t?0:this.#s(n,a.id,a.cls,d),S={id:a.id,isIndeterminate:this.isIndeterminate(n,a.id),evalState:T,parentPath:f,resolvedpath:a.id?.startsWith("%")?a.resolvedpath+"/":f,hidden:a.hidden,text:a.text,cls:a.cls,children:[]};C&&(S.accepted=this.matchAccepts(C,S)),o.set(f,S),d.children.push(S)}d=o.get(f)}}return[l]});#s(t,e,n,s){if(s.evalState===-1)return-2;let o=0,r=t.filter(l=>!l.startsWith("-")&&!l.startsWith("+")),C=t.filter(l=>l.startsWith("-")||l.startsWith("+"));if(r.length===0)return o;for(let l=0;l<r.length;l++){let a=r[l];if(e?.startsWith(a)){o=1;break}}if(C.length===0)return o;for(let l=0;l<C.length;l++){let a=C[l],c=a.slice(1),_=a.startsWith("-")?"exclude":"include";if(c.startsWith("/")&&c.endsWith("/")){if(n!=="folder")continue;if(e===c){o=_==="include"?1:-1;break}}if(c.startsWith("*")&&c.endsWith("*/")){if(n!=="folder")continue;let d=c.slice(1,-2);if(d==="")break;if(e?.includes(d+"/")){o=_==="include"?1:-1;break}}if(c.startsWith("[.*")&&c.endsWith("[^\\/]*]")){if(n!=="file")continue;let d=c.slice(3,-7);if(new RegExp(d).test(e)){o=_==="include"?1:-1;break}}if(c.startsWith("[")&&c.endsWith("]")){let d=c.slice(1,-1),M=this.translateCSharpRegex(d);if(new RegExp(`${M}`).test(e)){o=_==="include"?1:-1;break}}if(c.startsWith("*.")){if(n!=="file"||c.replace("*.","").length===0)continue;if(this.#n(e,c,!0)){o=_==="include"?1:-1;break}}if(c==="")continue;if(this.#n(e,c,!0)){o=_==="include"?1:-1;break}}return o}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(s,o,r)=>`(${r})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.some(n=>n.startsWith(e))}#n(t,e,n=!1){let s=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${s}${n?"$":""}`).test(t)}showHiddenNodesEffect=k(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=k(()=>{let t=this.pathDiscoveryMethod(),e=this.#e();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id==="/")return!0;let n=t.split(",");if(n.length===0)return!0;let s="."+e.id.slice(e.id.indexOf("."));return s?n.some(o=>s.endsWith(o)):!1}currentPathEffect=k(()=>{let t=this.#e();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=k(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#l(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.#e.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();t?(this.currentPath.set(t),this.#d(t)):this.#o(null,this.rootPath())}toggleSelectedNode(t,e){if(e.id==="/"||(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 s=this.currentPath().split("\0").filter(r=>r!==""&&r!=="/"),o=this.isChildOfSelected(e)?`-${e.id}`:e.id;this.multiSelect()?s.includes(e.id)?this.currentPath.set(s.filter(r=>r!==e.id).join("\0")):s.some(r=>r.startsWith(o))?this.currentPath.set(s.filter(r=>r!==o).join("\0")):this.currentPath.set([...s,o].join("\0")):s.includes(e.id)?this.currentPath.set(s.filter(r=>r!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!=="/").some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(s=>!s.id?.startsWith(e.id)||s.id===e.id)):this.#o(e,t))}#l(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}#a(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#c(t){let e=this.backupSettings(),n={id:e.id,time:e.time,prefixOnly:!1,folderContents:!0};return t&&(n.filter="@"+t),this.#t.getApiV1BackupByIdFiles(n)}#i(t){return this.isByBackupSettings()?this.#c(t):this.#a(t)}#d(t){let e=t.split("\0").filter(r=>r.startsWith("-")).map(r=>r.slice(1,-1)),n=t.split("\0").filter(r=>!r.startsWith("-")).filter(Boolean),s=n.map(r=>r.split("/").filter(Boolean)),o=[this.rootPath()??"/"];s.forEach(r=>{r.forEach((C,l)=>{let a=r.slice(0,l+1).join("/"),c=a.startsWith("%")?a:"/"+a;o.includes(c)||o.push(c)})}),this.isLoading.set(!0),Y([...o.map(r=>this.#i(r))]).pipe(V(()=>this.isLoading.set(!1))).subscribe({next:r=>{this.treeNodes.update(C=>{let l=r.flatMap(c=>c.map(_=>{let f=_.id,d=f&&f.split("/").filter(Boolean).slice(0,-1).join("/"),T="/"+(f&&f.split("/").filter(Boolean).join("/")),S=n.findIndex(F=>this.multiSelect()?T.startsWith(F):T===F)>-1,Pe=n.findIndex(F=>F===f)>-1,Te=e.findIndex(F=>F===T)>-1;return j($({},_),{parentPath:d.startsWith("%")?d:"/"+d,isSelected:S&&!Te||Pe})}));return[...new Map([...C,...l].map(c=>[c.resolvedpath??c.id,c])).values()]})}})}#o(t=null,e="/"){this.isLoading.set(!0),this.#i(e).pipe(V(()=>this.isLoading.set(!1))).subscribe({next:n=>{let s=this.isByBackupSettings()?n.Files.map(o=>({text:o.Path.split("/").filter(r=>r!=="").pop(),id:o.Path,cls:o.Path.endsWith("/")?"folder":"file",leaf:t!==null,resolvedpath:o.Path,hidden:!1})):n;this.treeNodes.update(o=>{let r=s.map(l=>{let a=l.id.startsWith("%")&&l.id.endsWith("%")||l.id.endsWith("/")?"folder":"file";return j($({},l),{cls:a,parentPath:e})});return[...new Map([...o,...r].map(l=>[l.resolvedpath??l.id,l])).values()]})}})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=R({type:i,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&(Q(n.treeContainerRef,Me,5),Q(n.formRef,ye,5)),e&2&&se(2)},hostVars:2,hostBindings:function(e,n){e&2&&E("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPath:[1,"rootPath"],backupSettings:[1,"backupSettings"],showHiddenNodes:[1,"showHiddenNodes"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:Se,decls:15,vars:15,consts:()=>{let t;t=$localize` Browser path `;let e;e=$localize` Manually type path `;let n;return n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"primary","raised","browse-files-toggle",3,"active"],[1,"form-field"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"spk-primary"],[1,"text",3,"click"],[1,"primary","raised","browse-files-toggle",3,"click"]]},template:function(e,n){if(e&1&&(L(Oe),v(0,ke,5,4,"spk-button-group"),p(1,"div",7),x(2,0,["ngProjectAs","label",5,["label"]]),p(3,"div",8,0),v(5,Re,1,0,"spk-progress-bar",9)(6,He,3,2,"ng-template",null,1,ce)(8,Ge,1,0,"ng-container",10),u(),v(9,qe,2,3,"spk-toggle",11),u(),p(10,"div",12,2)(12,"spk-form-field"),x(13,1,["ngProjectAs","label",5,["label"]]),x(14,2,["ngProjectAs","input",5,["input"]]),u()()),e&2){let s=z(7);P(n.multiSelect()?-1:0),h(),E("hidden",n.pathDiscoveryMethod()!=="browse"),h(2),E("visualize-accepted",n.accepts()),h(2),P(n.isLoading()?5:-1),h(3),K("ngTemplateOutlet",s)("ngTemplateOutletContext",W(13,ve,W(11,we,n.treeStructure()))),h(),P(n.accepts()?-1:9),h(),E("hidden",n.pathDiscoveryMethod()!=="path")}},dependencies:[he,Ce,D,_e,fe,me,de,ge],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%] spk-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-level-40);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-level-10);position:relative}.browse-files[_ngcontent-%COMP%] spk-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%] spk-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-level-30);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:.25rem;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:var(--base-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] spk-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%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-level-60R)}.hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var Ke=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],Xe=["[title]","[description]","[action]","*"];function Qe(i,t){i&1&&b(0,"Title")}function ze(i,t){i&1&&(p(0,"spk-icon"),b(1,"caret-down"),u())}var J=class i{isActive=Z(!1);disallowToggle=m(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=R({type:i,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,n){e&2&&E("active",n.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:Xe,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(e,n){e&1&&(L(Ke),p(0,"header")(1,"div",0)(2,"h3",1),O("click",function(){return n.disallowToggle()||n.toggle()}),x(3,0,null,Qe,1,0),v(5,ze,2,0,"spk-icon"),u(),x(6,1),u(),p(7,"div",2),x(8,2),u()(),p(9,"div",3),x(10,3),u()),e&2&&(h(5),P(n.disallowToggle()?-1:5))},dependencies:[D],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-level-20)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};export{U as a,J as b};
@@ -0,0 +1 @@
1
+ import{a as ue}from"./chunk-SZ4NLIO2.js";import{a as se}from"./chunk-QZCTOSPE.js";import"./chunk-PIDBEXSZ.js";import{a as I,g as R,h as le,j as ce,m as re,n as pe}from"./chunk-EHV3OZDB.js";import{Y as H}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Ab as S,Bb as Z,Cb as ee,Db as ne,Eb as o,Fb as i,Gb as p,Hb as M,Ib as E,Kb as te,Qb as m,Ra as l,Rb as O,Sb as c,Tb as oe,Ub as ie,Wb as f,X as q,Xb as s,ea as k,fa as P,fb as J,ic as u,kc as T,lb as d,rc as F,sb as Q,sc as $,tb as Y,vb as C,vc as A,wc as _e,xb as N,xc as ae}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var de=()=>[H,R,I,ce,re,import("./chunk-4TN5W4QO.js").then(e=>e.DatePipe),import("./chunk-BEZGDXHL.js").then(e=>e.DurationFormatPipe)],Me=()=>["/add-backup"],Ee=()=>["/restore"],ge=e=>["/backup",e],Ce=e=>["/backup",e,"export"];function Se(e,_){if(e&1&&(u(0," - "),M(1),c(2,14),E(),u(3),A(4,"durationFormat")),e&2){let n=s().$implicit;l(3),T(" ",_e(4,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration)," ")}}function me(e,_){e&1&&(M(0),c(1,15),E())}function Oe(e,_){if(e&1&&u(0),e&2){let n=s().$implicit;T(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString," ")}}function Te(e,_){e&1&&(M(0),c(1,16),E())}function ke(e,_){if(e&1&&u(0),e&2){let n=s().$implicit;T(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetSizeString," ")}}function Pe(e,_){e&1&&(M(0),c(1,17),E())}function Ne(e,_){if(e&1&&(o(0,"spk-chip",30),c(1,18),i()),e&2){let n=s().$implicit;l(),oe(n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount),ie(1)}}function fe(e,_){e&1&&(o(0,"spk-chip",31),c(1,19),i())}function Fe(e,_){if(e&1){let n=te();o(0,"div",29)(1,"div",24)(2,"h3"),u(3),o(4,"spk-icon"),u(5,"database"),i()(),o(6,"p")(7,"span"),c(8,8),i(),u(9),A(10,"date"),d(11,Se,5,3)(12,me,2,0,"ng-container"),i(),o(13,"p")(14,"span"),c(15,9),i(),d(16,Oe,1,1)(17,Te,2,0,"ng-container"),i(),o(18,"p")(19,"span"),c(20,10),i(),d(21,ke,1,1)(22,Pe,2,0,"ng-container"),i()(),d(23,Ne,2,1,"spk-chip",30)(24,fe,2,0,"spk-chip",31),o(25,"div",32)(26,"button",33),f("click",function(){let r=k(n).$implicit,g=s(3);return P(g.startBackup(r.Backup==null?null:r.Backup.ID))}),m(27,11),p(28,"spk-icon"),O(),i(),o(29,"button",34)(30,"spk-icon"),u(31,"pencil-simple"),i()(),o(32,"spk-menu",35)(33,"button",25)(34,"spk-icon"),u(35,"dots-three-vertical"),i()(),M(36,36),o(37,"button",37,0),m(39,12),p(40,"spk-icon"),O(),i(),o(41,"button",38,0),f("click",function(){let r=k(n).$implicit,g=s(3);return P(g.deleteBackup(r.Backup==null?null:r.Backup.ID))}),m(43,13),p(44,"spk-icon"),O(),i(),E(),i()()()}if(e&2){let n,t=_.$implicit,r=s(3);l(3),T(" ",(n=t.Backup==null?null:t.Backup.Name)!==null&&n!==void 0?n:r.MISSING_BACKUP_NAME," "),l(6),T(" ",ae(10,13,t.Backup==null||t.Backup.Metadata==null?null:t.Backup.Metadata.LastBackupDate,"short")," "),l(2),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDuration?11:12),l(5),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.SourceSizeString?16:17),l(5),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.TargetSizeString?21:22),l(2),S(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.BackupListCount?23:24),l(3),N("loader",r.startingBackup()),l(3),C("routerLink",$(16,ge,t.Backup==null?null:t.Backup.ID)),l(3),C("right",!0),l(5),C("routerLink",$(18,Ce,t.Backup==null?null:t.Backup.ID)),l(4),N("loader",r.deletingBackup()===(t.Backup==null?null:t.Backup.ID))}}function $e(e,_){if(e&1&&ee(0,Fe,45,20,"div",29,Z),e&2){let n=s(2);ne(n.backups())}}function Ae(e,_){e&1&&(M(0),c(1,20),E())}function He(e,_){if(e&1&&d(0,$e,2,0)(1,Ae,2,0,"ng-container"),e&2){let n=s();S(n.backups().length?0:1)}}function Ie(e,_){e&1&&(o(0,"div",39),p(1,"spk-progress-bar",40),o(2,"div",24)(3,"h3"),c(4,21),i()()())}var x=class e{#e=q(se);MISSING_BACKUP_NAME=$localize`Backup name missing`;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;ngOnInit(){this.#e.getBackups(!0)}startBackup(_){this.#e.startBackup(_)}deleteBackup(_){_&&window.confirm("Are you sure you want to delete this backup?")&&this.#e.deleteBackup(_)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=J({type:e,selectors:[["app-home"]],decls:31,vars:5,consts:()=>{let _;_=$localize`Backups`;let n;n=$localize`Backups are stored in the cloud and can be restored at any time.`;let t;t=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let r;r=$localize`Restores`;let g;g=$localize`Restores are stored in the cloud and can be restored at any time.`;let D;D=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let B;B=$localize`My backups`;let L;L=$localize`Last successful backup:`;let b;b=$localize`Source:`;let y;y=$localize`Destination:`;let G;G=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:play-circle${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Start `;let h;h=$localize` Export ${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let v;v=$localize` Delete ${"\uFFFD#44\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#44\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let X;X=$localize`took`;let z;z=$localize`N/A`;let w;w=$localize`N/A`;let K;K=$localize`N/A`;let V;V=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: Version `;let j;j=$localize`No version yet`;let U;U=$localize`No backups founds`;let W;return W=$localize`Loading backups...`,[["option",""],_,n,t,r,g,D,B,L,b,y,G,h,v,X,z,w,K,V,j,U,W,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"backups"],[1,"backup"],[1,"simple","success"],[1,"simple"],[1,"actions"],["spk-button","",3,"click"],["spk-button","",3,"routerLink"],[3,"right"],["menu",""],[3,"routerLink"],[3,"click"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(n,t){n&1&&(p(0,"app-status-bar"),o(1,"section")(2,"header")(3,"spk-card",22),p(4,"img",23),o(5,"div",24)(6,"h3"),c(7,1),i(),o(8,"p"),c(9,2),i()(),o(10,"button",25),m(11,3),p(12,"spk-icon"),O(),i()(),o(13,"spk-card",22),p(14,"img",26),o(15,"div",24)(16,"h3"),c(17,4),i(),o(18,"p"),c(19,5),i()(),o(20,"button",25),m(21,6),p(22,"spk-icon"),O(),i()()(),o(23,"div",27)(24,"h2"),c(25,7),i(),o(26,"div",28),d(27,He,2,1)(28,Ie,5,0),Q(29,27,de,null,28),i()()()),n&2&&(l(3),C("routerLink",F(3,Me)),l(10),C("routerLink",F(4,Ee)),l(16),Y(!t.backupsLoading()))},dependencies:[H,ue,le,R,I,pe],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:1rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-level-70)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{x as default};
@@ -1 +1 @@
1
- import{l as a,m as b}from"./chunk-4UJICSQB.js";import"./chunk-QSMEC63O.js";import"./chunk-DNHLTHLR.js";import"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createSourceDataForm,b as default};
1
+ import{l as a,m as b}from"./chunk-L6DT3BQG.js";import"./chunk-DE2AAZUP.js";import"./chunk-DNHLTHLR.js";import"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createSourceDataForm,b as default};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-W6WGCBBX.js";import{a as v}from"./chunk-QZCTOSPE.js";import{a as B}from"./chunk-PIDBEXSZ.js";import{a as h,g as y,h as b,n as L}from"./chunk-EHV3OZDB.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Ab as C,Bb as f,Cb as k,Db as O,Eb as a,Fb as r,Gb as p,Hb as M,Ib as P,Qb as N,Ra as l,Rb as F,Sb as _,Tb as $,Ub as D,X as c,Xb as d,fb as E,ic as A,lb as u,lc as I,sb as g,sc as x,tb as R,vb as T}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var X=()=>[b,y,h,import("./chunk-HEBDWN5N.js").then(e=>e.RouterLink)],w=e=>["/restore-flow",e];function z(e,o){if(e&1&&(a(0,"spk-card",5),p(1,"img",6),a(2,"div",7)(3,"h3"),_(4,1),r(),a(5,"p"),A(6),r()(),a(7,"button",8),N(8,2),p(9,"spk-icon"),F(),r()()),e&2){let t,i,n=o.$implicit;l(4),$((t=n.Backup==null?null:n.Backup.Name)!==null&&t!==void 0?t:"Backup name missing"),D(4),l(2),I(" ",(i=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString)!==null&&i!==void 0?i:"-"," / ",(i=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount)!==null&&i!==void 0?i:"-"," "),l(),T("routerLink",x(4,w,n.Backup==null?null:n.Backup.ID))}}function W(e,o){if(e&1&&k(0,z,10,6,"spk-card",5,f),e&2){let t=d(2);O(t.backups())}}function K(e,o){e&1&&(M(0),_(1,3),P())}function j(e,o){if(e&1&&u(0,W,2,0)(1,K,2,0,"ng-container"),e&2){let t=d();C(t.backups().length?0:1)}}function q(e,o){e&1&&(a(0,"div",9),p(1,"spk-progress-bar",10),a(2,"div",7)(3,"h3"),_(4,4),r()()())}var m=class e{#e=c(v);#t=c(B);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups()}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=E({type:e,selectors:[["app-restore"]],decls:8,vars:1,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let t;t=$localize`Restore ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let i;i=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let n;n=$localize`No backups founds`;let S;return S=$localize`Loading backups...`,[o,t,i,n,S,[1,"type-a"],["src","assets/images/folder.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(p(0,"app-status-bar"),a(1,"section")(2,"h2"),_(3,0),r(),u(4,j,2,1)(5,q,5,0),g(6,4,X,null,5),r()),t&2&&(l(6),R(!i.backupsLoading()))},dependencies:[G,L],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 0;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-level-60)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{m as default};
1
+ import{a as G}from"./chunk-SZ4NLIO2.js";import{a as v}from"./chunk-QZCTOSPE.js";import{a as B}from"./chunk-PIDBEXSZ.js";import{a as h,g as y,h as b,n as L}from"./chunk-EHV3OZDB.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Ab as C,Bb as f,Cb as k,Db as O,Eb as a,Fb as r,Gb as p,Hb as M,Ib as P,Qb as N,Ra as l,Rb as F,Sb as _,Tb as $,Ub as D,X as c,Xb as d,fb as E,ic as A,lb as u,lc as I,sb as g,sc as x,tb as R,vb as T}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var X=()=>[b,y,h,import("./chunk-HEBDWN5N.js").then(e=>e.RouterLink)],w=e=>["/restore-flow",e];function z(e,o){if(e&1&&(a(0,"spk-card",5),p(1,"img",6),a(2,"div",7)(3,"h3"),_(4,1),r(),a(5,"p"),A(6),r()(),a(7,"button",8),N(8,2),p(9,"spk-icon"),F(),r()()),e&2){let t,i,n=o.$implicit;l(4),$((t=n.Backup==null?null:n.Backup.Name)!==null&&t!==void 0?t:"Backup name missing"),D(4),l(2),I(" ",(i=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString)!==null&&i!==void 0?i:"-"," / ",(i=n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount)!==null&&i!==void 0?i:"-"," "),l(),T("routerLink",x(4,w,n.Backup==null?null:n.Backup.ID))}}function W(e,o){if(e&1&&k(0,z,10,6,"spk-card",5,f),e&2){let t=d(2);O(t.backups())}}function K(e,o){e&1&&(M(0),_(1,3),P())}function j(e,o){if(e&1&&u(0,W,2,0)(1,K,2,0,"ng-container"),e&2){let t=d();C(t.backups().length?0:1)}}function q(e,o){e&1&&(a(0,"div",9),p(1,"spk-progress-bar",10),a(2,"div",7)(3,"h3"),_(4,4),r()()())}var m=class e{#e=c(v);#t=c(B);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups()}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=E({type:e,selectors:[["app-restore"]],decls:8,vars:1,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let t;t=$localize`Restore ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let i;i=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let n;n=$localize`No backups founds`;let S;return S=$localize`Loading backups...`,[o,t,i,n,S,[1,"type-a"],["src","assets/images/folder.png","alt","","width","48px"],[1,"text"],["spk-button","",3,"routerLink"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(p(0,"app-status-bar"),a(1,"section")(2,"h2"),_(3,0),r(),u(4,j,2,1)(5,q,5,0),g(6,4,X,null,5),r()),t&2&&(l(6),R(!i.backupsLoading()))},dependencies:[G,L],styles:["[_nghost-%COMP%]{display:block}h2[_ngcontent-%COMP%]{font:var(--title-30);text-align:center;padding:2rem}section[_ngcontent-%COMP%]{max-width:43.75rem;margin:0 auto;padding:2rem 0;display:flex;flex-direction:column;gap:1rem}spk-divider[_ngcontent-%COMP%]{color:var(--base-level-60)}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}"],changeDetection:0})};export{m as default};
@@ -1 +1 @@
1
- import{d as a,e as b,f as c}from"./chunk-4UJICSQB.js";import"./chunk-QSMEC63O.js";import"./chunk-DNHLTHLR.js";import"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
1
+ import{d as a,e as b,f as c}from"./chunk-L6DT3BQG.js";import"./chunk-DE2AAZUP.js";import"./chunk-DNHLTHLR.js";import"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{b as NONE_OPTION,a as createGeneralForm,c as default};
@@ -1,4 +1,4 @@
1
- import{a as Xe,b as ve}from"./chunk-QSMEC63O.js";import{a as At,b as Ht}from"./chunk-DNHLTHLR.js";import{a as pt}from"./chunk-UUMKHH4F.js";import{b as W}from"./chunk-KFGIVU27.js";import{a as Ie,b as ne,c as ye,d as ie,e as fe,f as ct,g as Ut,h as Se,i as $e,k as _t,l as Te,m as Me,n as Bt,o as Ee,p as oe,q as re,r as ee,s as mt,t as De}from"./chunk-7SJHYZC5.js";import{a as Be}from"./chunk-PIDBEXSZ.js";import{a as ae,b as ut,d as Kt,e as Xt,g as we,i as dt,k as le,m as Ft,n as zt,p as gt,q as se,v as Re,w as Ke}from"./chunk-EHV3OZDB.js";import{H as Ce,X as te}from"./chunk-J3H4BCHI.js";import{c as Lt}from"./chunk-5XX7BU4I.js";import{ia as st}from"./chunk-5ZK3D2RS.js";import{$b as X,Ab as g,Bb as w,Cb as R,Db as v,E as Ye,Eb as a,Fb as r,Gb as m,Hb as I,Ib as $,Jb as be,Kb as P,Kc as H,Mc as lt,Qb as E,R as xe,Ra as l,Rb as D,Sb as A,Tb as Je,Ub as et,Vb as Oe,Wb as C,X as y,Xb as p,Za as x,_a as ue,_b as U,ac as V,ea as S,fa as T,fb as J,fc as de,gc as Fe,hc as ge,ic as c,ja as Mt,jc as L,kc as b,lb as F,lc as wt,mc as Rt,nc as vt,oc as Gt,p as Qe,qa as Ze,ra as rt,rc as bt,sc as Ve,tc as Vt,uc as tt,vb as _,xb as he,yc as at}from"./chunk-MR4RE3IB.js";import{a as Z,c as $t}from"./chunk-C6Q5SG76.js";function nn(n,i){if(n&1&&(a(0,"p"),c(1),r()),n&2){let e=p();l(),L(e._data().message)}}var on={title:$localize`Are you sure?`,confirmText:$localize`Confirm`,cancelText:$localize`Cancel`},Le=class n{data=rt();_data=H(()=>Z(Z({},on),this.data()));closed=Ze();close(i="confirm"){this.closed.emit(i==="confirm")}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:10,vars:4,consts:[["header",""],["content",""],["footer",""],["spk-button","",1,"",3,"click"],["spk-button","",1,"raised","primary",3,"click"]],template:function(e,t){e&1&&(a(0,"header",0)(1,"h3"),c(2),r()(),a(3,"div",1),F(4,nn,2,1,"p"),r(),a(5,"footer",2)(6,"button",3),C("click",function(){return t.close("cancel")}),c(7),r(),a(8,"button",4),C("click",function(){return t.close("confirm")}),c(9),r()()),e&2&&(l(2),L(t._data().title),l(2),g(t._data().message?4:-1),l(3),L(t._data().cancelText),l(2),L(t._data().confirmText))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Ct=class n{fromString(i){if(!i)return null;let e=i.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(i,e){return`${i}${e}`}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ue=class n{#e=y(Be);s3Providers=W(this.getS3Config("Providers"));s3Regions=W(this.getS3Config("Regions"));s3RegionHosts=W(this.getS3Config("RegionHosts"));s3StorageClasses=W(this.getS3Config("StorageClasses"));storjSatellites=W(this.getStorjConfig("Satellites"));storjAuthenticationMethods=W(this.getStorjConfig("AuthenticationMethods"));openstackProviders=W(this.getOpenstackConfig("Providers"));openstackVersions=W(this.getOpenstackConfig("Versions"));gcsLocations=W(this.getGcsConfig("Locations"));gcsStorageClasses=W(this.getGcsConfig("StorageClasses"));getS3Config(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":i}}).pipe(Qe(e=>this.#n(e)))}createS3IamUser(i,e){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":i,"s3-password":e}})}createS3PolicyIAM(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:i}})}getStorjConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":i}}).pipe(Qe(e=>this.#n(e)))}getOpenstackConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":i}}).pipe(Qe(e=>this.#n(e)))}getGcsConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":i}}).pipe(Qe(e=>this.#n(e)))}#n(i){return(i.Result&&typeof i.Result=="object"&&Object.entries(i.Result).map(([e,t])=>({key:e,value:t})))??[]}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ge=new ee,nt={file:{customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:n=>Ge.control(n??"")}}},ssh:{customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:n=>Ge.control(n??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:n=>Ge.control(n??"",[ye.required,ye.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}]},s3:{customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:n=>Ge.control(n??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).s3StorageClasses}]},gcs:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:n=>Ge.control(n??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).gcsStorageClasses},"authid"]},googledrive:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:["authid"]}};function He(n,i){let e={},t={};return i.searchParams.forEach((o,s)=>{nt[n].dynamicFields?.includes(s)?t[s]=decodeURIComponent(o):e[s]=decodeURIComponent(o)}),{advanced:e,dynamic:t}}function it(n){let i=n.map(([e,t])=>`${e}=${t?encodeURIComponent(t.toString()):""}`).join("&");return i?"?"+i:""}var We={file:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.path}${i}`},from:(n,i,e)=>{let t=e.indexOf("file:///")===0,o=e.split(t?"///":"//")[1].substring(0,1)+i.hostname.substring(1);return Z({destinationType:n,custom:{path:`${t?"/":""}${o}${i.pathname}`}},He(n,i))}},ssh:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.server}${n.custom.port?":"+n.custom.port:""}${n.custom.path.startsWith("/")?n.custom.path:"/"+n.custom.path}${i}`},from:(n,i,e)=>Z({destinationType:n,custom:{server:i.hostname,port:i.port,path:i.pathname}},He(n,i))},s3:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.bucket}${n.custom.path.startsWith("/")?n.custom.path:"/"+n.custom.path}${i}`},from:(n,i,e)=>Z({destinationType:n,custom:{path:i.pathname,bucket:i.hostname}},He(n,i))},gcs:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.path}${i}`},from:(n,i,e)=>{let{advanced:t,dynamic:o}=He(n,i);return{destinationType:n,custom:{path:i.hostname+i.pathname},dynamic:o,advanced:t}}},googledrive:{to:n=>{let i=n.custom.path,e=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${i}${e}`},from:(n,i,e)=>{let{advanced:t,dynamic:o}=He(n,i);return{destinationType:n,custom:{path:i.hostname+i.pathname},dynamic:o,advanced:t}}},fallbackMapper:{to:n=>"",from:(n,i,e)=>Z({destinationType:n},He(n,i))}};function ft(n){let i=n.destinationType;return!i||!We.hasOwnProperty(i)?We.fallbackMapper.to(n)??"":We[i].to(n)??""}function ht(n){let i=URL.canParse(n),e=n.split("://")[0],t="http://"+n.split("://")[1],o=new URL(t);if(!We.hasOwnProperty(e))return We.fallbackMapper.from(e,o);if(!i)throw new Error("Invalid target path");return We[e].from(e,o,n)}var Wt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,St=class n{generate(i,e=Wt){let t;do t=this.generatePassword(i,e);while(this.calculatePasswordStrength(t)<5);return t}generatePassword(i,e=Wt){let t=this;return Array.apply(null,{length:i}).map(()=>{let o;for(;;)if(o=String.fromCharCode(t.#e()),e.test(o))return o},this).join("")}calculatePasswordStrength(i){let e=1;return i.length>=8&&e++,i.match(/[a-z]/)&&i.match(/[A-Z]/)&&e++,i.match(/\d+/)&&e++,i.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&e++,Math.min(e,5)}#e(){if(window.crypto&&window.crypto.getRandomValues){let i=new Uint8Array(1);return window.crypto.getRandomValues(i),i[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let i=new Uint8Array(1);return window.msCrypto.getRandomValues(i),i[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var rn=["formRef"];function an(n,i){if(n&1&&(a(0,"option",27),c(1),r()),n&2){let e=i.$implicit;_("value",e.Key),l(),L(e.DisplayName)}}function ln(n,i){if(n&1&&m(0,"spk-progress-bar",38),n&2){let e=p(3);he("warn",e.calculatePasswordStrength()===1)("tertiary",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),_("value",e.calculatePasswordStrength()*(100/5))}}function sn(n,i){n&1&&(a(0,"span",33),A(1,9),r())}function pn(n,i){n&1&&(E(0,7,1),m(1,"spk-icon"),D())}function cn(n,i){n&1&&(E(0,7,2),m(1,"spk-icon"),D())}function _n(n,i){n&1&&(E(0,10,1),m(1,"spk-icon",40),D())}function mn(n,i){n&1&&(E(0,10,2),m(1,"spk-icon"),D())}function un(n,i){if(n&1){let e=P();a(0,"button",39),C("click",function(){S(e);let o=p(3);return T(o.copyPassword())}),E(1,10),F(2,_n,2,0)(3,mn,2,0),D(),r()}if(n&2){let e=p(3);l(2),g(e.copiedPassword()?2:3)}}function dn(n,i){n&1&&(a(0,"spk-alert",37),A(1,11),r())}function Fn(n,i){if(n&1){let e=P();a(0,"div",28)(1,"spk-form-field")(2,"label",29),E(3,6),m(4,"sup"),D(),r(),m(5,"input",30),r(),F(6,ln,1,9,"spk-progress-bar",31),a(7,"spk-form-field"),m(8,"input",32),F(9,sn,2,0,"span",33),r(),a(10,"div",34)(11,"button",35),C("click",function(){S(e);let o=p(2);return T(o.showPassword.set(!o.showPassword()))}),E(12,7),F(13,pn,2,0)(14,cn,2,0),D(),r(),a(15,"button",35),C("click",function(){S(e);let o=p(2);return T(o.generatePassword())}),E(16,8),m(17,"spk-icon"),D(),r(),F(18,un,4,1,"button",36),r(),F(19,dn,2,0,"spk-alert",37),r()}if(n&2){let e=p(2);l(5),_("type",e.showPassword()?"text":"password"),l(),g(e.generalForm.value.password?6:-1),l(2),_("type",e.showPassword()?"text":"password"),l(),g(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),l(4),g(e.showPassword()?13:14),l(5),g(e.showCopyPassword()?18:-1),l(),g(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function gn(n,i){if(n&1&&(a(0,"spk-select",24)(1,"label",25),A(2,5),r(),m(3,"input",26),R(4,an,2,2,"option",27,w),r(),F(6,Fn,20,7,"div",28)),n&2){let e=p();_("displayFn",e.displayFn()),l(4),v(e.encryptionOptions()),l(2),g(e.encryptionFieldSignal()!==""?6:-1)}}function Cn(n,i){if(n&1&&(a(0,"button",22),E(1,12),m(2,"spk-icon"),D(),r()),n&2){let e=p();_("disabled",e.generalForm.invalid)}}function fn(n,i){if(n&1&&(a(0,"spk-tooltip",23)(1,"button",22),E(2,13),m(3,"spk-icon"),D(),r()()),n&2){let e=p();_("disabled",!(e.showCopyPassword()&&!e.copiedPassword())),l(),_("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var je=new ee,jt=(n={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>je.group({name:je.control(n.name,[ye.required]),description:je.control(n.description),encryption:je.control(n.encryption,[Ht()]),password:je.control(n.password,[At(i=>i?.value.encryption!=="",[ye.required])]),repeatPassword:je.control(n.repeatPassword,[At(i=>i?.value.encryption!=="",[ye.required])])}),yt={Key:"",DisplayName:"None"},Ot=class n{#e=y(te);#n=y(Ce);#i=y(St);#o=y(pe);#t=y(pt);formRef=ue.required("formRef");generalForm=this.#o.generalForm;generalFormSignal=this.#o.generalFormSignal;encryptionFieldSignal=this.#o.encryptionFieldSignal;encryptionOptions=this.#o.encryptionOptions;isNew=this.#o.isNew;showPassword=x(!1);copiedPassword=x(!1);showCopyPassword=x(!1);encryptionEffect=lt(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=H(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#o.exit()}async copyPassword(){let i=this.generalForm.controls.password.value;await this.#r(i??""),this.copiedPassword.set(!0)}async#r(i){try{await navigator.clipboard.writeText(i)}catch{try{let t=document.createElement("textarea");t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}catch(t){console.error("Failed to copy text: ",t)}}}displayFn(){let i=this.#t.systemInfo()?.EncryptionModules??[];return e=>{let t=[yt,...i].find(o=>o.Key===e);return t?`${t.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let i=this.#i.generate(16);this.generalForm.controls.password.setValue(i),this.generalForm.controls.repeatPassword.setValue(i),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-general"]],viewQuery:function(e,t){e&1&&de(t.formRef,rn,5),e&2&&Fe()},decls:20,vars:3,consts:()=>{let i;i=$localize`Your backup name`;let e;e=$localize`Your backup description`;let t;t=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let s;s=$localize`Backup description`;let d;d=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let k;k=$localize`Encryption`;let M;M=$localize`Encryption`;let h;h=$localize`Password`;let Q;Q=$localize`Repeat password`;let Y;Y=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let B;B=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,B=Oe(B);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let j;j=$localize`Passwords do not match`;let N;N=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,N=Oe(N);let u;u=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let f;f=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let z;return z=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],t,o,s,d,M,Y,B,K,j,N,u,f,z,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",i,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],[3,"displayFn"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",k,"formControlName","encryption"],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],[1,"raised",3,"warn","tertiary","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",Q,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",14,0),C("submit",function(){return S(o),T(t.next())}),a(2,"h3",15),A(3,1),r(),a(4,"spk-form-field")(5,"label",16),E(6,2),m(7,"sup"),D(),r(),m(8,"input",17),r(),a(9,"spk-form-field")(10,"label",18),A(11,3),r(),m(12,"textarea",19),r(),F(13,gn,7,2),a(14,"div",20)(15,"button",21),C("click",function(){return S(o),T(t.exit())}),E(16,4),m(17,"spk-icon"),D(),r(),F(18,Cn,3,1,"button",22)(19,fn,4,2,"spk-tooltip",23),r()()}e&2&&(_("formGroup",t.generalForm),l(13),g(t.isNew()?13:-1),l(5),g(t.encryptionFieldSignal()===""?18:19))},dependencies:[De,Se,oe,re,ne,ie,fe,Te,Ee,le,se,we,ae,zt,ut,Ke],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--warn-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var Sn=["formRef"],Tn=(n,i)=>({index:n,formView:i,formGroupName:"advancedOptions",destinationType:null,oauthField:null}),En=n=>({$implicit:n});function Dn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function Nn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.name)}}function An(n,i){if(n&1){let e=P();E(0,7,1),a(1,"button",30,2),C("click",function(){let o=S(e).$implicit,s=p();return T(s.addNewOption(o))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function hn(n,i){n&1&&be(0)}function On(n,i){if(n&1&&F(0,hn,1,0,"ng-container",31),n&2){let e=i.$implicit,t=i.$index;p();let o=ge(36);_("ngTemplateOutlet",o)("ngTemplateOutletContext",Ve(5,En,Vt(2,Tn,t,e)))}}function yn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Pn(n,i){if(n&1&&(a(0,"app-file-tree",34)(1,"label",40),c(2),F(3,yn,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name))("accepts",t.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function kn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function xn(n,i){if(n&1&&(a(0,"app-file-tree",35)(1,"label",40),c(2),F(3,kn,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name)),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function In(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function $n(n,i){n&1&&(a(0,"spk-icon",43),c(1,"link"),r())}function Mn(n,i){n&1&&(a(0,"spk-icon",43),c(1,"textbox"),r())}function wn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,In,3,1,"spk-tooltip",41),r(),m(4,"input",42),F(5,$n,2,0,"spk-icon",43)(6,Mn,2,0,"spk-icon",43),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),l(),g(t.formView.type==="Path"?5:6)}}function Rn(n,i){if(n&1){let e=P();a(0,"span",47),C("click",function(){S(e);let o=p(2).$implicit,s=p();return T(s.oauthStartTokenCreation(o.formViewType))}),c(1,"AuthID"),r()}}function vn(n,i){n&1&&(a(0,"spk-icon",43),c(1,"password"),r())}function Gn(n,i){if(n&1){let e=P();a(0,"spk-icon",48),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function bn(n,i){if(n&1){let e=P();a(0,"spk-icon",48),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function Vn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),r(),m(3,"input",44),F(4,Rn,2,0,"span",45)(5,vn,2,0,"spk-icon",43)(6,Gn,2,0,"spk-icon",46)(7,bn,2,0,"spk-icon",46),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),_("type",t.formView.showPassword?"text":"password"),l(),g(t.oauthField===t.formView.name?4:5),l(2),g(t.formView.showPassword?6:7)}}function Ln(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Un(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function Bn(n,i){if(n&1&&(a(0,"spk-select")(1,"label",40),c(2),F(3,Ln,3,1,"spk-tooltip",41),r(),m(4,"input",49),I(5,17),R(6,Un,2,2,"option",18,w),$(),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function Kn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function zn(n,i){if(n&1&&(a(0,"div",36)(1,"label",40),c(2),F(3,Kn,3,1,"spk-tooltip",41),r(),a(4,"div",50)(5,"spk-form-field"),m(6,"input",51),a(7,"spk-icon",43),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",52),I(12,17),R(13,Xn,2,2,"option",18,w),$(),r()()()),n&2){let e,t=p().$implicit,o=p();_("formGroupName",t.formView.name),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(3),X("id","destination-",t.formGroupName,"-",t.index,""),l(7),v(o.sizeOptions())}}function Hn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Wn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,Hn,3,1,"spk-tooltip",41),r(),m(4,"input",53),a(5,"spk-icon",43),c(6,"numpad"),r()()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function jn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function qn(n,i){if(n&1&&(a(0,"spk-toggle",37)(1,"label",40),c(2),F(3,jn,3,1,"spk-tooltip",41),r(),m(4,"input",54),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function Qn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Yn(n,i){n&1&&(a(0,"spk-option",56),c(1,"None"),r()),n&2&&_("value","None")}function Zn(n,i){if(n&1&&(a(0,"spk-option",18),c(1),m(2,"spk-checkbox",57),r()),n&2){let e=p().$implicit;_("value",e),l(),b(" ",e," ")}}function Jn(n,i){if(n&1&&F(0,Yn,2,1,"spk-option",56)(1,Zn,3,2,"spk-option",18),n&2){let e=i.$implicit;g(e==="None"?0:1)}}function ei(n,i){if(n&1&&(a(0,"spk-select",38)(1,"label",40),c(2),F(3,Qn,3,1,"spk-tooltip",41),r(),m(4,"input",55),I(5,17),R(6,Jn,2,1,null,null,w),$(),r()),n&2){let e,t=p().$implicit;_("selectMultiple",!0),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function ti(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function ni(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,ti,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function ii(n,i){if(n&1){let e=P();a(0,"div",32),I(1,33),F(2,Pn,5,14,"app-file-tree",34)(3,xn,5,10,"app-file-tree",35)(4,wn,7,10,"spk-form-field")(5,Vn,8,11,"spk-form-field")(6,Bn,8,9,"spk-select")(7,zn,15,9,"div",36)(8,Wn,7,9,"spk-form-field")(9,qn,5,9,"spk-toggle",37)(10,ei,8,7,"spk-select",38)(11,ni,5,9,"spk-form-field"),$(),a(12,"button",39),C("click",function(){let o=S(e).$implicit,s=p();return T(s.removeFormView(o.formView,0))}),a(13,"spk-icon"),c(14,"x-circle"),r()()()}if(n&2){let e=i.$implicit;l(),_("formGroupName",e.formGroupName),l(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="Size"?7:e.formView.type==="Integer"?8:e.formView.type==="Boolean"?9:e.formView.type==="Flags"?10:e.formView.type==="Timespan"?11:-1)}}var Pe=new ee,oi=["Bytes","KB","MB","GB","TB","PB"],ri=[{value:"",name:"Keep all backups"},{value:"time",name:"Delete backups that are older than"},{value:"versions",name:"Keep a specific number of backups"},{value:"smart",name:"Smart backup retention"},{value:"custom",name:"Custom backup retention"}],qt=(n={remoteVolumeSize:50,size:"MB",backupRetention:"",advancedOptions:[]})=>Pe.group({remoteVolumeSize:Pe.group({size:Pe.control(n.remoteVolumeSize),unit:Pe.control(n.size)}),backupRetention:Pe.control(n.backupRetention),advancedOptions:Pe.group({})}),gr=(n,i)=>Pe.group({name:Pe.control(n),value:Pe.control(i)}),Pt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");optionsForm=this.#e.optionsForm;selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;sizeOptions=x(oi);rentationOptions=x(ri);oauthStartTokenCreation(i){}getFormFieldValue(i,e,t){return this.optionsForm.controls.advancedOptions.controls[t].value}removeFormView(i,e){this.#e.removeOptionFromFormGroup(i)}addNewOption(i){this.#e.addOptionToFormGroup(i)}retentionOptionDisplayFn(){let i=this.rentationOptions();return e=>{let t=i.find(o=>o.value===e);return t?t.name:""}}displayFn(){let i=this.#e.advancedOptions();return e=>{let t=i.find(o=>o.name===e);return t?`${t.name}`:""}}goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}submit(){this.#e.submit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-options"]],viewQuery:function(e,t){e&1&&de(t.formRef,Sn,5),e&2&&Fe()},decls:44,vars:5,consts:()=>{let i;i=$localize`Select an option...`;let e;e=$localize`Options`;let t;t=$localize`Remote volume size`;let o;o=$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#17\uFFFD"}:START_LINK:Read more${"\uFFFD/#17\uFFFD"}:CLOSE_LINK:`;let s;s=$localize`Backup retention`;let d;d=$localize` Advanced options ${"\uFFFD#27\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#28\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#28\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#30\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*32:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1:${"\uFFFD0:1\uFFFD"}:INTERPOLATION:${"[\uFFFD/#28\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*32:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SPK_MENU:`,d=Oe(d);let k;k=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let M;return M=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],["fieldTemplate",""],["option",""],e,t,o,s,d,k,M,[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder",i,"formControlName","unit"],["options",""],[3,"value"],["href","#",1,"spk-primary"],[3,"displayFn"],["type","text","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["type","button"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","button",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",10,0),C("submit",function(){return S(o),T(t.submit())}),a(2,"h3",11),A(3,3),r(),a(4,"div",12)(5,"div",13)(6,"spk-form-field")(7,"label",14),A(8,4),r(),m(9,"input",15),r(),a(10,"spk-select"),m(11,"input",16),I(12,17),R(13,Dn,2,2,"option",18,w),$(),r()(),a(15,"p"),E(16,5),m(17,"a",19),D(),r()(),a(18,"spk-select",20)(19,"label",14),A(20,6),r(),m(21,"input",21),R(22,Nn,2,2,"option",18,w),r(),a(24,"app-toggle-card",22),I(25,23),E(26,7),a(27,"spk-menu")(28,"button",24),m(29,"spk-icon"),r(),I(30,25),R(31,An,3,1,"button",26,w),$(),r(),D(),$(),R(33,On,1,7,"ng-container",null,w),r(),F(35,ii,15,2,"ng-template",null,1,at),a(37,"div",27)(38,"button",28),C("click",function(){return S(o),T(t.goBack())}),E(39,8),m(40,"spk-icon"),D(),r(),a(41,"button",29),E(42,9),m(43,"spk-icon"),D(),r()()()}e&2&&(_("formGroup",t.optionsForm),l(13),v(t.sizeOptions()),l(5),_("displayFn",t.retentionOptionDisplayFn()),l(4),v(t.rentationOptions()),l(2),_("disallowToggle",!0),l(7),v(t.nonSelectedOptions()),l(2),v(t.selectedOptions()),l(8),he("loader",t.isSubmitting()))},dependencies:[De,Se,oe,re,ne,$e,Ie,ie,fe,Te,Ee,Me,st,Ft,se,we,ae,le,Re,dt,gt,Ke,Xe,ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.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}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var ai=["formRef"];function li(n,i){if(n&1&&(a(0,"option",39),c(1),r()),n&2){let e=i.$implicit;_("value",e.key),l(),L(e.label)}}function si(n,i){if(n&1){let e=P();a(0,"div",26)(1,"spk-form-field")(2,"label",27),A(3,8),r(),a(4,"input",28,1),C("focus",function(){S(e);let o=ge(5);return T(o.showPicker())}),r(),a(6,"spk-icon",29),c(7,"clock"),r()(),a(8,"spk-form-field"),m(9,"label",30),a(10,"input",31,2),C("focus",function(){S(e);let o=ge(11);return T(o.showPicker())}),r(),a(12,"spk-icon",29),c(13,"calendar"),r()()(),I(14,32),a(15,"div",33)(16,"spk-form-field")(17,"label",34),A(18,9),r(),m(19,"input",35),r(),a(20,"spk-select",36),m(21,"input",37),I(22,38),R(23,li,2,2,"option",39,w),$(),r()(),a(25,"app-toggle-card",40),I(26,41),A(27,10),$(),a(28,"div",42)(29,"spk-toggle",21),E(30,11),m(31,"input",43),D(),r(),a(32,"spk-toggle",21),E(33,12),m(34,"input",44),D(),r(),a(35,"spk-toggle",21),E(36,13),m(37,"input",45),D(),r(),a(38,"spk-toggle",21),E(39,14),m(40,"input",46),D(),r(),a(41,"spk-toggle",21),E(42,15),m(43,"input",47),D(),r(),a(44,"spk-toggle",21),E(45,16),m(46,"input",48),D(),r(),a(47,"spk-toggle",21),E(48,17),m(49,"input",49),D(),r()()(),$()}if(n&2){let e=p();l(20),_("displayFn",e.displayFn),l(3),v(e.unitOptions),l(2),_("disallowToggle",!0)}}var q=new ee,Qt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],Yt=(n={autoRun:!1,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>q.group({autoRun:q.control(n.autoRun),nextTime:q.group({time:q.control(n.nextTime.time),date:q.control(n.nextTime.date)}),runAgain:q.group({repeatValue:q.control(n.runAgain.repeatValue),repeatUnit:q.control(n.runAgain.repeatUnit),allowedDays:q.group({mon:q.control(n.runAgain.allowedDays.mon),tue:q.control(n.runAgain.allowedDays.tue),wed:q.control(n.runAgain.allowedDays.wed),thu:q.control(n.runAgain.allowedDays.thu),fri:q.control(n.runAgain.allowedDays.fri),sat:q.control(n.runAgain.allowedDays.sat),sun:q.control(n.runAgain.allowedDays.sun)})})}),kt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=Qt;displayFn(i){let e=Qt.find(t=>t.key===i);return e?`${e.label}`:""}goBack(){this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#n.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-schedule"]],viewQuery:function(e,t){e&1&&de(t.formRef,ai,5),e&2&&Fe()},decls:18,vars:2,consts:()=>{let i;i=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let t;t=$localize`If a date was missed, the job will run as soon as possible.`;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let s;s=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let d;d=$localize`Next time`;let k;k=$localize`Run again every`;let M;M=$localize`Allowed days`;let h;h=$localize` Monday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Tuesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize` Wednesday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Thursday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let j;j=$localize` Saturday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let N;return N=$localize` Sunday ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],i,e,t,o,s,d,k,M,h,Q,Y,B,K,j,N,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],["options",""],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",18,0),C("submit",function(){return S(o),T(t.next())}),a(2,"h3",19),A(3,3),r(),a(4,"div",20)(5,"spk-toggle",21),E(6,4),m(7,"input",22),D(),r(),a(8,"p"),A(9,5),r()(),F(10,si,50,2),a(11,"div",23)(12,"button",24),C("click",function(){return S(o),T(t.goBack())}),E(13,6),m(14,"spk-icon"),D(),r(),a(15,"button",25),E(16,7),m(17,"spk-icon"),D(),r()()()}if(e&2){let o;_("formGroup",t.scheduleForm),l(10),g((o=t.scheduleFormSignal())!=null&&o.autoRun?10:-1)}},dependencies:[De,Se,oe,re,ne,$e,Ie,ie,fe,Te,Ee,Me,le,se,Re,ae,we,ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function pi(n,i){if(n&1&&(a(0,"option",3),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.key)}}function ci(n,i){if(n&1&&(a(0,"option",3),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.key)}}function _i(n,i){if(n&1){let e=P();a(0,"spk-select",0)(1,"input",6),C("ngModelChange",function(o){S(e);let s=p(2);return T(s.updateStateExpression(o))}),r(),R(2,ci,2,2,"option",3,w),r()}if(n&2){let e,t=p(2);_("hideClearButton",!0)("displayFn",t.displayFn),l(),_("ngModel",(e=t.pathState())==null?null:e.expression),l(),v(t.fileGroupOptions())}}function mi(n,i){if(n&1){let e=P();a(0,"spk-form-field")(1,"input",6),C("ngModelChange",function(o){S(e);let s=p(2);return T(s.updateStateExpression(o))}),r()()}if(n&2){let e,t=p(2);l(),_("ngModel",(e=t.pathState())==null?null:e.expression)}}function ui(n,i){if(n&1){let e=P();a(0,"spk-select",0)(1,"input",1),C("ngModelChange",function(o){S(e);let s=p();return T(s.updateStateType(o))}),r(),I(2,2),R(3,pi,2,2,"option",3,w),$(),r(),F(5,_i,4,3,"spk-select",0)(6,mi,2,1,"spk-form-field"),a(7,"div",4),C("click",function(){S(e);let o=p();return T(o.removeFilter())}),a(8,"spk-icon",5),c(9,"x-circle"),r()()}if(n&2){let e,t,o=p();_("hideClearButton",!0)("displayFn",o.displayFn),l(),_("ngModel",(e=o.pathState())==null?null:e.type),l(2),v(o.expressionOptions()),l(2),g(((t=o.pathState())==null?null:t.type)==="-FileGroup"||((t=o.pathState())==null?null:t.type)==="+FileGroup"?5:6)}}var Zt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"}],di=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],Tt=class n{path=rt.required();pathChange=Ze();remove=Ze();expressionOptions=x(Zt);fileGroupOptions=x(di);pathState=x(null);pathEffect=lt(()=>{let i=this.path(),e=i.slice(1),t=i.startsWith("-")?"-":"+";return e.startsWith("/")&&e.endsWith("/")?this.pathState.set({type:`${t}Folder`,path:e,expression:e}):e.startsWith("*")&&e.endsWith("*/")?this.pathState.set({type:`${t}FolderNameIncludes`,path:e,expression:e.slice(1,-2)}):e.startsWith("[.*")&&e.endsWith("[^\\/]*]")?this.pathState.set({type:`${t}FileNameIncludes`,path:e,expression:e.slice(3,-7)}):e.startsWith("{")&&e.endsWith("}")?this.pathState.set({type:`${t}FileGroup`,path:e,expression:e.slice(1,-1)}):e.startsWith("[")&&e.endsWith("]")?this.pathState.set({type:`${t}Regex`,path:e,expression:e.slice(1,-1)}):e.startsWith("*.")?this.pathState.set({type:`${t}Extension`,path:e,expression:e.slice(2)}):this.pathState.set({type:`${t}Expression`,path:e,expression:e})});updateStateType(i){this.pathState.update(e=>(e.type=i,e.path=this.#e(e),e)),this.pathChange.emit(this.pathState().path)}updateStateExpression(i){this.pathState.update(e=>(e.expression=i,e.path=this.#e(e),e)),this.pathChange.emit(this.pathState().path)}#e(i){let e=i.type.slice(0,1),t=i.type.slice(1);if(t==="Folder"){let o=i.expression.endsWith("/"),s=i.expression.startsWith("/");return o&&s?`${e}${i.expression}`:o?`${e}${i.expression}/`:s?`${e}/${i.expression}`:`${e}/${i.expression}/`}return t==="FolderNameIncludes"?`${e}*${i.expression}*/`:t==="FileNameIncludes"?`${e}[.*${i.expression}[^\\/]*]`:t==="FileGroup"?`${e}{${i.expression}}`:t==="Regex"?`${e}[${i.expression}]`:t==="Extension"?`${e}*.${i.expression}`:`${e}${i.expression}`}removeFilter(){this.remove.emit()}displayFn(i){let e=Zt.find(t=>t.value===i);return e?e.key:""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-filter"]],inputs:{path:[1,"path"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let i;return i=$localize`Select an option...`,[[3,"hideClearButton","displayFn"],["type","text","placeholder",i,3,"ngModelChange","ngModel"],["options",""],[3,"value"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(e,t){e&1&&F(0,ui,10,4),e&2&&g(t.pathState()?0:-1)},dependencies:[mt,oe,re,ne,ie,Ut,se,ae,le],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Fi=["formRef"];function gi(n,i){if(n&1){let e=P();a(0,"app-filter",41),C("pathChange",function(o){let s=S(e).$index,d=p();return T(d.patchPathAt(o,s))})("remove",function(){let o=S(e).$index,s=p();return T(s.removePathAt(o))}),r()}if(n&2){let e=i.$implicit;_("path",e)}}function Ci(n,i){if(n&1&&(a(0,"option",45),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function fi(n,i){if(n&1&&(a(0,"div",40)(1,"spk-form-field"),m(2,"input",42),r(),a(3,"spk-select"),m(4,"input",43),I(5,44),R(6,Ci,2,2,"option",45,w),$(),r()()),n&2){let e=p();l(6),v(e.sizeOptions())}}var ke=new ee,Si=["Bytes","KB","MB","GB","TB","PB"],Jt=(n={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>ke.group({path:ke.control(n.path),excludes:ke.group({hidden:ke.control(n.excludes.hidden),system:ke.control(n.excludes.system),temporary:ke.control(n.excludes.temporary),filesLargerThan:ke.group({size:ke.control(null),unit:ke.control(null)})})}),xt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new ct("");filesLargerThan=H(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=x(Si);pathSignal=W(this.sourceDataForm.controls.path.valueChanges);pathArray=H(()=>this.pathSignal()?.split("\0").filter(i=>i.startsWith("-")||i.startsWith("+"))??[]);addFilter(i="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${i}`)}patchPathAt(i,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),s=this.pathArray().map((d,k)=>k===e?`${i}`:`${d}`).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${s}`)}removePathAt(i){let t=this.sourceDataForm.controls.path.value.split("\0").filter(s=>!s.startsWith("-")&&!s.startsWith("+")).join("\0"),o=this.pathArray().filter((s,d)=>d!==i).join("\0");this.sourceDataForm.controls.path.setValue(`${t}\0${o}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${i}\0${this.newPathCtrl.value}`),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-source-data"]],viewQuery:function(e,t){e&1&&de(t.formRef,Fi,5),e&2&&Fe()},decls:56,vars:11,consts:()=>{let i;i=$localize`Path`;let e;e=$localize`Add a direct path`;let t;t=$localize`Hidden files`;let o;o=$localize`System files`;let s;s=$localize`Temporary files`;let d;d=$localize`Source Data`;let k;k=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let M;M=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let h;h=$localize`Source Data`;let Q;Q=$localize`Add Path`;let Y;Y=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let K;K=$localize`Customize your filters.`;let j;j=$localize`Add filter`;let N;N=$localize`Exclude`;let u;u=$localize`Choose if there’s any files you want to exclude.`;let f;f=$localize` Hidden files ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let z;z=$localize` System files ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Temporary files ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files larger than `;let Ae;return Ae=$localize`Select an option...`,[["formRef",""],d,k,M,h,Q,Y,B,K,j,N,u,f,z,O,_e,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",i,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],[3,"path"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",t,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",s,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"pathChange","remove","path"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder",Ae],["options",""],[3,"value"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",16,0),C("submit",function(){return S(o),T(t.next())}),a(2,"div",17)(3,"h3",18),A(4,1),r(),a(5,"app-file-tree",19)(6,"label",20),c(7,"Folder path"),r(),m(8,"input",21),r(),a(9,"div",22)(10,"button",23),C("click",function(){return S(o),T(t.goBack())}),E(11,2),m(12,"spk-icon"),D(),r(),a(13,"button",24),E(14,3),m(15,"spk-icon"),D(),r()()(),a(16,"div",25)(17,"h3",18),A(18,4),r(),a(19,"app-toggle-card",26),I(20,27),A(21,5),$(),a(22,"p",28),A(23,6),r(),a(24,"div",29)(25,"spk-form-field"),m(26,"input",30),r(),a(27,"button",31),C("click",function(){return S(o),T(t.addNewPath())}),a(28,"spk-icon"),c(29,"plus"),r()()()(),a(30,"app-toggle-card",26),I(31,27),A(32,7),$(),a(33,"p",28),A(34,8),r(),a(35,"button",32),C("click",function(){return S(o),T(t.addFilter())}),A(36,9),r(),R(37,gi,1,1,"app-filter",33,w),r(),a(39,"app-toggle-card",34),I(40,27),A(41,10),$(),a(42,"p",28),A(43,11),r(),a(44,"spk-toggle",35),E(45,12),m(46,"input",36),D(),r(),a(47,"spk-toggle",35),E(48,13),m(49,"input",37),D(),r(),a(50,"spk-toggle",35),E(51,14),m(52,"input",38),D(),r(),a(53,"spk-toggle",39),C("click",function(){return S(o),T(t.toggleFilesLargerThan())}),A(54,15),r(),F(55,fi,8,0,"div",40),r()()()}e&2&&(_("formGroup",t.sourceDataForm),l(5),_("multiSelect",!0)("startingPath",t.getPath())("showFiles",!0),l(14),_("disallowToggle",!0),l(7),_("formControl",t.newPathCtrl),l(4),_("disallowToggle",!0),l(7),v(t.pathArray()),l(2),_("disallowToggle",!0),l(14),he("active",t.filesLargerThan()),l(2),g(t.filesLargerThan()?55:-1))},dependencies:[mt,Se,oe,re,ne,$e,Ie,ie,fe,De,_t,Te,Ee,Me,le,ae,we,se,Re,Xe,ve,Tt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var ce=new ee,pe=class n{#e=y(te);#n=y(pt);#i=y(Be);#o=y(Ct);generalForm=jt();sourceDataForm=Jt();scheduleForm=Yt();destinationForm=en();optionsForm=qt();isDraft=x(!1);backupId=x(null);isSubmitting=x(!1);finishedLoading=x(!1);backupDefaults=x(null);isNew=H(()=>this.backupId()==="new");selectedOptions=x([]);selectedAdvancedFormPair=x([]);destinationFormPair=x({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=H(()=>{let i=this.destinationFormPair()?.advanced??[],e=this.selectedAdvancedFormPair()??[];return i.filter(t=>e.findIndex(o=>o.name===t.name)===-1)});selectedHttpOptions=x([]);notSelectedHttpOptions=H(()=>{let i=this.httpOptions(),e=this.selectedHttpOptions()??[];return i.filter(t=>e.findIndex(o=>o.name===t.name)===-1)});sourceDataFormSignal=W(this.sourceDataForm.valueChanges);destinationFormSignal=W(this.destinationForm.valueChanges);generalFormSignal=W(this.generalForm.valueChanges);encryptionFieldSignal=W(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=W(this.scheduleForm.valueChanges);destinationOptions=H(()=>this.#n.backendModules()??[]);httpOptions=H(()=>this.#n.systemInfo()?.GenericModules?.find(i=>i.Key==="http-options")?.Options?.map(this.#t)??[]);advancedOptions=H(()=>this.#n.systemInfo()?.Options?.map(this.#t)??[]);#t(i){return{name:i.Name,type:i.Type,shortDescription:i.ShortDescription??void 0,longDescription:i.LongDescription??void 0,options:i.ValidValues}}encryptionOptions=H(()=>{let i=this.#n.systemInfo()?.EncryptionModules??[];return[yt,...i]});nonSelectedOptions=H(()=>this.advancedOptions().sort((i,e)=>i?.name&&e?.name?i?.name.localeCompare(e?.name):0).filter(i=>this.selectedOptions()?.findIndex(e=>e.name===i.name)===-1));addAdvancedFormPairByName(i,e,t){let o=this.notSelectedAdvancedFormPair().find(s=>s.name===i);o&&this.addAdvancedFormPair(o,e,t)}addHttpOptionByName(i,e,t){let o=this.notSelectedHttpOptions().find(s=>s.name===i);o&&this.addHttpOption(o,e,t)}addAdvancedFormPair(i,e,t){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,s=t??i.defaultValue;this.createFormField(o,i,s),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),i])}addHttpOption(i,e,t){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,s=t??i.defaultValue;this.createFormField(o,i,s),this.selectedHttpOptions.set([...this.selectedHttpOptions(),i])}removeAdvancedFormPair(i,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(i.name),this.selectedAdvancedFormPair().findIndex(o=>o.name===i.name)!==-1?this.selectedAdvancedFormPair.update(o=>(o=o.filter(s=>s.name!==i.name),o)):this.selectedHttpOptions.update(o=>(o=o.filter(s=>s.name!==i.name),o))}removeHttpOption(i,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(i.name),this.selectedHttpOptions.update(t=>(t=t.filter(o=>o.name!==i.name),t))}submit(){this.isSubmitting.set(!0);let i=this.#s(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#i.postApiV1Backups({requestBody:i}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:t=>{console.log("submitted res",t),this.exit()},error:t=>{console.error("submitted error",t)}}):this.#i.putApiV1BackupById({id:e,requestBody:i}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:t=>{console.log("submitted res",t),this.exit()},error:t=>{console.error("submitted error",t)}})}exit(){this.#c(),this.#e.navigate(["/"])}updateFieldsFromTargetUrl(i){this.#r(),setTimeout(()=>{this.#l(i)})}#r(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(i){let e=i.Sources??"",t=i.Filters?.map(h=>`${h.Include?"":"-"}${h.Expression}`)??[],o=i.Settings?.find(h=>h.Name==="--exclude-files-attributes")?.Value??"",s=i.Settings?.find(h=>h.Name==="--skip-files-larger-than")??null,d=s?.Value.replace(/[0-9]/g,"")??null,k=s?.Value.replace(/[^0-9]/g,"")??null,M={path:[...e,...t].join("\0"),excludes:{hiddenFiles:o.includes("hidden"),systemFiles:o.includes("system"),tempFiles:o.includes("temporary"),filesLargerThan:d&&k?{size:parseInt(k),unit:d.toUpperCase()}:null}};this.sourceDataForm.patchValue(M)}mapDestinationToForm(i){let e=i.TargetURL?ht(i.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}#l(i){let e=ht(i);e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}mapGeneralToForm(i){let e=i.Settings?.find(s=>s.Name==="encryption-module"),t=e?.Value&&e.Value.length?e.Value:"",o={name:i.Name??"",description:i.Description??""};t&&t!==""&&(o.encryption=t),this.generalForm.patchValue(o)}mapScheduleToForm(i){if(!i){this.scheduleForm.patchValue({autoRun:!0});return}let e=this.#o.fromString(i.Repeat)??null,o={nextTime:this.#p(i.Time),runAgain:{repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:i.AllowedDays?.includes("mon")??!1,tue:i.AllowedDays?.includes("tue")??!1,wed:i.AllowedDays?.includes("wed")??!1,thu:i.AllowedDays?.includes("thu")??!1,fri:i.AllowedDays?.includes("fri")??!1,sat:i.AllowedDays?.includes("sat")??!1,sun:i.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(o)}mapOptionsToForms(i){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],t=this.advancedOptions();i.Settings?.forEach(o=>{if(o.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(o.Value??"");if(!(o.Name&&e.includes(o.Name))){if(o.Name==="dblock-size"){let s=o.Value?.replace(/[^0-9]/g,""),d=o.Value?.replace(/[0-9]/g,"");return this.optionsForm.controls.remoteVolumeSize.setValue({size:s?parseInt(s):null,unit:d?d.toUpperCase():null})}if(o.Name&&o.Value){let s=t.find(d=>d.name===o.Name);if(!s)return;this.addOptionToFormGroup(s,o.Value)}}})}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#s(){let i=this.generalForm.value,e=this.optionsForm.value,t=this.scheduleForm.value,o=this.sourceDataForm.value,d=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],k=null;t.runAgain?.repeatUnit&&t.runAgain?.repeatValue&&(k=this.#o.toString(t.runAgain.repeatValue,t.runAgain.repeatUnit));let M=t.runAgain?.allowedDays?Object.entries(t.runAgain?.allowedDays).filter(([u,f])=>f).map(([u,f])=>u):[],h=o.path?.split("\0")??[],Q=i.encryption===""?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:i.encryption??null},Y=this.advancedOptions(),B=Object.entries(e.advancedOptions??{}).filter(([u,f])=>u&&f).map(([u,f])=>{let z=Y.find(O=>O.name===u);return z?.type==="Size"?{Name:u,Value:`${f.size}${f.unit.toLowerCase()}`}:z?.type==="Integer"?{Name:u,Value:f.toString()}:z?.type==="Boolean"?{Name:u,Value:f.toString()}:{Name:u,Value:f}}),K=[Q,...B],j=Object.entries(o.excludes??{}).filter(([u,f])=>f&&u!=="filesLargerThan").map(([u])=>u),N=o.excludes?.filesLargerThan;return j.length&&K.push({Name:"--exclude-files-attributes",Value:j.join(",")}),N&&N.size!==null&&N.unit!==null&&K.push({Name:"--skip-files-larger-than",Value:`${N.size}${N.unit}`}),{Backup:{Name:i.name,Description:i.description,TargetURL:d[0]??null,Sources:h.filter(u=>!u.startsWith("-")),Settings:K,Filters:h.filter(u=>u.startsWith("-")).map((u,f)=>({Order:f,Include:!1,Expression:u.slice(1)}))},Schedule:t.autoRun?{Repeat:k,Time:t.nextTime?.date?new Date(`${t.nextTime.date}T${t.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:M}:null}}#a(i){return i.controls.map(e=>ft(e.value))}#p(i){if(!i||i?.indexOf("T")===-1)return{time:i??"13:00"};let e=new Date(i),t={time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`};return i.indexOf("T")!==-1&&(t.date=e.toISOString().split("T")[0]),t}removeOptionFromFormGroup(i){let e=i.name;e&&(this.optionsForm.controls.advancedOptions.removeControl(e),this.selectedOptions.update(t=>(t=t.filter(o=>o.name!==e),t)))}addOptionToFormGroup(i,e){let t=this.optionsForm.controls.advancedOptions;this.createFormField(t,i,e??i.defaultValue),this.selectedOptions.update(o=>(o.push(i),o))}createFormField(i,e,t){if(e.type==="String"||e.type==="FileTree"||e.type==="FolderTree"||e.type==="Password"||e.type==="Enumeration"||e.type==="NonValidatedSelectableString"||e.type==="Path"){i.addControl(e.name,ce.control(t));return}if(e.type==="Size"){let o=t.replace(/[0-9]/g,""),s=t.replace(/[^0-9]/g,"");i.addControl(e.name,ce.group({size:ce.control(s?parseInt(s):50),unit:ce.control(o?o.toUpperCase():"MB")}));return}if(e.type==="Integer"){i.addControl(e.name,ce.control(t?parseInt(t):0));return}if(e.type==="Boolean"){i.addControl(e.name,ce.control(t==="true"));return}if(e.type==="Flags"){i.addControl(e.name,ce.control(t??""));return}if(e.type==="Timespan"){i.addControl(e.name,ce.control(t,[ye.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(i,e,t=!1){let o=this.destinationOptions().find(N=>N.Key===i),s=this.httpOptions();if(!o||!o.Options)return;let d=nt.hasOwnProperty(i)&&nt[i],k=d&&d.oauthField?d.oauthField:null,M=d&&d.customFields?d.customFields:{},h=d&&d.dynamicFields?d.dynamicFields:[],Q=d&&d.advancedFields?d.advancedFields:[],Y=d&&d.ignoredAdvancedFields?d.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:k,custom:[],dynamic:[],advanced:[]});let B=ce.group({}),K=ce.group({}),j=ce.group({});M&&Object.entries(M).forEach(([N,u],f)=>{let _e=u,{formElement:z}=_e,O=$t(_e,["formElement"]);B.addControl(N,z(e?.custom[N])),this.destinationFormPair.update(Ae=>(Ae.custom.push(Z({order:900+f},O)),Ae))});for(let N=0;N<o.Options.length;N++){let u=o.Options[N];if(u.Deprecated)continue;let f=h.find(z=>z===u.Name||z.name===u.Name);if(f){let z=f&&typeof f!="string",O={name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,order:900+N},_e=z?Z(Z({},O),f):O,G=e?.dynamic[u.Name]??u.DefaultValue;this.createFormField(K,_e,G),this.destinationFormPair.update(qe=>(qe.dynamic.push(_e),qe))}else{if(Y.find(me=>me===u.Name))continue;let O=Q.find(me=>me===u.Name||me.name===u.Name),_e=O&&typeof O!="string",Ae=e?.advanced[u.Name],G=Ae??u.DefaultValue,qe={name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,defaultValue:G,order:900+N},Nt=_e?Z(Z({},qe),O):qe;t&&Ae&&(this.createFormField(j,Nt,G),this.selectedAdvancedFormPair.update(me=>(me.push(Nt),me))),this.destinationFormPair.update(me=>(me.advanced.push(Nt),me))}}for(let N=0;N<s.length;N++){let u=s[N],f=e?.advanced[u.name],z=f??u.defaultValue;t&&f&&(this.createFormField(j,u,z),this.selectedHttpOptions.update(O=>(O.push(u),O)))}this.destinationFormPair.update(N=>({oauthField:N.oauthField,custom:N.custom.sort((u,f)=>u.order-f.order),dynamic:N.dynamic.sort((u,f)=>u.order-f.order),advanced:N.advanced.sort((u,f)=>u.order-f.order)})),this.destinationForm.controls.destinations.push(tn({key:o.Key,customGroup:B,dynamicGroup:K,advancedGroup:j}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ti=["formRef"],Ei=(n,i,e,t)=>({index:n,formView:i,formGroupName:"custom",destinationType:e,oauthField:t}),Dt=n=>({$implicit:n}),Di=(n,i,e,t)=>({index:n,formView:i,formGroupName:"dynamic",destinationType:e,oauthField:t}),Ni=(n,i,e,t)=>({index:n,formView:i,formGroupName:"advanced",destinationType:e,oauthField:t}),Ai=(n,i,e,t)=>({index:n,formView:i,formGroupName:"advanced",asHttpOptions:!0,destinationType:e,oauthField:t}),hi=()=>({maxWidth:"700px",width:"100%"});function Oi(n,i){n&1&&(E(0,2,2),m(1,"spk-icon"),D())}function yi(n,i){n&1&&A(0,2,3)}function Pi(n,i){if(n&1){let e=P();E(0,2,1),a(1,"button",24),C("click",function(){S(e);let o=p();return T(o.testDestination())}),F(2,Oi,2,0)(3,yi,1,0),r(),D()}if(n&2){let e=p();l(),he("success",e.successfulTest()),l(),g(e.successfulTest()?2:3)}}function ki(n,i){if(n&1){let e=P();a(0,"p",30),C("click",function(){S(e);let o=p();return T(o.removeDestinationFormGroup(o.destinationCount()-1))}),E(1,5),m(2,"span",31),D(),r()}}function xi(n,i){if(n&1){let e=P();a(0,"div",32)(1,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("file"))}),a(2,"h3"),A(3,6),r(),a(4,"p"),A(5,7),r()(),a(6,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("gcs"))}),a(7,"h3"),c(8,"Google Cloud Storage"),r(),a(9,"p"),A(10,8),r()(),a(11,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("s3"))}),a(12,"h3"),c(13,"S3 compatible bucket"),r(),a(14,"p"),A(15,9),r()(),a(16,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("ssh"))}),a(17,"h3"),c(18,"SSH"),r(),a(19,"p"),A(20,10),r()(),a(21,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("googledrive"))}),a(22,"h3"),c(23,"Google Drive"),r(),a(24,"p"),A(25,11),r()()(),a(26,"p"),A(27,12),r()}}function Ii(n,i){n&1&&be(0)}function $i(n,i){if(n&1&&F(0,Ii,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ei,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Mi(n,i){n&1&&be(0)}function wi(n,i){if(n&1&&F(0,Mi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Di,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Ri(n,i){if(n&1){let e=P();E(0,13,1),a(1,"button",40),C("click",function(){let o=S(e).$implicit,s=p(2);return T(s.addAdvancedFormPair(o,0))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function vi(n,i){n&1&&be(0)}function Gi(n,i){if(n&1&&F(0,vi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ni,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function bi(n,i){if(n&1){let e=P();E(0,14,1),a(1,"button",40),C("click",function(){let o=S(e).$implicit,s=p(2);return T(s.addHttpOption(o,0))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function Vi(n,i){n&1&&be(0)}function Li(n,i){if(n&1&&F(0,Vi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ai,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Ui(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Bi(n,i){if(n&1&&(a(0,"app-file-tree",43)(1,"label",50),c(2),F(3,Ui,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name))("accepts",t.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function Ki(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xi(n,i){if(n&1&&(a(0,"app-file-tree",44)(1,"label",50),c(2),F(3,Ki,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name)),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function zi(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Hi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"link"),r())}function Wi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"textbox"),r())}function ji(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,zi,3,1,"spk-tooltip",51),r(),m(4,"input",52),F(5,Hi,2,0,"spk-icon",53)(6,Wi,2,0,"spk-icon",53),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(),g(t.formView.type==="Path"?5:6)}}function qi(n,i){if(n&1){let e=P();a(0,"span",57),C("click",function(){S(e);let o=p(2).$implicit,s=p(2);return T(s.oauthStartTokenCreation(o.destinationType))}),c(1,"AuthID"),r()}}function Qi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"password"),r())}function Yi(n,i){if(n&1){let e=P();a(0,"spk-icon",58),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function Zi(n,i){if(n&1){let e=P();a(0,"spk-icon",58),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function Ji(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),r(),m(3,"input",54),F(4,qi,2,0,"span",55)(5,Qi,2,0,"spk-icon",53)(6,Yi,2,0,"spk-icon",56)(7,Zi,2,0,"spk-icon",56),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),_("type",t.formView.showPassword?"text":"password"),l(),g(t.oauthField===t.formView.name?4:5),l(2),g(t.formView.showPassword?6:7)}}function eo(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function to(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function no(n,i){if(n&1&&(a(0,"spk-select")(1,"label",50),c(2),F(3,eo,3,1,"spk-tooltip",51),r(),m(4,"input",59),I(5,60),R(6,to,2,2,"option",61,w),$(),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function io(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function oo(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),wt(" ",e.key," ",e.value?"("+e.value+")":""," ")}}function ro(n,i){if(n&1&&(a(0,"spk-select",45)(1,"label",50),c(2),F(3,io,3,1,"spk-tooltip",51),r(),m(4,"input",59),I(5,60),R(6,oo,2,3,"option",61,w),$(),r()),n&2){let e,t=p().$implicit,o=p(2);_("isFreeText",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(2),v(t.formView.loadOptions(o.injector)())}}function ao(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function lo(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function so(n,i){if(n&1&&(a(0,"div",46)(1,"label",50),c(2),F(3,ao,3,1,"spk-tooltip",51),r(),a(4,"div",62)(5,"spk-form-field"),m(6,"input",63),a(7,"spk-icon",53),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",64),I(12,60),R(13,lo,2,2,"option",61,w),$(),r()()()),n&2){let e,t=p().$implicit,o=p(2);_("formGroupName",t.formView.name),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(3),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(7),v(o.sizeOptions())}}function po(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function co(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,po,3,1,"spk-tooltip",51),r(),m(4,"input",65),a(5,"spk-icon",53),c(6,"numpad"),r()()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function _o(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function mo(n,i){if(n&1&&(a(0,"spk-toggle",47)(1,"label",50),c(2),F(3,_o,3,1,"spk-tooltip",51),r(),m(4,"input",66),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function uo(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Fo(n,i){n&1&&(a(0,"spk-option",68),c(1,"None"),r()),n&2&&_("value","None")}function go(n,i){if(n&1&&(a(0,"spk-option",61),c(1),m(2,"spk-checkbox",69),r()),n&2){let e=p().$implicit;_("value",e),l(),b(" ",e," ")}}function Co(n,i){if(n&1&&F(0,Fo,2,1,"spk-option",68)(1,go,3,2,"spk-option",61),n&2){let e=i.$implicit;g(e==="None"?0:1)}}function fo(n,i){if(n&1&&(a(0,"spk-select",48)(1,"label",50),c(2),F(3,uo,3,1,"spk-tooltip",51),r(),m(4,"input",67),I(5,60),R(6,Co,2,1,null,null,w),$(),r()),n&2){let e,t=p().$implicit;_("selectMultiple",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function So(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function To(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,So,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function Eo(n,i){if(n&1){let e=P();a(0,"button",70),C("click",function(){S(e);let o=p().$implicit,s=p(2);return T(s.removeFormView(o.formView,0))}),a(1,"spk-icon"),c(2,"x-circle"),r()()}}function Do(n,i){if(n&1&&(a(0,"div",41),I(1,42),F(2,Bi,5,16,"app-file-tree",43)(3,Xi,5,12,"app-file-tree",44)(4,ji,7,12,"spk-form-field")(5,Ji,8,13,"spk-form-field")(6,no,8,11,"spk-select")(7,ro,8,12,"spk-select",45)(8,so,15,11,"div",46)(9,co,7,11,"spk-form-field")(10,mo,5,11,"spk-toggle",47)(11,fo,8,8,"spk-select",48)(12,To,5,11,"spk-form-field"),$(),F(13,Eo,3,0,"button",49),r()),n&2){let e=i.$implicit;he("single-field",e.formGroupName!=="advanced"),l(),_("formGroupName",e.formGroupName),l(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="NonValidatedSelectableString"?7:e.formView.type==="Size"?8:e.formView.type==="Integer"?9:e.formView.type==="Boolean"?10:e.formView.type==="Flags"?11:e.formView.type==="Timespan"?12:-1),l(11),g(e.formGroupName==="advanced"?13:-1)}}function No(n,i){if(n&1&&(I(0,25)(1,34),R(2,$i,1,9,"ng-container",null,w),R(4,wi,1,9,"ng-container",null,w),a(6,"app-toggle-card",35),I(7,36),E(8,13),a(9,"spk-menu")(10,"button",37),m(11,"spk-icon"),r(),I(12,23),R(13,Ri,2,1,"button",38,w),$(),r(),D(),$(),R(15,Gi,1,9,"ng-container",null,w),r(),a(17,"app-toggle-card",35),I(18,36),E(19,14),a(20,"spk-menu")(21,"button",37),m(22,"spk-icon"),r(),I(23,23),R(24,bi,2,1,"button",38,w),$(),r(),D(),$(),R(26,Li,1,9,"ng-container",null,w),r(),F(28,Do,14,5,"ng-template",null,1,at),$()()),n&2){let e=p();l(2),v(e.destinationFormPair().custom),l(2),v(e.destinationFormPair().dynamic),l(2),_("disallowToggle",!0),l(4),_("disabled",e.notSelectedAdvancedFormPair().length===0),l(3),v(e.notSelectedAdvancedFormPair()),l(2),v(e.selectedAdvancedFormPair()),l(2),_("disallowToggle",!0),l(4),_("disabled",e.notSelectedHttpOptions().length===0),l(3),v(e.notSelectedHttpOptions()),l(2),v(e.selectedHttpOptions())}}function Ao(n,i){if(n&1){let e=P();a(0,"spk-dialog",71),Gt("isOpenChange",function(o){S(e);let s=p();return vt(s.targetUrlDialogOpen,o)||(s.targetUrlDialogOpen=o),T(o)}),a(1,"header",72)(2,"h2"),A(3,15),r(),a(4,"spk-alert",73),A(5,16),r()(),a(6,"div",74)(7,"spk-form-field"),m(8,"textarea",75),r()(),a(9,"footer",76)(10,"button",27),C("click",function(){S(e);let o=p();return T(o.closeTargetUrlDialog(!1))}),c(11,"Cancel"),r(),a(12,"button",77),C("click",function(){S(e);let o=p();return T(o.closeTargetUrlDialog(!0))}),E(13,17),m(14,"spk-icon"),D(),r()()()}if(n&2){let e=p();Rt("isOpen",e.targetUrlDialogOpen),_("options",bt(3,hi)),l(8),_("formControl",e.targetUrlCtrl)}}var ho=["Bytes","KB","MB","GB","TB","PB"],Et=new ee,en=(n={destinations:[]})=>Et.group({destinations:Et.array(n.destinations)}),tn=({key:n,customGroup:i,dynamicGroup:e,advancedGroup:t})=>Et.group({destinationType:Et.control(n),custom:i,dynamic:e,advanced:t}),It=class n{#e=y(te);#n=y(Ce);#i=y(Lt);#o=y(Be);#t=y(pe);#r=y(Xt);injector=y(Mt);formRef=ue.required("formRef");destinationForm=this.#t.destinationForm;destinationFormPair=this.#t.destinationFormPair;selectedAdvancedFormPair=this.#t.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#t.notSelectedAdvancedFormPair;selectedHttpOptions=this.#t.selectedHttpOptions;notSelectedHttpOptions=this.#t.notSelectedHttpOptions;destinationOptions=this.#t.destinationOptions;destinationFormSignal=this.#t.destinationFormSignal;destinationCount=H(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=x(ho);successfulTest=x(!1);getFormFieldValue(i,e,t){return((this.destinationForm.controls.destinations.controls?.[i]).controls?.[e]).controls[t].value}addDestinationFormGroup(i){this.#t.addDestinationFormGroup(i)}addAdvancedFormPair(i,e){this.#t.addAdvancedFormPair(i,e)}removeFormView(i,e){this.#t.removeAdvancedFormPair(i,e)}addHttpOption(i,e){this.#t.addHttpOption(i,e)}targetUrl=H(()=>this.#t.getCurrentTargetUrl()[0]);targetUrlCtrl=new ct;targetUrlInitial=x(null);targetUrlDialogOpen=x(!1);openTargetUrlDialog(){let e=this.#t.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl.value,t=this.targetUrlInitial();!i||e===t||this.#t.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(i=0){let t=this.#t.getCurrentTargetUrl()[i];t&&this.#o.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:o=>{let s=o.error.error.Error;if(s==="missing-folder"&&this.#r.open(Le,{data:{title:"Create folder",message:"The remote destination folder does not exist, do you want to create it?"},closed:d=>{d&&this.#o.postApiV1RemoteoperationCreate({requestBody:{path:t}}).subscribe()}}),s.startsWith("incorrect-cert:")){let d=s.split("incorrect-cert:")[1];this.#r.open(Le,{maxWidth:"500px",data:{title:"Trust the certificate",message:`The server is using a certificate that is not trusted.
1
+ import{a as Xe,b as ve}from"./chunk-DE2AAZUP.js";import{a as At,b as Ht}from"./chunk-DNHLTHLR.js";import{a as pt}from"./chunk-V7APGUBT.js";import{b as W}from"./chunk-KFGIVU27.js";import{a as Ie,b as ne,c as ye,d as ie,e as fe,f as ct,g as Ut,h as Se,i as $e,k as _t,l as Te,m as Me,n as Bt,o as Ee,p as oe,q as re,r as ee,s as mt,t as De}from"./chunk-7SJHYZC5.js";import{a as Be}from"./chunk-PIDBEXSZ.js";import{a as ae,b as ut,d as Kt,e as Xt,g as we,i as dt,k as le,m as Ft,n as zt,p as gt,q as se,v as Re,w as Ke}from"./chunk-EHV3OZDB.js";import{H as Ce,X as te}from"./chunk-J3H4BCHI.js";import{c as Lt}from"./chunk-5XX7BU4I.js";import{ia as st}from"./chunk-5ZK3D2RS.js";import{$b as X,Ab as g,Bb as w,Cb as R,Db as v,E as Ye,Eb as a,Fb as r,Gb as m,Hb as I,Ib as $,Jb as be,Kb as P,Kc as H,Mc as lt,Qb as E,R as xe,Ra as l,Rb as D,Sb as A,Tb as Je,Ub as et,Vb as Oe,Wb as C,X as y,Xb as p,Za as x,_a as ue,_b as U,ac as V,ea as S,fa as T,fb as J,fc as de,gc as Fe,hc as ge,ic as c,ja as Mt,jc as L,kc as b,lb as F,lc as wt,mc as Rt,nc as vt,oc as Gt,p as Qe,qa as Ze,ra as rt,rc as bt,sc as Ve,tc as Vt,uc as tt,vb as _,xb as he,yc as at}from"./chunk-MR4RE3IB.js";import{a as Z,c as $t}from"./chunk-C6Q5SG76.js";function nn(n,i){if(n&1&&(a(0,"p"),c(1),r()),n&2){let e=p();l(),L(e._data().message)}}var on={title:$localize`Are you sure?`,confirmText:$localize`Confirm`,cancelText:$localize`Cancel`},Le=class n{data=rt();_data=H(()=>Z(Z({},on),this.data()));closed=Ze();close(i="confirm"){this.closed.emit(i==="confirm")}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:10,vars:4,consts:[["header",""],["content",""],["footer",""],["spk-button","",1,"",3,"click"],["spk-button","",1,"raised","primary",3,"click"]],template:function(e,t){e&1&&(a(0,"header",0)(1,"h3"),c(2),r()(),a(3,"div",1),F(4,nn,2,1,"p"),r(),a(5,"footer",2)(6,"button",3),C("click",function(){return t.close("cancel")}),c(7),r(),a(8,"button",4),C("click",function(){return t.close("confirm")}),c(9),r()()),e&2&&(l(2),L(t._data().title),l(2),g(t._data().message?4:-1),l(3),L(t._data().cancelText),l(2),L(t._data().confirmText))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};var Ct=class n{fromString(i){if(!i)return null;let e=i.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(i,e){return`${i}${e}`}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ue=class n{#e=y(Be);s3Providers=W(this.getS3Config("Providers"));s3Regions=W(this.getS3Config("Regions"));s3RegionHosts=W(this.getS3Config("RegionHosts"));s3StorageClasses=W(this.getS3Config("StorageClasses"));storjSatellites=W(this.getStorjConfig("Satellites"));storjAuthenticationMethods=W(this.getStorjConfig("AuthenticationMethods"));openstackProviders=W(this.getOpenstackConfig("Providers"));openstackVersions=W(this.getOpenstackConfig("Versions"));gcsLocations=W(this.getGcsConfig("Locations"));gcsStorageClasses=W(this.getGcsConfig("StorageClasses"));getS3Config(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":i}}).pipe(Qe(e=>this.#n(e)))}createS3IamUser(i,e){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":i,"s3-password":e}})}createS3PolicyIAM(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:i}})}getStorjConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":i}}).pipe(Qe(e=>this.#n(e)))}getOpenstackConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":i}}).pipe(Qe(e=>this.#n(e)))}getGcsConfig(i){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":i}}).pipe(Qe(e=>this.#n(e)))}#n(i){return(i.Result&&typeof i.Result=="object"&&Object.entries(i.Result).map(([e,t])=>({key:e,value:t})))??[]}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ge=new ee,nt={file:{customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:n=>Ge.control(n??"")}}},ssh:{customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:n=>Ge.control(n??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:n=>Ge.control(n??"",[ye.required,ye.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}]},s3:{customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:n=>Ge.control(n??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).s3StorageClasses}]},gcs:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:n=>Ge.control(n??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:n=>n.get(Ue).gcsStorageClasses},"authid"]},googledrive:{oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:n=>Ge.control(n??"")}},dynamicFields:["authid"]}};function He(n,i){let e={},t={};return i.searchParams.forEach((o,s)=>{nt[n].dynamicFields?.includes(s)?t[s]=decodeURIComponent(o):e[s]=decodeURIComponent(o)}),{advanced:e,dynamic:t}}function it(n){let i=n.map(([e,t])=>`${e}=${t?encodeURIComponent(t.toString()):""}`).join("&");return i?"?"+i:""}var We={file:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.path}${i}`},from:(n,i,e)=>{let t=e.indexOf("file:///")===0,o=e.split(t?"///":"//")[1].substring(0,1)+i.hostname.substring(1);return Z({destinationType:n,custom:{path:`${t?"/":""}${o}${i.pathname}`}},He(n,i))}},ssh:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.server}${n.custom.port?":"+n.custom.port:""}${n.custom.path.startsWith("/")?n.custom.path:"/"+n.custom.path}${i}`},from:(n,i,e)=>Z({destinationType:n,custom:{server:i.hostname,port:i.port,path:i.pathname}},He(n,i))},s3:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.bucket}${n.custom.path.startsWith("/")?n.custom.path:"/"+n.custom.path}${i}`},from:(n,i,e)=>Z({destinationType:n,custom:{path:i.pathname,bucket:i.hostname}},He(n,i))},gcs:{to:n=>{let i=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${n.custom.path}${i}`},from:(n,i,e)=>{let{advanced:t,dynamic:o}=He(n,i);return{destinationType:n,custom:{path:i.hostname+i.pathname},dynamic:o,advanced:t}}},googledrive:{to:n=>{let i=n.custom.path,e=it([...Object.entries(n.advanced),...Object.entries(n.dynamic)]);return`${n.destinationType}://${i}${e}`},from:(n,i,e)=>{let{advanced:t,dynamic:o}=He(n,i);return{destinationType:n,custom:{path:i.hostname+i.pathname},dynamic:o,advanced:t}}},fallbackMapper:{to:n=>"",from:(n,i,e)=>Z({destinationType:n},He(n,i))}};function ft(n){let i=n.destinationType;return!i||!We.hasOwnProperty(i)?We.fallbackMapper.to(n)??"":We[i].to(n)??""}function ht(n){let i=URL.canParse(n),e=n.split("://")[0],t="http://"+n.split("://")[1],o=new URL(t);if(!We.hasOwnProperty(e))return We.fallbackMapper.from(e,o);if(!i)throw new Error("Invalid target path");return We[e].from(e,o,n)}var Wt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,St=class n{generate(i,e=Wt){let t;do t=this.generatePassword(i,e);while(this.calculatePasswordStrength(t)<5);return t}generatePassword(i,e=Wt){let t=this;return Array.apply(null,{length:i}).map(()=>{let o;for(;;)if(o=String.fromCharCode(t.#e()),e.test(o))return o},this).join("")}calculatePasswordStrength(i){let e=1;return i.length>=8&&e++,i.match(/[a-z]/)&&i.match(/[A-Z]/)&&e++,i.match(/\d+/)&&e++,i.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&e++,Math.min(e,5)}#e(){if(window.crypto&&window.crypto.getRandomValues){let i=new Uint8Array(1);return window.crypto.getRandomValues(i),i[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let i=new Uint8Array(1);return window.msCrypto.getRandomValues(i),i[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var rn=["formRef"];function an(n,i){if(n&1&&(a(0,"option",27),c(1),r()),n&2){let e=i.$implicit;_("value",e.Key),l(),L(e.DisplayName)}}function ln(n,i){if(n&1&&m(0,"spk-progress-bar",38),n&2){let e=p(3);he("warn",e.calculatePasswordStrength()===1)("tertiary",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),_("value",e.calculatePasswordStrength()*(100/5))}}function sn(n,i){n&1&&(a(0,"span",33),A(1,9),r())}function pn(n,i){n&1&&(E(0,7,1),m(1,"spk-icon"),D())}function cn(n,i){n&1&&(E(0,7,2),m(1,"spk-icon"),D())}function _n(n,i){n&1&&(E(0,10,1),m(1,"spk-icon",40),D())}function mn(n,i){n&1&&(E(0,10,2),m(1,"spk-icon"),D())}function un(n,i){if(n&1){let e=P();a(0,"button",39),C("click",function(){S(e);let o=p(3);return T(o.copyPassword())}),E(1,10),F(2,_n,2,0)(3,mn,2,0),D(),r()}if(n&2){let e=p(3);l(2),g(e.copiedPassword()?2:3)}}function dn(n,i){n&1&&(a(0,"spk-alert",37),A(1,11),r())}function Fn(n,i){if(n&1){let e=P();a(0,"div",28)(1,"spk-form-field")(2,"label",29),E(3,6),m(4,"sup"),D(),r(),m(5,"input",30),r(),F(6,ln,1,9,"spk-progress-bar",31),a(7,"spk-form-field"),m(8,"input",32),F(9,sn,2,0,"span",33),r(),a(10,"div",34)(11,"button",35),C("click",function(){S(e);let o=p(2);return T(o.showPassword.set(!o.showPassword()))}),E(12,7),F(13,pn,2,0)(14,cn,2,0),D(),r(),a(15,"button",35),C("click",function(){S(e);let o=p(2);return T(o.generatePassword())}),E(16,8),m(17,"spk-icon"),D(),r(),F(18,un,4,1,"button",36),r(),F(19,dn,2,0,"spk-alert",37),r()}if(n&2){let e=p(2);l(5),_("type",e.showPassword()?"text":"password"),l(),g(e.generalForm.value.password?6:-1),l(2),_("type",e.showPassword()?"text":"password"),l(),g(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),l(4),g(e.showPassword()?13:14),l(5),g(e.showCopyPassword()?18:-1),l(),g(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function gn(n,i){if(n&1&&(a(0,"spk-select",24)(1,"label",25),A(2,5),r(),m(3,"input",26),R(4,an,2,2,"option",27,w),r(),F(6,Fn,20,7,"div",28)),n&2){let e=p();_("displayFn",e.displayFn()),l(4),v(e.encryptionOptions()),l(2),g(e.encryptionFieldSignal()!==""?6:-1)}}function Cn(n,i){if(n&1&&(a(0,"button",22),E(1,12),m(2,"spk-icon"),D(),r()),n&2){let e=p();_("disabled",e.generalForm.invalid)}}function fn(n,i){if(n&1&&(a(0,"spk-tooltip",23)(1,"button",22),E(2,13),m(3,"spk-icon"),D(),r()()),n&2){let e=p();_("disabled",!(e.showCopyPassword()&&!e.copiedPassword())),l(),_("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var je=new ee,jt=(n={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>je.group({name:je.control(n.name,[ye.required]),description:je.control(n.description),encryption:je.control(n.encryption,[Ht()]),password:je.control(n.password,[At(i=>i?.value.encryption!=="",[ye.required])]),repeatPassword:je.control(n.repeatPassword,[At(i=>i?.value.encryption!=="",[ye.required])])}),yt={Key:"",DisplayName:"None"},Ot=class n{#e=y(te);#n=y(Ce);#i=y(St);#o=y(pe);#t=y(pt);formRef=ue.required("formRef");generalForm=this.#o.generalForm;generalFormSignal=this.#o.generalFormSignal;encryptionFieldSignal=this.#o.encryptionFieldSignal;encryptionOptions=this.#o.encryptionOptions;isNew=this.#o.isNew;showPassword=x(!1);copiedPassword=x(!1);showCopyPassword=x(!1);encryptionEffect=lt(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=H(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#o.exit()}async copyPassword(){let i=this.generalForm.controls.password.value;await this.#r(i??""),this.copiedPassword.set(!0)}async#r(i){try{await navigator.clipboard.writeText(i)}catch{try{let t=document.createElement("textarea");t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}catch(t){console.error("Failed to copy text: ",t)}}}displayFn(){let i=this.#t.systemInfo()?.EncryptionModules??[];return e=>{let t=[yt,...i].find(o=>o.Key===e);return t?`${t.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let i=this.#i.generate(16);this.generalForm.controls.password.setValue(i),this.generalForm.controls.repeatPassword.setValue(i),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-general"]],viewQuery:function(e,t){e&1&&de(t.formRef,rn,5),e&2&&Fe()},decls:20,vars:3,consts:()=>{let i;i=$localize`Your backup name`;let e;e=$localize`Your backup description`;let t;t=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let s;s=$localize`Backup description`;let d;d=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let k;k=$localize`Encryption`;let M;M=$localize`Encryption`;let h;h=$localize`Password`;let Q;Q=$localize`Repeat password`;let Y;Y=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let B;B=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,B=Oe(B);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let j;j=$localize`Passwords do not match`;let N;N=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,N=Oe(N);let u;u=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let f;f=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let z;return z=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],t,o,s,d,M,Y,B,K,j,N,u,f,z,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",i,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],[3,"displayFn"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",k,"formControlName","encryption"],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],[1,"raised",3,"warn","tertiary","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",Q,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",14,0),C("submit",function(){return S(o),T(t.next())}),a(2,"h3",15),A(3,1),r(),a(4,"spk-form-field")(5,"label",16),E(6,2),m(7,"sup"),D(),r(),m(8,"input",17),r(),a(9,"spk-form-field")(10,"label",18),A(11,3),r(),m(12,"textarea",19),r(),F(13,gn,7,2),a(14,"div",20)(15,"button",21),C("click",function(){return S(o),T(t.exit())}),E(16,4),m(17,"spk-icon"),D(),r(),F(18,Cn,3,1,"button",22)(19,fn,4,2,"spk-tooltip",23),r()()}e&2&&(_("formGroup",t.generalForm),l(13),g(t.isNew()?13:-1),l(5),g(t.encryptionFieldSignal()===""?18:19))},dependencies:[De,Se,oe,re,ne,ie,fe,Te,Ee,le,se,we,ae,zt,ut,Ke],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--warn-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var Sn=["formRef"],Tn=(n,i)=>({index:n,formView:i,formGroupName:"advancedOptions",destinationType:null,oauthField:null}),En=n=>({$implicit:n});function Dn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function Nn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.name)}}function An(n,i){if(n&1){let e=P();E(0,7,1),a(1,"button",30,2),C("click",function(){let o=S(e).$implicit,s=p();return T(s.addNewOption(o))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function hn(n,i){n&1&&be(0)}function On(n,i){if(n&1&&F(0,hn,1,0,"ng-container",31),n&2){let e=i.$implicit,t=i.$index;p();let o=ge(36);_("ngTemplateOutlet",o)("ngTemplateOutletContext",Ve(5,En,Vt(2,Tn,t,e)))}}function yn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Pn(n,i){if(n&1&&(a(0,"app-file-tree",34)(1,"label",40),c(2),F(3,yn,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name))("accepts",t.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function kn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function xn(n,i){if(n&1&&(a(0,"app-file-tree",35)(1,"label",40),c(2),F(3,kn,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit,o=p();_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name)),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function In(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function $n(n,i){n&1&&(a(0,"spk-icon",43),c(1,"link"),r())}function Mn(n,i){n&1&&(a(0,"spk-icon",43),c(1,"textbox"),r())}function wn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,In,3,1,"spk-tooltip",41),r(),m(4,"input",42),F(5,$n,2,0,"spk-icon",43)(6,Mn,2,0,"spk-icon",43),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),l(),g(t.formView.type==="Path"?5:6)}}function Rn(n,i){if(n&1){let e=P();a(0,"span",47),C("click",function(){S(e);let o=p(2).$implicit,s=p();return T(s.oauthStartTokenCreation(o.formViewType))}),c(1,"AuthID"),r()}}function vn(n,i){n&1&&(a(0,"spk-icon",43),c(1,"password"),r())}function Gn(n,i){if(n&1){let e=P();a(0,"spk-icon",48),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function bn(n,i){if(n&1){let e=P();a(0,"spk-icon",48),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function Vn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),r(),m(3,"input",44),F(4,Rn,2,0,"span",45)(5,vn,2,0,"spk-icon",43)(6,Gn,2,0,"spk-icon",46)(7,bn,2,0,"spk-icon",46),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),_("type",t.formView.showPassword?"text":"password"),l(),g(t.oauthField===t.formView.name?4:5),l(2),g(t.formView.showPassword?6:7)}}function Ln(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Un(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function Bn(n,i){if(n&1&&(a(0,"spk-select")(1,"label",40),c(2),F(3,Ln,3,1,"spk-tooltip",41),r(),m(4,"input",49),I(5,17),R(6,Un,2,2,"option",18,w),$(),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function Kn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xn(n,i){if(n&1&&(a(0,"option",18),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function zn(n,i){if(n&1&&(a(0,"div",36)(1,"label",40),c(2),F(3,Kn,3,1,"spk-tooltip",41),r(),a(4,"div",50)(5,"spk-form-field"),m(6,"input",51),a(7,"spk-icon",43),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",52),I(12,17),R(13,Xn,2,2,"option",18,w),$(),r()()()),n&2){let e,t=p().$implicit,o=p();_("formGroupName",t.formView.name),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(3),X("id","destination-",t.formGroupName,"-",t.index,""),l(7),v(o.sizeOptions())}}function Hn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Wn(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,Hn,3,1,"spk-tooltip",41),r(),m(4,"input",53),a(5,"spk-icon",43),c(6,"numpad"),r()()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function jn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function qn(n,i){if(n&1&&(a(0,"spk-toggle",37)(1,"label",40),c(2),F(3,jn,3,1,"spk-tooltip",41),r(),m(4,"input",54),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function Qn(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Yn(n,i){n&1&&(a(0,"spk-option",56),c(1,"None"),r()),n&2&&_("value","None")}function Zn(n,i){if(n&1&&(a(0,"spk-option",18),c(1),m(2,"spk-checkbox",57),r()),n&2){let e=p().$implicit;_("value",e),l(),b(" ",e," ")}}function Jn(n,i){if(n&1&&F(0,Yn,2,1,"spk-option",56)(1,Zn,3,2,"spk-option",18),n&2){let e=i.$implicit;g(e==="None"?0:1)}}function ei(n,i){if(n&1&&(a(0,"spk-select",38)(1,"label",40),c(2),F(3,Qn,3,1,"spk-tooltip",41),r(),m(4,"input",55),I(5,17),R(6,Jn,2,1,null,null,w),$(),r()),n&2){let e,t=p().$implicit;_("selectMultiple",!0),l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function ti(n,i){if(n&1&&(a(0,"spk-tooltip",41)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function ni(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",40),c(2),F(3,ti,3,1,"spk-tooltip",41),r(),m(4,"input",42),r()),n&2){let e,t=p().$implicit;l(),X("for","destination-",t.formGroupName,"-",t.index,""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),X("id","destination-",t.formGroupName,"-",t.index,""),U("formControlName",t.formView.name)}}function ii(n,i){if(n&1){let e=P();a(0,"div",32),I(1,33),F(2,Pn,5,14,"app-file-tree",34)(3,xn,5,10,"app-file-tree",35)(4,wn,7,10,"spk-form-field")(5,Vn,8,11,"spk-form-field")(6,Bn,8,9,"spk-select")(7,zn,15,9,"div",36)(8,Wn,7,9,"spk-form-field")(9,qn,5,9,"spk-toggle",37)(10,ei,8,7,"spk-select",38)(11,ni,5,9,"spk-form-field"),$(),a(12,"button",39),C("click",function(){let o=S(e).$implicit,s=p();return T(s.removeFormView(o.formView,0))}),a(13,"spk-icon"),c(14,"x-circle"),r()()()}if(n&2){let e=i.$implicit;l(),_("formGroupName",e.formGroupName),l(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="Size"?7:e.formView.type==="Integer"?8:e.formView.type==="Boolean"?9:e.formView.type==="Flags"?10:e.formView.type==="Timespan"?11:-1)}}var Pe=new ee,oi=["Bytes","KB","MB","GB","TB","PB"],ri=[{value:"",name:"Keep all backups"},{value:"time",name:"Delete backups that are older than"},{value:"versions",name:"Keep a specific number of backups"},{value:"smart",name:"Smart backup retention"},{value:"custom",name:"Custom backup retention"}],qt=(n={remoteVolumeSize:50,size:"MB",backupRetention:"",advancedOptions:[]})=>Pe.group({remoteVolumeSize:Pe.group({size:Pe.control(n.remoteVolumeSize),unit:Pe.control(n.size)}),backupRetention:Pe.control(n.backupRetention),advancedOptions:Pe.group({})}),gr=(n,i)=>Pe.group({name:Pe.control(n),value:Pe.control(i)}),Pt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");optionsForm=this.#e.optionsForm;selectedOptions=this.#e.selectedOptions;nonSelectedOptions=this.#e.nonSelectedOptions;isSubmitting=this.#e.isSubmitting;sizeOptions=x(oi);rentationOptions=x(ri);oauthStartTokenCreation(i){}getFormFieldValue(i,e,t){return this.optionsForm.controls.advancedOptions.controls[t].value}removeFormView(i,e){this.#e.removeOptionFromFormGroup(i)}addNewOption(i){this.#e.addOptionToFormGroup(i)}retentionOptionDisplayFn(){let i=this.rentationOptions();return e=>{let t=i.find(o=>o.value===e);return t?t.name:""}}displayFn(){let i=this.#e.advancedOptions();return e=>{let t=i.find(o=>o.name===e);return t?`${t.name}`:""}}goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}submit(){this.#e.submit()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-options"]],viewQuery:function(e,t){e&1&&de(t.formRef,Sn,5),e&2&&Fe()},decls:44,vars:5,consts:()=>{let i;i=$localize`Select an option...`;let e;e=$localize`Options`;let t;t=$localize`Remote volume size`;let o;o=$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#17\uFFFD"}:START_LINK:Read more${"\uFFFD/#17\uFFFD"}:CLOSE_LINK:`;let s;s=$localize`Backup retention`;let d;d=$localize` Advanced options ${"\uFFFD#27\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#28\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#29\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#29\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#28\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#30\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*32:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1:${"\uFFFD0:1\uFFFD"}:INTERPOLATION:${"[\uFFFD/#28\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*32:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SPK_MENU:`,d=Oe(d);let k;k=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let M;return M=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],["fieldTemplate",""],["option",""],e,t,o,s,d,k,M,[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder",i,"formControlName","unit"],["options",""],[3,"value"],["href","#",1,"spk-primary"],[3,"displayFn"],["type","text","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["type","button"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","button",3,"click"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",10,0),C("submit",function(){return S(o),T(t.submit())}),a(2,"h3",11),A(3,3),r(),a(4,"div",12)(5,"div",13)(6,"spk-form-field")(7,"label",14),A(8,4),r(),m(9,"input",15),r(),a(10,"spk-select"),m(11,"input",16),I(12,17),R(13,Dn,2,2,"option",18,w),$(),r()(),a(15,"p"),E(16,5),m(17,"a",19),D(),r()(),a(18,"spk-select",20)(19,"label",14),A(20,6),r(),m(21,"input",21),R(22,Nn,2,2,"option",18,w),r(),a(24,"app-toggle-card",22),I(25,23),E(26,7),a(27,"spk-menu")(28,"button",24),m(29,"spk-icon"),r(),I(30,25),R(31,An,3,1,"button",26,w),$(),r(),D(),$(),R(33,On,1,7,"ng-container",null,w),r(),F(35,ii,15,2,"ng-template",null,1,at),a(37,"div",27)(38,"button",28),C("click",function(){return S(o),T(t.goBack())}),E(39,8),m(40,"spk-icon"),D(),r(),a(41,"button",29),E(42,9),m(43,"spk-icon"),D(),r()()()}e&2&&(_("formGroup",t.optionsForm),l(13),v(t.sizeOptions()),l(5),_("displayFn",t.retentionOptionDisplayFn()),l(4),v(t.rentationOptions()),l(2),_("disallowToggle",!0),l(7),v(t.nonSelectedOptions()),l(2),v(t.selectedOptions()),l(8),he("loader",t.isSubmitting()))},dependencies:[De,Se,oe,re,ne,$e,Ie,ie,fe,Te,Ee,Me,st,Ft,se,we,ae,le,Re,dt,gt,Ke,Xe,ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.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}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var ai=["formRef"];function li(n,i){if(n&1&&(a(0,"option",39),c(1),r()),n&2){let e=i.$implicit;_("value",e.key),l(),L(e.label)}}function si(n,i){if(n&1){let e=P();a(0,"div",26)(1,"spk-form-field")(2,"label",27),A(3,8),r(),a(4,"input",28,1),C("focus",function(){S(e);let o=ge(5);return T(o.showPicker())}),r(),a(6,"spk-icon",29),c(7,"clock"),r()(),a(8,"spk-form-field"),m(9,"label",30),a(10,"input",31,2),C("focus",function(){S(e);let o=ge(11);return T(o.showPicker())}),r(),a(12,"spk-icon",29),c(13,"calendar"),r()()(),I(14,32),a(15,"div",33)(16,"spk-form-field")(17,"label",34),A(18,9),r(),m(19,"input",35),r(),a(20,"spk-select",36),m(21,"input",37),I(22,38),R(23,li,2,2,"option",39,w),$(),r()(),a(25,"app-toggle-card",40),I(26,41),A(27,10),$(),a(28,"div",42)(29,"spk-toggle",21),E(30,11),m(31,"input",43),D(),r(),a(32,"spk-toggle",21),E(33,12),m(34,"input",44),D(),r(),a(35,"spk-toggle",21),E(36,13),m(37,"input",45),D(),r(),a(38,"spk-toggle",21),E(39,14),m(40,"input",46),D(),r(),a(41,"spk-toggle",21),E(42,15),m(43,"input",47),D(),r(),a(44,"spk-toggle",21),E(45,16),m(46,"input",48),D(),r(),a(47,"spk-toggle",21),E(48,17),m(49,"input",49),D(),r()()(),$()}if(n&2){let e=p();l(20),_("displayFn",e.displayFn),l(3),v(e.unitOptions),l(2),_("disallowToggle",!0)}}var q=new ee,Qt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],Yt=(n={autoRun:!1,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>q.group({autoRun:q.control(n.autoRun),nextTime:q.group({time:q.control(n.nextTime.time),date:q.control(n.nextTime.date)}),runAgain:q.group({repeatValue:q.control(n.runAgain.repeatValue),repeatUnit:q.control(n.runAgain.repeatUnit),allowedDays:q.group({mon:q.control(n.runAgain.allowedDays.mon),tue:q.control(n.runAgain.allowedDays.tue),wed:q.control(n.runAgain.allowedDays.wed),thu:q.control(n.runAgain.allowedDays.thu),fri:q.control(n.runAgain.allowedDays.fri),sat:q.control(n.runAgain.allowedDays.sat),sun:q.control(n.runAgain.allowedDays.sun)})})}),kt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=Qt;displayFn(i){let e=Qt.find(t=>t.key===i);return e?`${e.label}`:""}goBack(){this.#n.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#n.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-schedule"]],viewQuery:function(e,t){e&1&&de(t.formRef,ai,5),e&2&&Fe()},decls:18,vars:2,consts:()=>{let i;i=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let t;t=$localize`If a date was missed, the job will run as soon as possible.`;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let s;s=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let d;d=$localize`Next time`;let k;k=$localize`Run again every`;let M;M=$localize`Allowed days`;let h;h=$localize` Monday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Tuesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize` Wednesday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let B;B=$localize` Thursday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let j;j=$localize` Saturday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let N;return N=$localize` Sunday ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],i,e,t,o,s,d,k,M,h,Q,Y,B,K,j,N,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],["options",""],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",18,0),C("submit",function(){return S(o),T(t.next())}),a(2,"h3",19),A(3,3),r(),a(4,"div",20)(5,"spk-toggle",21),E(6,4),m(7,"input",22),D(),r(),a(8,"p"),A(9,5),r()(),F(10,si,50,2),a(11,"div",23)(12,"button",24),C("click",function(){return S(o),T(t.goBack())}),E(13,6),m(14,"spk-icon"),D(),r(),a(15,"button",25),E(16,7),m(17,"spk-icon"),D(),r()()()}if(e&2){let o;_("formGroup",t.scheduleForm),l(10),g((o=t.scheduleFormSignal())!=null&&o.autoRun?10:-1)}},dependencies:[De,Se,oe,re,ne,$e,Ie,ie,fe,Te,Ee,Me,le,se,Re,ae,we,ve],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function pi(n,i){if(n&1&&(a(0,"option",3),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.key)}}function ci(n,i){if(n&1&&(a(0,"option",3),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),L(e.key)}}function _i(n,i){if(n&1){let e=P();a(0,"spk-select",0)(1,"input",6),C("ngModelChange",function(o){S(e);let s=p(2);return T(s.updateStateExpression(o))}),r(),R(2,ci,2,2,"option",3,w),r()}if(n&2){let e,t=p(2);_("hideClearButton",!0)("displayFn",t.displayFn),l(),_("ngModel",(e=t.pathState())==null?null:e.expression),l(),v(t.fileGroupOptions())}}function mi(n,i){if(n&1){let e=P();a(0,"spk-form-field")(1,"input",6),C("ngModelChange",function(o){S(e);let s=p(2);return T(s.updateStateExpression(o))}),r()()}if(n&2){let e,t=p(2);l(),_("ngModel",(e=t.pathState())==null?null:e.expression)}}function ui(n,i){if(n&1){let e=P();a(0,"spk-select",0)(1,"input",1),C("ngModelChange",function(o){S(e);let s=p();return T(s.updateStateType(o))}),r(),I(2,2),R(3,pi,2,2,"option",3,w),$(),r(),F(5,_i,4,3,"spk-select",0)(6,mi,2,1,"spk-form-field"),a(7,"div",4),C("click",function(){S(e);let o=p();return T(o.removeFilter())}),a(8,"spk-icon",5),c(9,"x-circle"),r()()}if(n&2){let e,t,o=p();_("hideClearButton",!0)("displayFn",o.displayFn),l(),_("ngModel",(e=o.pathState())==null?null:e.type),l(2),v(o.expressionOptions()),l(2),g(((t=o.pathState())==null?null:t.type)==="-FileGroup"||((t=o.pathState())==null?null:t.type)==="+FileGroup"?5:6)}}var Zt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"}],di=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],Tt=class n{path=rt.required();pathChange=Ze();remove=Ze();expressionOptions=x(Zt);fileGroupOptions=x(di);pathState=x(null);pathEffect=lt(()=>{let i=this.path(),e=i.slice(1),t=i.startsWith("-")?"-":"+";return e.startsWith("/")&&e.endsWith("/")?this.pathState.set({type:`${t}Folder`,path:e,expression:e}):e.startsWith("*")&&e.endsWith("*/")?this.pathState.set({type:`${t}FolderNameIncludes`,path:e,expression:e.slice(1,-2)}):e.startsWith("[.*")&&e.endsWith("[^\\/]*]")?this.pathState.set({type:`${t}FileNameIncludes`,path:e,expression:e.slice(3,-7)}):e.startsWith("{")&&e.endsWith("}")?this.pathState.set({type:`${t}FileGroup`,path:e,expression:e.slice(1,-1)}):e.startsWith("[")&&e.endsWith("]")?this.pathState.set({type:`${t}Regex`,path:e,expression:e.slice(1,-1)}):e.startsWith("*.")?this.pathState.set({type:`${t}Extension`,path:e,expression:e.slice(2)}):this.pathState.set({type:`${t}Expression`,path:e,expression:e})});updateStateType(i){this.pathState.update(e=>(e.type=i,e.path=this.#e(e),e)),this.pathChange.emit(this.pathState().path)}updateStateExpression(i){this.pathState.update(e=>(e.expression=i,e.path=this.#e(e),e)),this.pathChange.emit(this.pathState().path)}#e(i){let e=i.type.slice(0,1),t=i.type.slice(1);if(t==="Folder"){let o=i.expression.endsWith("/"),s=i.expression.startsWith("/");return o&&s?`${e}${i.expression}`:o?`${e}${i.expression}/`:s?`${e}/${i.expression}`:`${e}/${i.expression}/`}return t==="FolderNameIncludes"?`${e}*${i.expression}*/`:t==="FileNameIncludes"?`${e}[.*${i.expression}[^\\/]*]`:t==="FileGroup"?`${e}{${i.expression}}`:t==="Regex"?`${e}[${i.expression}]`:t==="Extension"?`${e}*.${i.expression}`:`${e}${i.expression}`}removeFilter(){this.remove.emit()}displayFn(i){let e=Zt.find(t=>t.value===i);return e?e.key:""}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-filter"]],inputs:{path:[1,"path"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let i;return i=$localize`Select an option...`,[[3,"hideClearButton","displayFn"],["type","text","placeholder",i,3,"ngModelChange","ngModel"],["options",""],[3,"value"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(e,t){e&1&&F(0,ui,10,4),e&2&&g(t.pathState()?0:-1)},dependencies:[mt,oe,re,ne,ie,Ut,se,ae,le],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Fi=["formRef"];function gi(n,i){if(n&1){let e=P();a(0,"app-filter",41),C("pathChange",function(o){let s=S(e).$index,d=p();return T(d.patchPathAt(o,s))})("remove",function(){let o=S(e).$index,s=p();return T(s.removePathAt(o))}),r()}if(n&2){let e=i.$implicit;_("path",e)}}function Ci(n,i){if(n&1&&(a(0,"option",45),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function fi(n,i){if(n&1&&(a(0,"div",40)(1,"spk-form-field"),m(2,"input",42),r(),a(3,"spk-select"),m(4,"input",43),I(5,44),R(6,Ci,2,2,"option",45,w),$(),r()()),n&2){let e=p();l(6),v(e.sizeOptions())}}var ke=new ee,Si=["Bytes","KB","MB","GB","TB","PB"],Jt=(n={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>ke.group({path:ke.control(n.path),excludes:ke.group({hidden:ke.control(n.excludes.hidden),system:ke.control(n.excludes.system),temporary:ke.control(n.excludes.temporary),filesLargerThan:ke.group({size:ke.control(null),unit:ke.control(null)})})}),xt=class n{#e=y(pe);#n=y(te);#i=y(Ce);formRef=ue.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new ct("");filesLargerThan=H(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=x(Si);pathSignal=W(this.sourceDataForm.controls.path.valueChanges);pathArray=H(()=>this.pathSignal()?.split("\0").filter(i=>i.startsWith("-")||i.startsWith("+"))??[]);addFilter(i="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${i}`)}patchPathAt(i,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),s=this.pathArray().map((d,k)=>k===e?`${i}`:`${d}`).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${s}`)}removePathAt(i){let t=this.sourceDataForm.controls.path.value.split("\0").filter(s=>!s.startsWith("-")&&!s.startsWith("+")).join("\0"),o=this.pathArray().filter((s,d)=>d!==i).join("\0");this.sourceDataForm.controls.path.setValue(`${t}\0${o}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${i}\0${this.newPathCtrl.value}`),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=J({type:n,selectors:[["app-source-data"]],viewQuery:function(e,t){e&1&&de(t.formRef,Fi,5),e&2&&Fe()},decls:56,vars:11,consts:()=>{let i;i=$localize`Path`;let e;e=$localize`Add a direct path`;let t;t=$localize`Hidden files`;let o;o=$localize`System files`;let s;s=$localize`Temporary files`;let d;d=$localize`Source Data`;let k;k=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let M;M=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let h;h=$localize`Source Data`;let Q;Q=$localize`Add Path`;let Y;Y=$localize`Add a path directly from your machine.`;let B;B=$localize`Filters`;let K;K=$localize`Customize your filters.`;let j;j=$localize`Add filter`;let N;N=$localize`Exclude`;let u;u=$localize`Choose if there’s any files you want to exclude.`;let f;f=$localize` Hidden files ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let z;z=$localize` System files ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let O;O=$localize` Temporary files ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files larger than `;let Ae;return Ae=$localize`Select an option...`,[["formRef",""],d,k,M,h,Q,Y,B,K,j,N,u,f,z,O,_e,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",i,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],[3,"path"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",t,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",s,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"pathChange","remove","path"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder",Ae],["options",""],[3,"value"]]},template:function(e,t){if(e&1){let o=P();a(0,"form",16,0),C("submit",function(){return S(o),T(t.next())}),a(2,"div",17)(3,"h3",18),A(4,1),r(),a(5,"app-file-tree",19)(6,"label",20),c(7,"Folder path"),r(),m(8,"input",21),r(),a(9,"div",22)(10,"button",23),C("click",function(){return S(o),T(t.goBack())}),E(11,2),m(12,"spk-icon"),D(),r(),a(13,"button",24),E(14,3),m(15,"spk-icon"),D(),r()()(),a(16,"div",25)(17,"h3",18),A(18,4),r(),a(19,"app-toggle-card",26),I(20,27),A(21,5),$(),a(22,"p",28),A(23,6),r(),a(24,"div",29)(25,"spk-form-field"),m(26,"input",30),r(),a(27,"button",31),C("click",function(){return S(o),T(t.addNewPath())}),a(28,"spk-icon"),c(29,"plus"),r()()()(),a(30,"app-toggle-card",26),I(31,27),A(32,7),$(),a(33,"p",28),A(34,8),r(),a(35,"button",32),C("click",function(){return S(o),T(t.addFilter())}),A(36,9),r(),R(37,gi,1,1,"app-filter",33,w),r(),a(39,"app-toggle-card",34),I(40,27),A(41,10),$(),a(42,"p",28),A(43,11),r(),a(44,"spk-toggle",35),E(45,12),m(46,"input",36),D(),r(),a(47,"spk-toggle",35),E(48,13),m(49,"input",37),D(),r(),a(50,"spk-toggle",35),E(51,14),m(52,"input",38),D(),r(),a(53,"spk-toggle",39),C("click",function(){return S(o),T(t.toggleFilesLargerThan())}),A(54,15),r(),F(55,fi,8,0,"div",40),r()()()}e&2&&(_("formGroup",t.sourceDataForm),l(5),_("multiSelect",!0)("startingPath",t.getPath())("showFiles",!0),l(14),_("disallowToggle",!0),l(7),_("formControl",t.newPathCtrl),l(4),_("disallowToggle",!0),l(7),v(t.pathArray()),l(2),_("disallowToggle",!0),l(14),he("active",t.filesLargerThan()),l(2),g(t.filesLargerThan()?55:-1))},dependencies:[mt,Se,oe,re,ne,$e,Ie,ie,fe,De,_t,Te,Ee,Me,le,ae,we,se,Re,Xe,ve,Tt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var ce=new ee,pe=class n{#e=y(te);#n=y(pt);#i=y(Be);#o=y(Ct);generalForm=jt();sourceDataForm=Jt();scheduleForm=Yt();destinationForm=en();optionsForm=qt();isDraft=x(!1);backupId=x(null);isSubmitting=x(!1);finishedLoading=x(!1);backupDefaults=x(null);isNew=H(()=>this.backupId()==="new");selectedOptions=x([]);selectedAdvancedFormPair=x([]);destinationFormPair=x({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=H(()=>{let i=this.destinationFormPair()?.advanced??[],e=this.selectedAdvancedFormPair()??[];return i.filter(t=>e.findIndex(o=>o.name===t.name)===-1)});selectedHttpOptions=x([]);notSelectedHttpOptions=H(()=>{let i=this.httpOptions(),e=this.selectedHttpOptions()??[];return i.filter(t=>e.findIndex(o=>o.name===t.name)===-1)});sourceDataFormSignal=W(this.sourceDataForm.valueChanges);destinationFormSignal=W(this.destinationForm.valueChanges);generalFormSignal=W(this.generalForm.valueChanges);encryptionFieldSignal=W(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=W(this.scheduleForm.valueChanges);destinationOptions=H(()=>this.#n.backendModules()??[]);httpOptions=H(()=>this.#n.systemInfo()?.GenericModules?.find(i=>i.Key==="http-options")?.Options?.map(this.#t)??[]);advancedOptions=H(()=>this.#n.systemInfo()?.Options?.map(this.#t)??[]);#t(i){return{name:i.Name,type:i.Type,shortDescription:i.ShortDescription??void 0,longDescription:i.LongDescription??void 0,options:i.ValidValues}}encryptionOptions=H(()=>{let i=this.#n.systemInfo()?.EncryptionModules??[];return[yt,...i]});nonSelectedOptions=H(()=>this.advancedOptions().sort((i,e)=>i?.name&&e?.name?i?.name.localeCompare(e?.name):0).filter(i=>this.selectedOptions()?.findIndex(e=>e.name===i.name)===-1));addAdvancedFormPairByName(i,e,t){let o=this.notSelectedAdvancedFormPair().find(s=>s.name===i);o&&this.addAdvancedFormPair(o,e,t)}addHttpOptionByName(i,e,t){let o=this.notSelectedHttpOptions().find(s=>s.name===i);o&&this.addHttpOption(o,e,t)}addAdvancedFormPair(i,e,t){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,s=t??i.defaultValue;this.createFormField(o,i,s),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),i])}addHttpOption(i,e,t){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,s=t??i.defaultValue;this.createFormField(o,i,s),this.selectedHttpOptions.set([...this.selectedHttpOptions(),i])}removeAdvancedFormPair(i,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(i.name),this.selectedAdvancedFormPair().findIndex(o=>o.name===i.name)!==-1?this.selectedAdvancedFormPair.update(o=>(o=o.filter(s=>s.name!==i.name),o)):this.selectedHttpOptions.update(o=>(o=o.filter(s=>s.name!==i.name),o))}removeHttpOption(i,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(i.name),this.selectedHttpOptions.update(t=>(t=t.filter(o=>o.name!==i.name),t))}submit(){this.isSubmitting.set(!0);let i=this.#s(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#i.postApiV1Backups({requestBody:i}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:t=>{console.log("submitted res",t),this.exit()},error:t=>{console.error("submitted error",t)}}):this.#i.putApiV1BackupById({id:e,requestBody:i}).pipe(Ye(()=>this.isSubmitting.set(!1))).subscribe({next:t=>{console.log("submitted res",t),this.exit()},error:t=>{console.error("submitted error",t)}})}exit(){this.#c(),this.#e.navigate(["/"])}updateFieldsFromTargetUrl(i){this.#r(),setTimeout(()=>{this.#l(i)})}#r(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(i){let e=i.Sources??"",t=i.Filters?.map(h=>`${h.Include?"":"-"}${h.Expression}`)??[],o=i.Settings?.find(h=>h.Name==="--exclude-files-attributes")?.Value??"",s=i.Settings?.find(h=>h.Name==="--skip-files-larger-than")??null,d=s?.Value.replace(/[0-9]/g,"")??null,k=s?.Value.replace(/[^0-9]/g,"")??null,M={path:[...e,...t].join("\0"),excludes:{hiddenFiles:o.includes("hidden"),systemFiles:o.includes("system"),tempFiles:o.includes("temporary"),filesLargerThan:d&&k?{size:parseInt(k),unit:d.toUpperCase()}:null}};this.sourceDataForm.patchValue(M)}mapDestinationToForm(i){let e=i.TargetURL?ht(i.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}#l(i){let e=ht(i);e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}mapGeneralToForm(i){let e=i.Settings?.find(s=>s.Name==="encryption-module"),t=e?.Value&&e.Value.length?e.Value:"",o={name:i.Name??"",description:i.Description??""};t&&t!==""&&(o.encryption=t),this.generalForm.patchValue(o)}mapScheduleToForm(i){if(!i){this.scheduleForm.patchValue({autoRun:!0});return}let e=this.#o.fromString(i.Repeat)??null,o={nextTime:this.#p(i.Time),runAgain:{repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:i.AllowedDays?.includes("mon")??!1,tue:i.AllowedDays?.includes("tue")??!1,wed:i.AllowedDays?.includes("wed")??!1,thu:i.AllowedDays?.includes("thu")??!1,fri:i.AllowedDays?.includes("fri")??!1,sat:i.AllowedDays?.includes("sat")??!1,sun:i.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(o)}mapOptionsToForms(i){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"],t=this.advancedOptions();i.Settings?.forEach(o=>{if(o.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(o.Value??"");if(!(o.Name&&e.includes(o.Name))){if(o.Name==="dblock-size"){let s=o.Value?.replace(/[^0-9]/g,""),d=o.Value?.replace(/[0-9]/g,"");return this.optionsForm.controls.remoteVolumeSize.setValue({size:s?parseInt(s):null,unit:d?d.toUpperCase():null})}if(o.Name&&o.Value){let s=t.find(d=>d.name===o.Name);if(!s)return;this.addOptionToFormGroup(s,o.Value)}}})}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#s(){let i=this.generalForm.value,e=this.optionsForm.value,t=this.scheduleForm.value,o=this.sourceDataForm.value,d=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],k=null;t.runAgain?.repeatUnit&&t.runAgain?.repeatValue&&(k=this.#o.toString(t.runAgain.repeatValue,t.runAgain.repeatUnit));let M=t.runAgain?.allowedDays?Object.entries(t.runAgain?.allowedDays).filter(([u,f])=>f).map(([u,f])=>u):[],h=o.path?.split("\0")??[],Q=i.encryption===""?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:i.encryption??null},Y=this.advancedOptions(),B=Object.entries(e.advancedOptions??{}).filter(([u,f])=>u&&f).map(([u,f])=>{let z=Y.find(O=>O.name===u);return z?.type==="Size"?{Name:u,Value:`${f.size}${f.unit.toLowerCase()}`}:z?.type==="Integer"?{Name:u,Value:f.toString()}:z?.type==="Boolean"?{Name:u,Value:f.toString()}:{Name:u,Value:f}}),K=[Q,...B],j=Object.entries(o.excludes??{}).filter(([u,f])=>f&&u!=="filesLargerThan").map(([u])=>u),N=o.excludes?.filesLargerThan;return j.length&&K.push({Name:"--exclude-files-attributes",Value:j.join(",")}),N&&N.size!==null&&N.unit!==null&&K.push({Name:"--skip-files-larger-than",Value:`${N.size}${N.unit}`}),{Backup:{Name:i.name,Description:i.description,TargetURL:d[0]??null,Sources:h.filter(u=>!u.startsWith("-")),Settings:K,Filters:h.filter(u=>u.startsWith("-")).map((u,f)=>({Order:f,Include:!1,Expression:u.slice(1)}))},Schedule:t.autoRun?{Repeat:k,Time:t.nextTime?.date?new Date(`${t.nextTime.date}T${t.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:M}:null}}#a(i){return i.controls.map(e=>ft(e.value))}#p(i){if(!i||i?.indexOf("T")===-1)return{time:i??"13:00"};let e=new Date(i),t={time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`};return i.indexOf("T")!==-1&&(t.date=e.toISOString().split("T")[0]),t}removeOptionFromFormGroup(i){let e=i.name;e&&(this.optionsForm.controls.advancedOptions.removeControl(e),this.selectedOptions.update(t=>(t=t.filter(o=>o.name!==e),t)))}addOptionToFormGroup(i,e){let t=this.optionsForm.controls.advancedOptions;this.createFormField(t,i,e??i.defaultValue),this.selectedOptions.update(o=>(o.push(i),o))}createFormField(i,e,t){if(e.type==="String"||e.type==="FileTree"||e.type==="FolderTree"||e.type==="Password"||e.type==="Enumeration"||e.type==="NonValidatedSelectableString"||e.type==="Path"){i.addControl(e.name,ce.control(t));return}if(e.type==="Size"){let o=t.replace(/[0-9]/g,""),s=t.replace(/[^0-9]/g,"");i.addControl(e.name,ce.group({size:ce.control(s?parseInt(s):50),unit:ce.control(o?o.toUpperCase():"MB")}));return}if(e.type==="Integer"){i.addControl(e.name,ce.control(t?parseInt(t):0));return}if(e.type==="Boolean"){i.addControl(e.name,ce.control(t==="true"));return}if(e.type==="Flags"){i.addControl(e.name,ce.control(t??""));return}if(e.type==="Timespan"){i.addControl(e.name,ce.control(t,[ye.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(i,e,t=!1){let o=this.destinationOptions().find(N=>N.Key===i),s=this.httpOptions();if(!o||!o.Options)return;let d=nt.hasOwnProperty(i)&&nt[i],k=d&&d.oauthField?d.oauthField:null,M=d&&d.customFields?d.customFields:{},h=d&&d.dynamicFields?d.dynamicFields:[],Q=d&&d.advancedFields?d.advancedFields:[],Y=d&&d.ignoredAdvancedFields?d.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:k,custom:[],dynamic:[],advanced:[]});let B=ce.group({}),K=ce.group({}),j=ce.group({});M&&Object.entries(M).forEach(([N,u],f)=>{let _e=u,{formElement:z}=_e,O=$t(_e,["formElement"]);B.addControl(N,z(e?.custom[N])),this.destinationFormPair.update(Ae=>(Ae.custom.push(Z({order:900+f},O)),Ae))});for(let N=0;N<o.Options.length;N++){let u=o.Options[N];if(u.Deprecated)continue;let f=h.find(z=>z===u.Name||z.name===u.Name);if(f){let z=f&&typeof f!="string",O={name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,order:900+N},_e=z?Z(Z({},O),f):O,G=e?.dynamic[u.Name]??u.DefaultValue;this.createFormField(K,_e,G),this.destinationFormPair.update(qe=>(qe.dynamic.push(_e),qe))}else{if(Y.find(me=>me===u.Name))continue;let O=Q.find(me=>me===u.Name||me.name===u.Name),_e=O&&typeof O!="string",Ae=e?.advanced[u.Name],G=Ae??u.DefaultValue,qe={name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues,defaultValue:G,order:900+N},Nt=_e?Z(Z({},qe),O):qe;t&&Ae&&(this.createFormField(j,Nt,G),this.selectedAdvancedFormPair.update(me=>(me.push(Nt),me))),this.destinationFormPair.update(me=>(me.advanced.push(Nt),me))}}for(let N=0;N<s.length;N++){let u=s[N],f=e?.advanced[u.name],z=f??u.defaultValue;t&&f&&(this.createFormField(j,u,z),this.selectedHttpOptions.update(O=>(O.push(u),O)))}this.destinationFormPair.update(N=>({oauthField:N.oauthField,custom:N.custom.sort((u,f)=>u.order-f.order),dynamic:N.dynamic.sort((u,f)=>u.order-f.order),advanced:N.advanced.sort((u,f)=>u.order-f.order)})),this.destinationForm.controls.destinations.push(tn({key:o.Key,customGroup:B,dynamicGroup:K,advancedGroup:j}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||n)};static \u0275prov=xe({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ti=["formRef"],Ei=(n,i,e,t)=>({index:n,formView:i,formGroupName:"custom",destinationType:e,oauthField:t}),Dt=n=>({$implicit:n}),Di=(n,i,e,t)=>({index:n,formView:i,formGroupName:"dynamic",destinationType:e,oauthField:t}),Ni=(n,i,e,t)=>({index:n,formView:i,formGroupName:"advanced",destinationType:e,oauthField:t}),Ai=(n,i,e,t)=>({index:n,formView:i,formGroupName:"advanced",asHttpOptions:!0,destinationType:e,oauthField:t}),hi=()=>({maxWidth:"700px",width:"100%"});function Oi(n,i){n&1&&(E(0,2,2),m(1,"spk-icon"),D())}function yi(n,i){n&1&&A(0,2,3)}function Pi(n,i){if(n&1){let e=P();E(0,2,1),a(1,"button",24),C("click",function(){S(e);let o=p();return T(o.testDestination())}),F(2,Oi,2,0)(3,yi,1,0),r(),D()}if(n&2){let e=p();l(),he("success",e.successfulTest()),l(),g(e.successfulTest()?2:3)}}function ki(n,i){if(n&1){let e=P();a(0,"p",30),C("click",function(){S(e);let o=p();return T(o.removeDestinationFormGroup(o.destinationCount()-1))}),E(1,5),m(2,"span",31),D(),r()}}function xi(n,i){if(n&1){let e=P();a(0,"div",32)(1,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("file"))}),a(2,"h3"),A(3,6),r(),a(4,"p"),A(5,7),r()(),a(6,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("gcs"))}),a(7,"h3"),c(8,"Google Cloud Storage"),r(),a(9,"p"),A(10,8),r()(),a(11,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("s3"))}),a(12,"h3"),c(13,"S3 compatible bucket"),r(),a(14,"p"),A(15,9),r()(),a(16,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("ssh"))}),a(17,"h3"),c(18,"SSH"),r(),a(19,"p"),A(20,10),r()(),a(21,"div",33),C("click",function(){S(e);let o=p();return T(o.addDestinationFormGroup("googledrive"))}),a(22,"h3"),c(23,"Google Drive"),r(),a(24,"p"),A(25,11),r()()(),a(26,"p"),A(27,12),r()}}function Ii(n,i){n&1&&be(0)}function $i(n,i){if(n&1&&F(0,Ii,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ei,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Mi(n,i){n&1&&be(0)}function wi(n,i){if(n&1&&F(0,Mi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Di,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Ri(n,i){if(n&1){let e=P();E(0,13,1),a(1,"button",40),C("click",function(){let o=S(e).$implicit,s=p(2);return T(s.addAdvancedFormPair(o,0))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function vi(n,i){n&1&&be(0)}function Gi(n,i){if(n&1&&F(0,vi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ni,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function bi(n,i){if(n&1){let e=P();E(0,14,1),a(1,"button",40),C("click",function(){let o=S(e).$implicit,s=p(2);return T(s.addHttpOption(o,0))}),r(),D()}if(n&2){let e=i.$implicit;l(),Je(e.name),et(0)}}function Vi(n,i){n&1&&be(0)}function Li(n,i){if(n&1&&F(0,Vi,1,0,"ng-container",39),n&2){let e,t=i.$implicit,o=i.$index;p();let s=ge(29),d=p();_("ngTemplateOutlet",s)("ngTemplateOutletContext",Ve(7,Dt,tt(2,Ai,o,t,(e=d.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,d.destinationFormPair().oauthField)))}}function Ui(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Bi(n,i){if(n&1&&(a(0,"app-file-tree",43)(1,"label",50),c(2),F(3,Ui,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name))("accepts",t.formView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function Ki(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Xi(n,i){if(n&1&&(a(0,"app-file-tree",44)(1,"label",50),c(2),F(3,Ki,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit,o=p(2);_("startingPath",o.getFormFieldValue(0,t.formGroupName,t.formView.name)),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function zi(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Hi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"link"),r())}function Wi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"textbox"),r())}function ji(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,zi,3,1,"spk-tooltip",51),r(),m(4,"input",52),F(5,Hi,2,0,"spk-icon",53)(6,Wi,2,0,"spk-icon",53),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(),g(t.formView.type==="Path"?5:6)}}function qi(n,i){if(n&1){let e=P();a(0,"span",57),C("click",function(){S(e);let o=p(2).$implicit,s=p(2);return T(s.oauthStartTokenCreation(o.destinationType))}),c(1,"AuthID"),r()}}function Qi(n,i){n&1&&(a(0,"spk-icon",53),c(1,"password"),r())}function Yi(n,i){if(n&1){let e=P();a(0,"spk-icon",58),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye "),r()}}function Zi(n,i){if(n&1){let e=P();a(0,"spk-icon",58),C("click",function(){S(e);let o=p(2).$implicit;return T(o.formView.showPassword=!o.formView.showPassword)}),c(1," eye-slash "),r()}}function Ji(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),r(),m(3,"input",54),F(4,qi,2,0,"span",55)(5,Qi,2,0,"spk-icon",53)(6,Yi,2,0,"spk-icon",56)(7,Zi,2,0,"spk-icon",56),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),_("type",t.formView.showPassword?"text":"password"),l(),g(t.oauthField===t.formView.name?4:5),l(2),g(t.formView.showPassword?6:7)}}function eo(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function to(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function no(n,i){if(n&1&&(a(0,"spk-select")(1,"label",50),c(2),F(3,eo,3,1,"spk-tooltip",51),r(),m(4,"input",59),I(5,60),R(6,to,2,2,"option",61,w),$(),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function io(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function oo(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e.value),l(),wt(" ",e.key," ",e.value?"("+e.value+")":""," ")}}function ro(n,i){if(n&1&&(a(0,"spk-select",45)(1,"label",50),c(2),F(3,io,3,1,"spk-tooltip",51),r(),m(4,"input",59),I(5,60),R(6,oo,2,3,"option",61,w),$(),r()),n&2){let e,t=p().$implicit,o=p(2);_("isFreeText",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name),l(2),v(t.formView.loadOptions(o.injector)())}}function ao(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function lo(n,i){if(n&1&&(a(0,"option",61),c(1),r()),n&2){let e=i.$implicit;_("value",e),l(),L(e)}}function so(n,i){if(n&1&&(a(0,"div",46)(1,"label",50),c(2),F(3,ao,3,1,"spk-tooltip",51),r(),a(4,"div",62)(5,"spk-form-field"),m(6,"input",63),a(7,"spk-icon",53),c(8,"resize"),r()(),a(9,"spk-select"),m(10,"label")(11,"input",64),I(12,60),R(13,lo,2,2,"option",61,w),$(),r()()()),n&2){let e,t=p().$implicit,o=p(2);_("formGroupName",t.formView.name),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(3),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(7),v(o.sizeOptions())}}function po(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function co(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,po,3,1,"spk-tooltip",51),r(),m(4,"input",65),a(5,"spk-icon",53),c(6,"numpad"),r()()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function _o(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function mo(n,i){if(n&1&&(a(0,"spk-toggle",47)(1,"label",50),c(2),F(3,_o,3,1,"spk-tooltip",51),r(),m(4,"input",66),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function uo(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function Fo(n,i){n&1&&(a(0,"spk-option",68),c(1,"None"),r()),n&2&&_("value","None")}function go(n,i){if(n&1&&(a(0,"spk-option",61),c(1),m(2,"spk-checkbox",69),r()),n&2){let e=p().$implicit;_("value",e),l(),b(" ",e," ")}}function Co(n,i){if(n&1&&F(0,Fo,2,1,"spk-option",68)(1,go,3,2,"spk-option",61),n&2){let e=i.$implicit;g(e==="None"?0:1)}}function fo(n,i){if(n&1&&(a(0,"spk-select",48)(1,"label",50),c(2),F(3,uo,3,1,"spk-tooltip",51),r(),m(4,"input",67),I(5,60),R(6,Co,2,1,null,null,w),$(),r()),n&2){let e,t=p().$implicit;_("selectMultiple",!0),l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),U("formControlName",t.formView.name),l(2),v(t.formView.options)}}function So(n,i){if(n&1&&(a(0,"spk-tooltip",51)(1,"spk-icon"),c(2,"question"),r()()),n&2){let e=p(2).$implicit;_("message",e.formView.longDescription)}}function To(n,i){if(n&1&&(a(0,"spk-form-field")(1,"label",50),c(2),F(3,So,3,1,"spk-tooltip",51),r(),m(4,"input",52),r()),n&2){let e,t=p().$implicit;l(),V("for","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),l(),b(" ",(e=t.formView.shortDescription)!==null&&e!==void 0?e:t.formView.name," "),l(),g(t.formView.longDescription?3:-1),l(),V("id","destination-",t.formGroupName,"-",t.index,"-",t.asHttpOptions?"http":"other",""),U("formControlName",t.formView.name)}}function Eo(n,i){if(n&1){let e=P();a(0,"button",70),C("click",function(){S(e);let o=p().$implicit,s=p(2);return T(s.removeFormView(o.formView,0))}),a(1,"spk-icon"),c(2,"x-circle"),r()()}}function Do(n,i){if(n&1&&(a(0,"div",41),I(1,42),F(2,Bi,5,16,"app-file-tree",43)(3,Xi,5,12,"app-file-tree",44)(4,ji,7,12,"spk-form-field")(5,Ji,8,13,"spk-form-field")(6,no,8,11,"spk-select")(7,ro,8,12,"spk-select",45)(8,so,15,11,"div",46)(9,co,7,11,"spk-form-field")(10,mo,5,11,"spk-toggle",47)(11,fo,8,8,"spk-select",48)(12,To,5,11,"spk-form-field"),$(),F(13,Eo,3,0,"button",49),r()),n&2){let e=i.$implicit;he("single-field",e.formGroupName!=="advanced"),l(),_("formGroupName",e.formGroupName),l(),g(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="NonValidatedSelectableString"?7:e.formView.type==="Size"?8:e.formView.type==="Integer"?9:e.formView.type==="Boolean"?10:e.formView.type==="Flags"?11:e.formView.type==="Timespan"?12:-1),l(11),g(e.formGroupName==="advanced"?13:-1)}}function No(n,i){if(n&1&&(I(0,25)(1,34),R(2,$i,1,9,"ng-container",null,w),R(4,wi,1,9,"ng-container",null,w),a(6,"app-toggle-card",35),I(7,36),E(8,13),a(9,"spk-menu")(10,"button",37),m(11,"spk-icon"),r(),I(12,23),R(13,Ri,2,1,"button",38,w),$(),r(),D(),$(),R(15,Gi,1,9,"ng-container",null,w),r(),a(17,"app-toggle-card",35),I(18,36),E(19,14),a(20,"spk-menu")(21,"button",37),m(22,"spk-icon"),r(),I(23,23),R(24,bi,2,1,"button",38,w),$(),r(),D(),$(),R(26,Li,1,9,"ng-container",null,w),r(),F(28,Do,14,5,"ng-template",null,1,at),$()()),n&2){let e=p();l(2),v(e.destinationFormPair().custom),l(2),v(e.destinationFormPair().dynamic),l(2),_("disallowToggle",!0),l(4),_("disabled",e.notSelectedAdvancedFormPair().length===0),l(3),v(e.notSelectedAdvancedFormPair()),l(2),v(e.selectedAdvancedFormPair()),l(2),_("disallowToggle",!0),l(4),_("disabled",e.notSelectedHttpOptions().length===0),l(3),v(e.notSelectedHttpOptions()),l(2),v(e.selectedHttpOptions())}}function Ao(n,i){if(n&1){let e=P();a(0,"spk-dialog",71),Gt("isOpenChange",function(o){S(e);let s=p();return vt(s.targetUrlDialogOpen,o)||(s.targetUrlDialogOpen=o),T(o)}),a(1,"header",72)(2,"h2"),A(3,15),r(),a(4,"spk-alert",73),A(5,16),r()(),a(6,"div",74)(7,"spk-form-field"),m(8,"textarea",75),r()(),a(9,"footer",76)(10,"button",27),C("click",function(){S(e);let o=p();return T(o.closeTargetUrlDialog(!1))}),c(11,"Cancel"),r(),a(12,"button",77),C("click",function(){S(e);let o=p();return T(o.closeTargetUrlDialog(!0))}),E(13,17),m(14,"spk-icon"),D(),r()()()}if(n&2){let e=p();Rt("isOpen",e.targetUrlDialogOpen),_("options",bt(3,hi)),l(8),_("formControl",e.targetUrlCtrl)}}var ho=["Bytes","KB","MB","GB","TB","PB"],Et=new ee,en=(n={destinations:[]})=>Et.group({destinations:Et.array(n.destinations)}),tn=({key:n,customGroup:i,dynamicGroup:e,advancedGroup:t})=>Et.group({destinationType:Et.control(n),custom:i,dynamic:e,advanced:t}),It=class n{#e=y(te);#n=y(Ce);#i=y(Lt);#o=y(Be);#t=y(pe);#r=y(Xt);injector=y(Mt);formRef=ue.required("formRef");destinationForm=this.#t.destinationForm;destinationFormPair=this.#t.destinationFormPair;selectedAdvancedFormPair=this.#t.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#t.notSelectedAdvancedFormPair;selectedHttpOptions=this.#t.selectedHttpOptions;notSelectedHttpOptions=this.#t.notSelectedHttpOptions;destinationOptions=this.#t.destinationOptions;destinationFormSignal=this.#t.destinationFormSignal;destinationCount=H(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=x(ho);successfulTest=x(!1);getFormFieldValue(i,e,t){return((this.destinationForm.controls.destinations.controls?.[i]).controls?.[e]).controls[t].value}addDestinationFormGroup(i){this.#t.addDestinationFormGroup(i)}addAdvancedFormPair(i,e){this.#t.addAdvancedFormPair(i,e)}removeFormView(i,e){this.#t.removeAdvancedFormPair(i,e)}addHttpOption(i,e){this.#t.addHttpOption(i,e)}targetUrl=H(()=>this.#t.getCurrentTargetUrl()[0]);targetUrlCtrl=new ct;targetUrlInitial=x(null);targetUrlDialogOpen=x(!1);openTargetUrlDialog(){let e=this.#t.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(i=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl.value,t=this.targetUrlInitial();!i||e===t||this.#t.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(i=0){let t=this.#t.getCurrentTargetUrl()[i];t&&this.#o.postApiV1RemoteoperationTest({requestBody:{path:t}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:o=>{let s=o.error.error.Error;if(s==="missing-folder"&&this.#r.open(Le,{data:{title:"Create folder",message:"The remote destination folder does not exist, do you want to create it?"},closed:d=>{d&&this.#o.postApiV1RemoteoperationCreate({requestBody:{path:t}}).subscribe()}}),s.startsWith("incorrect-cert:")){let d=s.split("incorrect-cert:")[1];this.#r.open(Le,{maxWidth:"500px",data:{title:"Trust the certificate",message:`The server is using a certificate that is not trusted.
2
2
  If this is a self-signed certificate, you can choose to trust this certificate.
3
3
  The server reported the certificate hash: ${d}`,confirmText:"Trust the certificate",cancelText:"Cancel"},closed:k=>{k&&this.#t.addHttpOptionByName("accept-specified-ssl-hash",d)}})}if(s.startsWith("incorrect-host-key:")){let d=s.split('incorrect-host-key:"')[1].split('",')[0],k=s.split('accepted-host-key:"')[1].split('",')[0];k?this.#r.open(Le,{maxWidth:"500px",data:{title:"The host key has changed",message:`The host key has changed, please check with the server administrator if this is correct,
4
4
  otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
@@ -1 +1 @@
1
- import{e as E}from"./chunk-SW6FZ3TL.js";import"./chunk-K7H3KYW7.js";import"./chunk-QSMEC63O.js";import"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import{o as g,s as O}from"./chunk-EHV3OZDB.js";import{H as u,L as R,Y as m,Z as T}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import{Eb as n,Fb as r,Gb as a,Qb as _,Ra as p,Rb as l,X as s,fb as S,sc as d,vb as F}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var k=t=>["/restore-flow",t,"select-files"],f=t=>["/restore-flow",t,"options"],c=class t{#t=s(u);#e=s(E);backupId=this.#e.backupId;ngOnInit(){this.#e.init(this.#t.snapshot.params.id)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=S({type:t,selectors:[["app-restore-flow"]],decls:9,vars:6,consts:()=>{let o;o=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let e;return e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[o,e,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,i){e&1&&(n(0,"spk-stepper")(1,"div",2),_(2,0),a(3,"spk-radio"),l(),r(),n(4,"div",2),_(5,1),a(6,"spk-radio"),l(),r()(),n(7,"section"),a(8,"router-outlet"),r()),e&2&&(p(),F("routerLink",d(2,k,i.backupId())),p(3),F("routerLink",d(4,f,i.backupId())))},dependencies:[O,g,R,m,T],styles:["[_nghost-%COMP%]{display:block}spk-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{c as default};
1
+ import{e as E}from"./chunk-W76PK3CU.js";import"./chunk-K7H3KYW7.js";import"./chunk-DE2AAZUP.js";import"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import{o as g,s as O}from"./chunk-EHV3OZDB.js";import{H as u,L as R,Y as m,Z as T}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import{Eb as n,Fb as r,Gb as a,Qb as _,Ra as p,Rb as l,X as s,fb as S,sc as d,vb as F}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var k=t=>["/restore-flow",t,"select-files"],f=t=>["/restore-flow",t,"options"],c=class t{#t=s(u);#e=s(E);backupId=this.#e.backupId;ngOnInit(){this.#e.init(this.#t.snapshot.params.id)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=S({type:t,selectors:[["app-restore-flow"]],decls:9,vars:6,consts:()=>{let o;o=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_RADIO: Select files `;let e;return e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[o,e,["step","","routerLinkActive","active",3,"routerLink"]]},template:function(e,i){e&1&&(n(0,"spk-stepper")(1,"div",2),_(2,0),a(3,"spk-radio"),l(),r(),n(4,"div",2),_(5,1),a(6,"spk-radio"),l(),r()(),n(7,"section"),a(8,"router-outlet"),r()),e&2&&(p(),F("routerLink",d(2,k,i.backupId())),p(3),F("routerLink",d(4,f,i.backupId())))},dependencies:[O,g,R,m,T],styles:["[_nghost-%COMP%]{display:block}spk-stepper[_ngcontent-%COMP%]{max-width:31.25rem;margin:2.5rem auto}section[_ngcontent-%COMP%]{max-width:31.25rem;margin:0 auto 2.5rem}"],changeDetection:0})};export{c as default};
@@ -0,0 +1 @@
1
+ import"./chunk-C6Q5SG76.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-IOH6RL5H.js")},{path:"destination",loadComponent:()=>import("./chunk-YCOOYSZG.js")},{path:"source-data",loadComponent:()=>import("./chunk-GTXQM7B6.js")},{path:"schedule",loadComponent:()=>import("./chunk-BT2JRS3A.js")},{path:"options",loadComponent:()=>import("./chunk-QLPXITCK.js")}];export{o as default};
@@ -1 +1 @@
1
- import{g as a,h as b,i as c}from"./chunk-4UJICSQB.js";import"./chunk-QSMEC63O.js";import"./chunk-DNHLTHLR.js";import"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{b as createAdvancedOption,a as createOptionsForm,c as default};
1
+ import{g as a,h as b,i as c}from"./chunk-L6DT3BQG.js";import"./chunk-DE2AAZUP.js";import"./chunk-DNHLTHLR.js";import"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{b as createAdvancedOption,a as createOptionsForm,c as default};
@@ -1 +1 @@
1
- import{a,b}from"./chunk-SW6FZ3TL.js";import"./chunk-K7H3KYW7.js";import"./chunk-QSMEC63O.js";import"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreOptionsForm,b as default};
1
+ import{a,b}from"./chunk-W76PK3CU.js";import"./chunk-K7H3KYW7.js";import"./chunk-DE2AAZUP.js";import"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreOptionsForm,b as default};
@@ -1 +1 @@
1
- import{a as G}from"./chunk-QZCTOSPE.js";import{a as x,b as w}from"./chunk-PIDBEXSZ.js";import{n as L}from"./chunk-EHV3OZDB.js";import{a as M}from"./chunk-OVIL3KMN.js";import{Ab as E,E as g,Eb as l,Fb as o,Gb as R,Kc as p,L as b,Mc as P,R as B,Ra as u,Sb as f,X as r,Xb as _,Za as i,fb as D,ib as A,ic as h,l as T,lb as I,lc as k,p as C,vb as y,vc as N,wc as O}from"./chunk-MR4RE3IB.js";import{a as d,b as S}from"./chunk-C6Q5SG76.js";var c=class a{#t=r(M);transform(t,...e){return console.log(t),console.log(this.#t.hello),this.#t.locale(),this.#t(t).fromNow()}static \u0275fac=function(e){return new(e||a)};static \u0275pipe=A({name:"appRelativeTime",type:a,pure:!0})};var m=class a{#t=1e3;#d=r(w);#o=r(x);#n=r(G);#e=i(!1);#i=i(!1);#u=i(this.#t);#p=i(null);#r=i(!1);#s=i(!1);#a=i(null);#S=i(!1);statusData=this.#p.asReadonly();serverState=p(()=>{let t=this.#a();return t?(t.ProposedSchedule=t?.ProposedSchedule?.map(e=>{let s=e.Item1?this.#n.getBackupById(e.Item1):null;return S(d({},e),{backup:s})}),t):null});isFetching=this.#i.asReadonly();#l=null;#g=P(()=>{let t=this.#e(),e=this.#u();if(!t||!e||e<this.#t){this.#l&&window.clearInterval(this.#l);return}this.#l=window.setInterval(()=>{this.#m()},e)});start(){this.#r.set(!0),this.#c()}stop(){this.#r.set(!1)}startPollingProgress(){this.#m(),this.#e.set(!0)}stopPollingProgress(){this.#e.set(!1)}setProgressStatePollingInterval(t){if(t<this.#t){console.error(`Polling interval must be at least ${this.#t}ms`);return}this.#u.set(t)}serverStateEffect=P(()=>{if(this.#S()){this.stopPollingProgress();return}!this.#s()&&this.#r()?setTimeout(()=>{this.startPollingProgress(),this.#c()},1e3):this.stopPollingProgress()});#c(){if(this.#s())return;this.#s.set(!0);let t=this.#a()?.LastEventID,e=t==null?{}:{lastEventId:t,longpoll:!0,duration:"299s"};this.#o.getApiV1Serverstate(e).pipe(g(()=>this.#s.set(!1))).subscribe({next:s=>{this.#a()?.LastDataUpdateID!==s.LastDataUpdateID&&this.#n.getBackups(),this.#a.set(s)}})}#m(){this.#i.set(!0),this.#d.getApiV1Progressstate().pipe(b(t=>{let e=t.TaskID??null;return e===null?T(t):this.#o.getApiV1TaskByTaskid({taskid:e}).pipe(C(s=>S(d({},t),{task:s??null})))}),g(()=>this.#i.set(!1))).subscribe({next:t=>{let e=t.TaskID??null,s=t.BackupID??null;if(e!==null&&s!==null){let n=this.#n.getBackupById(s);t.backup=n}t.task?.Status==="Completed"?this.#e.set(!1):this.#e.set(!0),this.#p.set(t)},error:t=>{t.status===404&&this.#e.set(!1)}})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=B({token:a,factory:a.\u0275fac,providedIn:"root"})};function V(a,t){if(a&1&&(l(0,"div",4),h(1),o(),R(2,"spk-progress-bar",5)),a&2){let e,s,n=_();u(),k("",(e=n.statusData())==null||e.task==null?null:e.task.Status," - ",(e=n.statusData())==null||e.backup==null||e.backup.Backup==null?null:e.backup.Backup.Name,""),u(),y("value",(s=n.statusData())!=null&&s.OverallProgress?((s=n.statusData())==null?null:s.OverallProgress)*100:3)}}function j(a,t){if(a&1&&(l(0,"div",4),h(1),N(2,"appRelativeTime"),o()),a&2){let e,s=_();u(),k("",(e=s.nextBackup().backup)==null||e.Backup==null?null:e.Backup.Name," - ",O(2,2,s.nextBackup().time),"")}}function F(a,t){a&1&&(l(0,"div",4),f(1,0),o())}function X(a,t){a&1&&(l(0,"div",4),f(1,1),o())}var U=new Date,v=class a{#t=r(m);minsAgo=U.setMinutes(U.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;nextBackup=p(()=>({backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}));ngOnInit(){this.#t.start()}ngOnDestroy(){this.#t.stop()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=D({type:a,selectors:[["app-status-bar"]],decls:6,vars:1,consts:()=>{let t;t=$localize`No scheduled tasks`;let e;return e=$localize`Loading...`,[t,e,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"raised","primary",3,"value"]]},template:function(e,s){if(e&1&&(l(0,"div",2)(1,"div",3),I(2,V,3,3)(3,j,3,4,"div",4)(4,F,2,0,"div",4)(5,X,2,0,"div",4),o()()),e&2){let n;u(2),E(!((n=s.statusData())==null||n.task==null)&&n.task.Status&&((n=s.statusData())==null||n.task==null?null:n.task.Status)!=="Completed"?2:s.nextBackup().backup||s.nextBackup().time?3:!s.statusData()||((n=s.statusData())==null||n.task==null?null:n.task.Status)==="Completed"?4:5)}},dependencies:[L,c],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-level-40)}.current-backup[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{v as a};
1
+ import{a as L}from"./chunk-QZCTOSPE.js";import{a as M,b as x}from"./chunk-PIDBEXSZ.js";import{n as w}from"./chunk-EHV3OZDB.js";import{a as G}from"./chunk-OVIL3KMN.js";import{Ab as E,E as g,Eb as r,Fb as o,Gb as R,Kc as p,L as b,Mc as P,R as B,Ra as u,Sb as f,X as l,Xb as _,Za as i,fb as A,ib as I,ic as h,l as T,lb as D,lc as k,p as C,vb as y,vc as N,wc as O}from"./chunk-MR4RE3IB.js";import{a as d,b as S}from"./chunk-C6Q5SG76.js";var c=class a{#t=l(G);transform(t,...e){return console.log(t),console.log(this.#t.hello),this.#t.locale(),this.#t(t).fromNow()}static \u0275fac=function(e){return new(e||a)};static \u0275pipe=I({name:"appRelativeTime",type:a,pure:!0})};var m=class a{#t=1e3;#d=l(x);#o=l(M);#n=l(L);#e=i(!1);#i=i(!1);#u=i(this.#t);#p=i(null);#l=i(!1);#s=i(!1);#a=i(null);#S=i(!1);statusData=this.#p.asReadonly();serverState=p(()=>{let t=this.#a();return t?(t.ProposedSchedule=t?.ProposedSchedule?.map(e=>{let s=e.Item1?this.#n.getBackupById(e.Item1):null;return S(d({},e),{backup:s})}),t):null});isFetching=this.#i.asReadonly();#r=null;#g=P(()=>{let t=this.#e(),e=this.#u();if(!t||!e||e<this.#t){this.#r&&window.clearInterval(this.#r);return}this.#r=window.setInterval(()=>{this.#m()},e)});start(){this.#l.set(!0),this.#c()}stop(){this.#l.set(!1)}startPollingProgress(){this.#m(),this.#e.set(!0)}stopPollingProgress(){this.#e.set(!1)}setProgressStatePollingInterval(t){if(t<this.#t){console.error(`Polling interval must be at least ${this.#t}ms`);return}this.#u.set(t)}serverStateEffect=P(()=>{if(this.#S()){this.stopPollingProgress();return}!this.#s()&&this.#l()?setTimeout(()=>{this.startPollingProgress(),this.#c()},1e3):this.stopPollingProgress()});#c(){if(this.#s())return;this.#s.set(!0);let t=this.#a()?.LastEventID,e=t==null?{}:{lastEventId:t,longpoll:!0,duration:"299s"};this.#o.getApiV1Serverstate(e).pipe(g(()=>this.#s.set(!1))).subscribe({next:s=>{this.#a()?.LastDataUpdateID!==s.LastDataUpdateID&&this.#n.getBackups(),this.#a.set(s)}})}#m(){this.#i.set(!0),this.#d.getApiV1Progressstate().pipe(b(t=>{let e=t.TaskID??null;return e===null?T(t):this.#o.getApiV1TaskByTaskid({taskid:e}).pipe(C(s=>S(d({},t),{task:s??null})))}),g(()=>this.#i.set(!1))).subscribe({next:t=>{let e=t.TaskID??null,s=t.BackupID??null;if(e!==null&&s!==null){let n=this.#n.getBackupById(s);t.backup=n}t.task?.Status==="Completed"?this.#e.set(!1):this.#e.set(!0),this.#p.set(t)},error:t=>{t.status===404&&this.#e.set(!1)}})}static \u0275fac=function(e){return new(e||a)};static \u0275prov=B({token:a,factory:a.\u0275fac,providedIn:"root"})};function V(a,t){if(a&1&&(r(0,"div",4),h(1),o(),R(2,"spk-progress-bar",5)),a&2){let e,s,n=_();u(),k("",(e=n.statusData())==null||e.task==null?null:e.task.Status," - ",(e=n.statusData())==null||e.backup==null||e.backup.Backup==null?null:e.backup.Backup.Name,""),u(),y("value",(s=n.statusData())!=null&&s.OverallProgress?((s=n.statusData())==null?null:s.OverallProgress)*100:3)}}function j(a,t){if(a&1&&(r(0,"div",4),h(1),N(2,"appRelativeTime"),o()),a&2){let e,s=_();u(),k("",(e=s.nextBackup().backup)==null||e.Backup==null?null:e.Backup.Name," - ",O(2,2,s.nextBackup().time),"")}}function F(a,t){a&1&&(r(0,"div",4),f(1,0),o())}function X(a,t){a&1&&(r(0,"div",4),f(1,1),o())}var U=new Date,v=class a{#t=l(m);minsAgo=U.setMinutes(U.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;nextBackup=p(()=>({backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}));ngOnInit(){this.#t.start()}ngOnDestroy(){this.#t.stop()}static \u0275fac=function(e){return new(e||a)};static \u0275cmp=A({type:a,selectors:[["app-status-bar"]],decls:6,vars:1,consts:()=>{let t;t=$localize`No scheduled tasks`;let e;return e=$localize`Loading...`,[t,e,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"raised","primary",3,"value"]]},template:function(e,s){if(e&1&&(r(0,"div",2)(1,"div",3),D(2,V,3,3)(3,j,3,4,"div",4)(4,F,2,0,"div",4)(5,X,2,0,"div",4),o()()),e&2){let n;u(2),E(!((n=s.statusData())==null||n.task==null)&&n.task.Status&&((n=s.statusData())==null||n.task==null?null:n.task.Status)!=="Completed"?2:s.nextBackup().backup||s.nextBackup().time?3:!s.statusData()||((n=s.statusData())==null||n.task==null?null:n.task.Status)==="Completed"?4:5)}},dependencies:[w,c],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-level-40)}.current-backup[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{v as a};
@@ -0,0 +1 @@
1
+ import{a as Ke}from"./chunk-K7H3KYW7.js";import{a as A}from"./chunk-N35HGIXN.js";import{a as Pe}from"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import{a as Be}from"./chunk-DGBBEZNN.js";import{b as he,d as Re,e as Ge,g as ye,h as Oe,j as $e,l as Ae,m as be,o as ve,p as De,q as ke,r as Le,s as xe,t as we}from"./chunk-7SJHYZC5.js";import{a as Me}from"./chunk-6M3MNJ52.js";import{a as We}from"./chunk-SZ4NLIO2.js";import"./chunk-QZCTOSPE.js";import{a as Ie}from"./chunk-PIDBEXSZ.js";import{g as Xe,k as Ue,o as ze,q as Ve}from"./chunk-EHV3OZDB.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Ab as g,Bb as P,Cb as h,Db as R,Eb as i,Fb as o,Gb as p,Hb as de,Ib as ce,K as y,Kb as M,Kc as fe,Mc as Fe,Oa as Se,Qb as E,Ra as s,Rb as N,Sb as _,Tb as D,Ub as k,Vb as ge,Wb as u,X as I,Xb as c,Za as C,_b as me,c as _e,ea as m,fa as T,fb as pe,ic as f,jc as O,kc as $,lb as b,mc as Te,nc as Ce,oc as Ee,p as ue,rc as Ne,vb as d,xb as v}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var He=()=>({standalone:!0});function Je(l,e){if(l&1){let t=M();i(0,"spk-form-field",63),p(1,"input",64),o(),i(2,"button",65),u("click",function(){m(t);let r=c(2);return T(r.beginRemoteRegistration())}),_(3,24),o()}}function Qe(l,e){if(l&1&&(i(0,"div",61)(1,"label"),_(2,25),o(),i(3,"a",66),f(4),o()()),l&2){let t=c(2);s(3),me("href",t.remoteControlClaimUrl(),Se),s(),O(t.remoteControlClaimUrl())}}function Ye(l,e){l&1&&(i(0,"div",61)(1,"label"),_(2,26),o()())}function Ze(l,e){if(l&1){let t=M();i(0,"button",65),u("click",function(){m(t);let r=c(2);return T(r.cancelRemoteRegistration())}),_(1,27),o()}}function et(l,e){if(l&1){let t=M();i(0,"button",65),u("click",function(){m(t);let r=c(2);return T(r.disableRemoteControl())}),_(1,28),o()}}function tt(l,e){if(l&1){let t=M();i(0,"button",65),u("click",function(){m(t);let r=c(2);return T(r.enableRemoteControl())}),_(1,29),o(),i(2,"button",67),u("click",function(){m(t);let r=c(2);return T(r.deleteRemoteControl())}),_(3,30),o()}}function nt(l,e){if(l&1&&(i(0,"div",36),b(1,Je,4,0)(2,Qe,5,2,"div",61)(3,Ye,3,0,"div",61)(4,Ze,2,0,"button",62)(5,et,2,0,"button",62)(6,tt,4,0),o()),l&2){let t=c();s(),g(t.remoteControlState()==="inactive"?1:-1),s(),g(t.remoteControlState()==="registered"?2:-1),s(),g(t.remoteControlState()==="registering"?3:-1),s(),g(t.remoteControlState()==="registering"||t.remoteControlState()==="registeringfaulted"||t.remoteControlState()==="registered"?4:-1),s(),g(t.remoteControlState()==="connected"||t.remoteControlState()==="enabled"?5:-1),s(),g(t.remoteControlState()==="disabled"?6:-1)}}function it(l,e){if(l&1&&(i(0,"option",41),f(1),o()),l&2){let t=e.$implicit;d("value",t),s(),O(t)}}function ot(l,e){if(l&1){let t=M();i(0,"option",68),u("click",function(){let r=m(t).$implicit,S=c();return T(S.pauseSettings.controls.timeType.setValue(r.value))}),f(1),o()}if(l&2){let t=e.$implicit;d("value",t.value),s(),$(" ",t.label," ")}}function rt(l,e){if(l&1&&(i(0,"option",41),f(1),o()),l&2){let t=e.$implicit;d("value",t.value),s(),$(" ",t.label," ")}}function lt(l,e){if(l&1&&(i(0,"option",41),f(1),o()),l&2){let t=e.$implicit;d("value",t.value),s(),$(" ",t.label," ")}}var F=new Le,qe=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],je=[{value:"",label:$localize`System default (information)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"none",label:$localize`None / disabled`}],L=class l{#i=I(Be);#r=I(Pe);#e=I(Ie);#o=I(Me);#l=this.#o.getItem("locale")??"en-US";sysinfo=this.#r.systemInfo;isDarkMode=this.#i.isDarkMode;editAs=C("list");langCtrl=C(this.#l);settingsForm=F.group({pauseSettings:F.group({time:F.control(0),timeType:F.control("s")}),usageStatistics:F.control(""),updateChannel:F.control(""),remoteControlRegisterUrl:F.control("")});remoteControlState=C("unknown");remoteControlClaimUrl=C(null);sysInfoEffect=Fe(()=>{this.settingsForm.controls.remoteControlRegisterUrl.patchValue(this.sysinfo()?.RemoteControlRegistrationUrl??"")});get pauseSettings(){return this.settingsForm.controls.pauseSettings}timeTypeOptions=C(qe);timeOptions=Ke([this.pauseSettings.controls.timeType.valueChanges.pipe(y("s")),this.pauseSettings.controls.time.valueChanges.pipe(y(null))],_e(ue(([e,t])=>{let n=this.#a(e);return t!==null?n.filter(r=>r.toString().includes(t.toString())):n}),y([])));languageOptions=fe(()=>{let e=this.langCtrl();return e?A.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):A});usageStatisticsOptions=C(je);ngOnInit(){this.refreshRemoteControlStatus(),this.getServerSettings()}saveLocale(e){this.#o.setItem("locale",e),window.location.reload()}submit(){let e=`${this.pauseSettings.controls.time.value}${this.pauseSettings.controls.timeType.value}`;this.#e.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.settingsForm.controls.usageStatistics.value,"startup-delay":e==="0s"?"":e,"update-channel":this.settingsForm.controls.updateChannel.value}}).subscribe({next:t=>{console.log("res",t)},error:t=>{console.error("err",t)}})}getServerSettings(){return this.#e.getApiV1Serversettings().subscribe({next:e=>{let t=e["startup-delay"],n=t.slice(-1),r=t.slice(0,-1),S=["s","m","h"];this.settingsForm.patchValue({pauseSettings:{time:parseInt(r==""?"0":r),timeType:S.includes(n)?n:"s"},usageStatistics:e["usage-reporter-level"],updateChannel:e["update-channel"]})}})}languageDisplay(){let e=this;return()=>{let t=e.langCtrl();return t?A.find(n=>n.value===t)?.label??null:null}}typeDisplay(){let e=this;return()=>{let t=e.settingsForm.value.pauseSettings?.timeType;return t==null?null:qe.find(n=>n.value===t)?.label??null}}usageDisplay(){let e=this;return()=>{let t=e.settingsForm.value.usageStatistics;return t==null?null:je.find(n=>n.value===t)?.label??null}}setDarkMode(){this.#i.setDarkMode()}setLightMode(){this.#i.setLightMode()}#a(e){let t=e==="h"?25:61;return new Array(t).fill(0).map((n,r)=>r)}repeatRegisterTimer=null;#t(e){e.RegistrationUrl&&this.remoteControlClaimUrl.set(e.RegistrationUrl),e.IsConnected?this.remoteControlState.set("connected"):e.IsEnabled?this.remoteControlState.set("enabled"):e.CanEnable?this.remoteControlState.set("disabled"):e.IsRegisteringFaulted?this.remoteControlState.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.remoteControlState.set("registered"):this.remoteControlState.set("registering"):this.remoteControlState.set("inactive");let t=this.remoteControlState();console.log("currentRemoteControlState: ",t),this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:n=>{this.#t(n)},error:n=>{this.#n(n)}})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.getApiV1RemotecontrolStatus().subscribe({next:n=>{this.#t(n)},error:n=>{this.#n(n)}})},5e3)),e.IsRegistering&&e.CanEnable&&this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:n=>{this.#t(n)}})}#n(e){this.#e.getApiV1RemotecontrolStatus().subscribe({next:t=>{this.#t(t)}})}refreshRemoteControlStatus(){this.#e.getApiV1RemotecontrolStatus().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}beginRemoteRegistration(){this.remoteControlState.set("registering");let e=this.settingsForm.controls.remoteControlRegisterUrl.value;this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e}}).subscribe({next:t=>{this.#t(t)},error:t=>{this.#n(t)}})}cancelRemoteRegistration(){this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}enableRemoteControl(){this.#e.postApiV1RemotecontrolEnable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}disableRemoteControl(){this.#e.postApiV1RemotecontrolDisable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}deleteRemoteControl(){let e=this;confirm("Are you sure you want to delete the remote control registration?")&&e.#e.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>{e.#t(t)},error:t=>{e.#n(t)}})}getRemoteControlStatusText(){let e=this.remoteControlState();return e==="enabled"?"Remote control is enabled but not connected":e==="connected"?"Remote control is connected":e==="registering"?"Registering machine...":e==="registeringfaulted"?"Registration failed":e==="registered"?"Registered, waiting for accept":e==="disabled"?"Remote control is configured but not enabled":e==="unknown"?"...loading...":"Remote control is not set up"}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=pe({type:l,selectors:[["app-settings"]],decls:107,vars:18,consts:()=>{let e;e=$localize`Settings`;let t;t=$localize`Configure your backup settings.`;let n;n=$localize`Save changes`;let r;r=$localize`Remote access control`;let S;S=$localize`Pause after startup or hibernation`;let x;x=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let w;w=$localize`Color theme`;let X;X=$localize`Customize your application theme`;let U;U=$localize`Language`;let z;z=$localize`Select a language for the platform`;let V;V=$localize`Update channel`;let B;B=$localize`Update channel selection is not implemented yet.`;let W;W=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) ${"\uFFFD#66\uFFFD\uFFFD/#66\uFFFD"}:TAG_INPUT:`;let K;K=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let q;q=$localize` Stable ${"\uFFFD#72\uFFFD\uFFFD/#72\uFFFD"}:TAG_INPUT:`;let j;j=$localize`Official releases`;let H;H=$localize` Beta ${"\uFFFD#78\uFFFD\uFFFD/#78\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. `;let Q;Q=$localize` Experimental ${"\uFFFD#84\uFFFD\uFFFD/#84\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize`Specific builds for developers only. Not for use with important data.`;let Z;Z=$localize` Canary ${"\uFFFD#90\uFFFD\uFFFD/#90\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize`Individual builds for developers only. Not for use with important data.`;let te;te=$localize`Usage statistics`;let G;G=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#99\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#99\uFFFD"}:CLOSE_LINK:${"[\uFFFD#100\uFFFD\uFFFD/#100\uFFFD|\uFFFD#101\uFFFD\uFFFD/#101\uFFFD]"}:LINE_BREAK:${"[\uFFFD#100\uFFFD\uFFFD/#100\uFFFD|\uFFFD#101\uFFFD\uFFFD/#101\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,G=ge(G);let ne;ne=$localize` Register for remote control `;let ie;ie=$localize`Machine is now registered, open this link to add it to your account:`;let oe;oe=$localize`Registering, please wait...`;let re;re=$localize` Cancel registration `;let le;le=$localize` Disable remote control `;let ae;ae=$localize` Enable remote control `;let se;return se=$localize` Delete remote control setup `,[e,t,n,r,S,x,w,X,U,z,V,B,W,K,q,j,H,J,Q,Y,Z,ee,te,G,ne,ie,oe,re,le,ae,se,[1,"content",3,"submit","formGroup"],[1,"title"],["type","submit","spk-button","",1,"raised","primary"],[1,"left"],[1,"right","remote-control"],[1,"field-row"],[1,"right"],["formGroupName","pauseSettings",1,"field-row"],[3,"hideClearButton"],["type","search","formControlName","time"],[3,"value"],[3,"displayFn","hideClearButton"],["type","text","formControlName","timeType"],["options",""],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[3,"change","displayFn","hideClearButton"],["type","search",3,"ngModelChange","ngModel","ngModelOptions"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"outlined","primary"],["type","radio","name","updateChannel","value","","formControlName","updateChannel"],["type","radio","name","updateChannel","value","stable","formControlName","updateChannel"],["type","radio","name","updateChannel","value","beta","formControlName","updateChannel"],["type","radio","name","updateChannel","value","experimental","formControlName","updateChannel"],["type","radio","name","updateChannel","value","canary","formControlName","updateChannel"],["href","#"],[3,"displayFn"],["type","text","formControlName","usageStatistics"],[1,"field-col"],["type","button","spk-button","",1,"raised"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","spk-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl","formControlName","remoteControlRegisterUrl"],["type","button","spk-button","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","spk-button","",1,"raised","warn",3,"click"],[3,"click","value"]]},template:function(t,n){if(t&1&&(p(0,"app-status-bar"),i(1,"form",31),u("submit",function(){return n.submit()}),i(2,"header")(3,"div",32)(4,"h2"),_(5,0),o(),i(6,"p"),_(7,1),o()(),i(8,"button",33),_(9,2),o()(),i(10,"section")(11,"div",34)(12,"h3"),_(13,3),o(),i(14,"p"),f(15),o()(),i(16,"div",35),b(17,nt,7,6,"div",36),o()(),i(18,"section")(19,"div",34)(20,"h3"),_(21,4),o(),i(22,"p"),_(23,5),o()(),i(24,"div",37)(25,"div",38)(26,"spk-select",39),p(27,"input",40),h(28,it,2,2,"option",41,P),o(),i(30,"spk-select",42),p(31,"input",43),de(32,44),h(33,ot,2,2,"option",41,P),ce(),o()()()(),i(35,"section")(36,"div",34)(37,"h3"),_(38,6),o(),i(39,"p"),_(40,7),o()(),i(41,"div",37)(42,"div",45)(43,"img",46),u("click",function(){return n.setLightMode()}),o(),i(44,"img",47),u("click",function(){return n.setDarkMode()}),o()()()(),i(45,"section")(46,"div",34)(47,"h3"),_(48,8),o(),i(49,"p"),_(50,9),o()(),i(51,"div",37)(52,"spk-select",48),u("change",function(S){return n.saveLocale(S)}),i(53,"input",49),Ee("ngModelChange",function(S){return Ce(n.langCtrl,S)||(n.langCtrl=S),S}),o(),h(54,rt,2,2,"option",41,P),o()()(),i(56,"section")(57,"div",34)(58,"h3"),_(59,10),o(),i(60,"p"),_(61,11),o()(),i(62,"div",50)(63,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("")}),i(64,"spk-radio",52),E(65,12),p(66,"input",53),N(),o(),i(67,"p"),_(68,13),o()(),i(69,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("stable")}),i(70,"spk-radio",52),E(71,14),p(72,"input",54),N(),o(),i(73,"p"),_(74,15),o()(),i(75,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("beta")}),i(76,"spk-radio",52),E(77,16),p(78,"input",55),N(),o(),i(79,"p"),_(80,17),o()(),i(81,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("experimental")}),i(82,"spk-radio",52),E(83,18),p(84,"input",56),N(),o(),i(85,"p"),_(86,19),o()(),i(87,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("canary")}),i(88,"spk-radio",52),E(89,20),p(90,"input",57),N(),o(),i(91,"p"),_(92,21),o()()()(),i(93,"section")(94,"div",34)(95,"h3"),_(96,22),o(),i(97,"p"),E(98,23),p(99,"a",58)(100,"br")(101,"br"),N(),o()(),i(102,"div",37)(103,"spk-select",59),p(104,"input",60),h(105,lt,2,2,"option",41,P),o()()()()),t&2){let r,S;s(),d("formGroup",n.settingsForm),s(14),O(n.getRemoteControlStatusText()),s(2),g(n.remoteControlState()!=="unknown"?17:-1),s(9),d("hideClearButton",!0),s(2),R(n.timeOptions()),s(2),d("displayFn",n.typeDisplay())("hideClearButton",!0),s(3),R(n.timeTypeOptions()),s(10),v("active",!n.isDarkMode()),s(),v("active",n.isDarkMode()),s(8),d("displayFn",n.languageDisplay())("hideClearButton",!0),s(),Te("ngModel",n.langCtrl),d("ngModelOptions",Ne(17,He)),s(),R(n.languageOptions()),s(12),D((r=n.sysinfo())==null?null:r.DefaultUpdateChannel),k(65),s(2),D((S=n.sysinfo())==null?null:S.ServerVersionType),k(68),s(35),d("displayFn",n.usageDisplay()),s(2),R(n.usageStatisticsOptions())}},dependencies:[xe,Oe,De,ke,he,$e,Re,Ge,ye,we,Ae,ve,be,We,Xe,ze,Ue,Ve],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-level-40)}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] spk-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:240px;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-500)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] spk-radio[_ngcontent-%COMP%]{color:var(--base-level-60);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-level-60R)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] spk-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] spk-select[_ngcontent-%COMP%]{flex:1 0}.remote-control[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}"],changeDetection:0})};export{L as default};
@@ -0,0 +1 @@
1
+ import{b as p}from"./chunk-KFGIVU27.js";import{a as f}from"./chunk-PIDBEXSZ.js";import{E as s,Kc as l,N as i,R as n,X as a,Za as o}from"./chunk-MR4RE3IB.js";var m=class t{#e=a(f);isLoaded=o(!1);systemInfo=o(null);filterGroups=p(this.#e.getApiV1SysteminfoFiltergroups());backendModules=l(()=>this.systemInfo()?.BackendModules??[]);preload(r=!1){let e=this.#e.getApiV1Systeminfo().pipe(i(c=>this.systemInfo.set(c)),s(()=>this.isLoaded.set(!0)));if(r)return e;e.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=n({token:t,factory:t.\u0275fac,providedIn:"root"})};export{m as a};
@@ -1 +1 @@
1
- import{a as he}from"./chunk-K7H3KYW7.js";import{a as X,b as Le}from"./chunk-QSMEC63O.js";import{b as H}from"./chunk-KFGIVU27.js";import{a as ge,b as A,d as D,e as y,h as v,i as Ee,j as fe,l as b,o as G,p as Ce,q as Pe,r as w,t as x}from"./chunk-7SJHYZC5.js";import{a as k}from"./chunk-PIDBEXSZ.js";import{a as W,g as V,n as Ne,o as Ie,q as Re,v as Me}from"./chunk-EHV3OZDB.js";import{H as $,X as P}from"./chunk-J3H4BCHI.js";import{pa as h}from"./chunk-5ZK3D2RS.js";import{Ab as j,B as se,Bb as Fe,Cb as ue,Db as Se,E as z,Eb as n,Fb as l,Gb as a,Hb as E,Ib as f,K as le,Kb as M,Kc as de,L as ae,Qb as F,R as _e,Ra as m,Rb as u,Sb as T,Wb as C,X as _,Xb as U,Za as O,c as oe,ea as d,fa as g,fb as R,ic as L,l as ie,lb as K,lc as me,p as ne,qc as ce,v as re,vb as c,vc as Oe,xb as pe,xc as Te}from"./chunk-MR4RE3IB.js";function ve(r,t){r&1&&a(0,"spk-progress-bar",7)}function be(r,t){if(r&1&&(n(0,"option",14),L(1),Oe(2,"date"),l()),r&2){let e=t.$implicit;c("value",e.Version),m(),me("",e.Version,": ",Te(2,3,e.Time,"d MMM y, h:mm"),"")}}function Ge(r,t){if(r&1&&(n(0,"app-file-tree",15)(1,"label",16),T(2,4),l(),a(3,"input",17),l()),r&2){let e=U(2);c("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function we(r,t){if(r&1&&(n(0,"spk-select",11),a(1,"input",12),E(2,13),ue(3,be,3,6,"option",14,Fe),f(),l(),K(5,Ge,4,4,"app-file-tree",15)),r&2){let e=U();c("displayFn",e.displayFn()),m(3),Se(e.versionOptions()),m(2),j(e.rootPathLoaded()?5:-1)}}var B=new w,ke=()=>B.group({filesToRestore:B.control(""),selectedOption:B.control(null),passphrase:B.control(null)}),q=class r{#t=_(k);#e=_(N);#o=_(P);#i=_($);#n=_(h);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;backupSettings=de(()=>{let t=this.backupId(),e=this.selectFilesFormSignal()?.selectedOption;if(typeof e!="number"||!t)return null;let i=this.versionOptions()?.find(s=>s.Version===e)?.Time??null;return i?{id:t,time:i}:null});rootPathLoaded=O(!1);rootPath=he([this.selectFilesFormSignal,this.backupId],oe(le([null,null]),ae(([t,e])=>{let o=t?.selectedOption,i=e;if(typeof o!="number"||!i)return ie("/");let s=this.versionOptions()?.find(p=>p.Version===o);return this.#t.getApiV1BackupByIdFiles({id:i,time:s?.Time??"",prefixOnly:!1,folderContents:!0}).pipe(ne(p=>(this.rootPathLoaded.set(!0),p.Files[0].Path)))})));displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(i=>i.Version?.toString()===e);return o?`${o.Version}: ${this.#n.transform(o.Time,"d MMM y, h:mm")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#i.parent})}exit(){this.#e.exit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=R({type:r,selectors:[["app-select-files"]],features:[ce([h])],decls:13,vars:2,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize`Select an option...`;let s;return s=$localize`Path`,[["formRef",""],t,e,o,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"displayFn"],["type","number","placeholder",i,"formControlName","selectedOption"],["options",""],[3,"value"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,o){if(e&1){let i=M();n(0,"form",5,0),C("submit",function(){return d(i),g(o.next())}),n(2,"h3",6),T(3,1),l(),K(4,ve,1,0,"spk-progress-bar",7)(5,we,6,2),n(6,"div",8)(7,"button",9),C("click",function(){return d(i),g(o.exit())}),F(8,2),a(9,"spk-icon"),u(),l(),n(10,"button",10),F(11,3),a(12,"spk-icon"),u(),l()()()}e&2&&(c("formGroup",o.selectFilesForm),m(4),j(o.versionOptionsLoading()?4:5))},dependencies:[x,v,Ce,Pe,A,Ee,D,y,b,G,h,X,V,W,Re,Ne],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 N=class r{#t=_(P);#e=_(k);backupId=O(null);backup=O(null);selectFilesForm=ke();optionsForm=Ae();optionsFormSignal=H(this.optionsForm.valueChanges);selectFilesFormSignal=H(this.selectFilesForm.valueChanges);versionOptionsLoading=O(!1);versionOptions=O([]);isSubmitting=O(!1);init(t){this.backupId.set(t),this.#o(t,!0)}submit(){this.isSubmitting.set(!0);let t=this.backupId(),e=this.optionsForm.value,o=this.selectFilesForm.value,i=this.versionOptions()?.find(s=>s.Version===o.selectedOption);this.#e.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(s=>`${s}*`)??[],passphrase:o.passphrase??null,time:i?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(z(()=>this.isSubmitting.set(!1))).subscribe({next:()=>this.exit(),error:s=>{console.error("restore error",s)}})}exit(){this.#i(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}#o(t,e=!1){this.versionOptionsLoading.set(!0),re([this.#e.getApiV1BackupById({id:t}),this.#e.getApiV1BackupByIdFilesets({id:t})]).pipe(se(1),z(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([o,i])=>{this.versionOptions.set(i),this.backup.set(o),e&&this.selectFilesForm.controls.selectedOption.setValue(i[0].Version)}})}#i(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||r)};static \u0275prov=_e({token:r,factory:r.\u0275fac,providedIn:"root"})};var I=new w,Ae=()=>I.group({restoreFrom:I.control("orignal"),restoreFromPath:I.control(""),handleExisting:I.control("overwrite"),permissions:I.control(!1)}),J=class r{#t=_(N);#e=_(P);#o=_($);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=R({type:r,selectors:[["app-options"]],decls:39,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files from?`;let o;o=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let i;i=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let s;s=$localize`How do you want to handle existing files?`;let p;p=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize`Permissions`;let Z;Z=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let te;return te=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],t,e,o,i,s,p,Q,Y,Z,ee,te,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,o){if(e&1){let i=M();n(0,"form",12,0),C("submit",function(){return d(i),g(o.submit())}),n(2,"h3",13),T(3,1),l(),n(4,"app-toggle-card",14),E(5,15),T(6,2),f(),n(7,"spk-radio",16),F(8,3),a(9,"input",17),u(),l(),n(10,"spk-radio",16),F(11,4),a(12,"input",18),u(),l(),n(13,"app-file-tree",19)(14,"label",20),L(15,"Path"),l(),a(16,"input",21),l()(),n(17,"app-toggle-card",14),E(18,15),T(19,5),f(),n(20,"spk-radio",16),F(21,6),a(22,"input",22),u(),l(),n(23,"spk-radio",16),F(24,7),a(25,"input",23),u(),l()(),n(26,"app-toggle-card"),E(27,15),T(28,8),f(),n(29,"spk-toggle",24),F(30,9),a(31,"input",25),u(),l()(),n(32,"div",26)(33,"button",27),C("click",function(){return d(i),g(o.goBack())}),F(34,10),a(35,"spk-icon"),u(),l(),n(36,"button",28),F(37,11),a(38,"spk-icon"),u(),l()()()}if(e&2){let i;c("formGroup",o.optionsForm),m(4),c("disallowToggle",!0),m(9),c("disabled",((i=o.optionsFormSignal())==null?null:i.restoreFrom)!=="pickLocation"),m(4),c("disallowToggle",!0),m(19),pe("loader",o.isSubmitting())}},dependencies:[x,v,A,ge,fe,D,y,b,G,Le,X,Me,Ie,V,W],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{Ae as a,J as b,ke as c,q as d,N as e};
1
+ import{a as he}from"./chunk-K7H3KYW7.js";import{a as X,b as Le}from"./chunk-DE2AAZUP.js";import{b as H}from"./chunk-KFGIVU27.js";import{a as ge,b as A,d as D,e as y,h as v,i as Ee,j as fe,l as b,o as G,p as Ce,q as Pe,r as w,t as x}from"./chunk-7SJHYZC5.js";import{a as k}from"./chunk-PIDBEXSZ.js";import{a as W,g as V,n as Ne,o as Ie,q as Re,v as Me}from"./chunk-EHV3OZDB.js";import{H as $,X as P}from"./chunk-J3H4BCHI.js";import{pa as h}from"./chunk-5ZK3D2RS.js";import{Ab as j,B as se,Bb as Fe,Cb as ue,Db as Se,E as z,Eb as n,Fb as l,Gb as a,Hb as E,Ib as f,K as le,Kb as M,Kc as de,L as ae,Qb as F,R as _e,Ra as m,Rb as u,Sb as T,Wb as C,X as _,Xb as U,Za as O,c as oe,ea as d,fa as g,fb as R,ic as L,l as ie,lb as K,lc as me,p as ne,qc as ce,v as re,vb as c,vc as Oe,xb as pe,xc as Te}from"./chunk-MR4RE3IB.js";function ve(r,t){r&1&&a(0,"spk-progress-bar",7)}function be(r,t){if(r&1&&(n(0,"option",14),L(1),Oe(2,"date"),l()),r&2){let e=t.$implicit;c("value",e.Version),m(),me("",e.Version,": ",Te(2,3,e.Time,"d MMM y, h:mm"),"")}}function Ge(r,t){if(r&1&&(n(0,"app-file-tree",15)(1,"label",16),T(2,4),l(),a(3,"input",17),l()),r&2){let e=U(2);c("rootPath",e.rootPath())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)}}function we(r,t){if(r&1&&(n(0,"spk-select",11),a(1,"input",12),E(2,13),ue(3,be,3,6,"option",14,Fe),f(),l(),K(5,Ge,4,4,"app-file-tree",15)),r&2){let e=U();c("displayFn",e.displayFn()),m(3),Se(e.versionOptions()),m(2),j(e.rootPathLoaded()?5:-1)}}var B=new w,ke=()=>B.group({filesToRestore:B.control(""),selectedOption:B.control(null),passphrase:B.control(null)}),q=class r{#t=_(k);#e=_(N);#o=_(P);#i=_($);#n=_(h);selectFilesForm=this.#e.selectFilesForm;selectFilesFormSignal=this.#e.selectFilesFormSignal;backupId=this.#e.backupId;versionOptionsLoading=this.#e.versionOptionsLoading;versionOptions=this.#e.versionOptions;backupSettings=de(()=>{let t=this.backupId(),e=this.selectFilesFormSignal()?.selectedOption;if(typeof e!="number"||!t)return null;let i=this.versionOptions()?.find(s=>s.Version===e)?.Time??null;return i?{id:t,time:i}:null});rootPathLoaded=O(!1);rootPath=he([this.selectFilesFormSignal,this.backupId],oe(le([null,null]),ae(([t,e])=>{let o=t?.selectedOption,i=e;if(typeof o!="number"||!i)return ie("/");let s=this.versionOptions()?.find(p=>p.Version===o);return this.#t.getApiV1BackupByIdFiles({id:i,time:s?.Time??"",prefixOnly:!1,folderContents:!0}).pipe(ne(p=>(this.rootPathLoaded.set(!0),p.Files[0].Path)))})));displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let o=t?.find(i=>i.Version?.toString()===e);return o?`${o.Version}: ${this.#n.transform(o.Time,"d MMM y, h:mm")}`:""}}next(){this.#o.navigate(["options"],{relativeTo:this.#i.parent})}exit(){this.#e.exit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=R({type:r,selectors:[["app-select-files"]],features:[ce([h])],decls:13,vars:2,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize`Select an option...`;let s;return s=$localize`Path`,[["formRef",""],t,e,o,s,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"displayFn"],["type","number","placeholder",i,"formControlName","selectedOption"],["options",""],[3,"value"],[3,"rootPath","backupSettings","multiSelect","showFiles"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,o){if(e&1){let i=M();n(0,"form",5,0),C("submit",function(){return d(i),g(o.next())}),n(2,"h3",6),T(3,1),l(),K(4,ve,1,0,"spk-progress-bar",7)(5,we,6,2),n(6,"div",8)(7,"button",9),C("click",function(){return d(i),g(o.exit())}),F(8,2),a(9,"spk-icon"),u(),l(),n(10,"button",10),F(11,3),a(12,"spk-icon"),u(),l()()()}e&2&&(c("formGroup",o.selectFilesForm),m(4),j(o.versionOptionsLoading()?4:5))},dependencies:[x,v,Ce,Pe,A,Ee,D,y,b,G,h,X,V,W,Re,Ne],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 N=class r{#t=_(P);#e=_(k);backupId=O(null);backup=O(null);selectFilesForm=ke();optionsForm=Ae();optionsFormSignal=H(this.optionsForm.valueChanges);selectFilesFormSignal=H(this.selectFilesForm.valueChanges);versionOptionsLoading=O(!1);versionOptions=O([]);isSubmitting=O(!1);init(t){this.backupId.set(t),this.#o(t,!0)}submit(){this.isSubmitting.set(!0);let t=this.backupId(),e=this.optionsForm.value,o=this.selectFilesForm.value,i=this.versionOptions()?.find(s=>s.Version===o.selectedOption);this.#e.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:o.filesToRestore?.split("\0").map(s=>`${s}*`)??[],passphrase:o.passphrase??null,time:i?.Time,restore_path:e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!0}}).pipe(z(()=>this.isSubmitting.set(!1))).subscribe({next:()=>this.exit(),error:s=>{console.error("restore error",s)}})}exit(){this.#i(),this.#t.navigate(["/"])}getVersionOptions(){this.versionOptions()}#o(t,e=!1){this.versionOptionsLoading.set(!0),re([this.#e.getApiV1BackupById({id:t}),this.#e.getApiV1BackupByIdFilesets({id:t})]).pipe(se(1),z(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([o,i])=>{this.versionOptions.set(i),this.backup.set(o),e&&this.selectFilesForm.controls.selectedOption.setValue(i[0].Version)}})}#i(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||r)};static \u0275prov=_e({token:r,factory:r.\u0275fac,providedIn:"root"})};var I=new w,Ae=()=>I.group({restoreFrom:I.control("orignal"),restoreFromPath:I.control(""),handleExisting:I.control("overwrite"),permissions:I.control(!1)}),J=class r{#t=_(N);#e=_(P);#o=_($);optionsForm=this.#t.optionsForm;optionsFormSignal=this.#t.optionsFormSignal;isSubmitting=this.#t.isSubmitting;goBack(){this.#e.navigate(["select-files"],{relativeTo:this.#o.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||r)};static \u0275cmp=R({type:r,selectors:[["app-options"]],decls:39,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files from?`;let o;o=$localize` Original location ${"\uFFFD#9\uFFFD\uFFFD/#9\uFFFD"}:TAG_INPUT:`;let i;i=$localize` Pick location ${"\uFFFD#12\uFFFD\uFFFD/#12\uFFFD"}:TAG_INPUT:`;let s;s=$localize`How do you want to handle existing files?`;let p;p=$localize` Overwrite ${"\uFFFD#22\uFFFD\uFFFD/#22\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Save different versions with timestamp in file name ${"\uFFFD#25\uFFFD\uFFFD/#25\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize`Permissions`;let Z;Z=$localize` Restore read/write permissions ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize`${"\uFFFD#35\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#35\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let te;return te=$localize`${"\uFFFD#38\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#38\uFFFD"}:CLOSE_TAG_SPK_ICON: Submit `,[["formRef",""],t,e,o,i,s,p,Q,Y,Z,ee,te,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"raised","primary"],["type","radio","name","restoreFrom","value","orignal","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","permissions"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"]]},template:function(e,o){if(e&1){let i=M();n(0,"form",12,0),C("submit",function(){return d(i),g(o.submit())}),n(2,"h3",13),T(3,1),l(),n(4,"app-toggle-card",14),E(5,15),T(6,2),f(),n(7,"spk-radio",16),F(8,3),a(9,"input",17),u(),l(),n(10,"spk-radio",16),F(11,4),a(12,"input",18),u(),l(),n(13,"app-file-tree",19)(14,"label",20),L(15,"Path"),l(),a(16,"input",21),l()(),n(17,"app-toggle-card",14),E(18,15),T(19,5),f(),n(20,"spk-radio",16),F(21,6),a(22,"input",22),u(),l(),n(23,"spk-radio",16),F(24,7),a(25,"input",23),u(),l()(),n(26,"app-toggle-card"),E(27,15),T(28,8),f(),n(29,"spk-toggle",24),F(30,9),a(31,"input",25),u(),l()(),n(32,"div",26)(33,"button",27),C("click",function(){return d(i),g(o.goBack())}),F(34,10),a(35,"spk-icon"),u(),l(),n(36,"button",28),F(37,11),a(38,"spk-icon"),u(),l()()()}if(e&2){let i;c("formGroup",o.optionsForm),m(4),c("disallowToggle",!0),m(9),c("disabled",((i=o.optionsFormSignal())==null?null:i.restoreFrom)!=="pickLocation"),m(4),c("disallowToggle",!0),m(19),pe("loader",o.isSubmitting())}},dependencies:[x,v,A,ge,fe,D,y,b,G,Le,X,Me,Ie,V,W],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{Ae as a,J as b,ke as c,q as d,N as e};
@@ -1 +1 @@
1
- import{n as g}from"./chunk-4UJICSQB.js";import"./chunk-QSMEC63O.js";import"./chunk-DNHLTHLR.js";import"./chunk-UUMKHH4F.js";import{b as k}from"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import{a as I}from"./chunk-W6WGCBBX.js";import{a as N}from"./chunk-QZCTOSPE.js";import{a as O}from"./chunk-PIDBEXSZ.js";import{n as $,o as M,s as b}from"./chunk-EHV3OZDB.js";import{H as P,L as h,Y as E,Z as B}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Ab as D,B as m,Eb as s,Fb as p,Gb as n,Mc as A,Qb as d,Ra as r,Rb as c,X as F,fb as f,lb as C,qc as R,tc as _,vb as u}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var K=(i,e)=>[i,e,"general"],L=(i,e)=>[i,e,"destination"],v=(i,e)=>[i,e,"source-data"],G=(i,e)=>[i,e,"schedule"],y=(i,e)=>[i,e,"options"];function U(i,e){i&1&&n(0,"spk-progress-bar",6)}function X(i,e){i&1&&(s(0,"section"),n(1,"router-outlet"),p())}var T=class i{#t=F(P);#e=F(g);#a=F(N);#i=F(O);isDraft=this.#e.isDraft;backupId=this.#e.backupId;finishedLoading=this.#e.finishedLoading;#o=k(this.#t.params);#n=k(this.#t.url);paramsChanged=A(()=>{let e=this.#o()?.id,a=!!this.#n()?.find(t=>t.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,a):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(m(1)).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(e.Backup),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,a=!1){let t=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.finishedLoading.set(!0)};if(a){this.isDraft.set(a);let o=this.#a.draftBackups().find(l=>l.id===e);if(!o){alert("Backup not found");return}t(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:t})}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=f({type:i,selectors:[["app-backup"]],features:[R([g])],decls:20,vars:21,consts:()=>{let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: General `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let t;t=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_RADIO: Schedule `;let l;return l=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[e,a,t,o,l,["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(a,t){a&1&&(n(0,"app-status-bar"),s(1,"header")(2,"spk-stepper")(3,"div",5),d(4,0),n(5,"spk-radio"),c(),p(),s(6,"div",5),d(7,1),n(8,"spk-radio"),c(),p(),s(9,"div",5),d(10,2),n(11,"spk-radio"),c(),p(),s(12,"div",5),d(13,3),n(14,"spk-radio"),c(),p(),s(15,"div",5),d(16,4),n(17,"spk-radio"),c(),p()()(),C(18,U,1,0,"spk-progress-bar",6)(19,X,2,0,"section")),a&2&&(r(3),u("routerLink",_(6,K,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),u("routerLink",_(9,L,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),u("routerLink",_(12,v,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),u("routerLink",_(15,G,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),u("routerLink",_(18,y,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),D(t.finishedLoading()?19:18))},dependencies:[h,E,B,I,M,b,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-level-40)}header[_ngcontent-%COMP%] spk-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow:hidden}"],changeDetection:0})};export{T as default};
1
+ import{n as g}from"./chunk-L6DT3BQG.js";import"./chunk-DE2AAZUP.js";import"./chunk-DNHLTHLR.js";import"./chunk-V7APGUBT.js";import{b as k}from"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import{a as I}from"./chunk-SZ4NLIO2.js";import{a as N}from"./chunk-QZCTOSPE.js";import{a as O}from"./chunk-PIDBEXSZ.js";import{n as $,o as M,s as b}from"./chunk-EHV3OZDB.js";import{H as P,L as h,Y as E,Z as B}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Ab as D,B as m,Eb as s,Fb as p,Gb as n,Mc as A,Qb as d,Ra as r,Rb as c,X as F,fb as f,lb as C,qc as R,tc as _,vb as u}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var K=(i,e)=>[i,e,"general"],L=(i,e)=>[i,e,"destination"],v=(i,e)=>[i,e,"source-data"],G=(i,e)=>[i,e,"schedule"],y=(i,e)=>[i,e,"options"];function U(i,e){i&1&&n(0,"spk-progress-bar",6)}function X(i,e){i&1&&(s(0,"section"),n(1,"router-outlet"),p())}var T=class i{#t=F(P);#e=F(g);#a=F(N);#i=F(O);isDraft=this.#e.isDraft;backupId=this.#e.backupId;finishedLoading=this.#e.finishedLoading;#o=k(this.#t.params);#n=k(this.#t.url);paramsChanged=A(()=>{let e=this.#o()?.id,a=!!this.#n()?.find(t=>t.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,a):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(m(1)).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(e.Backup),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,a=!1){let t=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.finishedLoading.set(!0)};if(a){this.isDraft.set(a);let o=this.#a.draftBackups().find(l=>l.id===e);if(!o){alert("Backup not found");return}t(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:t})}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=f({type:i,selectors:[["app-backup"]],features:[R([g])],decls:20,vars:21,consts:()=>{let e;e=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SPK_RADIO: General `;let a;a=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SPK_RADIO: Destination `;let t;t=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_RADIO: Schedule `;let l;return l=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_RADIO:${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_RADIO: Options `,[e,a,t,o,l,["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(a,t){a&1&&(n(0,"app-status-bar"),s(1,"header")(2,"spk-stepper")(3,"div",5),d(4,0),n(5,"spk-radio"),c(),p(),s(6,"div",5),d(7,1),n(8,"spk-radio"),c(),p(),s(9,"div",5),d(10,2),n(11,"spk-radio"),c(),p(),s(12,"div",5),d(13,3),n(14,"spk-radio"),c(),p(),s(15,"div",5),d(16,4),n(17,"spk-radio"),c(),p()()(),C(18,U,1,0,"spk-progress-bar",6)(19,X,2,0,"section")),a&2&&(r(3),u("routerLink",_(6,K,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),u("routerLink",_(9,L,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),u("routerLink",_(12,v,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),u("routerLink",_(15,G,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),u("routerLink",_(18,y,t.isDraft()?"/backup-draft":"/backup",t.backupId())),r(3),D(t.finishedLoading()?19:18))},dependencies:[h,E,B,I,M,b,$],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-level-40)}header[_ngcontent-%COMP%] spk-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow:hidden}"],changeDetection:0})};export{T as default};
@@ -1 +1 @@
1
- import{a,b,c}from"./chunk-4UJICSQB.js";import"./chunk-QSMEC63O.js";import"./chunk-DNHLTHLR.js";import"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createDestinationForm,b as createDestinationFormGroup,c as default};
1
+ import{a,b,c}from"./chunk-L6DT3BQG.js";import"./chunk-DE2AAZUP.js";import"./chunk-DNHLTHLR.js";import"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createDestinationForm,b as createDestinationFormGroup,c as default};
@@ -1 +1 @@
1
- import{c as a,d as b}from"./chunk-SW6FZ3TL.js";import"./chunk-K7H3KYW7.js";import"./chunk-QSMEC63O.js";import"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{c as a,d as b}from"./chunk-W76PK3CU.js";import"./chunk-K7H3KYW7.js";import"./chunk-DE2AAZUP.js";import"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import"./chunk-7SJHYZC5.js";import"./chunk-PIDBEXSZ.js";import"./chunk-EHV3OZDB.js";import"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";export{a as createRestoreSelectFilesForm,b as default};
package/index.html CHANGED
@@ -20,5 +20,5 @@
20
20
  <style>:root{--font-size:16px;font-size:var(--font-size)}html body{--sparkle-light:initial;--sparkle-dark: ;color-scheme:light dark;--primary-50:#eff6ff;--primary-rgb-50:239,246,255;--primary-contrast-50:var(--dark-primary-text);--primary-100:#dbeafe;--primary-rgb-100:219,234,254;--primary-contrast-100:var(--dark-primary-text);--primary-200:#bfdbfe;--primary-rgb-200:191,219,254;--primary-contrast-200:var(--dark-primary-text);--primary-300:#93c5fd;--primary-rgb-300:147,197,253;--primary-contrast-300:var(--dark-primary-text);--primary-400:#60a5fa;--primary-rgb-400:96,165,250;--primary-contrast-400:var(--dark-primary-text);--primary-500:#3b82f6;--primary-rgb-500:59,130,246;--primary-contrast-500:var(--light-primary-text);--primary-600:#2563eb;--primary-rgb-600:37,99,235;--primary-contrast-600:var(--light-primary-text);--primary-700:#1d4ed8;--primary-rgb-700:29,78,216;--primary-contrast-700:var(--light-primary-text);--primary-800:#1e40af;--primary-rgb-800:30,64,175;--primary-contrast-800:var(--light-primary-text);--primary-900:#1e3a8a;--primary-rgb-900:30,58,138;--primary-contrast-900:var(--light-primary-text);--primary-950:#172554;--primary-rgb-950:23,37,84;--primary-contrast-950:var(--light-primary-text);--accent-50:#f5f3ff;--accent-rgb-50:245,243,255;--accent-contrast-50:var(--dark-primary-text);--accent-100:#ede9fe;--accent-rgb-100:237,233,254;--accent-contrast-100:var(--dark-primary-text);--accent-200:#ddd6fe;--accent-rgb-200:221,214,254;--accent-contrast-200:var(--dark-primary-text);--accent-300:#c4b5fd;--accent-rgb-300:196,181,253;--accent-contrast-300:var(--dark-primary-text);--accent-400:#a78bfa;--accent-rgb-400:167,139,250;--accent-contrast-400:var(--dark-primary-text);--accent-500:#8b5cf6;--accent-rgb-500:139,92,246;--accent-contrast-500:var(--light-primary-text);--accent-600:#7c3aed;--accent-rgb-600:124,58,237;--accent-contrast-600:var(--light-primary-text);--accent-700:#6d28d9;--accent-rgb-700:109,40,217;--accent-contrast-700:var(--light-primary-text);--accent-800:#5b21b6;--accent-rgb-800:91,33,182;--accent-contrast-800:var(--light-primary-text);--accent-900:#4c1d95;--accent-rgb-900:76,29,149;--accent-contrast-900:var(--light-primary-text);--accent-950:#2e1065;--accent-rgb-950:46,16,101;--accent-contrast-950:var(--light-primary-text);--tertiary-50:#fffbeb;--tertiary-rgb-50:255,251,235;--tertiary-contrast-50:var(--dark-primary-text);--tertiary-100:#fef3c7;--tertiary-rgb-100:254,243,199;--tertiary-contrast-100:var(--dark-primary-text);--tertiary-200:#fde68a;--tertiary-rgb-200:253,230,138;--tertiary-contrast-200:var(--dark-primary-text);--tertiary-300:#fcd34d;--tertiary-rgb-300:252,211,77;--tertiary-contrast-300:var(--dark-primary-text);--tertiary-400:#fbbf24;--tertiary-rgb-400:251,191,36;--tertiary-contrast-400:var(--light-primary-text);--tertiary-500:#f59e0b;--tertiary-rgb-500:245,158,11;--tertiary-contrast-500:var(--light-primary-text);--tertiary-600:#d97706;--tertiary-rgb-600:217,119,6;--tertiary-contrast-600:var(--light-primary-text);--tertiary-700:#b45309;--tertiary-rgb-700:180,83,9;--tertiary-contrast-700:var(--light-primary-text);--tertiary-800:#92400e;--tertiary-rgb-800:146,64,14;--tertiary-contrast-800:var(--light-primary-text);--tertiary-900:#78350f;--tertiary-rgb-900:120,53,15;--tertiary-contrast-900:var(--light-primary-text);--tertiary-950:#451a03;--tertiary-rgb-950:69,26,3;--tertiary-contrast-950:var(--light-primary-text);--grey-50:#fafafa;--grey-rgb-50:250,250,250;--grey-contrast-50:var(--dark-primary-text);--grey-100:#f4f4f5;--grey-rgb-100:244,244,245;--grey-contrast-100:var(--dark-primary-text);--grey-200:#e4e4e7;--grey-rgb-200:228,228,231;--grey-contrast-200:var(--dark-primary-text);--grey-300:#d4d4d8;--grey-rgb-300:212,212,216;--grey-contrast-300:var(--dark-primary-text);--grey-400:#a1a1aa;--grey-rgb-400:161,161,170;--grey-contrast-400:var(--dark-primary-text);--grey-500:#71717a;--grey-rgb-500:113,113,122;--grey-contrast-500:var(--light-primary-text);--grey-600:#52525b;--grey-rgb-600:82,82,91;--grey-contrast-600:var(--light-primary-text);--grey-700:#3f3f46;--grey-rgb-700:63,63,70;--grey-contrast-700:var(--light-primary-text);--grey-750:#2f2f31;--grey-rgb-750:47,47,49;--grey-contrast-750:var(--light-primary-text);--grey-800:#27272a;--grey-rgb-800:39,39,42;--grey-contrast-800:var(--light-primary-text);--grey-900:#18181b;--grey-rgb-900:24,24,27;--grey-contrast-900:var(--light-primary-text);--grey-950:#09090b;--grey-rgb-950:9,9,11;--grey-contrast-950:var(--light-primary-text);--warn-50:#fef2f2;--warn-rgb-50:254,242,242;--warn-contrast-50:var(--dark-primary-text);--warn-100:#fee2e2;--warn-rgb-100:254,226,226;--warn-contrast-100:var(--dark-primary-text);--warn-200:#fecaca;--warn-rgb-200:254,202,202;--warn-contrast-200:var(--dark-primary-text);--warn-300:#fca5a5;--warn-rgb-300:252,165,165;--warn-contrast-300:var(--dark-primary-text);--warn-400:#f87171;--warn-rgb-400:248,113,113;--warn-contrast-400:var(--light-primary-text);--warn-500:#ef4444;--warn-rgb-500:239,68,68;--warn-contrast-500:var(--light-primary-text);--warn-600:#dc2626;--warn-rgb-600:220,38,38;--warn-contrast-600:var(--light-primary-text);--warn-700:#b91c1c;--warn-rgb-700:185,28,28;--warn-contrast-700:var(--light-primary-text);--warn-800:#991b1b;--warn-rgb-800:153,27,27;--warn-contrast-800:var(--light-primary-text);--warn-900:#7f1d1d;--warn-rgb-900:127,29,29;--warn-contrast-900:var(--light-primary-text);--warn-950:#450a0a;--warn-rgb-950:69,10,10;--warn-contrast-950:var(--light-primary-text);--success-50:#ecfdf5;--success-rgb-50:236,253,245;--success-contrast-50:var(--dark-primary-text);--success-100:#d1fae5;--success-rgb-100:209,250,229;--success-contrast-100:var(--dark-primary-text);--success-200:#a7f3d0;--success-rgb-200:167,243,208;--success-contrast-200:var(--dark-primary-text);--success-300:#6ee7b7;--success-rgb-300:110,231,183;--success-contrast-300:var(--dark-primary-text);--success-400:#34d399;--success-rgb-400:52,211,153;--success-contrast-400:var(--light-primary-text);--success-500:#10b981;--success-rgb-500:16,185,129;--success-contrast-500:var(--light-primary-text);--success-600:#059669;--success-rgb-600:5,150,105;--success-contrast-600:var(--light-primary-text);--success-700:#047857;--success-rgb-700:4,120,87;--success-contrast-700:var(--light-primary-text);--success-800:#065f46;--success-rgb-800:6,95,70;--success-contrast-800:var(--light-primary-text);--success-900:#064e3b;--success-rgb-900:6,78,59;--success-contrast-900:var(--light-primary-text);--success-950:#022c22;--success-rgb-950:2,44,34;--success-contrast-950:var(--light-primary-text);--display-10:600 5rem / normal Inter Tight, sans-serif;--display-20:600 4.5rem / normal Inter Tight, sans-serif;--display-30:600 4rem / normal Inter Tight, sans-serif;--display-40:600 3.5rem / normal Inter Tight, sans-serif;--display-50:600 3rem / normal Inter Tight, sans-serif;--title-10:500 2.5rem / normal Inter Tight, sans-serif;--title-20:500 2rem / normal Inter Tight, sans-serif;--title-30:500 1.5rem / normal Inter Tight, sans-serif;--title-10B:600 2.5rem / normal Inter Tight, sans-serif;--title-20B:600 2rem / normal Inter Tight, sans-serif;--title-30B:600 1.5rem / normal Inter Tight, sans-serif;--paragraph-10:500 1.125rem / normal Inter Tight, sans-serif;--paragraph-20:500 1rem / normal Inter Tight, sans-serif;--paragraph-30:500 .875rem / normal Inter Tight, sans-serif;--paragraph-40:500 .75rem / normal Inter Tight, sans-serif;--paragraph-10B:600 1.125rem / normal Inter Tight, sans-serif;--paragraph-20B:600 1rem / normal Inter Tight, sans-serif;--paragraph-30B:600 .875rem / normal Inter Tight, sans-serif;--paragraph-40B:600 .75rem / normal Inter Tight, sans-serif;--shape-1:.25rem;--shape-2:.5rem;--shape-3:.75rem;--shape-4:1rem;--shape-5:1.25rem;--box-shadow-10:0 1px 2px 0 rgba(18, 18, 23, .07);--box-shadow-20:0 1px 3px 0 rgba(18, 18, 23, .1);--box-shadow-30:0 1px 4px -1px rgba(18, 18, 23, .08);--box-shadow-35:0 4px 6px -1px rgba(18, 18, 23, .08);--box-shadow-40:0 10px 15px -3px rgba(18, 18, 23, .08);--box-shadow-50:0 20px 25px -5px rgba(18, 18, 23, .1);--box-shadow-60:0 25px 50px -12px rgba(18, 18, 23, .25);--base-level-10:var(--sparkle-light, #fff) var(--sparkle-dark, var(--grey-950));--base-level-20:var(--sparkle-light, var(--grey-50)) var(--sparkle-dark, var(--grey-900));--base-level-30:var(--sparkle-light, var(--grey-100)) var(--sparkle-dark, var(--grey-900));--base-level-30R:var(--sparkle-light, var(--grey-900)) var(--sparkle-dark, var(--grey-100));--base-level-40:var(--sparkle-light, var(--grey-200)) var(--sparkle-dark, var(--grey-700));--base-level-50:var(--sparkle-light, var(--grey-300)) var(--sparkle-dark, var(--grey-800));--base-level-60:var(--sparkle-light, var(--grey-500)) var(--sparkle-dark, var(--grey-400));--base-level-60R:var(--sparkle-light, var(--grey-400)) var(--sparkle-dark, var(--grey-500));--base-level-70:var(--sparkle-light, var(--grey-900)) var(--sparkle-dark, #fff);--base-level-70R:var(--sparkle-light, #fff) var(--sparkle-dark, var(--grey-900));--base-gradient-20:linear-gradient(180deg, var(--grey-400) 0%, var(--grey-500) 50%);--base-gradient-30:linear-gradient(180deg, var(--grey-300) 0%, var(--grey-500) 50%);--base-gradient-60:linear-gradient(180deg, var(--grey-700) 0%, var(--grey-900) 50%);--base-gradient-70:linear-gradient(180deg, var(--grey-600) 0%, var(--grey-900) 50%);--primary-level-20:var(--sparkle-light, var(--primary-50)) var(--sparkle-dark, var(--primary-950));--primary-level-30:var(--sparkle-light, var(--primary-100)) var(--sparkle-dark, var(--primary-900));--primary-level-40:var(--sparkle-light, var(--primary-200)) var(--sparkle-dark, var(--primary-800));--primary-level-50:var(--sparkle-light, var(--primary-300)) var(--sparkle-dark, var(--primary-800));--primary-level-50R:var(--sparkle-light, var(--primary-800)) var(--sparkle-dark, var(--primary-300));--primary-level-80:var(--sparkle-light, var(--primary-900)) var(--sparkle-dark, var(--primary-300));--primary-gradient-20:linear-gradient(180deg, var(--primary-400) 0%, var(--primary-500) 50%);--primary-gradient-30:linear-gradient(180deg, var(--primary-300) 0%, var(--primary-500) 50%);--accent-level-20:var(--sparkle-light, var(--accent-50)) var(--sparkle-dark, var(--accent-950));--accent-level-30:var(--sparkle-light, var(--accent-100)) var(--sparkle-dark, var(--accent-900));--accent-level-40:var(--sparkle-light, var(--accent-200)) var(--sparkle-dark, var(--accent-800));--accent-level-50:var(--sparkle-light, var(--accent-300)) var(--sparkle-dark, var(--accent-800));--accent-level-50R:var(--sparkle-light, var(--accent-800)) var(--sparkle-dark, var(--accent-300));--accent-level-80:var(--sparkle-light, var(--accent-900)) var(--sparkle-dark, var(--accent-300));--accent-gradient-20:linear-gradient(180deg, var(--accent-400) 0%, var(--accent-500) 50%);--accent-gradient-30:linear-gradient(180deg, var(--accent-300) 0%, var(--accent-500) 50%);--tertiary-level-20:var(--sparkle-light, var(--tertiary-50)) var(--sparkle-dark, var(--tertiary-950));--tertiary-level-30:var(--sparkle-light, var(--tertiary-100)) var(--sparkle-dark, var(--tertiary-900));--tertiary-level-40:var(--sparkle-light, var(--tertiary-200)) var(--sparkle-dark, var(--tertiary-800));--tertiary-level-50:var(--sparkle-light, var(--tertiary-300)) var(--sparkle-dark, var(--tertiary-800));--tertiary-level-50R:var(--sparkle-light, var(--tertiary-800)) var(--sparkle-dark, var(--tertiary-300));--tertiary-level-80:var(--sparkle-light, var(--tertiary-900)) var(--sparkle-dark, var(--tertiary-300));--tertiary-gradient-20:linear-gradient(180deg, var(--tertiary-400) 0%, var(--tertiary-500) 50%);--tertiary-gradient-30:linear-gradient(180deg, var(--tertiary-300) 0%, var(--tertiary-500) 50%);--warn-level-20:var(--sparkle-light, var(--warn-50)) var(--sparkle-dark, var(--warn-950));--warn-level-30:var(--sparkle-light, var(--warn-100)) var(--sparkle-dark, var(--warn-900));--warn-level-40:var(--sparkle-light, var(--warn-200)) var(--sparkle-dark, var(--warn-800));--warn-level-50:var(--sparkle-light, var(--warn-300)) var(--sparkle-dark, var(--warn-800));--warn-level-50R:var(--sparkle-light, var(--warn-800)) var(--sparkle-dark, var(--warn-300));--warn-level-80:var(--sparkle-light, var(--warn-900)) var(--sparkle-dark, var(--warn-300));--warn-gradient-20:linear-gradient(180deg, var(--warn-400) 0%, var(--warn-500) 50%);--warn-gradient-30:linear-gradient(180deg, var(--warn-300) 0%, var(--warn-500) 50%);--success-level-20:var(--sparkle-light, var(--success-50)) var(--sparkle-dark, var(--success-950));--success-level-30:var(--sparkle-light, var(--success-100)) var(--sparkle-dark, var(--success-900));--success-level-40:var(--sparkle-light, var(--success-200)) var(--sparkle-dark, var(--success-800));--success-level-50:var(--sparkle-light, var(--success-300)) var(--sparkle-dark, var(--success-800));--success-level-50R:var(--sparkle-light, var(--success-800)) var(--sparkle-dark, var(--success-300));--success-level-80:var(--sparkle-light, var(--success-900)) var(--sparkle-dark, var(--success-300));--success-gradient-20:linear-gradient(180deg, var(--success-400) 0%, var(--success-500) 50%);--success-gradient-30:linear-gradient(180deg, var(--success-300) 0%, var(--success-500) 50%);--dark-primary-text:var(--grey-900);--light-primary-text:#fff}*{box-sizing:border-box}html,body,app-root{width:100vw;min-height:100vh;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;background-color:var(--base-level-20)}body{margin:0;font:var(--paragraph-30);color:var(--base-level-70)}</style><link rel="stylesheet" href="styles-CLP6NP2M.css" media="print" onload="this.media='all'"><noscript><link rel="stylesheet" href="styles-CLP6NP2M.css"></noscript></head>
21
21
  <body>
22
22
  <app-root></app-root>
23
- <link rel="modulepreload" href="chunk-N35HGIXN.js"><link rel="modulepreload" href="chunk-UUMKHH4F.js"><link rel="modulepreload" href="chunk-KFGIVU27.js"><link rel="modulepreload" href="chunk-SSYD4I7W.js"><link rel="modulepreload" href="chunk-6M3MNJ52.js"><link rel="modulepreload" href="chunk-PIDBEXSZ.js"><link rel="modulepreload" href="chunk-EHV3OZDB.js"><link rel="modulepreload" href="chunk-J3H4BCHI.js"><link rel="modulepreload" href="chunk-P6LV5I2K.js"><link rel="modulepreload" href="chunk-5XX7BU4I.js"><script src="polyfills-DUGKNACR.js" type="module"></script><script src="main-KLER7HZN.js" type="module"></script></body>
23
+ <link rel="modulepreload" href="chunk-N35HGIXN.js"><link rel="modulepreload" href="chunk-V7APGUBT.js"><link rel="modulepreload" href="chunk-KFGIVU27.js"><link rel="modulepreload" href="chunk-SSYD4I7W.js"><link rel="modulepreload" href="chunk-6M3MNJ52.js"><link rel="modulepreload" href="chunk-PIDBEXSZ.js"><link rel="modulepreload" href="chunk-EHV3OZDB.js"><link rel="modulepreload" href="chunk-J3H4BCHI.js"><link rel="modulepreload" href="chunk-P6LV5I2K.js"><link rel="modulepreload" href="chunk-5XX7BU4I.js"><script src="polyfills-DUGKNACR.js" type="module"></script><script src="main-WGR4ZD6A.js" type="module"></script></body>
24
24
  </html>
@@ -128,6 +128,7 @@
128
128
  "8076205046065195949": "Gendanner gemmes i skyen og kan gendannes når som helst.",
129
129
  "6462449391546115362": " Start {$START_TAG_SPK_ICON}arrow-right{$CLOSE_TAG_SPK_ICON}",
130
130
  "1677665968492592597": "Mine backups",
131
+ "3425407769043382371": "tog",
131
132
  "6520003959216971027": "Sidste vellykkede backup:",
132
133
  "6811901802533648897": "N/A",
133
134
  "471538465380942039": "Kilde:",
@@ -128,6 +128,7 @@
128
128
  "6462449391546115362": " Start {$START_TAG_SPK_ICON}arrow-right{$CLOSE_TAG_SPK_ICON}",
129
129
  "1677665968492592597": "My backups",
130
130
  "6520003959216971027": "Last successful backup:",
131
+ "3425407769043382371": "took",
131
132
  "6811901802533648897": "N/A",
132
133
  "471538465380942039": "Source:",
133
134
  "5646035883377382015": "Destination:",
@@ -0,0 +1 @@
1
+ import{b as se,c as ie}from"./chunk-N35HGIXN.js";import{a as oe}from"./chunk-V7APGUBT.js";import"./chunk-KFGIVU27.js";import{a as I}from"./chunk-SSYD4I7W.js";import{a as b}from"./chunk-6M3MNJ52.js";import{d as te}from"./chunk-PIDBEXSZ.js";import{c as ne}from"./chunk-EHV3OZDB.js";import{H as Z,L as Q,X as S,ca as Y,ma as ee}from"./chunk-J3H4BCHI.js";import{a as X}from"./chunk-P6LV5I2K.js";import{a as $,b as z,d as B,e as q,f as _}from"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import{b as re}from"./chunk-OVIL3KMN.js";import{Bc as J,Cc as G,E as w,Gb as D,J as P,L as R,Mc as K,N as W,R as y,U as H,X as r,Za as l,d as x,fb as F,g as V,ja as U,m as E,x as j,y as O}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var d=class o{#o=l(null);#n=window.self!==window.top;config=this.#o.asReadonly();configLoaded=this.#n?new V:null;parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#i(),this.#n&&(this.parentIframeListner=new AbortController,this.#e("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),n=JSON.parse(t);if(!n?.accessToken||!n?.clientId){this.#e("error:invalid-config");return}if(typeof n.clientId!="string"){this.#e("error:invalid-config");return}if(typeof n.accessToken!="string"){this.#e("error:invalid-config");return}console.info("postMessage config set"),this.#o.set(n),this.configLoaded?.next(!0)}},{signal:this.parentIframeListner.signal}))}#e(e){window.parent.postMessage(e,"*")}#i(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})};var M=class o{#o=r(b);#n=r(Z);#e=r(d);sub=null;ngOnInit(){this.#e.fetchConfig(),this.sub=this.#n.queryParams.subscribe(({accessToken:e,clientId:t})=>{e?.length&&t?.length&&this.#e.setConfig({accessToken:e,clientId:t})}),this.#o.clearAllNotCurrentVersion()}ngOnDestroy(){this.sub?.unsubscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=F({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&D(0,"router-outlet")},dependencies:[Q],encapsulation:2})};var ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var u=new H("ENVIRONMENT");var T=class o{#o=r(te);isLoaded=l(!1);webmodules=l(null);preload(e=!1){let t=this.#o.getApiV1Webmodules().pipe(W(n=>this.webmodules.set(n)),w(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})};var ue=()=>{let o=r(d),e=r(U);return o.configLoaded===null&&console.log("preload"),o.configLoaded?.pipe(R(()=>j(e.get(oe).preload(!0),e.get(T).preload(!0))))},pe=[{path:"",children:[{path:"login",canActivate:[()=>r(I).token()!==null?r(S).navigate(["/"]):!0],loadComponent:()=>import("./chunk-EWJCAT5A.js")},{path:"logout",loadComponent:()=>import("./chunk-LVYTERRJ.js")},{path:"",canActivate:[ue],loadComponent:()=>import("./chunk-2X2NVYPD.js"),children:[{path:"",loadComponent:()=>import("./chunk-E4CUHBCT.js")},{path:"add-backup",loadComponent:()=>import("./chunk-BJAZPKHX.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-B3MIBKC5.js")},{path:"backup/import",loadComponent:()=>import("./chunk-NWRHNRPB.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-XM4XOJPS.js"),loadChildren:()=>import("./chunk-NKPGP6QP.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-XM4XOJPS.js"),loadChildren:()=>import("./chunk-NKPGP6QP.js")},{path:"restore",loadComponent:()=>import("./chunk-HLOYWLHV.js")},{path:"restore-flow/:id",loadComponent:()=>import("./chunk-LQUKRKUH.js"),children:[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"select-files",loadComponent:()=>import("./chunk-ZRCOVLAQ.js")},{path:"options",loadComponent:()=>import("./chunk-RU7EY7FN.js")}]},{path:"settings",loadComponent:()=>import("./chunk-UAKB5CAQ.js")},{path:"about",loadComponent:()=>import("./chunk-QGSX2XOM.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-UPHEPMGX.js")},{path:"changelog",loadComponent:()=>import("./chunk-ZI3FISVO.js")},{path:"libraries",loadComponent:()=>import("./chunk-VOINBIWD.js")},{path:"system-info",loadComponent:()=>import("./chunk-443IB2NN.js")},{path:"logs",loadComponent:()=>import("./chunk-X25RPH22.js")}]}]}]}];var A=null,ce=(o,e)=>{let t=r(I),n=r(S),c=r(b),i=r(u),f=r(ne),s=c.getItem("locale"),p=se(s),h=o;if(t.token()&&o.url.startsWith(i.baseUrl)){let a=o.headers.set("Authorization",`Bearer ${t.token()}`);s&&s!=="en-US"&&(a=a.set("X-Ui-Language",p)),h=o.clone({headers:a})}return e(h).pipe(O(a=>{if(f.error(a.message),a.status===401&&!A&&(A=t.refreshToken().pipe(P())),a.status===401)return A.pipe(R(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))),O(g=>(n.navigate(["/logout"]),E(()=>g))),w(()=>A=null));let m=`Error Code: ${a.status}, Message: ${a.message}`;return E(()=>({error:a,message:m}))}))};var fe="1.0.0",le="portal-proxy-client",he=1,k=class o{#o=1e3;#n=r(u);#e=l("disconnected");#i=l(this.#o);#a=l(!1);#r=l(!1);#p=l(null);isConnectedToMachineServer=this.#r.asReadonly();wsState=this.#e.asReadonly();#c=[];#s={};#t=null;#m=new TextDecoder("utf-8");#l=null;#d=K(()=>{let e=this.#a(),t=this.#i(),n=this.#p();if(!n||!e||!t||t<this.#o){this.#l&&window.clearInterval(this.#l);return}this.#l=window.setInterval(()=>{this.connectToMachineServer(n)},t)});utf8Atob(e){let t=Uint8Array.from(atob(e),c=>c.charCodeAt(0)),n=this.#m.decode(t);return n?JSON.parse(n):null}connectToMachineServer(e,t){let n=t?.reconnect??!1;this.#t&&this.wsState()==="authenticated"&&!n||(this.#t&&this.wsState()!=="authenticated"&&this.#t.close(),this.#t=new WebSocket(this.#n.machineServerUrl),this.#t.onopen=()=>{this.#e.set("connect"),this.#r.set(!0),this.#a.set(!1),this.#p.set(null)},this.#t.onclose=()=>{this.#e.set("disconnected"),this.#r.set(!1),this.#p.set(e),this.#a.set(!0)},this.#t.onerror=()=>{this.#e.set("error")},this.#t.onmessage=c=>{let i=JSON.parse(c.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let s={token:e,publicKey:"",clientVersion:fe,protocolVersion:he},p=this.createResponse(i,"authportal",s);this.#e.set("welcome"),this.#t?.send(p)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var f=JSON.parse(i.payload??"");if(f.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#e.set("authenticated"),this.#r.set(!0);this.#c.length>0;){let s=this.#c.pop();s&&this.#s[s.messageId]&&this.activateCommand(s)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let s=this.#s[i.messageId];if(s){if(i.errorMessage){s.reject(i.errorMessage);return}else{let p=JSON.parse(i.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),s.resolve(p)}delete this.#s[i.messageId],window.clearTimeout(s.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#t?.close(),this.#t=null,this.#e.set("disconnected"),this.#r.set(!1)}createResponse(e,t,n){let c={from:le,to:e.from,type:t,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(c)}sendCommand(e,t,n,c,i,f,s=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((p,h)=>{let a=crypto.randomUUID(),g={from:le,to:t,type:"command",messageId:a,payload:JSON.stringify({method:n,path:c,body:i,headers:f})},v={resolve:p,reject:h,timer:window.setTimeout(()=>{let C=this.#s[a];C&&(delete this.#s[a],C.reject("Timeout"))},s)};this.#s[a]=v,this.#r()?this.activateCommand(g):this.#c.push(g)})}activateCommand(e){this.#t?.send(JSON.stringify(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=y({token:o,factory:o.\u0275fac,providedIn:"root"})};function ge(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}var me=(o,e)=>{let n=r(d).config(),c=r(u);if(n===null)return e(o);let i=r(k),f=ge(o.body),s={};o.headers.keys().forEach(m=>{s[m]=o.headers.get(m)??""});let p=o.headers.get("timeout"),h=p!==null?parseInt(p):c.defaultTimeout,a=i.sendCommand(n.accessToken,n.clientId,o.method,o.url,f,s,h);return new x(m=>{a.then(g=>{let v=new $;s!=null&&Object.keys(s).forEach(L=>{v.set(L,s[L])});let C=new z({body:g.body,status:g.code,statusText:"OK",headers:v});m.next(C),m.complete()})})};var de={providers:[J(),Y(pe,ee()),B(_(),q([me,ce])),b,{provide:u,useValue:ae},{provide:G,useValue:ie()},re]};X(M,de);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.33",
2
+ "version": "0.0.35",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-CFQQ4QBV.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-C6Q5SG76.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-OGOMCLP4.js")},{path:"destination",loadComponent:()=>import("./chunk-PRXIWW64.js")},{path:"source-data",loadComponent:()=>import("./chunk-KZMJGNOW.js")},{path:"schedule",loadComponent:()=>import("./chunk-IBQ7EDD3.js")},{path:"options",loadComponent:()=>import("./chunk-J2ZPRK4G.js")}];export{o as default};
package/chunk-OHAFLXCH.js DELETED
@@ -1 +0,0 @@
1
- import{a as se}from"./chunk-W6WGCBBX.js";import{a as pe}from"./chunk-QZCTOSPE.js";import"./chunk-PIDBEXSZ.js";import{a as H,g as R,h as ae,j as le,m as ce,n as re}from"./chunk-EHV3OZDB.js";import{Y as I}from"./chunk-J3H4BCHI.js";import"./chunk-P6LV5I2K.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Ab as E,Bb as Y,Cb as Z,Db as ee,Eb as o,Fb as i,Gb as p,Hb as C,Ib as S,Kb as ne,Qb as m,Ra as l,Rb as O,Sb as c,Tb as te,Ub as oe,Wb as f,X as W,Xb as s,ea as k,fa as P,fb as q,ic as u,kc as T,lb as d,rc as N,sb as J,sc as $,tb as Q,vb as g,vc as A,wc as ie,xb as F,xc as _e}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var ue=()=>[I,R,H,le,ce,import("./chunk-4TN5W4QO.js").then(e=>e.DatePipe),import("./chunk-BEZGDXHL.js").then(e=>e.DurationFormatPipe)],de=()=>["/add-backup"],Me=()=>["/restore"],ge=e=>["/backup",e],Ee=e=>["/backup",e,"export"];function Ce(e,_){if(e&1&&(u(0),A(1,"durationFormat")),e&2){let n=s().$implicit;T(" - (took ",ie(1,1,n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDuration),") ")}}function Se(e,_){e&1&&(C(0),c(1,14),S())}function me(e,_){if(e&1&&u(0),e&2){let n=s().$implicit;T(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.SourceSizeString," ")}}function Oe(e,_){e&1&&(C(0),c(1,15),S())}function Te(e,_){if(e&1&&u(0),e&2){let n=s().$implicit;T(" ",n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.TargetSizeString," ")}}function ke(e,_){e&1&&(C(0),c(1,16),S())}function Pe(e,_){if(e&1&&(o(0,"spk-chip",29),c(1,17),i()),e&2){let n=s().$implicit;l(),te(n.Backup==null||n.Backup.Metadata==null?null:n.Backup.Metadata.BackupListCount),oe(1)}}function Fe(e,_){e&1&&(o(0,"spk-chip",30),c(1,18),i())}function fe(e,_){if(e&1){let n=ne();o(0,"div",28)(1,"div",23)(2,"h3"),u(3),o(4,"spk-icon"),u(5,"database"),i()(),o(6,"p")(7,"span"),c(8,8),i(),u(9),A(10,"date"),d(11,Ce,2,3)(12,Se,2,0,"ng-container"),i(),o(13,"p")(14,"span"),c(15,9),i(),d(16,me,1,1)(17,Oe,2,0,"ng-container"),i(),o(18,"p")(19,"span"),c(20,10),i(),d(21,Te,1,1)(22,ke,2,0,"ng-container"),i()(),d(23,Pe,2,1,"spk-chip",29)(24,Fe,2,0,"spk-chip",30),o(25,"div",31)(26,"button",32),f("click",function(){let r=k(n).$implicit,M=s(3);return P(M.startBackup(r.Backup==null?null:r.Backup.ID))}),m(27,11),p(28,"spk-icon"),O(),i(),o(29,"button",33)(30,"spk-icon"),u(31,"pencil-simple"),i()(),o(32,"spk-menu",34)(33,"button",24)(34,"spk-icon"),u(35,"dots-three-vertical"),i()(),C(36,35),o(37,"button",36,0),m(39,12),p(40,"spk-icon"),O(),i(),o(41,"button",37,0),f("click",function(){let r=k(n).$implicit,M=s(3);return P(M.deleteBackup(r.Backup==null?null:r.Backup.ID))}),m(43,13),p(44,"spk-icon"),O(),i(),S(),i()()()}if(e&2){let n,t=_.$implicit,r=s(3);l(3),T(" ",(n=t.Backup==null?null:t.Backup.Name)!==null&&n!==void 0?n:r.MISSING_BACKUP_NAME," "),l(6),T(" ",_e(10,13,t.Backup==null||t.Backup.Metadata==null?null:t.Backup.Metadata.LastBackupDate,"short")," "),l(2),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.LastBackupDuration?11:12),l(5),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.SourceSizeString?16:17),l(5),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.TargetSizeString?21:22),l(2),E(!(t.Backup==null||t.Backup.Metadata==null)&&t.Backup.Metadata.BackupListCount?23:24),l(3),F("loader",r.startingBackup()),l(3),g("routerLink",$(16,ge,t.Backup==null?null:t.Backup.ID)),l(3),g("right",!0),l(5),g("routerLink",$(18,Ee,t.Backup==null?null:t.Backup.ID)),l(4),F("loader",r.deletingBackup()===(t.Backup==null?null:t.Backup.ID))}}function Ne(e,_){if(e&1&&Z(0,fe,45,20,"div",28,Y),e&2){let n=s(2);ee(n.backups())}}function $e(e,_){e&1&&(C(0),c(1,19),S())}function Ae(e,_){if(e&1&&d(0,Ne,2,0)(1,$e,2,0,"ng-container"),e&2){let n=s();E(n.backups().length?0:1)}}function Ie(e,_){e&1&&(o(0,"div",38),p(1,"spk-progress-bar",39),o(2,"div",23)(3,"h3"),c(4,20),i()()())}var x=class e{#e=W(pe);MISSING_BACKUP_NAME=$localize`Backup name missing`;backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;startingBackup=this.#e.startingBackup;deletingBackup=this.#e.deletingBackup;ngOnInit(){this.#e.getBackups(!0)}startBackup(_){this.#e.startBackup(_)}deleteBackup(_){_&&window.confirm("Are you sure you want to delete this backup?")&&this.#e.deleteBackup(_)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=q({type:e,selectors:[["app-home"]],decls:31,vars:5,consts:()=>{let _;_=$localize`Backups`;let n;n=$localize`Backups are stored in the cloud and can be restored at any time.`;let t;t=$localize` Add ${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let r;r=$localize`Restores`;let M;M=$localize`Restores are stored in the cloud and can be restored at any time.`;let D;D=$localize` Start ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let B;B=$localize`My backups`;let b;b=$localize`Last successful backup:`;let L;L=$localize`Source:`;let y;y=$localize`Destination:`;let h;h=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SPK_ICON:play-circle${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SPK_ICON: Start `;let G;G=$localize` Export ${"\uFFFD#40\uFFFD"}:START_TAG_SPK_ICON:export${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let v;v=$localize` Delete ${"\uFFFD#44\uFFFD"}:START_TAG_SPK_ICON:x-circle${"\uFFFD/#44\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let X;X=$localize`N/A`;let z;z=$localize`N/A`;let w;w=$localize`N/A`;let K;K=$localize` ${"\uFFFD0\uFFFD"}:INTERPOLATION: Version `;let V;V=$localize`No version yet`;let j;j=$localize`No backups founds`;let U;return U=$localize`Loading backups...`,[["option",""],_,n,t,r,M,D,B,b,L,y,h,G,v,X,z,w,K,V,j,U,[1,"type-a",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["spk-button",""],["src","assets/images/restore.png","alt","","width","48px"],[1,"content"],[1,"backups"],[1,"backup"],[1,"simple","success"],[1,"simple"],[1,"actions"],["spk-button","",3,"click"],["spk-button","",3,"routerLink"],[3,"right"],["menu",""],[3,"routerLink"],[3,"click"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(n,t){n&1&&(p(0,"app-status-bar"),o(1,"section")(2,"header")(3,"spk-card",21),p(4,"img",22),o(5,"div",23)(6,"h3"),c(7,1),i(),o(8,"p"),c(9,2),i()(),o(10,"button",24),m(11,3),p(12,"spk-icon"),O(),i()(),o(13,"spk-card",21),p(14,"img",25),o(15,"div",23)(16,"h3"),c(17,4),i(),o(18,"p"),c(19,5),i()(),o(20,"button",24),m(21,6),p(22,"spk-icon"),O(),i()()(),o(23,"div",26)(24,"h2"),c(25,7),i(),o(26,"div",27),d(27,Ae,2,1)(28,Ie,5,0),J(29,27,ue,null,28),i()()()),n&2&&(l(3),g("routerLink",N(3,de)),l(10),g("routerLink",N(4,Me)),l(16),Q(!t.backupsLoading()))},dependencies:[I,se,ae,R,H,re],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem 0}header[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;padding:0 2rem;gap:1rem}spk-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem}spk-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem;gap:1rem}.backups[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-level-60)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-level-70)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{x as default};
package/chunk-UUMKHH4F.js DELETED
@@ -1 +0,0 @@
1
- import{b as m}from"./chunk-KFGIVU27.js";import{a as p}from"./chunk-PIDBEXSZ.js";import{E as n,Kc as f,N as s,R as a,X as l,Za as r}from"./chunk-MR4RE3IB.js";var c=class t{#e=l(p);isLoaded=r(!1);systemInfo=r(null);filterGroups=m(this.#e.getApiV1SysteminfoFiltergroups());backendModules=f(()=>this.systemInfo()?.BackendModules??[]);preload(i=!1){let e=this.#e.getApiV1Systeminfo().pipe(s(o=>this.systemInfo.set(o)),s(o=>console.log("systemInfo",o)),n(()=>this.isLoaded.set(!0)));if(i)return e;e.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=a({token:t,factory:t.\u0275fac,providedIn:"root"})};export{c as a};
package/chunk-WCTCAT6N.js DELETED
@@ -1 +0,0 @@
1
- import{a as Ke}from"./chunk-K7H3KYW7.js";import{a as A}from"./chunk-N35HGIXN.js";import{a as Pe}from"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import{a as Be}from"./chunk-DGBBEZNN.js";import{b as he,d as Re,e as Ge,g as ye,h as Oe,j as $e,l as Ae,m as be,o as ve,p as De,q as ke,r as Le,s as xe,t as we}from"./chunk-7SJHYZC5.js";import{a as Me}from"./chunk-6M3MNJ52.js";import{a as We}from"./chunk-W6WGCBBX.js";import"./chunk-QZCTOSPE.js";import{a as Ie}from"./chunk-PIDBEXSZ.js";import{g as Xe,k as Ue,o as ze,q as Ve}from"./chunk-EHV3OZDB.js";import"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import"./chunk-OVIL3KMN.js";import{Ab as g,Bb as P,Cb as h,Db as R,Eb as i,Fb as o,Gb as p,Hb as de,Ib as ce,K as y,Kb as M,Kc as fe,Mc as Fe,Oa as Se,Qb as E,Ra as s,Rb as N,Sb as _,Tb as D,Ub as k,Vb as ge,Wb as u,X as I,Xb as c,Za as C,_b as me,c as _e,ea as m,fa as T,fb as pe,ic as f,jc as O,kc as $,lb as b,mc as Te,nc as Ce,oc as Ee,p as ue,rc as Ne,vb as d,xb as v}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var He=()=>({standalone:!0});function Je(l,e){if(l&1){let t=M();i(0,"spk-form-field",63),p(1,"input",64),o(),i(2,"button",65),u("click",function(){m(t);let r=c(2);return T(r.beginRemoteRegistration())}),_(3,24),o()}}function Qe(l,e){if(l&1&&(i(0,"div",61)(1,"label"),_(2,25),o(),i(3,"a",66),f(4),o()()),l&2){let t=c(2);s(3),me("href",t.remoteControlClaimUrl(),Se),s(),O(t.remoteControlClaimUrl())}}function Ye(l,e){l&1&&(i(0,"div",61)(1,"label"),_(2,26),o()())}function Ze(l,e){if(l&1){let t=M();i(0,"button",65),u("click",function(){m(t);let r=c(2);return T(r.cancelRemoteRegistration())}),_(1,27),o()}}function et(l,e){if(l&1){let t=M();i(0,"button",65),u("click",function(){m(t);let r=c(2);return T(r.disableRemoteControl())}),_(1,28),o()}}function tt(l,e){if(l&1){let t=M();i(0,"button",65),u("click",function(){m(t);let r=c(2);return T(r.enableRemoteControl())}),_(1,29),o(),i(2,"button",67),u("click",function(){m(t);let r=c(2);return T(r.deleteRemoteControl())}),_(3,30),o()}}function nt(l,e){if(l&1&&(i(0,"div",36),b(1,Je,4,0)(2,Qe,5,2,"div",61)(3,Ye,3,0,"div",61)(4,Ze,2,0,"button",62)(5,et,2,0,"button",62)(6,tt,4,0),o()),l&2){let t=c();s(),g(t.remoteControlState()==="inactive"?1:-1),s(),g(t.remoteControlState()==="registered"?2:-1),s(),g(t.remoteControlState()==="registering"?3:-1),s(),g(t.remoteControlState()==="registering"||t.remoteControlState()==="registeringfaulted"||t.remoteControlState()==="registered"?4:-1),s(),g(t.remoteControlState()==="connected"||t.remoteControlState()==="enabled"?5:-1),s(),g(t.remoteControlState()==="disabled"?6:-1)}}function it(l,e){if(l&1&&(i(0,"option",41),f(1),o()),l&2){let t=e.$implicit;d("value",t),s(),O(t)}}function ot(l,e){if(l&1){let t=M();i(0,"option",68),u("click",function(){let r=m(t).$implicit,S=c();return T(S.pauseSettings.controls.timeType.setValue(r.value))}),f(1),o()}if(l&2){let t=e.$implicit;d("value",t.value),s(),$(" ",t.label," ")}}function rt(l,e){if(l&1&&(i(0,"option",41),f(1),o()),l&2){let t=e.$implicit;d("value",t.value),s(),$(" ",t.label," ")}}function lt(l,e){if(l&1&&(i(0,"option",41),f(1),o()),l&2){let t=e.$implicit;d("value",t.value),s(),$(" ",t.label," ")}}var F=new Le,qe=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],je=[{value:"",label:$localize`System default (information)`},{value:"information",label:$localize`Usage statistics, warnings, errors, and crashes`},{value:"warning",label:$localize`Warnings, errors and crashes`},{value:"error",label:$localize`Errors and crashes`},{value:"crash",label:$localize`Crashes only`},{value:"none",label:$localize`None / disabled`}],L=class l{#i=I(Be);#r=I(Pe);#e=I(Ie);#o=I(Me);#l=this.#o.getItem("locale")??"en-US";sysinfo=this.#r.systemInfo;isDarkMode=this.#i.isDarkMode;editAs=C("list");langCtrl=C(this.#l);settingsForm=F.group({pauseSettings:F.group({time:F.control(0),timeType:F.control("s")}),usageStatistics:F.control(""),updateChannel:F.control(""),remoteControlRegisterUrl:F.control("")});remoteControlState=C("unknown");remoteControlClaimUrl=C(null);sysInfoEffect=Fe(()=>{this.settingsForm.controls.remoteControlRegisterUrl.patchValue(this.sysinfo()?.RemoteControlRegistrationUrl??"")});get pauseSettings(){return this.settingsForm.controls.pauseSettings}timeTypeOptions=C(qe);timeOptions=Ke([this.pauseSettings.controls.timeType.valueChanges.pipe(y("s")),this.pauseSettings.controls.time.valueChanges.pipe(y(null))],_e(ue(([e,t])=>{let n=this.#a(e);return t!==null?n.filter(r=>r.toString().includes(t.toString())):n}),y([])));languageOptions=fe(()=>{let e=this.langCtrl();return e?A.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())):A});usageStatisticsOptions=C(je);ngOnInit(){this.refreshRemoteControlStatus(),this.getServerSettings()}saveLocale(e){this.#o.setItem("locale",e),window.location.reload()}submit(){let e=`${this.pauseSettings.controls.time.value}${this.pauseSettings.controls.timeType.value}`;this.#e.patchApiV1Serversettings({requestBody:{"usage-reporter-level":this.settingsForm.controls.usageStatistics.value,"startup-delay":e==="0s"?"":e,"update-channel":this.settingsForm.controls.updateChannel.value}}).subscribe({next:t=>{console.log("res",t)},error:t=>{console.error("err",t)}})}getServerSettings(){return this.#e.getApiV1Serversettings().subscribe({next:e=>{let t=e["startup-delay"],n=t.slice(-1),r=t.slice(0,-1),S=["s","m","h"];this.settingsForm.patchValue({pauseSettings:{time:parseInt(r==""?"0":r),timeType:S.includes(n)?n:"s"},usageStatistics:e["usage-reporter-level"],updateChannel:e["update-channel"]})}})}languageDisplay(){let e=this;return()=>{let t=e.langCtrl();return t?A.find(n=>n.value===t)?.label??null:null}}typeDisplay(){let e=this;return()=>{let t=e.settingsForm.value.pauseSettings?.timeType;return t==null?null:qe.find(n=>n.value===t)?.label??null}}usageDisplay(){let e=this;return()=>{let t=e.settingsForm.value.usageStatistics;return t==null?null:je.find(n=>n.value===t)?.label??null}}setDarkMode(){this.#i.setDarkMode()}setLightMode(){this.#i.setLightMode()}#a(e){let t=e==="h"?25:61;return new Array(t).fill(0).map((n,r)=>r)}repeatRegisterTimer=null;#t(e){e.RegistrationUrl&&this.remoteControlClaimUrl.set(e.RegistrationUrl),console.log(e),e.IsConnected?this.remoteControlState.set("connected"):e.IsEnabled?this.remoteControlState.set("enabled"):e.CanEnable?this.remoteControlState.set("disabled"):e.IsRegisteringFaulted?this.remoteControlState.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.remoteControlState.set("registered"):this.remoteControlState.set("registering"):this.remoteControlState.set("inactive");let t=this.remoteControlState();console.log(t),this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),t==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:""}}).subscribe({next:n=>{this.#t(n)},error:n=>{this.#n(n)}})},5e3)),(t==="enabled"||t==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.getApiV1RemotecontrolStatus().subscribe({next:n=>{this.#t(n)},error:n=>{this.#n(n)}})},5e3)),e.IsRegistering&&e.CanEnable&&this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:n=>{this.#t(n)}})}#n(e){this.#e.getApiV1RemotecontrolStatus().subscribe({next:t=>{this.#t(t)}})}refreshRemoteControlStatus(){this.#e.getApiV1RemotecontrolStatus().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}beginRemoteRegistration(){this.remoteControlState.set("registering");let e=this.settingsForm.controls.remoteControlRegisterUrl.value;this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e}}).subscribe({next:t=>{this.#t(t)},error:t=>{this.#n(t)}})}cancelRemoteRegistration(){this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}enableRemoteControl(){this.#e.postApiV1RemotecontrolEnable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}disableRemoteControl(){this.#e.postApiV1RemotecontrolDisable().subscribe({next:e=>{this.#t(e)},error:e=>{this.#n(e)}})}deleteRemoteControl(){let e=this;confirm("Are you sure you want to delete the remote control registration?")&&e.#e.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>{e.#t(t)},error:t=>{e.#n(t)}})}getRemoteControlStatusText(){let e=this.remoteControlState();return e==="enabled"?"Remote control is enabled but not connected":e==="connected"?"Remote control is connected":e==="registering"?"Registering machine...":e==="registeringfaulted"?"Registration failed":e==="registered"?"Registered, waiting for accept":e==="disabled"?"Remote control is configured but not enabled":e==="unknown"?"...loading...":"Remote control is not set up"}static \u0275fac=function(t){return new(t||l)};static \u0275cmp=pe({type:l,selectors:[["app-settings"]],decls:107,vars:18,consts:()=>{let e;e=$localize`Settings`;let t;t=$localize`Configure your backup settings.`;let n;n=$localize`Save changes`;let r;r=$localize`Remote access control`;let S;S=$localize`Pause after startup or hibernation`;let x;x=$localize` Duplicati will run when started, but will remain in paused state for the duration. Duplicati will occupy minimal system resources and no backups will be run. `;let w;w=$localize`Color theme`;let X;X=$localize`Customize your application theme`;let U;U=$localize`Language`;let z;z=$localize`Select a language for the platform`;let V;V=$localize`Update channel`;let B;B=$localize`Update channel selection is not implemented yet.`;let W;W=$localize` Default (${"\uFFFD0\uFFFD"}:INTERPOLATION:) ${"\uFFFD#66\uFFFD\uFFFD/#66\uFFFD"}:TAG_INPUT:`;let K;K=$localize`Same as the base install version: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let q;q=$localize` Stable ${"\uFFFD#72\uFFFD\uFFFD/#72\uFFFD"}:TAG_INPUT:`;let j;j=$localize`Official releases`;let H;H=$localize` Beta ${"\uFFFD#78\uFFFD\uFFFD/#78\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Try out the new features that we are working on. Currently the most stable version available. Test Restore data before using this in production environments. `;let Q;Q=$localize` Experimental ${"\uFFFD#84\uFFFD\uFFFD/#84\uFFFD"}:TAG_INPUT:`;let Y;Y=$localize`Specific builds for developers only. Not for use with important data.`;let Z;Z=$localize` Canary ${"\uFFFD#90\uFFFD\uFFFD/#90\uFFFD"}:TAG_INPUT:`;let ee;ee=$localize`Individual builds for developers only. Not for use with important data.`;let te;te=$localize`Usage statistics`;let G;G=$localize` Usage reports help us improve the user experience and evaluate impact of new features. We use them to generate ${"\uFFFD#99\uFFFD"}:START_LINK:public usage statistics.${"\uFFFD/#99\uFFFD"}:CLOSE_LINK:${"[\uFFFD#100\uFFFD\uFFFD/#100\uFFFD|\uFFFD#101\uFFFD\uFFFD/#101\uFFFD]"}:LINE_BREAK:${"[\uFFFD#100\uFFFD\uFFFD/#100\uFFFD|\uFFFD#101\uFFFD\uFFFD/#101\uFFFD]"}:LINE_BREAK: All usage reports are sent anonymously and do not contain any personal information. They contain information about hardware and operating system, the type of backend, backup duration, overall size of source data and similar data. They do not contain paths, filenames, usernames, passwords or similar sensitive information. `,G=ge(G);let ne;ne=$localize` Register for remote control `;let ie;ie=$localize`Machine is now registered, open this link to add it to your account:`;let oe;oe=$localize`Registering, please wait...`;let re;re=$localize` Cancel registration `;let le;le=$localize` Disable remote control `;let ae;ae=$localize` Enable remote control `;let se;return se=$localize` Delete remote control setup `,[e,t,n,r,S,x,w,X,U,z,V,B,W,K,q,j,H,J,Q,Y,Z,ee,te,G,ne,ie,oe,re,le,ae,se,[1,"content",3,"submit","formGroup"],[1,"title"],["type","submit","spk-button","",1,"raised","primary"],[1,"left"],[1,"right","remote-control"],[1,"field-row"],[1,"right"],["formGroupName","pauseSettings",1,"field-row"],[3,"hideClearButton"],["type","search","formControlName","time"],[3,"value"],[3,"displayFn","hideClearButton"],["type","text","formControlName","timeType"],["options",""],[1,"themes"],["src","assets/images/light-theme.png","alt","light theme",3,"click"],["src","assets/images/dark-theme.png","alt","dark theme",3,"click"],[3,"change","displayFn","hideClearButton"],["type","search",3,"ngModelChange","ngModel","ngModelOptions"],[1,"right","radios"],[1,"radio-option",3,"click"],[1,"outlined","primary"],["type","radio","name","updateChannel","value","","formControlName","updateChannel"],["type","radio","name","updateChannel","value","stable","formControlName","updateChannel"],["type","radio","name","updateChannel","value","beta","formControlName","updateChannel"],["type","radio","name","updateChannel","value","experimental","formControlName","updateChannel"],["type","radio","name","updateChannel","value","canary","formControlName","updateChannel"],["href","#"],[3,"displayFn"],["type","text","formControlName","usageStatistics"],[1,"field-col"],["type","button","spk-button","",1,"raised"],["label","Registration URL","for","remoteControlRegisterUrl"],["type","text","spk-input","","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl","formControlName","remoteControlRegisterUrl"],["type","button","spk-button","",1,"raised",3,"click"],["target","_blank",3,"href"],["type","button","spk-button","",1,"raised","warn",3,"click"],[3,"click","value"]]},template:function(t,n){if(t&1&&(p(0,"app-status-bar"),i(1,"form",31),u("submit",function(){return n.submit()}),i(2,"header")(3,"div",32)(4,"h2"),_(5,0),o(),i(6,"p"),_(7,1),o()(),i(8,"button",33),_(9,2),o()(),i(10,"section")(11,"div",34)(12,"h3"),_(13,3),o(),i(14,"p"),f(15),o()(),i(16,"div",35),b(17,nt,7,6,"div",36),o()(),i(18,"section")(19,"div",34)(20,"h3"),_(21,4),o(),i(22,"p"),_(23,5),o()(),i(24,"div",37)(25,"div",38)(26,"spk-select",39),p(27,"input",40),h(28,it,2,2,"option",41,P),o(),i(30,"spk-select",42),p(31,"input",43),de(32,44),h(33,ot,2,2,"option",41,P),ce(),o()()()(),i(35,"section")(36,"div",34)(37,"h3"),_(38,6),o(),i(39,"p"),_(40,7),o()(),i(41,"div",37)(42,"div",45)(43,"img",46),u("click",function(){return n.setLightMode()}),o(),i(44,"img",47),u("click",function(){return n.setDarkMode()}),o()()()(),i(45,"section")(46,"div",34)(47,"h3"),_(48,8),o(),i(49,"p"),_(50,9),o()(),i(51,"div",37)(52,"spk-select",48),u("change",function(S){return n.saveLocale(S)}),i(53,"input",49),Ee("ngModelChange",function(S){return Ce(n.langCtrl,S)||(n.langCtrl=S),S}),o(),h(54,rt,2,2,"option",41,P),o()()(),i(56,"section")(57,"div",34)(58,"h3"),_(59,10),o(),i(60,"p"),_(61,11),o()(),i(62,"div",50)(63,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("")}),i(64,"spk-radio",52),E(65,12),p(66,"input",53),N(),o(),i(67,"p"),_(68,13),o()(),i(69,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("stable")}),i(70,"spk-radio",52),E(71,14),p(72,"input",54),N(),o(),i(73,"p"),_(74,15),o()(),i(75,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("beta")}),i(76,"spk-radio",52),E(77,16),p(78,"input",55),N(),o(),i(79,"p"),_(80,17),o()(),i(81,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("experimental")}),i(82,"spk-radio",52),E(83,18),p(84,"input",56),N(),o(),i(85,"p"),_(86,19),o()(),i(87,"div",51),u("click",function(){return n.settingsForm.controls.updateChannel.setValue("canary")}),i(88,"spk-radio",52),E(89,20),p(90,"input",57),N(),o(),i(91,"p"),_(92,21),o()()()(),i(93,"section")(94,"div",34)(95,"h3"),_(96,22),o(),i(97,"p"),E(98,23),p(99,"a",58)(100,"br")(101,"br"),N(),o()(),i(102,"div",37)(103,"spk-select",59),p(104,"input",60),h(105,lt,2,2,"option",41,P),o()()()()),t&2){let r,S;s(),d("formGroup",n.settingsForm),s(14),O(n.getRemoteControlStatusText()),s(2),g(n.remoteControlState()!=="unknown"?17:-1),s(9),d("hideClearButton",!0),s(2),R(n.timeOptions()),s(2),d("displayFn",n.typeDisplay())("hideClearButton",!0),s(3),R(n.timeTypeOptions()),s(10),v("active",!n.isDarkMode()),s(),v("active",n.isDarkMode()),s(8),d("displayFn",n.languageDisplay())("hideClearButton",!0),s(),Te("ngModel",n.langCtrl),d("ngModelOptions",Ne(17,He)),s(),R(n.languageOptions()),s(12),D((r=n.sysinfo())==null?null:r.DefaultUpdateChannel),k(65),s(2),D((S=n.sysinfo())==null?null:S.ServerVersionType),k(68),s(35),d("displayFn",n.usageDisplay()),s(2),R(n.usageStatisticsOptions())}},dependencies:[xe,Oe,De,ke,he,$e,Re,Ge,ye,we,Ae,ve,be,We,Xe,ze,Ue,Ve],styles:["[_nghost-%COMP%]{display:block}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:0 2rem 2rem}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem 0}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;padding:2rem 0;border-top:1px solid var(--base-level-40)}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;align-items:flex-start}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] spk-button-group[_ngcontent-%COMP%]{margin-top:.25rem}section[_ngcontent-%COMP%] .left[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;width:50%}.themes[_ngcontent-%COMP%]{display:flex;gap:.5rem}.themes[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:240px;border-radius:var(--shape-3);cursor:pointer}.themes[_ngcontent-%COMP%] img.active[_ngcontent-%COMP%]{border:2px solid var(--primary-500)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.radio-option[_ngcontent-%COMP%]{cursor:pointer}.radio-option[_ngcontent-%COMP%] spk-radio[_ngcontent-%COMP%]{color:var(--base-level-60);margin-bottom:.25rem}.radio-option[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;color:var(--base-level-60R)}.field-col[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] spk-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] spk-select[_ngcontent-%COMP%]{flex:1 0}.remote-control[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{white-space:nowrap}"],changeDetection:0})};export{L as default};
package/main-KLER7HZN.js DELETED
@@ -1 +0,0 @@
1
- import{b as re,c as se}from"./chunk-N35HGIXN.js";import{a as oe}from"./chunk-UUMKHH4F.js";import"./chunk-KFGIVU27.js";import{a as w}from"./chunk-SSYD4I7W.js";import{a as y}from"./chunk-6M3MNJ52.js";import{d as te}from"./chunk-PIDBEXSZ.js";import{c as ne}from"./chunk-EHV3OZDB.js";import{H as _,L as X,X as S,ca as Y,ma as Z}from"./chunk-J3H4BCHI.js";import{a as q}from"./chunk-P6LV5I2K.js";import{a as K,b as $,d as G,e as z,f as B}from"./chunk-5XX7BU4I.js";import"./chunk-5ZK3D2RS.js";import{a as Q,b as ee}from"./chunk-OVIL3KMN.js";import{Bc as D,Cc as F,E as R,Gb as U,J as V,L as j,Mc as J,N as P,R as g,U as W,X as r,Za as l,d as L,fb as H,m as k,x,y as E}from"./chunk-MR4RE3IB.js";import"./chunk-C6Q5SG76.js";var b=class o{#o=l(null);config=this.#o.asReadonly();parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#t(),this.parentIframeListner=new AbortController,this.#n("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),n=JSON.parse(t);if(!n?.accessToken||!n?.clientId){this.#n("error:invalid-config");return}if(typeof n.clientId!="string"){this.#n("error:invalid-config");return}if(typeof n.accessToken!="string"){this.#n("error:invalid-config");return}console.info("postMessage config set"),this.#o.set(n)}},{signal:this.parentIframeListner.signal})}#n(e){window.parent.postMessage(e,"*")}#t(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=g({token:o,factory:o.\u0275fac,providedIn:"root"})};var I=class o{#o=r(Q);#n=r(y);#t=r(_);#i=r(b);sub=null;ngOnInit(){this.#i.fetchConfig(),this.sub=this.#t.queryParams.subscribe(({accessToken:e,clientId:t})=>{e?.length&&t?.length&&this.#i.setConfig({accessToken:e,clientId:t})}),this.#n.clearAllNotCurrentVersion()}ngOnDestroy(){this.sub?.unsubscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=H({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&U(0,"router-outlet")},dependencies:[X],encapsulation:2})};var ie={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var d=new W("ENVIRONMENT");var T=class o{#o=r(te);isLoaded=l(!1);webmodules=l(null);preload(e=!1){let t=this.#o.getApiV1Webmodules().pipe(P(n=>this.webmodules.set(n)),R(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=g({token:o,factory:o.\u0275fac,providedIn:"root"})};var ae=[{path:"",children:[{path:"login",canActivate:[()=>r(w).token()!==null?r(S).navigate(["/"]):!0],loadComponent:()=>import("./chunk-EWJCAT5A.js")},{path:"logout",loadComponent:()=>import("./chunk-LVYTERRJ.js")},{path:"",canActivate:[()=>x(r(oe).preload(!0),r(T).preload(!0))],loadComponent:()=>import("./chunk-2X2NVYPD.js"),children:[{path:"",loadComponent:()=>import("./chunk-OHAFLXCH.js")},{path:"add-backup",loadComponent:()=>import("./chunk-WWDF3TQC.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-B3MIBKC5.js")},{path:"backup/import",loadComponent:()=>import("./chunk-NWRHNRPB.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-FTAJFNK5.js"),loadChildren:()=>import("./chunk-CFQQ4QBV.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-FTAJFNK5.js"),loadChildren:()=>import("./chunk-CFQQ4QBV.js")},{path:"restore",loadComponent:()=>import("./chunk-GIZ3WMHA.js")},{path:"restore-flow/:id",loadComponent:()=>import("./chunk-C3DDBRLN.js"),children:[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"select-files",loadComponent:()=>import("./chunk-IEODBWAI.js")},{path:"options",loadComponent:()=>import("./chunk-RMO2MLB3.js")}]},{path:"settings",loadComponent:()=>import("./chunk-WCTCAT6N.js")},{path:"about",loadComponent:()=>import("./chunk-QGSX2XOM.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-UPHEPMGX.js")},{path:"changelog",loadComponent:()=>import("./chunk-ZI3FISVO.js")},{path:"libraries",loadComponent:()=>import("./chunk-VOINBIWD.js")},{path:"system-info",loadComponent:()=>import("./chunk-5ILDMHKR.js")},{path:"logs",loadComponent:()=>import("./chunk-X25RPH22.js")}]}]}]}];var M=null,pe=(o,e)=>{let t=r(w),n=r(S),c=r(y),i=r(d),u=r(ne),s=c.getItem("locale"),p=re(s),h=o;if(t.token()&&o.url.startsWith(i.baseUrl)){let a=o.headers.set("Authorization",`Bearer ${t.token()}`);s&&s!=="en-US"&&(a=a.set("X-Ui-Language",p)),h=o.clone({headers:a})}return e(h).pipe(E(a=>{if(u.error(a.message),a.status===401&&!M&&(M=t.refreshToken().pipe(V())),a.status===401)return M.pipe(j(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))),E(f=>(n.navigate(["/logout"]),k(()=>f))),R(()=>M=null));let m=`Error Code: ${a.status}, Message: ${a.message}`;return k(()=>({error:a,message:m}))}))};var de="1.0.0",ce="portal-proxy-client",ue=1,A=class o{#o=1e3;#n=r(d);#t=l("disconnected");#i=l(this.#o);#a=l(!1);#r=l(!1);#p=l(null);isConnectedToMachineServer=this.#r.asReadonly();wsState=this.#t.asReadonly();#c=[];#s={};#e=null;#m=new TextDecoder("utf-8");#l=null;#d=J(()=>{let e=this.#a(),t=this.#i(),n=this.#p();if(!n||!e||!t||t<this.#o){this.#l&&window.clearInterval(this.#l);return}this.#l=window.setInterval(()=>{this.connectToMachineServer(n)},t)});utf8Atob(e){let t=Uint8Array.from(atob(e),c=>c.charCodeAt(0)),n=this.#m.decode(t);return n?JSON.parse(n):null}connectToMachineServer(e,t){let n=t?.reconnect??!1;this.#e&&this.wsState()==="authenticated"&&!n||(this.#e&&this.wsState()!=="authenticated"&&this.#e.close(),this.#e=new WebSocket(this.#n.machineServerUrl),this.#e.onopen=()=>{this.#t.set("connect"),this.#r.set(!0),this.#a.set(!1),this.#p.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#r.set(!1),this.#p.set(e),this.#a.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=c=>{let i=JSON.parse(c.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let s={token:e,publicKey:"",clientVersion:de,protocolVersion:ue},p=this.createResponse(i,"authportal",s);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#r.set(!0);this.#c.length>0;){let s=this.#c.pop();s&&this.#s[s.messageId]&&this.activateCommand(s)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let s=this.#s[i.messageId];if(s){if(i.errorMessage){s.reject(i.errorMessage);return}else{let p=JSON.parse(i.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),s.resolve(p)}delete this.#s[i.messageId],window.clearTimeout(s.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#r.set(!1)}createResponse(e,t,n){let c={from:ce,to:e.from,type:t,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(c)}sendCommand(e,t,n,c,i,u,s=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((p,h)=>{let a=crypto.randomUUID(),f={from:ce,to:t,type:"command",messageId:a,payload:JSON.stringify({method:n,path:c,body:i,headers:u})},v={resolve:p,reject:h,timer:window.setTimeout(()=>{let C=this.#s[a];C&&(delete this.#s[a],C.reject("Timeout"))},s)};this.#s[a]=v,this.#r()?this.activateCommand(f):this.#c.push(f)})}activateCommand(e){this.#e?.send(JSON.stringify(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=g({token:o,factory:o.\u0275fac,providedIn:"root"})};function he(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}var le=(o,e)=>{let n=r(b).config(),c=r(d);if(n===null)return e(o);let i=r(A),u=he(o.body),s={};o.headers.keys().forEach(m=>{s[m]=o.headers.get(m)??""});let p=o.headers.get("timeout"),h=p!==null?parseInt(p):c.defaultTimeout,a=i.sendCommand(n.accessToken,n.clientId,o.method,o.url,u,s,h);return new L(m=>{a.then(f=>{let v=new K;s!=null&&Object.keys(s).forEach(N=>{v.set(N,s[N])});let C=new $({body:f.body,status:f.code,statusText:"OK",headers:v});m.next(C),m.complete()})})};var me={providers:[D(),Y(ae,Z()),G(B(),z([le,pe])),y,{provide:d,useValue:ie},{provide:F,useValue:se()},ee]};q(I,me);