@duplicati/ngclient 0.0.159 → 0.0.161

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/assets/sh.woff2 +0 -0
  2. package/{chunk-F6ME3VE6.js → chunk-2KU5X7TN.js} +1 -1
  3. package/{chunk-XX3WLO55.js → chunk-2MIEBBFN.js} +1 -1
  4. package/{chunk-2WGW24ZH.js → chunk-2PUCHKOK.js} +1 -1
  5. package/{chunk-4NBLWONL.js → chunk-2YGOHGD2.js} +1 -1
  6. package/{chunk-XUIDYG2O.js → chunk-3S7YCGEK.js} +1 -1
  7. package/chunk-3V4DGTSM.js +1 -0
  8. package/{chunk-RZKDEJUP.js → chunk-4FWCJIJ4.js} +1 -1
  9. package/{chunk-NM7WJRU7.js → chunk-4KEA3KF7.js} +1 -1
  10. package/chunk-4NOWNXOS.js +1 -0
  11. package/{chunk-QNM5CG4Z.js → chunk-5CTM5KYC.js} +1 -1
  12. package/{chunk-XLDVUBTQ.js → chunk-5LX6M65H.js} +1 -1
  13. package/{chunk-GCCJSS4C.js → chunk-6XI3IP27.js} +1 -1
  14. package/{chunk-4IXUXIXV.js → chunk-A366Q7F5.js} +1 -1
  15. package/{chunk-2S6ABLBU.js → chunk-AUR4SBGD.js} +1 -1
  16. package/chunk-AVTEJPQ4.js +1 -0
  17. package/{chunk-PHQBBCUL.js → chunk-B32YSHV5.js} +1 -1
  18. package/{chunk-PULERFBI.js → chunk-BF2IYOUB.js} +1 -1
  19. package/{chunk-CCKT2GLS.js → chunk-BK2MSH26.js} +1 -1
  20. package/{chunk-72QJ345F.js → chunk-BZ2XGEV5.js} +1 -1
  21. package/{chunk-BQJICFF5.js → chunk-C7EUC34O.js} +1 -1
  22. package/{chunk-GOVVHVP2.js → chunk-CSL7HCLZ.js} +1 -1
  23. package/{chunk-SWD3HS57.js → chunk-CTAP3SAA.js} +1 -1
  24. package/{chunk-ZDME3W57.js → chunk-DJQOPNQJ.js} +1 -1
  25. package/{chunk-LSKF2B33.js → chunk-DUCPSWRQ.js} +1 -1
  26. package/{chunk-KAAYNQ7L.js → chunk-E6H2XELA.js} +1 -1
  27. package/chunk-EYFTFGJS.js +1 -0
  28. package/{chunk-D6KZSKI7.js → chunk-F5Z5ZAIL.js} +1 -1
  29. package/{chunk-C6F6FP4R.js → chunk-FSG362SU.js} +1 -1
  30. package/{chunk-D4F7SID5.js → chunk-G6VJHFTW.js} +1 -1
  31. package/{chunk-UST7PIBI.js → chunk-GMUNZKVL.js} +1 -1
  32. package/{chunk-MGTRQOF6.js → chunk-H44BDPZE.js} +1 -1
  33. package/{chunk-GYDI67IZ.js → chunk-H7ZKBS2Q.js} +1 -1
  34. package/{chunk-ZBVBVQO7.js → chunk-HHU5JW5J.js} +1 -1
  35. package/{chunk-4IIDZXFC.js → chunk-HJBNADRP.js} +1 -1
  36. package/{chunk-A5LNLNWR.js → chunk-HYQ6MPYI.js} +1 -1
  37. package/chunk-IUK3B6GX.js +1 -0
  38. package/{chunk-5WDKKAXO.js → chunk-K2BANUEJ.js} +1 -1
  39. package/{chunk-FNJU5CD3.js → chunk-KIIJBHZE.js} +1 -1
  40. package/{chunk-VXRNST6C.js → chunk-KXJZEADJ.js} +1 -1
  41. package/chunk-MBYGBVHF.js +1 -0
  42. package/{chunk-6YGURBW6.js → chunk-MHPSC3FM.js} +1 -1
  43. package/chunk-MTNOIKEK.js +1 -0
  44. package/chunk-MWXDEOZO.js +3 -0
  45. package/{chunk-U2Y2D6MA.js → chunk-NCDXMDW5.js} +1 -1
  46. package/{chunk-QX3IRESN.js → chunk-NSAY2K7E.js} +1 -1
  47. package/{chunk-PUNIQ3JW.js → chunk-NSPJ3ZXL.js} +1 -1
  48. package/{chunk-2QJVTZ56.js → chunk-OJ3H3ZRA.js} +1 -1
  49. package/chunk-P6IZFXXC.js +1 -0
  50. package/{chunk-2ZGJS4OW.js → chunk-PFZASYQH.js} +1 -1
  51. package/chunk-QF5WMLMJ.js +1 -0
  52. package/chunk-QWNOIRT4.js +1 -0
  53. package/{chunk-CHYEYO6L.js → chunk-R2FAS2C3.js} +1 -1
  54. package/chunk-RPUPXDQE.js +1 -0
  55. package/{chunk-7LYN2XHO.js → chunk-S4OFJD2F.js} +1 -1
  56. package/{chunk-7JHF4R5J.js → chunk-SPMSFKWG.js} +1 -1
  57. package/{chunk-EBANXXYI.js → chunk-SWAQMTBY.js} +1 -1
  58. package/{chunk-EMRD3UKA.js → chunk-TI6AQ6OL.js} +1 -1
  59. package/chunk-U562AGPC.js +1 -0
  60. package/chunk-U7GOWS7E.js +1 -0
  61. package/chunk-XJ7KXQWK.js +1 -0
  62. package/{chunk-KT7U3QIP.js → chunk-XXVFRNSP.js} +1 -1
  63. package/{chunk-3NFAL4U4.js → chunk-YCORZV4Z.js} +1 -1
  64. package/{chunk-ZMTLDG46.js → chunk-YPJRYB54.js} +1 -1
  65. package/{chunk-DW7A6PHZ.js → chunk-YYJFEUNT.js} +1 -1
  66. package/{chunk-KXM6LF3X.js → chunk-Z7WHLTVV.js} +1 -1
  67. package/index.html +2 -2
  68. package/main-L6FT73U5.js +1 -0
  69. package/package.json +1 -1
  70. package/styles-FD7LUDV4.css +1 -0
  71. package/chunk-33J6ZQYE.js +0 -1
  72. package/chunk-3OCWLJKG.js +0 -3
  73. package/chunk-72HORZFV.js +0 -1
  74. package/chunk-A2LUC3NC.js +0 -1
  75. package/chunk-DTOILX4E.js +0 -1
  76. package/chunk-GDQZEB3A.js +0 -1
  77. package/chunk-H3UUJ5EW.js +0 -1
  78. package/chunk-K3ILN56U.js +0 -1
  79. package/chunk-OKDVOGSM.js +0 -1
  80. package/chunk-PQSZLHZR.js +0 -1
  81. package/chunk-Q65KFDJ5.js +0 -1
  82. package/chunk-QF4DQYEP.js +0 -1
  83. package/chunk-RUXUFB7C.js +0 -1
  84. package/chunk-RWPF5SQT.js +0 -1
  85. package/chunk-W2CMPDWL.js +0 -1
  86. package/main-AK26L46R.js +0 -1
  87. package/styles-DYNNLJCR.css +0 -1
@@ -1 +1 @@
1
- import{a as We}from"./chunk-72HORZFV.js";import{a as Ve}from"./chunk-XLDVUBTQ.js";import{A as Re,B as Ie,G as te,I as Le,K as Ae,O as Be,V as ke,a as Oe,c as U,e as Y,i as Z,k as ye,s as ee,u as xe,y as we,z as De}from"./chunk-QF4DQYEP.js";import{h as $e}from"./chunk-2QJVTZ56.js";import{ea as Fe}from"./chunk-5ZSBXGHQ.js";import{$b as p,Ab as he,Ac as Me,B as pe,Bb as _e,Bc as Ne,Cb as O,Cc as Q,Db as c,Dc as ve,Eb as d,Fb as X,H as ne,Jc as Se,Lb as ie,Mb as L,Qc as D,Rc as R,Sa as h,Tb as ge,Ub as me,Vb as A,Vc as se,Wb as fe,Wc as C,Xb as Ce,Xc as le,Zb as x,_ as j,ac as q,bc as w,cb as J,ea as N,fa as v,gc as oe,hb as W,hc as Te,ic as re,jc as K,kc as y,n as ce,nc as b,oc as Ee,pa as P,pc as Pe,qc as be,r as H,sc as B,tc as k,ub as ue,uc as $,x as de,xb as S,yb as F}from"./chunk-QONLYWYC.js";import{a as G,b as z}from"./chunk-EUDKD2JW.js";var qe=["treeContainer"],Ke=["formRef"],Qe=[[["label"]],[["label"]],[["input"]]],Ue=["label","label","input"],Ye=o=>({children:o,level:0}),Ge=o=>({$implicit:o}),Ze=(o,t)=>({children:o,level:t}),et=()=>({maxWidth:"700px",width:"100%"}),tt=(o,t)=>t.id;function nt(o,t){if(o&1){let e=L();c(0,"sh-button-group")(1,"button",19),x("click",function(){N(e);let i=p();return v(i.pathDiscoveryMethod.set("browse"))}),A(2,4),d(),c(3,"button",19),x("click",function(){N(e);let i=p();return v(i.pathDiscoveryMethod.set("path"))}),A(4,5),d()()}if(o&2){let e=p();h(),y("active",e.pathDiscoveryMethod()==="browse"),h(2),y("active",e.pathDiscoveryMethod()==="path")}}function it(o,t){o&1&&X(0,"sh-progress-bar",12)}function ot(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-down"),d())}function rt(o,t){o&1&&X(0,"sh-icon",24)}function st(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-right"),d())}function lt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-open"),d())}function at(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-user"),d())}function ct(o,t){o&1&&(c(0,"sh-icon",22),b(1,"file"),d())}function dt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder"),d())}function pt(o,t){if(o&1&&(S(0,ot,2,0,"sh-icon",24)(1,rt,1,0,"sh-icon",24)(2,st,2,0,"sh-icon",24),S(3,lt,2,0,"sh-icon",22)(4,at,2,0,"sh-icon",22)(5,ct,2,0,"sh-icon",22)(6,dt,2,0,"sh-icon",22)),o&2){let e=p(2).$implicit;F(e.children.length?0:e.cls==="file"?1:2),h(3),F(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function ut(o,t){o&1&&(c(0,"sh-icon",22),b(1,"desktop-tower"),d())}function ht(o,t){o&1&&ie(0)}function _t(o,t){if(o&1&&W(0,ht,1,0,"ng-container",13),o&2){let e=p(2).$implicit,n=p().$implicit;p();let i=re(7);O("ngTemplateOutlet",i)("ngTemplateOutletContext",Q(5,Ge,ve(2,Ze,e.children,n.level+1)))}}function gt(o,t){if(o&1){let e=L();c(0,"div",20,3),x("click",function(){N(e);let i=p().$implicit,r=p(2);return v(r.toggleNode(i.id,i))}),c(2,"div",21),S(3,pt,7,2)(4,ut,2,0,"sh-icon",22),d(),c(5,"div",23),x("click",function(i){N(e);let r=p().$implicit,a=p(2);return v(a.toggleSelectedNode(i,r))}),b(6),d()(),S(7,_t,1,7,"ng-container")}if(o&2){let e=p().$implicit,n=p().$implicit,i=p();y("accepted",e.accepted===!0)("active",e.evalState===i.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",n.level===0),h(2),y("file",e.cls==="file"),h(),F(e.id!=="/"?3:4),h(3),Pe(" ",e.text," "),h(),F(e.children.length>0?7:-1)}}function mt(o,t){if(o&1&&S(0,gt,8,17),o&2){let e=t.$implicit,n=p(2);F(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function ft(o,t){if(o&1&&(c(0,"sh-list"),he(1,mt,1,1,null,null,tt),d()),o&2){let e=t.$implicit;K("padding-left",e.level*.25,"rem"),h(),_e(e.children)}}function Ct(o,t){o&1&&ie(0)}function Tt(o,t){if(o&1){let e=L();c(0,"sh-toggle",25),x("click",function(){N(e);let i=p();return v(i._showHiddenNodes.set(!i._showHiddenNodes()))}),A(1,6),d()}if(o&2){let e=p();y("active",e._showHiddenNodes()),h(),fe(e.showFiles()?"files":"folders"),Ce(1)}}function Et(o,t){if(o&1){let e=L();c(0,"button",26),x("click",function(){N(e);let i=p();return v(i.openCreateFolderDialog())}),A(1,7),d()}if(o&2){let e=p();O("disabled",!e.isCurrentPathFolder())}}function Pt(o,t){if(o&1){let e=L();c(0,"sh-dialog",27),$("isOpenChange",function(i){N(e);let r=p();return k(r.createFolderDialogOpen,i)||(r.createFolderDialogOpen=i),v(i)}),c(1,"header",28)(2,"h2"),A(3,8),d()(),c(4,"div",29)(5,"div"),b(6," Folder will be created under "),c(7,"pre"),b(8),d()(),c(9,"sh-form-field")(10,"textarea",30),$("ngModelChange",function(i){N(e);let r=p();return k(r.createFolderPath,i)||(r.createFolderPath=i),v(i)}),d()()(),c(11,"footer",31)(12,"button",32),x("click",function(){N(e);let i=p();return v(i.closeCreateFolderDialog(!1))}),b(13,"Cancel"),d(),c(14,"button",33),x("click",function(){N(e);let i=p();return v(i.closeCreateFolderDialog(!0))}),ge(15,9),X(16,"sh-icon"),me(),d()()()}if(o&2){let e,n=p();B("isOpen",n.createFolderDialogOpen),O("options",Ne(5,et)),h(8),Ee(n.currentPath()),h(2),B("ngModel",n.createFolderPath),h(4),O("disabled",!((e=n.createFolderPath())!=null&&e.length))}}var ze=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(ze||{}),M="/",ae=class o{#t=j($e);#i=j(Ve);#c=j(De);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);includes=se();excludes=se();_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=le("treeContainer");formRef=le("formRef");pathDiscoveryMethod=P("browse");isLoading=P(!1);currentPath=P("/");#o=P(null);treeSearchQuery=P("");treeNodes=P([]);isWindows=D(()=>this.#i.systemInfo()?.OSType==="Windows");pathDelimiter=D(()=>this.isWindows()?"\\":"/");filterGroups=this.#i.filterGroups();isByBackupSettings=D(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=D(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=ze;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),n=structuredClone(e);for(let l=0;l<n.length;l++){let f=n[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let _=f.slice(1,-1),g=this.filterGroups?.FilterGroups[_];if(g&&g.length){let T=g.map(E=>`-${E}`);n.splice(l,1,...T)}}}let i=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),m=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let u=this.#r(n,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:u,isIndeterminate:!1,cls:this.#e(l,m)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let u=new Map;if(!l.id)return;let f=l.id;a&&(l.accepted=!0),u.set(f,l);let _=r.length>0?i.filter(g=>g.parentPath.startsWith(f)):i;for(let g of _){if(!g.id)continue;let T=g.id;if(!g.cls||u.has(T))continue;let E=u.get(g.parentPath),V=g.hidden===!0&&t?0:this.#r(n,T,g.cls,E),I=z(G({},g),{isIndeterminate:this.isIndeterminate(n,T),evalState:V,children:[]});a&&(I.accepted=this.matchAccepts(a,I)),u.set(T,I),E&&E.children.push(I)}return l}),s});#d(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#r(t,e,n,i){if(i&&i.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),m=t.filter(u=>!u.startsWith("-")&&!u.startsWith("+")),s=t.filter(u=>u.startsWith("-")||u.startsWith("+")),l=this.multiSelect();if(m.length===0)return r;for(let u=0;u<m.length;u++){let f=m[u];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let u=0;u<s.length;u++){let f=s[u],_=f.slice(1),g=f.startsWith("-")?-1:1;if(this.#e(_,a)){if(n!=="folder")continue;if(e===_){r=g;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(n!=="folder")continue;let E=_.slice(1,-2);if(E==="")break;if(e?.includes(E+a)){r=g;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(n!=="file")continue;let E=_.slice(3,-7);if(new RegExp(E).test(e)){r=g;break}}if(_.startsWith("[")&&_.endsWith("]")){let E=_.slice(1,-1),V=this.translateCSharpRegex(E);if(new RegExp(`${V}`).test(e)){r=g;break}}if(_.startsWith("*.")){if(n!=="file"||_.replace("*.","").length===0)continue;if(this.#s(e,_,!0)){r=g;break}}if(_==="")continue;if(_===e){r=g;break}if(this.#s(e,_,!0)){r=g;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(i,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(n=>!n.startsWith("-")&&this.#e(n,this.pathDelimiter())).some(n=>n.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,n=!1){let i=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${i}${n?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let n=t.split(",");if(n.length===0)return!0;let i="."+e.id.slice(e.id.indexOf("."));return i?n.some(r=>i.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),n=this.initialNodes();e&&e.length>0?(n&&n.length>0&&this.treeNodes.set(n.map(i=>({id:i.id,leaf:i.leaf,cls:i.cls,text:i.text,iconCls:i.iconCls,fileSize:i.fileSize,resolvedpath:i.resolvedpath,parentPath:this.getParentPath(i.id??"")}))),this.#n(null,e[0])):this.#n(null,M)}}getParentPath(t){let e=this.pathDelimiter(),n=t.split(e);return n.length<=1?M:(n.pop(),n.length!==0&&n.pop(),n.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let i=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,m=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(i.includes(e.id))this.currentPath.set(i.filter(s=>s!==e.id&&!(m&&s.startsWith(a))).join("\0"));else if(i.some(s=>s==a))this.currentPath.set(i.filter(s=>s!==a).join("\0"));else{let s=m?i.filter(l=>!l.startsWith(e.id)):i;this.currentPath.set([...s,a].join("\0"))}else i.includes(e.id)?this.currentPath.set(i.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!==M&&this.#e(n,this.pathDelimiter())).some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(i=>!i.id?.startsWith(e.id)||i.id===e.id)):this.#n(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let n=this.currentPath(),i=this.#d(e),r=n+i;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#n(null,n),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let m=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=m?m[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#c.open(We,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#u(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#i.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(H(n=>n.Data??[]));{let n={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(n).pipe(H(i=>i.Files??[]))}}#a(t){return this.isByBackupSettings()?this.#h(t):this.#u(t)}#_(t){let e=this.pathDelimiter(),n=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,u)=>{let f=s.slice(0,u+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let m=a.map(s=>this.#a(s).pipe(H(l=>({status:"success",value:l,url:s})),pe(l=>ce({status:"error",value:l,url:s}))));de(m).pipe(ne(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),u=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let _=l.flatMap(T=>Array.isArray(T.value)?T.value.map(E=>z(G({},E),{parentPath:T.url})):[]),g=[...new Map([...f,..._].map(T=>[T.id,T])).values()];return this.#l(),this.hideShortcuts()?g.filter(T=>!T.id.startsWith("%")):g})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#n(t=null,e=M){let n=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ne(()=>this.isLoading.set(!1))).subscribe({next:i=>{let r=this.isByBackupSettings()?i.map(a=>({text:a.Path.split(n).filter(m=>m!=="").pop(),id:a.Path,cls:this.#e(a.Path,n)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):i;this.treeNodes.update(a=>{let m=r.map(l=>{let u=this.#e(l.id,n)?"folder":"file";return z(G({},l),{cls:u,parentPath:e})}),s=[...new Map([...a,...m].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&(oe(n.treeContainerRef,qe,5),oe(n.formRef,Ke,5)),e&2&&Te(2)},hostVars:2,hostBindings:function(e,n){e&2&&y("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:Ue,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let n;n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,i,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){if(e&1&&(q(Qe),S(0,nt,5,4,"sh-button-group"),c(1,"div",10),w(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,it,1,0,"sh-progress-bar",12),W(6,ft,3,2,"ng-template",null,1,Se)(8,Ct,1,0,"ng-container",13),d(),c(9,"div",14),S(10,Tt,2,3,"sh-toggle",15),S(11,Et,2,1,"button",16),d()(),c(12,"div",17,2)(14,"sh-form-field"),w(15,1,["ngProjectAs","label",5,["label"]]),w(16,2,["ngProjectAs","input",5,["input"]]),d()(),S(17,Pt,17,6,"sh-dialog",18)),e&2){let i=re(7);F(n.multiSelect()?-1:0),h(),y("hidden",n.pathDiscoveryMethod()!=="browse"),h(2),y("visualize-accepted",n.accepts()),h(2),F(n.isLoading()?5:-1),h(3),O("ngTemplateOutlet",i)("ngTemplateOutletContext",Q(15,Ge,Q(13,Ye,n.treeStructure()))),h(2),F(!n.accepts()&&!n.isByBackupSettings()?10:-1),h(),F(n.enableCreateFolder()?11:-1),h(),y("hidden",n.pathDiscoveryMethod()!=="path"),h(5),F(n.createFolderDialogOpen()?17:-1)}},dependencies:[Ie,Re,ke,xe,te,Le,Ae,we,Fe,ee,U,Y,Z],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};var bt=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Mt=["label","[prefix]","[suffix]"];function Nt(o,t){if(o&1&&b(0),o&2){let e=t.$implicit,n=p();be("",e.label,"",n.hasPerSecond()?"/s":"")}}var vt=["throttle-upload","throttle-download"],St=[{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Ft=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},He=class o{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(St);readonly=P(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&vt.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Ft(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Me([{provide:Oe,useExisting:o,multi:!0}])],ngContentSelectors:Mt,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,n){e&1&&(q(bt),c(0,"div",0),w(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(n.timespan,r)||(n.timespan=r),r}),d(),w(4,1),w(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(n.unit,r)||(n.unit=r),r}),d(),W(8,Nt,1,2,"ng-template"),d()),e&2&&(h(2),ue("readonly",n.readonly()||void 0),h(),O("id",n.customId()),B("ngModel",n.timespan),O("disabled",n.readonly()),h(3),K("--miw",0),O("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),h(),B("ngModel",n.unit))},dependencies:[Be,te,ee,U,ye,Y,Z],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};export{ae as a,St as b,Ft as c,He as d};
1
+ import{a as We}from"./chunk-3V4DGTSM.js";import{a as Ve}from"./chunk-5LX6M65H.js";import{A as Re,B as Ie,G as te,I as Le,K as Ae,O as Be,V as ke,a as Oe,c as U,e as Y,i as Z,k as ye,s as ee,u as xe,y as we,z as De}from"./chunk-RPUPXDQE.js";import{i as $e}from"./chunk-OJ3H3ZRA.js";import{ea as Fe}from"./chunk-5ZSBXGHQ.js";import{$b as p,Ab as he,Ac as Me,B as pe,Bb as _e,Bc as Ne,Cb as O,Cc as Q,Db as c,Dc as ve,Eb as d,Fb as X,H as ne,Jc as Se,Lb as ie,Mb as L,Qc as D,Rc as R,Sa as h,Tb as ge,Ub as me,Vb as A,Vc as se,Wb as fe,Wc as C,Xb as Ce,Xc as le,Zb as x,_ as j,ac as q,bc as w,cb as J,ea as N,fa as v,gc as oe,hb as W,hc as Te,ic as re,jc as K,kc as y,n as ce,nc as b,oc as Ee,pa as P,pc as Pe,qc as be,r as H,sc as B,tc as k,ub as ue,uc as $,x as de,xb as S,yb as F}from"./chunk-QONLYWYC.js";import{a as G,b as z}from"./chunk-EUDKD2JW.js";var qe=["treeContainer"],Ke=["formRef"],Qe=[[["label"]],[["label"]],[["input"]]],Ue=["label","label","input"],Ye=o=>({children:o,level:0}),Ge=o=>({$implicit:o}),Ze=(o,t)=>({children:o,level:t}),et=()=>({maxWidth:"700px",width:"100%"}),tt=(o,t)=>t.id;function nt(o,t){if(o&1){let e=L();c(0,"sh-button-group")(1,"button",19),x("click",function(){N(e);let i=p();return v(i.pathDiscoveryMethod.set("browse"))}),A(2,4),d(),c(3,"button",19),x("click",function(){N(e);let i=p();return v(i.pathDiscoveryMethod.set("path"))}),A(4,5),d()()}if(o&2){let e=p();h(),y("active",e.pathDiscoveryMethod()==="browse"),h(2),y("active",e.pathDiscoveryMethod()==="path")}}function it(o,t){o&1&&X(0,"sh-progress-bar",12)}function ot(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-down"),d())}function rt(o,t){o&1&&X(0,"sh-icon",24)}function st(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-right"),d())}function lt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-open"),d())}function at(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-user"),d())}function ct(o,t){o&1&&(c(0,"sh-icon",22),b(1,"file"),d())}function dt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder"),d())}function pt(o,t){if(o&1&&(S(0,ot,2,0,"sh-icon",24)(1,rt,1,0,"sh-icon",24)(2,st,2,0,"sh-icon",24),S(3,lt,2,0,"sh-icon",22)(4,at,2,0,"sh-icon",22)(5,ct,2,0,"sh-icon",22)(6,dt,2,0,"sh-icon",22)),o&2){let e=p(2).$implicit;F(e.children.length?0:e.cls==="file"?1:2),h(3),F(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function ut(o,t){o&1&&(c(0,"sh-icon",22),b(1,"desktop-tower"),d())}function ht(o,t){o&1&&ie(0)}function _t(o,t){if(o&1&&W(0,ht,1,0,"ng-container",13),o&2){let e=p(2).$implicit,n=p().$implicit;p();let i=re(7);O("ngTemplateOutlet",i)("ngTemplateOutletContext",Q(5,Ge,ve(2,Ze,e.children,n.level+1)))}}function gt(o,t){if(o&1){let e=L();c(0,"div",20,3),x("click",function(){N(e);let i=p().$implicit,r=p(2);return v(r.toggleNode(i.id,i))}),c(2,"div",21),S(3,pt,7,2)(4,ut,2,0,"sh-icon",22),d(),c(5,"div",23),x("click",function(i){N(e);let r=p().$implicit,a=p(2);return v(a.toggleSelectedNode(i,r))}),b(6),d()(),S(7,_t,1,7,"ng-container")}if(o&2){let e=p().$implicit,n=p().$implicit,i=p();y("accepted",e.accepted===!0)("active",e.evalState===i.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",n.level===0),h(2),y("file",e.cls==="file"),h(),F(e.id!=="/"?3:4),h(3),Pe(" ",e.text," "),h(),F(e.children.length>0?7:-1)}}function mt(o,t){if(o&1&&S(0,gt,8,17),o&2){let e=t.$implicit,n=p(2);F(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function ft(o,t){if(o&1&&(c(0,"sh-list"),he(1,mt,1,1,null,null,tt),d()),o&2){let e=t.$implicit;K("padding-left",e.level*.25,"rem"),h(),_e(e.children)}}function Ct(o,t){o&1&&ie(0)}function Tt(o,t){if(o&1){let e=L();c(0,"sh-toggle",25),x("click",function(){N(e);let i=p();return v(i._showHiddenNodes.set(!i._showHiddenNodes()))}),A(1,6),d()}if(o&2){let e=p();y("active",e._showHiddenNodes()),h(),fe(e.showFiles()?"files":"folders"),Ce(1)}}function Et(o,t){if(o&1){let e=L();c(0,"button",26),x("click",function(){N(e);let i=p();return v(i.openCreateFolderDialog())}),A(1,7),d()}if(o&2){let e=p();O("disabled",!e.isCurrentPathFolder())}}function Pt(o,t){if(o&1){let e=L();c(0,"sh-dialog",27),$("isOpenChange",function(i){N(e);let r=p();return k(r.createFolderDialogOpen,i)||(r.createFolderDialogOpen=i),v(i)}),c(1,"header",28)(2,"h2"),A(3,8),d()(),c(4,"div",29)(5,"div"),b(6," Folder will be created under "),c(7,"pre"),b(8),d()(),c(9,"sh-form-field")(10,"textarea",30),$("ngModelChange",function(i){N(e);let r=p();return k(r.createFolderPath,i)||(r.createFolderPath=i),v(i)}),d()()(),c(11,"footer",31)(12,"button",32),x("click",function(){N(e);let i=p();return v(i.closeCreateFolderDialog(!1))}),b(13,"Cancel"),d(),c(14,"button",33),x("click",function(){N(e);let i=p();return v(i.closeCreateFolderDialog(!0))}),ge(15,9),X(16,"sh-icon"),me(),d()()()}if(o&2){let e,n=p();B("isOpen",n.createFolderDialogOpen),O("options",Ne(5,et)),h(8),Ee(n.currentPath()),h(2),B("ngModel",n.createFolderPath),h(4),O("disabled",!((e=n.createFolderPath())!=null&&e.length))}}var ze=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(ze||{}),M="/",ae=class o{#t=j($e);#i=j(Ve);#c=j(De);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);includes=se();excludes=se();_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=le("treeContainer");formRef=le("formRef");pathDiscoveryMethod=P("browse");isLoading=P(!1);currentPath=P("/");#o=P(null);treeSearchQuery=P("");treeNodes=P([]);isWindows=D(()=>this.#i.systemInfo()?.OSType==="Windows");pathDelimiter=D(()=>this.isWindows()?"\\":"/");filterGroups=this.#i.filterGroups();isByBackupSettings=D(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=D(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=ze;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),n=structuredClone(e);for(let l=0;l<n.length;l++){let f=n[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let _=f.slice(1,-1),g=this.filterGroups?.FilterGroups[_];if(g&&g.length){let T=g.map(E=>`-${E}`);n.splice(l,1,...T)}}}let i=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),m=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let u=this.#r(n,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:u,isIndeterminate:!1,cls:this.#e(l,m)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let u=new Map;if(!l.id)return;let f=l.id;a&&(l.accepted=!0),u.set(f,l);let _=r.length>0?i.filter(g=>g.parentPath.startsWith(f)):i;for(let g of _){if(!g.id)continue;let T=g.id;if(!g.cls||u.has(T))continue;let E=u.get(g.parentPath),V=g.hidden===!0&&t?0:this.#r(n,T,g.cls,E),I=z(G({},g),{isIndeterminate:this.isIndeterminate(n,T),evalState:V,children:[]});a&&(I.accepted=this.matchAccepts(a,I)),u.set(T,I),E&&E.children.push(I)}return l}),s});#d(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#r(t,e,n,i){if(i&&i.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),m=t.filter(u=>!u.startsWith("-")&&!u.startsWith("+")),s=t.filter(u=>u.startsWith("-")||u.startsWith("+")),l=this.multiSelect();if(m.length===0)return r;for(let u=0;u<m.length;u++){let f=m[u];if(e===f){r=1;break}if(!l||!this.#e(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let u=0;u<s.length;u++){let f=s[u],_=f.slice(1),g=f.startsWith("-")?-1:1;if(this.#e(_,a)){if(n!=="folder")continue;if(e===_){r=g;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(n!=="folder")continue;let E=_.slice(1,-2);if(E==="")break;if(e?.includes(E+a)){r=g;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(n!=="file")continue;let E=_.slice(3,-7);if(new RegExp(E).test(e)){r=g;break}}if(_.startsWith("[")&&_.endsWith("]")){let E=_.slice(1,-1),V=this.translateCSharpRegex(E);if(new RegExp(`${V}`).test(e)){r=g;break}}if(_.startsWith("*.")){if(n!=="file"||_.replace("*.","").length===0)continue;if(this.#s(e,_,!0)){r=g;break}}if(_==="")continue;if(_===e){r=g;break}if(this.#s(e,_,!0)){r=g;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(i,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(n=>!n.startsWith("-")&&this.#e(n,this.pathDelimiter())).some(n=>n.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,n=!1){let i=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${i}${n?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let n=t.split(",");if(n.length===0)return!0;let i="."+e.id.slice(e.id.indexOf("."));return i?n.some(r=>i.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),n=this.initialNodes();e&&e.length>0?(n&&n.length>0&&this.treeNodes.set(n.map(i=>({id:i.id,leaf:i.leaf,cls:i.cls,text:i.text,iconCls:i.iconCls,fileSize:i.fileSize,resolvedpath:i.resolvedpath,parentPath:this.getParentPath(i.id??"")}))),this.#n(null,e[0])):this.#n(null,M)}}getParentPath(t){let e=this.pathDelimiter(),n=t.split(e);return n.length<=1?M:(n.pop(),n.length!==0&&n.pop(),n.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let i=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,m=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(i.includes(e.id))this.currentPath.set(i.filter(s=>s!==e.id&&!(m&&s.startsWith(a))).join("\0"));else if(i.some(s=>s==a))this.currentPath.set(i.filter(s=>s!==a).join("\0"));else{let s=m?i.filter(l=>!l.startsWith(e.id)):i;this.currentPath.set([...s,a].join("\0"))}else i.includes(e.id)?this.currentPath.set(i.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(n=>n!==""&&n!==M&&this.#e(n,this.pathDelimiter())).some(n=>t.id?.startsWith(n)||`-${t.id}`.startsWith(n))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(n=>n.filter(i=>!i.id?.startsWith(e.id)||i.id===e.id)):this.#n(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let n=this.currentPath(),i=this.#d(e),r=n+i;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#n(null,n),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let m=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=m?m[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#c.open(We,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#p(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#u(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#i.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(H(n=>n.Data??[]));{let n={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(n).pipe(H(i=>i.Files??[]))}}#a(t){return this.isByBackupSettings()?this.#h(t):this.#u(t)}#_(t){let e=this.pathDelimiter(),n=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,u)=>{let f=s.slice(0,u+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let m=a.map(s=>this.#a(s).pipe(H(l=>({status:"success",value:l,url:s})),pe(l=>ce({status:"error",value:l,url:s}))));de(m).pipe(ne(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),u=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let _=l.flatMap(T=>Array.isArray(T.value)?T.value.map(E=>z(G({},E),{parentPath:T.url})):[]),g=[...new Map([...f,..._].map(T=>[T.id,T])).values()];return this.#l(),this.hideShortcuts()?g.filter(T=>!T.id.startsWith("%")):g})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#n(t=null,e=M){let n=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ne(()=>this.isLoading.set(!1))).subscribe({next:i=>{let r=this.isByBackupSettings()?i.map(a=>({text:a.Path.split(n).filter(m=>m!=="").pop(),id:a.Path,cls:this.#e(a.Path,n)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):i;this.treeNodes.update(a=>{let m=r.map(l=>{let u=this.#e(l.id,n)?"folder":"file";return z(G({},l),{cls:u,parentPath:e})}),s=[...new Map([...a,...m].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&(oe(n.treeContainerRef,qe,5),oe(n.formRef,Ke,5)),e&2&&Te(2)},hostVars:2,hostBindings:function(e,n){e&2&&y("disabled",n.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:Ue,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let n;n=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,n,i,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){if(e&1&&(q(Qe),S(0,nt,5,4,"sh-button-group"),c(1,"div",10),w(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,it,1,0,"sh-progress-bar",12),W(6,ft,3,2,"ng-template",null,1,Se)(8,Ct,1,0,"ng-container",13),d(),c(9,"div",14),S(10,Tt,2,3,"sh-toggle",15),S(11,Et,2,1,"button",16),d()(),c(12,"div",17,2)(14,"sh-form-field"),w(15,1,["ngProjectAs","label",5,["label"]]),w(16,2,["ngProjectAs","input",5,["input"]]),d()(),S(17,Pt,17,6,"sh-dialog",18)),e&2){let i=re(7);F(n.multiSelect()?-1:0),h(),y("hidden",n.pathDiscoveryMethod()!=="browse"),h(2),y("visualize-accepted",n.accepts()),h(2),F(n.isLoading()?5:-1),h(3),O("ngTemplateOutlet",i)("ngTemplateOutletContext",Q(15,Ge,Q(13,Ye,n.treeStructure()))),h(2),F(!n.accepts()&&!n.isByBackupSettings()?10:-1),h(),F(n.enableCreateFolder()?11:-1),h(),y("hidden",n.pathDiscoveryMethod()!=="path"),h(5),F(n.createFolderDialogOpen()?17:-1)}},dependencies:[Ie,Re,ke,xe,te,Le,Ae,we,Fe,ee,U,Y,Z],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};var bt=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Mt=["label","[prefix]","[suffix]"];function Nt(o,t){if(o&1&&b(0),o&2){let e=t.$implicit,n=p();be("",e.label,"",n.hasPerSecond()?"/s":"")}}var vt=["throttle-upload","throttle-download"],St=[{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Ft=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},He=class o{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(St);readonly=P(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&vt.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Ft(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Me([{provide:Oe,useExisting:o,multi:!0}])],ngContentSelectors:Mt,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,n){e&1&&(q(bt),c(0,"div",0),w(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(n.timespan,r)||(n.timespan=r),r}),d(),w(4,1),w(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(n.unit,r)||(n.unit=r),r}),d(),W(8,Nt,1,2,"ng-template"),d()),e&2&&(h(2),ue("readonly",n.readonly()||void 0),h(),O("id",n.customId()),B("ngModel",n.timespan),O("disabled",n.readonly()),h(3),K("--miw",0),O("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),h(),B("ngModel",n.unit))},dependencies:[Be,te,ee,U,ye,Y,Z],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};export{ae as a,St as b,Ft as c,He as d};
@@ -0,0 +1 @@
1
+ import{e as a,f as b}from"./chunk-F5Z5ZAIL.js";import"./chunk-E6H2XELA.js";import"./chunk-HHU5JW5J.js";import"./chunk-FSG362SU.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-Z27IQRKV.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-6XI3IP27.js";import"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";export{a as createRestoreSelectFilesForm,b as default};
@@ -1,2 +1,2 @@
1
- import{B as U,S as z,u as w}from"./chunk-QF4DQYEP.js";import{h as J}from"./chunk-2QJVTZ56.js";import{la as y}from"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as g,Ab as C,Bb as f,Cb as L,Db as i,Eb as a,Fb as h,Fc as x,H as F,Hc as A,Mb as M,Rc as k,Sa as _,Tb as $,Ub as B,Vb as r,Zb as N,_ as G,cb as b,ea as S,fa as u,jc as I,kc as v,nc as d,oc as m,pa as l,xb as O,yb as T,zb as E}from"./chunk-QONLYWYC.js";import{a as P,b as D}from"./chunk-EUDKD2JW.js";function X(o,e){if(o&1&&(i(0,"li"),d(1),a()),o&2){let t=e.$implicit;_(),m(t)}}function V(o,e){if(o&1&&(i(0,"tr")(1,"td",12)(2,"code")(3,"ol",13),C(4,X,2,1,"li",null,E),a()()()()),o&2){let t=g().$implicit,n=g();_(),I("grid-column","1 / -1")("height","auto"),_(3),f(n.breakIntoLines(t.Exception))}}function j(o,e){if(o&1){let t=M();i(0,"tr",9),N("click",function(){let s=S(t).$index,c=g();return u(c.toggleRow(s))}),i(1,"td"),d(2),x(3,"date"),a(),i(4,"td",10),d(5),a(),i(6,"td"),d(7),a(),i(8,"td")(9,"button",11)(10,"sh-icon"),d(11,"caret-down"),a()()()(),O(12,V,6,4,"tr")}if(o&2){let t=e.$implicit,n=e.$index,s=g();_(2),m(t.Timestamp?A(3,6,t.Timestamp*1e3,"medium"):"-"),_(3),m(t.BackupID>=0?t.BackupID:"-"),_(2),m(t.Message),_(2),v("rotated-icon",n===s.openRowIndex()),_(3),T(n===s.openRowIndex()?12:-1)}}function K(o,e){o&1&&r(0,4,1)}function q(o,e){o&1&&r(0,4,2)}var H=["BackupID","Timestamp","Message","actions"],R=class o{#e=G(J);displayedColumns=l(H);openRowIndex=l(null);noMoreItems=l(!1);logsIsLoading=l(!1);logs=l([]);pagination=l({offsetTime:void 0,pagesize:10});paginationEffect=k(()=>{let e=this.pagination();this.getLogs()});ngOnInit(){this.getLogs()}getLogs(){this.logsIsLoading.set(!0);let e=this.pagination();this.#e.getApiV1LogdataLog({pagesize:e.pagesize,offset:e.offsetTime}).pipe(F(()=>this.logsIsLoading.set(!1))).subscribe({next:t=>{t.length===0&&this.noMoreItems.set(!0),this.logs.update(n=>[...n,...t])}})}toggleRow(e){this.openRowIndex.set(e===this.openRowIndex()?null:e)}breakIntoLines(e){return e?e.split(`
1
+ import{B as U,S as z,u as w}from"./chunk-RPUPXDQE.js";import{i as J}from"./chunk-OJ3H3ZRA.js";import{la as y}from"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as g,Ab as C,Bb as f,Cb as L,Db as i,Eb as a,Fb as h,Fc as x,H as F,Hc as A,Mb as M,Rc as k,Sa as _,Tb as $,Ub as B,Vb as r,Zb as N,_ as G,cb as b,ea as S,fa as u,jc as I,kc as v,nc as d,oc as m,pa as l,xb as O,yb as T,zb as E}from"./chunk-QONLYWYC.js";import{a as P,b as D}from"./chunk-EUDKD2JW.js";function X(o,e){if(o&1&&(i(0,"li"),d(1),a()),o&2){let t=e.$implicit;_(),m(t)}}function V(o,e){if(o&1&&(i(0,"tr")(1,"td",12)(2,"code")(3,"ol",13),C(4,X,2,1,"li",null,E),a()()()()),o&2){let t=g().$implicit,n=g();_(),I("grid-column","1 / -1")("height","auto"),_(3),f(n.breakIntoLines(t.Exception))}}function j(o,e){if(o&1){let t=M();i(0,"tr",9),N("click",function(){let s=S(t).$index,c=g();return u(c.toggleRow(s))}),i(1,"td"),d(2),x(3,"date"),a(),i(4,"td",10),d(5),a(),i(6,"td"),d(7),a(),i(8,"td")(9,"button",11)(10,"sh-icon"),d(11,"caret-down"),a()()()(),O(12,V,6,4,"tr")}if(o&2){let t=e.$implicit,n=e.$index,s=g();_(2),m(t.Timestamp?A(3,6,t.Timestamp*1e3,"medium"):"-"),_(3),m(t.BackupID>=0?t.BackupID:"-"),_(2),m(t.Message),_(2),v("rotated-icon",n===s.openRowIndex()),_(3),T(n===s.openRowIndex()?12:-1)}}function K(o,e){o&1&&r(0,4,1)}function q(o,e){o&1&&r(0,4,2)}var H=["BackupID","Timestamp","Message","actions"],R=class o{#e=G(J);displayedColumns=l(H);openRowIndex=l(null);noMoreItems=l(!1);logsIsLoading=l(!1);logs=l([]);pagination=l({offsetTime:void 0,pagesize:10});paginationEffect=k(()=>{let e=this.pagination();this.getLogs()});ngOnInit(){this.getLogs()}getLogs(){this.logsIsLoading.set(!0);let e=this.pagination();this.#e.getApiV1LogdataLog({pagesize:e.pagesize,offset:e.offsetTime}).pipe(F(()=>this.logsIsLoading.set(!1))).subscribe({next:t=>{t.length===0&&this.noMoreItems.set(!0),this.logs.update(n=>[...n,...t])}})}toggleRow(e){this.openRowIndex.set(e===this.openRowIndex()?null:e)}breakIntoLines(e){return e?e.split(`
2
2
  `):[]}loadMore(){let e=this.logs().at(-1)?.Timestamp;this.pagination.update(t=>D(P({},t),{offsetTime:e}))}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=b({type:o,selectors:[["app-logs-stored"]],decls:18,vars:6,consts:()=>{let e;e=$localize`Timestamp`;let t;t=$localize`Backup ID`;let n;n=$localize`Message`;let s;s=$localize`No data available`;let c;return c=$localize`${"\uFFFD*16:1\uFFFD"}:START_BLOCK_IF: No more items ${"\uFFFD/*16:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*17:2\uFFFD"}:START_BLOCK_ELSE: Load more ${"\uFFFD/*17:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,[e,t,n,s,c,[1,"type-b",3,"data","loading"],["table-header",""],["table-no-rows",""],["shButton","",1,"primary","raised",3,"click","disabled"],[3,"click"],[1,"id"],["shButton","","type","button",1,"outlined","small"],[2,"white-space","pre-wrap"],[1,"line-numbers-ol"]]},template:function(t,n){if(t&1){let s=M();i(0,"sh-table",5)(1,"tr",6)(2,"th"),r(3,0),a(),i(4,"th"),r(5,1),a(),i(6,"th"),r(7,2),a(),h(8,"th"),a(),C(9,j,13,9,null,null,E),i(11,"div",7),r(12,3),a()(),i(13,"footer")(14,"button",8),N("click",function(){return S(s),u(n.loadMore())}),$(15,4),O(16,K,1,0)(17,q,1,0),B(),a()()}if(t&2){let s=n.logs();I("grid-template-columns","1fr 1fr 1fr auto"),L("data",s)("loading",n.logsIsLoading()),_(9),f(s),_(5),L("disabled",n.logsIsLoading()||n.noMoreItems()),_(2),T(n.noMoreItems()?16:17)}},dependencies:[z,w,U,y],styles:["[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30);margin:0 0 1.25rem}sh-table[_ngcontent-%COMP%]{--table-columns: auto auto 1fr auto}sh-table[_ngcontent-%COMP%] td.id[_ngcontent-%COMP%]{justify-content:center}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code){padding:1rem .75rem;overflow:hidden}sh-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]:has(code) code[_ngcontent-%COMP%]{background:color-mix(in srgb,var(--base-8),#000 70%);color:#fff;padding:2.5rem 2.5rem 2.5rem 1.5rem;border-radius:var(--shape-3);overflow:auto;white-space:pre}footer[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;padding:2rem 0 0}"],changeDetection:0})};export{R as default};
@@ -1 +1 @@
1
- import{a as z}from"./chunk-VXRNST6C.js";import"./chunk-GYDI67IZ.js";import{a as X}from"./chunk-4NBLWONL.js";import"./chunk-CCKT2GLS.js";import"./chunk-72HORZFV.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import"./chunk-LN26XMBJ.js";import"./chunk-7LYN2XHO.js";import"./chunk-GCCJSS4C.js";import{e as E}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as g,C,F as v,K as w,u as S}from"./chunk-QF4DQYEP.js";import{h as J}from"./chunk-2QJVTZ56.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as m,Ab as x,Bb as I,Bc as u,Cb as p,Cc as G,Db as e,Eb as i,Fb as a,Jb as L,Kb as $,Sa as s,Tb as b,Ub as D,Vb as c,Wb as y,Xb as A,_ as d,cb as O,ib as N,nc as r,qc as B,sb as h,tb as P,xb as M,yb as F,zb as k}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var j=()=>[C,g,S,E],W=()=>["/restore-from-files"],H=()=>["/restore/from-config"],q=n=>["/restore",n];function V(n,o){if(n&1&&(e(0,"sh-card",5),a(1,"img",10),e(2,"div",7)(3,"h3"),c(4,1),i(),e(5,"p"),r(6),i()(),e(7,"button",8),b(8,2),a(9,"sh-icon"),D(),i()()),n&2){let t=o.$implicit;p("routerLink",G(4,q,t.Backup.ID)),s(4),y(t.Backup.Name??"Backup name missing"),A(4),s(2),B(" ",(t.Backup.Metadata==null?null:t.Backup.Metadata.SourceSizeString)??"-"," / ",(t.Backup.Metadata==null?null:t.Backup.Metadata.BackupListCount)??"-"," ")}}function K(n,o){if(n&1&&x(0,V,10,6,"sh-card",5,k),n&2){let t=m(2);I(t.backups())}}function Q(n,o){n&1&&(L(0),c(1,3),$())}function U(n,o){if(n&1&&M(0,K,2,0)(1,Q,2,0,"ng-container"),n&2){let t=m();F(t.backups().length?0:1)}}function Y(n,o){n&1&&(e(0,"div",11),a(1,"sh-progress-bar",12),e(2,"div",7)(3,"h3"),c(4,4),i()()())}var T=class n{#e=d(X);#t=d(J);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["app-restore"]],decls:32,vars:5,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let _;_=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let R;R=$localize`No backups founds`;let f;return f=$localize`Loading backups...`,[o,t,_,R,f,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["shButton",""],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(t,_){t&1&&(a(0,"app-status-bar"),e(1,"section")(2,"h2"),c(3,0),i(),e(4,"sh-card",5),a(5,"img",6),e(6,"div",7)(7,"h3"),r(8,"Direct restore from backup files"),i(),e(9,"p"),r(10,"Point to your backup files and restore from there."),i()(),e(11,"button",8),r(12," Start "),e(13,"sh-icon"),r(14,"play-circle"),i()()(),e(15,"sh-card",5),a(16,"img",9),e(17,"div",7)(18,"h3"),r(19,"Restore from configuration"),i(),e(20,"p"),r(21,"Load destination from an exported job"),i()(),e(22,"button",8),r(23," Start "),e(24,"sh-icon"),r(25,"play-circle"),i()()(),e(26,"sh-divider"),r(27,"Or existing"),i(),N(28,U,2,1)(29,Y,5,0),h(30,28,j,null,29),i()),t&2&&(s(4),p("routerLink",u(3,W)),s(11),p("routerLink",u(4,H)),s(15),P(!_.backupsLoading()))},dependencies:[z,C,g,v,S,w,E],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 1rem;display:flex;flex-direction:column;gap:1rem}sh-divider[_ngcontent-%COMP%]{color:var(--base-8)}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{T as default};
1
+ import{a as z}from"./chunk-KXJZEADJ.js";import"./chunk-H7ZKBS2Q.js";import{a as X}from"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{e as E}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as g,C,F as v,K as w,u as S}from"./chunk-RPUPXDQE.js";import{i as J}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as m,Ab as x,Bb as I,Bc as u,Cb as p,Cc as G,Db as e,Eb as i,Fb as a,Jb as L,Kb as $,Sa as s,Tb as b,Ub as D,Vb as c,Wb as y,Xb as A,_ as d,cb as O,ib as N,nc as r,qc as B,sb as h,tb as P,xb as M,yb as F,zb as k}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var j=()=>[C,g,S,E],W=()=>["/restore-from-files"],H=()=>["/restore/from-config"],q=n=>["/restore",n];function V(n,o){if(n&1&&(e(0,"sh-card",5),a(1,"img",10),e(2,"div",7)(3,"h3"),c(4,1),i(),e(5,"p"),r(6),i()(),e(7,"button",8),b(8,2),a(9,"sh-icon"),D(),i()()),n&2){let t=o.$implicit;p("routerLink",G(4,q,t.Backup.ID)),s(4),y(t.Backup.Name??"Backup name missing"),A(4),s(2),B(" ",(t.Backup.Metadata==null?null:t.Backup.Metadata.SourceSizeString)??"-"," / ",(t.Backup.Metadata==null?null:t.Backup.Metadata.BackupListCount)??"-"," ")}}function K(n,o){if(n&1&&x(0,V,10,6,"sh-card",5,k),n&2){let t=m(2);I(t.backups())}}function Q(n,o){n&1&&(L(0),c(1,3),$())}function U(n,o){if(n&1&&M(0,K,2,0)(1,Q,2,0,"ng-container"),n&2){let t=m();F(t.backups().length?0:1)}}function Y(n,o){n&1&&(e(0,"div",11),a(1,"sh-progress-bar",12),e(2,"div",7)(3,"h3"),c(4,4),i()()())}var T=class n{#e=d(X);#t=d(J);backups=this.#e.backups;backupsLoading=this.#e.backupsLoading;ngOnInit(){this.#e.getBackups(!0)}restoreNow(o){this.#t.postApiV1BackupByIdRestore({id:o.Backup?.ID,requestBody:{}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["app-restore"]],decls:32,vars:5,consts:()=>{let o;o=$localize`Where do you want to restore from?`;let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let _;_=$localize` Restore ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let R;R=$localize`No backups founds`;let f;return f=$localize`Loading backups...`,[o,t,_,R,f,[1,"type-a","actionable",3,"routerLink"],["src","assets/images/backup.png","alt","","width","48px"],[1,"text"],["shButton",""],["src","assets/images/restore.png","alt","","width","48px"],["src","assets/images/folder.png","alt","","width","48px"],[1,"loading-list"],[1,"indeterminate","primary"]]},template:function(t,_){t&1&&(a(0,"app-status-bar"),e(1,"section")(2,"h2"),c(3,0),i(),e(4,"sh-card",5),a(5,"img",6),e(6,"div",7)(7,"h3"),r(8,"Direct restore from backup files"),i(),e(9,"p"),r(10,"Point to your backup files and restore from there."),i()(),e(11,"button",8),r(12," Start "),e(13,"sh-icon"),r(14,"play-circle"),i()()(),e(15,"sh-card",5),a(16,"img",9),e(17,"div",7)(18,"h3"),r(19,"Restore from configuration"),i(),e(20,"p"),r(21,"Load destination from an exported job"),i()(),e(22,"button",8),r(23," Start "),e(24,"sh-icon"),r(25,"play-circle"),i()()(),e(26,"sh-divider"),r(27,"Or existing"),i(),N(28,U,2,1)(29,Y,5,0),h(30,28,j,null,29),i()),t&2&&(s(4),p("routerLink",u(3,W)),s(11),p("routerLink",u(4,H)),s(15),P(!_.backupsLoading()))},dependencies:[z,C,g,v,S,w,E],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 1rem;display:flex;flex-direction:column;gap:1rem}sh-divider[_ngcontent-%COMP%]{color:var(--base-8)}sh-card[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;--card-padding: 2rem}sh-card[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:.25rem}.actionable[_ngcontent-%COMP%]{cursor:pointer}.actionable[_ngcontent-%COMP%]:after{transition:inset .1s linear}.actionable[_ngcontent-%COMP%]:hover{--card-shp: 0}"],changeDetection:0})};export{T as default};
@@ -1 +1 @@
1
- import{a as Pe}from"./chunk-GYDI67IZ.js";import{a as Ne}from"./chunk-4NBLWONL.js";import{a as Oe}from"./chunk-CCKT2GLS.js";import{a as Ee}from"./chunk-XLDVUBTQ.js";import{b as oe}from"./chunk-GCCJSS4C.js";import{B as Te,D as pe,G as ce,K as de,L as me,N as ge,O as Ce,c as ae,e as se,i as le,k as _e,s as x,u as re,w as ue,z as Se}from"./chunk-QF4DQYEP.js";import{h as P}from"./chunk-2QJVTZ56.js";import{a as fe}from"./chunk-I2LW33GO.js";import{la as ie}from"./chunk-5ZSBXGHQ.js";import{$b as d,Ab as Z,Bb as q,Cb as R,Db as s,Eb as l,Fb as C,Fc as H,Gc as te,H as U,Hc as ne,Mb as D,Qc as G,Sa as _,Tb as E,Ub as O,Vb as S,Vc as k,Yb as Q,Zb as T,_ as c,cb as N,ea as h,fa as M,jc as ee,kc as m,nc as g,pa as p,pc as v,qc as z,sc as b,tc as B,uc as L,xb as I,yb as F,zb as Y}from"./chunk-QONLYWYC.js";function De(a,n){if(a&1){let i=D();s(0,"sh-radio",10),T("click",function(){let t=h(i).$implicit,o=d();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=d();m("active",e.pauseOption()===i.value),_(),v(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=c(P);pauseOptions=p(be);closed=k();isSubmitting=p(!1);pauseTransfers=p(!1);pauseOption=p(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),S(2,0),l()(),s(3,"div",6)(4,"div",7),Z(5,De,2,3,"sh-radio",8,Y),l(),s(7,"div",9)(8,"sh-checkbox",10),T("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),S(9,1),l(),s(10,"sh-alert",11),S(11,2),l()()(),s(12,"footer",12)(13,"button",13),T("click",function(){return e.closed.emit()}),S(14,3),l(),s(15,"button",14),T("click",function(){return e.submit()}),S(16,4),l()()),i&2&&(_(5),q(e.pauseOptions()),_(3),m("active",e.pauseTransfers()),_(7),m("loader",e.isSubmitting()))},dependencies:[x,me,pe,ue],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Ie=8,V=1024,w=V*1024,W=w*1024,K=W*1024,Fe=K*1024,Le={B:1,KB:V,MB:w,GB:W,TB:K,PB:Fe},Ge=1e3,X=Ge*1e3,J=X*1e3,ye=[{threshold:Fe,unitPrefix:"PByte"},{threshold:K,unitPrefix:"TByte"},{threshold:W,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:V,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],y=class a{#e=c(P);closed=k();isSubmitting=p(!1);sizeOptions=p([...Be]);maxUpload=p(0);maxDownload=p(0);maxUploadUnit=p("mbps");maxDownloadUnit=p("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(Le[i.toUpperCase()]||w)*Ie;return t===0?{value:0,unit:"mbps"}:t>=J?{value:parseFloat((t/J).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/X).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*J;break;case"mbps":e=n*X;break}let t=e/Ie;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:r}of ye)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:r};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,r=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(e,t),A=Me[f];A?n=`${u}${A}`:console.error(`Invalid unit prefix for API submission (upload): ${f}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(o,r),A=Me[f];A?i=`${u}${A}`:console.error(`Invalid unit prefix for API submission (download): ${f}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let r;return r=$localize` Update settings `,[n,i,e,t,o,r,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),S(2,0),l(),s(3,"p"),S(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),S(9,2),l(),s(10,"sh-form-field")(11,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),L("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),S(16,3),l(),s(17,"sh-form-field")(18,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),L("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),T("click",function(){return e.closed.emit(!1)}),S(23,4),l(),s(24,"button",14),T("click",function(){return e.submit()}),S(25,5),l()()),i&2&&(_(11),b("ngModel",e.maxUpload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxUploadUnit),_(5),b("ngModel",e.maxDownload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxDownloadUnit),_(4),m("loader",e.isSubmitting()))},dependencies:[x,ae,_e,se,le,ce,Ce],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ue(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=d();_(),z("",i.statusData().actionText," - ",i.statusData().statusText),_(),R("value",i.statusData().progress*100)}}function ve(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=d();_(),v(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),_(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function ke(a,n){a&1&&(s(0,"div",7),S(1,1),l())}function xe(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(_(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&I(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=d();F(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Je(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Re=new Date,j=class a{#e=c(P);#t=c(Pe);#n=c(Se);#a=c(Ne);#s=c(oe);#l=c(Ee);#i=c(Oe);minsAgo=Re.setMinutes(Re.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=G(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=G(()=>this.runningTask()==this.#o());#o=p(-1);pgState=G(()=>this.#i.serverState());nextBackup=G(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(y,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),I(2,Ue,3,3)(3,ve,7,8,"div",7)(4,ke,2,0,"div",7)(5,xe,3,4,"div",8),l(),s(6,"div",9),I(7,ze,2,1),s(8,"button",10),T("click",function(){return e.pauseResume()}),E(9,0),I(10,He,2,0)(11,Je,2,0),O(),l(),s(12,"button",10),T("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;_(2),F((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),_(5),F(e.runningTask()?7:-1),_(),m("loader",e.isResuming()),_(2),F(e.clientIsRunning()?10:11)}},dependencies:[de,re,Te,ge,fe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
1
+ import{a as Pe}from"./chunk-H7ZKBS2Q.js";import{a as Ne}from"./chunk-2YGOHGD2.js";import{a as Oe}from"./chunk-BK2MSH26.js";import{a as Ee}from"./chunk-5LX6M65H.js";import{b as oe}from"./chunk-6XI3IP27.js";import{B as Te,D as pe,G as ce,K as de,L as me,N as ge,O as Ce,c as ae,e as se,i as le,k as _e,s as x,u as re,w as ue,z as Se}from"./chunk-RPUPXDQE.js";import{i as P}from"./chunk-OJ3H3ZRA.js";import{a as fe}from"./chunk-I2LW33GO.js";import{la as ie}from"./chunk-5ZSBXGHQ.js";import{$b as d,Ab as Z,Bb as q,Cb as R,Db as s,Eb as l,Fb as C,Fc as H,Gc as te,H as U,Hc as ne,Mb as D,Qc as G,Sa as _,Tb as E,Ub as O,Vb as S,Vc as k,Yb as Q,Zb as T,_ as c,cb as N,ea as h,fa as M,jc as ee,kc as m,nc as g,pa as p,pc as v,qc as z,sc as b,tc as B,uc as L,xb as I,yb as F,zb as Y}from"./chunk-QONLYWYC.js";function De(a,n){if(a&1){let i=D();s(0,"sh-radio",10),T("click",function(){let t=h(i).$implicit,o=d();return M(o.pauseOption.set(t.value))}),g(1),l()}if(a&2){let i=n.$implicit,e=d();m("active",e.pauseOption()===i.value),_(),v(" ",i.label," ")}}var be=[{label:$localize`5 minutes`,value:"5m"},{label:$localize`10 minutes`,value:"10m"},{label:$localize`15 minutes`,value:"15m"},{label:$localize`30 minutes`,value:"30m"},{label:$localize`1 hour`,value:"1h"},{label:$localize`4 hours`,value:"4h"},{label:$localize`8 hours`,value:"8h"},{label:$localize`24 hours`,value:"24h"},{label:$localize`Until resumed`,value:void 0}],$=class a{#e=c(P);pauseOptions=p(be);closed=k();isSubmitting=p(!1);pauseTransfers=p(!1);pauseOption=p(void 0);submit(){this.isSubmitting.set(!0);let n=this.pauseTransfers()||null,i=this.pauseOption();this.#e.postApiV1ServerstatePause({duration:i,pauseTransfers:n}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:e=>{this.closed.emit()}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-pause-dialog"]],outputs:{closed:"closed"},decls:17,vars:4,consts:()=>{let n;n=$localize`Pause settings`;let i;i=$localize` Also pause transfers `;let e;e=$localize`If you pause transfers they could time out and cause retries or failures.`;let t;t=$localize`Cancel`;let o;return o=$localize` Update settings `,[n,i,e,t,o,["header",""],["content",""],[1,"radios"],[1,"primary","raised",3,"active"],[1,"check-wrap"],[1,"primary","raised",3,"click"],["type","warning"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header",5)(1,"h3"),S(2,0),l()(),s(3,"div",6)(4,"div",7),Z(5,De,2,3,"sh-radio",8,Y),l(),s(7,"div",9)(8,"sh-checkbox",10),T("click",function(){return e.pauseTransfers.set(!e.pauseTransfers())}),S(9,1),l(),s(10,"sh-alert",11),S(11,2),l()()(),s(12,"footer",12)(13,"button",13),T("click",function(){return e.closed.emit()}),S(14,3),l(),s(15,"button",14),T("click",function(){return e.submit()}),S(16,4),l()()),i&2&&(_(5),q(e.pauseOptions()),_(3),m("active",e.pauseTransfers()),_(7),m("loader",e.isSubmitting()))},dependencies:[x,me,pe,ue],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}.radios[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.check-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:2rem 0 0}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},Be=["mbps","gbps"],Ie=8,V=1024,w=V*1024,W=w*1024,K=W*1024,Fe=K*1024,Le={B:1,KB:V,MB:w,GB:W,TB:K,PB:Fe},Ge=1e3,X=Ge*1e3,J=X*1e3,ye=[{threshold:Fe,unitPrefix:"PByte"},{threshold:K,unitPrefix:"TByte"},{threshold:W,unitPrefix:"GByte"},{threshold:w,unitPrefix:"MByte"},{threshold:V,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],y=class a{#e=c(P);closed=k();isSubmitting=p(!1);sizeOptions=p([...Be]);maxUpload=p(0);maxDownload=p(0);maxUploadUnit=p("mbps");maxDownloadUnit=p("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(n,i){let t=n*(Le[i.toUpperCase()]||w)*Ie;return t===0?{value:0,unit:"mbps"}:t>=J?{value:parseFloat((t/J).toFixed(2)),unit:"gbps"}:{value:parseFloat((t/X).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(n,i){let e=0;switch(i){case"gbps":e=n*J;break;case"mbps":e=n*X;break}let t=e/Ie;if(t===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:o,unitPrefix:r}of ye)if(t>=o)return{valueForApi:Math.round(t/o),unitPrefixForApi:r};return{valueForApi:Math.round(t),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:n=>{let i=n?.["max-upload-speed"],e=n?.["max-download-speed"];if(i&&i!==""){let t=i.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxUpload.set(u.value),this.maxUploadUnit.set(u.unit)}else console.warn("Unexpected max-upload-speed format from API:",i),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let t=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(t){let o=parseFloat(t[1]),r=t[2],u=this.convertToBitsPerSecondUnits(o,r);this.maxDownload.set(u.value),this.maxDownloadUnit.set(u.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:n=>{console.error("Failed to get server settings:",n),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(n){if([".",","].includes(n.key))return n.preventDefault()}cleanupInputAfterPasting(n){n.preventDefault();let i=n.clipboardData?.getData("text/plain");if(!i)return;let e=i.replaceAll(/[\.,]/g,"");n.target.value=e}submit(){this.isSubmitting.set(!0);let n="",i="",e=this.maxUpload()??0,t=this.maxUploadUnit(),o=this.maxDownload()??0,r=this.maxDownloadUnit();if(e>0){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(e,t),A=Me[f];A?n=`${u}${A}`:console.error(`Invalid unit prefix for API submission (upload): ${f}. Defaulting to empty string.`)}if(o){let{valueForApi:u,unitPrefixForApi:f}=this.convertFromBitsPerSecondUnits(o,r),A=Me[f];A?i=`${u}${A}`:console.error(`Invalid unit prefix for API submission (download): ${f}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":n,"max-download-speed":i}}).pipe(U(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:u=>{console.error("Failed to submit throttle settings:",u)}})}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let n;n=$localize`Throttle network speed`;let i;i=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let t;t=$localize`Max download speed`;let o;o=$localize`Cancel`;let r;return r=$localize` Update settings `,[n,i,e,t,o,r,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(i,e){i&1&&(s(0,"header")(1,"h3"),S(2,0),l(),s(3,"p"),S(4,1),l()(),s(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),S(9,2),l(),s(10,"sh-form-field")(11,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxUpload,o)||(e.maxUpload=o),o}),l()(),s(12,"sh-select",10)(13,"input",11),L("ngModelChange",function(o){return B(e.maxUploadUnit,o)||(e.maxUploadUnit=o),o}),l()()(),s(14,"div",8)(15,"label"),S(16,3),l(),s(17,"sh-form-field")(18,"input",9),T("paste",function(o){return e.cleanupInputAfterPasting(o)})("keydown",function(o){return e.blockDecimalKeys(o)}),L("ngModelChange",function(o){return B(e.maxDownload,o)||(e.maxDownload=o),o}),l()(),s(19,"sh-select",10)(20,"input",11),L("ngModelChange",function(o){return B(e.maxDownloadUnit,o)||(e.maxDownloadUnit=o),o}),l()()()()(),s(21,"footer",12)(22,"button",13),T("click",function(){return e.closed.emit(!1)}),S(23,4),l(),s(24,"button",14),T("click",function(){return e.submit()}),S(25,5),l()()),i&2&&(_(11),b("ngModel",e.maxUpload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxUploadUnit),_(5),b("ngModel",e.maxDownload),_(),R("isClearable",!1)("options",e.sizeOptions()),_(),b("ngModel",e.maxDownloadUnit),_(4),m("loader",e.isSubmitting()))},dependencies:[x,ae,_e,se,le,ce,Ce],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ue(a,n){if(a&1&&(s(0,"div"),g(1),l(),C(2,"sh-progress-bar",11)),a&2){let i=d();_(),z("",i.statusData().actionText," - ",i.statusData().statusText),_(),R("value",i.statusData().progress*100)}}function ve(a,n){if(a&1&&(s(0,"div",7),g(1),s(2,"sh-icon"),g(3,"clock"),l(),g(4),H(5,"relativeTime"),H(6,"date"),l()),a&2){let i,e=d();_(),v(" ",(i=e.nextBackup().backup)==null||i.Backup==null?null:i.Backup.Name," - "),_(3),z(" ",te(5,3,e.nextBackup().time)," at ",ne(6,5,e.nextBackup().time,"shortTime")," ")}}function ke(a,n){a&1&&(s(0,"div",7),S(1,1),l())}function xe(a,n){a&1&&(s(0,"div",8),E(1,2),C(2,"sh-spinner"),O(),l()),a&2&&(_(2),ee("--spinner-size","12px")("--spinner-thickness","2px"))}function $e(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.abort())}),E(1,3),C(2,"sh-icon"),O(),l()}}function we(a,n){if(a&1){let i=D();s(0,"button",10),T("click",function(){h(i);let t=d(2);return M(t.stop())}),E(1,4),C(2,"sh-icon"),O(),l()}}function ze(a,n){if(a&1&&I(0,$e,3,0,"button",12)(1,we,3,0,"button",12),a&2){let i=d();F(i.isStopping()?0:1)}}function He(a,n){a&1&&(E(0,0,1),C(1,"sh-icon"),O())}function Je(a,n){a&1&&(E(0,0,2),C(1,"sh-icon"),O())}var Re=new Date,j=class a{#e=c(P);#t=c(Pe);#n=c(Se);#a=c(Ne);#s=c(oe);#l=c(Ee);#i=c(Oe);minsAgo=Re.setMinutes(Re.getMinutes()-1);statusData=this.#t.statusData;serverState=this.#t.serverState;clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=G(()=>this.#i.serverState()?.ActiveTask?.Item1);isStopping=G(()=>this.runningTask()==this.#o());#o=p(-1);pgState=G(()=>this.#i.serverState());nextBackup=G(()=>{let n=this.#a.backups();return{backup:this.serverState()?.ProposedSchedule?.[0]?.backup,time:this.serverState()?.ProposedSchedule?.[0]?.Item2}});openThrottleSettingsDialog(){this.#n.open(y,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open($,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let n=this.runningTask();n&&(this.#o.set(n),this.#e.postApiV1TaskByTaskidStop({taskid:n}).subscribe())}abort(){let n=this.runningTask();n&&this.#e.postApiV1TaskByTaskidAbort({taskid:n}).subscribe()}ngAfterViewInit(){let n=this.#s.relayIsEnabled()||!this.#l.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(n)}static \u0275fac=function(i){return new(i||a)};static \u0275cmp=N({type:a,selectors:[["app-status-bar"]],decls:15,vars:5,consts:()=>{let n;n=$localize`${"\uFFFD*10:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*10:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*11:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Start ${"\uFFFD/*11:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Q(n);let i;i=$localize`No scheduled tasks`;let e;e=$localize` Loading ${"\uFFFD#2\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let t;t=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let o;return o=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[n,i,e,t,o,[1,"current-backup"],[1,"current-backup-progress"],[1,"label"],[1,"label","label-loading"],[1,"current-backup-actions"],["shButton","",3,"click"],[1,"raised","primary",3,"value"],["shButton",""]]},template:function(i,e){if(i&1&&(s(0,"div",5)(1,"div",6),I(2,Ue,3,3)(3,ve,7,8,"div",7)(4,ke,2,0,"div",7)(5,xe,3,4,"div",8),l(),s(6,"div",9),I(7,ze,2,1),s(8,"button",10),T("click",function(){return e.pauseResume()}),E(9,0),I(10,He,2,0)(11,Je,2,0),O(),l(),s(12,"button",10),T("click",function(){return e.openThrottleSettingsDialog()}),s(13,"sh-icon"),g(14,"speedometer"),l()()()()),i&2){let t;_(2),F((t=e.serverState())!=null&&t.ActiveTask&&(!((t=e.statusData())==null||t.task==null)&&t.task.Status)&&((t=e.statusData())==null||t.task==null?null:t.task.Status)!=="Completed"?2:e.nextBackup().backup||e.nextBackup().time?3:(t=e.serverState())!=null&&t.ActiveTask?5:4),_(5),F(e.runningTask()?7:-1),_(),m("loader",e.isResuming()),_(2),F(e.clientIsRunning()?10:11)}},dependencies:[de,re,Te,ge,fe,ie],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.current-backup-progress[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;min-width:18.75rem;flex:1 0}.current-backup-progress[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{max-width:18.75rem;width:100%}.current-backup-progress[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.current-backup-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}.label-loading[_ngcontent-%COMP%]{display:inline-flex;align-items:center;gap:.25rem}"],changeDetection:0})};export{j as a};
@@ -0,0 +1 @@
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-2PUCHKOK.js")},{path:"encryption",loadComponent:()=>import("./chunk-U562AGPC.js")},{path:"select-files",loadComponent:()=>import("./chunk-IUK3B6GX.js")},{path:"options",loadComponent:()=>import("./chunk-U7GOWS7E.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-SWAQMTBY.js")}],t=o;export{t as default};
@@ -1 +1 @@
1
- import{b as g}from"./chunk-Z27IQRKV.js";import{h as o}from"./chunk-2QJVTZ56.js";import{Qc as n,V as r,_ as i,pa as s}from"./chunk-QONLYWYC.js";var a=class e{#e=i(o);#r=g(this.#e.getApiV1Serversettings());#t=s(void 0);serverSettings=n(()=>this.#t()||this.#r());refreshServerSettings(){this.#e.getApiV1Serversettings().subscribe({next:t=>{this.#t.set(t)}})}static \u0275fac=function(p){return new(p||e)};static \u0275prov=r({token:e,factory:e.\u0275fac,providedIn:"root"})};export{a};
1
+ import{b as g}from"./chunk-Z27IQRKV.js";import{i as o}from"./chunk-OJ3H3ZRA.js";import{Qc as n,V as r,_ as i,pa as s}from"./chunk-QONLYWYC.js";var a=class e{#e=i(o);#r=g(this.#e.getApiV1Serversettings());#t=s(void 0);serverSettings=n(()=>this.#t()||this.#r());refreshServerSettings(){this.#e.getApiV1Serversettings().subscribe({next:t=>{this.#t.set(t)}})}static \u0275fac=function(p){return new(p||e)};static \u0275prov=r({token:e,factory:e.\u0275fac,providedIn:"root"})};export{a};
@@ -0,0 +1 @@
1
+ import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-EYFTFGJS.js")},{path:"destination",loadComponent:()=>import("./chunk-NCDXMDW5.js")},{path:"source-data",loadComponent:()=>import("./chunk-QWNOIRT4.js")},{path:"schedule",loadComponent:()=>import("./chunk-XJ7KXQWK.js")},{path:"options",loadComponent:()=>import("./chunk-R2FAS2C3.js")}];export{o as default};
@@ -0,0 +1,3 @@
1
+ import{a as Se}from"./chunk-E6H2XELA.js";import"./chunk-HHU5JW5J.js";import"./chunk-FSG362SU.js";import{a as Ee}from"./chunk-KXJZEADJ.js";import{h as A}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import{a as Me}from"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import{b as O}from"./chunk-Z27IQRKV.js";import{a as ge}from"./chunk-H7ZKBS2Q.js";import"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{b as j,d as q,e as Q}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as _e,F as de,G as Ce,K as ce,O as ue,c as Y,e as Z,f as ee,j as te,n as ne,o as ie,p as oe,q as ae,r as re,s as le,t as se,u as me}from"./chunk-RPUPXDQE.js";import{h as pe,i as Ne}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as M,Ab as B,Ac as z,Bb as G,Bc as H,Cb as p,Db as a,Eb as n,Fb as r,Jb as f,Kb as F,Mb as y,Rc as W,Sa as m,Tb as g,Ub as E,Vb as C,Wb as v,Xb as U,Zb as x,_ as u,cb as R,ea as S,fa as T,kc as w,pa as D,sc as K,tc as J,uc as X,xb as $,yb as b,zb as k,zc as V}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Te=()=>["backup"];function fe(l,t){l&1&&r(0,"sh-progress-bar",12)}function Fe(l,t){if(l&1&&(a(0,"sh-form-field"),r(1,"input",32),n()),l&2){let e=t.$implicit,s=t.$index;m(),p("id",V("filter-",s))("formControl",e)}}function Oe(l,t){if(l&1){let e=y();a(0,"form",13)(1,"sh-select",14)(2,"label",15),C(3,1),n(),r(4,"input",16),n(),a(5,"sh-form-field")(6,"label",17),C(7,2),n(),r(8,"textarea",18),n(),a(9,"sh-form-field")(10,"label",19),C(11,3),n(),r(12,"textarea",20),n()(),a(13,"sh-divider"),C(14,4),n(),a(15,"form",13)(16,"sh-form-field")(17,"label",21),C(18,5),n(),r(19,"input",22),n(),a(20,"sh-form-field")(21,"label",23),C(22,6),n(),r(23,"input",24),n(),a(24,"app-toggle-card",25),f(25,26),C(26,7),F(),f(27,27),B(28,Fe,2,3,"sh-form-field",null,k),F(),n()(),a(30,"p"),g(31,8),r(32,"a",28),E(),n(),a(33,"app-options-list",29),X("optionsChange",function(o){S(e);let c=M();return J(c.settings,o)||(c.settings=o),T(o)}),n(),a(34,"div",30)(35,"button",31),x("click",function(){S(e);let o=M();return T(o.submit())}),g(36,9),r(37,"sh-icon"),E(),n()()}if(l&2){let e=M();p("formGroup",e.baseCmdForm),m(),p("options",e.commandOptions()??H(10,Te))("inlineSearch",!0),m(14),p("formGroup",e.standardFields),m(9),p("disallowToggle",!0),m(4),G(e.standardFields.controls.filters.controls),m(5),K("options",e.settings),p("hasFreeTextSettings",!0),m(2),w("loader",e.isSubmitting()),m(2),v(e.baseCmdForm.value.command),U(36)}}var _=new re,P=class l{#e=u(A);#t=u(Ne);#n=u(q);#i=u(j);#o=u(pe);#a=u(ge);#r=O(this.#i.params);commandOptions=O(this.#o.getApiV1Commandline());isSubmitting=D(!1);optionsFields=this.#e.optionsFields;standardFields=_.group({"backup-id":_.control(""),"backup-name":_.control(""),dbpath:_.control(""),filters:_.array([])});baseCmdForm=_.group({command:_.control("backup"),targetUrl:_.control(""),arguments:_.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#s=W(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#t.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup)),this.#e.finishedLoading.set(!0)}})}mapStandardFieldsToForm(t){this.standardFields.patchValue({dbpath:t.DBPath,"backup-id":t.ID,"backup-name":t.Name}),t.Filters&&t.Filters.length&&t.Filters.map(e=>{this.standardFields.controls.filters.push(_.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#a.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.baseCmdForm.value,e=t.targetUrl??"",s=t.arguments?.split(`
2
+ `).filter(i=>i.length>0)??[],o=this.standardFields.value,c=o.filters??[],N=[t.command,e,...s,`--backup-name=${o["backup-name"]}`,`--dbpath=${o.dbpath}`,`--backup-id=${o["backup-id"]}`,...c.filter(i=>i).map(i=>i.startsWith("-")?`--exclude=${i?.slice(1)}`:`--include=${i}`),...this.#e.mapFormsToSettings(["backup-id","backup-name","dbpath"]).map(i=>`${i.Name.startsWith("--")?"":"--"}${i.Name}=${i.Value}`),"--disable-module=console-password-input"];this.#t.postApiV1Commandline({requestBody:N}).subscribe(i=>{i.Status==="OK"&&this.#n.navigate(["backup",this.backupId(),"commandline",i.ID])})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
+ `)??""})}static \u0275fac=function(e){return new(e||l)};static \u0275cmp=R({type:l,selectors:[["app-commandline"]],features:[z([A])],decls:8,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`Command`;let s;s=$localize`TargetUrl`;let o;o=$localize`Commandline Arguments`;let c;c=$localize`Advanced options`;let N;N=$localize`Backup ID`;let i;i=$localize`Backup Name`;let I;I=$localize`Filters`;let h;h=$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#32\uFFFD"}:START_LINK:Read more${"\uFFFD/#32\uFFFD"}:CLOSE_LINK:`;let L;return L=$localize`${"\uFFFD#37\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#37\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,s,o,c,N,i,I,h,L,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["id","arguments","autocomplete","off","formControlName","arguments"],["for","backup-id"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],["href","#",1,"sh-primary"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,s){e&1&&(r(0,"app-status-bar"),a(1,"section")(2,"div",10)(3,"button",11),g(4,0),r(5,"sh-icon"),E(),n()(),$(6,fe,1,0,"sh-progress-bar",12)(7,Oe,38,11),n()),e&2&&(m(6),b(s.finishedLoading()?7:6))},dependencies:[le,te,Y,Z,ee,Ee,Se,Me,se,ne,ie,ae,oe,Q,Ce,_e,de,ue,ce,me],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;width:100%;max-width:40rem;padding:2.5rem;gap:1.25rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}"],changeDetection:0})};export{P as default};
@@ -1 +1 @@
1
- import{a as Lt,b as Rt,c as Bt}from"./chunk-2ZGJS4OW.js";import"./chunk-ZBVBVQO7.js";import{a as Pt}from"./chunk-C6F6FP4R.js";import{h as yt}from"./chunk-BQJICFF5.js";import"./chunk-A5LNLNWR.js";import"./chunk-3NFAL4U4.js";import"./chunk-4VY6SMSL.js";import"./chunk-6YGURBW6.js";import"./chunk-Z27IQRKV.js";import{a as $}from"./chunk-72HORZFV.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import{b as St,d as mt}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as k,C as $t,G as v,J as Mt,c as x,e as G,f as Nt,g as It,i as U,j as ht,r as Et,s as w,u as b,w as Ot,y as ft,z as At}from"./chunk-QF4DQYEP.js";import"./chunk-2QJVTZ56.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as st,Bb as Ft,Bc as Dt,Cb as m,Db as s,Eb as F,Fb as c,Jb as rt,Kb as lt,Mb as g,Pa as ot,Qc as R,Sa as r,Tb as _,Ub as u,Vb as y,Vc as gt,Wb as z,Wc as pt,Xb as H,Xc as Ct,Yb as J,Zb as D,_ as N,ac as ct,bc as _t,cb as E,ea as T,fa as d,gc as ut,hc as Tt,ja as it,kc as dt,nc as L,oc as X,pa as h,sc as O,tc as f,uc as A,vc as j,wc as W,xb as C,xc as B,yb as S,yc as q,zb as at}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Ut=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:Ut,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,i){if(t&1&&(ct(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),L(4),F(),s(5,"div",4),L(6),F(),s(7,"div",5),_t(8),F()()),t&2){let e=i.destination();r(2),m("src",q(e.icon),ot)("alt",q(e.displayName)),r(2),X(e.displayName),r(2),X(e.description)}},dependencies:[$t],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function bt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let e=T(t).$implicit,a=l();return d(a.setDestination.emit(e.key))}),_(2,0),c(3,"sh-icon"),u(),F()()}if(o&2){let t=n.$implicit;m("destination",t)}}var K=class o{#i=N(Rt);setDestination=gt();destinationSearchTerm=h("");destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=R(()=>{let n=this.destinationTypeOptions(),t=this.destinationSearchTerm().toLowerCase(),i=[...n].sort((e,a)=>{let I=e.sortOrder??0,P=a.sortOrder??0;return I!==P?P-I:e.displayName.localeCompare(a.displayName)}).filter(e=>(e.sortOrder??0)>=0);return t?i.filter(e=>e.searchTerms.toLowerCase().includes(t)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let n;n=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,i){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return f(i.destinationSearchTerm,a)||(i.destinationSearchTerm=a),a}),F()(),s(2,"div",2),st(3,bt,4,1,"app-destination-list-item",3,at),F()),t&2&&(r(),O("ngModel",i.destinationSearchTerm),r(2),Ft(i.destinationTypeOptionsFocused()))},dependencies:[M,w,x,G,U,v,k,b],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var kt=["formRef"],vt=()=>({maxWidth:"700px",width:"100%"});function Kt(o,n){if(o&1){let t=g();_(0,1,1),s(1,"button",28),D("click",function(){T(t);let e=l();return d(e.testDestination(0,!0))}),F(),u()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),m("disabled",t.testSignal()=="testing")}}function Vt(o,n){if(o&1){let t=g();_(0,1,2),s(1,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(2,"sh-icon"),F(),u()}}function zt(o,n){if(o&1){let t=g();_(0,1,4),s(1,"button",29),D("click",function(){T(t);let e=l(2);return d(e.copyTargetUrl())}),c(2,"sh-icon"),F(),u()}}function Ht(o,n){if(o&1){let t=g();_(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),rt(4,30),s(5,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(6,"sh-icon"),F(),C(7,zt,3,0,"button",17),lt(),F(),u()}if(o&2){l();let t=B(0);r(7),S(t?7:-1)}}function Jt(o,n){o&1&&(s(0,"sh-alert"),_(1,4),c(2,"sh-icon",31),u(),F())}function Xt(o,n){o&1&&(s(0,"sh-alert",18),_(1,5),c(2,"sh-icon",31),u(),F())}function jt(o,n){if(o&1&&(s(0,"sh-alert",19),_(1,6),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Wt(o,n){if(o&1&&(s(0,"sh-alert",20),_(1,7),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function qt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){T(t);let e=l();return d(e.removeDestination())}),y(2,8),F()()}if(o&2){l();let t=B(14);m("destination",t)}}function Qt(o,n){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(e){T(t);let a=l();return d(a.setDestination(e))}),F()}}function Yt(o,n){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(e){T(t);let a=l();return f(a.targetUrlModel,e)||(a.targetUrlModel=e),d(e)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel),m("useBackupState",!0)}}function Zt(o,n){o&1&&(_(0,3,1),c(1,"sh-icon",26),u())}function te(o,n){o&1&&(_(0,3,2),c(1,"sh-icon"),u())}function ee(o,n){o&1&&(s(0,"h2"),y(1,11),F())}function ne(o,n){o&1&&(s(0,"h2"),y(1,12),F())}function ie(o,n){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(e){T(t);let a=l();return f(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),d(e)}),s(1,"header",35),C(2,ee,2,0,"h2")(3,ne,2,0,"h2"),s(4,"sh-alert",19),y(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(e){T(t);let a=l();return f(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),d(e)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!1))}),L(11,"Cancel"),F(),s(12,"button",39),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!0))}),_(13,10),c(14,"sh-icon"),u(),F()()()}if(o&2){let t=l(),i=B(0);O("isOpen",t.targetUrlDialogOpen),m("options",Dt(4,vt)),r(2),S(i?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new Et,Le=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),Re=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:i})=>V.group({destinationType:V.control(o),custom:n,dynamic:t,advanced:i}),Q=class o{#i=N(mt);#o=N(St);#t=N(yt);#e=N(At);#a=N(Lt);injector=N(it);formRef=Ct.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=h(null);targetUrlInitial=h(null);targetUrlDialogOpen=h(!1);toggleNewDestination=h(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=R(()=>{let n=this.targetUrlModel();if(!n)return null;let t=n.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=R(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let n=this.targetUrlModel();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||t===i||!t||this.#t.setTargetUrl(t)}testDestination(n,t,i){let e=this.targetUrlModel();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),i?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let I=e.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(e+`${I?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(e+`${I?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):i?.()}}))}setDestination(n){this.#t.setTargetUrl(`${n}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.#t.isNew(),t=this.testSignal();if(!n){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:i=>{i?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination"]],viewQuery:function(t,i){t&1&&ut(i.formRef,kt,5),t&2&&Tt()},decls:27,vars:11,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,n=J(n);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=J(i);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Y;Y=$localize`Change`;let Z;Z=$localize`Be careful, this will overwrite everything you have in your destination.`;let tt;tt=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let et;et=$localize`Set target URL`;let nt;return nt=$localize`Edit target URL`,[["formRef",""],n,t,i,e,a,I,P,Y,Z,tt,et,nt,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,i){if(t&1){let e=g();j(0),s(1,"form",13,0),D("submit",function(){return T(e),d(i.next())}),s(3,"header")(4,"h3",14),_(5,1),s(6,"div",15),C(7,Kt,2,3,"button",16),C(8,Vt,3,0,"button",17)(9,Ht,8,1,"sh-menu"),F(),u(),F(),C(10,Jt,3,0,"sh-alert")(11,Xt,3,0,"sh-alert",18)(12,jt,3,1,"sh-alert",19)(13,Wt,3,1,"sh-alert",20),j(14),C(15,qt,3,1,"app-destination-list-item",21),F(),C(16,Qt,1,0,"app-destination-list"),C(17,Yt,1,2,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return T(e),d(i.goBack())}),_(20,2),c(21,"sh-icon"),u(),F(),s(22,"button",25),_(23,3),C(24,Zt,2,0,"sh-icon",26)(25,te,2,0,"sh-icon"),u(),F()()(),C(26,ie,15,5,"sh-dialog",27)}if(t&2){let e=W(!!i.targetUrlModel());r(7),S(e?7:-1),r(),S(e?9:8),r(2),S(i.testSignal()=="testing"?10:i.testSignal()=="success"?11:i.testSignal()=="warning"?12:i.testSignal()=="error"?13:-1),r(4);let a=W(i.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(e?-1:16),r(),S(e?17:-1),r(5),m("disabled",i.testSignal()=="testing"||!e),r(2),S(i.testSignal()=="testing"?24:25),r(2),S(i.targetUrlDialogOpen()?26:-1)}},dependencies:[Bt,K,M,w,ht,x,G,Nt,U,It,k,v,Mt,b,ft,Ot],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{Le as createDestinationForm,Re as createDestinationFormGroup,Q as default};
1
+ import{a as Lt,b as Rt,c as Bt}from"./chunk-PFZASYQH.js";import"./chunk-HHU5JW5J.js";import{a as Pt}from"./chunk-FSG362SU.js";import{h as yt}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import"./chunk-MHPSC3FM.js";import"./chunk-Z27IQRKV.js";import{a as $}from"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import{b as St,d as mt}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{B as k,C as $t,G as v,J as Mt,c as x,e as G,f as Nt,g as It,i as U,j as ht,r as Et,s as w,u as b,w as Ot,y as ft,z as At}from"./chunk-RPUPXDQE.js";import"./chunk-OJ3H3ZRA.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as st,Bb as Ft,Bc as Dt,Cb as m,Db as s,Eb as F,Fb as c,Jb as rt,Kb as lt,Mb as g,Pa as ot,Qc as R,Sa as r,Tb as _,Ub as u,Vb as y,Vc as gt,Wb as z,Wc as pt,Xb as H,Xc as Ct,Yb as J,Zb as D,_ as N,ac as ct,bc as _t,cb as E,ea as T,fa as d,gc as ut,hc as Tt,ja as it,kc as dt,nc as L,oc as X,pa as h,sc as O,tc as f,uc as A,vc as j,wc as W,xb as C,xc as B,yb as S,yc as q,zb as at}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var Ut=["*"],M=class o{destination=pt.required();static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"]},ngContentSelectors:Ut,decls:9,vars:6,consts:[[1,"type-b"],[1,"icon"],[3,"src","alt"],[1,"name"],[1,"description"],[1,"actions"]],template:function(t,i){if(t&1&&(ct(),s(0,"sh-card",0)(1,"div",1),c(2,"img",2),F(),s(3,"div",3),L(4),F(),s(5,"div",4),L(6),F(),s(7,"div",5),_t(8),F()()),t&2){let e=i.destination();r(2),m("src",q(e.icon),ot)("alt",q(e.displayName)),r(2),X(e.displayName),r(2),X(e.description)}},dependencies:[$t],styles:['[_nghost-%COMP%]{display:block}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};function bt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",3)(1,"button",4),D("click",function(){let e=T(t).$implicit,a=l();return d(a.setDestination.emit(e.key))}),_(2,0),c(3,"sh-icon"),u(),F()()}if(o&2){let t=n.$implicit;m("destination",t)}}var K=class o{#i=N(Rt);setDestination=gt();destinationSearchTerm=h("");destinationTypeOptions=this.#i.destinationTypeOptions;destinationTypeOptionsFocused=R(()=>{let n=this.destinationTypeOptions(),t=this.destinationSearchTerm().toLowerCase(),i=[...n].sort((e,a)=>{let I=e.sortOrder??0,P=a.sortOrder??0;return I!==P?P-I:e.displayName.localeCompare(a.displayName)}).filter(e=>(e.sortOrder??0)>=0);return t?i.filter(e=>e.searchTerms.toLowerCase().includes(t)):i});static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination-list"]],outputs:{setDestination:"setDestination"},decls:5,vars:1,consts:()=>{let n;n=$localize`Search for destination...`;let t;return t=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[t,["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"list"],[3,"destination"],["shButton","","type","button",3,"click"]]},template:function(t,i){t&1&&(s(0,"sh-form-field")(1,"input",1),A("ngModelChange",function(a){return f(i.destinationSearchTerm,a)||(i.destinationSearchTerm=a),a}),F()(),s(2,"div",2),st(3,bt,4,1,"app-destination-list-item",3,at),F()),t&2&&(r(),O("ngModel",i.destinationSearchTerm),r(2),Ft(i.destinationTypeOptionsFocused()))},dependencies:[M,w,x,G,U,v,k,b],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding-bottom:1rem;border-bottom:.0625rem solid var(--base-4)}"],changeDetection:0})};var kt=["formRef"],vt=()=>({maxWidth:"700px",width:"100%"});function Kt(o,n){if(o&1){let t=g();_(0,1,1),s(1,"button",28),D("click",function(){T(t);let e=l();return d(e.testDestination(0,!0))}),F(),u()}if(o&2){let t=l();r(),dt("loader",t.testSignal()=="testing"),m("disabled",t.testSignal()=="testing")}}function Vt(o,n){if(o&1){let t=g();_(0,1,2),s(1,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(2,"sh-icon"),F(),u()}}function zt(o,n){if(o&1){let t=g();_(0,1,4),s(1,"button",29),D("click",function(){T(t);let e=l(2);return d(e.copyTargetUrl())}),c(2,"sh-icon"),F(),u()}}function Ht(o,n){if(o&1){let t=g();_(0,1,3),s(1,"sh-menu")(2,"button",17),c(3,"sh-icon"),F(),rt(4,30),s(5,"button",29),D("click",function(){T(t);let e=l();return d(e.openTargetUrlDialog())}),c(6,"sh-icon"),F(),C(7,zt,3,0,"button",17),lt(),F(),u()}if(o&2){l();let t=B(0);r(7),S(t?7:-1)}}function Jt(o,n){o&1&&(s(0,"sh-alert"),_(1,4),c(2,"sh-icon",31),u(),F())}function Xt(o,n){o&1&&(s(0,"sh-alert",18),_(1,5),c(2,"sh-icon",31),u(),F())}function jt(o,n){if(o&1&&(s(0,"sh-alert",19),_(1,6),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function Wt(o,n){if(o&1&&(s(0,"sh-alert",20),_(1,7),c(2,"sh-icon",31),u(),F()),o&2){let t=l();r(2),z(t.testErrorMessage()),H(1)}}function qt(o,n){if(o&1){let t=g();s(0,"app-destination-list-item",21)(1,"button",24),D("click",function(){T(t);let e=l();return d(e.removeDestination())}),y(2,8),F()()}if(o&2){l();let t=B(14);m("destination",t)}}function Qt(o,n){if(o&1){let t=g();s(0,"app-destination-list",32),D("setDestination",function(e){T(t);let a=l();return d(a.setDestination(e))}),F()}}function Yt(o,n){if(o&1){let t=g();s(0,"app-single-destination",33),A("targetUrlChange",function(e){T(t);let a=l();return f(a.targetUrlModel,e)||(a.targetUrlModel=e),d(e)}),F()}if(o&2){let t=l();O("targetUrl",t.targetUrlModel),m("useBackupState",!0)}}function Zt(o,n){o&1&&(_(0,3,1),c(1,"sh-icon",26),u())}function te(o,n){o&1&&(_(0,3,2),c(1,"sh-icon"),u())}function ee(o,n){o&1&&(s(0,"h2"),y(1,11),F())}function ne(o,n){o&1&&(s(0,"h2"),y(1,12),F())}function ie(o,n){if(o&1){let t=g();s(0,"sh-dialog",34),A("isOpenChange",function(e){T(t);let a=l();return f(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),d(e)}),s(1,"header",35),C(2,ee,2,0,"h2")(3,ne,2,0,"h2"),s(4,"sh-alert",19),y(5,9),F()(),s(6,"div",36)(7,"sh-form-field")(8,"textarea",37),A("ngModelChange",function(e){T(t);let a=l();return f(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),d(e)}),F()()(),s(9,"footer",38)(10,"button",24),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!1))}),L(11,"Cancel"),F(),s(12,"button",39),D("click",function(){T(t);let e=l();return d(e.closeTargetUrlDialog(!0))}),_(13,10),c(14,"sh-icon"),u(),F()()()}if(o&2){let t=l(),i=B(0);O("isOpen",t.targetUrlDialogOpen),m("options",Dt(4,vt)),r(2),S(i?3:2),r(6),O("ngModel",t.targetUrlCtrl)}}var V=new Et,Le=(o={destinations:[]})=>V.group({destinations:V.array(o.destinations)}),Re=({key:o,customGroup:n,dynamicGroup:t,advancedGroup:i})=>V.group({destinationType:V.control(o),custom:n,dynamic:t,advanced:i}),Q=class o{#i=N(mt);#o=N(St);#t=N(yt);#e=N(At);#a=N(Lt);injector=N(it);formRef=Ct.required("formRef");targetUrlModel=this.#t.targetUrlModel;targetUrlCtrl=h(null);targetUrlInitial=h(null);targetUrlDialogOpen=h(!1);toggleNewDestination=h(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;selectedDestinationType=R(()=>{let n=this.targetUrlModel();if(!n)return null;let t=n.split("://")[0];return Pt(t)??null});selectedDestinationTypeOption=R(()=>{let n=this.selectedDestinationType();return n?{key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description,icon:n.icon}:null});copyTargetUrl(){navigator.clipboard.writeText(this.targetUrlModel()??"")}openTargetUrlDialog(){let n=this.targetUrlModel();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),i=this.targetUrlInitial();!n||t===i||!t||this.#t.setTargetUrl(t)}testDestination(n,t,i){let e=this.targetUrlModel();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,!0).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),this.#t.isNew()&&(a.containsBackup===!0?(this.#t.setTestState("warning",$localize`The remote destination already contains a backup. Please use a different folder for each backup.`),t||this.#e.open($,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!0&&(this.#t.setTestState("warning",$localize`The remote destination contains unknown files.`),t||this.#e.open($,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}}))),i?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){i?.();return}let I=e.includes("?");a.action==="trust-cert"&&this.#t.setTargetUrl(e+`${I?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.setTargetUrl(e+`${I?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):i?.()}}))}setDestination(n){this.#t.setTargetUrl(`${n}://`,!0)}removeDestination(){this.#t.setTargetUrl(null,!0)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.#t.isNew(),t=this.testSignal();if(!n){this.#n();return}if(t===""){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:i=>{i?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open($,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(t!=="success"){this.#e.open($,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:i=>{i&&this.#n()}});return}this.#n()}#n(){this.#t.isNew()||this.#t.submit(!0),this.#i.navigate(["source-data"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=E({type:o,selectors:[["app-destination"]],viewQuery:function(t,i){t&1&&ut(i.formRef,kt,5),t&2&&Tt()},decls:27,vars:11,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#6\uFFFD"}:START_TAG_DIV:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*8:2\uFFFD"}:START_BLOCK_IF_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Set target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*9:3\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:3\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#2:3\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#4:3\uFFFD"}:START_TAG_NG_CONTAINER:${"[\uFFFD#1:2\uFFFD|\uFFFD#5:3\uFFFD]"}:START_TAG_BUTTON_1:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*7:1\uFFFD|\uFFFD*7:4\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:4\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#2:2\uFFFD|\uFFFD#3:3\uFFFD|\uFFFD#6:3\uFFFD|\uFFFD#2:4\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#2:2\uFFFD|\uFFFD/#3:3\uFFFD|\uFFFD/#6:3\uFFFD|\uFFFD/#2:4\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD|\uFFFD/#2:3\uFFFD|\uFFFD/#5:3\uFFFD|\uFFFD/#1:4\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*7:1\uFFFD|\uFFFD/*8:2\uFFFD|\uFFFD/*7:4\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#4:3\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#1:3\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/*9:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_DIV:`,n=J(n);let t;t=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let i;i=$localize`${"\uFFFD*24:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*24:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*25:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*25:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,i=J(i);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let I;I=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let P;P=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let Y;Y=$localize`Change`;let Z;Z=$localize`Be careful, this will overwrite everything you have in your destination.`;let tt;tt=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let et;et=$localize`Set target URL`;let nt;return nt=$localize`Edit target URL`,[["formRef",""],n,t,i,e,a,I,P,Y,Z,tt,et,nt,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"loader","disabled"],["shButton","","type","button",1,"small"],[1,"success"],[1,"warn"],[1,"error"],[1,"current-destination",3,"destination"],[3,"targetUrl","useBackupState"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["shButton","","type","button",1,"small",3,"click"],["menu",""],["icon",""],[3,"setDestination"],[3,"targetUrlChange","targetUrl","useBackupState"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,i){if(t&1){let e=g();j(0),s(1,"form",13,0),D("submit",function(){return T(e),d(i.next())}),s(3,"header")(4,"h3",14),_(5,1),s(6,"div",15),C(7,Kt,2,3,"button",16),C(8,Vt,3,0,"button",17)(9,Ht,8,1,"sh-menu"),F(),u(),F(),C(10,Jt,3,0,"sh-alert")(11,Xt,3,0,"sh-alert",18)(12,jt,3,1,"sh-alert",19)(13,Wt,3,1,"sh-alert",20),j(14),C(15,qt,3,1,"app-destination-list-item",21),F(),C(16,Qt,1,0,"app-destination-list"),C(17,Yt,1,2,"app-single-destination",22),s(18,"div",23)(19,"button",24),D("click",function(){return T(e),d(i.goBack())}),_(20,2),c(21,"sh-icon"),u(),F(),s(22,"button",25),_(23,3),C(24,Zt,2,0,"sh-icon",26)(25,te,2,0,"sh-icon"),u(),F()()(),C(26,ie,15,5,"sh-dialog",27)}if(t&2){let e=W(!!i.targetUrlModel());r(7),S(e?7:-1),r(),S(e?9:8),r(2),S(i.testSignal()=="testing"?10:i.testSignal()=="success"?11:i.testSignal()=="warning"?12:i.testSignal()=="error"?13:-1),r(4);let a=W(i.selectedDestinationTypeOption());r(),S(a?15:-1),r(),S(e?-1:16),r(),S(e?17:-1),r(5),m("disabled",i.testSignal()=="testing"||!e),r(2),S(i.testSignal()=="testing"?24:25),r(2),S(i.targetUrlDialogOpen()?26:-1)}},dependencies:[Bt,K,M,w,ht,x,G,Nt,U,It,k,v,Mt,b,ft,Ot],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;padding:2.5rem 2.5rem 0}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;height:100%;padding:0 0 2.5rem}.current-destination[_ngcontent-%COMP%]{margin:1rem 0 0}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{Le as createDestinationForm,Re as createDestinationFormGroup,Q as default};
@@ -1 +1 @@
1
- import{h as d}from"./chunk-2QJVTZ56.js";import{H as o,Qc as s,Rc as g,V as n,_ as r,pa as l}from"./chunk-QONLYWYC.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=r(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):this.clearPolling()});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(o(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let i=e.reverse(),t=this.#i(i);t>0&&this.id.set(t),this.#e.set([...i,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e),e==="Disabled"&&this.clearPolling()}#i(e){return e.reduce((i,t)=>Math.max(i,t.ID),0)}destroy(){this.logLevel.set("Disabled"),this.clearPolling()}clearPolling(){this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
1
+ import{i as d}from"./chunk-OJ3H3ZRA.js";import{H as o,Qc as s,Rc as g,V as n,_ as r,pa as l}from"./chunk-QONLYWYC.js";var u=[{value:"Disabled",label:$localize`Disabled`},{value:"Verbose",label:$localize`Verbose`},{value:"ExplicitOnly",label:$localize`Explicit only`},{value:"Profiling",label:$localize`Profiling`},{value:"Retry",label:$localize`Retry`},{value:"Information",label:$localize`Information`},{value:"DryRun",label:$localize`Dry run`},{value:"Warning",label:$localize`Warning`},{value:"Error",label:$localize`Error`}],v=class a{#l=r(d);#e=l([]);LOG_LEVELS=u;logLevel=l("Disabled");logLevelByLabel=s(()=>u.find(e=>e.value===this.logLevel())?.label);whenFilter=l(null);backupIdFilter=l(null);id=l(0);logs=s(()=>this.whenFilter()&&this.backupIdFilter()?this.#e().filter(e=>e.BackupID===this.backupIdFilter()&&new Date(e.When).getTime()>=this.whenFilter()&&e.BackupID===this.backupIdFilter()):this.#e());timerInterval;logsLoading=l(!1);isPolling=l(!1);pagination=l({offset:0,pagesize:100});logLevelEffect=g(()=>{this.isPolling()?(this.#e.set([]),this.id.set(0),queueMicrotask(()=>this.loadLogs()),this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=setInterval(()=>{this.loadLogs()},3e3)):this.clearPolling()});setWhenFilter(e){this.whenFilter.set(e)}setBackupIdFilter(e){this.backupIdFilter.set(e)}loadLogs(){this.logsLoading.set(!0),this.#l.getApiV1LogdataPoll({id:this.id(),level:this.logLevel(),pagesize:this.pagination().pagesize}).pipe(o(()=>this.logsLoading.set(!1))).subscribe({next:e=>{let i=e.reverse(),t=this.#i(i);t>0&&this.id.set(t),this.#e.set([...i,...this.#e()])}})}updateLogLevel(e){this.logLevel.set(e),e==="Disabled"&&this.clearPolling()}#i(e){return e.reduce((i,t)=>Math.max(i,t.ID),0)}destroy(){this.logLevel.set("Disabled"),this.clearPolling()}clearPolling(){this.timerInterval&&clearInterval(this.timerInterval),this.timerInterval=void 0}static \u0275fac=function(i){return new(i||a)};static \u0275prov=n({token:a,factory:a.\u0275fac,providedIn:"root"})};export{v as a};
@@ -1 +1 @@
1
- import{a as v}from"./chunk-VXRNST6C.js";import{h as C}from"./chunk-BQJICFF5.js";import"./chunk-A5LNLNWR.js";import"./chunk-3NFAL4U4.js";import"./chunk-4VY6SMSL.js";import{b as h}from"./chunk-Z27IQRKV.js";import"./chunk-GYDI67IZ.js";import{a as G}from"./chunk-4NBLWONL.js";import"./chunk-CCKT2GLS.js";import"./chunk-72HORZFV.js";import"./chunk-6Q6SSTBK.js";import"./chunk-XLDVUBTQ.js";import"./chunk-LN26XMBJ.js";import"./chunk-7LYN2XHO.js";import"./chunk-GCCJSS4C.js";import{b as N,c as O,e as B,f as b}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{K as M,L as $,Q as I}from"./chunk-QF4DQYEP.js";import{h as L}from"./chunk-2QJVTZ56.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as D,Ac as E,Cb as d,Db as s,Dc as _,Eb as u,F as f,Fb as r,Rc as k,Sa as n,Tb as c,Ub as p,_ as l,cb as R,nc as A,pc as P,xb as T,yb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=D();n(),P("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=k(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=R({type:a,selectors:[["app-backup"]],features:[E([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),p(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),p(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),p(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),p(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),p(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",_(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};
1
+ import{a as v}from"./chunk-KXJZEADJ.js";import{h as C}from"./chunk-C7EUC34O.js";import"./chunk-HYQ6MPYI.js";import"./chunk-YCORZV4Z.js";import"./chunk-4VY6SMSL.js";import{b as h}from"./chunk-Z27IQRKV.js";import"./chunk-H7ZKBS2Q.js";import{a as G}from"./chunk-2YGOHGD2.js";import"./chunk-BK2MSH26.js";import"./chunk-3V4DGTSM.js";import"./chunk-6Q6SSTBK.js";import"./chunk-5LX6M65H.js";import"./chunk-LN26XMBJ.js";import"./chunk-S4OFJD2F.js";import"./chunk-6XI3IP27.js";import{b as N,c as O,e as B,f as b}from"./chunk-ABYM5HWA.js";import"./chunk-Z35OG2DV.js";import{K as M,L as $,Q as I}from"./chunk-RPUPXDQE.js";import{i as L}from"./chunk-OJ3H3ZRA.js";import"./chunk-I2LW33GO.js";import"./chunk-5ZSBXGHQ.js";import"./chunk-FPPZ4BUR.js";import"./chunk-JYWOYPSQ.js";import{$b as D,Ac as E,Cb as d,Db as s,Dc as _,Eb as u,F as f,Fb as r,Rc as k,Sa as n,Tb as c,Ub as p,_ as l,cb as R,nc as A,pc as P,xb as T,yb as g}from"./chunk-QONLYWYC.js";import"./chunk-EUDKD2JW.js";var y=(a,e)=>[a,e,"general"],U=(a,e)=>[a,e,"destination"],K=(a,e)=>[a,e,"source-data"],w=(a,e)=>[a,e,"schedule"],H=(a,e)=>[a,e,"options"];function J(a,e){if(a&1&&(s(0,"p"),A(1),u()),a&2){let t=D();n(),P("Editing: ",t.backupName())}}function X(a,e){a&1&&r(0,"sh-progress-bar",7)}function x(a,e){a&1&&(s(0,"section"),r(1,"router-outlet"),u())}var m=class a{#t=l(N);#e=l(C);#a=l(G);#i=l(L);isDraft=this.#e.isDraft;isNew=this.#e.isNew;backupId=this.#e.backupId;backupName=this.#e.backupName;finishedLoading=this.#e.finishedLoading;#o=h(this.#t.params);#n=h(this.#t.url);paramsChanged=k(()=>{let e=this.#o()?.id,t=!!this.#n()?.find(i=>i.path==="backup-draft");this.#e.backupId.set(e),e!=="new"?this.getBackup(e,t):this.getDefaults()});getDefaults(){this.#i.getApiV1Backupdefaults().pipe(f(1)).subscribe({next:e=>{let t=e.Backup;t.Settings=[...t.Settings],this.#e.mapGeneralToForm(t),this.#e.mapDestinationToForm(t),this.#e.mapSourceDataToForm(t),this.#e.mapScheduleToForm(e.Schedule),this.#e.mapOptionsToForms(t),this.#e.applicationOptions.set(e.ApplicationOptions),this.#e.backupDefaults.set(e),this.#e.finishedLoading.set(!0)}})}getBackup(e,t=!1){let i=o=>{this.#e.mapScheduleToForm(o.Schedule??null),o.Backup&&(this.#e.mapGeneralToForm(o.Backup),this.#e.mapDestinationToForm(o.Backup),this.#e.mapSourceDataToForm(o.Backup),this.#e.mapOptionsToForms(o.Backup),this.#e.storeMetadata(o.Backup,t)),this.#e.finishedLoading.set(!0)};if(t){this.isDraft.set(t);let o=this.#a.draftBackups().find(F=>F.id===e);if(!o){alert("Backup not found");return}i(o.data)}else this.#i.getApiV1BackupById({id:e}).subscribe({next:i})}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=R({type:a,selectors:[["app-backup"]],features:[E([C])],decls:21,vars:22,consts:()=>{let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_RADIO: General `;let t;t=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_RADIO: Destination `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_RADIO: Source Data `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_RADIO: Schedule `;let F;return F=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_RADIO:${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_RADIO: Options `,[e,t,i,o,F,[1,"primary"],["step","","routerLinkActive","active",3,"routerLink"],[1,"indeterminate","primary"]]},template:function(t,i){t&1&&(r(0,"app-status-bar"),s(1,"header"),T(2,J,2,1,"p"),s(3,"sh-stepper",5)(4,"div",6),c(5,0),r(6,"sh-radio"),p(),u(),s(7,"div",6),c(8,1),r(9,"sh-radio"),p(),u(),s(10,"div",6),c(11,2),r(12,"sh-radio"),p(),u(),s(13,"div",6),c(14,3),r(15,"sh-radio"),p(),u(),s(16,"div",6),c(17,4),r(18,"sh-radio"),p(),u()()(),T(19,X,1,0,"sh-progress-bar",7)(20,x,2,0,"section")),t&2&&(n(2),g(i.isNew()?-1:2),n(2),d("routerLink",_(7,y,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(10,U,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(13,K,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(16,w,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),d("routerLink",_(19,H,i.isDraft()?"/backup-draft":"/backup",i.backupId())),n(3),g(i.finishedLoading()?20:19))},dependencies:[O,B,b,v,$,I,M],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;height:100%}header[_ngcontent-%COMP%]{padding:1rem 1.5rem;border-bottom:1px solid var(--base-4)}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin-bottom:.5rem}header[_ngcontent-%COMP%] sh-stepper[_ngcontent-%COMP%]{width:100%}section[_ngcontent-%COMP%]{width:100%;display:flex;justify-content:center;flex:1 0;overflow-x:hidden;overflow-y:auto;-webkit-overflow-scrolling:auto}"],changeDetection:0})};export{m as default};