@duplicati/ngclient 0.0.201 → 0.0.203

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 (47) hide show
  1. package/assets/sh.woff2 +0 -0
  2. package/{chunk-NEC5ZCCT.js → chunk-2BXGPMD6.js} +1 -1
  3. package/chunk-2Y2B4SFQ.js +1 -0
  4. package/{chunk-YDE34GTN.js → chunk-3QV6WLWV.js} +1 -1
  5. package/{chunk-V7OCP4NF.js → chunk-5REQ64AK.js} +1 -1
  6. package/{chunk-HETNGT36.js → chunk-7DCQVM6E.js} +1 -1
  7. package/{chunk-4GYWPC2V.js → chunk-7OT4OWQG.js} +1 -1
  8. package/chunk-7SNTP57H.js +1 -0
  9. package/chunk-BFTGDQ4K.js +1 -0
  10. package/{chunk-UK6PJVXG.js → chunk-C25WT56X.js} +1 -1
  11. package/chunk-C64L6XY3.js +1 -0
  12. package/{chunk-WNG24347.js → chunk-C7N24TZM.js} +1 -1
  13. package/{chunk-56MQ46JU.js → chunk-DJEDUAEJ.js} +1 -1
  14. package/{chunk-C5RNVTX6.js → chunk-DUYRB53D.js} +1 -1
  15. package/{chunk-F5SNXI4Q.js → chunk-EE27B3OV.js} +1 -1
  16. package/{chunk-ZMSYEF6G.js → chunk-GRVTXORM.js} +1 -1
  17. package/chunk-HRHF3TYJ.js +1 -0
  18. package/{chunk-XHIPGS6J.js → chunk-IGYSPFE7.js} +1 -1
  19. package/{chunk-MI7UAY44.js → chunk-JRLBD7M4.js} +1 -1
  20. package/chunk-K6G7ALTG.js +1 -0
  21. package/{chunk-JZRRR52Q.js → chunk-NDRKUUWC.js} +1 -1
  22. package/{chunk-POPZ47SS.js → chunk-OL7C46LY.js} +1 -1
  23. package/chunk-P3D2ZP6W.js +11 -0
  24. package/{chunk-44X4A7WY.js → chunk-PMRQJTYP.js} +1 -1
  25. package/{chunk-AMTYI2HA.js → chunk-Q2UQ5J3C.js} +1 -1
  26. package/{chunk-NQAH5AL7.js → chunk-QBBHHRS4.js} +1 -1
  27. package/{chunk-VIXVL2MX.js → chunk-S53N5WRU.js} +1 -1
  28. package/chunk-SXUG3CGT.js +1 -0
  29. package/{chunk-FRPWQ4C3.js → chunk-T4BXBCQI.js} +1 -1
  30. package/{chunk-ZESQ7CXK.js → chunk-TKB2SB6D.js} +1 -1
  31. package/{chunk-O64YAUSG.js → chunk-TX7JDBPD.js} +1 -1
  32. package/chunk-W3YBKYPJ.js +1 -0
  33. package/{chunk-BAGYEJI6.js → chunk-W67KMV7H.js} +1 -1
  34. package/{chunk-LODLMHG5.js → chunk-XLMLR5EV.js} +1 -1
  35. package/{chunk-XZH2SXWG.js → chunk-XS4CJ2AE.js} +1 -1
  36. package/index.html +1 -1
  37. package/{main-CMOWV2QF.js → main-MW67CCYR.js} +1 -1
  38. package/package.json +1 -1
  39. package/chunk-3TJKPVBA.js +0 -1
  40. package/chunk-4AQZL2UM.js +0 -1
  41. package/chunk-LPAIFT5I.js +0 -11
  42. package/chunk-MUFBZIQA.js +0 -1
  43. package/chunk-P7OUKLCO.js +0 -1
  44. package/chunk-PE34XFKC.js +0 -1
  45. package/chunk-SQNRZYPW.js +0 -1
  46. package/chunk-VLC2XPEM.js +0 -1
  47. package/chunk-VVQRXJRI.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as He}from"./chunk-HSHF5HR7.js";import{a as je}from"./chunk-HUZXJWCG.js";import{A as ke,B as de,H as J,J as $e,K as Be,L as Ve,P as We,W as Ge,a as ae,c as G,e as z,i as j,k as ce,s as H,u as Ie,y as Ae,z as Le}from"./chunk-UNMDSCAN.js";import{c as ze}from"./chunk-CFNARBNK.js";import{_ as we}from"./chunk-7AVOHYTE.js";import{$ as P,Ab as c,Bb as oe,E as ue,Fb as Ee,Gb as Me,Gc as xe,Hb as pe,Ib as A,Mc as D,Pa as g,Pb as be,Qb as Pe,Qc as Re,Rb as I,Rc as f,Sb as K,Sc as _e,Tb as Q,Vb as y,W as ee,Xb as h,Yb as W,Zb as v,aa as N,cb as V,cc as Ne,dc as Se,ec as ge,fc as re,gc as R,hb as q,jc as E,kc as ve,l as me,la as C,lc as Oe,mc as Fe,na as x,oc as L,p as X,pc as k,qc as $,rb as te,sb as O,tb as F,ub as Te,v as fe,wb as ne,wc as se,xb as ie,xc as ye,yb as b,yc as le,z as Ce,zb as a,zc as De}from"./chunk-26Z7TPJB.js";import{a as Y,b as Z}from"./chunk-7CGTOI24.js";var Ze=[[["label"]],[["","prefix",""]],[["","suffix",""]]],et=["label","[prefix]","[suffix]"];function tt(o,t){if(o&1&&E(0),o&2){let e=t.$implicit,n=h();Fe("",e.label,"",n.hasPerSecond()?"/s":"")}}var nt=["throttle-upload","throttle-download"],it=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],ot=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},Je=class o{customId=f();inputType=f();timespan=C(0);unit=C("MB");sizeOptions=C(it);readonly=C(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&nt.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=x(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=ot(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=V({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[se([{provide:ae,useExisting:o,multi:!0}])],ngContentSelectors:et,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&&(W(Ze),a(0,"div",0),v(1,0,["ngProjectAs","label",5,["label"]]),c(),a(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(n.timespan,r)||(n.timespan=r),r}),c(),v(4,1),v(5,2),c(),a(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(n.unit,r)||(n.unit=r),r}),c(),q(8,tt,1,2,"ng-template"),c()),e&2&&(g(2),te("readonly",n.readonly()||void 0),g(),b("id",n.customId()),L("ngModel",n.timespan),b("disabled",n.readonly()),g(3),re("--miw",0),b("options",n.sizeOptions())("readonly",n.readonly())("isClearable",!1),g(),L("ngModel",n.unit))},dependencies:[We,J,H,G,ce,z,j],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var rt=["treeContainer"],st=["formRef"],lt=[[["label"]],[["label"]],[["input"]]],at=["label","label","input"],ct=o=>({children:o,level:0}),Ke=o=>({$implicit:o}),dt=(o,t)=>({children:o,level:t}),ut=()=>({maxWidth:"700px",width:"100%"}),pt=(o,t)=>t.id;function gt(o,t){if(o&1){let e=A();a(0,"sh-button-group",10)(1,"button",20),y("click",function(){P(e);let i=h();return N(i.pathDiscoveryMethod.set("browse"))}),I(2,4),c(),a(3,"button",20),y("click",function(){P(e);let i=h();return N(i.pathDiscoveryMethod.set("path"))}),I(4,5),c()()}if(o&2){let e=h();g(),R("active",e.pathDiscoveryMethod()==="browse"),g(2),R("active",e.pathDiscoveryMethod()==="path")}}function _t(o,t){o&1&&oe(0,"sh-progress-bar",13)}function ht(o,t){o&1&&(a(0,"sh-icon",25),E(1,"caret-down"),c())}function mt(o,t){o&1&&oe(0,"sh-icon",25)}function ft(o,t){o&1&&(a(0,"sh-icon",25),E(1,"spinner"),c())}function Ct(o,t){o&1&&(a(0,"sh-icon",25),E(1,"caret-right"),c())}function Tt(o,t){o&1&&(a(0,"sh-icon",23),E(1,"folder-open"),c())}function Et(o,t){o&1&&(a(0,"sh-icon",23),E(1,"folder-user"),c())}function Mt(o,t){o&1&&(a(0,"sh-icon",23),E(1,"file"),c())}function bt(o,t){o&1&&(a(0,"sh-icon",23),E(1,"folder"),c())}function Pt(o,t){if(o&1&&(O(0,ht,2,0,"sh-icon",25)(1,mt,1,0,"sh-icon",25)(2,ft,2,0,"sh-icon",25)(3,Ct,2,0,"sh-icon",25),O(4,Tt,2,0,"sh-icon",23)(5,Et,2,0,"sh-icon",23)(6,Mt,2,0,"sh-icon",23)(7,bt,2,0,"sh-icon",23)),o&2){let e=h(2).$implicit,n=h(2);F(e.children.length?0:e.cls==="file"?1:e.id===n.isLoading()?2:3),g(4),F(e.children.length?4:e.id==="%HOME%"?5:e.cls==="file"?6:7)}}function Nt(o,t){o&1&&(a(0,"sh-icon",23),E(1,"desktop-tower"),c())}function St(o,t){o&1&&pe(0)}function vt(o,t){if(o&1&&q(0,St,1,0,"ng-container",14),o&2){let e=h(2).$implicit,n=h().$implicit;h();let i=ge(7);b("ngTemplateOutlet",i)("ngTemplateOutletContext",le(5,Ke,De(2,dt,e.children,n.level+1)))}}function Ot(o,t){if(o&1){let e=A();a(0,"div",21,3),y("click",function(){P(e);let i=h().$implicit,r=h(2);return N(r.toggleNode(i.id,i))}),a(2,"div",22),O(3,Pt,8,2)(4,Nt,2,0,"sh-icon",23),c(),a(5,"div",24),y("click",function(i){P(e);let r=h().$implicit,d=h(2);return N(d.toggleSelectedNode(i,r))}),E(6),c()(),O(7,vt,1,7,"ng-container")}if(o&2){let e=h().$implicit,n=h().$implicit,i=h();R("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)("loading",i.isLoading()===e.id),g(2),R("file",e.cls==="file"),g(),F(e.id!=="/"?3:4),g(3),Oe(" ",e.text," "),g(),F(e.children.length>0?7:-1)}}function Ft(o,t){if(o&1&&O(0,Ot,8,19),o&2){let e=t.$implicit,n=h(2);F(e.hidden&&n._showHiddenNodes()||!e.hidden?0:-1)}}function yt(o,t){if(o&1&&(a(0,"sh-list"),ne(1,Ft,1,1,null,null,pt),c()),o&2){let e=t.$implicit;re("padding-left",e.level*.25,"rem"),g(),ie(e.children)}}function Dt(o,t){o&1&&pe(0)}function xt(o,t){if(o&1){let e=A();a(0,"sh-toggle",26),y("click",function(){P(e);let i=h();return N(i._showHiddenNodes.set(!i._showHiddenNodes()))}),I(1,6),c()}if(o&2){let e=h();R("active",e._showHiddenNodes()),g(),K(e.showFiles()?"files":"folders"),Q(1)}}function Rt(o,t){if(o&1){let e=A();a(0,"button",27),y("click",function(){P(e);let i=h();return N(i.openCreateFolderDialog())}),I(1,7),c()}if(o&2){let e=h();b("disabled",!e.isCurrentPathFolder())}}function wt(o,t){if(o&1){let e=A();a(0,"sh-dialog",28),$("isOpenChange",function(i){P(e);let r=h();return k(r.createFolderDialogOpen,i)||(r.createFolderDialogOpen=i),N(i)}),a(1,"header",29)(2,"h2"),I(3,8),c()(),a(4,"div",30)(5,"div"),E(6," Folder will be created under "),a(7,"pre"),E(8),c()(),a(9,"sh-form-field")(10,"textarea",31),$("ngModelChange",function(i){P(e);let r=h();return k(r.createFolderPath,i)||(r.createFolderPath=i),N(i)}),c()()(),a(11,"footer",32)(12,"button",33),y("click",function(){P(e);let i=h();return N(i.closeCreateFolderDialog(!1))}),E(13,"Cancel"),c(),a(14,"button",34),y("click",function(){P(e);let i=h();return N(i.closeCreateFolderDialog(!0))}),be(15,9),oe(16,"sh-icon"),Pe(),c()()()}if(o&2){let e,n=h();L("isOpen",n.createFolderDialogOpen),b("options",ye(5,ut)),g(8),ve(n.currentPath()),g(2),L("ngModel",n.createFolderPath),g(4),b("disabled",!((e=n.createFolderPath())!=null&&e.length))}}var Qe=(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))(Qe||{}),S="/",he=class o{#e=ee(ze);#i=ee(je);#d=ee(Le);multiSelect=f(!1);disabled=f(!1);showFiles=f(!1);selectFiles=f(!1);accepts=f(null);startingPath=f(null);rootPaths=f([]);initialNodes=f([]);backupSettings=f(null);pathRefreshTrigger=f(!1);showHiddenNodes=f(!1);enableCreateFolder=f(!1);hideShortcuts=f(!1);office365Mode=f(!1);backupId=f("");destinationUrl=f("");loadExtendedData=f(!0);hasExtendedData=Re();_showHiddenNodes=C(!1);createFolderDialogOpen=C(!1);createFolderPath=C(null);treeContainerRef=_e("treeContainer");formRef=_e("formRef");pathDiscoveryMethod=C("browse");isLoading=C(null);currentPath=C("/");#o=C(null);treeSearchQuery=C("");treeNodes=C([]);pathDelimiter=D(()=>this.#i.systemInfo()?.DirectorySeparator??"");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=Qe;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(u=>u!==""&&u!==S),n=structuredClone(e);for(let u=0;u<n.length;u++){let T=n[u].slice(1);if(T.startsWith("{")&&T.endsWith("}")){let m=T.slice(1,-1),_=this.filterGroups?.FilterGroups[m];if(_&&_.length){let w=_.map(M=>`-${M}`);n.splice(u,1,...w)}}}let i=this.searchableTreeNodes(),r=this.rootPaths(),d=this.accepts(),l=this.pathDelimiter(),s=[];return r.length>0?s=r.map(u=>{let p=this.#r(n,u,"folder",null);return{id:u,resolvedpath:u,text:u,parentPath:"",children:[],evalState:p,isIndeterminate:!1,cls:this.#t(u,l)?"folder":"file"}}):s=[{id:S,resolvedpath:S,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(u=>{let p=new Map;if(!u.id)return;let T=u.id;d&&(u.accepted=!0),p.set(T,u);let m=r.length>0?i.filter(_=>_.parentPath.startsWith(T)):i;for(let _ of m){if(!_.id)continue;let w=_.id;if(!_.cls||p.has(w))continue;let M=p.get(_.parentPath),U=_.hidden===!0&&t?0:this.#r(n,w,_.cls,M),B=Z(Y({},_),{isIndeterminate:this.isIndeterminate(n,w),evalState:U,children:[]});d&&(B.accepted=this.matchAccepts(d,B)),p.set(w,B),M&&M.children.push(B)}return u}),s});#u(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===S?t:t+e:S}#r(t,e,n,i){if(i&&i.evalState===-1)return-2;let r=0,d=this.pathDelimiter(),l=t.filter(p=>!p.startsWith("-")&&!p.startsWith("+")),s=t.filter(p=>p.startsWith("-")||p.startsWith("+")),u=this.multiSelect();if(l.length===0)return r;for(let p=0;p<l.length;p++){let T=l[p];if(e===T){r=1;break}if(!u||!this.#t(T,d))continue;if(e?.startsWith(T)){r=1;break}}if(s.length===0)return r;for(let p=0;p<s.length;p++){let T=s[p],m=T.slice(1),_=T.startsWith("-")?-1:1;if(this.#t(m,d)){if(n!=="folder")continue;if(e===m){r=_;break}}if(m.startsWith("*")&&m.endsWith(`*${d}`)){if(n!=="folder")continue;let M=m.slice(1,-2);if(M==="")break;if(e?.includes(M+d)){r=_;break}}if(m.startsWith("[.*")&&m.endsWith(`[^\\${d}]*]`)){if(n!=="file")continue;let M=m.slice(3,-7);if(new RegExp(M).test(e)){r=_;break}}if(m.startsWith("[")&&m.endsWith("]")){let M=m.slice(1,-1),U=this.translateCSharpRegex(M);if(new RegExp(`${U}`).test(e)){r=_;break}}if(m.startsWith("*.")){if(n!=="file"||m.replace("*.","").length===0)continue;if(this.#s(e,m,!0)){r=_;break}}if(m==="")continue;if(m===e){r=_;break}if(this.#s(e,m,!0)){r=_;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let n=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(n,(i,r,d)=>`(${d})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(n=>!n.startsWith("-")&&this.#t(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=x(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=x(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();if(t==="browse"&&e){let n=e.value;if(n==null||n==="")return;this.currentPath.set(n)}});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===S)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=x(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=x(()=>{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.#m(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:this.#c(i.text,i?.Metadata),iconCls:i.iconCls,fileSize:i.fileSize,resolvedpath:i.resolvedpath,parentPath:this.getParentPath(i.id??"")}))),this.#n(null,e[0])):this.#n(null,S)}}getParentPath(t){let e=this.pathDelimiter(),n=t.split(e);return n.length<=1?S:(n.pop(),n.length!==0&&n.pop(),n.join(e)+e)}toggleSelectedNode(t,e){if(e.id===S||(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!==S),d=this.isChildOfSelected(e)?`-${e.id}`:e.id,l=this.#t(e.id,this.pathDelimiter());if(this.multiSelect())if(i.includes(e.id))this.currentPath.set(i.filter(s=>s!==e.id&&!(l&&s.startsWith(d))).join("\0"));else if(i.some(s=>s==d))this.currentPath.set(i.filter(s=>s!==d).join("\0"));else{let s=l?i.filter(u=>!u.startsWith(e.id)):i;this.currentPath.set([...s,d].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!==S&&this.#t(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.#u(e),r=n+i;this.#e.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#n(null,n),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:d=>{let l=d?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=l?l[1]:d?.message||$localize`An error occurred while trying to create the folder.`;this.#d.open(He,{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}#g(t){return this.#e.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#_(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":this.backupId()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(X(e=>{let n=e.Result;return Object.keys(n).map(i=>({Path:i,Metadata:JSON.parse(n[i])}))}))}#h(t){let e=this.backupSettings();if(this.#i.hasV2ListOperations())return this.#e.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0,ReturnExtended:this.office365Mode()||this.loadExtendedData()}}).pipe(X(n=>n.Data??[]));{let n={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#e.getApiV1BackupByIdFiles(n).pipe(X(i=>i.Files??[]))}}#a(t){return this.office365Mode()?this.#_(t):this.isByBackupSettings()?this.#h(t):this.#g(t)}#m(t){let e=this.pathDelimiter(),i=t.split("\0").filter(l=>!l.startsWith("-")&&!l.startsWith("+")&&!l.startsWith("@")).filter(Boolean).map(l=>{let s=l.split(e);return s.at(-1)!==""&&s.pop(),s}),r=[S];i.forEach(l=>{l.forEach((s,u)=>{let p=l.slice(0,u+1).join(e)+e;p===""||p===e||r.includes(p)||r.push(p)})});let d=r.map(l=>(this.isLoading.set(l),this.#a(l).pipe(X(s=>({status:"success",value:s,url:l})),Ce(s=>me({status:"error",value:s,url:l})))));fe(d).pipe(ue(()=>this.isLoading.set(null))).subscribe({next:l=>{let s=l.filter(p=>p.status==="success"),u=l.filter(p=>p.status==="error");this.treeNodes.update(p=>{let T=s.flatMap(_=>Array.isArray(_.value)?_.value.map(w=>Z(Y({},w),{parentPath:_.url})):[]),m=[...new Map([...p,...T].map(_=>[_.id,_])).values()];return this.#l(),this.hideShortcuts()?m.filter(_=>!_.id.startsWith("%")):m})}})}#c(t,e){if(e){let n=e["o365:Name"]||e["o365:DisplayName"]||e["gsuite:Name"]||e["gsuite:DisplayName"];if(n)return n}return t}#f(t){t&&t.ExtType&&t.ExtType.length>0&&this.hasExtendedData.emit(t.ExtType)}#t(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#n(t=null,e=S){let n=this.pathDelimiter();this.isLoading.set(e),this.#a(e).pipe(ue(()=>this.isLoading.set(null))).subscribe({next:i=>{let r=this.isByBackupSettings()||this.office365Mode()?i.map(d=>(this.#f(d.Metadata),{text:this.#c(d.Path.split(n).filter(s=>s!=="").pop(),d.Metadata),id:d.Path,cls:this.#t(d.Path,n)?"folder":"file",leaf:t!==null,resolvedpath:d.Path,hidden:!1})):i;this.treeNodes.update(d=>{let l=r.map(u=>{let p=this.#t(u.id,n)?"folder":"file";return Z(Y({},u),{cls:p,parentPath:e})}),s=[...new Map([...d,...l].map(u=>[u.id,u])).values()];return this.hideShortcuts()?s.filter(u=>!u.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,n){e&1&&Ne(n.treeContainerRef,rt,5)(n.formRef,st,5),e&2&&Se(2)},hostVars:2,hostBindings:function(e,n){e&2&&R("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"],office365Mode:[1,"office365Mode"],backupId:[1,"backupId"],destinationUrl:[1,"destinationUrl"],loadExtendedData:[1,"loadExtendedData"]},outputs:{hasExtendedData:"hasExtendedData"},ngContentSelectors:at,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 d;return d=$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,d,[1,"type-b","small"],[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){if(e&1&&(W(lt),O(0,gt,5,4,"sh-button-group",10),a(1,"div",11),v(2,0,["ngProjectAs","label",5,["label"]]),a(3,"div",12,0),O(5,_t,1,0,"sh-progress-bar",13),q(6,yt,3,2,"ng-template",null,1,xe)(8,Dt,1,0,"ng-container",14),c(),a(9,"div",15),O(10,xt,2,3,"sh-toggle",16),O(11,Rt,2,1,"button",17),c()(),a(12,"div",18,2)(14,"sh-form-field"),v(15,1,["ngProjectAs","label",5,["label"]]),v(16,2,["ngProjectAs","input",5,["input"]]),c()(),O(17,wt,17,6,"sh-dialog",19)),e&2){let i=ge(7);F(!n.multiSelect()&&!n.office365Mode()?0:-1),g(),R("hidden",n.pathDiscoveryMethod()!=="browse"),g(2),R("visualize-accepted",n.accepts()),g(2),F(n.isLoading()!=null?5:-1),g(3),b("ngTemplateOutlet",i)("ngTemplateOutletContext",le(15,Ke,le(13,ct,n.treeStructure()))),g(2),F(!n.accepts()&&!n.isByBackupSettings()&&!n.office365Mode()?10:-1),g(),F(n.enableCreateFolder()&&!n.office365Mode()?11:-1),g(),R("hidden",n.pathDiscoveryMethod()!=="path"),g(5),F(n.createFolderDialogOpen()?17:-1)}},dependencies:[de,ke,Ge,Ie,J,$e,Ve,Ae,we,H,G,z,j],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].loading[_ngcontent-%COMP%]{opacity:.7}.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 It=[[["label"]],[["","prefix",""]],[["","suffix",""]]],At=["label","[prefix]","[suffix]"];function Lt(o,t){if(o&1){let e=A();a(0,"button",7),y("click",function(){let i=P(e).$implicit,r=h();return N(r.updateUnit(i.value))}),I(1,1),c()}if(o&2){let e=t.$implicit;g(),K(e.label),Q(1)}}var kt=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],$t=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],Bt=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],Ye=class o{customId=f();inputType=f();timespan=C(0);#e="D";unit=C(this.#e);unitLabel=D(()=>{let t=this.timeOptions(),e=t.findIndex(n=>n.value===this.unit());return t[e]?.label??this.unit()});isShortTime=D(()=>{let t=this.inputType();return t&&Bt.includes(t.replace("--",""))});timeOptions=D(()=>this.isShortTime()?kt:$t);readonly=C(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=x(()=>{this.onChange(this.getValue())});inputTypeEffect=x(()=>{let t=this.timeOptions(),e=this.isShortTime()?"s":"D";this.#e=e,this.unit.set(e)});updateUnit(t){this.unit.set(t)}writeValue(t){let e=this.isShortTime();if(t){let n=e?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,i=t.match(n);i?(this.timespan.set(parseInt(i[1],10)),this.unit.set(i[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}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=V({type:o,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[se([{provide:ae,useExisting:o,multi:!0}])],ngContentSelectors:At,decls:11,vars:6,consts:()=>{let t;t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;return e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`,[t,e,["type","number",3,"ngModelChange","id","ngModel","disabled"],[3,"openIndicator"],["shButton","","type","button",1,"trigger"],["menu",""],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"]]},template:function(e,n){e&1&&(W(It),v(0,0,["ngProjectAs","label",5,["label"]]),a(1,"sh-form-field")(2,"input",2),$("ngModelChange",function(r){return k(n.timespan,r)||(n.timespan=r),r}),c(),v(3,1),v(4,2),c(),a(5,"sh-menu",3)(6,"button",4),I(7,0),c(),Ee(8,5),ne(9,Lt,2,1,"button",6,Te),Me(),c()),e&2&&(g(),te("readonly",n.readonly()||void 0),g(),b("id",n.customId()),L("ngModel",n.timespan),b("disabled",n.readonly()),g(3),b("openIndicator",!0),g(2),K(n.unitLabel()),Q(7),g(2),ie(n.timeOptions()))},dependencies:[Be,J,H,G,ce,z,j,de],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-menu[_ngcontent-%COMP%]{grid-area:unit}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%] button.trigger[_ngcontent-%COMP%]{width:100%}'],changeDetection:0})};export{it as a,ot as b,Je as c,he as d,Ye as e};
@@ -1 +1 @@
1
- import{a as _e}from"./chunk-F5SNXI4Q.js";import"./chunk-Q74O3CWJ.js";import"./chunk-3TJKPVBA.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import{a as se}from"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import{a as b}from"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{a as le,b as m}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ae,H as ie,Y as ne,c as Q,e as Y,i as Z,s as x,u as ee,z as te}from"./chunk-UNMDSCAN.js";import{c as oe}from"./chunk-CFNARBNK.js";import{b as q,e as j}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Ab as i,B as G,Bb as c,C as g,D as L,E as p,Mc as E,Pa as _,Pb as u,Qb as h,Rb as A,Sb as H,Tb as J,Vb as T,W as F,cb as V,gc as C,ic as K,jc as D,la as s,na as P,oc as X,p as y,pc as z,qc as W,sb as w,tb as U,yb as d,zb as n}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";function re(r,t){r&1&&(n(0,"sh-icon",19),D(1,"spinner"),i())}function ce(r,t){r&1&&(n(0,"sh-icon",20),D(1,"check"),i())}function de(r,t){r&1&&(n(0,"sh-icon",21),D(1,"warning"),i()),r&2&&d("shTooltip","File not found")}function ue(r,t){let a=le(r).pipe(G(t),L());return m(a,{initialValue:r()})}var N=class r{#o=F(q);#s=F(se);#e=F(oe);#a=F(te);#t=s("");backupId=m(this.#o.params.pipe(y(t=>t.id)));activeBackup=E(()=>this.#s.backups().find(t=>t.Backup?.ID===this.backupId()));backupFilePath=s("");lastValidatedPath=s("");isValidatedPath=E(()=>this.lastValidatedPath()===this.backupFilePath());pathHasChanged=E(()=>this.backupFilePath()!==this.#t());isValidatingPath=s(!1);#i=ue(this.backupFilePath,500);#n=s(!1);isWaitingForValidation=E(()=>this.#i()!=this.backupFilePath()||this.isValidatingPath());backupFilePathEffect=P(()=>{let t=this.#i(),a=this.activeBackup(),e=this.#n();t!==""&&(this.isValidatingPath.set(!0),this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).pipe(g(1),p(()=>this.isValidatingPath.set(!1))).subscribe(()=>this.lastValidatedPath.set(t)))});isRestoring=s(!1);isRepairing=s(!1);isDeleting=s(!1);isSavingDbPath=s(!1);isSavingAndRepairing=s(!1);isMovingDb=s(!1);isCreatingBugReport=s(!1);createdReport=s(!1);activeBackupEffect=P(()=>{let t=this.activeBackup();if(!t)return;let a=t.Backup?.DBPath??"";this.backupFilePath.set(a),this.#t.set(a)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),p(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(t=null){this.isValidatedPath()?this.#a.open(b,{data:{title:$localize`Confirm delete?`,message:$localize`Do you really want to delete the database for ${this.activeBackup()?.Backup?.Name}?`,confirmText:$localize`Delete database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doDeleteDatabase(t)}}):this.doDeleteDatabase(t)}doDeleteDatabase(t=null){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),p(()=>this.isDeleting.set(!1))).subscribe(()=>{this.lastValidatedPath.set(""),t?.()})}restoreDatabase(){this.isValidatedPath()?this.deleteDatabase(()=>{this.doRepairDatabase()}):this.doRepairDatabase()}doRepairDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId(),requestBody:{refresh_lock_info:!0}}).pipe(g(1),p(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t())}saveDatabasePath(t=null){this.isValidatedPath()?this.#a.open(b,{data:{title:$localize`Confirm reassign?`,message:$localize`The target database path already exists and may belong to another backup. Are you sure you want to assign this backup to an existing database?`,confirmText:$localize`Assign existing database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doSaveDatabasePath(t)}}):this.doSaveDatabasePath(t)}doSaveDatabasePath(t=null){this.isSavingDbPath.set(!0);let a=this.backupFilePath();this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:a}}).pipe(p(()=>this.isSavingDbPath.set(!1))).subscribe(()=>{this.#t.set(a),t?.()})}saveAndRepairDatabasePath(){this.saveDatabasePath(()=>(this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),p(()=>this.isSavingAndRepairing.set(!1))).subscribe()))}moveDatabasePath(){this.isMovingDb.set(!0);let t=this.backupFilePath();this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:t}}).pipe(p(()=>this.isMovingDb.set(!1))).subscribe(()=>{this.#n.update(a=>!a),this.#t.set(t)})}createErrorReport(){this.isCreatingBugReport.set(!0),this.#e.postApiV1BackupByIdCreatereport({id:this.backupId()}).pipe(p(()=>this.isCreatingBugReport.set(!1))).subscribe({next:()=>{this.createdReport.set(!0),window.setTimeout(()=>this.createdReport.set(!1),3e3)}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=V({type:r,selectors:[["app-database"]],decls:50,vars:21,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let a;a=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let o;o=$localize`Maintenance`;let S;S=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. The bug report button can be used to create a copy of the database with path information removed. This should only be used if a developer requests to investigate an issue with your database. `;let f;f=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Repair `;let I;I=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let M;M=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SH_ICON: Recreate (delete and repair) `;let R;R=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:file-plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Create bug report database `;let B;B=$localize`Placement`;let O;O=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:backspace${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON: Reset `;let $;$=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Save `;let v;v=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SH_ICON: Save & Repair `;let k;return k=$localize`${"\uFFFD#49\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#49\uFFFD"}:CLOSE_TAG_SH_ICON: Move existing database `,[t,a,e,o,S,f,I,M,R,B,O,$,v,k,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"actions","maintenance"],["shButton","",3,"click","disabled"],["type","text",3,"ngModelChange","ngModel"],["prefix","",1,"primary"],["prefix",""],["prefix","",3,"shTooltip"],[1,"actions","placement"]]},template:function(a,e){if(a&1&&(c(0,"app-status-bar"),n(1,"section")(2,"div",14)(3,"button",15),u(4,0),c(5,"sh-icon"),h(),i()(),n(6,"article")(7,"h1"),A(8,1),i(),n(9,"p"),A(10,2),i()(),n(11,"article")(12,"h2"),A(13,3),i(),n(14,"p"),A(15,4),i(),n(16,"div",16)(17,"button",17),T("click",function(){return e.repairDatabase()}),u(18,5),c(19,"sh-icon"),h(),i(),n(20,"button",17),T("click",function(){return e.deleteDatabase()}),u(21,6),c(22,"sh-icon"),h(),i(),n(23,"button",17),T("click",function(){return e.restoreDatabase()}),u(24,7),c(25,"sh-icon"),h(),i(),n(26,"button",17),T("click",function(){return e.createErrorReport()}),u(27,8),c(28,"sh-icon"),h(),i()()(),n(29,"article")(30,"h2"),A(31,9),i(),n(32,"sh-form-field")(33,"input",18),W("ngModelChange",function(S){return z(e.backupFilePath,S)||(e.backupFilePath=S),S}),i(),w(34,re,2,0,"sh-icon",19)(35,ce,2,0,"sh-icon",20)(36,de,2,1,"sh-icon",21),i(),n(37,"div",22)(38,"button",17),T("click",function(){return e.resetDatabasePath()}),u(39,10),c(40,"sh-icon"),h(),i(),n(41,"button",17),T("click",function(){return e.saveDatabasePath()}),u(42,11),c(43,"sh-icon"),h(),i(),n(44,"button",17),T("click",function(){return e.saveAndRepairDatabasePath()}),u(45,12),c(46,"sh-icon"),h(),i(),n(47,"button",17),T("click",function(){return e.moveDatabasePath()}),u(48,13),c(49,"sh-icon"),h(),i()()()()),a&2){let o;_(8),H((o=e.activeBackup())==null||o.Backup==null?null:o.Backup.Name),J(8),_(9),C("loader",e.isRepairing()),d("disabled",!e.isValidatedPath()||e.pathHasChanged()),_(3),C("loader",e.isDeleting()),d("disabled",!e.isValidatedPath()||e.pathHasChanged()),_(3),C("loader",e.isRestoring()),d("disabled",e.pathHasChanged()),_(3),C("loader",e.isCreatingBugReport()),d("disabled",e.isCreatingBugReport()||!e.isValidatedPath()||e.pathHasChanged()),_(6),K(e.isValidatedPath()?"success":"error"),_(),X("ngModel",e.backupFilePath),_(),U(e.isWaitingForValidation()?34:e.isValidatedPath()?35:36),_(4),d("disabled",!e.pathHasChanged()),_(3),d("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),_(3),d("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),_(3),d("disabled",!e.pathHasChanged()||e.isValidatedPath()||e.isWaitingForValidation())}},dependencies:[x,Q,Y,Z,_e,ae,ie,ee,ne,j],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{N as default};
1
+ import{a as _e}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import{a as se}from"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import{a as b}from"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{a as le,b as m}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ae,H as ie,Y as ne,c as Q,e as Y,i as Z,s as x,u as ee,z as te}from"./chunk-UNMDSCAN.js";import{c as oe}from"./chunk-CFNARBNK.js";import{b as q,e as j}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Ab as i,B as G,Bb as c,C as g,D as L,E as p,Mc as E,Pa as _,Pb as u,Qb as h,Rb as A,Sb as H,Tb as J,Vb as T,W as F,cb as V,gc as C,ic as K,jc as D,la as s,na as P,oc as X,p as y,pc as z,qc as W,sb as w,tb as U,yb as d,zb as n}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";function re(r,t){r&1&&(n(0,"sh-icon",19),D(1,"spinner"),i())}function ce(r,t){r&1&&(n(0,"sh-icon",20),D(1,"check"),i())}function de(r,t){r&1&&(n(0,"sh-icon",21),D(1,"warning"),i()),r&2&&d("shTooltip","File not found")}function ue(r,t){let a=le(r).pipe(G(t),L());return m(a,{initialValue:r()})}var N=class r{#o=F(q);#s=F(se);#e=F(oe);#a=F(te);#t=s("");backupId=m(this.#o.params.pipe(y(t=>t.id)));activeBackup=E(()=>this.#s.backups().find(t=>t.Backup?.ID===this.backupId()));backupFilePath=s("");lastValidatedPath=s("");isValidatedPath=E(()=>this.lastValidatedPath()===this.backupFilePath());pathHasChanged=E(()=>this.backupFilePath()!==this.#t());isValidatingPath=s(!1);#i=ue(this.backupFilePath,500);#n=s(!1);isWaitingForValidation=E(()=>this.#i()!=this.backupFilePath()||this.isValidatingPath());backupFilePathEffect=P(()=>{let t=this.#i(),a=this.activeBackup(),e=this.#n();t!==""&&(this.isValidatingPath.set(!0),this.#e.postApiV1FilesystemValidate({requestBody:{path:t}}).pipe(g(1),p(()=>this.isValidatingPath.set(!1))).subscribe(()=>this.lastValidatedPath.set(t)))});isRestoring=s(!1);isRepairing=s(!1);isDeleting=s(!1);isSavingDbPath=s(!1);isSavingAndRepairing=s(!1);isMovingDb=s(!1);isCreatingBugReport=s(!1);createdReport=s(!1);activeBackupEffect=P(()=>{let t=this.activeBackup();if(!t)return;let a=t.Backup?.DBPath??"";this.backupFilePath.set(a),this.#t.set(a)});repairDatabase(){this.isRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),p(()=>this.isRepairing.set(!1))).subscribe()}deleteDatabase(t=null){this.isValidatedPath()?this.#a.open(b,{data:{title:$localize`Confirm delete?`,message:$localize`Do you really want to delete the database for ${this.activeBackup()?.Backup?.Name}?`,confirmText:$localize`Delete database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doDeleteDatabase(t)}}):this.doDeleteDatabase(t)}doDeleteDatabase(t=null){this.isDeleting.set(!0),this.#e.postApiV1BackupByIdDeletedb({id:this.backupId()}).pipe(g(1),p(()=>this.isDeleting.set(!1))).subscribe(()=>{this.lastValidatedPath.set(""),t?.()})}restoreDatabase(){this.isValidatedPath()?this.deleteDatabase(()=>{this.doRepairDatabase()}):this.doRepairDatabase()}doRepairDatabase(){this.isRestoring.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId(),requestBody:{refresh_lock_info:!0}}).pipe(g(1),p(()=>this.isRestoring.set(!1))).subscribe()}resetDatabasePath(){this.backupFilePath.set(this.#t())}saveDatabasePath(t=null){this.isValidatedPath()?this.#a.open(b,{data:{title:$localize`Confirm reassign?`,message:$localize`The target database path already exists and may belong to another backup. Are you sure you want to assign this backup to an existing database?`,confirmText:$localize`Assign existing database`,cancelText:$localize`Cancel`},closed:a=>{a&&this.doSaveDatabasePath(t)}}):this.doSaveDatabasePath(t)}doSaveDatabasePath(t=null){this.isSavingDbPath.set(!0);let a=this.backupFilePath();this.#e.postApiV1BackupByIdUpdatedb({id:this.backupId(),requestBody:{path:a}}).pipe(p(()=>this.isSavingDbPath.set(!1))).subscribe(()=>{this.#t.set(a),t?.()})}saveAndRepairDatabasePath(){this.saveDatabasePath(()=>(this.isSavingAndRepairing.set(!0),this.#e.postApiV1BackupByIdRepair({id:this.backupId()}).pipe(g(1),p(()=>this.isSavingAndRepairing.set(!1))).subscribe()))}moveDatabasePath(){this.isMovingDb.set(!0);let t=this.backupFilePath();this.#e.postApiV1BackupByIdMovedb({id:this.backupId(),requestBody:{path:t}}).pipe(p(()=>this.isMovingDb.set(!1))).subscribe(()=>{this.#n.update(a=>!a),this.#t.set(t)})}createErrorReport(){this.isCreatingBugReport.set(!0),this.#e.postApiV1BackupByIdCreatereport({id:this.backupId()}).pipe(p(()=>this.isCreatingBugReport.set(!1))).subscribe({next:()=>{this.createdReport.set(!0),window.setTimeout(()=>this.createdReport.set(!1),3e3)}})}static \u0275fac=function(a){return new(a||r)};static \u0275cmp=V({type:r,selectors:[["app-database"]],decls:50,vars:21,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let a;a=$localize`Local database for ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize` Each backup has a local database associated with it, which stores information about the remote backup on the local machine. This makes it faster to perform many operations, and reduces the amount of data that needs to be downloaded for each operation. `;let o;o=$localize`Maintenance`;let S;S=$localize` If the backup and the remote storage is out of sync, Duplicati will require that you perform a repair operation to synchronize the database. If the repair is unsuccessful, you can delete the local database and re-generate. The bug report button can be used to create a copy of the database with path information removed. This should only be used if a developer requests to investigate an issue with your database. `;let f;f=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Repair `;let I;I=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:trash${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON: Delete `;let M;M=$localize`${"\uFFFD#25\uFFFD"}:START_TAG_SH_ICON:clock-counter-clockwise${"\uFFFD/#25\uFFFD"}:CLOSE_TAG_SH_ICON: Recreate (delete and repair) `;let R;R=$localize`${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON:file-plus${"\uFFFD/#28\uFFFD"}:CLOSE_TAG_SH_ICON: Create bug report database `;let B;B=$localize`Placement`;let O;O=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:backspace${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON: Reset `;let $;$=$localize`${"\uFFFD#43\uFFFD"}:START_TAG_SH_ICON:floppy-disk${"\uFFFD/#43\uFFFD"}:CLOSE_TAG_SH_ICON: Save `;let v;v=$localize`${"\uFFFD#46\uFFFD"}:START_TAG_SH_ICON:wrench${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_SH_ICON: Save & Repair `;let k;return k=$localize`${"\uFFFD#49\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#49\uFFFD"}:CLOSE_TAG_SH_ICON: Move existing database `,[t,a,e,o,S,f,I,M,R,B,O,$,v,k,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"actions","maintenance"],["shButton","",3,"click","disabled"],["type","text",3,"ngModelChange","ngModel"],["prefix","",1,"primary"],["prefix",""],["prefix","",3,"shTooltip"],[1,"actions","placement"]]},template:function(a,e){if(a&1&&(c(0,"app-status-bar"),n(1,"section")(2,"div",14)(3,"button",15),u(4,0),c(5,"sh-icon"),h(),i()(),n(6,"article")(7,"h1"),A(8,1),i(),n(9,"p"),A(10,2),i()(),n(11,"article")(12,"h2"),A(13,3),i(),n(14,"p"),A(15,4),i(),n(16,"div",16)(17,"button",17),T("click",function(){return e.repairDatabase()}),u(18,5),c(19,"sh-icon"),h(),i(),n(20,"button",17),T("click",function(){return e.deleteDatabase()}),u(21,6),c(22,"sh-icon"),h(),i(),n(23,"button",17),T("click",function(){return e.restoreDatabase()}),u(24,7),c(25,"sh-icon"),h(),i(),n(26,"button",17),T("click",function(){return e.createErrorReport()}),u(27,8),c(28,"sh-icon"),h(),i()()(),n(29,"article")(30,"h2"),A(31,9),i(),n(32,"sh-form-field")(33,"input",18),W("ngModelChange",function(S){return z(e.backupFilePath,S)||(e.backupFilePath=S),S}),i(),w(34,re,2,0,"sh-icon",19)(35,ce,2,0,"sh-icon",20)(36,de,2,1,"sh-icon",21),i(),n(37,"div",22)(38,"button",17),T("click",function(){return e.resetDatabasePath()}),u(39,10),c(40,"sh-icon"),h(),i(),n(41,"button",17),T("click",function(){return e.saveDatabasePath()}),u(42,11),c(43,"sh-icon"),h(),i(),n(44,"button",17),T("click",function(){return e.saveAndRepairDatabasePath()}),u(45,12),c(46,"sh-icon"),h(),i(),n(47,"button",17),T("click",function(){return e.moveDatabasePath()}),u(48,13),c(49,"sh-icon"),h(),i()()()()),a&2){let o;_(8),H((o=e.activeBackup())==null||o.Backup==null?null:o.Backup.Name),J(8),_(9),C("loader",e.isRepairing()),d("disabled",!e.isValidatedPath()||e.pathHasChanged()),_(3),C("loader",e.isDeleting()),d("disabled",!e.isValidatedPath()||e.pathHasChanged()),_(3),C("loader",e.isRestoring()),d("disabled",e.pathHasChanged()),_(3),C("loader",e.isCreatingBugReport()),d("disabled",e.isCreatingBugReport()||!e.isValidatedPath()||e.pathHasChanged()),_(6),K(e.isValidatedPath()?"success":"error"),_(),X("ngModel",e.backupFilePath),_(),U(e.isWaitingForValidation()?34:e.isValidatedPath()?35:36),_(4),d("disabled",!e.pathHasChanged()),_(3),d("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),_(3),d("disabled",!e.pathHasChanged()||e.isWaitingForValidation()),_(3),d("disabled",!e.pathHasChanged()||e.isValidatedPath()||e.isWaitingForValidation())}},dependencies:[x,Q,Y,Z,_e,ae,ie,ee,ne,j],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem;padding:2rem}article[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}h1[_ngcontent-%COMP%]{font:var(--title-20)}h2[_ngcontent-%COMP%]{font:var(--title-30)}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}"],changeDetection:0})};export{N as default};
@@ -1 +1 @@
1
- import{c as a,d as b}from"./chunk-4AQZL2UM.js";import"./chunk-POPZ47SS.js";import"./chunk-LPAIFT5I.js";import"./chunk-MUFBZIQA.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as createEncryptionForm,b as default};
1
+ import{c as a,d as b}from"./chunk-K6G7ALTG.js";import"./chunk-OL7C46LY.js";import"./chunk-P3D2ZP6W.js";import"./chunk-HRHF3TYJ.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-D6IP567E.js";import"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import"./chunk-UNMDSCAN.js";import"./chunk-CFNARBNK.js";import"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";export{a as createEncryptionForm,b as default};
@@ -0,0 +1 @@
1
+ import{a as Ze}from"./chunk-OL7C46LY.js";import{h as Ke,m as Qe}from"./chunk-P3D2ZP6W.js";import{d as re}from"./chunk-HRHF3TYJ.js";import{a as je}from"./chunk-SZUNW4JO.js";import{a as D}from"./chunk-HSHF5HR7.js";import{b as _e}from"./chunk-VDSX2M4H.js";import{b as qe}from"./chunk-ZU6T3TW3.js";import{a as K}from"./chunk-HUZXJWCG.js";import{B as j,H as ze,L as Je,M as Xe,P as Ue,V as Ye,W as He,b as we,c as B,e as V,f as W,i as Be,j as z,l as Ve,p as J,q as X,r as U,s as We,t as Y,u as H,z as se}from"./chunk-UNMDSCAN.js";import{c as q}from"./chunk-CFNARBNK.js";import{b as M,d as L}from"./chunk-I27PVH6D.js";import{fa as ne}from"./chunk-7AVOHYTE.js";import{$ as P,Ab as a,Bb as p,C as Q,Cc as le,Dc as ke,E as R,Ec as xe,Fb as b,Gb as v,H as Pe,Ib as A,K as Ie,L as ee,Mc as N,Pa as d,Pb as m,Qb as T,R as Me,Rb as O,Sb as De,Tb as ye,Vb as C,W as c,Xb as f,aa as I,cb as w,g as Ce,gc as $e,hb as Le,jc as G,la as _,lc as be,m as Ne,mc as ve,na as x,oc as te,pc as ie,qc as oe,sb as g,tb as E,v as ae,w as he,wc as Ae,xc as Ge,yb as F,z as Re,zb as r}from"./chunk-26Z7TPJB.js";function rt(s,t){s&1&&(r(0,"p"),O(1,3),a())}function at(s,t){s&1&&(r(0,"sh-form-field")(1,"label",11),O(2,4),a(),p(3,"input",12),a())}var et=new U,ot=()=>et.group({passphrase:et.control("")}),ce=class s{#e=c(q);#t=c(y);#n=c(L);#o=c(M);encryptionForm=this.#t.encryptionForm;creatingTemporaryBackup=_(!1);settings=_([]);hasEncryptedBackup=N(()=>{let t=this.#t.destinationTestSignal();return t==="testing"||typeof t=="string"?!0:t?.containsEncryptedBackupFiles??!0});showEncryptionField=_(!1);next(){let t=this.#t.destinationTargetUrl();if(!t)throw new Error("No target URL");this.creatingTemporaryBackup.set(!0);let e=this.encryptionForm.value?.passphrase??null,i=[];e?i.push({Name:"--passphrase",Value:e}):i.push({Name:"--no-encryption",Value:"true"}),this.settings().forEach(o=>{let n=o.Name?.trim();n&&n!=="--"&&(n.startsWith("--")||(n=`--${n}`),i.push({Name:n,Value:o.Value??""}))}),this.#e.postApiV1Backups({requestBody:{Backup:{TargetURL:t,Settings:i}},temporary:!0}).pipe(R(()=>this.creatingTemporaryBackup.set(!1))).subscribe({next:o=>{let n=o.ID;this.#n.navigate([`/restore-draft/${n}`])},error:o=>{console.error(o)}})}back(){this.#t.isFileRestore()?this.#n.navigate(["destination"],{relativeTo:this.#o.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-restore-encryption"]],decls:14,vars:5,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize`${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let i;i=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`The backup does not contain encrypted files.`;let n;n=$localize`Enter backup passphrase if defined.`;let l;return l=$localize`Password`,[t,e,i,o,l,[3,"submit","formGroup"],["title",""],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["for","password"],["type","password","id","password","placeholder",n,"formControlName","passphrase"]]},template:function(e,i){e&1&&(r(0,"form",5),C("submit",function(){return i.next()}),g(1,rt,2,0,"p"),g(2,at,4,0,"sh-form-field"),r(3,"sh-toggle-card"),b(4,6),O(5,0),v(),r(6,"app-options-list",7),oe("optionsChange",function(n){return ie(i.settings,n)||(i.settings=n),n}),a()(),r(7,"div",8)(8,"button",9),C("click",function(){return i.back()}),m(9,1),p(10,"sh-icon"),T(),a(),r(11,"button",10),m(12,2),p(13,"sh-icon"),T(),a()()()),e&2&&(F("formGroup",i.encryptionForm),d(),E(i.hasEncryptedBackup()?-1:1),d(),E(i.hasEncryptedBackup()||i.showEncryptionField()?2:-1),d(4),te("options",i.settings),F("hasFreeTextSettings",!0))},dependencies:[Y,z,B,V,W,X,J,ze,H,j,Ye,Ze],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var lt=()=>({standalone:!0});function _t(s,t){s&1&&p(0,"sh-progress-bar",8)}function ct(s,t){if(s&1&&(G(0),le(1,"bytes")),s&2){let e=f().$implicit;be(" (",ke(1,1,e.FileSizes),") ")}}function pt(s,t){s&1&&(r(0,"span",16),O(1,4),a())}function ut(s,t){if(s&1&&(r(0,"div",15),G(1),le(2,"date"),g(3,ct,2,3),g(4,pt,2,0,"span",16),a()),s&2){let e=t.$implicit;d(),ve(" ",e.Version,": ",xe(2,4,e.Time,"medium")," "),d(2),E(e.FileSizes?3:-1),d(),E(e.IsFullBackup===!1?4:-1)}}function dt(s,t){s&1&&p(0,"sh-progress-bar",8)}function mt(s,t){if(s&1){let e=A();r(0,"app-file-tree",17),C("hasExtendedData",function(o){P(e);let n=f(2);return I(n.extendedDataType.set(o))}),r(1,"label",18),O(2,5),a(),p(3,"input",19),a()}if(s&2){let e=f(2);F("rootPaths",e.rootPaths())("initialNodes",e.initialNodes())("backupSettings",e.backupSettings())("multiSelect",!0)("showFiles",!0)("loadExtendedData",!0)}}function Tt(s,t){if(s&1){let e=A();r(0,"sh-select",12),C("cleared",function(){P(e);let o=f();return I(o.abortLoading())}),r(1,"input",13),oe("ngModelChange",function(o){P(e);let n=f();return ie(n.selectOption,o)||(n.selectOption=o),I(o)}),a(),Le(2,ut,5,7,"ng-template"),a(),g(3,dt,1,0,"sh-progress-bar",8),g(4,mt,4,6,"app-file-tree",14)}if(s&2){let e=f();F("options",e.versionOptions())("isClearable",!1),d(),te("ngModel",e.selectOption),F("ngModelOptions",Ge(6,lt)),d(2),E(e.isRepairing()||e.versionOptionsLoading()||e.loadingRootPath()?3:-1),d(),E(e.showFileTree()?4:-1)}}var ue=new U,nt=()=>ue.group({filesToRestore:ue.control(""),passphrase:ue.control(null)}),de=class s{#e=c(q);#t=c(y);#n=c(qe);#o=c(K);#i=c(L);#s=c(M);#a=c(ne);#l=null;#_=null;#r=_([]);selectFilesForm=this.#t.selectFilesForm;selectFilesFormSignal=this.#t.selectFilesFormSignal;selectOption=this.#t.selectOption;backupId=this.#t.backupId;versionOptionsLoading=this.#t.versionOptionsLoading;versionOptions=this.#t.versionOptions;isFileRestore=this.#t.isFileRestore;extendedDataType=this.#t.extendedDataType;needsDatabaseRepair=N(()=>this.#t.backup()?.Backup?.IsTemporary??!0);showFileTree=_(!1);backupSettings=_(null);rootPaths=_([]);initialNodes=_([]);loadingRootPath=_(!1);isRepairing=N(()=>this.#r().length>0);loadedVersions=_({});loadingEffect=x(()=>{if(this.versionOptionsLoading())return;let e=this.versionOptions();if(e&&e?.length>0){let i=e[0].Version;this.selectOption.set(i.toString())}});backupSettingsEffect=x(()=>{let t=this.backupId(),e=this.selectOption(),i=this.isRepairing(),o=this.loadedVersions();if(!e||!t)return;let l=this.versionOptions()?.find(Z=>Z.Version===parseInt(e))?.Time??null;if(!l)return;let u=`${t}+${l}`,h=o[u];if(this.needsDatabaseRepair()&&(!h||i))return;let $={id:t+"",time:l};this.backupSettings.set($),this.getRootPath($)});repairEffect=x(()=>{if(!this.needsDatabaseRepair())return;let t=this.selectOption(),e=this.versionOptions();if(t){let i=e.find(l=>l.Version===parseInt(t));if(i===void 0)return;let o=this.backupId(),n=`${o}+${i.Time}`;if(this.#_===n||(this.#_=n,this.#r().includes(n)))return;this.#r.update(l=>[...l,n]),this.#e.postApiV1BackupByIdRepairupdate({id:o,requestBody:{only_paths:!0,time:i.Time}}).pipe(ee(this.abortLoading$),R(()=>{this.#_=null})).subscribe(l=>{let u=l.ID;this.#n.waitForTaskToComplete(u).pipe(Q(1)).subscribe(()=>{this.#r.update(h=>h.filter($=>$!==n)),this.loadedVersions.update(h=>(h[n]=!0,h))})})}});getRootPath(t){let e={id:t.id+"",time:t.time,prefixOnly:!0,folderContents:!1},i=t.id+"";this.isRepairing()||this.#l===i||(this.#l=i,this.loadingRootPath.set(!0),this.showFileTree.set(!1),this.#o.hasV2ListOperations()?this.#e.postApiV2BackupListFolder({requestBody:{BackupId:t.id,Time:t.time,Paths:null,PageSize:0,Page:0}}).pipe(ee(this.abortLoading$),R(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1),this.#l=null})).subscribe({next:o=>{let n=(o.Data??[]).map(l=>l.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}):this.#e.getApiV1BackupByIdFiles(e).pipe(ee(this.abortLoading$),R(()=>{this.showFileTree.set(!0),this.loadingRootPath.set(!1)})).subscribe({next:o=>{let n=o.Files.map(l=>l.Path??"");n.length>0?(this.initialNodes.set([]),this.rootPaths.set(n)):(this.initialNodes.set([]),this.rootPaths.set(["/"]))}}))}abortLoading$=new Ce;abortLoading(){this.showFileTree.set(!1),this.loadingRootPath.set(!1),this.abortLoading$.next(!0)}displayFn(){let t=this.versionOptions();return e=>{if(!e)return"";let i=t?.find(o=>typeof o.Version=="number"&&o.Version.toString()===e);return i?`${i.Version}: ${this.#a.transform(i.Time,"medium")}`:""}}next(){this.#i.navigate(["options"],{relativeTo:this.#s.parent})}back(){this.#t.isFileRestore()?this.#i.navigate(["encryption"],{relativeTo:this.#s.parent}):this.#t.exit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-select-files"]],features:[Ae([ne])],decls:13,vars:3,consts:()=>{let t;t=$localize`Select files`;let e;e=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let o;o=$localize`Select an option...`;let n;n=$localize`(partial)`;let l;return l=$localize`Path`,[["formRef",""],t,e,i,n,l,[3,"submit","formGroup"],[1,"title-30"],[1,"indeterminate","primary"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],["value","Version",3,"cleared","options","isClearable"],["type","text","placeholder",o,3,"ngModelChange","ngModel","ngModelOptions"],[3,"rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],[1,"custom-option"],[1,"partial"],[3,"hasExtendedData","rootPaths","initialNodes","backupSettings","multiSelect","showFiles","loadExtendedData"],["for","path"],["type","text","id","path","formControlName","filesToRestore"]]},template:function(e,i){if(e&1){let o=A();r(0,"form",6,0),C("submit",function(){return P(o),I(i.next())}),r(2,"h3",7),O(3,1),a(),g(4,_t,1,0,"sh-progress-bar",8)(5,Tt,5,7),r(6,"div",9)(7,"button",10),C("click",function(){return P(o),I(i.back())}),m(8,2),p(9,"sh-icon"),T(),a(),r(10,"button",11),m(11,3),p(12,"sh-icon"),T(),a()()()}e&2&&(F("formGroup",i.selectFilesForm),d(4),E(i.versionOptionsLoading()?4:5),d(5),De(i.isFileRestore()?"Back":"Exit"),ye(8))},dependencies:[We,z,B,V,W,Be,Y,X,J,re,j,H,Ue,Je,ne,je],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.partial[_ngcontent-%COMP%]{color:var(--base-9);font-style:italic}"],changeDetection:0})};var y=class s{#e=c(L);#t=c(M);#n=c(K);#o=c(se);#i=c(q);backupId=_(null);backup=_(null);destinationTargetUrl=_(null);destinationTestSignal=_(null);selectFilesForm=nt();optionsForm=st();encryptionForm=ot();optionsFormSignal=_e(this.optionsForm.valueChanges);selectFilesFormSignal=_e(this.selectFilesForm.valueChanges);selectOption=_(null);versionOptionsLoading=_(!1);versionOptions=_([]);isSubmitting=_(!1);isFileRestore=_(!1);isFullWidthPage=_(!1);extendedDataType=_(null);alternateRestorePath=_(null);init(t,e=!1){this.backupId.set(t),this.isFileRestore.set(e),this.alternateRestorePath.set(null),this.extendedDataType.set(null),e&&this.#e.navigate(["/restore-from-files/destination"]),e||this.getBackup()}updateTargetUrl(t){this.destinationTargetUrl.set(t)}setAlternateRestorePath(t){this.alternateRestorePath.set(t)}submit(){this.isSubmitting.set(!0);let t=this.backupId();this.backup()?.Backup?.IsTemporary??!1?this.#i.postApiV1BackupByIdCopytotemp({id:this.backupId()??""}).subscribe({next:i=>{this.#s(i.ID??"")},error:i=>this.showErrorDialog($localize`An error occurred while copying the backup to a temporary location: ${i.message}`)}):this.#s(t??"")}showErrorDialog(t){this.#o.open(D,{data:{title:$localize`Error occured`,message:t,confirmText:$localize`OK`,cancelText:void 0},closed:e=>{}})}#s(t){let e=this.optionsForm.value,i=this.selectFilesForm.value,o=this.selectOption(),n=this.versionOptions()?.find(l=>l.Version===(o&&parseInt(o)));this.#i.postApiV1BackupByIdRestore({id:t??"",requestBody:{paths:i.filesToRestore?.split("\0").map(l=>l.endsWith("/")||l.endsWith("\\")?`${l}*`:l)??[],passphrase:i.passphrase??null,time:n?.Time,restore_path:this.alternateRestorePath()??e.restoreFromPath,overwrite:e.handleExisting==="overwrite",permissions:e.permissions,skip_metadata:!e.includeMetadata}}).pipe(R(()=>this.isSubmitting.set(!1))).subscribe({next:l=>{this.#e.navigate([`./${l.ID}`,"progress"],{relativeTo:this.#t})},error:l=>{console.error("restore error",l)}})}exit(){this.#o.open(D,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:t=>{t&&(this.#a(),this.#e.navigate(["/"]))}})}getVersionOptions(){this.versionOptions()}loadFilesetsWithRetryv2(t,e=2){return this.#i.postApiV2BackupListFilesets({requestBody:{BackupId:t}}).pipe(Re(i=>{let o=i?.error?.body?.StatusCode??i?.error?.requestBody?.StatusCode;return o==="EncryptedStorageNoPassphrase"||o==="FolderMissing"||o==="EmptyRemoteFolder"||e===0?Ne(()=>i):he(1e3).pipe(Ie(()=>this.loadFilesetsWithRetryv2(t,e-1)))}))}getBackup(){let t=this.backupId();this.versionOptionsLoading.set(!0),this.#n.hasV2ListOperations()?ae([this.#i.getApiV1BackupById({id:t}),this.loadFilesetsWithRetryv2(t)]).pipe(Q(1),R(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,i])=>{if(i.Error)throw new Error(i.Error);if(!(e.Backup?.IsTemporary??!0)&&e?.Backup?.DBPathExists===!1){this.#o.open(D,{data:{title:$localize`Missing Local Database`,message:$localize`The local database for this backup is missing. Please repair or recreate the local database before restoring.`,confirmText:$localize`OK`,cancelText:void 0},closed:n=>{this.#e.navigate(["/backup",t,"database"])}});return}this.versionOptions.set((i.Data??[]).map(n=>({Version:n.Version??-1,IsFullBackup:n.IsFullBackup??void 0,Time:n.Time??"<missing>",FileCount:n.FileCount??void 0,FileSizes:n.FileSizes??void 0}))),this.backup.set(e)},error:e=>{let i=e?.error?.body?.StatusCode??e?.error?.requestBody?.StatusCode,o=i==="EncryptedStorageNoPassphrase",n=i==="FolderMissing",l=i==="EmptyRemoteFolder",u=$localize`An error occurred while loading the backup filesets: ${e.message}`;o&&(u=$localize`The remote storage is encrypted. Please enter the passphrase to access the backup.`),n&&(u=$localize`The backup storage folder was not found.`),l&&(u=$localize`The backup storage folder does not contain any filesets.`),this.#o.open(D,{data:{title:$localize`Failed to load backup filesets`,message:u,confirmText:$localize`OK`,cancelText:void 0},closed:h=>{this.#e.navigate([o?"/restore-from-files/encryption":"/restore-from-files/destination"])}})}}):ae([this.#i.getApiV1BackupById({id:t}),this.#i.getApiV1BackupByIdFilesets({id:t}).pipe(Pe(3))]).pipe(Q(1),R(()=>this.versionOptionsLoading.set(!1))).subscribe({next:([e,i])=>{this.versionOptions.set(i.map(o=>({Version:o.Version??-1,IsFullBackup:(o.IsFullBackup??1)==1,Time:o.Time??"<missing>",FileCount:o.FileCount??void 0,FileSizes:o.FileSizes??void 0}))),this.backup.set(e)}})}#a(){this.selectFilesForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Me({token:s,factory:s.\u0275fac,providedIn:"root"})};function St(s,t){if(s&1&&(r(0,"app-file-tree",29)(1,"label",31),G(2,"Path"),a(),p(3,"input",32),a()),s&2){let e,i=f(2);F("disabled",((e=i.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Ft(s,t){if(s&1&&(r(0,"app-file-tree",30)(1,"label",31),G(2,"Path"),a(),p(3,"input",32),a()),s&2){let e=f(2);F("office365Mode",!0)("backupId",e.backupId())("destinationUrl",e.office365destinationUrl())}}function gt(s,t){if(s&1){let e=A();r(0,"sh-radio",25),m(1,5),p(2,"input",26),T(),a(),r(3,"sh-radio",25),m(4,6),r(5,"input",27),C("click",function(){P(e);let o=f();return I(o.chooseOfficeTenant())}),a(),T(),a(),r(6,"sh-radio",25),m(7,7),p(8,"input",28),T(),a(),g(9,St,4,2,"app-file-tree",29),g(10,Ft,4,3,"app-file-tree",30)}if(s&2){let e,i=f();d(9),E(((e=i.optionsFormSignal())==null?null:e.restoreFrom)==="pickLocation"?9:-1),d(),E(i.showOffice365RestoreTree()?10:-1)}}function Et(s,t){if(s&1&&(r(0,"sh-radio",25),m(1,8),p(2,"input",33),T(),a(),r(3,"sh-radio",25),m(4,9),p(5,"input",28),T(),a(),r(6,"app-file-tree",29)(7,"label",31),G(8,"Path"),a(),p(9,"input",32),a()),s&2){let e,i=f();d(6),F("disabled",((e=i.optionsFormSignal())==null?null:e.restoreFrom)!=="pickLocation")("enableCreateFolder",!0)}}function Ot(s,t){s&1&&(r(0,"app-toggle-card",20),b(1,21),O(2,10),v(),r(3,"sh-toggle",25),m(4,11),p(5,"input",34),T(),a()()),s&2&&F("disallowToggle",!0)}function ft(s,t){s&1&&(r(0,"app-toggle-card",20),b(1,21),O(2,12),v(),r(3,"sh-radio",25),m(4,13),p(5,"input",35),T(),a(),r(6,"sh-radio",25),m(7,14),p(8,"input",36),T(),a()(),r(9,"app-toggle-card"),b(10,21),O(11,15),v(),r(12,"sh-toggle",37),m(13,16),p(14,"input",38),T(),a(),r(15,"sh-toggle",37),m(16,17),p(17,"input",39),T(),a()()),s&2&&F("disallowToggle",!0)}var k=new U,st=()=>k.group({restoreFrom:k.control("original"),restoreFromPath:k.control(""),handleExisting:k.control("saveTimestamp"),permissions:k.control(!1),includeMetadata:k.control(!0),officeIgnoreExisting:k.control(!1)}),me=class s{#e=c(y);#t=c(L);#n=c(M);#o=c(K);#i=c(se);optionsForm=this.#e.optionsForm;optionsFormSignal=this.#e.optionsFormSignal;isSubmitting=this.#e.isSubmitting;extendedData=this.#e.extendedDataType;office365CustomTargetUrl=_(null);backupId=N(()=>this.#e.backup()?.Backup?.ID??null);hasOffice365Data=N(()=>this.extendedData()==="o365");office365SourceUrl=N(()=>{let t=this.#e.backup()?.Backup?.Sources?.filter(i=>i.startsWith("@")&&i.includes("|office365"))[0];if(!t)return null;let e=t.split("|");return e.length>=2?e[1]:null});office365destinationUrl=N(()=>{let t=this.optionsFormSignal()?.restoreFrom,e=this.hasOffice365Data();return t==="same-o365"&&e?this.office365SourceUrl():t==="other-o365"&&e?this.office365CustomTargetUrl():null});showOffice365RestoreTree=N(()=>!!(this.optionsFormSignal()?.restoreFrom==="same-o365"&&this.office365destinationUrl()&&this.backupId()||this.optionsFormSignal()?.restoreFrom==="other-o365"&&this.office365destinationUrl()));isOffice365Restore=N(()=>{let t=this.optionsFormSignal()?.restoreFrom;return t==="same-o365"||t==="other-o365"});chooseOfficeTenant(){return this.#i.open(Qe,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:this.office365CustomTargetUrl()||this.office365SourceUrl()||"office365://",moduleType:"RestoreDestinationProvider",askToCreate:!0,expectedResult:"any",suppressErrorDialogs:!0}}).closed.subscribe(e=>{e&&(this.office365CustomTargetUrl.set(e),this.optionsForm.controls.restoreFrom.setValue("other-o365"))}),!1}#s=x(()=>{let t=this.optionsFormSignal()?.restoreFrom;this.hasOffice365Data()&&(t==="original"||t===void 0)&&(this.optionsForm.controls.restoreFrom.setValue("pickLocation"),this.optionsForm.controls.handleExisting.setValue("overwrite")),!this.hasOffice365Data()&&(t==="same-o365"||t==="other-o365")&&(this.optionsForm.controls.restoreFrom.setValue("original"),this.optionsForm.controls.handleExisting.setValue("saveTimestamp"))});goBack(){this.#t.navigate(["select-files"],{relativeTo:this.#n.parent})}submit(){let t=this.#e.selectFilesFormSignal()?.filesToRestore??[];if(t.length>0&&this.optionsFormSignal()?.restoreFrom=="original"&&(t[0].includes("/")?"/":"\\")!==this.#o.systemInfo()?.DirectorySeparator){this.#i.open(D,{data:{title:$localize`Confirm target folder`,message:$localize`This backup was created on another operating system. Restoring files without specifying a destination folder can cause files to be restored in unexpected places. Are you sure you want to continue without choosing a destination folder?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{o&&this.#e.submit()}});return}if(this.optionsFormSignal()?.restoreFrom==="same-o365"||this.optionsFormSignal()?.restoreFrom==="other-o365"){let i=this.optionsFormSignal()?.restoreFromPath;if(i&&i.startsWith("/")&&(i=i.substring(1)),!i||i.trim()===""){this.#i.open(D,{data:{title:$localize`No path specified`,message:$localize`Please choose a path to restore to in the Office 365 tenant.`,confirmText:$localize`OK`,cancelText:void 0}});return}let o=this.optionsFormSignal()?.officeIgnoreExisting,n=this.office365destinationUrl()?.substring(this.office365destinationUrl().indexOf("?")),l=`@office365://${i}${n}&office365-ignore-existing=${o?"true":"false"}`;this.#e.setAlternateRestorePath(l),this.optionsForm.controls.includeMetadata.setValue(!0),this.optionsForm.controls.permissions.setValue(!0)}else this.#e.setAlternateRestorePath(null);this.#e.submit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=w({type:s,selectors:[["app-advanced-options-settings"]],decls:18,vars:6,consts:()=>{let t;t=$localize`Restore options`;let e;e=$localize`Where do you want to restore files to?`;let i;i=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let n;n=$localize` Same Office 365 Tenant ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let l;l=$localize` Different Office 365 Tenant ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let u;u=$localize` Local file system ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let h;h=$localize` Original location ${"\uFFFD#2\uFFFD\uFFFD/#2\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Pick location ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Z;Z=$localize`Restore settings`;let Te;Te=$localize` Ignore existing resources in the destination ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let Se;Se=$localize`How do you want to handle existing files?`;let Fe;Fe=$localize` Overwrite ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let ge;ge=$localize` Save different versions with timestamp in file name ${"\uFFFD#8\uFFFD\uFFFD/#8\uFFFD"}:TAG_INPUT:`;let Ee;Ee=$localize`Metadata settings`;let Oe;Oe=$localize` Restore file metadata ${"\uFFFD#14\uFFFD\uFFFD/#14\uFFFD"}:TAG_INPUT:`;let fe;return fe=$localize` Restore read/write permissions ${"\uFFFD#17\uFFFD\uFFFD/#17\uFFFD"}:TAG_INPUT:`,[["formRef",""],t,e,i,o,n,l,u,h,$,Z,Te,Se,Fe,ge,Ee,Oe,fe,[3,"submit","formGroup"],[1,"title-30"],[3,"disallowToggle"],["title",""],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"raised","primary"],["type","radio","name","restoreFrom","value","same-o365","formControlName","restoreFrom"],["type","radio","name","restoreFrom","value","other-o365","formControlName","restoreFrom",3,"click"],["type","radio","name","restoreFrom","value","pickLocation","formControlName","restoreFrom"],[3,"disabled","enableCreateFolder"],[3,"office365Mode","backupId","destinationUrl"],["for","path"],["type","text","id","path","formControlName","restoreFromPath"],["type","radio","name","restoreFrom","value","original","formControlName","restoreFrom"],["type","checkbox","formControlName","officeIgnoreExisting"],["type","radio","name","handleExisting","value","overwrite","formControlName","handleExisting"],["type","radio","name","handleExisting","value","saveTimestamp","formControlName","handleExisting"],[1,"primary","raised"],["type","checkbox","formControlName","includeMetadata"],["type","checkbox","formControlName","permissions"]]},template:function(e,i){if(e&1){let o=A();r(0,"form",18,0),C("submit",function(){return P(o),I(i.submit())}),r(2,"h3",19),O(3,1),a(),r(4,"app-toggle-card",20),b(5,21),O(6,2),v(),g(7,gt,11,2)(8,Et,10,2),a(),g(9,Ot,6,1,"app-toggle-card",20)(10,ft,18,1),r(11,"div",22)(12,"button",23),C("click",function(){return P(o),I(i.goBack())}),m(13,3),p(14,"sh-icon"),T(),a(),r(15,"button",24),m(16,4),p(17,"sh-icon"),T(),a()()()}e&2&&(F("formGroup",i.optionsForm),d(4),F("disallowToggle",!0),d(3),E(i.hasOffice365Data()?7:8),d(2),E(i.isOffice365Restore()?9:10),d(6),$e("loader",i.isSubmitting()))},dependencies:[Y,z,B,we,Ve,V,W,X,J,Ke,re,He,Xe,j,H],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};export{st as a,me as b,ot as c,ce as d,nt as e,de as f,y as g};
@@ -1,3 +1,3 @@
1
- import{a as Ee}from"./chunk-POPZ47SS.js";import{a as Ne}from"./chunk-F5SNXI4Q.js";import"./chunk-Q74O3CWJ.js";import{h as Te,q as A}from"./chunk-LPAIFT5I.js";import"./chunk-MUFBZIQA.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import{b as he}from"./chunk-3TJKPVBA.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{b as D}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ue,G as de,H as _e,L as pe,P as Ce,Y as ge,c as Z,e as ee,f as te,j as ne,n as oe,o as ie,p as ae,q as se,r as re,s as le,t as ce,u as me}from"./chunk-UNMDSCAN.js";import{b as Fe,c as Se}from"./chunk-CFNARBNK.js";import{b as W,d as Q,e as Y}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as E,Ab as o,Bb as a,Fb as I,Gb as M,Ib as v,Pa as u,Pb as p,Qb as C,R as b,Rb as O,Sb as x,Tb as w,Vb as K,W as _,Xb as N,aa as f,cb as R,gc as J,la as L,na as $,oc as X,pc as q,qc as V,sb as k,tb as G,ub as B,vc as H,wb as y,wc as z,xb as U,xc as j,yb as F,zb as l}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var T=class s{#e=new Map;saveState(t){let e=crypto.randomUUID();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})};var Ie=()=>["backup"];function Me(s,t){s&1&&a(0,"sh-progress-bar",11)}function Oe(s,t){if(s&1&&(l(0,"sh-form-field"),a(1,"input",35),o()),s&2){let e=t.$implicit,n=t.$index;u(),F("id",H("filter-",n))("formControl",e)}}function De(s,t){if(s&1){let e=v();l(0,"form",12)(1,"sh-select",13)(2,"label",14),p(3,1),a(4,"sh-icon",15),C(),o(),a(5,"input",16),o(),l(6,"sh-form-field")(7,"label",17),p(8,2),a(9,"sh-icon",18),C(),o(),a(10,"textarea",19),o(),l(11,"sh-form-field")(12,"label",20),p(13,3),a(14,"sh-icon",21),C(),o(),a(15,"textarea",22),o()(),l(16,"sh-divider"),O(17,4),o(),l(18,"form",12)(19,"sh-form-field")(20,"label",23),p(21,5),a(22,"sh-icon",24),C(),o(),a(23,"input",25),o(),l(24,"sh-form-field")(25,"label",26),p(26,6),a(27,"sh-icon",27),C(),o(),a(28,"input",28),o(),l(29,"app-toggle-card",29),I(30,30),O(31,7),M(),I(32,31),y(33,Oe,2,3,"sh-form-field",null,B),M(),o()(),l(35,"app-options-list",32),V("optionsChange",function(r){E(e);let m=N();return q(m.settings,r)||(m.settings=r),f(r)}),o(),l(36,"div",33)(37,"button",34),K("click",function(){E(e);let r=N();return f(r.submit())}),p(38,8),a(39,"sh-icon"),C(),o()()}if(s&2){let e=N();F("formGroup",e.baseCmdForm),u(),F("options",e.commandOptions()??j(10,Ie))("inlineSearch",!0),u(17),F("formGroup",e.standardFields),u(11),F("disallowToggle",!0),u(4),U(e.standardFields.controls.filters.controls),u(2),X("options",e.settings),F("hasFreeTextSettings",!0),u(2),J("loader",e.isSubmitting()),u(2),x(e.baseCmdForm.value.command),w(38)}}var c=new re,P=class s{#e=_(A);#n=_(Se);#o=_(Q);#t=_(W);#a=_(Fe);#s=_(he);#i=_(T);#r=D(this.#t.params);commandOptions=D(this.#a.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#c=$(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),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(c.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#s.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",r=(e.arguments??"").split(`
1
+ import{a as Ee}from"./chunk-OL7C46LY.js";import{a as Ne}from"./chunk-EE27B3OV.js";import"./chunk-Q74O3CWJ.js";import{h as Te,p as A}from"./chunk-P3D2ZP6W.js";import"./chunk-HRHF3TYJ.js";import"./chunk-IMHM7ISI.js";import"./chunk-6LAXPU22.js";import{b as he}from"./chunk-BFTGDQ4K.js";import"./chunk-QHBOEY2O.js";import"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import"./chunk-6Q6SSTBK.js";import"./chunk-SZUNW4JO.js";import"./chunk-TL4WOQKT.js";import"./chunk-7LTHH6OG.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-D6IP567E.js";import{b as D}from"./chunk-VDSX2M4H.js";import"./chunk-ZU6T3TW3.js";import"./chunk-HUZXJWCG.js";import"./chunk-7TWUW4XJ.js";import{B as ue,G as de,H as _e,L as pe,P as Ce,Y as ge,c as Z,e as ee,f as te,j as ne,n as oe,o as ie,p as ae,q as se,r as re,s as le,t as ce,u as me}from"./chunk-UNMDSCAN.js";import{b as Fe,c as Se}from"./chunk-CFNARBNK.js";import{b as W,d as Q,e as Y}from"./chunk-I27PVH6D.js";import"./chunk-5VE6P5U5.js";import"./chunk-PO3L6MKW.js";import"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{$ as E,Ab as o,Bb as a,Fb as I,Gb as M,Ib as v,Pa as u,Pb as p,Qb as C,R as b,Rb as O,Sb as x,Tb as w,Vb as K,W as _,Xb as N,aa as f,cb as R,gc as J,la as L,na as $,oc as X,pc as q,qc as V,sb as k,tb as G,ub as B,vc as H,wb as y,wc as z,xb as U,xc as j,yb as F,zb as l}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var T=class s{#e=new Map;saveState(t){let e=crypto.randomUUID();return this.#e.set(e,t),e}getState(t){return this.#e.get(t)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=b({token:s,factory:s.\u0275fac,providedIn:"root"})};var Ie=()=>["backup"];function Me(s,t){s&1&&a(0,"sh-progress-bar",11)}function Oe(s,t){if(s&1&&(l(0,"sh-form-field"),a(1,"input",35),o()),s&2){let e=t.$implicit,n=t.$index;u(),F("id",H("filter-",n))("formControl",e)}}function De(s,t){if(s&1){let e=v();l(0,"form",12)(1,"sh-select",13)(2,"label",14),p(3,1),a(4,"sh-icon",15),C(),o(),a(5,"input",16),o(),l(6,"sh-form-field")(7,"label",17),p(8,2),a(9,"sh-icon",18),C(),o(),a(10,"textarea",19),o(),l(11,"sh-form-field")(12,"label",20),p(13,3),a(14,"sh-icon",21),C(),o(),a(15,"textarea",22),o()(),l(16,"sh-divider"),O(17,4),o(),l(18,"form",12)(19,"sh-form-field")(20,"label",23),p(21,5),a(22,"sh-icon",24),C(),o(),a(23,"input",25),o(),l(24,"sh-form-field")(25,"label",26),p(26,6),a(27,"sh-icon",27),C(),o(),a(28,"input",28),o(),l(29,"app-toggle-card",29),I(30,30),O(31,7),M(),I(32,31),y(33,Oe,2,3,"sh-form-field",null,B),M(),o()(),l(35,"app-options-list",32),V("optionsChange",function(r){E(e);let m=N();return q(m.settings,r)||(m.settings=r),f(r)}),o(),l(36,"div",33)(37,"button",34),K("click",function(){E(e);let r=N();return f(r.submit())}),p(38,8),a(39,"sh-icon"),C(),o()()}if(s&2){let e=N();F("formGroup",e.baseCmdForm),u(),F("options",e.commandOptions()??j(10,Ie))("inlineSearch",!0),u(17),F("formGroup",e.standardFields),u(11),F("disallowToggle",!0),u(4),U(e.standardFields.controls.filters.controls),u(2),X("options",e.settings),F("hasFreeTextSettings",!0),u(2),J("loader",e.isSubmitting()),u(2),x(e.baseCmdForm.value.command),w(38)}}var c=new re,P=class s{#e=_(A);#n=_(Se);#o=_(Q);#t=_(W);#a=_(Fe);#s=_(he);#i=_(T);#r=D(this.#t.params);commandOptions=D(this.#a.getApiV1Commandline());isSubmitting=L(!1);optionsFields=this.#e.optionsFields;standardFields=c.group({"backup-id":c.control(""),"backup-name":c.control(""),dbpath:c.control(""),filters:c.array([])});baseCmdForm=c.group({command:c.control("backup"),targetUrl:c.control(""),arguments:c.control("")});finishedLoading=this.#e.finishedLoading;backupId=this.#e.backupId;settings=this.#e.settings;#c=$(()=>{let t=this.#r()?.id;this.#e.backupId.set(t),this.getBackup(t)});getBackup(t){this.#n.getApiV1BackupById({id:t}).subscribe({next:e=>{this.#e.mapScheduleToForm(e.Schedule??null),e.Backup&&(this.#e.mapGeneralToForm(e.Backup),this.mapStandardFieldsToForm(e.Backup),this.mapBaseCmdToForm(e.Backup),this.#e.mapOptionsToForms(e.Backup,!0)),this.applyStateFromUrl(),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(c.control(`${e.Include?"":"-"}${e.Expression}`))})}submit(){this.#s.resumeDialogCheck(()=>this.#l())}#l(){this.isSubmitting.set(!0);let t=this.updateUrl(),e=this.baseCmdForm.value,n=e.targetUrl??"",r=(e.arguments??"").split(`
2
2
  `)??[],m=[n,...r].filter(i=>i.length>0),g=this.standardFields.value,S=g.filters??[],h=[e.command,...m,`--backup-name=${g["backup-name"]}`,`--dbpath=${g.dbpath}`,`--backup-id=${g["backup-id"]}`,...S.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.#n.postApiV1Commandline({requestBody:h}).subscribe({next:i=>{i.Status==="OK"&&this.#o.navigate(["backup",this.backupId(),"commandline",i.ID],{queryParams:{state:t}})},error:()=>{this.isSubmitting.set(!1)}})}mapBaseCmdToForm(t){let e=t.TargetURL??null;e&&this.baseCmdForm.patchValue({targetUrl:e??"",arguments:t.Sources?.join(`
3
3
  `)??""})}updateUrl(){let t=this.baseCmdForm.value,e=this.standardFields.value,n=e.filters??[],r=this.settings(),m=this.#i.saveState({command:t.command,targetUrl:t.targetUrl,arguments:t.arguments,backupId:e["backup-id"],backupName:e["backup-name"],dbpath:e.dbpath,filters:n,options:r});return this.#o.navigate([],{relativeTo:this.#t,queryParams:{state:m},replaceUrl:!0}),m}applyStateFromUrl(){let e=this.#t.snapshot.queryParams.state;if(!e)return;let n=this.#i.getState(e);n&&(this.baseCmdForm.patchValue({command:n.command,targetUrl:n.targetUrl,arguments:n.arguments}),this.standardFields.patchValue({"backup-id":n.backupId,"backup-name":n.backupName,dbpath:n.dbpath}),n.filters&&(this.standardFields.controls.filters.clear(),n.filters.forEach(r=>{this.standardFields.controls.filters.push(c.control(r))})),n.options&&n.options.length>0&&this.settings.set(n.options))}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=R({type:s,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 ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` TargetUrl ${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON:`;let r;r=$localize` Commandline Arguments ${"\uFFFD#14\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SH_ICON:`;let m;m=$localize`Advanced options`;let g;g=$localize` Backup ID ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`;let S;S=$localize` Backup Name ${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON:`;let h;h=$localize`Filters`;let i;return i=$localize`${"\uFFFD#39\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#39\uFFFD"}:CLOSE_TAG_SH_ICON: Run "${"\uFFFD0\uFFFD"}:INTERPOLATION:" command now `,[t,e,n,r,m,g,S,h,i,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"indeterminate","primary"],[3,"formGroup"],["placeholder","Select a command...",3,"options","inlineSearch"],["for","command"],["shTooltip","Choose the command to execute"],["type","text","id","command","formControlName","command"],["for","targetUrl"],["shTooltip","Enter the URL of the backup target"],["id","targetUrl","autocomplete","off","formControlName","targetUrl"],["for","arguments"],["shTooltip","Enter one argument per line without quotes (e.g., *.txt)"],["id","arguments","autocomplete","off","rows","5","formControlName","arguments","placeholder","Enter one argument per line without quotes (e.g., *.txt)",1,"arguments"],["for","backup-id"],["shTooltip","The ID of the backup configuration this run belongs to (can be empty)"],["id","backup-id","formControlName","backup-id"],["for","backup-name"],["shTooltip","The optional name of the backup"],["id","backup-name","formControlName","backup-name"],[3,"disallowToggle"],["title",""],["content","","formGroupName","filters"],[3,"optionsChange","options","hasFreeTextSettings"],[1,"form-actions"],["shButton","",1,"raised","primary",3,"click"],[3,"id","formControl"]]},template:function(e,n){e&1&&(a(0,"app-status-bar"),l(1,"section")(2,"div",9)(3,"button",10),p(4,0),a(5,"sh-icon"),C(),o()(),k(6,Me,1,0,"sh-progress-bar",11)(7,De,40,11),o()),e&2&&(u(6),G(n.finishedLoading()?7:6))},dependencies:[le,ne,Z,ee,te,Ne,Ee,Te,ce,oe,se,ae,ie,Y,_e,ue,de,Ce,pe,me,ge],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}.arguments[_ngcontent-%COMP%]{min-height:6rem;white-space:pre}"],changeDetection:0})};export{P as default};
@@ -1,2 +1,2 @@
1
- import{c as ge,d as fe,e as xe}from"./chunk-MUFBZIQA.js";import{g as ue}from"./chunk-IMHM7ISI.js";import{a as Ce}from"./chunk-HUZXJWCG.js";import{B as le,H as _e,K as pe,P as se,V as ce,W as me,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,u as re}from"./chunk-UNMDSCAN.js";import{_ as Z}from"./chunk-7AVOHYTE.js";import{$ as d,Ab as p,Bb as N,Fb as R,Gb as M,Gc as v,Hb as f,Ib as x,Mc as H,Pa as l,Pb as k,Qb as G,Rb as Q,Rc as J,Uc as Y,Vb as u,W as j,Xb as r,aa as C,cb as q,ec as g,gc as B,hb as S,jc as m,kc as z,la as b,lc as U,rc as K,sb as F,sc as E,tb as h,tc as O,ub as $,wb as A,xb as D,xc as W,yb as s,yc as T,zb as _}from"./chunk-26Z7TPJB.js";import{a as L,b as P}from"./chunk-7CGTOI24.js";var Te=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),w=t=>({formView:t}),y=t=>({$implicit:t});function he(t,i){if(t&1){let e=x();_(0,"button",14),u("click",function(){d(e);let n=r();return C(n.showTextArea.set(!1))}),k(1,6),N(2,"sh-icon"),G(),p()}}function we(t,i){if(t&1){let e=x();_(0,"button",18,1),u("click",function(){let n=d(e).$implicit,a=r(3);return C(a.addSetting(n))}),_(2,"div",19)(3,"p"),m(4),p(),m(5),p()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),l(4),z(e.shortDescription),l(),U(" ",e.name," ")}}function ye(t,i){if(t&1&&(_(0,"h3",10),m(1),p(),A(2,we,6,4,"button",17,$)),t&2){let e=i.$implicit;l(),z(e.displayName),l(),D(e.options)}}function Ve(t,i){if(t&1){let e=x();_(0,"sh-menu")(1,"button",20)(2,"sh-icon"),m(3,"dots-three-vertical"),p()(),R(4,16),_(5,"button",14),u("click",function(){d(e);let n=r(2);return C(n.addFreeTextSetting())}),k(6,8),N(7,"sh-icon"),G(),p(),_(8,"button",21),u("click",function(){d(e);let n=r(2);return C(n.showTextArea.set(!0))}),_(9,"sh-icon"),m(10,"link"),p(),m(11," Edit contents as text "),p(),M(),p()}}function Le(t,i){if(t&1&&(_(0,"sh-menu",15)(1,"button",12),k(2,7),N(3,"sh-icon"),G(),p(),R(4,16),A(5,ye,4,1,null,null,$),M(),p(),F(7,Ve,12,0,"sh-menu")),t&2){let e=r();s("searchable",!0),l(5),D(e.nonSelectedOptionsGrouped()),l(2),h(e.hasFreeTextSettings()?7:-1)}}function Ie(t,i){if(t&1){let e=x();_(0,"textarea",22),u("ngModelChange",function(n){d(e);let a=r();return C(a.updateSettingsFromText(n))}),p()}if(t&2){let e=r();s("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function Ne(t,i){t&1&&(_(0,"div",23),m(1,"Add a setting above to get started."),p())}function Me(t,i){t&1&&(_(0,"sh-icon",31),m(1," warning-octagon "),p())}function Ee(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"archive"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(_(0,"sh-icon",33),m(1,"question"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.longDescription)}}function Pe(t,i){if(t&1&&(F(0,Me,2,0,"sh-icon",31),_(1,"span"),m(2),p(),F(3,Ee,2,1,"sh-icon",32)(4,ve,2,1,"sh-icon",33)),t&2){let e=r().$implicit,o=O(1);h(o?0:-1),l(),B("deprecated",e.FormView.deprecatedDescription),l(),z(e.FormView.shortDescription),l(),h(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function be(t,i){t&1&&f(0)}function $e(t,i){if(t&1){let e=x();_(0,"div",25)(1,"label"),S(2,be,1,0,"ng-container",34),p(),_(3,"div")(4,"sh-form-field")(5,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateFreeTextSettingName(a,n))}),p(),_(6,"sh-icon",36),m(7,"rectangle-dashed"),p()()(),_(8,"div")(9,"sh-form-field")(10,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(11,"sh-icon",36),m(12,"textbox"),p()()()()}if(t&2){let e=r().$implicit,o=g(3);l(2),s("ngTemplateOutlet",o),l(3),s("ngModel",e.Name),l(5),s("ngModel",e.Value())}}function Ae(t,i){t&1&&f(0)}function De(t,i){if(t&1){let e=x();_(0,"app-file-tree",26)(1,"label",37),S(2,Ae,1,0,"ng-container",34),p(),_(3,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);s("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("id",n)("ngModel",e.Value())}}function Re(t,i){if(t&1){let e=x();_(0,"app-file-tree",27),N(1,"label",37),_(2,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=O(0);s("startingPath",e.Value()),l(),s("for",o),l(),s("id",o)("ngModel",e.Value())}}function ke(t,i){t&1&&f(0)}function Ge(t,i){t&1&&f(0)}function Be(t,i){t&1&&(_(0,"sh-icon",36),m(1,"link"),p())}function ze(t,i){t&1&&(_(0,"sh-icon",36),m(1,"hard-drives"),p())}function Ue(t,i){t&1&&(_(0,"sh-icon",36),m(1,"jar"),p())}function Ke(t,i){t&1&&(_(0,"sh-icon",36),m(1,"envelope"),p())}function He(t,i){t&1&&(_(0,"sh-icon",36),m(1,"textbox"),p())}function Je(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,ke,1,0,"ng-container",34)(3,Ge,1,0,"ng-container",39),p(),_(4,"input",40),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),F(5,Be,2,0,"sh-icon",36)(6,ze,2,0,"sh-icon",36)(7,Ue,2,0,"sh-icon",36)(8,Ke,2,0,"sh-icon",36)(9,He,2,0,"sh-icon",36),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),l(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function Xe(t,i){t&1&&f(0)}function je(t,i){t&1&&f(0)}function qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye "),p()}}function Qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye-slash "),p()}}function We(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,Xe,1,0,"ng-container",34)(3,je,1,0,"ng-container",39),p(),_(4,"input",41),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"password"),p(),F(7,qe,2,0,"sh-icon",42)(8,Qe,2,0,"sh-icon",42),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),l(3),h(e.showPassword?7:8)}}function Ye(t,i){t&1&&f(0)}function Ze(t,i){t&1&&f(0)}function et(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function tt(t,i){if(t&1){let e=x();_(0,"sh-select",44)(1,"label",37),S(2,Ye,1,0,"ng-container",34)(3,Ze,1,0,"ng-container",39),p(),_(4,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,et,1,1,"ng-template",null,3,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(11,y,T(9,w,o.FormView))),l(),s("id",a)("ngModel",o.Value())}}function nt(t,i){t&1&&f(0)}function it(t,i){t&1&&f(0)}function ot(t,i){if(t&1){let e=x();_(0,"app-size",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,nt,1,0,"ng-container",34)(3,it,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function at(t,i){t&1&&f(0)}function rt(t,i){t&1&&f(0)}function lt(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,at,1,0,"ng-container",34)(3,rt,1,0,"ng-container",39),p(),_(4,"input",46),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"numpad"),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function _t(t,i){t&1&&f(0)}function pt(t,i){t&1&&f(0)}function st(t,i){if(t&1){let e=x();_(0,"sh-toggle",29)(1,"label",37),S(2,_t,1,0,"ng-container",34)(3,pt,1,0,"ng-container",39),p(),_(4,"input",47),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function ct(t,i){t&1&&f(0)}function mt(t,i){t&1&&f(0)}function dt(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function Ct(t,i){if(t&1){let e=x();_(0,"sh-select",48)(1,"label",37),S(2,ct,1,0,"ng-container",34)(3,mt,1,0,"ng-container",39),p(),_(4,"input",49),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,dt,1,1,"ng-template",null,4,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(10,y,T(8,w,o.FormView))),l(),s("ngModel",o.Value())}}function ut(t,i){t&1&&f(0)}function gt(t,i){t&1&&f(0)}function ft(t,i){if(t&1){let e=x();_(0,"app-timespan",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,ut,1,0,"ng-container",34)(3,gt,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function xt(t,i){if(t&1){let e=x();K(0)(1),S(2,Pe,5,5,"ng-template",null,2,v),_(4,"div",24),F(5,$e,13,3,"div",25)(6,De,4,9,"app-file-tree",26)(7,Re,3,4,"app-file-tree",27)(8,Je,10,12,"sh-form-field")(9,We,9,12,"sh-form-field")(10,tt,7,13)(11,ot,4,11,"app-size",28)(12,lt,7,10,"sh-form-field")(13,st,5,10,"sh-toggle",29)(14,Ct,7,12)(15,ft,4,11,"app-timespan",28),_(16,"button",30),u("click",function(){let n=d(e).$implicit,a=r(2);return C(a.removeSetting(n))}),_(17,"sh-icon"),m(18,"x-bold"),p()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);E("destination-"+e.Name+o),l(),E(n.inAppOptions(e.Name)),l(3),B("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),l(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Tt(t,i){if(t&1&&(F(0,Ne,2,0,"div",23),A(1,xt,19,5,null,null,$)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),l(),D(e.selectedSettings())}}function St(t,i){if(t&1&&(_(0,"sh-icon",50),m(1,"x-circle"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ot(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"warning"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ft(t,i){if(t&1&&(K(0),F(1,St,2,1,"sh-icon",50)(2,Ot,2,1,"sh-icon",32)),t&2){r();let e=O(0),o=r().$implicit,n=E(o.formView.validate(e));l(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function ht(t,i){if(t&1&&(K(0),F(1,Ft,3,2)),t&2){let e=r().$implicit,n=(E(e.Value())??"").toString().trim()==="";l(),h(!n&&e.formView.validate?1:-1)}}function wt(t,i){if(t&1&&F(0,ht,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(Ce);options=Y.required();hiddenOptions=J([]);hasFreeTextSettings=J(!1);applicationOptions=J();showTextArea=b(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=H(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(V=>V.name===n.Name?.replace("--","")),c=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(c=this.isTrue(c)),a.type==="Integer"&&(c=parseInt(c)||0),a.type==="Enumeration"&&a.options){let I=c?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===I);X&&(c=X)}let V=Te.find(I=>I.name===a?.name);return V&&(a=L(L({},a),V)),P(L({},n),{Value:b(c),FormView:a})}else if(this.hasFreeTextSettings())return P(L({},n),{Value:b(c),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=H(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>P(L({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=H(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
1
+ import{c as ge,d as fe,e as xe}from"./chunk-HRHF3TYJ.js";import{g as ue}from"./chunk-IMHM7ISI.js";import{a as Ce}from"./chunk-HUZXJWCG.js";import{B as le,H as _e,K as pe,P as se,V as ce,W as me,Y as de,b as ee,c as te,e as ne,i as ie,k as oe,s as ae,u as re}from"./chunk-UNMDSCAN.js";import{_ as Z}from"./chunk-7AVOHYTE.js";import{$ as d,Ab as p,Bb as N,Fb as R,Gb as M,Gc as v,Hb as f,Ib as x,Mc as H,Pa as l,Pb as k,Qb as G,Rb as Q,Rc as J,Uc as Y,Vb as u,W as j,Xb as r,aa as C,cb as q,ec as g,gc as B,hb as S,jc as m,kc as z,la as b,lc as U,rc as K,sb as F,sc as E,tb as h,tc as O,ub as $,wb as A,xb as D,xc as W,yb as s,yc as T,zb as _}from"./chunk-26Z7TPJB.js";import{a as L,b as P}from"./chunk-7CGTOI24.js";var Te=[{name:"send-mail-to",type:"Email"},{name:"send-mail-from",type:"Email"},{name:"log-file",type:"FileTree"},{name:"compression-extension-file",type:"FileTree"},{name:"dbpath",type:"FileTree"},{name:"restore-path",type:"FileTree"},{name:"gpg-program-path",type:"FileTree"}];var Fe=()=>({updateOn:"blur"}),w=t=>({formView:t}),y=t=>({$implicit:t});function he(t,i){if(t&1){let e=x();_(0,"button",14),u("click",function(){d(e);let n=r();return C(n.showTextArea.set(!1))}),k(1,6),N(2,"sh-icon"),G(),p()}}function we(t,i){if(t&1){let e=x();_(0,"button",18,1),u("click",function(){let n=d(e).$implicit,a=r(3);return C(a.addSetting(n))}),_(2,"div",19)(3,"p"),m(4),p(),m(5),p()()}if(t&2){let e=i.$implicit;B("deprecated",e.deprecatedDescription),l(4),z(e.shortDescription),l(),U(" ",e.name," ")}}function ye(t,i){if(t&1&&(_(0,"h3",10),m(1),p(),A(2,we,6,4,"button",17,$)),t&2){let e=i.$implicit;l(),z(e.displayName),l(),D(e.options)}}function Ve(t,i){if(t&1){let e=x();_(0,"sh-menu")(1,"button",20)(2,"sh-icon"),m(3,"dots-three-vertical"),p()(),R(4,16),_(5,"button",14),u("click",function(){d(e);let n=r(2);return C(n.addFreeTextSetting())}),k(6,8),N(7,"sh-icon"),G(),p(),_(8,"button",21),u("click",function(){d(e);let n=r(2);return C(n.showTextArea.set(!0))}),_(9,"sh-icon"),m(10,"link"),p(),m(11," Edit contents as text "),p(),M(),p()}}function Le(t,i){if(t&1&&(_(0,"sh-menu",15)(1,"button",12),k(2,7),N(3,"sh-icon"),G(),p(),R(4,16),A(5,ye,4,1,null,null,$),M(),p(),F(7,Ve,12,0,"sh-menu")),t&2){let e=r();s("searchable",!0),l(5),D(e.nonSelectedOptionsGrouped()),l(2),h(e.hasFreeTextSettings()?7:-1)}}function Ie(t,i){if(t&1){let e=x();_(0,"textarea",22),u("ngModelChange",function(n){d(e);let a=r();return C(a.updateSettingsFromText(n))}),p()}if(t&2){let e=r();s("ngModel",e.settingsAsText())("ngModelOptions",W(2,Fe))}}function Ne(t,i){t&1&&(_(0,"div",23),m(1,"Add a setting above to get started."),p())}function Me(t,i){t&1&&(_(0,"sh-icon",31),m(1," warning-octagon "),p())}function Ee(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"archive"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.deprecatedDescription)}}function ve(t,i){if(t&1&&(_(0,"sh-icon",33),m(1,"question"),p()),t&2){let e=r(2).$implicit;s("shTooltip",e.FormView.longDescription)}}function Pe(t,i){if(t&1&&(F(0,Me,2,0,"sh-icon",31),_(1,"span"),m(2),p(),F(3,Ee,2,1,"sh-icon",32)(4,ve,2,1,"sh-icon",33)),t&2){let e=r().$implicit,o=O(1);h(o?0:-1),l(),B("deprecated",e.FormView.deprecatedDescription),l(),z(e.FormView.shortDescription),l(),h(e.FormView.deprecatedDescription?3:e.FormView.longDescription?4:-1)}}function be(t,i){t&1&&f(0)}function $e(t,i){if(t&1){let e=x();_(0,"div",25)(1,"label"),S(2,be,1,0,"ng-container",34),p(),_(3,"div")(4,"sh-form-field")(5,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateFreeTextSettingName(a,n))}),p(),_(6,"sh-icon",36),m(7,"rectangle-dashed"),p()()(),_(8,"div")(9,"sh-form-field")(10,"input",35),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(11,"sh-icon",36),m(12,"textbox"),p()()()()}if(t&2){let e=r().$implicit,o=g(3);l(2),s("ngTemplateOutlet",o),l(3),s("ngModel",e.Name),l(5),s("ngModel",e.Value())}}function Ae(t,i){t&1&&f(0)}function De(t,i){if(t&1){let e=x();_(0,"app-file-tree",26)(1,"label",37),S(2,Ae,1,0,"ng-container",34),p(),_(3,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);s("startingPath",e.Value())("accepts",e.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("id",n)("ngModel",e.Value())}}function Re(t,i){if(t&1){let e=x();_(0,"app-file-tree",27),N(1,"label",37),_(2,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=O(0);s("startingPath",e.Value()),l(),s("for",o),l(),s("id",o)("ngModel",e.Value())}}function ke(t,i){t&1&&f(0)}function Ge(t,i){t&1&&f(0)}function Be(t,i){t&1&&(_(0,"sh-icon",36),m(1,"link"),p())}function ze(t,i){t&1&&(_(0,"sh-icon",36),m(1,"hard-drives"),p())}function Ue(t,i){t&1&&(_(0,"sh-icon",36),m(1,"jar"),p())}function Ke(t,i){t&1&&(_(0,"sh-icon",36),m(1,"envelope"),p())}function He(t,i){t&1&&(_(0,"sh-icon",36),m(1,"textbox"),p())}function Je(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,ke,1,0,"ng-container",34)(3,Ge,1,0,"ng-container",39),p(),_(4,"input",40),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),F(5,Be,2,0,"sh-icon",36)(6,ze,2,0,"sh-icon",36)(7,Ue,2,0,"sh-icon",36)(8,Ke,2,0,"sh-icon",36)(9,He,2,0,"sh-icon",36),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.FormView.type==="Email"?"email":"text")("id",n)("ngModel",e.Value()),l(),h(e.FormView.type==="Path"?5:e.FormView.type==="Hostname"?6:e.FormView.type==="Bucketname"?7:e.FormView.type==="Email"?8:9)}}function Xe(t,i){t&1&&f(0)}function je(t,i){t&1&&f(0)}function qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye "),p()}}function Qe(t,i){if(t&1){let e=x();_(0,"sh-icon",43),u("click",function(){d(e);let n=r(2).$implicit;return C(n.showPassword=!n.showPassword)}),m(1," eye-slash "),p()}}function We(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,Xe,1,0,"ng-container",34)(3,je,1,0,"ng-container",39),p(),_(4,"input",41),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"password"),p(),F(7,qe,2,0,"sh-icon",42)(8,Qe,2,0,"sh-icon",42),p()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(10,y,T(8,w,e.FormView))),l(),s("type",e.showPassword?"text":"password")("id",n)("ngModel",e.Value()),l(3),h(e.showPassword?7:8)}}function Ye(t,i){t&1&&f(0)}function Ze(t,i){t&1&&f(0)}function et(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function tt(t,i){if(t&1){let e=x();_(0,"sh-select",44)(1,"label",37),S(2,Ye,1,0,"ng-container",34)(3,Ze,1,0,"ng-container",39),p(),_(4,"input",38),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,et,1,1,"ng-template",null,3,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("isClearable",!1)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(11,y,T(9,w,o.FormView))),l(),s("id",a)("ngModel",o.Value())}}function nt(t,i){t&1&&f(0)}function it(t,i){t&1&&f(0)}function ot(t,i){if(t&1){let e=x();_(0,"app-size",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,nt,1,0,"ng-container",34)(3,it,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function at(t,i){t&1&&f(0)}function rt(t,i){t&1&&f(0)}function lt(t,i){if(t&1){let e=x();_(0,"sh-form-field")(1,"label",37),S(2,at,1,0,"ng-container",34)(3,rt,1,0,"ng-container",39),p(),_(4,"input",46),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p(),_(5,"sh-icon",36),m(6,"numpad"),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function _t(t,i){t&1&&f(0)}function pt(t,i){t&1&&f(0)}function st(t,i){if(t&1){let e=x();_(0,"sh-toggle",29)(1,"label",37),S(2,_t,1,0,"ng-container",34)(3,pt,1,0,"ng-container",39),p(),_(4,"input",47),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(8,y,T(6,w,e.FormView))),l(),s("id",n)("ngModel",e.Value())}}function ct(t,i){t&1&&f(0)}function mt(t,i){t&1&&f(0)}function dt(t,i){if(t&1&&m(0),t&2){let e=i.$implicit;U(" ",e," ")}}function Ct(t,i){if(t&1){let e=x();_(0,"sh-select",48)(1,"label",37),S(2,ct,1,0,"ng-container",34)(3,mt,1,0,"ng-container",39),p(),_(4,"input",49),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),p()(),S(5,dt,1,1,"ng-template",null,4,v)}if(t&2){let e=g(6),o=r().$implicit,n=g(3),a=O(0);r(2);let c=g(10);s("options",o.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),s("for",a),l(),s("ngTemplateOutlet",n),l(),s("ngTemplateOutlet",c)("ngTemplateOutletContext",T(10,y,T(8,w,o.FormView))),l(),s("ngModel",o.Value())}}function ut(t,i){t&1&&f(0)}function gt(t,i){t&1&&f(0)}function ft(t,i){if(t&1){let e=x();_(0,"app-timespan",45),u("ngModelChange",function(n){d(e);let a=r().$implicit,c=r(2);return C(c.updateSettingValue(a,n))}),_(1,"label",37),S(2,ut,1,0,"ng-container",34)(3,gt,1,0,"ng-container",39),p()()}if(t&2){let e=r().$implicit,o=g(3),n=O(0);r(2);let a=g(10);s("inputType",e.Name)("ngModel",e.Value())("customId",n),l(),s("for",n),l(),s("ngTemplateOutlet",o),l(),s("ngTemplateOutlet",a)("ngTemplateOutletContext",T(9,y,T(7,w,e.FormView)))}}function xt(t,i){if(t&1){let e=x();K(0)(1),S(2,Pe,5,5,"ng-template",null,2,v),_(4,"div",24),F(5,$e,13,3,"div",25)(6,De,4,9,"app-file-tree",26)(7,Re,3,4,"app-file-tree",27)(8,Je,10,12,"sh-form-field")(9,We,9,12,"sh-form-field")(10,tt,7,13)(11,ot,4,11,"app-size",28)(12,lt,7,10,"sh-form-field")(13,st,5,10,"sh-toggle",29)(14,Ct,7,12)(15,ft,4,11,"app-timespan",28),_(16,"button",30),u("click",function(){let n=d(e).$implicit,a=r(2);return C(a.removeSetting(n))}),_(17,"sh-icon"),m(18,"x-bold"),p()()()}if(t&2){let e=i.$implicit,o=i.$index,n=r(2);E("destination-"+e.Name+o),l(),E(n.inAppOptions(e.Name)),l(3),B("align-remove-start",e.FormView.type==="FolderTree"||e.FormView.type==="FileTree"||e.FormView.type==="Boolean"),l(),h(e.FormView.type==="FreeText"?5:e.FormView.type==="FileTree"?6:e.FormView.type==="FolderTree"?7:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"||e.FormView.type==="Email"||e.FormView.type==="Hostname"||e.FormView.type==="Bucketname"?8:e.FormView.type==="Password"?9:e.FormView.type==="Enumeration"?10:e.FormView.type==="Size"?11:e.FormView.type==="Integer"?12:e.FormView.type==="Boolean"?13:e.FormView.type==="Flags"?14:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?15:-1)}}function Tt(t,i){if(t&1&&(F(0,Ne,2,0,"div",23),A(1,xt,19,5,null,null,$)),t&2){let e=r();h(e.selectedSettings().length===0?0:-1),l(),D(e.selectedSettings())}}function St(t,i){if(t&1&&(_(0,"sh-icon",50),m(1,"x-circle"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ot(t,i){if(t&1&&(_(0,"sh-icon",32),m(1,"warning"),p()),t&2){r();let e=O(0);s("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Ft(t,i){if(t&1&&(K(0),F(1,St,2,1,"sh-icon",50)(2,Ot,2,1,"sh-icon",32)),t&2){r();let e=O(0),o=r().$implicit,n=E(o.formView.validate(e));l(),h((n==null?null:n.type)==="error"?1:(n==null?null:n.type)==="warning"?2:-1)}}function ht(t,i){if(t&1&&(K(0),F(1,Ft,3,2)),t&2){let e=r().$implicit,n=(E(e.Value())??"").toString().trim()==="";l(),h(!n&&e.formView.validate?1:-1)}}function wt(t,i){if(t&1&&F(0,ht,2,2),t&2){let e=i.$implicit;h(e.Value?0:-1)}}var Se=class t{#e=j(Ce);options=Y.required();hiddenOptions=J([]);hasFreeTextSettings=J(!1);applicationOptions=J();showTextArea=b(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=H(()=>{let i=this.hiddenOptions();return this.options().map(n=>{let a=this.allOptions().find(V=>V.name===n.Name?.replace("--","")),c=n.Value??"";if(a&&i.includes(a.name))return null;if(a){if(a.type==="Boolean"&&(c=this.isTrue(c)),a.type==="Integer"&&(c=parseInt(c)||0),a.type==="Enumeration"&&a.options){let I=c?.trim().toLowerCase(),X=a.options.find(Oe=>(Oe??"").trim().toLocaleLowerCase()===I);X&&(c=X)}let V=Te.find(I=>I.name===a?.name);return V&&(a=L(L({},a),V)),P(L({},n),{Value:b(c),FormView:a})}else if(this.hasFreeTextSettings())return P(L({},n),{Value:b(c),FormView:{name:n.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(n=>n!==null)});nonSelectedOptionsGrouped=H(()=>{let i=this.options().map(o=>o.Name?.replace("--","")),e=this.hiddenOptions();return this.allOptionsGrouped().map(o=>P(L({},o),{options:o.options.filter(n=>!i.includes(n.name)&&!e.includes(n.name))})).filter(o=>o.options.length>0)});settingsAsText=H(()=>this.selectedSettings().map(i=>{let e=i.Value(),o="";return typeof e=="boolean"?o=this.isTrue(e)?"True":"False":(typeof e=="number"||e!=null)&&(o=e.toString()),`${i.Name??""}=${o}`}).join(`
2
2
  `));updateSettingsFromText(i){if(typeof i!="string")return;let e=ue(i);this.options.update(()=>e)}isTrue(i){if(typeof i=="boolean")return i;if(typeof i=="string"){let e=i.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}inAppOptions(i){let e=this.applicationOptions()?.findIndex(o=>o.Name?.replace("--","")===i);return e===void 0?!1:e>-1}addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(i=>[...i,{Filter:null,Name:"",Value:""}])}addSetting(i){this.options.update(e=>{let o=i.defaultValue??"";return i.type==="Boolean"&&(o=this.isTrue(o)),i.type==="Integer"&&(o=parseInt(o)||0),[...e,{Name:i.name,Value:o}]})}updateSettingValue(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(c=>c.Name===i.Name);if(i.FormView.type==="Boolean")return n[a].Value=this.isTrue(e)?"True":"False",n;if(i.FormView.type==="Integer")return n[a].Value=e.toString(),n;if(i.FormView.type==="Enumeration"&&i.FormView.options){let c=e?.trim().toLowerCase()??"",V=i.FormView.options.find(I=>(I??"").trim().toLocaleLowerCase()===c);if(V)return n[a].Value=V,n}return n[a].Value=e,n})}updateFreeTextSettingName(i,e){this.options.update(o=>{let n=[...o],a=n.findIndex(c=>c.Name===i.Name);return n[a].Name=e,n})}removeSetting(i){this.options.update(e=>e.filter(o=>o.Name!==i.Name))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=q({type:t,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"],applicationOptions:[1,"applicationOptions"]},outputs:{options:"optionsChange"},decls:11,vars:3,consts:()=>{let i;i=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize` Add advanced option ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:pen${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: New custom option `;let a;return a=$localize`By adding this option it will override the matching global option`,[["validateTemplate",""],["option",""],["defaultLabel",""],["enumOptionTemplate",""],["optionTemplate",""],i,e,o,n,[3,"disallowToggle"],["title",""],[1,"actions"],["shButton","","type","button",1,"outlined","small"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["menu",""],["type","button",3,"deprecated"],["type","button",3,"click"],[1,"option-col"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"placeholder"],[1,"field-row"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["shButton","","type","button",1,"outlined","small","remove-btn",3,"click"],["shTooltip",a,1,"error"],[1,"warn",3,"shTooltip"],[1,"primary",3,"shTooltip"],[4,"ngTemplateOutlet"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],["type","text",3,"ngModelChange","id","ngModel"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"ngModelChange","type","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"],[1,"error",3,"shTooltip"]]},template:function(e,o){e&1&&(_(0,"sh-toggle-card",9),R(1,10)(2),Q(3,5),M(),_(4,"div",11),F(5,he,3,0,"button",12)(6,Le,8,2),p(),M(),F(7,Ie,1,3,"textarea",13)(8,Tt,3,1),p(),S(9,wt,1,1,"ng-template",null,0,v)),e&2&&(s("disallowToggle",!0),l(5),h(o.showTextArea()?5:6),l(2),h(o.showTextArea()?7:8))},dependencies:[ae,te,oe,ee,ne,ie,fe,ge,xe,Z,ce,_e,le,pe,de,re,se,me],styles:["[_nghost-%COMP%]{display:block}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}sh-toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-9);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;position:relative;z-index:1;max-width:32.5rem;width:100%}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.field-row[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]:first-child{max-width:28rem;width:100%}.field-row.align-remove-start[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-start}.option-col[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}sh-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}.deprecated[_ngcontent-%COMP%]{text-decoration:line-through}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}"],changeDetection:0})};export{Se as a};