@duplicati/ngclient 0.0.164 → 0.0.166
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-25QJ7OWU.js +1 -0
- package/{chunk-2QT6CZNW.js → chunk-2HQTO4LT.js} +1 -1
- package/{chunk-NXROYR6L.js → chunk-3ADKRLYD.js} +1 -1
- package/{chunk-VEON764K.js → chunk-3O255C2R.js} +1 -1
- package/{chunk-K6IL54XE.js → chunk-3VHQLGKM.js} +1 -1
- package/{chunk-SVQCV5AE.js → chunk-4IAJY6E3.js} +1 -1
- package/chunk-4N7O6OWH.js +1 -0
- package/{chunk-JPRQYGHQ.js → chunk-53GUCO6P.js} +1 -1
- package/{chunk-VCLWADQK.js → chunk-53V6KV3I.js} +1 -1
- package/{chunk-E5E5ASXG.js → chunk-5RCKMVGY.js} +1 -1
- package/{chunk-4GY6ZWN5.js → chunk-7WATCQLK.js} +1 -1
- package/chunk-A4HSV37F.js +1 -0
- package/{chunk-7XXYLQEN.js → chunk-AROXMP46.js} +1 -1
- package/{chunk-HVB6ARTT.js → chunk-AUMCM45B.js} +1 -1
- package/{chunk-NME5JWZN.js → chunk-AY4BUZJQ.js} +1 -1
- package/{chunk-X5BOJXMC.js → chunk-BRPGUJ77.js} +1 -1
- package/{chunk-URAI6X74.js → chunk-CMFSS355.js} +1 -1
- package/{chunk-CZRQ3GX6.js → chunk-CMMGGY2S.js} +1 -1
- package/{chunk-35KH4G7Y.js → chunk-CO4VU5IU.js} +1 -1
- package/chunk-DPQEDR6U.js +1 -0
- package/{chunk-XTFTWEJS.js → chunk-E4KSSC6K.js} +1 -1
- package/chunk-EEXKY2IJ.js +1 -0
- package/chunk-EYFKXXER.js +1 -0
- package/chunk-FUPYLAQ6.js +1 -0
- package/chunk-G4Z3JAJB.js +1 -0
- package/{chunk-H3W2UQY2.js → chunk-GGNFAVSC.js} +1 -1
- package/{chunk-QMHLXETS.js → chunk-GHJ4MU3O.js} +1 -1
- package/{chunk-WJDMMKWE.js → chunk-GRPEAINE.js} +1 -1
- package/{chunk-RPJFKWMV.js → chunk-HEST3B3S.js} +1 -1
- package/chunk-HJSCQF6V.js +1 -0
- package/{chunk-465L4ZG5.js → chunk-HKYSIIV5.js} +1 -1
- package/{chunk-AT6BXXSP.js → chunk-HW7A5ZWV.js} +1 -1
- package/{chunk-ISCGGOPN.js → chunk-ILGMXHEE.js} +1 -1
- package/chunk-IMF5BUVN.js +1 -0
- package/{chunk-2CWLIRUP.js → chunk-IQ52IXSC.js} +1 -1
- package/{chunk-2DP4QU4T.js → chunk-J64OAILA.js} +1 -1
- package/{chunk-OHP7HLY2.js → chunk-JGXPFEYZ.js} +1 -1
- package/{chunk-D3LEV6WL.js → chunk-JXLBFHEH.js} +1 -1
- package/chunk-KKLVMIFL.js +1 -0
- package/{chunk-H4H72SDD.js → chunk-KUP2T6AG.js} +1 -1
- package/{chunk-NFIJYWQI.js → chunk-L7WPKNLR.js} +1 -1
- package/{chunk-TBTQMBCJ.js → chunk-LHOHOKP5.js} +1 -1
- package/{chunk-NZDZUPC5.js → chunk-M2BAPEJT.js} +1 -1
- package/{chunk-IKPQDSQK.js → chunk-NA6MTRHY.js} +2 -2
- package/{chunk-Z5W4ULWF.js → chunk-NDZU2O2Q.js} +1 -1
- package/chunk-NLXY47SY.js +1 -0
- package/{chunk-RNWKZDZM.js → chunk-NXJQU7IR.js} +1 -1
- package/{chunk-POJT4MSX.js → chunk-NY63VRAY.js} +1 -1
- package/{chunk-E3KF5SRU.js → chunk-O2M7MRKP.js} +1 -1
- package/{chunk-AWXWGD4T.js → chunk-OQ2HMOSQ.js} +1 -1
- package/{chunk-SXFSAK5L.js → chunk-OVLLX4US.js} +1 -1
- package/{chunk-TC7HZO7D.js → chunk-P7OKMMNZ.js} +1 -1
- package/chunk-POAVE42X.js +1 -0
- package/{chunk-PKK4MIRQ.js → chunk-Q4I4JXKZ.js} +1 -1
- package/chunk-QAY6UFT6.js +1 -0
- package/chunk-QE4NBN5H.js +2 -0
- package/{chunk-QBHHGHBJ.js → chunk-QLUEDPL4.js} +1 -1
- package/{chunk-E6DCTQ34.js → chunk-QOQI2ALM.js} +1 -1
- package/{chunk-5KMPTDRJ.js → chunk-R2N5UWYB.js} +1 -1
- package/chunk-R3F6GIHW.js +1 -0
- package/{chunk-CENUQU54.js → chunk-RRM5OZPV.js} +2 -2
- package/{chunk-ZLLXHZQV.js → chunk-SFSDLKTN.js} +1 -1
- package/{chunk-DY4NXNVS.js → chunk-SHNCRKXQ.js} +1 -1
- package/chunk-SKFITJZT.js +1 -0
- package/{chunk-O5W6EGCB.js → chunk-SNVT3M5C.js} +1 -1
- package/chunk-TPYX7QC7.js +1 -0
- package/{chunk-75C77QFK.js → chunk-ULR2EPP5.js} +1 -1
- package/{chunk-MSASOFXF.js → chunk-V5B247QH.js} +1 -1
- package/{chunk-W2SSWLYM.js → chunk-V7OQKE2Z.js} +1 -1
- package/{chunk-4Z72AON4.js → chunk-VXJJGZ5F.js} +1 -1
- package/{chunk-DQAT6VCF.js → chunk-W7NX3PWJ.js} +1 -1
- package/chunk-WJEUX75A.js +1 -0
- package/{chunk-DF6VTK4B.js → chunk-WKA7CSGA.js} +1 -1
- package/{chunk-D7OP5FPA.js → chunk-WNHQELMC.js} +1 -1
- package/{chunk-J34TTKLN.js → chunk-WPIVIZS6.js} +1 -1
- package/{chunk-4VZNWPWO.js → chunk-X6SJVQXW.js} +1 -1
- package/{chunk-MPQNBRD5.js → chunk-X7XIFHAV.js} +1 -1
- package/{chunk-ATGKEH5N.js → chunk-XUQ74HFK.js} +1 -1
- package/{chunk-2VOU6SHS.js → chunk-Y2LISX47.js} +1 -1
- package/chunk-Y7PHGRGB.js +4 -0
- package/{chunk-Y4GDUNWN.js → chunk-YU5AMM6C.js} +1 -1
- package/{chunk-35ZUPRX7.js → chunk-YWZRYOES.js} +1 -1
- package/{chunk-AE7T2DAH.js → chunk-ZQ56M63S.js} +1 -1
- package/chunk-ZSEZR472.js +1 -0
- package/{chunk-EUVXYJ2O.js → chunk-ZXEF3CNK.js} +1 -1
- package/{chunk-GNJTDWT4.js → chunk-ZZBUNZZO.js} +1 -1
- package/{chunk-GOFRTODH.js → chunk-ZZBZEHXF.js} +1 -1
- package/index.html +2 -2
- package/locale/messages.en.json +3 -0
- package/locale/messages.json +3 -0
- package/main-L5HX5P6R.js +1 -0
- package/package.json +1 -1
- package/styles-5QAJP4BI.css +1 -0
- package/chunk-5RQDJUIT.js +0 -1
- package/chunk-732GPC5D.js +0 -1
- package/chunk-ACZQPL4M.js +0 -1
- package/chunk-EOKEY2WO.js +0 -1
- package/chunk-EVJEPFC6.js +0 -1
- package/chunk-IFCA5KWR.js +0 -1
- package/chunk-LH6XLRJU.js +0 -1
- package/chunk-MCOUCF6F.js +0 -1
- package/chunk-PIMTQKQK.js +0 -1
- package/chunk-RIX6H2ZX.js +0 -1
- package/chunk-TGNUULAU.js +0 -1
- package/chunk-VNGJCKGG.js +0 -1
- package/chunk-W4KOKNGU.js +0 -1
- package/chunk-WZAZENJC.js +0 -1
- package/chunk-X4KK6R3X.js +0 -1
- package/chunk-XKKT2NP5.js +0 -1
- package/chunk-XRI2BFC2.js +0 -2
- package/chunk-XUN5TTJC.js +0 -1
- package/chunk-Z34TVTJN.js +0 -1
- package/chunk-Z4MDYLVI.js +0 -1
- package/chunk-ZBK64QS2.js +0 -4
- package/main-75X3EGHT.js +0 -1
- package/styles-JSM72RCO.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ct}from"./chunk-5KMPTDRJ.js";import{b as ye,c as dt,d as pt}from"./chunk-2DP4QU4T.js";import{a as ut,b as Ve,c as ct}from"./chunk-AWXWGD4T.js";import{a as _t}from"./chunk-POJT4MSX.js";import{b as re}from"./chunk-WJDMMKWE.js";import{a as rt}from"./chunk-QBHHGHBJ.js";import{a as Oe}from"./chunk-AE7T2DAH.js";import{b as lt}from"./chunk-TC7HZO7D.js";import{B as ae,G as Y,K as ot,O as le,U as st,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as se,t as Re,u as q,w as nt,z as it}from"./chunk-TGNUULAU.js";import{b as ie,d as H}from"./chunk-XUN5TTJC.js";import{$b as u,Ab as $e,Bb as xe,Bc as me,Cb as N,Db as a,Eb as l,Fb as S,H as we,Jb as B,Kb as k,Mb as x,Rc as G,Sa as r,Sc as ne,Tb as m,Ub as F,V as Ce,Vb as f,Wc as Be,Xc as ke,Yb as Ue,Yc as Fe,Zb as T,_ as A,cb as J,ea as p,fa as C,gc as ge,hb as je,hc as Ee,ic as be,kc as Se,nc as U,oc as ve,pa as E,pc as Ye,sc as L,tc as I,ub as qe,uc as w,xb as D,yb as R,zb as Ge}from"./chunk-ZBK64QS2.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class s{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Ce({token:s,factory:s.\u0275fac,providedIn:"root"})};function mt(s,t){if(s&1){let e=x();a(0,"div",24)(1,"sh-form-field")(2,"label",25),f(3,7),l(),a(4,"input",26,0),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),C(i)}),T("focus",function(){p(e);let i=be(5);return C(i.showPicker())}),l(),a(6,"sh-icon",27),U(7,"clock"),l()(),a(8,"sh-form-field"),S(9,"label",28),a(10,"input",29,1),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),C(i)}),T("focus",function(){p(e);let i=be(11);return C(i.showPicker())}),l(),a(12,"sh-icon",27),U(13,"calendar"),l()()(),a(14,"div",24)(15,"sh-form-field")(16,"label",30),f(17,8),l(),a(18,"input",31),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),C(i)}),l()(),a(19,"sh-select",32)(20,"input",33),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),C(i)}),l()()(),a(21,"sh-toggle-card",34),B(22,35),f(23,9),k(),a(24,"div",36)(25,"sh-toggle",19),m(26,10),a(27,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),C(i)}),l(),F(),l(),a(28,"sh-toggle",19),m(29,11),a(30,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),C(i)}),l(),F(),l(),a(31,"sh-toggle",19),m(32,12),a(33,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),C(i)}),l(),F(),l(),a(34,"sh-toggle",19),m(35,13),a(36,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),C(i)}),l(),F(),l(),a(37,"sh-toggle",19),m(38,14),a(39,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),C(i)}),l(),F(),l(),a(40,"sh-toggle",19),m(41,15),a(42,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),C(i)}),l(),F(),l(),a(43,"sh-toggle",19),m(44,16),a(45,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),C(i)}),l(),F(),l()()()}if(s&2){let e=u();r(4),L("ngModel",e.scheduleFields.nextTime().time),r(6),L("ngModel",e.scheduleFields.nextTime().date),r(8),L("ngModel",e.scheduleFields.runAgain().repeatValue),r(),N("options",e.unitOptions)("isClearable",!1),r(),L("ngModel",e.scheduleFields.runAgain().repeatUnit),r(),N("disallowToggle",!0),r(6),L("ngModel",e.scheduleFields.runAgain().allowedDays.mon),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.tue),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.wed),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.thu),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.fri),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.sat),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var Ft=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],ee={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Ke=class s{#e=A(Q);#t=A(H);#i=A(ie);unitOptions=Ft;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=J({type:s,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let d;d=$localize`Next time`;let c;c=$localize`Run again every`;let _;_=$localize`Allowed days`;let g;g=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let y;y=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let h;h=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,d,c,_,g,y,h,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(a(0,"h3",17),f(1,2),l(),a(2,"div",18)(3,"sh-toggle",19),m(4,3),a(5,"input",20),w("ngModelChange",function(o){return I(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),F(),l(),a(6,"p"),f(7,4),l()(),D(8,mt,46,14),a(9,"div",21)(10,"button",22),T("click",function(){return n.goBack()}),m(11,5),S(12,"sh-icon"),F(),l(),a(13,"button",23),T("click",function(){return n.next()}),m(14,6),S(15,"sh-icon"),F(),l()()),e&2&&(r(5),L("ngModel",n.scheduleFields.autoRun),r(3),R(n.scheduleFields.autoRun()?8:-1))},dependencies:[se,z,Ze,Te,j,oe,Y,Me,q,ae,le,st],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Tt(s,t){if(s&1){let e=x();a(0,"sh-select",2)(1,"input",6),w("ngModelChange",function(i){p(e);let o=u();return I(o.internalPath,i)||(o.internalPath=i),C(i)}),T("ngModelChange",function(){p(e);let i=u();return C(i.updateFilter())}),l()()}if(s&2){let e=u();N("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),r(),L("ngModel",e.internalPath)}}function ht(s,t){if(s&1&&(B(0,7),U(1),k()),s&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Nt(s,t){if(s&1&&(B(0,8),U(1),k()),s&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ft(s,t){if(s&1){let e=x();a(0,"sh-form-field",3)(1,"input",6),w("ngModelChange",function(i){p(e);let o=u();return I(o.internalPath,i)||(o.internalPath=i),C(i)}),T("ngModelChange",function(){p(e);let i=u();return C(i.updateFilter())}),l(),D(2,ht,2,1,"ng-container",7),D(3,Nt,2,1,"ng-container",8),l()}if(s&2){let e,n,i=u();r(),L("ngModel",i.internalPath),r(),R(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),r(),R(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Pt=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],At=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ie=class s{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=E("");pathType=E("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=E(Pt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return At.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=J({type:s,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(a(0,"sh-select",0)(1,"input",1),w("ngModelChange",function(o){return I(n.pathType,o)||(n.pathType=o),o}),T("ngModelChange",function(){return n.updateFilter()}),l()(),D(2,Tt,2,4,"sh-select",2)(3,ft,4,3,"sh-form-field",3),a(4,"div",4),T("click",function(){return n.removeFilter()}),a(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;N("options",n.expressionOptions())("isClearable",!1),r(),L("ngModel",n.pathType),r(),R(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[se,z,j,oe,le,Y,q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Dt=["formRef"],He=()=>({standalone:!0});function Rt(s,t){if(s&1){let e=x();a(0,"sh-form-field",41)(1,"input",42),w("ngModelChange",function(i){p(e);let o=u(2);return I(o.editingPath,i)||(o.editingPath=i),C(i)}),l()(),a(2,"button",43),T("click",function(){p(e);let i=u(2);return C(i.updatePath())}),a(3,"sh-icon"),U(4,"floppy-disk"),l()(),a(5,"button",43),T("click",function(){p(e);let i=u(2);return C(i.cancelEditPath())}),a(6,"sh-icon"),U(7,"x-bold"),l()()}if(s&2){let e=u(2);r(),L("ngModel",e.editingPath),N("ngModelOptions",me(2,He))}}function Mt(s,t){if(s&1){let e=x();a(0,"sh-form-field",41),S(1,"input",44),l(),a(2,"button",43),T("click",function(){p(e);let i=u().$implicit,o=u();return C(o.editPath(i))}),a(3,"sh-icon"),U(4,"pen"),l()(),a(5,"button",43),T("click",function(){p(e);let i=u().$implicit,o=u();return C(o.removePath(i))}),a(6,"sh-icon"),U(7,"trash-simple"),l()()}if(s&2){let e=u().$implicit;qe("readonly",!0),r(),N("ngModel",e)("ngModelOptions",me(3,He))}}function Ot(s,t){if(s&1&&(a(0,"div",30),D(1,Rt,8,3)(2,Mt,8,4),l()),s&2){let e=t.$implicit,n=u();r(),R(n.oldPath()===e?1:2)}}function yt(s,t){if(s&1){let e=x();a(0,"app-new-filter",46),T("pathChange",function(i){let o=p(e).$index,d=u(2);return C(d.patchPathAt(i,o))})("remove",function(){let i=p(e).$index,o=u(2);return C(o.removePathAt(i))}),l()}if(s&2){let e=t.$implicit,n=u(2);N("path",e)("osType",n.osType()??"")}}function Lt(s,t){if(s&1&&$e(0,yt,1,2,"app-new-filter",45,Ge),s&2){let e=u();xe(e.pathArray())}}function It(s,t){if(s&1){let e=x();a(0,"div",31)(1,"app-size",47),T("ngModelChange",function(i){p(e);let o=u();return C(o.updateFilesLargerThan(i))}),l()()}if(s&2){let e=u();r(),N("ngModel",e.filesLargerThan())("ngModelOptions",me(2,He))}}var V=new De,gt=(s={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(s.path),excludes:V.group({hidden:V.control(s.excludes.hidden),system:V.control(s.excludes.system),temporary:V.control(s.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class s{#e=A(Q);#t=A(H);#i=A(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=E(null);editingPath=E(null);addingNewPath=E(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ye(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().map((c,_)=>_===e?`${t}`:`${c}`).join("\0"),d=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(d)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),i=this.pathArray().filter((d,c)=>c!==t).join("\0"),o=[n,i].filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=J({type:s,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Dt,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let d;d=$localize`Source Data`;let c;c=$localize`Folder path`;let _;_=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let g;g=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let y;y=$localize`Paths`;let h;h=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let M;M=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let P;return P=$localize`Edit path`,[["formRef",""],d,c,_,g,y,h,$,K,v,W,M,Z,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",P,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=x();a(0,"form",16,0),T("submit",function(){return p(i),C(n.next())}),a(2,"div",17)(3,"h3",18),f(4,1),l(),a(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),S(8,"input",21),l(),a(9,"div",22)(10,"button",23),T("click",function(){return p(i),C(n.goBack())}),m(11,3),S(12,"sh-icon"),F(),l(),a(13,"button",24),m(14,4),S(15,"sh-icon"),F(),l()()(),a(16,"div",25)(17,"app-toggle-card",26),B(18,27),f(19,5),k(),a(20,"p",28),f(21,6),l(),a(22,"div",29),$e(23,Ot,3,1,"div",30,Ge),a(25,"div",31)(26,"sh-form-field"),S(27,"input",32),l(),a(28,"button",33),T("click",function(){return p(i),C(n.addNewPath())}),a(29,"sh-icon"),U(30,"plus"),l()()()()(),a(31,"app-toggle-card",26),B(32,27),f(33,7),k(),a(34,"p",28),f(35,8),l(),a(36,"button",34),T("click",function(){return p(i),C(n.addFilter())}),f(37,9),l(),D(38,Lt,2,0),l(),a(39,"app-toggle-card",35),B(40,27),f(41,10),k(),a(42,"p",28),f(43,11),l(),a(44,"sh-toggle",36),m(45,12),S(46,"input",37),F(),l(),a(47,"sh-toggle",36),m(48,13),S(49,"input",38),F(),l(),a(50,"sh-toggle",36),m(51,14),S(52,"input",39),F(),l(),a(53,"sh-toggle",40),T("click",function(){return p(i),C(n.toggleFilesLargerThan())}),f(54,15),l(),D(55,It,2,3,"div",31),l()()()}if(e&2){let i;N("formGroup",n.sourceDataForm),r(5),N("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),r(12),N("disallowToggle",!0),r(6),xe(n.nonFilterPaths()),r(4),N("formControl",n.newPathCtrl),r(4),N("disallowToggle",!0),r(7),R((i=n.pathSignal())!=null&&i.length?38:-1),r(),N("disallowToggle",!0),r(14),Se("active",n.filesLargerThan()),r(2),R(n.filesLargerThan()?55:-1)}},dependencies:[se,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,ae,Me,Ie,pt,Ct,dt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;overflow:auto}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Et="1W:1D,4W:1W,12M:1M",Q=class s{#e=A(H);#t=A(Oe);#i=A(it);#n=A(lt);#r=A(_t);#o=A(Le);generalForm=St();sourceDataForm=gt();scheduleFields={autoRun:E(ee.autoRun),nextTime:E(ee.nextTime),runAgain:E(ee.runAgain)};settings=E([]);optionsFields={remoteVolumeSize:E("50MB"),backupRetention:E("all"),backupRetentionTime:E(""),backupRetentionVersions:E(0),backupRetentionCustom:E("")};targetUrlModel=E(null);backupMetadata=E(null);isDraft=E(!1);backupId=E(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=E(!1);finishedLoading=E(!1);backupDefaults=E(null);applicationOptions=E(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=E([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#s=E("");#a=E(null);#l=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#a.asReadonly();#p=ne(()=>{let t=this.targetUrlModel(),e=this.#s(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#s.set(""),this.#a.set(null))});setTestState(t,e){this.#s.set(t),this.#a.set(e??null)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#c(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#_(),this.#e.navigate(["/"]);return}this.#i.open(rt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#_(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(c=>`${c.Include?"":"-"}${c.Expression}`)??[],i=t.Settings?.find(c=>c.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],o=t.Settings?.find(c=>c.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,d={path:[...e,...n].join("\0"),excludes:{hidden:i.includes("hidden"),system:i.includes("system"),temporary:i.includes("temporary"),filesLargerThan:o===null?void 0:ye(o)}};this.sourceDataForm.patchValue(d)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(g=>g.Name==="encryption-module"),o=t.Settings?.find(g=>g.Name==="passphrase")?.Value??"",d=i?.Value&&i.Value.length?i.Value:"",c=t.Settings?.find(g=>g.Name==="compression-module")?.Value??"",_={name:t.Name??"",description:t.Description??""};e&&e!==""&&(_.name=e),n&&n!==""&&(_.description=n),d&&d!==""&&(_.encryption=d),o&&o!==""&&(_.password=o,_.repeatPassword=o),c&&c!==""&&(_.compression=c),this.generalForm.patchValue(_)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#o.fromString(t.Repeat)??null,n=this.#d(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=(t.Settings??[]).map(_=>_);if(e){let _=this.#r.serverSettings()??{};Object.keys(_).filter(g=>g.startsWith("--")).forEach(g=>{i.find(h=>h.Name===g)||i.push({Name:g,Value:_[g],Filter:null})})}let o=i.filter(_=>!n.includes(_.Name)),d=i.filter(_=>n.includes(_.Name));this.settings.set(o??[]),o?.forEach(_=>{if(_.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(_.Value??"")});var c="all";d?.forEach(_=>{if(_.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(_.Value??"50MB"),_.Name==="keep-time"&&(_.Value??"")!=="")return c="time",this.optionsFields.backupRetentionTime.set(_.Value??"");if(_.Name==="keep-versions"&&(_.Value??"")!=="")return c="versions",this.optionsFields.backupRetentionVersions.set(_.Value?parseInt(_.Value):null);if(_.Name==="retention-policy"&&(_.Value??"")!=="")if(_.Value===Et)c="smart";else return c="custom",this.optionsFields.backupRetentionCustom.set(_.Value??"")}),this.optionsFields.backupRetention.set(c)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#c(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#o.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let d=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([h,$])=>$).map(([h,$])=>h):[],c=n.path?.split("\0")??[],_=this.mapFormsToSettings(),g=Object.entries(n.excludes??{}).filter(([h,$])=>$&&h!=="filesLargerThan").map(([h])=>h),y=n.excludes?.filesLargerThan;return g.length&&_.push({Name:"--exclude-files-attributes",Value:g.join(",")}),y&&y.size!==null&&y.unit!==null&&_.push({Name:"--skip-files-larger-than",Value:`${y.size}${y.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:c.filter(h=>!(h.startsWith("-")||h.startsWith("+"))),Settings:_,Filters:c.filter(h=>h.startsWith("-")||h.startsWith("+")).map((h,$)=>({Order:$,Include:h.startsWith("+"),Expression:h.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:d}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let d=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":d.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":d.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":d.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":d.push({Name:"retention-policy",Value:Et});break}let c=[...t,...n],_=this.settings().filter(g=>!c.includes(g.Name)).map(g=>{let y=g.Value;return typeof g.Value=="number"&&(y=g.Value.toString()),typeof g.Value=="boolean"&&(y=g.Value?"True":"False"),{Name:g.Name?.startsWith("--")?g.Name:`--${g.Name}`,Value:y}});return[...i,...o,...d,..._]}#d(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#_(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Ce({token:s,factory:s.\u0275fac,providedIn:"root"})};var wt=["formRef"];function Gt(s,t){s&1&&(a(0,"sh-alert",17),m(1,5),S(2,"sh-icon",26),F(),l())}function $t(s,t){if(s&1&&U(0),s&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function xt(s,t){if(s&1&&S(0,"sh-progress-bar",40),s&2){let e=u(3);Se("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),N("value",e.calculatePasswordStrength()*(100/5))}}function Ut(s,t){s&1&&(a(0,"span",35),f(1,10),l())}function bt(s,t){s&1&&(m(0,8,1),S(1,"sh-icon"),F())}function vt(s,t){s&1&&(m(0,8,2),S(1,"sh-icon"),F())}function Bt(s,t){s&1&&(m(0,11,1),S(1,"sh-icon",42),F())}function kt(s,t){s&1&&(m(0,11,2),S(1,"sh-icon"),F())}function Vt(s,t){if(s&1){let e=x();a(0,"button",41),T("click",function(){p(e);let i=u(3);return C(i.copyPassword())}),m(1,11),D(2,Bt,2,0)(3,kt,2,0),F(),l()}if(s&2){let e=u(3);r(2),R(e.copiedPassword()?2:3)}}function Kt(s,t){s&1&&(a(0,"sh-alert",39),f(1,12),l())}function Wt(s,t){if(s&1){let e=x();a(0,"div",30)(1,"sh-form-field")(2,"label",31),m(3,7),S(4,"sup"),F(),l(),S(5,"input",32),l(),D(6,xt,1,9,"sh-progress-bar",33),a(7,"sh-form-field"),S(8,"input",34),D(9,Ut,2,0,"span",35),l(),a(10,"div",36)(11,"button",37),T("click",function(){p(e);let i=u(2);return C(i.showPassword.set(!i.showPassword()))}),m(12,8),D(13,bt,2,0)(14,vt,2,0),F(),l(),a(15,"button",37),T("click",function(){p(e);let i=u(2);return C(i.generatePassword())}),m(16,9),S(17,"sh-icon"),F(),l(),D(18,Vt,4,1,"button",38),l(),D(19,Kt,2,0,"sh-alert",39),l()}if(s&2){let e=u(2);r(5),N("type",e.showPassword()?"text":"password"),r(),R(e.generalForm.value.password?6:-1),r(2),N("type",e.showPassword()?"text":"password"),r(),R(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),r(4),R(e.showPassword()?13:14),r(5),R(e.showCopyPassword()?18:-1),r(),R(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Xt(s,t){if(s&1&&(a(0,"sh-select",27)(1,"label",28),f(2,6),l(),S(3,"input",29),je(4,$t,1,1,"ng-template"),l(),D(5,Wt,20,7,"div",30)),s&2){let e=u();N("options",e.encryptionOptions())("isClearable",!1),r(5),R(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Jt(s,t){if(s&1&&(a(0,"button",24),m(1,13),S(2,"sh-icon"),F(),l()),s&2){let e=u();N("disabled",e.nameAndDescriptionValid()===!1)}}function Ht(s,t){if(s&1&&(a(0,"button",25),m(1,14),S(2,"sh-icon"),F(),l()),s&2){let e=u();N("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,St=(s={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(s.name,[he.required]),description:te.control(s.description),encryption:te.control(s.encryption,[ct()]),password:te.control(s.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(s.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(s.compression)}),pe={Key:"-",DisplayName:"None"},ze=class s{#e=A(H);#t=A(ie);#i=A(ut);#n=A(Q);#r=A(Oe);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=E(!1);copiedPassword=E(!1);showCopyPassword=E(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=J({type:s,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,wt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let d;d=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let _;_=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let g;g=$localize`Encryption`;let y;y=$localize`Encryption`;let h;h=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let M;M=$localize`Passwords do not match`;let Z;Z=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,d,c,_,y,K,v,W,M,Z,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",g,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",$,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=x();a(0,"form",15,0),T("submit",function(){return p(i),C(n.next())}),a(2,"h3",16),f(3,1),l(),D(4,Gt,3,0,"sh-alert",17),a(5,"sh-form-field")(6,"label",18),m(7,2),S(8,"sup"),F(),l(),S(9,"input",19),l(),a(10,"sh-form-field")(11,"label",20),f(12,3),l(),S(13,"textarea",21),l(),D(14,Xt,6,3),a(15,"div",22)(16,"button",23),T("click",function(){return p(i),C(n.exit())}),m(17,4),S(18,"sh-icon"),F(),l(),D(19,Jt,3,1,"button",24)(20,Ht,3,1,"button",25),l()()}if(e&2){let i;N("formGroup",n.generalForm),r(4),R(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),r(10),R(n.isNew()?14:-1),r(5),R(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,ae,q,ot,nt,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{St as a,pe as b,ze as c,ee as d,Ke as e,gt as f,Je as g,Q as h};
|
|
1
|
+
import{a as Ct}from"./chunk-R2N5UWYB.js";import{b as ye,c as dt,d as pt}from"./chunk-J64OAILA.js";import{a as ut,b as Ve,c as ct}from"./chunk-OQ2HMOSQ.js";import{a as _t}from"./chunk-NY63VRAY.js";import{b as re}from"./chunk-GRPEAINE.js";import{a as rt}from"./chunk-QLUEDPL4.js";import{a as Oe}from"./chunk-ZQ56M63S.js";import{b as lt}from"./chunk-P7OKMMNZ.js";import{B as ae,G as Y,K as ot,O as le,U as st,V as Me,X as at,b as Te,c as z,d as he,e as j,f as Ne,h as Qe,i as oe,j as fe,k as Ze,n as et,o as Pe,p as tt,q as Ae,r as De,s as se,t as Re,u as q,w as nt,z as it}from"./chunk-HJSCQF6V.js";import{b as ie,d as H}from"./chunk-G4Z3JAJB.js";import{Ab as xe,Ac as me,Bb as N,Cb as a,Db as l,Eb as S,H as we,Ib as B,Jb as k,Lb as x,Qc as G,Ra as r,Rc as ne,Sb as m,Tb as F,Ub as f,V as Ce,Vc as Be,Wc as ke,Xb as Ue,Xc as Fe,Yb as T,_ as A,_b as u,bb as J,da as p,ea as C,fc as ge,gb as je,gc as Ee,hc as be,jc as Se,mc as U,nc as ve,oa as E,oc as Ye,rc as L,sc as I,tb as qe,tc as w,wb as D,xb as R,yb as Ge,zb as $e}from"./chunk-Y7PHGRGB.js";import{a as b,b as X}from"./chunk-EUDKD2JW.js";var Le=class s{fromString(t){if(!t)return null;let e=t.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(t,e){return`${t}${e}`}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Ce({token:s,factory:s.\u0275fac,providedIn:"root"})};function mt(s,t){if(s&1){let e=x();a(0,"div",24)(1,"sh-form-field")(2,"label",25),f(3,7),l(),a(4,"input",26,0),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.nextTime().time,i)||(o.scheduleFields.nextTime().time=i),C(i)}),T("focus",function(){p(e);let i=be(5);return C(i.showPicker())}),l(),a(6,"sh-icon",27),U(7,"clock"),l()(),a(8,"sh-form-field"),S(9,"label",28),a(10,"input",29,1),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.nextTime().date,i)||(o.scheduleFields.nextTime().date=i),C(i)}),T("focus",function(){p(e);let i=be(11);return C(i.showPicker())}),l(),a(12,"sh-icon",27),U(13,"calendar"),l()()(),a(14,"div",24)(15,"sh-form-field")(16,"label",30),f(17,8),l(),a(18,"input",31),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().repeatValue,i)||(o.scheduleFields.runAgain().repeatValue=i),C(i)}),l()(),a(19,"sh-select",32)(20,"input",33),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().repeatUnit,i)||(o.scheduleFields.runAgain().repeatUnit=i),C(i)}),l()()(),a(21,"sh-toggle-card",34),B(22,35),f(23,9),k(),a(24,"div",36)(25,"sh-toggle",19),m(26,10),a(27,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.mon,i)||(o.scheduleFields.runAgain().allowedDays.mon=i),C(i)}),l(),F(),l(),a(28,"sh-toggle",19),m(29,11),a(30,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.tue,i)||(o.scheduleFields.runAgain().allowedDays.tue=i),C(i)}),l(),F(),l(),a(31,"sh-toggle",19),m(32,12),a(33,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.wed,i)||(o.scheduleFields.runAgain().allowedDays.wed=i),C(i)}),l(),F(),l(),a(34,"sh-toggle",19),m(35,13),a(36,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.thu,i)||(o.scheduleFields.runAgain().allowedDays.thu=i),C(i)}),l(),F(),l(),a(37,"sh-toggle",19),m(38,14),a(39,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.fri,i)||(o.scheduleFields.runAgain().allowedDays.fri=i),C(i)}),l(),F(),l(),a(40,"sh-toggle",19),m(41,15),a(42,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.sat,i)||(o.scheduleFields.runAgain().allowedDays.sat=i),C(i)}),l(),F(),l(),a(43,"sh-toggle",19),m(44,16),a(45,"input",20),w("ngModelChange",function(i){p(e);let o=u();return I(o.scheduleFields.runAgain().allowedDays.sun,i)||(o.scheduleFields.runAgain().allowedDays.sun=i),C(i)}),l(),F(),l()()()}if(s&2){let e=u();r(4),L("ngModel",e.scheduleFields.nextTime().time),r(6),L("ngModel",e.scheduleFields.nextTime().date),r(8),L("ngModel",e.scheduleFields.runAgain().repeatValue),r(),N("options",e.unitOptions)("isClearable",!1),r(),L("ngModel",e.scheduleFields.runAgain().repeatUnit),r(),N("disallowToggle",!0),r(6),L("ngModel",e.scheduleFields.runAgain().allowedDays.mon),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.tue),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.wed),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.thu),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.fri),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.sat),r(3),L("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var Ft=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],ee={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},Ke=class s{#e=A(Q);#t=A(H);#i=A(ie);unitOptions=Ft;scheduleFields=this.#e.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=J({type:s,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let t;t=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let n;n=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let d;d=$localize`Next time`;let c;c=$localize`Run again every`;let _;_=$localize`Allowed days`;let g;g=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let y;y=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let h;h=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let $;$=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let W;return W=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],t,e,n,i,o,d,c,_,g,y,h,$,K,v,W,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(a(0,"h3",17),f(1,2),l(),a(2,"div",18)(3,"sh-toggle",19),m(4,3),a(5,"input",20),w("ngModelChange",function(o){return I(n.scheduleFields.autoRun,o)||(n.scheduleFields.autoRun=o),o}),l(),F(),l(),a(6,"p"),f(7,4),l()(),D(8,mt,46,14),a(9,"div",21)(10,"button",22),T("click",function(){return n.goBack()}),m(11,5),S(12,"sh-icon"),F(),l(),a(13,"button",23),T("click",function(){return n.next()}),m(14,6),S(15,"sh-icon"),F(),l()()),e&2&&(r(5),L("ngModel",n.scheduleFields.autoRun),r(3),R(n.scheduleFields.autoRun()?8:-1))},dependencies:[se,z,Ze,Te,j,oe,Y,Me,q,ae,le,st],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Tt(s,t){if(s&1){let e=x();a(0,"sh-select",2)(1,"input",6),w("ngModelChange",function(i){p(e);let o=u();return I(o.internalPath,i)||(o.internalPath=i),C(i)}),T("ngModelChange",function(){p(e);let i=u();return C(i.updateFilter())}),l()()}if(s&2){let e=u();N("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),r(),L("ngModel",e.internalPath)}}function ht(s,t){if(s&1&&(B(0,7),U(1),k()),s&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.startsWith)}}function Nt(s,t){if(s&1&&(B(0,8),U(1),k()),s&2){let e,n=u(2);r(),ve((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ft(s,t){if(s&1){let e=x();a(0,"sh-form-field",3)(1,"input",6),w("ngModelChange",function(i){p(e);let o=u();return I(o.internalPath,i)||(o.internalPath=i),C(i)}),T("ngModelChange",function(){p(e);let i=u();return C(i.updateFilter())}),l(),D(2,ht,2,1,"ng-container",7),D(3,Nt,2,1,"ng-container",8),l()}if(s&2){let e,n,i=u();r(),L("ngModel",i.internalPath),r(),R(!((e=i.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?2:-1),r(),R(!((n=i.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?3:-1)}}var Pt=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],At=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Exclude file groups",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ie=class s{path=ke.required();osType=ke();pathChange=Be();remove=Be();internalPath=E("");pathType=E("-Expression");currentExpressionOption=G(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=E(Pt);expressionOptions=G(()=>{let e=this.osType()==="Windows"?"\\":"/";return At.map(n=>n.value==="-Folder"||n.value==="+Folder"?X(b({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?X(b({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?X(b({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?X(b({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?X(b({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?X(b({},n),{startsWith:"*.",endsWith:""}):X(b({},n),{startsWith:"",endsWith:""}))});pathEffect=ne(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",i=this.osType()==="Windows",o=i?"\\":"/";e.startsWith("%")&&e.endsWith(o)||i&&e.slice(2).startsWith(o)&&e.endsWith(o)||e.startsWith(o)&&e.endsWith(o)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${o}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${o}]*]`)?(this.pathType.set(`${n}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${n}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${n}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${n}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${n}Expression`),this.internalPath.set(e))});updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${t}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=J({type:s,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],["value","key","label","value",1,"expression-input",3,"options","isClearable","selectMultiple"],[1,"expression-input"],[1,"filter-removal",3,"click"],[1,"sh-primary"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""]]},template:function(e,n){if(e&1&&(a(0,"sh-select",0)(1,"input",1),w("ngModelChange",function(o){return I(n.pathType,o)||(n.pathType=o),o}),T("ngModelChange",function(){return n.updateFilter()}),l()(),D(2,Tt,2,4,"sh-select",2)(3,ft,4,3,"sh-form-field",3),a(4,"div",4),T("click",function(){return n.removeFilter()}),a(5,"sh-icon",5),U(6,"x-circle"),l()()),e&2){let i;N("options",n.expressionOptions())("isClearable",!1),r(),L("ngModel",n.pathType),r(),R(((i=n.currentExpressionOption())==null?null:i.value)=="-FileGroup"||((i=n.currentExpressionOption())==null?null:i.value)=="+FileGroup"?2:3)}},dependencies:[se,z,j,oe,le,Y,q],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}.expression-input[_ngcontent-%COMP%]{--ff-suffix-bg: var(--base-2)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var Dt=["formRef"],He=()=>({standalone:!0});function Rt(s,t){if(s&1){let e=x();a(0,"sh-form-field",41)(1,"input",42),w("ngModelChange",function(i){p(e);let o=u(2);return I(o.editingPath,i)||(o.editingPath=i),C(i)}),l()(),a(2,"button",43),T("click",function(){p(e);let i=u(2);return C(i.updatePath())}),a(3,"sh-icon"),U(4,"floppy-disk"),l()(),a(5,"button",43),T("click",function(){p(e);let i=u(2);return C(i.cancelEditPath())}),a(6,"sh-icon"),U(7,"x-bold"),l()()}if(s&2){let e=u(2);r(),L("ngModel",e.editingPath),N("ngModelOptions",me(2,He))}}function Mt(s,t){if(s&1){let e=x();a(0,"sh-form-field",41),S(1,"input",44),l(),a(2,"button",43),T("click",function(){p(e);let i=u().$implicit,o=u();return C(o.editPath(i))}),a(3,"sh-icon"),U(4,"pen"),l()(),a(5,"button",43),T("click",function(){p(e);let i=u().$implicit,o=u();return C(o.removePath(i))}),a(6,"sh-icon"),U(7,"trash-simple"),l()()}if(s&2){let e=u().$implicit;qe("readonly",!0),r(),N("ngModel",e)("ngModelOptions",me(3,He))}}function Ot(s,t){if(s&1&&(a(0,"div",30),D(1,Rt,8,3)(2,Mt,8,4),l()),s&2){let e=t.$implicit,n=u();r(),R(n.oldPath()===e?1:2)}}function yt(s,t){if(s&1){let e=x();a(0,"app-new-filter",46),T("pathChange",function(i){let o=p(e).$index,d=u(2);return C(d.patchPathAt(i,o))})("remove",function(){let i=p(e).$index,o=u(2);return C(o.removePathAt(i))}),l()}if(s&2){let e=t.$implicit,n=u(2);N("path",e)("osType",n.osType()??"")}}function Lt(s,t){if(s&1&&$e(0,yt,1,2,"app-new-filter",45,Ge),s&2){let e=u();xe(e.pathArray())}}function It(s,t){if(s&1){let e=x();a(0,"div",31)(1,"app-size",47),T("ngModelChange",function(i){p(e);let o=u();return C(o.updateFilesLargerThan(i))}),l()()}if(s&2){let e=u();r(),N("ngModel",e.filesLargerThan())("ngModelOptions",me(2,He))}}var V=new De,gt=(s={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>V.group({path:V.control(s.path),excludes:V.group({hidden:V.control(s.excludes.hidden),system:V.control(s.excludes.system),temporary:V.control(s.excludes.temporary),filesLargerThan:V.group({size:V.control(null),unit:V.control(null)})})}),Je=class s{#e=A(Q);#t=A(H);#i=A(ie);formRef=Fe.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new Qe("");filesLargerThan=G(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=re(this.sourceDataForm.controls.path.valueChanges);pathArray=G(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=G(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=E(null);editingPath=E(null);addingNewPath=E(!1);editPath(t){this.oldPath.set(t),this.editingPath.set(t)}updateFilesLargerThan(t){let{size:e,unit:n}=ye(t);this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:e,unit:n})}updatePath(){let t=this.oldPath(),e=this.editingPath();if(!t||!e||e===t){this.oldPath.set(null),this.editingPath.set(null);return}let n=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(n?.replace(t,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(t){let n=(this.sourceDataForm.controls.path.value??"").split("\0"),i=n.indexOf(t);if(i===-1)return;n.splice(i,1);let o=n.filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}addFilter(t="-*"){let n=[this.sourceDataForm.controls.path.value,t].filter(i=>i&&i!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}patchPathAt(t,e){let i=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),o=this.pathArray().map((c,_)=>_===e?`${t}`:`${c}`).join("\0"),d=[i,o].filter(c=>c&&c!=="").join("\0");this.sourceDataForm.controls.path.setValue(d)}removePathAt(t){let n=this.sourceDataForm.controls.path.value.split("\0").filter(d=>!d.startsWith("-")&&!d.startsWith("+")).join("\0"),i=this.pathArray().filter((d,c)=>c!==t).join("\0"),o=[n,i].filter(d=>d&&d!=="").join("\0");this.sourceDataForm.controls.path.setValue(o)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let t=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value,n=t?.split("\0")||[];e&&!n.includes(e)&&n.push(e);let i=n.filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(i),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.isNew()||this.#e.submit(!0),this.#t.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=J({type:s,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&ge(n.formRef,Dt,5),e&2&&Ee()},decls:56,vars:12,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Add a direct path`;let n;n=$localize`Hidden files`;let i;i=$localize`System files`;let o;o=$localize`Temporary files`;let d;d=$localize`Source Data`;let c;c=$localize`Folder path`;let _;_=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let g;g=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let y;y=$localize`Paths`;let h;h=$localize`Add a path directly from your machine.`;let $;$=$localize`Filters`;let K;K=$localize`Customize your filters.`;let v;v=$localize`Add filter`;let W;W=$localize`Exclude`;let M;M=$localize`Choose if there’s any files you want to exclude.`;let Z;Z=$localize` Files with the Hidden attribute ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let _e;_e=$localize` Files with the System attribute ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let ue;ue=$localize` Files with the Temporary attribute ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let ce;ce=$localize` Files larger than `;let P;return P=$localize`Edit path`,[["formRef",""],d,c,_,g,y,h,$,K,v,W,M,Z,_e,ue,ce,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],["type","button","shButton","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",n,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",o,"formControlName","temporary"],[1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",P,3,"ngModelChange","ngModel","ngModelOptions"],["shButton","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let i=x();a(0,"form",16,0),T("submit",function(){return p(i),C(n.next())}),a(2,"div",17)(3,"h3",18),f(4,1),l(),a(5,"app-file-tree",19)(6,"label",20),f(7,2),l(),S(8,"input",21),l(),a(9,"div",22)(10,"button",23),T("click",function(){return p(i),C(n.goBack())}),m(11,3),S(12,"sh-icon"),F(),l(),a(13,"button",24),m(14,4),S(15,"sh-icon"),F(),l()()(),a(16,"div",25)(17,"app-toggle-card",26),B(18,27),f(19,5),k(),a(20,"p",28),f(21,6),l(),a(22,"div",29),$e(23,Ot,3,1,"div",30,Ge),a(25,"div",31)(26,"sh-form-field"),S(27,"input",32),l(),a(28,"button",33),T("click",function(){return p(i),C(n.addNewPath())}),a(29,"sh-icon"),U(30,"plus"),l()()()()(),a(31,"app-toggle-card",26),B(32,27),f(33,7),k(),a(34,"p",28),f(35,8),l(),a(36,"button",34),T("click",function(){return p(i),C(n.addFilter())}),f(37,9),l(),D(38,Lt,2,0),l(),a(39,"app-toggle-card",35),B(40,27),f(41,10),k(),a(42,"p",28),f(43,11),l(),a(44,"sh-toggle",36),m(45,12),S(46,"input",37),F(),l(),a(47,"sh-toggle",36),m(48,13),S(49,"input",38),F(),l(),a(50,"sh-toggle",36),m(51,14),S(52,"input",39),F(),l(),a(53,"sh-toggle",40),T("click",function(){return p(i),C(n.toggleFilesLargerThan())}),f(54,15),l(),D(55,It,2,3,"div",31),l()()()}if(e&2){let i;N("formGroup",n.sourceDataForm),r(5),N("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),r(12),N("disallowToggle",!0),r(6),xe(n.nonFilterPaths()),r(4),N("formControl",n.newPathCtrl),r(4),N("disallowToggle",!0),r(7),R((i=n.pathSignal())!=null&&i.length?38:-1),r(),N("disallowToggle",!0),r(14),Se("active",n.filesLargerThan()),r(2),R(n.filesLargerThan()?55:-1)}},dependencies:[se,fe,z,Te,j,Ne,oe,Re,et,Pe,Ae,tt,Y,q,ae,Me,Ie,pt,Ct,dt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}sh-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;overflow:auto}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var Et="1W:1D,4W:1W,12M:1M",Q=class s{#e=A(H);#t=A(Oe);#i=A(it);#n=A(lt);#r=A(_t);#o=A(Le);generalForm=St();sourceDataForm=gt();scheduleFields={autoRun:E(ee.autoRun),nextTime:E(ee.nextTime),runAgain:E(ee.runAgain)};settings=E([]);optionsFields={remoteVolumeSize:E("50MB"),backupRetention:E("all"),backupRetentionTime:E(""),backupRetentionVersions:E(0),backupRetentionCustom:E("")};targetUrlModel=E(null);backupMetadata=E(null);isDraft=E(!1);backupId=E(null);backupName=G(()=>this.generalFormSignal()?.name??"");isSubmitting=E(!1);finishedLoading=E(!1);backupDefaults=E(null);applicationOptions=E(null);isNew=G(()=>this.backupId()==="new");osType=G(()=>this.#t.systemInfo()?.OSType);selectedOptions=E([]);sourceDataFormSignal=re(this.sourceDataForm.valueChanges);generalFormSignal=re(this.generalForm.valueChanges);encryptionFieldSignal=re(this.generalForm.controls.encryption.valueChanges);advancedOptions=G(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#s=E("");#a=E(null);#l=null;testSignal=this.#s.asReadonly();testErrorMessage=this.#a.asReadonly();#p=ne(()=>{let t=this.targetUrlModel(),e=this.#s(),n=this.#l;this.#l=t,!(e==="testing"||n===null||n===t)&&(this.#s.set(""),this.#a.set(null))});setTestState(t,e){this.#s.set(t),this.#a.set(e??null)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=G(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[pe,...t]});nonSelectedOptions=G(()=>this.advancedOptions().sort((t,e)=>t?.name&&e?.name?t?.name.localeCompare(e?.name):0).filter(t=>this.selectedOptions()?.findIndex(e=>e.name===t.name)===-1));submit(t=!1){this.isSubmitting.set(!0);let e=this.#c(),n=this.backupId();this.isDraft()&&e.Backup&&(e.Backup.Metadata=this.backupMetadata()),n==="new"||!n||this.isDraft()?this.#n.postApiV1Backups({requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}}):this.#n.putApiV1BackupById({id:n,requestBody:e}).pipe(we(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}exit(t){if(!t){this.#_(),this.#e.navigate(["/"]);return}this.#i.open(rt,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#_(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(c=>`${c.Include?"":"-"}${c.Expression}`)??[],i=t.Settings?.find(c=>c.Name==="--exclude-files-attributes")?.Value?.toLowerCase()?.split(",")??[],o=t.Settings?.find(c=>c.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,d={path:[...e,...n].join("\0"),excludes:{hidden:i.includes("hidden"),system:i.includes("system"),temporary:i.includes("temporary"),filesLargerThan:o===null?void 0:ye(o)}};this.sourceDataForm.patchValue(d)}mapDestinationToForm(t){this.targetUrlModel.set(t.TargetURL??"")}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",i=t.Settings?.find(g=>g.Name==="encryption-module"),o=t.Settings?.find(g=>g.Name==="passphrase")?.Value??"",d=i?.Value&&i.Value.length?i.Value:"",c=t.Settings?.find(g=>g.Name==="compression-module")?.Value??"",_={name:t.Name??"",description:t.Description??""};e&&e!==""&&(_.name=e),n&&n!==""&&(_.description=n),d&&d!==""&&(_.encryption=d),o&&o!==""&&(_.password=o,_.repeatPassword=o),c&&c!==""&&(_.compression=c),this.generalForm.patchValue(_)}mapScheduleToForm(t){if(!t){this.scheduleFields.autoRun.set(!1);return}let e=this.#o.fromString(t.Repeat)??null,n=this.#d(t.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(i=>b(b({},i),n)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:t.AllowedDays?.includes("mon")??!1,tue:t.AllowedDays?.includes("tue")??!1,wed:t.AllowedDays?.includes("wed")??!1,thu:t.AllowedDays?.includes("thu")??!1,fri:t.AllowedDays?.includes("fri")??!1,sat:t.AllowedDays?.includes("sat")??!1,sun:t.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=(t.Settings??[]).map(_=>_);if(e){let _=this.#r.serverSettings()??{};Object.keys(_).filter(g=>g.startsWith("--")).forEach(g=>{i.find(h=>h.Name===g)||i.push({Name:g,Value:_[g],Filter:null})})}let o=i.filter(_=>!n.includes(_.Name)),d=i.filter(_=>n.includes(_.Name));this.settings.set(o??[]),o?.forEach(_=>{if(_.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(_.Value??"")});var c="all";d?.forEach(_=>{if(_.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(_.Value??"50MB"),_.Name==="keep-time"&&(_.Value??"")!=="")return c="time",this.optionsFields.backupRetentionTime.set(_.Value??"");if(_.Name==="keep-versions"&&(_.Value??"")!=="")return c="versions",this.optionsFields.backupRetentionVersions.set(_.Value?parseInt(_.Value):null);if(_.Name==="retention-policy"&&(_.Value??"")!=="")if(_.Value===Et)c="smart";else return c="custom",this.optionsFields.backupRetentionCustom.set(_.Value??"")}),this.optionsFields.backupRetention.set(c)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#c(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,i=this.targetUrlModel(),o=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(o=this.#o.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let d=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([h,$])=>$).map(([h,$])=>h):[],c=n.path?.split("\0")??[],_=this.mapFormsToSettings(),g=Object.entries(n.excludes??{}).filter(([h,$])=>$&&h!=="filesLargerThan").map(([h])=>h),y=n.excludes?.filesLargerThan;return g.length&&_.push({Name:"--exclude-files-attributes",Value:g.join(",")}),y&&y.size!==null&&y.unit!==null&&_.push({Name:"--skip-files-larger-than",Value:`${y.size}${y.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:i??null,Sources:c.filter(h=>!(h.startsWith("-")||h.startsWith("+"))),Settings:_,Filters:c.filter(h=>h.startsWith("-")||h.startsWith("+")).map((h,$)=>({Order:$,Include:h.startsWith("+"),Expression:h.slice(1)}))},Schedule:e.autoRun?{Repeat:o,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:d}:null}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size","compression-module"],i=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==pe.Key&&(i=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let o=[{Name:"compression-module",Value:e.compression}];e.compression===""&&(o=[]);let d=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":d.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":d.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":d.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":d.push({Name:"retention-policy",Value:Et});break}let c=[...t,...n],_=this.settings().filter(g=>!c.includes(g.Name)).map(g=>{let y=g.Value;return typeof g.Value=="number"&&(y=g.Value.toString()),typeof g.Value=="boolean"&&(y=g.Value?"True":"False"),{Name:g.Name?.startsWith("--")?g.Name:`--${g.Name}`,Value:y}});return[...i,...o,...d,..._]}#d(t){if(!t||t?.indexOf("T")===-1)return{time:t??"13:00"};let e=new Date(t);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}setTargetUrl(t,e=!1){e&&(this.#l=null),this.targetUrlModel.set(t)}#_(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set(ee.autoRun),this.scheduleFields.nextTime.set(ee.nextTime),this.scheduleFields.runAgain.set(ee.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrlModel.set(null)}static \u0275fac=function(e){return new(e||s)};static \u0275prov=Ce({token:s,factory:s.\u0275fac,providedIn:"root"})};var wt=["formRef"];function Gt(s,t){s&1&&(a(0,"sh-alert",17),m(1,5),S(2,"sh-icon",26),F(),l())}function $t(s,t){if(s&1&&U(0),s&2){let e=t.$implicit;Ye(" ",e.DisplayName," ")}}function xt(s,t){if(s&1&&S(0,"sh-progress-bar",40),s&2){let e=u(3);Se("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),N("value",e.calculatePasswordStrength()*(100/5))}}function Ut(s,t){s&1&&(a(0,"span",35),f(1,10),l())}function bt(s,t){s&1&&(m(0,8,1),S(1,"sh-icon"),F())}function vt(s,t){s&1&&(m(0,8,2),S(1,"sh-icon"),F())}function Bt(s,t){s&1&&(m(0,11,1),S(1,"sh-icon",42),F())}function kt(s,t){s&1&&(m(0,11,2),S(1,"sh-icon"),F())}function Vt(s,t){if(s&1){let e=x();a(0,"button",41),T("click",function(){p(e);let i=u(3);return C(i.copyPassword())}),m(1,11),D(2,Bt,2,0)(3,kt,2,0),F(),l()}if(s&2){let e=u(3);r(2),R(e.copiedPassword()?2:3)}}function Kt(s,t){s&1&&(a(0,"sh-alert",39),f(1,12),l())}function Wt(s,t){if(s&1){let e=x();a(0,"div",30)(1,"sh-form-field")(2,"label",31),m(3,7),S(4,"sup"),F(),l(),S(5,"input",32),l(),D(6,xt,1,9,"sh-progress-bar",33),a(7,"sh-form-field"),S(8,"input",34),D(9,Ut,2,0,"span",35),l(),a(10,"div",36)(11,"button",37),T("click",function(){p(e);let i=u(2);return C(i.showPassword.set(!i.showPassword()))}),m(12,8),D(13,bt,2,0)(14,vt,2,0),F(),l(),a(15,"button",37),T("click",function(){p(e);let i=u(2);return C(i.generatePassword())}),m(16,9),S(17,"sh-icon"),F(),l(),D(18,Vt,4,1,"button",38),l(),D(19,Kt,2,0,"sh-alert",39),l()}if(s&2){let e=u(2);r(5),N("type",e.showPassword()?"text":"password"),r(),R(e.generalForm.value.password?6:-1),r(2),N("type",e.showPassword()?"text":"password"),r(),R(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),r(4),R(e.showPassword()?13:14),r(5),R(e.showCopyPassword()?18:-1),r(),R(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Xt(s,t){if(s&1&&(a(0,"sh-select",27)(1,"label",28),f(2,6),l(),S(3,"input",29),je(4,$t,1,1,"ng-template"),l(),D(5,Wt,20,7,"div",30)),s&2){let e=u();N("options",e.encryptionOptions())("isClearable",!1),r(5),R(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Jt(s,t){if(s&1&&(a(0,"button",24),m(1,13),S(2,"sh-icon"),F(),l()),s&2){let e=u();N("disabled",e.nameAndDescriptionValid()===!1)}}function Ht(s,t){if(s&1&&(a(0,"button",25),m(1,14),S(2,"sh-icon"),F(),l()),s&2){let e=u();N("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var te=new De,St=(s={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>te.group({name:te.control(s.name,[he.required]),description:te.control(s.description),encryption:te.control(s.encryption,[ct()]),password:te.control(s.password,[Ve(t=>t?.value.encryption!=="",[he.required])]),repeatPassword:te.control(s.repeatPassword,[Ve(t=>t?.value.encryption!=="",[he.required])]),compression:te.control(s.compression)}),pe={Key:"-",DisplayName:"None"},ze=class s{#e=A(H);#t=A(ie);#i=A(ut);#n=A(Q);#r=A(Oe);formRef=Fe.required("formRef");generalForm=this.#n.generalForm;generalFormSignal=this.#n.generalFormSignal;encryptionFieldSignal=this.#n.encryptionFieldSignal;encryptionOptions=this.#n.encryptionOptions;isNew=this.#n.isNew;showPassword=E(!1);copiedPassword=E(!1);showCopyPassword=E(!1);noneOptionKey=pe.Key;encryptionEffect=ne(()=>{this.encryptionFieldSignal()===pe.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=G(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=G(()=>{let e=this.generalFormSignal()?.password??"";return this.#i.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#n.exit(!0)}async copyPassword(){let t=this.generalForm.controls.password.value;await this.#o(t??""),this.copiedPassword.set(!0)}async#o(t){try{await navigator.clipboard.writeText(t)}catch{try{let n=document.createElement("textarea");n.value=t,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n)}catch(n){console.error("Failed to copy text: ",n)}}}generatePassword(){this.copiedPassword.set(!1);let t=this.#i.generate(16);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#n.isNew()||this.#n.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||s)};static \u0275cmp=J({type:s,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&ge(n.formRef,wt,5),e&2&&Ee()},decls:21,vars:4,consts:()=>{let t;t=$localize`Your backup name`;let e;e=$localize`Your backup description`;let n;n=$localize`Remember to copy the password`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let d;d=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let _;_=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let g;g=$localize`Encryption`;let y;y=$localize`Encryption`;let h;h=$localize`Password`;let $;$=$localize`Repeat password`;let K;K=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let v;v=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,v=Ue(v);let W;W=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let M;M=$localize`Passwords do not match`;let Z;Z=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,Z=Ue(Z);let _e;_e=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let ue;ue=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ce;return ce=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],i,o,d,c,_,y,K,v,W,M,Z,_e,ue,ce,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",t,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","shButton","",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],["shButton","","type","submit","shTooltip",n,1,"raised","primary",3,"disabled"],["icon",""],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",g,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",h,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",$,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["shButton","","type","button",1,"small","copy",3,"click"],[1,"sh-success"]]},template:function(e,n){if(e&1){let i=x();a(0,"form",15,0),T("submit",function(){return p(i),C(n.next())}),a(2,"h3",16),f(3,1),l(),D(4,Gt,3,0,"sh-alert",17),a(5,"sh-form-field")(6,"label",18),m(7,2),S(8,"sup"),F(),l(),S(9,"input",19),l(),a(10,"sh-form-field")(11,"label",20),f(12,3),l(),S(13,"textarea",21),l(),D(14,Xt,6,3),a(15,"div",22)(16,"button",23),T("click",function(){return p(i),C(n.exit())}),m(17,4),S(18,"sh-icon"),F(),l(),D(19,Jt,3,1,"button",24)(20,Ht,3,1,"button",25),l()()}if(e&2){let i;N("formGroup",n.generalForm),r(4),R(!n.isNew()&&((i=n.generalFormSignal())==null?null:i.encryption)!==""?4:-1),r(10),R(n.isNew()?14:-1),r(5),R(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[Re,fe,z,j,Ne,Pe,Ae,Y,le,ae,q,ot,nt,at],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-8)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] sh-icon.sh-success[_ngcontent-%COMP%]{color:var(--success-8)}"],changeDetection:0})};export{St as a,pe as b,ze as c,ee as d,Ke as e,gt as f,Je as g,Q as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as We}from"./chunk-QBHHGHBJ.js";import{a as Ve}from"./chunk-AE7T2DAH.js";import{b as $e}from"./chunk-TC7HZO7D.js";import{A as Re,B as Ie,G as te,I as Le,K as Ae,O as Be,V as ke,a as Oe,c as U,e as Y,i as Z,k as ye,s as ee,u as xe,y as we,z as De}from"./chunk-TGNUULAU.js";import{ea as Fe}from"./chunk-NXROYR6L.js";import{$b as u,Ab as he,Ac as Me,B as ue,Bb as _e,Bc as Ne,Cb as O,Cc as Q,Db as c,Dc as ve,Eb as d,Fb as X,H as ie,Kc as Se,Lb as ne,Mb as L,Rc as D,Sa as h,Sc as R,Tb as ge,Ub as fe,Vb as A,Wb as me,Wc as se,Xb as Ce,Xc as C,Yc as le,Zb as x,_ as j,ac as q,bc as w,cb as J,ea as N,fa as v,gc as oe,hb as W,hc as Te,ic as re,jc as K,kc as y,n as ce,nc as b,oc as Ee,pa as P,pc as Pe,qc as be,r as H,sc as B,tc as k,ub as pe,uc as $,x as de,xb as S,yb as F}from"./chunk-ZBK64QS2.js";import{a as G,b as z}from"./chunk-EUDKD2JW.js";var qe=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Ke=["label","[prefix]","[suffix]"];function Qe(o,t){if(o&1&&b(0),o&2){let e=t.$implicit,i=u();be("",e.label,"",i.hasPerSecond()?"/s":"")}}var Ue=["throttle-upload","throttle-download"],Ye=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Ze=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},Ge=class o{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(Ye);readonly=P(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&Ue.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Ze(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Me([{provide:Oe,useExisting:o,multi:!0}])],ngContentSelectors:Ke,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(q(qe),c(0,"div",0),w(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),w(4,1),w(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(i.unit,r)||(i.unit=r),r}),d(),W(8,Qe,1,2,"ng-template"),d()),e&2&&(h(2),pe("readonly",i.readonly()||void 0),h(),O("id",i.customId()),B("ngModel",i.timespan),O("disabled",i.readonly()),h(3),K("--miw",0),O("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),h(),B("ngModel",i.unit))},dependencies:[Be,te,ee,U,ye,Y,Z],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var et=["treeContainer"],tt=["formRef"],it=[[["label"]],[["label"]],[["input"]]],nt=["label","label","input"],ot=o=>({children:o,level:0}),ze=o=>({$implicit:o}),rt=(o,t)=>({children:o,level:t}),st=()=>({maxWidth:"700px",width:"100%"}),lt=(o,t)=>t.id;function at(o,t){if(o&1){let e=L();c(0,"sh-button-group")(1,"button",19),x("click",function(){N(e);let n=u();return v(n.pathDiscoveryMethod.set("browse"))}),A(2,4),d(),c(3,"button",19),x("click",function(){N(e);let n=u();return v(n.pathDiscoveryMethod.set("path"))}),A(4,5),d()()}if(o&2){let e=u();h(),y("active",e.pathDiscoveryMethod()==="browse"),h(2),y("active",e.pathDiscoveryMethod()==="path")}}function ct(o,t){o&1&&X(0,"sh-progress-bar",12)}function dt(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-down"),d())}function ut(o,t){o&1&&X(0,"sh-icon",24)}function pt(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-right"),d())}function ht(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-open"),d())}function _t(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-user"),d())}function gt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"file"),d())}function ft(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder"),d())}function mt(o,t){if(o&1&&(S(0,dt,2,0,"sh-icon",24)(1,ut,1,0,"sh-icon",24)(2,pt,2,0,"sh-icon",24),S(3,ht,2,0,"sh-icon",22)(4,_t,2,0,"sh-icon",22)(5,gt,2,0,"sh-icon",22)(6,ft,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;F(e.children.length?0:e.cls==="file"?1:2),h(3),F(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Ct(o,t){o&1&&(c(0,"sh-icon",22),b(1,"desktop-tower"),d())}function Tt(o,t){o&1&&ne(0)}function Et(o,t){if(o&1&&W(0,Tt,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=re(7);O("ngTemplateOutlet",n)("ngTemplateOutletContext",Q(5,ze,ve(2,rt,e.children,i.level+1)))}}function Pt(o,t){if(o&1){let e=L();c(0,"div",20,3),x("click",function(){N(e);let n=u().$implicit,r=u(2);return v(r.toggleNode(n.id,n))}),c(2,"div",21),S(3,mt,7,2)(4,Ct,2,0,"sh-icon",22),d(),c(5,"div",23),x("click",function(n){N(e);let r=u().$implicit,a=u(2);return v(a.toggleSelectedNode(n,r))}),b(6),d()(),S(7,Et,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();y("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),h(2),y("file",e.cls==="file"),h(),F(e.id!=="/"?3:4),h(3),Pe(" ",e.text," "),h(),F(e.children.length>0?7:-1)}}function bt(o,t){if(o&1&&S(0,Pt,8,17),o&2){let e=t.$implicit,i=u(2);F(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Mt(o,t){if(o&1&&(c(0,"sh-list"),he(1,bt,1,1,null,null,lt),d()),o&2){let e=t.$implicit;K("padding-left",e.level*.25,"rem"),h(),_e(e.children)}}function Nt(o,t){o&1&&ne(0)}function vt(o,t){if(o&1){let e=L();c(0,"sh-toggle",25),x("click",function(){N(e);let n=u();return v(n._showHiddenNodes.set(!n._showHiddenNodes()))}),A(1,6),d()}if(o&2){let e=u();y("active",e._showHiddenNodes()),h(),me(e.showFiles()?"files":"folders"),Ce(1)}}function St(o,t){if(o&1){let e=L();c(0,"button",26),x("click",function(){N(e);let n=u();return v(n.openCreateFolderDialog())}),A(1,7),d()}if(o&2){let e=u();O("disabled",!e.isCurrentPathFolder())}}function Ft(o,t){if(o&1){let e=L();c(0,"sh-dialog",27),$("isOpenChange",function(n){N(e);let r=u();return k(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),v(n)}),c(1,"header",28)(2,"h2"),A(3,8),d()(),c(4,"div",29)(5,"div"),b(6," Folder will be created under "),c(7,"pre"),b(8),d()(),c(9,"sh-form-field")(10,"textarea",30),$("ngModelChange",function(n){N(e);let r=u();return k(r.createFolderPath,n)||(r.createFolderPath=n),v(n)}),d()()(),c(11,"footer",31)(12,"button",32),x("click",function(){N(e);let n=u();return v(n.closeCreateFolderDialog(!1))}),b(13,"Cancel"),d(),c(14,"button",33),x("click",function(){N(e);let n=u();return v(n.closeCreateFolderDialog(!0))}),ge(15,9),X(16,"sh-icon"),fe(),d()()()}if(o&2){let e,i=u();B("isOpen",i.createFolderDialogOpen),O("options",Ne(5,st)),h(8),Ee(i.currentPath()),h(2),B("ngModel",i.createFolderPath),h(4),O("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var He=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(He||{}),M="/",ae=class o{#t=j($e);#n=j(Ve);#c=j(De);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);includes=se();excludes=se();_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=le("treeContainer");formRef=le("formRef");pathDiscoveryMethod=P("browse");isLoading=P(!1);currentPath=P("/");#o=P(null);treeSearchQuery=P("");treeNodes=P([]);pathDelimiter=D(()=>this.#n.systemInfo()?.DirectorySeparator??"");filterGroups=this.#n.filterGroups();isByBackupSettings=D(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=D(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=He;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),i=structuredClone(e);for(let l=0;l<i.length;l++){let m=i[l].slice(1);if(m.startsWith("{")&&m.endsWith("}")){let _=m.slice(1,-1),g=this.filterGroups?.FilterGroups[_];if(g&&g.length){let T=g.map(E=>`-${E}`);i.splice(l,1,...T)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),f=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let p=this.#r(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:p,isIndeterminate:!1,cls:this.#e(l,f)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let p=new Map;if(!l.id)return;let m=l.id;a&&(l.accepted=!0),p.set(m,l);let _=r.length>0?n.filter(g=>g.parentPath.startsWith(m)):n;for(let g of _){if(!g.id)continue;let T=g.id;if(!g.cls||p.has(T))continue;let E=p.get(g.parentPath),V=g.hidden===!0&&t?0:this.#r(i,T,g.cls,E),I=z(G({},g),{isIndeterminate:this.isIndeterminate(i,T),evalState:V,children:[]});a&&(I.accepted=this.matchAccepts(a,I)),p.set(T,I),E&&E.children.push(I)}return l}),s});#d(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#r(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),f=t.filter(p=>!p.startsWith("-")&&!p.startsWith("+")),s=t.filter(p=>p.startsWith("-")||p.startsWith("+")),l=this.multiSelect();if(f.length===0)return r;for(let p=0;p<f.length;p++){let m=f[p];if(e===m){r=1;break}if(!l||!this.#e(m,a))continue;if(e?.startsWith(m)){r=1;break}}if(s.length===0)return r;for(let p=0;p<s.length;p++){let m=s[p],_=m.slice(1),g=m.startsWith("-")?-1:1;if(this.#e(_,a)){if(i!=="folder")continue;if(e===_){r=g;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(i!=="folder")continue;let E=_.slice(1,-2);if(E==="")break;if(e?.includes(E+a)){r=g;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let E=_.slice(3,-7);if(new RegExp(E).test(e)){r=g;break}}if(_.startsWith("[")&&_.endsWith("]")){let E=_.slice(1,-1),V=this.translateCSharpRegex(E);if(new RegExp(`${V}`).test(e)){r=g;break}}if(_.startsWith("*.")){if(i!=="file"||_.replace("*.","").length===0)continue;if(this.#s(e,_,!0)){r=g;break}}if(_==="")continue;if(_===e){r=g;break}if(this.#s(e,_,!0)){r=g;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#u(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,M)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?M:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,f=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(f&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=f?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==M&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#d(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let f=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=f?f[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#c.open(We,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#u(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}#p(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(H(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(H(n=>n.Files??[]))}}#a(t){return this.isByBackupSettings()?this.#h(t):this.#p(t)}#_(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,p)=>{let m=s.slice(0,p+1).join(e);m!==""&&(a.includes(m)||a.push(m))})}),this.isLoading.set(!0);let f=a.map(s=>this.#a(s).pipe(H(l=>({status:"success",value:l,url:s})),ue(l=>ce({status:"error",value:l,url:s}))));de(f).pipe(ie(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(m=>m.status==="success"),p=s.filter(m=>m.status==="error");this.treeNodes.update(m=>{let _=l.flatMap(T=>Array.isArray(T.value)?T.value.map(E=>z(G({},E),{parentPath:T.url})):[]),g=[...new Map([...m,..._].map(T=>[T.id,T])).values()];return this.#l(),this.hideShortcuts()?g.filter(T=>!T.id.startsWith("%")):g})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=M){let i=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ie(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(f=>f!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let f=r.map(l=>{let p=this.#e(l.id,i)?"folder":"file";return z(G({},l),{cls:p,parentPath:e})}),s=[...new Map([...a,...f].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(oe(i.treeContainerRef,et,5),oe(i.formRef,tt,5)),e&2&&Te(2)},hostVars:2,hostBindings:function(e,i){e&2&&y("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:nt,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(q(it),S(0,at,5,4,"sh-button-group"),c(1,"div",10),w(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,ct,1,0,"sh-progress-bar",12),W(6,Mt,3,2,"ng-template",null,1,Se)(8,Nt,1,0,"ng-container",13),d(),c(9,"div",14),S(10,vt,2,3,"sh-toggle",15),S(11,St,2,1,"button",16),d()(),c(12,"div",17,2)(14,"sh-form-field"),w(15,1,["ngProjectAs","label",5,["label"]]),w(16,2,["ngProjectAs","input",5,["input"]]),d()(),S(17,Ft,17,6,"sh-dialog",18)),e&2){let n=re(7);F(i.multiSelect()?-1:0),h(),y("hidden",i.pathDiscoveryMethod()!=="browse"),h(2),y("visualize-accepted",i.accepts()),h(2),F(i.isLoading()?5:-1),h(3),O("ngTemplateOutlet",n)("ngTemplateOutletContext",Q(15,ze,Q(13,ot,i.treeStructure()))),h(2),F(!i.accepts()&&!i.isByBackupSettings()?10:-1),h(),F(i.enableCreateFolder()?11:-1),h(),y("hidden",i.pathDiscoveryMethod()!=="path"),h(5),F(i.createFolderDialogOpen()?17:-1)}},dependencies:[Ie,Re,ke,xe,te,Le,Ae,we,Fe,ee,U,Y,Z],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};export{Ye as a,Ze as b,Ge as c,ae as d};
|
|
1
|
+
import{a as We}from"./chunk-QLUEDPL4.js";import{a as Ve}from"./chunk-ZQ56M63S.js";import{b as $e}from"./chunk-P7OKMMNZ.js";import{A as Re,B as Ie,G as te,I as Le,K as Ae,O as Be,V as ke,a as Oe,c as U,e as Y,i as Z,k as ye,s as ee,u as xe,y as we,z as De}from"./chunk-HJSCQF6V.js";import{ea as Fe}from"./chunk-3ADKRLYD.js";import{$b as q,Ab as _e,Ac as Ne,B as ue,Bb as O,Bc as Q,Cb as c,Cc as ve,Db as d,Eb as X,H as ie,Jc as Se,Kb as ne,Lb as L,Qc as D,Ra as h,Rc as R,Sb as ge,Tb as fe,Ub as A,Vb as me,Vc as se,Wb as Ce,Wc as C,Xc as le,Yb as x,_ as j,_b as u,ac as w,bb as J,da as N,ea as v,fc as oe,gb as W,gc as Te,hc as re,ic as K,jc as y,mc as b,n as ce,nc as Ee,oa as P,oc as Pe,pc as be,r as H,rc as B,sc as k,tb as pe,tc as $,wb as S,x as de,xb as F,zb as he,zc as Me}from"./chunk-Y7PHGRGB.js";import{a as G,b as z}from"./chunk-EUDKD2JW.js";var qe=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Ke=["label","[prefix]","[suffix]"];function Qe(o,t){if(o&1&&b(0),o&2){let e=t.$implicit,i=u();be("",e.label,"",i.hasPerSecond()?"/s":"")}}var Ue=["throttle-upload","throttle-download"],Ye=[{value:"B",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Ze=o=>{if(!o||typeof o!="string"||o.length===0)return{size:0,unit:"MB"};let t=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b|kib|mib|gib|tib|pib)$/i);return t&&(t[2].toUpperCase()==="B"||t[2].toUpperCase()==="BYTES")?{size:1,unit:"KB"}:{size:t?parseInt(t[1],10):0,unit:t?t[2].toUpperCase():"MB"}},Ge=class o{customId=C();inputType=C();timespan=P(0);unit=P("MB");sizeOptions=P(Ye);readonly=P(!1);hasPerSecond=D(()=>{let t=this.inputType();return t&&Ue.includes(t)});onChange=()=>{};onTouched=()=>{};onChangeEffect=R(()=>{this.onChange(this.getValue())});writeValue(t){if(t){let e=Ze(t);e?queueMicrotask(()=>{this.timespan.set(e.size),this.unit.set(e.unit)}):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[Me([{provide:Oe,useExisting:o,multi:!0}])],ngContentSelectors:Ke,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,i){e&1&&(q(qe),c(0,"div",0),w(1,0,["ngProjectAs","label",5,["label"]]),d(),c(2,"sh-form-field")(3,"input",1),$("ngModelChange",function(r){return k(i.timespan,r)||(i.timespan=r),r}),d(),w(4,1),w(5,2),d(),c(6,"sh-select",2)(7,"input",3),$("ngModelChange",function(r){return k(i.unit,r)||(i.unit=r),r}),d(),W(8,Qe,1,2,"ng-template"),d()),e&2&&(h(2),pe("readonly",i.readonly()||void 0),h(),O("id",i.customId()),B("ngModel",i.timespan),O("disabled",i.readonly()),h(3),K("--miw",0),O("options",i.sizeOptions())("readonly",i.readonly())("isClearable",!1),h(),B("ngModel",i.unit))},dependencies:[Be,te,ee,U,ye,Y,Z],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var et=["treeContainer"],tt=["formRef"],it=[[["label"]],[["label"]],[["input"]]],nt=["label","label","input"],ot=o=>({children:o,level:0}),ze=o=>({$implicit:o}),rt=(o,t)=>({children:o,level:t}),st=()=>({maxWidth:"700px",width:"100%"}),lt=(o,t)=>t.id;function at(o,t){if(o&1){let e=L();c(0,"sh-button-group")(1,"button",19),x("click",function(){N(e);let n=u();return v(n.pathDiscoveryMethod.set("browse"))}),A(2,4),d(),c(3,"button",19),x("click",function(){N(e);let n=u();return v(n.pathDiscoveryMethod.set("path"))}),A(4,5),d()()}if(o&2){let e=u();h(),y("active",e.pathDiscoveryMethod()==="browse"),h(2),y("active",e.pathDiscoveryMethod()==="path")}}function ct(o,t){o&1&&X(0,"sh-progress-bar",12)}function dt(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-down"),d())}function ut(o,t){o&1&&X(0,"sh-icon",24)}function pt(o,t){o&1&&(c(0,"sh-icon",24),b(1,"caret-right"),d())}function ht(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-open"),d())}function _t(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder-user"),d())}function gt(o,t){o&1&&(c(0,"sh-icon",22),b(1,"file"),d())}function ft(o,t){o&1&&(c(0,"sh-icon",22),b(1,"folder"),d())}function mt(o,t){if(o&1&&(S(0,dt,2,0,"sh-icon",24)(1,ut,1,0,"sh-icon",24)(2,pt,2,0,"sh-icon",24),S(3,ht,2,0,"sh-icon",22)(4,_t,2,0,"sh-icon",22)(5,gt,2,0,"sh-icon",22)(6,ft,2,0,"sh-icon",22)),o&2){let e=u(2).$implicit;F(e.children.length?0:e.cls==="file"?1:2),h(3),F(e.children.length?3:e.id==="%HOME%"?4:e.cls==="file"?5:6)}}function Ct(o,t){o&1&&(c(0,"sh-icon",22),b(1,"desktop-tower"),d())}function Tt(o,t){o&1&&ne(0)}function Et(o,t){if(o&1&&W(0,Tt,1,0,"ng-container",13),o&2){let e=u(2).$implicit,i=u().$implicit;u();let n=re(7);O("ngTemplateOutlet",n)("ngTemplateOutletContext",Q(5,ze,ve(2,rt,e.children,i.level+1)))}}function Pt(o,t){if(o&1){let e=L();c(0,"div",20,3),x("click",function(){N(e);let n=u().$implicit,r=u(2);return v(r.toggleNode(n.id,n))}),c(2,"div",21),S(3,mt,7,2)(4,Ct,2,0,"sh-icon",22),d(),c(5,"div",23),x("click",function(n){N(e);let r=u().$implicit,a=u(2);return v(a.toggleSelectedNode(n,r))}),b(6),d()(),S(7,Et,1,7,"ng-container")}if(o&2){let e=u().$implicit,i=u().$implicit,n=u();y("accepted",e.accepted===!0)("active",e.evalState===n.TreeEvalEnum.Included)("indeterminate",e.isIndeterminate)("open",e.children.length)("usually-hidden",e.hidden)("root",i.level===0),h(2),y("file",e.cls==="file"),h(),F(e.id!=="/"?3:4),h(3),Pe(" ",e.text," "),h(),F(e.children.length>0?7:-1)}}function bt(o,t){if(o&1&&S(0,Pt,8,17),o&2){let e=t.$implicit,i=u(2);F(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function Mt(o,t){if(o&1&&(c(0,"sh-list"),he(1,bt,1,1,null,null,lt),d()),o&2){let e=t.$implicit;K("padding-left",e.level*.25,"rem"),h(),_e(e.children)}}function Nt(o,t){o&1&&ne(0)}function vt(o,t){if(o&1){let e=L();c(0,"sh-toggle",25),x("click",function(){N(e);let n=u();return v(n._showHiddenNodes.set(!n._showHiddenNodes()))}),A(1,6),d()}if(o&2){let e=u();y("active",e._showHiddenNodes()),h(),me(e.showFiles()?"files":"folders"),Ce(1)}}function St(o,t){if(o&1){let e=L();c(0,"button",26),x("click",function(){N(e);let n=u();return v(n.openCreateFolderDialog())}),A(1,7),d()}if(o&2){let e=u();O("disabled",!e.isCurrentPathFolder())}}function Ft(o,t){if(o&1){let e=L();c(0,"sh-dialog",27),$("isOpenChange",function(n){N(e);let r=u();return k(r.createFolderDialogOpen,n)||(r.createFolderDialogOpen=n),v(n)}),c(1,"header",28)(2,"h2"),A(3,8),d()(),c(4,"div",29)(5,"div"),b(6," Folder will be created under "),c(7,"pre"),b(8),d()(),c(9,"sh-form-field")(10,"textarea",30),$("ngModelChange",function(n){N(e);let r=u();return k(r.createFolderPath,n)||(r.createFolderPath=n),v(n)}),d()()(),c(11,"footer",31)(12,"button",32),x("click",function(){N(e);let n=u();return v(n.closeCreateFolderDialog(!1))}),b(13,"Cancel"),d(),c(14,"button",33),x("click",function(){N(e);let n=u();return v(n.closeCreateFolderDialog(!0))}),ge(15,9),X(16,"sh-icon"),fe(),d()()()}if(o&2){let e,i=u();B("isOpen",i.createFolderDialogOpen),O("options",Ne(5,st)),h(8),Ee(i.currentPath()),h(2),B("ngModel",i.createFolderPath),h(4),O("disabled",!((e=i.createFolderPath())!=null&&e.length))}}var He=(r=>(r[r.ExcludedByParent=-2]="ExcludedByParent",r[r.Excluded=-1]="Excluded",r[r.None=0]="None",r[r.Included=1]="Included",r[r.IncludedByParent=2]="IncludedByParent",r))(He||{}),M="/",ae=class o{#t=j($e);#n=j(Ve);#c=j(De);multiSelect=C(!1);disabled=C(!1);showFiles=C(!1);selectFiles=C(!1);accepts=C(null);startingPath=C(null);rootPaths=C([]);initialNodes=C([]);backupSettings=C(null);pathRefreshTrigger=C(!1);showHiddenNodes=C(!1);enableCreateFolder=C(!1);hideShortcuts=C(!1);includes=se();excludes=se();_showHiddenNodes=P(!1);createFolderDialogOpen=P(!1);createFolderPath=P(null);treeContainerRef=le("treeContainer");formRef=le("formRef");pathDiscoveryMethod=P("browse");isLoading=P(!1);currentPath=P("/");#o=P(null);treeSearchQuery=P("");treeNodes=P([]);pathDelimiter=D(()=>this.#n.systemInfo()?.DirectorySeparator??"");filterGroups=this.#n.filterGroups();isByBackupSettings=D(()=>{let t=this.backupSettings();return!(t===void 0||t?.id===void 0||t?.time===void 0)});searchableTreeNodes=D(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});TreeEvalEnum=He;treeStructure=D(()=>{let t=this.showHiddenNodes(),e=this.currentPath().split("\0").filter(l=>l!==""&&l!==M),i=structuredClone(e);for(let l=0;l<i.length;l++){let m=i[l].slice(1);if(m.startsWith("{")&&m.endsWith("}")){let _=m.slice(1,-1),g=this.filterGroups?.FilterGroups[_];if(g&&g.length){let T=g.map(E=>`-${E}`);i.splice(l,1,...T)}}}let n=this.searchableTreeNodes(),r=this.rootPaths(),a=this.accepts(),f=this.pathDelimiter(),s=[];return r.length>0?s=r.map(l=>{let p=this.#r(i,l,"folder",null);return{id:l,resolvedpath:l,text:l,parentPath:"",children:[],evalState:p,isIndeterminate:!1,cls:this.#e(l,f)?"folder":"file"}}):s=[{id:M,resolvedpath:M,text:$localize`Computer`,parentPath:"",children:[],evalState:0,isIndeterminate:!1,cls:"folder"}],s.map(l=>{let p=new Map;if(!l.id)return;let m=l.id;a&&(l.accepted=!0),p.set(m,l);let _=r.length>0?n.filter(g=>g.parentPath.startsWith(m)):n;for(let g of _){if(!g.id)continue;let T=g.id;if(!g.cls||p.has(T))continue;let E=p.get(g.parentPath),V=g.hidden===!0&&t?0:this.#r(i,T,g.cls,E),I=z(G({},g),{isIndeterminate:this.isIndeterminate(i,T),evalState:V,children:[]});a&&(I.accepted=this.matchAccepts(a,I)),p.set(T,I),E&&E.children.push(I)}return l}),s});#d(t){let e=this.pathDelimiter();return t?t.endsWith(e)||t===M?t:t+e:M}#r(t,e,i,n){if(n&&n.evalState===-1)return-2;let r=0,a=this.pathDelimiter(),f=t.filter(p=>!p.startsWith("-")&&!p.startsWith("+")),s=t.filter(p=>p.startsWith("-")||p.startsWith("+")),l=this.multiSelect();if(f.length===0)return r;for(let p=0;p<f.length;p++){let m=f[p];if(e===m){r=1;break}if(!l||!this.#e(m,a))continue;if(e?.startsWith(m)){r=1;break}}if(s.length===0)return r;for(let p=0;p<s.length;p++){let m=s[p],_=m.slice(1),g=m.startsWith("-")?-1:1;if(this.#e(_,a)){if(i!=="folder")continue;if(e===_){r=g;break}}if(_.startsWith("*")&&_.endsWith(`*${a}`)){if(i!=="folder")continue;let E=_.slice(1,-2);if(E==="")break;if(e?.includes(E+a)){r=g;break}}if(_.startsWith("[.*")&&_.endsWith(`[^\\${a}]*]`)){if(i!=="file")continue;let E=_.slice(3,-7);if(new RegExp(E).test(e)){r=g;break}}if(_.startsWith("[")&&_.endsWith("]")){let E=_.slice(1,-1),V=this.translateCSharpRegex(E);if(new RegExp(`${V}`).test(e)){r=g;break}}if(_.startsWith("*.")){if(i!=="file"||_.replace("*.","").length===0)continue;if(this.#s(e,_,!0)){r=g;break}}if(_==="")continue;if(_===e){r=g;break}if(this.#s(e,_,!0)){r=g;break}}return r}translateCSharpRegex(t){let e=t;e=e.replace(/^@/,"");let i=/\(\?<(?<name>\w+)>(?<pattern>[^)]+)\)/g;return e=e.replace(i,(n,r,a)=>`(${a})`),e=e.replace(/\\/g,"\\\\"),e}isIndeterminate(t,e){return t.filter(i=>!i.startsWith("-")&&this.#e(i,this.pathDelimiter())).some(i=>i.startsWith(e))}isCurrentPathFolder(){let t=this.currentPath();return t?t.endsWith(this.pathDelimiter())||t.startsWith("%")&&t.endsWith("%")&&!t.includes(this.pathDelimiter()):!1}#s(t,e,i=!1){let n=e.replace(/\*/g,".*").replace(/\?/g,".").replace(/\[!([^\]]+)\]/g,"[^$1]");return new RegExp(`${n}${i?"$":""}`).test(t)}showHiddenNodesEffect=R(()=>this._showHiddenNodes.set(this.showHiddenNodes()));pathDiscoveryMethodEffect=R(()=>{let t=this.pathDiscoveryMethod(),e=this.#o();t==="browse"&&e&&this.currentPath.set(e.value)});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id===M)return!0;let i=t.split(",");if(i.length===0)return!0;let n="."+e.id.slice(e.id.indexOf("."));return n?i.some(r=>n.endsWith(r)):!1}currentPathEffect=R(()=>{let t=this.#o();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))});inputValueChangeAbortController=null;inputRefEffect=R(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#u(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#o.set(t),t.autocomplete="off")});ngOnInit(){let t=this.startingPath();if(t)this.currentPath.set(t),this.#_(t);else{let e=this.rootPaths(),i=this.initialNodes();e&&e.length>0?(i&&i.length>0&&this.treeNodes.set(i.map(n=>({id:n.id,leaf:n.leaf,cls:n.cls,text:n.text,iconCls:n.iconCls,fileSize:n.fileSize,resolvedpath:n.resolvedpath,parentPath:this.getParentPath(n.id??"")}))),this.#i(null,e[0])):this.#i(null,M)}}getParentPath(t){let e=this.pathDelimiter(),i=t.split(e);return i.length<=1?M:(i.pop(),i.length!==0&&i.pop(),i.join(e)+e)}toggleSelectedNode(t,e){if(e.id===M||(t.stopPropagation(),e.evalState===-2))return;if(this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}if(this.accepts()&&!e.accepted)return;let n=this.currentPath().split("\0").filter(s=>s!==""&&s!==M),a=this.isChildOfSelected(e)?`-${e.id}`:e.id,f=this.#e(e.id,this.pathDelimiter());if(this.multiSelect())if(n.includes(e.id))this.currentPath.set(n.filter(s=>s!==e.id&&!(f&&s.startsWith(a))).join("\0"));else if(n.some(s=>s==a))this.currentPath.set(n.filter(s=>s!==a).join("\0"));else{let s=f?n.filter(l=>!l.startsWith(e.id)):n;this.currentPath.set([...s,a].join("\0"))}else n.includes(e.id)?this.currentPath.set(n.filter(s=>s!==e.id).join("\0")):this.currentPath.set(e.id)}isChildOfSelected(t){return this.currentPath().split("\0").filter(i=>i!==""&&i!==M&&this.#e(i,this.pathDelimiter())).some(i=>t.id?.startsWith(i)||`-${t.id}`.startsWith(i))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(n=>!n.id?.startsWith(e.id)||n.id===e.id)):this.#i(e,t))}openCreateFolderDialog(){return this.createFolderPath.set(null),this.createFolderDialogOpen.set(!0),!1}closeCreateFolderDialog(t){if(t&&this.createFolderPath()?.length&&this.isCurrentPathFolder()){let e=this.createFolderPath()?.trim();if(e){let i=this.currentPath(),n=this.#d(e),r=i+n;this.#t.postApiV1RemoteoperationCreate({requestBody:{path:"file://"+r}}).subscribe({next:()=>{this.currentPath.set(r),this.#i(null,i),setTimeout(()=>{this.#l()},500),this.createFolderDialogOpen.set(!1)},error:a=>{let f=a?.message?.match(/user-information\s*:\s*(.*?)(?:\s*,|$)/i),s=f?f[1]:a?.message||$localize`An error occurred while trying to create the folder.`;this.#c.open(We,{data:{title:$localize`Cannot create folder`,message:s,confirmText:$localize`OK`,cancelText:void 0}})}})}}else this.createFolderDialogOpen.set(!1);return!1}#l(){setTimeout(()=>{let e=this.treeContainerRef()?.nativeElement?.querySelector(".active");e&&e.scrollIntoView({behavior:"smooth",block:"center"})},100)}#u(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}#p(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#h(t){let e=this.backupSettings();if(this.#n.hasV2ListOperations())return this.#t.postApiV2BackupListFolder({requestBody:{BackupId:e.id,Time:e.time,Paths:t?[t]:null,PageSize:0,Page:0}}).pipe(H(i=>i.Data??[]));{let i={id:e.id+"",prefixOnly:!1,folderContents:!0,time:e.time,filter:t?"@"+t:void 0};return this.#t.getApiV1BackupByIdFiles(i).pipe(H(n=>n.Files??[]))}}#a(t){return this.isByBackupSettings()?this.#h(t):this.#p(t)}#_(t){let e=this.pathDelimiter(),i=t.split("\0").filter(s=>s.startsWith("-")).map(s=>s.slice(1,-1)),r=t.split("\0").filter(s=>!s.startsWith("-")).filter(Boolean).map(s=>{let l=s.split(e);return l.at(-1)!==""&&l.pop(),l}),a=[M];r.forEach(s=>{s.forEach((l,p)=>{let m=s.slice(0,p+1).join(e);m!==""&&(a.includes(m)||a.push(m))})}),this.isLoading.set(!0);let f=a.map(s=>this.#a(s).pipe(H(l=>({status:"success",value:l,url:s})),ue(l=>ce({status:"error",value:l,url:s}))));de(f).pipe(ie(()=>this.isLoading.set(!1))).subscribe({next:s=>{let l=s.filter(m=>m.status==="success"),p=s.filter(m=>m.status==="error");this.treeNodes.update(m=>{let _=l.flatMap(T=>Array.isArray(T.value)?T.value.map(E=>z(G({},E),{parentPath:T.url})):[]),g=[...new Map([...m,..._].map(T=>[T.id,T])).values()];return this.#l(),this.hideShortcuts()?g.filter(T=>!T.id.startsWith("%")):g})}})}#e(t,e){return t.startsWith("%")&&t.endsWith("%")||t.endsWith(e)}#i(t=null,e=M){let i=this.pathDelimiter();this.isLoading.set(!0),this.#a(e).pipe(ie(()=>this.isLoading.set(!1))).subscribe({next:n=>{let r=this.isByBackupSettings()?n.map(a=>({text:a.Path.split(i).filter(f=>f!=="").pop(),id:a.Path,cls:this.#e(a.Path,i)?"folder":"file",leaf:t!==null,resolvedpath:a.Path,hidden:!1})):n;this.treeNodes.update(a=>{let f=r.map(l=>{let p=this.#e(l.id,i)?"folder":"file";return z(G({},l),{cls:p,parentPath:e})}),s=[...new Map([...a,...f].map(l=>[l.id,l])).values()];return this.hideShortcuts()?s.filter(l=>!l.id.startsWith("%")):s})}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=J({type:o,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(oe(i.treeContainerRef,et,5),oe(i.formRef,tt,5)),e&2&&Te(2)},hostVars:2,hostBindings:function(e,i){e&2&&y("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPaths:[1,"rootPaths"],initialNodes:[1,"initialNodes"],backupSettings:[1,"backupSettings"],pathRefreshTrigger:[1,"pathRefreshTrigger"],showHiddenNodes:[1,"showHiddenNodes"],enableCreateFolder:[1,"enableCreateFolder"],hideShortcuts:[1,"hideShortcuts"]},outputs:{includes:"includes",excludes:"excludes"},ngContentSelectors:nt,decls:18,vars:17,consts:()=>{let t;t=$localize` Browse path `;let e;e=$localize` Manually type path `;let i;i=$localize` Show hidden ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let n;n=$localize` Create folder `;let r;r=$localize`Enter new folder path`;let a;return a=$localize` Create folder ${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:folder-plus${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],t,e,i,n,r,a,[1,"section"],[1,"browse-files"],[1,"indeterminate","primary"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"footer"],[1,"primary","raised","browse-files-toggle",3,"active"],["shButton","","type","button",1,"small","create-folder",3,"disabled"],[1,"form-field"],[3,"isOpen","options"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"primary"],[1,"text",3,"click"],[1,"small"],[1,"primary","raised","browse-files-toggle",3,"click"],["shButton","","type","button",1,"small","create-folder",3,"click","disabled"],[3,"isOpenChange","isOpen","options"],["header",""],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click","disabled"]]},template:function(e,i){if(e&1&&(q(it),S(0,at,5,4,"sh-button-group"),c(1,"div",10),w(2,0,["ngProjectAs","label",5,["label"]]),c(3,"div",11,0),S(5,ct,1,0,"sh-progress-bar",12),W(6,Mt,3,2,"ng-template",null,1,Se)(8,Nt,1,0,"ng-container",13),d(),c(9,"div",14),S(10,vt,2,3,"sh-toggle",15),S(11,St,2,1,"button",16),d()(),c(12,"div",17,2)(14,"sh-form-field"),w(15,1,["ngProjectAs","label",5,["label"]]),w(16,2,["ngProjectAs","input",5,["input"]]),d()(),S(17,Ft,17,6,"sh-dialog",18)),e&2){let n=re(7);F(i.multiSelect()?-1:0),h(),y("hidden",i.pathDiscoveryMethod()!=="browse"),h(2),y("visualize-accepted",i.accepts()),h(2),F(i.isLoading()?5:-1),h(3),O("ngTemplateOutlet",n)("ngTemplateOutletContext",Q(15,ze,Q(13,ot,i.treeStructure()))),h(2),F(!i.accepts()&&!i.isByBackupSettings()?10:-1),h(),F(i.enableCreateFolder()?11:-1),h(),y("hidden",i.pathDiscoveryMethod()!=="path"),h(5),F(i.createFolderDialogOpen()?17:-1)}},dependencies:[Ie,Re,ke,xe,te,Le,Ae,we,Fe,ee,U,Y,Z],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.fill[_nghost-%COMP%]{height:auto;overflow:hidden;flex:1 0}.fill[_nghost-%COMP%] .section[_ngcontent-%COMP%]{height:auto;overflow:hidden;flex:1 0;display:grid;grid-template-columns:1fr auto;grid-template-rows:auto 1fr;grid-template-areas:"label toggle" "tree tree"}.fill[_nghost-%COMP%] .browse-files[_ngcontent-%COMP%]{resize:none;height:initial;grid-area:tree}.fill[_nghost-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.fill[_nghost-%COMP%] sh-toggle[_ngcontent-%COMP%]{grid-area:toggle;flex-direction:row-reverse}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-4);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-1);position:relative}.browse-files[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{position:absolute;top:0;left:0;right:0}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-3);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:0;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:transparent;--list-active-bg: var(--primary-2)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].indeterminate[_ngcontent-%COMP%]{border-color:var(--primary-4)}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%]{gap:.25rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]:has(sh-icon:nth-child(2)){width:3rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action].root[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:3rem;gap:.25rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files[_ngcontent-%COMP%] sh-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon.file[_ngcontent-%COMP%]{width:3rem;padding:0 .25rem}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-9)}.hidden[_ngcontent-%COMP%]{display:none}.footer[_ngcontent-%COMP%]{display:flex;flex-direction:row;justify-content:space-between;align-items:center}'],changeDetection:0})};export{Ye as a,Ze as b,Ge as c,ae as d};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u}from"./chunk-
|
|
1
|
+
import{a as u}from"./chunk-X7XIFHAV.js";import{b as m}from"./chunk-P7OKMMNZ.js";import{B as d,F as o,H as p,R as h,Rc as l,V as N,_ as r,n as c,oa as s,x as f}from"./chunk-Y7PHGRGB.js";var b=class a{#e=r(m);#o=r(u);serverState=this.#o.serverState;serverStateEffect=l(()=>{let t=this.#o.serverState();t?.LastNotificationUpdateID&&this.updateLastNotificationEventId(t?.LastNotificationUpdateID)});#s=-1;#a=s(!1);#t=s([]);#i=s([]);notifications=this.#t.asReadonly();init(){this.notifications().length===0&&this.getNotifications()}updateLastNotificationEventId(t){this.#s!==t&&(this.#s=t,this.getNotifications())}getNotifications(){this.#a.set(!0),this.#e.getApiV1Notifications().pipe(o(1),h(t=>this.#t.set(t)),p(()=>this.#a.set(!1))).subscribe()}getNofication(t){this.#e.getApiV1NotificationById({id:t}).pipe(o(1)).subscribe()}deleteNotification(t){let i=this.#t(),e=i[t];this.#i.set(i),i.splice(t,1),this.#t.set(i),this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(o(1)).subscribe({error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}deleteAllNotifications(){let t=this.#t();this.#i.set(t),this.#t.set([]);let i=t.map(e=>this.#e.deleteApiV1NotificationById({id:e.ID}).pipe(d(()=>c(e))));f(i).pipe(o(1)).subscribe({next:e=>{let g=e.filter(n=>n!=null&&"ID"in n);this.#t.set(g),this.#i.set([])},error:()=>{this.#t.set(this.#i()),this.#i.set([])}})}static \u0275fac=function(i){return new(i||a)};static \u0275prov=N({token:a,factory:a.\u0275fac,providedIn:"root"})};export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as Nt}from"./chunk-SXFSAK5L.js";import{a as Ct,b as pt,c as Rt}from"./chunk-7XXYLQEN.js";import"./chunk-XRI2BFC2.js";import"./chunk-H4H72SDD.js";import{a as Et}from"./chunk-D7OP5FPA.js";import{h as Ot}from"./chunk-2CWLIRUP.js";import"./chunk-5KMPTDRJ.js";import"./chunk-2DP4QU4T.js";import"./chunk-AWXWGD4T.js";import"./chunk-4Z72AON4.js";import"./chunk-6Q6SSTBK.js";import"./chunk-HVB6ARTT.js";import"./chunk-POJT4MSX.js";import"./chunk-WJDMMKWE.js";import{a as R}from"./chunk-QBHHGHBJ.js";import"./chunk-AE7T2DAH.js";import"./chunk-SVQCV5AE.js";import"./chunk-TC7HZO7D.js";import{B as St,G as dt,J as Dt,c as ot,e as at,f as st,g as rt,i as Ft,j as lt,s as _t,u as ct,w as Tt,y as ut,z as gt}from"./chunk-TGNUULAU.js";import{b as nt,d as it}from"./chunk-XUN5TTJC.js";import"./chunk-VCLWADQK.js";import"./chunk-ATGKEH5N.js";import"./chunk-NXROYR6L.js";import"./chunk-FPPZ4BUR.js";import{$b as l,Ab as L,Ac as Z,Bb as x,Bc as tt,Cb as m,Db as s,Eb as r,Fb as g,Jb as G,Kb as w,Mb as O,Rc as k,Sa as F,Tb as T,Ub as u,Vb as h,Wb as f,Xb as $,Yb as b,Yc as et,Zb as d,_ as C,cb as K,ea as _,fa as c,gc as j,hc as Q,ja as X,kc as q,nc as I,oc as B,pa as p,pc as Y,sc as A,tc as M,uc as P,xb as D,yb as E,zb as y}from"./chunk-ZBK64QS2.js";import"./chunk-EUDKD2JW.js";var mt=["formRef"],It=()=>({maxWidth:"700px",width:"100%"});function ht(i,n){if(i&1){let t=O();T(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),r(),u()}if(i&2){let t=l();F(),q("loader",t.testSignal()=="testing"),m("disabled",t.testSignal()=="testing")}}function ft(i,n){if(i&1){let t=O();T(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),r(),u()}}function $t(i,n){i&1&&(s(0,"sh-alert"),T(1,5),g(2,"sh-icon",31),u(),r())}function At(i,n){i&1&&(s(0,"sh-alert",21),T(1,6),g(2,"sh-icon",31),u(),r())}function Mt(i,n){if(i&1&&(s(0,"sh-alert",22),T(1,7),g(2,"sh-icon",31),u(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),T(1,8),g(2,"sh-icon",31),u(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function yt(i,n){if(i&1){let t=O();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),T(1,9),g(2,"strong")(3,"br")(4,"span",33),u(),r()}if(i&2){let t,o=l();F(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=O();s(0,"div",39),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),I(2),r(),s(3,"p"),I(4),r()()}if(i&2){let t=n.$implicit;F(2),B(t.displayName),F(2),B(t.description)}}function xt(i,n){if(i&1){let t=O();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),r()}if(i&2){let t=n.$implicit;F(2),Y(" ",t.displayName," ")}}function Gt(i,n){if(i&1&&(s(0,"div",34),L(1,Lt,5,2,"div",35,y),r(),s(3,"sh-menu",36)(4,"button",37),h(5,10),r(),G(6,19),L(7,xt,3,1,"button",38,y),w(),r()),i&2){let t=l();F(),x(t.destinationTypeOptionsFocused()),F(2),m("searchable",!0),F(4),x(t.destinationTypeOptions())}}function wt(i,n){if(i&1){let t=O();s(0,"app-single-destination",41),P("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),r()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function bt(i,n){i&1&&(T(0,4,1),g(1,"sh-icon",28),u())}function Bt(i,n){i&1&&(T(0,4,2),g(1,"sh-icon"),u())}function kt(i,n){if(i&1){let t=O();s(0,"sh-dialog",42),P("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"div",44)(3,"h2"),h(4,11),r(),s(5,"sh-alert",22),h(6,12),r()()(),s(7,"div",45)(8,"sh-form-field")(9,"textarea",46),P("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),r()()(),s(10,"footer",47)(11,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(12,"Cancel"),r(),s(13,"button",48),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),T(14,13),g(15,"sh-icon"),u(),r()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),m("options",tt(3,It)),F(9),A("ngModel",t.targetUrlCtrl)}}var v=class i{#i=C(it);#o=C(nt);#e=C(gt);#a=C(Ct);injector=C(X);#t=C(Nt);#s=C(pt);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=p(null);targetUrlInitial=p(null);targetUrlDialogOpen=p(!1);toggleNewDestination=p(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=p(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=k(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=k(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Et(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(R,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(R,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let N=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(R,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(R,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(R,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=K({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&j(o.formRef,mt,5),t&2&&Q()},features:[Z([Ot])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=b(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=b(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let W;W=$localize`All destinations`;let z;z=$localize`Edit target URL`;let H;H=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,N,U,V,W,z,H,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled","loader"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"sh-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["shButton","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=O();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),T(4,2),s(5,"div",16),D(6,ht,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),r(),G(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),r(),D(13,ft,3,0,"button",18),w(),r()(),u(),r(),D(14,$t,3,0,"sh-alert")(15,At,3,0,"sh-alert",21)(16,Mt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,yt,5,1,"p"),r(),D(19,Gt,9,1),D(20,wt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),T(23,3),g(24,"sh-icon"),u(),r(),s(25,"button",27),T(26,4),D(27,bt,2,0,"sh-icon",28)(28,Bt,2,0,"sh-icon"),u(),r()()(),D(29,kt,16,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();F(6),E(e?6:-1),F(7),E(e?13:-1),F(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),F(4),E(e?18:-1),F(),E(e?-1:19),F(),E(e?20:-1),F(5),m("disabled",o.testSignal()=="testing"||!e),F(2),E(o.testSignal()=="testing"?27:28),F(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,_t,lt,ot,at,st,Ft,rt,St,dt,Dt,ct,ut,Tt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{v as default};
|
|
1
|
+
import{g as Nt}from"./chunk-OVLLX4US.js";import{a as Ct,b as pt,c as Rt}from"./chunk-AROXMP46.js";import"./chunk-QE4NBN5H.js";import"./chunk-KUP2T6AG.js";import{a as Et}from"./chunk-WNHQELMC.js";import{h as Ot}from"./chunk-IQ52IXSC.js";import"./chunk-R2N5UWYB.js";import"./chunk-J64OAILA.js";import"./chunk-OQ2HMOSQ.js";import"./chunk-VXJJGZ5F.js";import"./chunk-6Q6SSTBK.js";import"./chunk-AUMCM45B.js";import"./chunk-NY63VRAY.js";import"./chunk-GRPEAINE.js";import{a as R}from"./chunk-QLUEDPL4.js";import"./chunk-ZQ56M63S.js";import"./chunk-4IAJY6E3.js";import"./chunk-P7OKMMNZ.js";import{B as St,G as dt,J as Dt,c as ot,e as at,f as st,g as rt,i as Ft,j as lt,s as _t,u as ct,w as Tt,y as ut,z as gt}from"./chunk-HJSCQF6V.js";import{b as nt,d as it}from"./chunk-G4Z3JAJB.js";import"./chunk-53V6KV3I.js";import"./chunk-XUQ74HFK.js";import"./chunk-3ADKRLYD.js";import"./chunk-FPPZ4BUR.js";import{Ab as x,Ac as tt,Bb as m,Cb as s,Db as r,Eb as g,Ib as G,Jb as w,Lb as O,Qc as k,Ra as F,Sb as T,Tb as u,Ub as h,Vb as f,Wb as $,Xb as b,Xc as et,Yb as d,_ as C,_b as l,bb as K,da as _,ea as c,fc as j,gc as Q,ia as X,jc as q,mc as I,nc as B,oa as p,oc as Y,rc as A,sc as M,tc as P,wb as D,xb as E,yb as y,zb as L,zc as Z}from"./chunk-Y7PHGRGB.js";import"./chunk-EUDKD2JW.js";var mt=["formRef"],It=()=>({maxWidth:"700px",width:"100%"});function ht(i,n){if(i&1){let t=O();T(0,2,1),s(1,"button",30),d("click",function(){_(t);let e=l();return c(e.testDestination(0,!0))}),r(),u()}if(i&2){let t=l();F(),q("loader",t.testSignal()=="testing"),m("disabled",t.testSignal()=="testing")}}function ft(i,n){if(i&1){let t=O();T(0,2,2),s(1,"button",20),d("click",function(){_(t);let e=l();return c(e.copyTargetUrl())}),g(2,"sh-icon"),r(),u()}}function $t(i,n){i&1&&(s(0,"sh-alert"),T(1,5),g(2,"sh-icon",31),u(),r())}function At(i,n){i&1&&(s(0,"sh-alert",21),T(1,6),g(2,"sh-icon",31),u(),r())}function Mt(i,n){if(i&1&&(s(0,"sh-alert",22),T(1,7),g(2,"sh-icon",31),u(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function Pt(i,n){if(i&1&&(s(0,"sh-alert",23),T(1,8),g(2,"sh-icon",31),u(),r()),i&2){let t=l();F(2),f(t.testErrorMessage()),$(1)}}function yt(i,n){if(i&1){let t=O();s(0,"p",32),d("click",function(){_(t);let e=l();return c(e.removeDestination())}),T(1,9),g(2,"strong")(3,"br")(4,"span",33),u(),r()}if(i&2){let t,o=l();F(4),f((t=o.selectedDestinationType())==null?null:t.displayName),$(1)}}function Lt(i,n){if(i&1){let t=O();s(0,"div",39),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),s(1,"h3"),I(2),r(),s(3,"p"),I(4),r()()}if(i&2){let t=n.$implicit;F(2),B(t.displayName),F(2),B(t.description)}}function xt(i,n){if(i&1){let t=O();s(0,"button",40,1),d("click",function(){let e=_(t).$implicit,a=l(2);return c(a.setDestination(e.key))}),I(2),r()}if(i&2){let t=n.$implicit;F(2),Y(" ",t.displayName," ")}}function Gt(i,n){if(i&1&&(s(0,"div",34),L(1,Lt,5,2,"div",35,y),r(),s(3,"sh-menu",36)(4,"button",37),h(5,10),r(),G(6,19),L(7,xt,3,1,"button",38,y),w(),r()),i&2){let t=l();F(),x(t.destinationTypeOptionsFocused()),F(2),m("searchable",!0),F(4),x(t.destinationTypeOptions())}}function wt(i,n){if(i&1){let t=O();s(0,"app-single-destination",41),P("targetUrlChange",function(e){_(t);let a=l();return M(a.targetUrlModel,e)||(a.targetUrlModel=e),c(e)}),r()}if(i&2){let t=l();A("targetUrl",t.targetUrlModel)}}function bt(i,n){i&1&&(T(0,4,1),g(1,"sh-icon",28),u())}function Bt(i,n){i&1&&(T(0,4,2),g(1,"sh-icon"),u())}function kt(i,n){if(i&1){let t=O();s(0,"sh-dialog",42),P("isOpenChange",function(e){_(t);let a=l();return M(a.targetUrlDialogOpen,e)||(a.targetUrlDialogOpen=e),c(e)}),s(1,"header",43)(2,"div",44)(3,"h2"),h(4,11),r(),s(5,"sh-alert",22),h(6,12),r()()(),s(7,"div",45)(8,"sh-form-field")(9,"textarea",46),P("ngModelChange",function(e){_(t);let a=l();return M(a.targetUrlCtrl,e)||(a.targetUrlCtrl=e),c(e)}),r()()(),s(10,"footer",47)(11,"button",26),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!1))}),I(12,"Cancel"),r(),s(13,"button",48),d("click",function(){_(t);let e=l();return c(e.closeTargetUrlDialog(!0))}),T(14,13),g(15,"sh-icon"),u(),r()()()}if(i&2){let t=l();A("isOpen",t.targetUrlDialogOpen),m("options",tt(3,It)),F(9),A("ngModel",t.targetUrlCtrl)}}var v=class i{#i=C(it);#o=C(nt);#e=C(gt);#a=C(Ct);injector=C(X);#t=C(Nt);#s=C(pt);formRef=et.required("formRef");targetUrlModel=this.#t.destinationTargetUrl;targetUrlCtrl=p(null);targetUrlInitial=p(null);targetUrlDialogOpen=p(!1);toggleNewDestination=p(!0);testSignal=this.#t.testSignal;testErrorMessage=this.#t.testErrorMessage;destinationTypeOptionsInFocus=p(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=this.#s.destinationTypeOptions;destinationTypeOptionsFocused=k(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(e=>e.key===o))});selectedDestinationType=k(()=>{let n=this.#t.destinationTargetUrl();if(!n)return null;let t=n.split("://")[0];return Et(t)});copyTargetUrl(){navigator.clipboard.writeText(this.#t.destinationTargetUrl()??"")}openTargetUrlDialog(){let n=this.#t.destinationTargetUrl();this.targetUrlCtrl.set(n),this.targetUrlInitial.set(n),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl(),o=this.targetUrlInitial();!n||t===o||!t||this.#t.updateTargetUrl(t)}testDestination(n,t,o){let e=this.#t.destinationTargetUrl();e&&(this.#t.setTestState("testing"),this.#a.testDestination(e,this.#t.backupId(),n,!0,t).subscribe({next:a=>{if(a.action==="success"){this.#t.setTestState("success"),a.containsBackup===!1?(this.#t.setTestState("warning",$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`),t||this.#e.open(R,{data:{title:$localize`Folder contains no backup`,message:$localize`The remote destination does not contain any backups. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})):a.anyFilesFound===!1&&(this.#t.setTestState("warning",$localize`The remote destination is empty. Please check if the destination details are correct.`),t||this.#e.open(R,{data:{title:$localize`Folder is empty`,message:$localize`The remote destination is empty. Please check if the destination details are correct.`,confirmText:$localize`OK`,cancelText:void 0}})),o?.();return}if(this.#t.setTestState("error",a.errorMessage??$localize`An error occurred while testing the destination.`),a.action==="generic-error"){o?.();return}let N=e.includes("?");a.action==="trust-cert"&&this.#t.updateTargetUrl(e+`${N?"&":"?"}accept-specified-ssl-hash=${a.certData}`),a.action==="approve-host-key"&&this.#t.updateTargetUrl(e+`${N?"&":"?"}ssh-fingerprint=${a.reportedHostKey}`),a.testAgain?this.testDestination(a.destinationIndex,t):o?.()}}))}setDestination(n){this.#t.updateTargetUrl(`${n}://`)}removeDestination(){this.#t.updateTargetUrl(null)}goBack(){this.#i.navigate(["general"],{relativeTo:this.#o.parent})}next(){let n=this.testSignal();if(n===""){this.#e.open(R,{data:{title:$localize`Test destination`,message:$localize`You have not tested the destination yet. Do you want to test it now?`,confirmText:$localize`Test now`,cancelText:$localize`Skip test and continue`},closed:t=>{t?this.testDestination(0,!1,()=>{this.testSignal()==="success"?this.#n():this.#e.open(R,{data:{title:$localize`Test did not succeed`,message:this.testErrorMessage()??$localize`Failed to test the destination.`,confirmText:$localize`OK`,cancelText:void 0}})}):this.#n()}});return}if(n!=="success"){this.#e.open(R,{data:{title:$localize`Test destination`,message:$localize`The destination has not been tested successfully. Are you sure you want to continue?`,confirmText:$localize`Yes, continue`,cancelText:$localize`Cancel`},closed:t=>{t&&this.#n()}});return}this.#n()}#n(){this.#i.navigate(["encryption"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||i)};static \u0275cmp=K({type:i,selectors:[["app-restore-destination"]],viewQuery:function(t,o){t&1&&j(o.formRef,mt,5),t&2&&Q()},features:[Z([Ot])],decls:30,vars:9,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON: Test destination ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SH_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:dots-three-vertical${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:link${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD*6:1\uFFFD|\uFFFD*13:2\uFFFD]"}:START_BLOCK_IF:${"\uFFFD#1:2\uFFFD"}:START_TAG_BUTTON_3:${"[\uFFFD#9\uFFFD|\uFFFD#12\uFFFD|\uFFFD#2:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD|\uFFFD/#2:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy URL to clipboard ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*6:1\uFFFD|\uFFFD/*13:2\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=b(n);let t;t=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD*27:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SH_ICON:spinner${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*27:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*28:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SH_ICON_1:arrow-right${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*28:2\uFFFD"}:CLOSE_BLOCK_ELSE: Continue `,o=b(o);let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Testing connection... `;let a;a=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:check${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Connection tested successfully. `;let N;N=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let U;U=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: ${"\uFFFD0\uFFFD"}:INTERPOLATION: `;let V;V=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let W;W=$localize`All destinations`;let z;z=$localize`Edit target URL`;let H;H=$localize`Be careful, this will overwrite everything you have in your destination.`;let J;return J=$localize` Override target URL ${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:swap${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],["option",""],n,t,o,e,a,N,U,V,W,z,H,J,[3,"submit"],[1,"title-30"],[1,"actions"],["shButton","","type","button",1,"small",3,"disabled","loader"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],[1,"success"],[1,"warn"],[1,"error"],[3,"targetUrl"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","","type","submit",1,"raised","primary",3,"disabled"],[1,"loader"],[3,"isOpen","options"],["shButton","","type","button",1,"small",3,"click","disabled"],["icon",""],[3,"click"],[1,"sh-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["shButton","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],[3,"targetUrlChange","targetUrl"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"target-dialog-header"],["content",""],["id","targetUrl","autocomplete","off",3,"ngModelChange","ngModel"],["footer",""],["shButton","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let e=O();s(0,"form",14,0),d("submit",function(){return _(e),c(o.next())}),s(2,"header")(3,"h3",15),T(4,2),s(5,"div",16),D(6,ht,2,3,"button",17),s(7,"sh-menu")(8,"button",18),g(9,"sh-icon"),r(),G(10,19),s(11,"button",20),d("click",function(){return _(e),c(o.openTargetUrlDialog())}),g(12,"sh-icon"),r(),D(13,ft,3,0,"button",18),w(),r()(),u(),r(),D(14,$t,3,0,"sh-alert")(15,At,3,0,"sh-alert",21)(16,Mt,3,1,"sh-alert",22)(17,Pt,3,1,"sh-alert",23),D(18,yt,5,1,"p"),r(),D(19,Gt,9,1),D(20,wt,1,1,"app-single-destination",24),s(21,"div",25)(22,"button",26),d("click",function(){return _(e),c(o.goBack())}),T(23,3),g(24,"sh-icon"),u(),r(),s(25,"button",27),T(26,4),D(27,bt,2,0,"sh-icon",28)(28,Bt,2,0,"sh-icon"),u(),r()()(),D(29,kt,16,4,"sh-dialog",29)}if(t&2){let e=!!o.targetUrlModel();F(6),E(e?6:-1),F(7),E(e?13:-1),F(),E(o.testSignal()=="testing"?14:o.testSignal()=="success"?15:o.testSignal()=="warning"?16:o.testSignal()=="error"?17:-1),F(4),E(e?18:-1),F(),E(e?-1:19),F(),E(e?20:-1),F(5),m("disabled",o.testSignal()=="testing"||!e),F(2),E(o.testSignal()=="testing"?27:28),F(2),E(o.targetUrlDialogOpen()?29:-1)}},dependencies:[Rt,_t,lt,ot,at,st,Ft,rt,St,dt,Dt,ct,ut,Tt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10);background-color:var(--base-2);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}.target-dialog-header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:.5rem}"],changeDetection:0})};export{v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-EUDKD2JW.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-R3F6GIHW.js")},{path:"destination",loadComponent:()=>import("./chunk-WKA7CSGA.js")},{path:"source-data",loadComponent:()=>import("./chunk-SKFITJZT.js")},{path:"schedule",loadComponent:()=>import("./chunk-TPYX7QC7.js")},{path:"options",loadComponent:()=>import("./chunk-SHNCRKXQ.js")}];export{o as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as j,G as B,J as U,a as L,c as w,e as V,i as x,k as z,s as G}from"./chunk-
|
|
1
|
+
import{B as j,G as B,J as U,a as L,c as w,e as V,i as x,k as z,s as G}from"./chunk-HJSCQF6V.js";import{$b as D,Ab as O,Bb as u,Cb as p,Db as a,Ib as b,Jb as P,Lb as v,Qc as m,Ra as i,Rc as T,Ub as c,Vb as g,Wb as _,Wc as h,Yb as y,_b as I,ac as d,bb as f,da as C,ea as M,oa as r,rc as F,sc as A,tb as E,tc as $,yb as N,zb as S,zc as R}from"./chunk-Y7PHGRGB.js";var k=[[["label"]],[["","prefix",""]],[["","suffix",""]]],J=["label","[prefix]","[suffix]"];function X(o,e){if(o&1){let t=v();p(0,"button",7),y("click",function(){let s=C(t).$implicit,l=I();return M(l.updateUnit(s.value))}),c(1,1),a()}if(o&2){let t=e.$implicit;i(),g(t.label),_(1)}}var Y=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],H=[{value:"Y",label:$localize`Years`},{value:"M",label:$localize`Months`},{value:"W",label:$localize`Weeks`},{value:"D",label:$localize`Days`}],q=["retry-delay","web-timeout","read-write-timeout","run-script-timeout","list-timeout","short-timeout"],W=class o{customId=h();inputType=h();timespan=r(0);#e="D";unit=r(this.#e);unitLabel=m(()=>{let e=this.timeOptions(),t=e.findIndex(n=>n.value===this.unit());return e[t]?.label??this.unit()});isShortTime=m(()=>{let e=this.inputType();return e&&q.includes(e.replace("--",""))});timeOptions=m(()=>this.isShortTime()?Y:H);readonly=r(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=T(()=>{this.onChange(this.getValue())});inputTypeEffect=T(()=>{let e=this.timeOptions(),t=this.isShortTime()?"s":"D";this.#e=t,this.unit.set(t)});updateUnit(e){this.unit.set(e)}writeValue(e){let t=this.isShortTime();if(e){let n=t?/(\d+)([smh])/i:/^(\d+)([YMWD])$/i,s=e.match(n);s?(this.timespan.set(parseInt(s[1],10)),this.unit.set(s[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.readonly.set(e)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=f({type:o,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[R([{provide:L,useExisting:o,multi:!0}])],ngContentSelectors:J,decls:11,vars:6,consts:()=>{let e;e=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let t;return t=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION:`,[e,t,["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(t,n){t&1&&(D(k),d(0,0,["ngProjectAs","label",5,["label"]]),p(1,"sh-form-field")(2,"input",2),$("ngModelChange",function(l){return A(n.timespan,l)||(n.timespan=l),l}),a(),d(3,1),d(4,2),a(),p(5,"sh-menu",3)(6,"button",4),c(7,0),a(),b(8,5),S(9,X,2,1,"button",6,N),P(),a()),t&2&&(i(),E("readonly",n.readonly()||void 0),i(),u("id",n.customId()),F("ngModel",n.timespan),u("disabled",n.readonly()),i(3),u("openIndicator",!0),i(2),g(n.unitLabel()),_(7),i(2),O(n.timeOptions()))},dependencies:[U,B,G,w,z,V,x,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-menu[_ngcontent-%COMP%]{grid-area:unit}[_nghost-%COMP%] sh-menu[_ngcontent-%COMP%] button.trigger[_ngcontent-%COMP%]{width:100%}'],changeDetection:0})};export{W as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as M}from"./chunk-
|
|
1
|
+
import{a as M}from"./chunk-EEXKY2IJ.js";import"./chunk-X7XIFHAV.js";import"./chunk-ZZBUNZZO.js";import"./chunk-HW7A5ZWV.js";import"./chunk-ULR2EPP5.js";import"./chunk-VXJJGZ5F.js";import"./chunk-6Q6SSTBK.js";import"./chunk-AUMCM45B.js";import"./chunk-QOQI2ALM.js";import"./chunk-QLUEDPL4.js";import"./chunk-ZQ56M63S.js";import"./chunk-E4KSSC6K.js";import"./chunk-4IAJY6E3.js";import"./chunk-P7OKMMNZ.js";import{B as D,C as N,u as E}from"./chunk-HJSCQF6V.js";import{e as m}from"./chunk-G4Z3JAJB.js";import"./chunk-53V6KV3I.js";import"./chunk-XUQ74HFK.js";import"./chunk-3ADKRLYD.js";import"./chunk-FPPZ4BUR.js";import{Ac as d,Bb as s,Cb as e,Db as n,Eb as o,Ra as c,Sb as r,Tb as l,Ub as i,bb as T}from"./chunk-Y7PHGRGB.js";import"./chunk-EUDKD2JW.js";var f=()=>["/backup/new"],O=()=>["/backup/import"],u=class p{static \u0275fac=function(t){return new(t||p)};static \u0275cmp=T({type:p,selectors:[["app-add-backup"]],decls:23,vars:4,consts:()=>{let a;a=$localize`Add a new backup`;let t;t=$localize`New backup`;let C;C=$localize`Configure a new backup. Choose your destination, source data and schedule.`;let A;A=$localize` Add a new backup ${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:`;let g;g=$localize`Import from file`;let P;P=$localize`Import backup configuration from a file. During import, you can adjust the settings.`;let S;return S=$localize` Import from file ${"\uFFFD#22\uFFFD"}:START_TAG_SH_ICON:upload-simple${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SH_ICON:`,[a,t,C,A,g,P,S,[1,"backup-types"],[1,"type-a"],["src","assets/images/new-backup.png"],["shButton","",1,"raised","primary",3,"routerLink"]]},template:function(t,C){t&1&&(o(0,"app-status-bar"),e(1,"section")(2,"h2"),i(3,0),n(),e(4,"div",7)(5,"sh-card",8),o(6,"img",9),e(7,"h3"),i(8,1),n(),e(9,"p"),i(10,2),n(),e(11,"button",10),r(12,3),o(13,"sh-icon"),l(),n()(),e(14,"sh-card",8),o(15,"img",9),e(16,"h3"),i(17,4),n(),e(18,"p"),i(19,5),n(),e(20,"button",10),r(21,6),o(22,"sh-icon"),l(),n()()()()),t&2&&(c(11),s("routerLink",d(2,f)),c(9),s("routerLink",d(3,O)))},dependencies:[M,D,N,E,m],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;align-items:center;flex-direction:column;gap:2rem;padding:2rem 0}div.backup-types[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem;max-width:43.75rem}sh-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem;padding-bottom:3rem}sh-card[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-width:18.75rem}sh-card[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{text-wrap:balance;text-align:center;width:75%}"],changeDetection:0})};export{u as default};
|