@duplicati/ngclient 0.0.201 → 0.0.202
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.
- package/{chunk-ZESQ7CXK.js → chunk-2K372PXE.js} +1 -1
- package/{chunk-V7OCP4NF.js → chunk-2UQHKWPX.js} +1 -1
- package/{chunk-44X4A7WY.js → chunk-47WLUZZW.js} +1 -1
- package/{chunk-MI7UAY44.js → chunk-5FG47DZE.js} +1 -1
- package/{chunk-VIXVL2MX.js → chunk-6PRBIISZ.js} +1 -1
- package/{chunk-BAGYEJI6.js → chunk-BZCQDJKC.js} +1 -1
- package/{chunk-56MQ46JU.js → chunk-BZECS72X.js} +1 -1
- package/{chunk-NEC5ZCCT.js → chunk-F2LKEAZA.js} +1 -1
- package/{chunk-LPAIFT5I.js → chunk-K6G3RPPP.js} +4 -4
- package/{chunk-NQAH5AL7.js → chunk-KYDOMNGV.js} +1 -1
- package/{chunk-POPZ47SS.js → chunk-PGHGTNMG.js} +1 -1
- package/chunk-RTXGZ7K6.js +1 -0
- package/{chunk-C5RNVTX6.js → chunk-VDAFXR4A.js} +1 -1
- package/{chunk-P7OUKLCO.js → chunk-VHTM26J2.js} +1 -1
- package/{chunk-XZH2SXWG.js → chunk-VY3GBMSF.js} +1 -1
- package/chunk-WITGABR3.js +1 -0
- package/{chunk-JZRRR52Q.js → chunk-X2K5SVKZ.js} +1 -1
- package/{chunk-VLC2XPEM.js → chunk-X3BNEJHR.js} +1 -1
- package/{chunk-4GYWPC2V.js → chunk-XIHS2E55.js} +1 -1
- package/{chunk-4AQZL2UM.js → chunk-Y64QX4FF.js} +1 -1
- package/{chunk-MUFBZIQA.js → chunk-Z35S3FHQ.js} +1 -1
- package/index.html +1 -1
- package/{main-CMOWV2QF.js → main-CY7NIZIC.js} +1 -1
- package/package.json +1 -1
- package/chunk-SQNRZYPW.js +0 -1
- package/chunk-VVQRXJRI.js +0 -1
|
@@ -1 +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 N,Ab as d,Bb as oe,E as ue,Fb as Ee,Gb as Me,Gc as xe,Hb as pe,Ib as A,Mc as x,Pa as u,Pb as be,Qb as Pe,Qc as Re,Rb as I,Rc as m,Sb as K,Sc as he,Tb as Q,Vb as D,W as ee,Xb as p,Yb as W,Zb as O,aa as S,cb as V,cc as Ne,dc as Se,ec as ge,fc as re,gc as w,hb as q,jc as P,kc as ve,l as me,la as T,lc as Oe,mc as Fe,na as R,oc as L,p as X,pc as k,qc as $,rb as te,sb as F,tb as y,ub as Te,v as fe,wb as ie,wc as se,xb as ne,xc as ye,yb as b,yc as le,z as Ce,zb as c,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&&P(0),o&2){let e=t.$implicit,i=p();Fe("",e.label,"",i.hasPerSecond()?"/s":"")}}var it=["throttle-upload","throttle-download"],nt=[{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=m();inputType=m();timespan=T(0);unit=T("MB");sizeOptions=T(nt);readonly=T(!1);hasPerSecond=x(()=>{let t=this.inputType();return t&&it.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{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,i){e&1&&(W(Ze),c(0,"div",0),O(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),O(4,1),O(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(i.unit,r)||(i.unit=r),r}),d(),q(8,tt,1,2,"ng-template"),d()),e&2&&(u(2),te("readonly",i.readonly()||void 0),u(),b("id",i.customId()),L("ngModel",i.timespan),b("disabled",i.readonly()),u(3),re("--miw",0),b("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),u(),L("ngModel",i.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();c(0,"sh-button-group",10)(1,"button",20),D("click",function(){N(e);let n=p();return S(n.pathDiscoveryMethod.set("browse"))}),I(2,4),d(),c(3,"button",20),D("click",function(){N(e);let n=p();return S(n.pathDiscoveryMethod.set("path"))}),I(4,5),d()()}if(o&2){let e=p();u(),w("active",e.pathDiscoveryMethod()==="browse"),u(2),w("active",e.pathDiscoveryMethod()==="path")}}function ht(o,t){o&1&&oe(0,"sh-progress-bar",13)}function _t(o,t){o&1&&(c(0,"sh-icon",25),P(1,"caret-down"),d())}function mt(o,t){o&1&&oe(0,"sh-icon",25)}function ft(o,t){o&1&&(c(0,"sh-icon",25),P(1,"caret-right"),d())}function Ct(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder-open"),d())}function Tt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder-user"),d())}function Et(o,t){o&1&&(c(0,"sh-icon",23),P(1,"file"),d())}function Mt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder"),d())}function bt(o,t){if(o&1&&(F(0,_t,2,0,"sh-icon",25)(1,mt,1,0,"sh-icon",25)(2,ft,2,0,"sh-icon",25),F(3,Ct,2,0,"sh-icon",23)(4,Tt,2,0,"sh-icon",23)(5,Et,2,0,"sh-icon",23)(6,Mt,2,0,"sh-icon",23)),o&2){let e=p(2).$implicit;y(e.children.length?0:e.cls==="file"?1:2),u(3),y(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Pt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"desktop-tower"),d())}function Nt(o,t){o&1&&pe(0)}function St(o,t){if(o&1&&q(0,Nt,1,0,"ng-container",14),o&2){let e=p(2).$implicit,i=p().$implicit;p();let n=ge(7);b("ngTemplateOutlet",n)("ngTemplateOutletContext",le(5,Ke,De(2,dt,e.children,i.level+1)))}}function vt(o,t){if(o&1){let e=A();c(0,"div",21,3),D("click",function(){N(e);let n=p().$implicit,r=p(2);return S(r.toggleNode(n.id,n))}),c(2,"div",22),F(3,bt,7,2)(4,Pt,2,0,"sh-icon",23),d(),c(5,"div",24),D("click",function(n){N(e);let r=p().$implicit,a=p(2);return S(a.toggleSelectedNode(n,r))}),P(6),d()(),F(7,St,1,7,"ng-container")}if(o&2){let e=p().$implicit,i=p().$implicit,n=p();w("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),u(2),w("file",e.cls==="file"),u(),y(e.id!=="/"?3:4),u(3),Oe(" ",e.text," "),u(),y(e.children.length>0?7:-1)}}function Ot(o,t){if(o&1&&F(0,vt,8,17),o&2){let e=t.$implicit,i=p(2);y(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Ft(o,t){if(o&1&&(c(0,"sh-list"),ie(1,Ot,1,1,null,null,pt),d()),o&2){let e=t.$implicit;re("padding-left",e.level*.25,"rem"),u(),ne(e.children)}}function yt(o,t){o&1&&pe(0)}function Dt(o,t){if(o&1){let e=A();c(0,"sh-toggle",26),D("click",function(){N(e);let n=p();return S(n._showHiddenNodes.set(!n._showHiddenNodes()))}),I(1,6),d()}if(o&2){let e=p();w("active",e._showHiddenNodes()),u(),K(e.showFiles()?"files":"folders"),Q(1)}}function xt(o,t){if(o&1){let e=A();c(0,"button",27),D("click",function(){N(e);let n=p();return S(n.openCreateFolderDialog())}),I(1,7),d()}if(o&2){let e=p();b("disabled",!e.isCurrentPathFolder())}}function Rt(o,t){if(o&1){let e=A();c(0,"sh-dialog",28),$("isOpenChange",function(n){N(e);let r=p();return k(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),S(n)}),c(1,"header",29)(2,"h2"),I(3,8),d()(),c(4,"div",30)(5,"div"),P(6," Folder will be created under "),c(7,"pre"),P(8),d()(),c(9,"sh-form-field")(10,"textarea",31),$("ngModelChange",function(n){N(e);let r=p();return k(r.createFolderPath,n)||(r.createFolderPath=n),S(n)}),d()()(),c(11,"footer",32)(12,"button",33),D("click",function(){N(e);let n=p();return S(n.closeCreateFolderDialog(!1))}),P(13,"Cancel"),d(),c(14,"button",34),D("click",function(){N(e);let n=p();return S(n.closeCreateFolderDialog(!0))}),be(15,9),oe(16,"sh-icon"),Pe(),d()()()}if(o&2){let e,i=p();L("isOpen",i.createFolderDialogOpen),b("options",ye(5,ut)),u(8),ve(i.currentPath()),u(2),L("ngModel",i.createFolderPath),u(4),b("disabled",!((e=i.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||{}),v="/",_e=class o{#e=ee(ze);#n=ee(je);#d=ee(Le);multiSelect=m(!1);disabled=m(!1);showFiles=m(!1);selectFiles=m(!1);accepts=m(null);startingPath=m(null);rootPaths=m([]);initialNodes=m([]);backupSettings=m(null);pathRefreshTrigger=m(!1);showHiddenNodes=m(!1);enableCreateFolder=m(!1);hideShortcuts=m(!1);office365Mode=m(!1);backupId=m("");destinationUrl=m("");loadExtendedData=m(!0);hasExtendedData=Re();_showHiddenNodes=T(!1);createFolderDialogOpen=T(!1);createFolderPath=T(null);treeContainerRef=he("treeContainer");formRef=he("formRef");pathDiscoveryMethod=T("browse");isLoading=T(!1);currentPath=T("/");#o=T(null);treeSearchQuery=T("");treeNodes=T([]);pathDelimiter=x(()=>this.#n.systemInfo()?.DirectorySeparator??"");filterGroups=this.#n.filterGroups();isByBackupSettings=x(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=x(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Qe;treeStructure=x(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==v),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let h=f.slice(1,-1),_=this.filterGroups?.FilterGroups[h];if(_&&_.length){let E=_.map(M=>`-${M}`);i.splice(l,1,...E)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),C=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let g=this.#r(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:g,isIndeterminate:!1,cls:this.#t(l,C)?"folder":"file"}}):s=[{id:v,resolvedpath:v,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let g=new Map;if(!l.id)return;let f=l.id;a&&(l.accepted=!0),g.set(f,l);let h=r.length>0?n.filter(_=>_.parentPath.startsWith(f)):n;for(let _ of h){if(!_.id)continue;let E=_.id;if(!_.cls||g.has(E))continue;let M=g.get(_.parentPath),U=_.hidden===!0&&t?0:this.#r(i,E,_.cls,M),B=Z(Y({},_),{isIndeterminate:this.isIndeterminate(i,E),evalState:U,children:[]});a&&(B.accepted=this.matchAccepts(a,B)),g.set(E,B),M&&M.children.push(B)}return l}),s});#u(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===v?t:t+e:v}#r(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),C=t.filter(g=>!g.startsWith("-")&&!g.startsWith("+")),s=t.filter(g=>g.startsWith("-")||g.startsWith("+")),l=this.multiSelect();if(C.length===0)return r;for(let g=0;g<C.length;g++){let f=C[g];if(e===f){r=1;break}if(!l||!this.#t(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let g=0;g<s.length;g++){let f=s[g],h=f.slice(1),_=f.startsWith("-")?-1:1;if(this.#t(h,a)){if(i!=="folder")continue;if(e===h){r=_;break}}if(h.startsWith("*")&&h.endsWith(`*${a}`)){if(i!=="folder")continue;let M=h.slice(1,-2);if(M==="")break;if(e?.includes(M+a)){r=_;break}}if(h.startsWith("[.*")&&h.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let M=h.slice(3,-7);if(new RegExp(M).test(e)){r=_;break}}if(h.startsWith("[")&&h.endsWith("]")){let M=h.slice(1,-1),U=this.translateCSharpRegex(M);if(new RegExp(`${U}`).test(e)){r=_;break}}if(h.startsWith("*.")){if(i!=="file"||h.replace("*.","").length===0)continue;if(this.#s(e,h,!0)){r=_;break}}if(h==="")continue;if(h===e){r=_;break}if(this.#s(e,h,!0)){r=_;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#t(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===v)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#m(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:this.#c(n.text,n?.Metadata),iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,v)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?v:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===v||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==v),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,C=this.#t(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(C&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=C?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==v&&this.#t(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#u(e),r=i+n;this.#e.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let C=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=C?C[1]:a?.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()})}#h(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":this.backupId()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(X(e=>{let i=e.Result;return Object.keys(i).map(n=>({Path:n,Metadata:JSON.parse(i[n])}))}))}#_(t){let e=this.backupSettings();if(this.#n.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(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#e.getApiV1BackupByIdFiles(i).pipe(X(n=>n.Files??[]))}}#a(t){return this.office365Mode()?this.#h(t):this.isByBackupSettings()?this.#_(t):this.#g(t)}#m(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[v];r.forEach(s=>{s.forEach((l,g)=>{let f=s.slice(0,g+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let C=a.map(s=>this.#a(s).pipe(X(l=>({status:"success",value:l,url:s})),Ce(l=>me({status:"error",value:l,url:s}))));fe(C).pipe(ue(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),g=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let h=l.flatMap(E=>Array.isArray(E.value)?E.value.map(M=>Z(Y({},M),{parentPath:E.url})):[]),_=[...new Map([...f,...h].map(E=>[E.id,E])).values()];return this.#l(),this.hideShortcuts()?_.filter(E=>!E.id.startsWith("%")):_})}})}#c(t,e){if(e){let i=e["o365:Name"]||e["o365:DisplayName"];if(i)return i}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)}#i(t=null,e=v){let i=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ue(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()||this.office365Mode()?n.map(a=>(this.#f(a.Metadata),{text:this.#c(a.Path.split(i).filter(s=>s!=="").pop(),a.Metadata),id:a.Path,cls:this.#t(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let C=r.map(l=>{let g=this.#t(l.id,i)?"folder":"file";return Z(Y({},l),{cls:g,parentPath:e})}),s=[...new Map([...a,...C].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&Ne(i.treeContainerRef,rt,5)(i.formRef,st,5),e&2&&Se(2)},hostVars:2,hostBindings:function(e,i){e&2&&w("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"],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 i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"type-b","small"],[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(W(lt),F(0,gt,5,4,"sh-button-group",10),c(1,"div",11),O(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",12,0),F(5,ht,1,0,"sh-progress-bar",13),q(6,Ft,3,2,"ng-template",null,1,xe)(8,yt,1,0,"ng-container",14),d(),c(9,"div",15),F(10,Dt,2,3,"sh-toggle",16),F(11,xt,2,1,"button",17),d()(),c(12,"div",18,2)(14,"sh-form-field"),O(15,1,["ngProjectAs","label",5,["label"]]),O(16,2,["ngProjectAs","input",5,["input"]]),d()(),F(17,Rt,17,6,"sh-dialog",19)),e&2){let n=ge(7);y(!i.multiSelect()&&!i.office365Mode()?0:-1),u(),w("hidden",i.pathDiscoveryMethod()!=="browse"),u(2),w("visualize-accepted",i.accepts()),u(2),y(i.isLoading()?5:-1),u(3),b("ngTemplateOutlet",n)("ngTemplateOutletContext",le(15,Ke,le(13,ct,i.treeStructure()))),u(2),y(!i.accepts()&&!i.isByBackupSettings()&&!i.office365Mode()?10:-1),u(),y(i.enableCreateFolder()&&!i.office365Mode()?11:-1),u(),w("hidden",i.pathDiscoveryMethod()!=="path"),u(5),y(i.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][_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 wt=[[["label"]],[["","prefix",""]],[["","suffix",""]]],It=["label","[prefix]","[suffix]"];function At(o,t){if(o&1){let e=A();c(0,"button",7),D("click",function(){let n=N(e).$implicit,r=p();return S(r.updateUnit(n.value))}),I(1,1),d()}if(o&2){let e=t.$implicit;u(),K(e.label),Q(1)}}var Lt=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],kt=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],$t=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],Ye=class o{customId=m();inputType=m();timespan=T(0);#e="D";unit=T(this.#e);unitLabel=x(()=>{let t=this.timeOptions(),e=t.findIndex(i=>i.value===this.unit());return t[e]?.label??this.unit()});isShortTime=x(()=>{let t=this.inputType();return t&&$t.includes(t.replace("--",""))});timeOptions=x(()=>this.isShortTime()?Lt:kt);readonly=T(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});inputTypeEffect=R(()=>{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 i=e?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,n=t.match(i);n?(this.timespan.set(parseInt(n[1],10)),this.unit.set(n[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:It,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,i){e&1&&(W(wt),O(0,0,["ngProjectAs","label",5,["label"]]),c(1,"sh-form-field")(2,"input",2),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),O(3,1),O(4,2),d(),c(5,"sh-menu",3)(6,"button",4),I(7,0),d(),Ee(8,5),ie(9,At,2,1,"button",6,Te),Me(),d()),e&2&&(u(),te("readonly",i.readonly()||void 0),u(),b("id",i.customId()),L("ngModel",i.timespan),b("disabled",i.readonly()),u(3),b("openIndicator",!0),u(2),K(i.unitLabel()),Q(7),u(2),ne(i.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{nt as a,ot as b,Je as c,_e as d,Ye as e};
|
|
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 N,Ab as d,Bb as oe,E as ue,Fb as Ee,Gb as Me,Gc as xe,Hb as pe,Ib as A,Mc as x,Pa as u,Pb as be,Qb as Pe,Qc as Re,Rb as I,Rc as m,Sb as K,Sc as he,Tb as Q,Vb as D,W as ee,Xb as p,Yb as W,Zb as O,aa as S,cb as V,cc as Ne,dc as Se,ec as ge,fc as re,gc as w,hb as q,jc as P,kc as ve,l as me,la as T,lc as Oe,mc as Fe,na as R,oc as L,p as X,pc as k,qc as $,rb as te,sb as F,tb as y,ub as Te,v as fe,wb as ie,wc as se,xb as ne,xc as ye,yb as b,yc as le,z as Ce,zb as c,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&&P(0),o&2){let e=t.$implicit,i=p();Fe("",e.label,"",i.hasPerSecond()?"/s":"")}}var it=["throttle-upload","throttle-download"],nt=[{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=m();inputType=m();timespan=T(0);unit=T("MB");sizeOptions=T(nt);readonly=T(!1);hasPerSecond=x(()=>{let t=this.inputType();return t&&it.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{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,i){e&1&&(W(Ze),c(0,"div",0),O(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),O(4,1),O(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(i.unit,r)||(i.unit=r),r}),d(),q(8,tt,1,2,"ng-template"),d()),e&2&&(u(2),te("readonly",i.readonly()||void 0),u(),b("id",i.customId()),L("ngModel",i.timespan),b("disabled",i.readonly()),u(3),re("--miw",0),b("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),u(),L("ngModel",i.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();c(0,"sh-button-group",10)(1,"button",20),D("click",function(){N(e);let n=p();return S(n.pathDiscoveryMethod.set("browse"))}),I(2,4),d(),c(3,"button",20),D("click",function(){N(e);let n=p();return S(n.pathDiscoveryMethod.set("path"))}),I(4,5),d()()}if(o&2){let e=p();u(),w("active",e.pathDiscoveryMethod()==="browse"),u(2),w("active",e.pathDiscoveryMethod()==="path")}}function ht(o,t){o&1&&oe(0,"sh-progress-bar",13)}function _t(o,t){o&1&&(c(0,"sh-icon",25),P(1,"caret-down"),d())}function mt(o,t){o&1&&oe(0,"sh-icon",25)}function ft(o,t){o&1&&(c(0,"sh-icon",25),P(1,"caret-right"),d())}function Ct(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder-open"),d())}function Tt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder-user"),d())}function Et(o,t){o&1&&(c(0,"sh-icon",23),P(1,"file"),d())}function Mt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"folder"),d())}function bt(o,t){if(o&1&&(F(0,_t,2,0,"sh-icon",25)(1,mt,1,0,"sh-icon",25)(2,ft,2,0,"sh-icon",25),F(3,Ct,2,0,"sh-icon",23)(4,Tt,2,0,"sh-icon",23)(5,Et,2,0,"sh-icon",23)(6,Mt,2,0,"sh-icon",23)),o&2){let e=p(2).$implicit;y(e.children.length?0:e.cls==="file"?1:2),u(3),y(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Pt(o,t){o&1&&(c(0,"sh-icon",23),P(1,"desktop-tower"),d())}function Nt(o,t){o&1&&pe(0)}function St(o,t){if(o&1&&q(0,Nt,1,0,"ng-container",14),o&2){let e=p(2).$implicit,i=p().$implicit;p();let n=ge(7);b("ngTemplateOutlet",n)("ngTemplateOutletContext",le(5,Ke,De(2,dt,e.children,i.level+1)))}}function vt(o,t){if(o&1){let e=A();c(0,"div",21,3),D("click",function(){N(e);let n=p().$implicit,r=p(2);return S(r.toggleNode(n.id,n))}),c(2,"div",22),F(3,bt,7,2)(4,Pt,2,0,"sh-icon",23),d(),c(5,"div",24),D("click",function(n){N(e);let r=p().$implicit,a=p(2);return S(a.toggleSelectedNode(n,r))}),P(6),d()(),F(7,St,1,7,"ng-container")}if(o&2){let e=p().$implicit,i=p().$implicit,n=p();w("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),u(2),w("file",e.cls==="file"),u(),y(e.id!=="/"?3:4),u(3),Oe(" ",e.text," "),u(),y(e.children.length>0?7:-1)}}function Ot(o,t){if(o&1&&F(0,vt,8,17),o&2){let e=t.$implicit,i=p(2);y(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Ft(o,t){if(o&1&&(c(0,"sh-list"),ie(1,Ot,1,1,null,null,pt),d()),o&2){let e=t.$implicit;re("padding-left",e.level*.25,"rem"),u(),ne(e.children)}}function yt(o,t){o&1&&pe(0)}function Dt(o,t){if(o&1){let e=A();c(0,"sh-toggle",26),D("click",function(){N(e);let n=p();return S(n._showHiddenNodes.set(!n._showHiddenNodes()))}),I(1,6),d()}if(o&2){let e=p();w("active",e._showHiddenNodes()),u(),K(e.showFiles()?"files":"folders"),Q(1)}}function xt(o,t){if(o&1){let e=A();c(0,"button",27),D("click",function(){N(e);let n=p();return S(n.openCreateFolderDialog())}),I(1,7),d()}if(o&2){let e=p();b("disabled",!e.isCurrentPathFolder())}}function Rt(o,t){if(o&1){let e=A();c(0,"sh-dialog",28),$("isOpenChange",function(n){N(e);let r=p();return k(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),S(n)}),c(1,"header",29)(2,"h2"),I(3,8),d()(),c(4,"div",30)(5,"div"),P(6," Folder will be created under "),c(7,"pre"),P(8),d()(),c(9,"sh-form-field")(10,"textarea",31),$("ngModelChange",function(n){N(e);let r=p();return k(r.createFolderPath,n)||(r.createFolderPath=n),S(n)}),d()()(),c(11,"footer",32)(12,"button",33),D("click",function(){N(e);let n=p();return S(n.closeCreateFolderDialog(!1))}),P(13,"Cancel"),d(),c(14,"button",34),D("click",function(){N(e);let n=p();return S(n.closeCreateFolderDialog(!0))}),be(15,9),oe(16,"sh-icon"),Pe(),d()()()}if(o&2){let e,i=p();L("isOpen",i.createFolderDialogOpen),b("options",ye(5,ut)),u(8),ve(i.currentPath()),u(2),L("ngModel",i.createFolderPath),u(4),b("disabled",!((e=i.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||{}),v="/",_e=class o{#e=ee(ze);#n=ee(je);#d=ee(Le);multiSelect=m(!1);disabled=m(!1);showFiles=m(!1);selectFiles=m(!1);accepts=m(null);startingPath=m(null);rootPaths=m([]);initialNodes=m([]);backupSettings=m(null);pathRefreshTrigger=m(!1);showHiddenNodes=m(!1);enableCreateFolder=m(!1);hideShortcuts=m(!1);office365Mode=m(!1);backupId=m("");destinationUrl=m("");loadExtendedData=m(!0);hasExtendedData=Re();_showHiddenNodes=T(!1);createFolderDialogOpen=T(!1);createFolderPath=T(null);treeContainerRef=he("treeContainer");formRef=he("formRef");pathDiscoveryMethod=T("browse");isLoading=T(!1);currentPath=T("/");#o=T(null);treeSearchQuery=T("");treeNodes=T([]);pathDelimiter=x(()=>this.#n.systemInfo()?.DirectorySeparator??"");filterGroups=this.#n.filterGroups();isByBackupSettings=x(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=x(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=Qe;treeStructure=x(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==v),i=structuredClone(e);for(let l=0;l<i.length;l++){let f=i[l].slice(1);if(f.startsWith("{")&&f.endsWith("}")){let h=f.slice(1,-1),_=this.filterGroups?.FilterGroups[h];if(_&&_.length){let E=_.map(M=>`-${M}`);i.splice(l,1,...E)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),C=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let g=this.#r(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:g,isIndeterminate:!1,cls:this.#t(l,C)?"folder":"file"}}):s=[{id:v,resolvedpath:v,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let g=new Map;if(!l.id)return;let f=l.id;a&&(l.accepted=!0),g.set(f,l);let h=r.length>0?n.filter(_=>_.parentPath.startsWith(f)):n;for(let _ of h){if(!_.id)continue;let E=_.id;if(!_.cls||g.has(E))continue;let M=g.get(_.parentPath),U=_.hidden===!0&&t?0:this.#r(i,E,_.cls,M),B=Z(Y({},_),{isIndeterminate:this.isIndeterminate(i,E),evalState:U,children:[]});a&&(B.accepted=this.matchAccepts(a,B)),g.set(E,B),M&&M.children.push(B)}return l}),s});#u(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===v?t:t+e:v}#r(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),C=t.filter(g=>!g.startsWith("-")&&!g.startsWith("+")),s=t.filter(g=>g.startsWith("-")||g.startsWith("+")),l=this.multiSelect();if(C.length===0)return r;for(let g=0;g<C.length;g++){let f=C[g];if(e===f){r=1;break}if(!l||!this.#t(f,a))continue;if(e?.startsWith(f)){r=1;break}}if(s.length===0)return r;for(let g=0;g<s.length;g++){let f=s[g],h=f.slice(1),_=f.startsWith("-")?-1:1;if(this.#t(h,a)){if(i!=="folder")continue;if(e===h){r=_;break}}if(h.startsWith("*")&&h.endsWith(`*${a}`)){if(i!=="folder")continue;let M=h.slice(1,-2);if(M==="")break;if(e?.includes(M+a)){r=_;break}}if(h.startsWith("[.*")&&h.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let M=h.slice(3,-7);if(new RegExp(M).test(e)){r=_;break}}if(h.startsWith("[")&&h.endsWith("]")){let M=h.slice(1,-1),U=this.translateCSharpRegex(M);if(new RegExp(`${U}`).test(e)){r=_;break}}if(h.startsWith("*.")){if(i!=="file"||h.replace("*.","").length===0)continue;if(this.#s(e,h,!0)){r=_;break}}if(h==="")continue;if(h===e){r=_;break}if(this.#s(e,h,!0)){r=_;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#t(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===v)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#p(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#m(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:this.#c(n.text,n?.Metadata),iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,v)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?v:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===v||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==v),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,C=this.#t(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(C&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=C?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==v&&this.#t(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#u(e),r=i+n;this.#e.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let C=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=C?C[1]:a?.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()})}#h(t){return this.#e.postApiV1WebmoduleByModulekey({modulekey:"office365",requestBody:{"backup-id":this.backupId()??"",operation:"ListDestinationRestoreTargets",url:this.destinationUrl()??"",path:t??"/"}}).pipe(X(e=>{let i=e.Result;return Object.keys(i).map(n=>({Path:n,Metadata:JSON.parse(i[n])}))}))}#_(t){let e=this.backupSettings();if(this.#n.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(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#e.getApiV1BackupByIdFiles(i).pipe(X(n=>n.Files??[]))}}#a(t){return this.office365Mode()?this.#h(t):this.isByBackupSettings()?this.#_(t):this.#g(t)}#m(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")&&!s.startsWith("+")&&!s.startsWith("@")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[v];r.forEach(s=>{s.forEach((l,g)=>{let f=s.slice(0,g+1).join(e);f!==""&&(a.includes(f)||a.push(f))})}),this.isLoading.set(!0);let C=a.map(s=>this.#a(s).pipe(X(l=>({status:"success",value:l,url:s})),Ce(l=>me({status:"error",value:l,url:s}))));fe(C).pipe(ue(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(f=>f.status==="success"),g=s.filter(f=>f.status==="error");this.treeNodes.update(f=>{let h=l.flatMap(E=>Array.isArray(E.value)?E.value.map(M=>Z(Y({},M),{parentPath:E.url})):[]),_=[...new Map([...f,...h].map(E=>[E.id,E])).values()];return this.#l(),this.hideShortcuts()?_.filter(E=>!E.id.startsWith("%")):_})}})}#c(t,e){if(e){let i=e["o365:Name"]||e["o365:DisplayName"];if(i)return i}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)}#i(t=null,e=v){let i=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ue(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()||this.office365Mode()?n.map(a=>(this.#f(a.Metadata),{text:this.#c(a.Path.split(i).filter(s=>s!=="").pop(),a.Metadata),id:a.Path,cls:this.#t(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let C=r.map(l=>{let g=this.#t(l.id,i)?"folder":"file";return Z(Y({},l),{cls:g,parentPath:e})}),s=[...new Map([...a,...C].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=V({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&Ne(i.treeContainerRef,rt,5)(i.formRef,st,5),e&2&&Se(2)},hostVars:2,hostBindings:function(e,i){e&2&&w("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"],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 i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"type-b","small"],[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(W(lt),F(0,gt,5,4,"sh-button-group",10),c(1,"div",11),O(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",12,0),F(5,ht,1,0,"sh-progress-bar",13),q(6,Ft,3,2,"ng-template",null,1,xe)(8,yt,1,0,"ng-container",14),d(),c(9,"div",15),F(10,Dt,2,3,"sh-toggle",16),F(11,xt,2,1,"button",17),d()(),c(12,"div",18,2)(14,"sh-form-field"),O(15,1,["ngProjectAs","label",5,["label"]]),O(16,2,["ngProjectAs","input",5,["input"]]),d()(),F(17,Rt,17,6,"sh-dialog",19)),e&2){let n=ge(7);y(!i.multiSelect()&&!i.office365Mode()?0:-1),u(),w("hidden",i.pathDiscoveryMethod()!=="browse"),u(2),w("visualize-accepted",i.accepts()),u(2),y(i.isLoading()?5:-1),u(3),b("ngTemplateOutlet",n)("ngTemplateOutletContext",le(15,Ke,le(13,ct,i.treeStructure()))),u(2),y(!i.accepts()&&!i.isByBackupSettings()&&!i.office365Mode()?10:-1),u(),y(i.enableCreateFolder()&&!i.office365Mode()?11:-1),u(),w("hidden",i.pathDiscoveryMethod()!=="path"),u(5),y(i.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][_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 wt=[[["label"]],[["","prefix",""]],[["","suffix",""]]],It=["label","[prefix]","[suffix]"];function At(o,t){if(o&1){let e=A();c(0,"button",7),D("click",function(){let n=N(e).$implicit,r=p();return S(r.updateUnit(n.value))}),I(1,1),d()}if(o&2){let e=t.$implicit;u(),K(e.label),Q(1)}}var Lt=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],kt=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],$t=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],Ye=class o{customId=m();inputType=m();timespan=T(0);#e="D";unit=T(this.#e);unitLabel=x(()=>{let t=this.timeOptions(),e=t.findIndex(i=>i.value===this.unit());return t[e]?.label??this.unit()});isShortTime=x(()=>{let t=this.inputType();return t&&$t.includes(t.replace("--",""))});timeOptions=x(()=>this.isShortTime()?Lt:kt);readonly=T(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});inputTypeEffect=R(()=>{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 i=e?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,n=t.match(i);n?(this.timespan.set(parseInt(n[1],10)),this.unit.set(n[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:It,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,i){e&1&&(W(wt),O(0,0,["ngProjectAs","label",5,["label"]]),c(1,"sh-form-field")(2,"input",2),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),O(3,1),O(4,2),d(),c(5,"sh-menu",3)(6,"button",4),I(7,0),d(),Ee(8,5),ie(9,At,2,1,"button",6,Te),Me(),d()),e&2&&(u(),te("readonly",i.readonly()||void 0),u(),b("id",i.customId()),L("ngModel",i.timespan),b("disabled",i.readonly()),u(3),b("openIndicator",!0),u(2),K(i.unitLabel()),Q(7),u(2),ne(i.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{nt as a,ot as b,Je as c,_e as d,Ye as e};
|
package/index.html
CHANGED
|
@@ -124,5 +124,5 @@
|
|
|
124
124
|
<body>
|
|
125
125
|
<app-root></app-root>
|
|
126
126
|
<div class="loading">Connecting ...</div>
|
|
127
|
-
<link rel="modulepreload" href="chunk-AODNZLCK.js"><link rel="modulepreload" href="chunk-ZMSYEF6G.js"><link rel="modulepreload" href="chunk-MDXSNEQZ.js"><link rel="modulepreload" href="chunk-3TJKPVBA.js"><link rel="modulepreload" href="chunk-QHBOEY2O.js"><link rel="modulepreload" href="chunk-NK5WD6WE.js"><link rel="modulepreload" href="chunk-B62TPRVG.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-SZUNW4JO.js"><link rel="modulepreload" href="chunk-HSHF5HR7.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-
|
|
127
|
+
<link rel="modulepreload" href="chunk-AODNZLCK.js"><link rel="modulepreload" href="chunk-ZMSYEF6G.js"><link rel="modulepreload" href="chunk-MDXSNEQZ.js"><link rel="modulepreload" href="chunk-3TJKPVBA.js"><link rel="modulepreload" href="chunk-QHBOEY2O.js"><link rel="modulepreload" href="chunk-NK5WD6WE.js"><link rel="modulepreload" href="chunk-B62TPRVG.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-SZUNW4JO.js"><link rel="modulepreload" href="chunk-HSHF5HR7.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-CY7NIZIC.js" type="module"></script></body>
|
|
128
128
|
</html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as ke,c as Ae}from"./chunk-AODNZLCK.js";import{a as Te}from"./chunk-ZMSYEF6G.js";import{a as Ie}from"./chunk-MDXSNEQZ.js";import{b as k}from"./chunk-3TJKPVBA.js";import{a as Me}from"./chunk-QHBOEY2O.js";import{b as Ee}from"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import{a as D}from"./chunk-6Q6SSTBK.js";import{a as Re}from"./chunk-SZUNW4JO.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-ZU6T3TW3.js";import{a as H}from"./chunk-HUZXJWCG.js";import{a as h,b as be,c as v,d as we,e as I}from"./chunk-7TWUW4XJ.js";import{v as Ce,x as ve}from"./chunk-UNMDSCAN.js";import{a as ye,d as Se}from"./chunk-CFNARBNK.js";import{c as me,d as de,g as ue,h as he,i as fe,j as ge}from"./chunk-I27PVH6D.js";import{a as re}from"./chunk-5VE6P5U5.js";import{a as se,b as ie,c as ae,e as pe,f as le,g as ce}from"./chunk-PO3L6MKW.js";import{fa as oe,ka as ne}from"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Bb as Z,E as M,I as K,Ic as ee,Jc as te,K as T,M as _,R as C,U as q,W as s,cb as Y,da as z,ea as X,f as W,g as $,l as G,la as d,m as B,na as Q,p as w,y as P,z as J}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var A=class e{#e=s(h);#a=s(v);ngOnInit(){be(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=Y({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Z(0,"router-outlet")},dependencies:[me],encapsulation:2})};var Ne={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new q("ENVIRONMENT");var N=class e{#e=s(Se);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#e.getApiV1Webmodules().pipe(_(n=>this.webmodules.set(n)),M(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Fe=()=>{let e=s(I);return e.token()?!0:e.checkProxyAuthed().pipe(T(t=>t?G(!0):e.refreshToken().pipe(w(()=>!0))))},We=()=>{let e=s(v),t=s(k),o=s(z),n=e.relayIsEnabled()?"longpoll":"websocket",a=[o.get(H).preload(!0),o.get(H).preloadFilterGroups(!0),o.get(N).preload(!0)];return e.configLoaded===null?P(a).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(a)))},$e=()=>!0,Oe={path:"connect/:typeParam",loadComponent:()=>import("./chunk-NNNKIEPR.js")},Ge=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},xe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-HOGZ74SB.js")},{path:"logout",loadComponent:()=>import("./chunk-EE5SIDTF.js")},{path:"",canActivate:[Fe],children:[{path:"",canActivate:[We,$e,Ge],children:[{path:"welcome",loadComponent:()=>import("./chunk-NGNWWP6M.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-AIH3GSIT.js")},Oe]},{path:"",loadComponent:()=>import("./chunk-HETNGT36.js"),children:[{path:"",loadComponent:()=>import("./chunk-O64YAUSG.js")},Oe,{path:"add-backup",loadComponent:()=>import("./chunk-YDE34GTN.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-UK7MV4OF.js")},{path:"backup/import",loadComponent:()=>import("./chunk-QLENTLZJ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-BAGYEJI6.js"),loadChildren:()=>import("./chunk-VVQRXJRI.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-BAGYEJI6.js"),loadChildren:()=>import("./chunk-VVQRXJRI.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-AMTYI2HA.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-XHIPGS6J.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-JZRRR52Q.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-LODLMHG5.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-U2E3ZQUP.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-FRPWQ4C3.js")},{path:"from-config",loadComponent:()=>import("./chunk-A2O2XHOB.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-VIXVL2MX.js"),loadChildren:()=>import("./chunk-SQNRZYPW.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-VIXVL2MX.js"),loadChildren:()=>import("./chunk-SQNRZYPW.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-VIXVL2MX.js"),loadChildren:()=>import("./chunk-SQNRZYPW.js")},{path:"status",loadComponent:()=>import("./chunk-PE34XFKC.js")},{path:"settings",loadComponent:()=>import("./chunk-ZESQ7CXK.js")},{path:"about",loadComponent:()=>import("./chunk-WNG24347.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-I2RQR4CB.js")},{path:"changelog",loadComponent:()=>import("./chunk-BYUBKTO5.js")},{path:"libraries",loadComponent:()=>import("./chunk-R5YJUVWW.js")},{path:"system-info",loadComponent:()=>import("./chunk-3K3BYB36.js")},{path:"server-settings",loadComponent:()=>import("./chunk-T4IKTBRQ.js")},{path:"logs",loadChildren:()=>import("./chunk-26MRZAFB.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-VFBRHP2H.js")}]}]}]}]}]}];var U=null,Le=(e,t)=>{let o=s(I),n=s(de),a=s(h),p=s(f),i=a.getItem("locale"),u=s(ve),l=ke(i),r=ye.BASE||"",m=e.url===`${r}/api/v1/auth/login`,S=e.url===`${r}/api/v1/auth/logout`,g=e.url===`${r}/api/v1/auth/refresh`,b=e.url===`${r}/api/v1/progressstate`,E=e.url===`${r}/api/v1/remoteoperation/test`,Ue=e.url===`${r}/api/v1/filesystem/validate`,je=e.url.startsWith(`${r}/api/v2/`),L=o.token(),j=e,F=e.headers.has("custom-proxy-check")||L===we;if(L&&e.url.startsWith(r+p.baseUrl)&&!F){let c=e.headers.set("Authorization",`Bearer ${L}`);i&&i!=="en-US"&&(c=c.set("X-Ui-Language",l)),j=e.clone({headers:c})}return t(j).pipe(w(c=>{if(c.type===4&&c.status===200&&je){let y=c.body;if(y?.Success===!1)throw{status:200,message:y?.Error??"Unknown error",error:{Error:y?.Error??"Unknown error"},requestBody:y}}return c}),J(c=>{let y=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;if(!F){let R=!0;if((b&&c.status===404||E||Ue)&&(R=!1),g&&c.status===401&&(R=!1,o.logout(),n.navigate(["/logout"])),!m&&!g&&!S&&c.status===401)return R=!1,U??=o.refreshToken().pipe(K()),U.pipe(T(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),M(()=>U=null));R&&u.error(y)}return B(()=>({error:c,message:y}))}))};var O=class e{#e=s(X);showError(t){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=t||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Be="1.0.0",Pe=`portal-proxy-client-${D()}`,Je=1,x=class e{#e=1e3;#a=s(f);#d=s(O);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#l=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#c=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=Q(()=>{let t=this.#p(),o=this.#u(),n=this.#l();if(!n||!t||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(t){this.#s||(this.#s=!0,this.#d.showError(t||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(t){let o=Uint8Array.from(atob(t),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#l.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#l.set(t),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let l={token:t,publicKey:"",clientVersion:Be,protocolVersion:Je},r=this.createResponse(i,"authportal",l);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#c.length>0;){let l=this.#c.pop();l&&this.#r[l.messageId]&&this.activateCommand(l)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let l=this.#r[i.messageId];if(l){if(i.errorMessage)this.#i(i.errorMessage),l.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),l.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(l.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let a={from:Pe,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(t,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((l,r)=>{let m=D(),g={from:Pe,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},b={resolve:l,reject:r,timer:window.setTimeout(()=>{let E=this.#r[m];E&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),E.reject("Timeout"))},u)};this.#r[m]=b,this.#n()?this.activateCommand(g):this.#c.push(g)})}activateCommand(t){this.#t?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Ke(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function He(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let a=Ke(t.body),p={};t.headers.keys().forEach(r=>{p[r]=t.headers.get(r)??""});let i=t.headers.get("timeout"),u=i!==null?parseInt(i):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let l=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,a,p,u);return new W(r=>{l.then(m=>{let S=new se;p!=null&&Object.keys(p).forEach(b=>{S.set(b,p[b])});let g=new ie({body:m.body,status:m.statusCode,statusText:"OK",headers:S});r.next(g),r.complete()}).catch(m=>{r.error(new ae({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var De=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(x)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new $;return o.relayconfigState.configLoaded.subscribe(p=>{p&&He(o,e,t).subscribe(a)}),a}return He(o,e,t)};var Ve={providers:[ee(),he(xe,ge(),fe(ue)),pe(ce(),le([De,Le])),h,{provide:f,useValue:Ne},{provide:te,useValue:Ae()},{provide:Ce,useValue:{alertVariant:"simple"}},Te,k,Ee,ne,Re,oe,Me,Ie]};re(A,Ve);
|
|
1
|
+
import{b as ke,c as Ae}from"./chunk-AODNZLCK.js";import{a as Te}from"./chunk-ZMSYEF6G.js";import{a as Ie}from"./chunk-MDXSNEQZ.js";import{b as k}from"./chunk-3TJKPVBA.js";import{a as Me}from"./chunk-QHBOEY2O.js";import{b as Ee}from"./chunk-NK5WD6WE.js";import"./chunk-B62TPRVG.js";import{a as D}from"./chunk-6Q6SSTBK.js";import{a as Re}from"./chunk-SZUNW4JO.js";import"./chunk-HSHF5HR7.js";import"./chunk-5LBG6MOL.js";import"./chunk-ZU6T3TW3.js";import{a as H}from"./chunk-HUZXJWCG.js";import{a as h,b as be,c as v,d as we,e as I}from"./chunk-7TWUW4XJ.js";import{v as Ce,x as ve}from"./chunk-UNMDSCAN.js";import{a as ye,d as Se}from"./chunk-CFNARBNK.js";import{c as me,d as de,g as ue,h as he,i as fe,j as ge}from"./chunk-I27PVH6D.js";import{a as re}from"./chunk-5VE6P5U5.js";import{a as se,b as ie,c as ae,e as pe,f as le,g as ce}from"./chunk-PO3L6MKW.js";import{fa as oe,ka as ne}from"./chunk-7AVOHYTE.js";import"./chunk-KDSMLI73.js";import{Bb as Z,E as M,I as K,Ic as ee,Jc as te,K as T,M as _,R as C,U as q,W as s,cb as Y,da as z,ea as X,f as W,g as $,l as G,la as d,m as B,na as Q,p as w,y as P,z as J}from"./chunk-26Z7TPJB.js";import"./chunk-7CGTOI24.js";var A=class e{#e=s(h);#a=s(v);ngOnInit(){be(),this.#a.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(o){return new(o||e)};static \u0275cmp=Y({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(o,n){o&1&&Z(0,"router-outlet")},dependencies:[me],encapsulation:2})};var Ne={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new q("ENVIRONMENT");var N=class e{#e=s(Se);isLoaded=d(!1);webmodules=d(null);preload(t=!1){let o=this.#e.getApiV1Webmodules().pipe(_(n=>this.webmodules.set(n)),M(()=>this.isLoaded.set(!0)));if(t)return o;o.subscribe()}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Fe=()=>{let e=s(I);return e.token()?!0:e.checkProxyAuthed().pipe(T(t=>t?G(!0):e.refreshToken().pipe(w(()=>!0))))},We=()=>{let e=s(v),t=s(k),o=s(z),n=e.relayIsEnabled()?"longpoll":"websocket",a=[o.get(H).preload(!0),o.get(H).preloadFilterGroups(!0),o.get(N).preload(!0)];return e.configLoaded===null?P(a).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(a)))},$e=()=>!0,Oe={path:"connect/:typeParam",loadComponent:()=>import("./chunk-NNNKIEPR.js")},Ge=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},xe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-HOGZ74SB.js")},{path:"logout",loadComponent:()=>import("./chunk-EE5SIDTF.js")},{path:"",canActivate:[Fe],children:[{path:"",canActivate:[We,$e,Ge],children:[{path:"welcome",loadComponent:()=>import("./chunk-NGNWWP6M.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-AIH3GSIT.js")},Oe]},{path:"",loadComponent:()=>import("./chunk-HETNGT36.js"),children:[{path:"",loadComponent:()=>import("./chunk-O64YAUSG.js")},Oe,{path:"add-backup",loadComponent:()=>import("./chunk-YDE34GTN.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-UK7MV4OF.js")},{path:"backup/import",loadComponent:()=>import("./chunk-QLENTLZJ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-BZCQDJKC.js"),loadChildren:()=>import("./chunk-WITGABR3.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-BZCQDJKC.js"),loadChildren:()=>import("./chunk-WITGABR3.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-AMTYI2HA.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-XHIPGS6J.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-X2K5SVKZ.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-LODLMHG5.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-U2E3ZQUP.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-FRPWQ4C3.js")},{path:"from-config",loadComponent:()=>import("./chunk-A2O2XHOB.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-6PRBIISZ.js"),loadChildren:()=>import("./chunk-RTXGZ7K6.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-6PRBIISZ.js"),loadChildren:()=>import("./chunk-RTXGZ7K6.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-6PRBIISZ.js"),loadChildren:()=>import("./chunk-RTXGZ7K6.js")},{path:"status",loadComponent:()=>import("./chunk-PE34XFKC.js")},{path:"settings",loadComponent:()=>import("./chunk-2K372PXE.js")},{path:"about",loadComponent:()=>import("./chunk-WNG24347.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-I2RQR4CB.js")},{path:"changelog",loadComponent:()=>import("./chunk-BYUBKTO5.js")},{path:"libraries",loadComponent:()=>import("./chunk-R5YJUVWW.js")},{path:"system-info",loadComponent:()=>import("./chunk-3K3BYB36.js")},{path:"server-settings",loadComponent:()=>import("./chunk-T4IKTBRQ.js")},{path:"logs",loadChildren:()=>import("./chunk-26MRZAFB.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-VFBRHP2H.js")}]}]}]}]}]}];var U=null,Le=(e,t)=>{let o=s(I),n=s(de),a=s(h),p=s(f),i=a.getItem("locale"),u=s(ve),l=ke(i),r=ye.BASE||"",m=e.url===`${r}/api/v1/auth/login`,S=e.url===`${r}/api/v1/auth/logout`,g=e.url===`${r}/api/v1/auth/refresh`,b=e.url===`${r}/api/v1/progressstate`,E=e.url===`${r}/api/v1/remoteoperation/test`,Ue=e.url===`${r}/api/v1/filesystem/validate`,je=e.url.startsWith(`${r}/api/v2/`),L=o.token(),j=e,F=e.headers.has("custom-proxy-check")||L===we;if(L&&e.url.startsWith(r+p.baseUrl)&&!F){let c=e.headers.set("Authorization",`Bearer ${L}`);i&&i!=="en-US"&&(c=c.set("X-Ui-Language",l)),j=e.clone({headers:c})}return t(j).pipe(w(c=>{if(c.type===4&&c.status===200&&je){let y=c.body;if(y?.Success===!1)throw{status:200,message:y?.Error??"Unknown error",error:{Error:y?.Error??"Unknown error"},requestBody:y}}return c}),J(c=>{let y=c.error?.Error||`Error Code: ${c.status}, Message: ${c.message}`;if(!F){let R=!0;if((b&&c.status===404||E||Ue)&&(R=!1),g&&c.status===401&&(R=!1,o.logout(),n.navigate(["/logout"])),!m&&!g&&!S&&c.status===401)return R=!1,U??=o.refreshToken().pipe(K()),U.pipe(T(()=>t(e.clone({headers:e.headers.set("Authorization",`Bearer ${o.token()}`)}))),M(()=>U=null));R&&u.error(y)}return B(()=>({error:c,message:y}))}))};var O=class e{#e=s(X);showError(t){let o=this.#e.querySelector("body > .loading");if(!o)return;o.classList.add("has-error"),o.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let a=this.#e.createElement("div");a.classList.add("loading-error"),a.textContent=t||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),o.append(n,a,p)}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Be="1.0.0",Pe=`portal-proxy-client-${D()}`,Je=1,x=class e{#e=1e3;#a=s(f);#d=s(O);#o=d("disconnected");#u=d(this.#e);#p=d(!1);#n=d(!1);#l=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#c=[];#r={};#t=null;#h=new TextDecoder("utf-8");#m=null;#g=Q(()=>{let t=this.#p(),o=this.#u(),n=this.#l();if(!n||!t||!o||o<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n)},o)});#i(t){this.#s||(this.#s=!0,this.#d.showError(t||"Unable to connect to the server."))}#f(){this.#s||(this.#s=!0)}utf8Atob(t){let o=Uint8Array.from(atob(t),a=>a.charCodeAt(0)),n=this.#h.decode(o);return n?JSON.parse(n):null}connectToMachineServer(t,o){let n=o?.reconnect??!1,a=this.wsState();(a==="disconnected"||a==="error"||n)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(this.#a.machineServerUrl),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#p.set(!1),this.#l.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#l.set(t),this.#p.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let l={token:t,publicKey:"",clientVersion:Be,protocolVersion:Je},r=this.createResponse(i,"authportal",l);this.#o.set("welcome"),this.#t?.send(r)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var u=JSON.parse(i.payload??"");if(u.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#c.length>0;){let l=this.#c.pop();l&&this.#r[l.messageId]&&this.activateCommand(l)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let l=this.#r[i.messageId];if(l){if(i.errorMessage)this.#i(i.errorMessage),l.reject(i.errorMessage);else{let r=JSON.parse(i.payload??"");r.statusCode>=400?this.#i(r.body||`Initial request failed with status code ${r.statusCode}`):this.#f(),r.body=r?.body==null?null:this.utf8Atob(r.body),l.resolve(r)}delete this.#r[i.messageId],window.clearTimeout(l.timer)}}})}disconnectFromMachineServer(t=null){t&&console.error(t),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(t,o,n){let a={from:Pe,to:t.from,type:o,messageId:t.messageId,payload:JSON.stringify(n)};return JSON.stringify(a)}sendCommand(t,o,n,a,p,i,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(t),new Promise((l,r)=>{let m=D(),g={from:Pe,to:o,type:"command",messageId:m,payload:JSON.stringify({method:n,path:a,body:p,headers:i})},b={resolve:l,reject:r,timer:window.setTimeout(()=>{let E=this.#r[m];E&&(delete this.#r[m],this.#i("The request timed out before receiving a response."),E.reject("Timeout"))},u)};this.#r[m]=b,this.#n()?this.activateCommand(g):this.#c.push(g)})}activateCommand(t){this.#t?.send(JSON.stringify(t))}static \u0275fac=function(o){return new(o||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Ke(e){if(typeof e!="string")return null;let o=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...o))}function He(e,t,o){let n=e.relayconfigState.config();if(n===null)return o(t);let a=Ke(t.body),p={};t.headers.keys().forEach(r=>{p[r]=t.headers.get(r)??""});let i=t.headers.get("timeout"),u=i!==null?parseInt(i):e.defaultTimeout;t.url.startsWith("/api/v1/serverstate")&&t.url.includes("longpoll=true")&&(u=1e3*99);let l=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,t.method,t.url,a,p,u);return new W(r=>{l.then(m=>{let S=new se;p!=null&&Object.keys(p).forEach(b=>{S.set(b,p[b])});let g=new ie({body:m.body,status:m.statusCode,statusText:"OK",headers:S});r.next(g),r.complete()}).catch(m=>{r.error(new ae({error:m??"Unknown error",status:0,statusText:m??"Unknown error"}))})})}var De=(e,t)=>{let o={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(x)},n=o.relayconfigState.config();if(o.relayconfigState.configLoaded!==null&&n===null){let a=new $;return o.relayconfigState.configLoaded.subscribe(p=>{p&&He(o,e,t).subscribe(a)}),a}return He(o,e,t)};var Ve={providers:[ee(),he(xe,ge(),fe(ue)),pe(ce(),le([De,Le])),h,{provide:f,useValue:Ne},{provide:te,useValue:Ae()},{provide:Ce,useValue:{alertVariant:"simple"}},Te,k,Ee,ne,Re,oe,Me,Ie]};re(A,Ve);
|
package/package.json
CHANGED
package/chunk-SQNRZYPW.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-P7OUKLCO.js")},{path:"encryption",loadComponent:()=>import("./chunk-MI7UAY44.js")},{path:"select-files",loadComponent:()=>import("./chunk-V7OCP4NF.js")},{path:"options",loadComponent:()=>import("./chunk-56MQ46JU.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-4GYWPC2V.js")}],t=o;export{t as default};
|
package/chunk-VVQRXJRI.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-44X4A7WY.js")},{path:"destination",loadComponent:()=>import("./chunk-VLC2XPEM.js")},{path:"source-data",loadComponent:()=>import("./chunk-NQAH5AL7.js")},{path:"schedule",loadComponent:()=>import("./chunk-C5RNVTX6.js")},{path:"options",loadComponent:()=>import("./chunk-NEC5ZCCT.js")}];export{o as default};
|