@duplicati/ngclient 0.0.221 → 0.0.225

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/chunk-2EX5HS5X.js +1 -0
  2. package/{chunk-IQL3REGJ.js → chunk-2KD757N6.js} +1 -1
  3. package/{chunk-OPHQNXYO.js → chunk-2YUSBRXY.js} +1 -1
  4. package/{chunk-F2ZC26DC.js → chunk-35FMFK4I.js} +1 -1
  5. package/{chunk-IG7XUEED.js → chunk-3DHD6GQL.js} +1 -1
  6. package/{chunk-IRT2UBDI.js → chunk-3HYQMG65.js} +1 -1
  7. package/{chunk-3L3SRTPU.js → chunk-3PARK7B7.js} +1 -1
  8. package/chunk-3V25RAVK.js +1 -0
  9. package/{chunk-ELCA5MKF.js → chunk-4ISFDBI3.js} +1 -1
  10. package/chunk-5FQ7HESA.js +1 -0
  11. package/chunk-5QGFYH2A.js +3 -0
  12. package/chunk-5UJN5SN4.js +2 -0
  13. package/{chunk-BLSV7CNZ.js → chunk-6DX35WDO.js} +1 -1
  14. package/{chunk-77IXQ4GU.js → chunk-6WX2UOAN.js} +1 -1
  15. package/{chunk-N2GI5QYJ.js → chunk-7VQ67PEZ.js} +1 -1
  16. package/{chunk-XBAZKJ47.js → chunk-A23UTI46.js} +1 -1
  17. package/chunk-AR5SEBWX.js +1 -0
  18. package/{chunk-EKVZKEQJ.js → chunk-B4QFOJXL.js} +1 -1
  19. package/{chunk-TCXCC5BM.js → chunk-BPHX6VXP.js} +1 -1
  20. package/{chunk-VKQQDCUN.js → chunk-CJKZ27FM.js} +1 -1
  21. package/{chunk-YCJYEQF7.js → chunk-COEGVUM3.js} +1 -1
  22. package/chunk-CQJRBQ6I.js +1 -0
  23. package/{chunk-736PM4LG.js → chunk-E4CYVUYG.js} +1 -1
  24. package/chunk-EBKOJDCT.js +1 -0
  25. package/chunk-EVEI25GQ.js +2 -0
  26. package/{chunk-TVFRVP7K.js → chunk-EXAZ4QZR.js} +1 -1
  27. package/chunk-G7TNRWOU.js +1 -0
  28. package/{chunk-23SRH7FI.js → chunk-GA3CAVSK.js} +1 -1
  29. package/chunk-GKAMSAN5.js +1 -0
  30. package/{chunk-JPCUISZG.js → chunk-GNKCBZMS.js} +1 -1
  31. package/{chunk-N2AU7VKX.js → chunk-HDDAGHHE.js} +1 -1
  32. package/chunk-HLHUPBCV.js +1 -0
  33. package/chunk-HPXIWKIK.js +1 -0
  34. package/chunk-HS3UDQIJ.js +1 -0
  35. package/chunk-HWOUAWOE.js +1 -0
  36. package/chunk-IDJ52K34.js +1 -0
  37. package/chunk-ITN4L52Q.js +1 -0
  38. package/chunk-J7GH3G72.js +1 -0
  39. package/chunk-JBX7YYME.js +1 -0
  40. package/chunk-JCXT6U5P.js +1 -0
  41. package/{chunk-JP2Z2HMH.js → chunk-JNZJE3GC.js} +1 -1
  42. package/chunk-K5XGRFWJ.js +4 -0
  43. package/chunk-KGK4RY3J.js +1 -0
  44. package/{chunk-DSYNIXJF.js → chunk-KNSQLQC6.js} +1 -1
  45. package/chunk-KUNX5APQ.js +1 -0
  46. package/chunk-KX3UP3HV.js +1 -0
  47. package/chunk-KZYRTI62.js +1 -0
  48. package/chunk-LXTSZI4K.js +1 -0
  49. package/chunk-MKI54WTC.js +1 -0
  50. package/chunk-MSIH2OJ5.js +1 -0
  51. package/{chunk-FDYBIC4O.js → chunk-N5XYG3QW.js} +1 -1
  52. package/{chunk-LE24LKH7.js → chunk-NE255HQN.js} +1 -1
  53. package/chunk-NQAD2FBX.js +1 -0
  54. package/chunk-NUV5LHQV.js +1 -0
  55. package/{chunk-RGFJ5UMA.js → chunk-O2HQIEE4.js} +1 -1
  56. package/chunk-O2L2FRYE.js +11 -0
  57. package/chunk-OP7MDR2B.js +1 -0
  58. package/chunk-OSGHJCUU.js +1 -0
  59. package/chunk-OYU6OBKA.js +1 -0
  60. package/{chunk-5KJPC3V5.js → chunk-P2EIEVFT.js} +1 -1
  61. package/{chunk-6JS7B4FW.js → chunk-PDZNQW6F.js} +1 -1
  62. package/{chunk-IMQUTGIK.js → chunk-PEOYNJJM.js} +1 -1
  63. package/chunk-PMF4FTBF.js +1 -0
  64. package/{chunk-CAQ3XMFP.js → chunk-PNQ5BDQN.js} +1 -1
  65. package/{chunk-ACTJSKQZ.js → chunk-PNRFCYAE.js} +1 -1
  66. package/{chunk-GW34KK5A.js → chunk-POVWDK74.js} +1 -1
  67. package/chunk-QW23XWNE.js +1 -0
  68. package/{chunk-PIGMTUUT.js → chunk-SKLSR5GH.js} +1 -1
  69. package/chunk-T7RMSUHE.js +1 -0
  70. package/chunk-TSVSMVY4.js +1 -0
  71. package/chunk-TV7OB7Y4.js +1 -0
  72. package/{chunk-QDDVZ4CR.js → chunk-TWWAK5M6.js} +1 -1
  73. package/{chunk-BKEJZADV.js → chunk-TXCVGOPN.js} +1 -1
  74. package/{chunk-F3JYPWPK.js → chunk-UIVZWXBK.js} +1 -1
  75. package/chunk-UNQKMTFM.js +1 -0
  76. package/{chunk-KZTFESBJ.js → chunk-V2M5YF4E.js} +1 -1
  77. package/{chunk-O2SMJYPC.js → chunk-V2UO7ES2.js} +1 -1
  78. package/{chunk-OLWLWDXZ.js → chunk-VOXTAZLZ.js} +1 -1
  79. package/{chunk-FD5CKX3J.js → chunk-VQLI7RDY.js} +1 -1
  80. package/chunk-VTOEFKZG.js +1 -0
  81. package/chunk-VZNLMGYP.js +2 -0
  82. package/chunk-XUCXLLB4.js +1 -0
  83. package/{chunk-GKGMP6VF.js → chunk-XWML36YQ.js} +1 -1
  84. package/chunk-Y47NRSCA.js +1 -0
  85. package/{chunk-ZC23RK4J.js → chunk-YF6JHIN5.js} +1 -1
  86. package/{chunk-ANSV4G2K.js → chunk-YS4B2B5N.js} +1 -1
  87. package/{chunk-FBU3EBFO.js → chunk-ZGQ2WCM2.js} +1 -1
  88. package/chunk-ZSAEIKEB.js +1 -0
  89. package/chunk-ZXBKGNJU.js +1 -0
  90. package/index.html +1 -1
  91. package/main-S64CL44W.js +1 -0
  92. package/package.json +1 -1
  93. package/chunk-43WATFQS.js +0 -11
  94. package/chunk-4E7D5F6K.js +0 -1
  95. package/chunk-4J6L5OV3.js +0 -1
  96. package/chunk-5JGSXUKD.js +0 -1
  97. package/chunk-5YE4H57F.js +0 -1
  98. package/chunk-5ZRRLJA4.js +0 -1
  99. package/chunk-6NVCDJR6.js +0 -1
  100. package/chunk-ACTATISC.js +0 -1
  101. package/chunk-APSPCDGV.js +0 -1
  102. package/chunk-AXQQEOTT.js +0 -1
  103. package/chunk-BMACDVWX.js +0 -1
  104. package/chunk-COI6UMB5.js +0 -1
  105. package/chunk-CZVTBPNE.js +0 -1
  106. package/chunk-DE4JIJWO.js +0 -1
  107. package/chunk-DHFLXFWF.js +0 -1
  108. package/chunk-E4NQOMJX.js +0 -1
  109. package/chunk-ESLC5LVP.js +0 -1
  110. package/chunk-F3ETZKLK.js +0 -1
  111. package/chunk-FR5RTIOE.js +0 -1
  112. package/chunk-G2BDKU26.js +0 -2
  113. package/chunk-I5DD3Q6J.js +0 -1
  114. package/chunk-JPMKWWZP.js +0 -1
  115. package/chunk-JSZIISFS.js +0 -1
  116. package/chunk-MTL3FBSM.js +0 -1
  117. package/chunk-NPFPMA4P.js +0 -1
  118. package/chunk-O56QUSSI.js +0 -2
  119. package/chunk-OCUE5GMT.js +0 -1
  120. package/chunk-OJVUCHRP.js +0 -1
  121. package/chunk-OL7ADIFI.js +0 -1
  122. package/chunk-PPSQGUOL.js +0 -3
  123. package/chunk-QQWV3FEH.js +0 -1
  124. package/chunk-RDLRXAJU.js +0 -1
  125. package/chunk-SACQFUJE.js +0 -1
  126. package/chunk-TISQKN7N.js +0 -1
  127. package/chunk-TQTOIWBK.js +0 -4
  128. package/chunk-TWAHUXIN.js +0 -1
  129. package/chunk-TZ7MW3NZ.js +0 -2
  130. package/chunk-UTXZPAY6.js +0 -1
  131. package/chunk-UZ4POLDC.js +0 -1
  132. package/chunk-WJBMMY2Y.js +0 -1
  133. package/chunk-XPVATEBM.js +0 -1
  134. package/chunk-XWTB7XRI.js +0 -1
  135. package/chunk-YMFI2Q2X.js +0 -1
  136. package/chunk-YPNN5FBK.js +0 -1
  137. package/chunk-YWBZLU6M.js +0 -1
  138. package/chunk-YYD2JU6T.js +0 -1
  139. package/chunk-ZNYN6ES6.js +0 -1
  140. package/main-IUT3IXX4.js +0 -1
@@ -0,0 +1,11 @@
1
+ import{a as $n,b as Ht,c as vn}from"./chunk-PNQ5BDQN.js";import{a as Ye,b as wt,c as Gt,d as Gn}from"./chunk-2EX5HS5X.js";import{a as On,b as Mn,c as Pe,d as Lt,e as xn,f as Rn,g as bt,i as Ln,j as bn,k as wn}from"./chunk-EVEI25GQ.js";import{b as Pn}from"./chunk-KZYRTI62.js";import{a as Rt}from"./chunk-TSVSMVY4.js";import{a as Wt,b as Ue,c as In}from"./chunk-2KD757N6.js";import{a as ne}from"./chunk-PEOYNJJM.js";import{a as ge}from"./chunk-NUV5LHQV.js";import{B as Y,C as Dn,E as At,F as yn,H as ue,K as Qe,L as It,O as Pt,P as $e,V as Ot,W as ve,Y as Mt,a as fn,b as En,c as ee,d as St,e as te,f as ft,h as hn,i as re,j as Et,k as ht,n as Fn,o as Nn,p as Ft,q as Nt,r as Dt,s as se,t as qe,v as Q,w as yt,z as Ge}from"./chunk-CJKZ27FM.js";import{c as An,d as xt}from"./chunk-KNSQLQC6.js";import{b as je,d as we,e as Sn}from"./chunk-CQJRBQ6I.js";import{aa as Tn}from"./chunk-YF6JHIN5.js";import{$ as O,$c as be,Ac as Cn,B as cn,Bb as fe,Bc as Ae,Cb as Ee,Cc as le,Db as u,Dc as me,Eb as l,Ec as Tt,F as dn,Fb as r,G as Be,Gb as P,Kb as pe,Kc as Je,Lb as ce,M as dt,Mb as ae,Nb as I,O as un,P as pn,Q as ut,Qa as pt,R as mn,Rc as R,Ta as c,Ub as M,Vb as x,W as Ne,Wb as y,Wc as Le,Xc as G,Ya as mt,Yc as Ie,Zb as Ke,_b as T,a as rn,ac as s,bc as He,cc as he,ea as S,f as ct,fa as f,hb as z,hc as De,ia as We,ic as ye,jc as Z,kc as Ct,l as Ve,lc as Fe,mb as H,oc as p,pb as gn,pc as zt,q as ot,qa as h,qc as V,rc as at,sa as q,tc as U,uc as $,vc as k,w as sn,wb as gt,wc as de,xb as g,xc as j,y as _n,yb as C,yc as E,zb as Se}from"./chunk-K5XGRFWJ.js";import{a as W,b as oe}from"./chunk-7CGTOI24.js";var $t=class i{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||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function lt(i){if(gn(i))return i();if(Array.isArray(i))return i.map(t=>lt(t));if(typeof i=="object"&&i!==null){let t={};for(let e in i)i.hasOwnProperty(e)&&(t[e]=lt(i[e]));return t}return i}var Jn=i=>i;function Un(i,t){let e=pn(i,Jn,t?.equal),n=e[rn],o=e;return o.set=a=>{let _=e();return ut(n,a),()=>{ut(n,_)}},o.update=a=>{let _=e();return mn(n,a),()=>{ut(n,_)}},e}var Ze=class i{#e=O(An);isSaving=h(!1);resourceDestinations=In({stream:()=>this.#e.getApiV2ConnectionStrings()});destinations=Un(()=>{let t=this.resourceDestinations.value()?.Data;return t||[]});save(t,e){return this.isSaving.set(!0),e.Description="",(t==="new"?this.#e.postApiV2ConnectionStrings({requestBody:e}):this.#e.putApiV2ConnectionStringById({id:t.ID,requestBody:e})).pipe(Be(()=>{this.isSaving.set(!1)}))}getById(t){return this.#e.getApiV2ConnectionStringById({id:t})}delete(t){return this.#e.deleteApiV2ConnectionStringById({id:t})}reload(){this.resourceDestinations.reload()}updateBackups(t,e){return this.#e.postApiV2ConnectionStringByIdUpdateBackups({id:t,requestBody:{BackupIDs:e}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function Xn(i,t){if(i&1){let e=I();l(0,"div",26)(1,"sh-form-field")(2,"label",27),y(3,7),r(),l(4,"input",28,0),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.nextTime.time,o)||(a.scheduleFields.nextTime.time=o),f(o)}),r(),l(6,"sh-icon",29),p(7,"clock"),r()(),l(8,"sh-datepicker-input",30)(9,"label",31),p(10,"\xA0"),r(),l(11,"input",32,1),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.nextTime.date,o)||(a.scheduleFields.nextTime.date=o),f(o)}),r(),l(13,"sh-icon",29),p(14,"calendar"),r()()(),l(15,"div",26)(16,"sh-form-field")(17,"label",33),y(18,8),r(),l(19,"input",34),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.repeatValue,o)||(a.scheduleFields.runAgain.repeatValue=o),f(o)}),r()(),l(20,"sh-select",35)(21,"input",36),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.repeatUnit,o)||(a.scheduleFields.runAgain.repeatUnit=o),f(o)}),r()()(),l(22,"sh-toggle-card",37),pe(23,38),y(24,9),ce(),l(25,"div",39)(26,"sh-toggle",24),M(27,10),l(28,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.mon,o)||(a.scheduleFields.runAgain.allowedDays.mon=o),f(o)}),r(),x(),r(),l(29,"sh-toggle",24),M(30,11),l(31,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.tue,o)||(a.scheduleFields.runAgain.allowedDays.tue=o),f(o)}),r(),x(),r(),l(32,"sh-toggle",24),M(33,12),l(34,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.wed,o)||(a.scheduleFields.runAgain.allowedDays.wed=o),f(o)}),r(),x(),r(),l(35,"sh-toggle",24),M(36,13),l(37,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.thu,o)||(a.scheduleFields.runAgain.allowedDays.thu=o),f(o)}),r(),x(),r(),l(38,"sh-toggle",24),M(39,14),l(40,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.fri,o)||(a.scheduleFields.runAgain.allowedDays.fri=o),f(o)}),r(),x(),r(),l(41,"sh-toggle",24),M(42,15),l(43,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.sat,o)||(a.scheduleFields.runAgain.allowedDays.sat=o),f(o)}),r(),x(),r(),l(44,"sh-toggle",24),M(45,16),l(46,"input",25),k("ngModelChange",function(o){S(e);let a=s(2);return $(a.scheduleFields.runAgain.allowedDays.sun,o)||(a.scheduleFields.runAgain.allowedDays.sun=o),f(o)}),r(),x(),r()()()}if(i&2){let e=s(2);c(4),U("ngModel",e.scheduleFields.nextTime.time),c(7),U("ngModel",e.scheduleFields.nextTime.date),c(8),U("ngModel",e.scheduleFields.runAgain.repeatValue),c(),u("options",e.unitOptions)("isClearable",!1),c(),U("ngModel",e.scheduleFields.runAgain.repeatUnit),c(),u("disableToggle",!0),c(6),U("ngModel",e.scheduleFields.runAgain.allowedDays.mon),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.tue),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.wed),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.thu),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.fri),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.sat),c(3),U("ngModel",e.scheduleFields.runAgain.allowedDays.sun)}}function zn(i,t){if(i&1){let e=I();l(0,"div",23)(1,"sh-toggle",24),M(2,5),l(3,"input",25),k("ngModelChange",function(o){S(e);let a=s();return $(a.scheduleFields.autoRun,o)||(a.scheduleFields.autoRun=o),f(o)}),r(),x(),r(),l(4,"p"),y(5,6),r()(),g(6,Xn,47,14)}if(i&2){let e=s();c(3),U("ngModel",e.scheduleFields.autoRun),c(3),C(e.scheduleFields.autoRun()?6:-1)}}var Wn=[{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`}],vt=[{key:$localize`Daily 13:00`,value:"daily",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Weekdays 13:00`,value:"weekdays",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!1,sun:!1}}}},{key:$localize`Weekly monday 13:00`,value:"weekly",data:{autoRun:!0,nextTime:{time:"13:00:00",date:Hn().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"W",allowedDays:{mon:!0,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}}},{key:$localize`Don't run automatically`,value:"disabled",data:{autoRun:!1,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}},{key:$localize`Custom`,value:"custom",data:{autoRun:!0,nextTime:{time:"13:00:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!0,tue:!0,wed:!0,thu:!0,fri:!0,sat:!0,sun:!0}}}}];function kn(i){if(!i.autoRun)return null;let t=[i.runAgain.allowedDays.mon?"Monday":null,i.runAgain.allowedDays.tue?"Tuesday":null,i.runAgain.allowedDays.wed?"Wednesday":null,i.runAgain.allowedDays.thu?"Thursday":null,i.runAgain.allowedDays.fri?"Friday":null,i.runAgain.allowedDays.sat?"Saturday":null,i.runAgain.allowedDays.sun?"Sunday":null].filter(_=>_!==null),e=i.nextTime.time.split(":"),n=new Date(i.nextTime.date);n.setHours(parseInt(e[0])),n.setMinutes(parseInt(e[1]));let o=i.runAgain.repeatValue,a=i.runAgain.repeatUnit;return{Time:n.toISOString(),Repeat:`${o}${a}`,AllowedDays:t}}function Hn(){let i=new Date,t=i.getDay(),e=t===1?7:(8-t)%7;return i.setDate(i.getDate()+e),i.setHours(12,0,0,0),i}var qt=()=>({autoRun:h(!0),nextTime:{time:h("13:00"),date:h(new Date().toISOString().split("T")[0])},runAgain:{repeatValue:h(1),repeatUnit:h("D"),allowedDays:{mon:h(!0),tue:h(!0),wed:h(!0),thu:h(!0),fri:h(!0),sat:h(!0),sun:h(!0)}}}),jt=class i{#e=O(Oe);#t=O(we);#n=O(je);unitOptions=Wn;scheduleFields=this.#e.scheduleFields;scheduleType=this.#e.scheduleType;scheduleOptions=vt;updateScheduleType(t){let e=vt.find(n=>n.value===t);if(e&&e?.value!=="custom"){this.scheduleType.set(e.value);let n=e.data;this.scheduleFields.autoRun.set(n.autoRun??!1),this.scheduleFields.nextTime.time.set(n.nextTime?.time??"13:00"),this.scheduleFields.nextTime.date.set(n.nextTime?.date??new Date().toISOString().split("T")[0]),this.scheduleFields.runAgain.repeatValue.set(n.runAgain?.repeatValue??1),this.scheduleFields.runAgain.repeatUnit.set(n.runAgain?.repeatUnit??"D"),this.scheduleFields.runAgain.allowedDays.mon.set(n.runAgain?.allowedDays?.mon??!0),this.scheduleFields.runAgain.allowedDays.tue.set(n.runAgain?.allowedDays?.tue??!0),this.scheduleFields.runAgain.allowedDays.wed.set(n.runAgain?.allowedDays?.wed??!0),this.scheduleFields.runAgain.allowedDays.thu.set(n.runAgain?.allowedDays?.thu??!0),this.scheduleFields.runAgain.allowedDays.fri.set(n.runAgain?.allowedDays?.fri??!0),this.scheduleFields.runAgain.allowedDays.sat.set(n.runAgain?.allowedDays?.sat??!0),this.scheduleFields.runAgain.allowedDays.sun.set(n.runAgain?.allowedDays?.sun??!0)}else this.scheduleType.set("custom")}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent})}next(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#t.navigate(["options"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-schedule"]],decls:12,vars:4,consts:()=>{let t;t=$localize`Select an option...`;let e;e=$localize`Schedule`;let n;n=$localize`${"\uFFFD#8\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#8\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#11\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let a;a=$localize` Automatically run backups ${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:TAG_INPUT:`;let _;_=$localize`If a date was missed, the job will run as soon as possible.`;let d;d=$localize`Next time`;let m;m=$localize`Run again every`;let N;N=$localize`Allowed days`;let F;F=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let A;A=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let L;L=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let D;D=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let J;return J=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],e,n,o,a,_,d,m,N,F,A,L,v,D,K,J,[1,"title-30"],["label","key","value","value",3,"isClearable","options"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","ngModel"],["suffix",""],[1,"primary","sharp"],["for","date"],["type","text","id","date",3,"ngModelChange","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,"disableToggle"],["title",""],[1,"days-wrap"]]},template:function(e,n){e&1&&(l(0,"h3",17),y(1,2),r(),l(2,"sh-select",18)(3,"input",19),T("ngModelChange",function(a){return n.updateScheduleType(a)}),r()(),g(4,zn,7,2),l(5,"div",20)(6,"button",21),T("click",function(){return n.goBack()}),M(7,3),P(8,"sh-icon"),x(),r(),l(9,"button",22),T("click",function(){return n.next()}),M(10,4),P(11,"sh-icon"),x(),r()()),e&2&&(c(2),u("isClearable",!1)("options",n.scheduleOptions),c(),u("ngModel",n.scheduleType()),c(),C(n.scheduleType()==="custom"?4:-1))},dependencies:[se,ee,ht,En,te,re,ue,ve,Q,Y,$e,Ot,yn],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:40rem;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})};var jn=[[["","title",""]],[["","description",""]],[["","action",""]],"*"],qn=["[title]","[description]","[action]","*"];function Qn(i,t){i&1&&p(0,"Title")}function Yn(i,t){i&1&&(l(0,"sh-icon"),p(1,"caret-down"),r())}var Xe=class i{isActive=be(!1);disableToggle=G(!1);ngOnInit(){this.disableToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,n){e&2&&Fe("active",n.isActive())},inputs:{isActive:[1,"isActive"],disableToggle:[1,"disableToggle"]},outputs:{isActive:"isActiveChange"},ngContentSelectors:qn,decls:11,vars:1,consts:[[1,"title"],[3,"click"],[1,"actions"],[1,"content"]],template:function(e,n){e&1&&(He(jn),l(0,"header")(1,"div",0)(2,"h3",1),T("click",function(){return n.disableToggle()||n.toggle()}),he(3,0,null,Qn,1,0),g(5,Yn,2,0,"sh-icon"),r(),he(6,1),r(),l(7,"div",2),he(8,2),r()(),l(9,"div",3),he(10,3),r()),e&2&&(c(5),C(n.disableToggle()?-1:5))},dependencies:[Q],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-2)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.25rem;font:var(--paragraph-10);cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem}header[_ngcontent-%COMP%] .title[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem;flex:1 0}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]:empty{display:none}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};var Zn=["textInput"];function ei(i,t){if(i&1){let e=I();l(0,"sh-select",3)(1,"input",7),k("ngModelChange",function(o){S(e);let a=s();return $(a.internalPath,o)||(a.internalPath=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.updateFilter())}),r()()}if(i&2){let e=s();u("options",e.fileGroupOptions())("isClearable",!1)("selectMultiple",!0),c(),U("ngModel",e.internalPath)}}function ti(i,t){if(i&1&&(l(0,"div",8),p(1),r()),i&2){let e,n=s(2);c(),zt((e=n.currentExpressionOption())==null?null:e.startsWith)}}function ni(i,t){if(i&1&&(l(0,"div",9),p(1),r()),i&2){let e,n=s(2);c(),zt((e=n.currentExpressionOption())==null?null:e.endsWith)}}function ii(i,t){if(i&1){let e=I();l(0,"sh-form-field",4)(1,"input",7,0),k("ngModelChange",function(o){S(e);let a=s();return $(a.internalPath,o)||(a.internalPath=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.updateFilter())}),r(),g(3,ti,2,1,"div",8),g(4,ni,2,1,"div",9),r()}if(i&2){let e,n,o=s();c(),U("ngModel",o.internalPath),c(2),C(!((e=o.currentExpressionOption())==null||e.startsWith==null)&&e.startsWith.length?3:-1),c(),C(!((n=o.currentExpressionOption())==null||n.endsWith==null)&&n.endsWith.length?4:-1)}}var oi=[{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"}],ai=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Includes folders where name contains",value:"+FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Includes folder",value:"+Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Includes files where name contains",value:"+FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Include 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:"Include file groups",value:"+FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Ut=class i{#e=O(We);path=G.required();osType=G();isNew=G(!1);pathChange=Le();remove=Le();internalPath=h("");pathType=h("-Expression");textInput=Ie("textInput");currentExpressionOption=R(()=>{let t=this.pathType();return this.expressionOptions().find(e=>e.value===t)});fileGroupOptions=h(oi);expressionOptions=R(()=>{let e=this.osType()==="Windows"?"\\":"/";return ai.map(n=>n.value==="-Folder"||n.value==="+Folder"?oe(W({},n),{startsWith:"",endsWith:""}):n.value==="-FolderName"||n.value==="+FolderName"?oe(W({},n),{startsWith:"*",endsWith:`*${e}`}):n.value==="-FileName"||n.value==="+FileName"?oe(W({},n),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):n.value==="-FileGroup"||n.value==="+FileGroup"?oe(W({},n),{startsWith:"{",endsWith:"}"}):n.value==="-Regex"||n.value==="+Regex"?oe(W({},n),{startsWith:"[",endsWith:"]"}):n.value==="-Extension"||n.value==="+Extension"?oe(W({},n),{startsWith:"*.",endsWith:""}):oe(W({},n),{startsWith:"",endsWith:""}))});pathEffect=q(()=>{let t=this.path(),e=t.slice(1),n=t.startsWith("-")?"-":"+",o=this.osType()==="Windows",a=o?"\\":"/";e.startsWith("%")&&e.endsWith(a)||o&&e.slice(2).startsWith(a)&&e.endsWith(a)||e.startsWith(a)&&e.endsWith(a)?(this.pathType.set(`${n}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${a}`)?(this.pathType.set(`${n}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${a}]*]`)?(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)),this.isNew()&&mt(()=>{this.focusInput()},{injector:this.#e})});focusInput(){let t=this.textInput()?.nativeElement;t&&(t.focus(),t.select())}updateFilter(){let t=this.internalPath(),e=this.currentExpressionOption();t!==""&&(t==="*"&&(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||i)};static \u0275cmp=z({type:i,selectors:[["app-new-filter"]],viewQuery:function(e,n){e&1&&De(n.textInput,Zn,5),e&2&&ye()},inputs:{path:[1,"path"],osType:[1,"osType"],isNew:[1,"isNew"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:7,vars:4,consts:()=>{let t;return t=$localize`Select an option...`,[["textInput",""],["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"],["boxPrefix",""],["boxSuffix",""]]},template:function(e,n){if(e&1&&(l(0,"sh-select",1)(1,"input",2),k("ngModelChange",function(a){return $(n.pathType,a)||(n.pathType=a),a}),T("ngModelChange",function(){return n.updateFilter()}),r()(),g(2,ei,2,4,"sh-select",3)(3,ii,5,3,"sh-form-field",4),l(4,"div",5),T("click",function(){return n.removeFilter()}),l(5,"sh-icon",6),p(6,"x-circle"),r()()),e&2){let o;u("options",n.expressionOptions())("isClearable",!1),c(),U("ngModel",n.pathType),c(),C(((o=n.currentExpressionOption())==null?null:o.value)=="-FileGroup"||((o=n.currentExpressionOption())==null?null:o.value)=="+FileGroup"?2:3)}},dependencies:[se,ee,te,re,$e,ue,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 li=["filtersContainer"],ri=()=>({updateOn:"blur",standalone:!0});function si(i,t){if(i&1){let e=I();l(0,"button",15),T("click",function(){S(e);let o=s();return f(o.addFilter())}),M(1,3),P(2,"sh-icon"),x(),r()}}function _i(i,t){i&1&&y(0,2,1)}function ci(i,t){i&1&&y(0,2,2)}function di(i,t){i&1&&(l(0,"p",13),y(1,4),r())}function ui(i,t){i&1&&(l(0,"p",13),y(1,5),r())}function pi(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"textarea",16),k("ngModelChange",function(o){S(e);let a=s();return $(a.bulkFilters,o)||(a.bulkFilters=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.saveBulkFilterEdit())}),r()()}if(i&2){let e=s();c(),U("ngModel",e.bulkFilters),u("ngModelOptions",Ae(2,ri))}}function mi(i,t){if(i&1){let e=I();l(0,"app-new-filter",18),T("pathChange",function(o){let a=S(e).$index,_=s(2);return f(_.updateFilterAt(o,a))})("remove",function(){let o=S(e).$index,a=s(2);return f(a.removeFilterAt(o))}),r()}if(i&2){let e=t.$implicit,n=t.$index,o=s(2);u("path",e)("osType",o.osType())("isNew",o.lastAddedIndex()===n)}}function gi(i,t){if(i&1&&(l(0,"div",14,0),fe(2,mi,1,3,"app-new-filter",17,Se),r()),i&2){let e=s();c(2),Ee(e.filters())}}var kt=class i{#e=O(We);filters=be.required();osType=G("");disableToggle=G(!0);bulkFilterEditMode=h(!1);bulkFilters=h("");lastAddedIndex=h(null);filtersContainer=Ie.required("filtersContainer");hasFilters=R(()=>this.filters().length>0);toggleBulkFilterEdit(){this.bulkFilterEditMode()?this.bulkFilterEditMode.set(!1):(this.bulkFilters.set(this.filters().join(`
2
+ `)),this.bulkFilterEditMode.set(!0))}saveBulkFilterEdit(){let t=this.bulkFilters().split(`
3
+ `).map(n=>n.trim()).filter(n=>n!==""&&(n.startsWith("-")||n.startsWith("+"))),e=[...new Set(t)];this.filters.set(e),this.bulkFilterEditMode.set(!1)}addFilter(){let t=this.filters(),e=t.length;this.filters.set([...t,"-*"]),this.lastAddedIndex.set(e),mt(()=>{this.scrollToFilter(e)},{injector:this.#e})}scrollToFilter(t){let e=this.filtersContainer()?.nativeElement;if(!e)return;let n=e.querySelectorAll("app-new-filter");n[t]&&n[t].scrollIntoView({behavior:"smooth",block:"nearest"})}updateFilterAt(t,e){let o=[...this.filters()];o[e]=t,this.filters.set(o),this.lastAddedIndex.set(null)}removeFilterAt(t){let n=this.filters().filter((o,a)=>a!==t);this.filters.set(n),this.lastAddedIndex.set(null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-filters"]],viewQuery:function(e,n){e&1&&De(n.filtersContainer,li,5),e&2&&ye()},inputs:{filters:[1,"filters"],osType:[1,"osType"],disableToggle:[1,"disableToggle"]},outputs:{filters:"filtersChange"},decls:20,vars:5,consts:()=>{let t;t=$localize`Filters`;let e;e=$localize`${"\uFFFD#13\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#13\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*15:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*15:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let n;n=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add filter `;let o;o=$localize`Customize your filters.`;let a;return a=$localize`Edit filters as text, one per line.`,[["filtersContainer",""],t,e,n,o,a,[3,"disableToggle"],["title",""],[1,"spacer"],["type","button","shButton","",1,"small"],["shButton","","type","button",1,"small"],["menu",""],["shButton","","type","button",1,"small",3,"click"],["description",""],[1,"filters"],["type","button","shButton","",1,"small",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[3,"path","osType","isNew"],[3,"pathChange","remove","path","osType","isNew"]]},template:function(e,n){e&1&&(l(0,"app-toggle-card",6),pe(1,7),l(2,"span"),y(3,1),r(),P(4,"div",8),g(5,si,3,0,"button",9),l(6,"sh-menu")(7,"button",10)(8,"sh-icon"),p(9,"dots-three-vertical"),r()(),pe(10,11),l(11,"button",12),T("click",function(){return n.toggleBulkFilterEdit()}),M(12,2),P(13,"sh-icon"),g(14,_i,1,0)(15,ci,1,0),x(),r(),ce(),r(),ce(),g(16,di,2,0,"p",13)(17,ui,2,0,"p",13),g(18,pi,2,3,"sh-form-field")(19,gi,4,0,"div",14),r()),e&2&&(u("disableToggle",n.disableToggle()),c(5),C(n.bulkFilterEditMode()?-1:5),c(9),C(n.bulkFilterEditMode()?14:15),c(2),C(n.bulkFilterEditMode()?17:16),c(2),C(n.bulkFilterEditMode()?18:19))},dependencies:[se,ee,te,re,Y,Q,Qe,ue,Xe,Ut],styles:["[_nghost-%COMP%]{display:block}.spacer[_ngcontent-%COMP%]{flex:1}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}.filters[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}"],changeDetection:0})};var rt=class i{data=G();closed=Le();path=h("");isValid=R(()=>this.path().length>0);dataEffect=q(()=>{let t=this.data();t?.initialPath&&this.path.set(t.initialPath)});submit(){this.closed.emit(this.path()||null)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-target-disk-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:13,vars:3,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Local disk source`;let n;n=$localize`Folder path`;let o;o=$localize`Cancel`;let a;return a=$localize` Use this source `,[e,n,o,a,[1,"title-30"],["content",""],[3,"customRemoteMode"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,3,"ngModelChange","ngModel"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"]]},template:function(e,n){e&1&&(l(0,"header")(1,"h3",4),y(2,0),r()(),l(3,"section",5)(4,"app-file-tree",6)(5,"label",7),y(6,1),r(),l(7,"input",8),k("ngModelChange",function(a){return $(n.path,a)||(n.path=a),a}),r()()(),l(8,"footer",9)(9,"button",10),T("click",function(){return n.closed.emit(null)}),y(10,2),r(),l(11,"button",11),T("click",function(){return n.submit()}),y(12,3),r()()),e&2&&(c(4),u("customRemoteMode","diskimage"),c(3),U("ngModel",n.path),c(4),u("disabled",!n.isValid()))},dependencies:[Y,Ye,se,ee,te,re],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"],changeDetection:0})};var Ci=[[["","displayName",""]],[["","description",""]],"*"],Ti=["[displayName]","[description]","*"];function Si(i,t){if(i&1&&p(0),i&2){s(2);let e=E(1);V(" ",e.Name," ")}}function fi(i,t){if(i&1&&p(0),i&2){s(2);let e=E(0);V(" ",e.displayName," ")}}function Ei(i,t){i&1&&(l(0,"sh-chip",6),p(1,"Untested"),r())}function hi(i,t){i&1&&(l(0,"sh-chip",6),p(1,"Special"),r())}function Fi(i,t){i&1&&(l(0,"sh-chip",7),p(1,"Deprecated"),r())}function Ni(i,t){if(i&1&&p(0),i&2){s();let e=E(16);V(" ",e," ")}}function Di(i,t){if(i&1&&p(0),i&2){s(2);let e=E(0);V(" ",e.description," ")}}function yi(i,t){if(i&1&&(l(0,"sh-card",0)(1,"div",1),P(2,"img",2),r(),l(3,"div",3)(4,"div",4),he(5),r(),l(6,"div",5),g(7,Si,1,1)(8,fi,1,1),g(9,Ei,2,0,"sh-chip",6)(10,hi,2,0,"sh-chip",6)(11,Fi,2,0,"sh-chip",7),r()(),l(12,"div",8)(13,"div",4),he(14,1),r(),l(15,"div",5),de(16),g(17,Ni,1,1)(18,Di,1,1),r()(),l(19,"div",9),he(20,2),r()()),i&2){let e=s(),n=E(0),o=E(1);u("variant",e.variant()),c(2),u("src",n.icon,pt),gt("alt",n.displayName),c(5),C(o&&o.Name?7:8),c(2),C((n.sortOrder??0)==-3?9:(n.sortOrder??0)==-2?10:(n.sortOrder??0)<0?11:-1),c(7);let a=j(e.getSimplePath(o==null?null:o.BaseUrl));c(),C(a&&a.length>0?17:18)}}var et=class i{destination=G();targetUrl=G();variant=G("type-b");connectionStringId=G();#e=O(Ze);connectionString=R(()=>{let t=this.connectionStringId();return t==null?null:this.#e.destinations().find(e=>e.ID===t)});selectedDestinationType=R(()=>{let t=this.targetUrl();return t?Pe(t)??null:null});destinationFromTargetUrl=R(()=>{let t=this.selectedDestinationType();return t?{key:t.customKey??t.key,customKey:t.customKey??null,displayName:t.displayName,description:t.description,icon:t.icon}:null});destinationItem=R(()=>{let t=this.destination(),e=this.destinationFromTargetUrl();return t||e||null});getSimplePath(t){return t?Mn(t):""}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-destination-list-item"]],inputs:{destination:[1,"destination"],targetUrl:[1,"targetUrl"],variant:[1,"variant"],connectionStringId:[1,"connectionStringId"]},ngContentSelectors:Ti,decls:3,vars:3,consts:[[3,"variant"],[1,"icon"],[3,"src"],[1,"name"],[1,"projected"],[1,"default"],[1,"small","simple","primary"],[1,"small","simple","warn"],[1,"description"],[1,"actions"]],template:function(e,n){if(e&1&&(He(Ci),de(0)(1),g(2,yi,21,7,"sh-card",0)),e&2){let o=j(n.destinationItem());c(),j(n.connectionString()),c(),C(o?2:-1)}},dependencies:[Dn,At],styles:['[_nghost-%COMP%]{display:block;border-radius:var(--shape-3)}[_nghost-%COMP%]:focus-visible{outline:2px solid var(--primary-8);outline-offset:2px}sh-card[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:3rem 1fr auto;grid-template-areas:"icon name actions" "icon description actions";gap:.25rem 1rem}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{grid-area:icon;display:flex;align-items:center;justify-content:center;width:3rem;height:3rem;border-radius:var(--shape-2)}sh-card[_ngcontent-%COMP%] .icon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{object-fit:contain;width:100%;border-radius:var(--shape-2);overflow:hidden}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%]{grid-area:name;font:var(--paragraph-10)}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:empty{display:none}sh-card[_ngcontent-%COMP%] .name[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:not(:empty) + .default[_ngcontent-%COMP%]{display:none}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%]{grid-area:description;color:var(--base-8)}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:empty{display:none}sh-card[_ngcontent-%COMP%] .description[_ngcontent-%COMP%] .projected[_ngcontent-%COMP%]:not(:empty) + .default[_ngcontent-%COMP%]{display:none}sh-card[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{grid-area:actions;display:flex;align-items:center;gap:.5rem}'],changeDetection:0})};var tt=class i{#e=O(ge);#t(t){return t.flatMap(e=>{if(!e?.Key)return null;let n=xn(e.Key);if(n.length<=1){let o=Lt(e.Key);return o.isDefaultEntry===!0?[oe(W({},o),{displayName:e.DisplayName||o.displayName||e.Key,description:e.Description||o.description||""})]:o}else return n}).filter(e=>e!==null)}#n(t){return t.map(e=>({key:e.customKey??e.key,customKey:e.customKey??null,displayName:e.displayName,description:e.description,icon:e.icon,searchTerms:[e.displayName,e.description,e.key,e.searchTerms??"",e.customKey??""].join(" "),sortOrder:e.sortOrder??0}))}backendDestinationOptions=R(()=>{let t=this.#e.backendModules(),e=this.#t(t);return this.#n(e)});sourceProviderOptions=R(()=>{let t=this.#e.sourceProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});restoreDestinationOptions=R(()=>{let t=this.#e.restoreDestinationProviderModules(),e=this.#t(t.length?t:this.#e.backendModules());return this.#n(e)});destinationTypeOptions=this.backendDestinationOptions;allModules=R(()=>[...this.#e.backendModules(),...this.#e.sourceProviderModules(),...this.#e.restoreDestinationProviderModules()].reduce((t,e)=>(t.find(n=>n.Key===e.Key)||t.push(e),t),[]));static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function Ai(i,t){if(i&1){let e=I();l(0,"app-destination-list-item",7),T("click",function(){let o=S(e).$implicit,a=s();return f(a.setDestination.emit(o.customKey??o.key))})("keydown.enter",function(o){return o.target.click()})("keydown.space",function(o){return o.target.click()}),l(1,"button",8),M(2,1),P(3,"sh-icon"),x(),r()()}if(i&2){let e=t.$implicit;u("destination",e)}}var Vt=class i{#e=O(tt);#t=O(ge);showAsSources=G(!1);moduleType=G("Backend");setDestination=Le();destinationSearchTerm=h("");showAllDestinations=h(!1);destinationTypeOptions=R(()=>{switch(this.moduleType()){case"SourceProvider":return this.#e.sourceProviderOptions();case"RestoreDestinationProvider":return this.#e.restoreDestinationOptions();default:return this.#e.backendDestinationOptions()}});destinationTypeOptionsFocused=R(()=>{let t=this.#t.backendModules(),e=this.destinationTypeOptions().map(_=>{let d=t.find(m=>m.Key==_.key);return d&&(_=oe(W({},_),{sortOrder:d.IsDeprecated?-1:d.IsUntested?-3:_.sortOrder})),_}),n=this.destinationSearchTerm().toLowerCase(),o=this.showAllDestinations(),a=[...e].sort((_,d)=>{let m=_.sortOrder??0,N=d.sortOrder??0;return m!==N?N-m:_.displayName.localeCompare(d.displayName)}).filter(_=>{if(o)return!0;let d=_.sortOrder??0;return d<0&&n?.length&&(_.key.toLocaleLowerCase()===n.toLocaleLowerCase()||_.customKey?.toLocaleLowerCase()===n.toLocaleLowerCase())?!0:d>=0});return n?a.filter(_=>_.searchTerms.toLowerCase().includes(n)):a});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-destination-list"]],inputs:{showAsSources:[1,"showAsSources"],moduleType:[1,"moduleType"]},outputs:{setDestination:"setDestination"},decls:8,vars:2,consts:()=>{let t;t=$localize`Search for destination...`;let e;e=$localize`Show all`;let n;return n=$localize` Choose ${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON:`,[e,n,[1,"search-area"],["type","text","placeholder",t,3,"ngModelChange","ngModel"],[1,"raised","primary",3,"checkedChange","checked"],[1,"list"],["tabindex","0",3,"destination"],["tabindex","0",3,"click","keydown.enter","keydown.space","destination"],["shButton","","tabindex","-1","type","button"]]},template:function(e,n){e&1&&(l(0,"div",2)(1,"sh-form-field")(2,"input",3),k("ngModelChange",function(a){return $(n.destinationSearchTerm,a)||(n.destinationSearchTerm=a),a}),r()(),l(3,"sh-toggle",4),k("checkedChange",function(a){return $(n.showAllDestinations,a)||(n.showAllDestinations=a),a}),y(4,0),r()(),l(5,"div",5),fe(6,Ai,4,1,"app-destination-list-item",6,Se),r()),e&2&&(c(2),U("ngModel",n.destinationSearchTerm),c(),U("checked",n.showAllDestinations),c(3),Ee(n.destinationTypeOptionsFocused()))},dependencies:[et,se,ee,te,re,ue,Y,Q,ve],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:hidden;padding:.25rem;min-height:250px}.list[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;height:100%;overflow:auto;padding:.25rem .375rem 1rem;width:calc(100% + .5rem);margin-left:-.375rem;border-bottom:.0625rem solid var(--base-4)}.search-area[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:1rem}"],changeDetection:0})};var Ii=["fileInput"],Pi=[[["label"]]],Oi=["label"],Bt=class i{customId=G();content=h("");readonly=h(!1);placeholder=G($localize`Drop a file here or use the browse button`);fileInputRef=Ie("fileInput");onFileSelected(t){let e=t.target;e.files&&e.files.length>0&&this.readFile(e.files[0])}onFileDrop(t){t.preventDefault(),t.dataTransfer?.files&&t.dataTransfer.files.length>0&&this.readFile(t.dataTransfer.files[0])}onDragOver(t){t.preventDefault()}readFile(t){let e=new FileReader;e.onload=()=>{this.content.set(e.result)},e.readAsText(t)}triggerBrowse(){return this.fileInputRef()?.nativeElement.click(),!1}onChange=()=>{};onTouched=()=>{};onChangeEffect=q(()=>{this.onChange(this.content())});writeValue(t){this.content.set(t??"")}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}setDisabledState(t){this.readonly.set(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-file-drop-textarea"]],viewQuery:function(e,n){e&1&&De(n.fileInputRef,Ii,5),e&2&&ye()},inputs:{customId:[1,"customId"],placeholder:[1,"placeholder"]},features:[Cn([{provide:fn,useExisting:i,multi:!0}])],ngContentSelectors:Oi,decls:9,vars:3,consts:[["fileInput",""],[1,"browse-btn"],["shButton","","type","button",1,"small","outlined",3,"click"],[1,"textarea-container","textarea-wrap",3,"drop","dragover"],["rows","10",3,"ngModelChange","placeholder","ngModel","disabled"],["type","file",1,"hidden",3,"change"]],template:function(e,n){if(e&1){let o=I();He(Pi),he(0,0,["ngProjectAs","label",5,["label"]]),l(1,"div",1)(2,"button",2),T("click",function(){return n.triggerBrowse()}),l(3,"sh-icon"),p(4,"upload"),r()()(),l(5,"div",3),T("drop",function(_){return n.onFileDrop(_)})("dragover",function(_){return n.onDragOver(_)}),l(6,"textarea",4),k("ngModelChange",function(_){return S(o),$(n.content,_)||(n.content=_),f(_)}),r()(),l(7,"input",5,0),T("change",function(_){return n.onFileSelected(_)}),r()}e&2&&(c(6),u("placeholder",n.placeholder()),U("ngModel",n.content),u("disabled",n.readonly()))},dependencies:[se,ee,te,re,Q,Y],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label browsebtn" "input input";grid-template-columns:8fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .browse-btn[_ngcontent-%COMP%]{grid-area:browsebtn}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%]{grid-area:input;width:100%;border:none;font:var(--code-20)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%]{width:100%;color:var(--base-8);background-color:var(--base-1);border:1px solid var(--base-4);border-radius:var(--shape-3);padding:.5rem;resize:vertical;box-shadow:var(--box-shadow-10)}[_nghost-%COMP%] .textarea-wrap[_ngcontent-%COMP%] textarea[_ngcontent-%COMP%] .dark[_ngcontent-%COMP%]{background-color:var(--base-2)}[_nghost-%COMP%] .hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var Mi=(i,t,e,n)=>({index:i,fieldGroup:"custom",formView:t,destinationType:e,oauthField:n}),_e=i=>({$implicit:i}),xi=(i,t,e,n)=>({index:i,fieldGroup:"dynamic",formView:t,destinationType:e,oauthField:n}),Ri=()=>({updateOn:"blur"}),Li=(i,t,e,n)=>({index:i,formView:t,fieldGroup:"advanced",destinationType:e,oauthField:n}),Te=(i,t)=>({fieldGroup:i,formView:t}),bi=()=>["/connect/logon"];function wi(i,t){i&1&&ae(0)}function Gi(i,t){if(i&1&&H(0,wi,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s();let o=Z(15);s();let a=E(0),_=E(1);u("ngTemplateOutlet",o)("ngTemplateOutletContext",le(7,_e,Tt(2,Mi,n,e,a,_.oauthField)))}}function $i(i,t){i&1&&ae(0)}function vi(i,t){if(i&1&&H(0,$i,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s();let o=Z(15);s();let a=E(0),_=E(1);u("ngTemplateOutlet",o)("ngTemplateOutletContext",le(7,_e,Tt(2,xi,n,e,a,_.oauthField)))}}function Ui(i,t){if(i&1){let e=I();l(0,"button",26),T("click",function(){S(e);let o=s(2);return f(o.showTextArea.set(!1))}),M(1,8),P(2,"sh-icon"),x(),r()}}function ki(i,t){if(i&1){let e=I();l(0,"button",33,2),T("click",function(){let o=S(e).$implicit,a=s(3);return f(a.addAdvancedOption(o))}),p(2),r()}if(i&2){let e=t.$implicit;c(2),V(" ",e.name," ")}}function Vi(i,t){if(i&1){let e=I();l(0,"div",23)(1,"sh-menu",27)(2,"button",28),M(3,9),P(4,"sh-icon"),x(),r(),pe(5,29),fe(6,ki,3,1,"button",30,Se),ce(),r(),l(8,"sh-menu")(9,"button",31)(10,"sh-icon"),p(11,"dots-three-vertical"),r()(),pe(12,29),l(13,"button",32),T("click",function(){S(e);let o=s(2);return f(o.showTextArea.set(!0))}),l(14,"sh-icon"),p(15,"link"),r(),p(16," Edit contents as text "),r(),ce(),r()()}if(i&2){s();let e=E(9);c(),u("searchable",!0),c(),u("disabled",e.length===0),c(4),Ee(e)}}function Bi(i,t){if(i&1){let e=I();l(0,"textarea",34),T("ngModelChange",function(o){S(e);let a=s(2);return f(a.updateSettingsFromText(o))}),r()}if(i&2){let e=s(2);u("ngModel",e.settingsAsText())("ngModelOptions",Ae(2,Ri))}}function Ki(i,t){i&1&&ae(0)}function Ji(i,t){if(i&1&&H(0,Ki,1,0,"ng-container",25),i&2){let e=t.$implicit,n=t.$index;s(2);let o=Z(15),a=s(),_=E(0),d=E(1),m=a.getFormView("advanced",e)??a.getDefaultFormView(e);u("ngTemplateOutlet",o)("ngTemplateOutletContext",le(7,_e,Tt(2,Li,n,m,_,d.oauthField)))}}function Xi(i,t){if(i&1&&fe(0,Ji,1,9,"ng-container",null,Se),i&2){let e=s(2);Ee(e.advancedFormFieldNames())}}function zi(i,t){i&1&&(l(0,"sup",43),p(1,"*"),r())}function Wi(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Hi(i,t){if(i&1){let e=I();l(0,"app-file-tree",36)(1,"label",42),g(2,zi,2,0,"sup",43),p(3),g(4,Wi,2,1,"sh-icon",44),r(),l(5,"input",45),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),_=E(4),d=E(5);u("startingPath",a)("accepts",e.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0)("resolvePaths",!0),c(),u("for",d),c(),C(e.formView.isMandatory&&_?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("id",d)("ngModel",o)}}function ji(i,t){i&1&&(l(0,"sup",46),p(1,"*"),r())}function qi(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Qi(i,t){if(i&1){let e=I();l(0,"app-file-tree",37)(1,"label",42),g(2,ji,2,0,"sup",46),p(3),g(4,qi,2,1,"sh-icon",44),r(),l(5,"input",45),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),_=E(4),d=E(5);u("hideShortcuts",!0)("enableCreateFolder",!0)("startingPath",a)("resolvePaths",!0),c(),u("for",d),c(),C(e.formView.isMandatory&&_?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("id",d)("ngModel",o)}}function Yi(i,t){i&1&&(l(0,"sup",47),p(1,"*"),r())}function Zi(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function eo(i,t){i&1&&(l(0,"sh-icon",48),p(1," warning "),r())}function to(i,t){i&1&&ae(0)}function no(i,t){if(i&1&&(l(0,"sh-icon",52),p(1," link "),r()),i&2){s();let e=E(8),n=E(9);Fe("error",e&&n==="error")("warn",e&&n==="warning"),u("shTooltip",e)}}function io(i,t){i&1&&(l(0,"sh-icon",51),p(1,"envelope"),r())}function oo(i,t){i&1&&(l(0,"sh-icon",51),p(1,"hard-drives"),r())}function ao(i,t){i&1&&(l(0,"sh-icon",51),p(1,"jar"),r())}function lo(i,t){i&1&&(l(0,"sh-icon",51),p(1,"textbox"),r())}function ro(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,Yi,2,0,"sup",47),p(3),g(4,Zi,2,1,"sh-icon",44),g(5,eo,2,0,"sh-icon",48),H(6,to,1,0,"ng-container",25),r(),l(7,"input",49),T("keydown",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.onKeyDown(a.fieldGroup,a.formView.name,a.formView.type,o))})("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),de(8)(9),g(10,no,2,5,"sh-icon",50)(11,io,2,0,"sh-icon",51)(12,oo,2,0,"sh-icon",51)(13,ao,2,0,"sh-icon",51)(14,lo,2,0,"sh-icon",51),r()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(3),_=E(4),d=E(5);s();let m=Z(17);c(),u("for",d),c(),C(e.formView.isMandatory&&_?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),C(_&&e.formView.type==="Path"?5:-1),c(),u("ngTemplateOutlet",m)("ngTemplateOutletContext",le(16,_e,me(13,Te,e.fieldGroup,e.formView))),c(),u("type",e.formView.type==="Email"?"email":"text")("id",d)("ngModel",o);let N=a,F=s().hasLeadingSlash(N??"");c(),j(F&&(e.formView.doubleSlash==null?null:e.formView.doubleSlash.message)),c(),j(e.formView.doubleSlash==null?null:e.formView.doubleSlash.type),c(),C(e.formView.type==="Path"?10:e.formView.type==="Email"?11:e.formView.type==="Hostname"?12:e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?13:14)}}function so(i,t){i&1&&(l(0,"sup",53),p(1,"*"),r())}function _o(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function co(i,t){i&1&&ae(0)}function uo(i,t){if(i&1){let e=I();l(0,"span",57),T("click",function(){S(e);let o=s(2).$implicit,a=s(2);return f(a.oauthStartTokenCreation(o.destinationType,o.fieldGroup,o.formView.name,o.formView.oauthVersion))}),p(1," AuthID "),r()}}function po(i,t){i&1&&(l(0,"sh-icon",51),p(1,"password"),r())}function mo(i,t){if(i&1){let e=I();l(0,"sh-icon",58),T("click",function(){S(e);let o=s(2).$implicit;return f(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye "),r()}}function go(i,t){if(i&1){let e=I();l(0,"sh-icon",58),T("click",function(){S(e);let o=s(2).$implicit;return f(o.formView.showPassword=!o.formView.showPassword)}),p(1," eye-slash "),r()}}function Co(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,so,2,0,"sup",53),p(3),g(4,_o,2,1,"sh-icon",44),H(5,co,1,0,"ng-container",25),r(),l(6,"input",54),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),g(7,uo,2,0,"span",55)(8,po,2,0,"sh-icon",51),g(9,mo,2,0,"sh-icon",56)(10,go,2,0,"sh-icon",56),r()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17);c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(14,_e,me(11,Te,e.fieldGroup,e.formView))),c(),u("type",e.formView.showPassword?"text":"password")("id",_)("ngModel",o),c(),C(e.oauthField===e.formView.name?7:8),c(2),C(e.formView.showPassword?9:10)}}function To(i,t){i&1&&(l(0,"sup",60),p(1,"*"),r())}function So(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function fo(i,t){i&1&&ae(0)}function Eo(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function ho(i,t){if(i&1){let e=I();l(0,"sh-select",59)(1,"label",42),g(2,To,2,0,"sup",60),p(3),g(4,So,2,1,"sh-icon",44),H(5,fo,1,0,"ng-container",25),r(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Eo,1,2,"ng-template",null,3,Je)}if(i&2){let e=Z(8);s();let n=E(0),o=s().$implicit,a=E(1),_=E(2),d=E(4),m=E(5);s();let N=Z(17);u("options",n)("isClearable",!1)("optionTemplate",e),c(),u("for",m),c(),C(o.formView.isMandatory&&d?2:-1),c(),V(" ",a," "),c(),C(o.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",le(14,_e,me(11,Te,o.fieldGroup,o.formView))),c(),u("id",m)("ngModel",_)}}function Fo(i,t){if(i&1&&(de(0),g(1,ho,9,16)),i&2){let e=s().$implicit,n=j(s(2).mapOptions(e.formView));c(),C(n?1:-1)}}function No(i,t){i&1&&(l(0,"sup",63),p(1,"*"),r())}function Do(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function yo(i,t){i&1&&ae(0)}function Ao(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Io(i,t){if(i&1){let e=I();l(0,"sh-select",62)(1,"label",42),g(2,No,2,0,"sup",63),p(3),g(4,Do,2,1,"sh-icon",44),H(5,yo,1,0,"ng-container",25),r(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Ao,1,2,"ng-template",null,4,Je)}if(i&2){let e=Z(8);s();let n=E(0),o=s().$implicit,a=E(1),_=E(2),d=E(4),m=E(5);s();let N=Z(17);u("options",n)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",e),c(),u("for",m),c(),C(o.formView.isMandatory&&d?2:-1),c(),V(" ",a," "),c(),C(o.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",le(15,_e,me(12,Te,o.fieldGroup,o.formView))),c(),u("id",m)("ngModel",_)}}function Po(i,t){i&1&&P(0,"sh-progress-bar",61)}function Oo(i,t){if(i&1&&(de(0),g(1,Io,9,17)(2,Po,1,0,"sh-progress-bar",61)),i&2){let e=s().$implicit,n=E(2),o=j(s(2).mapOptionsWithFreeText(e.formView,n));c(),C(o?1:2)}}function Mo(i,t){i&1&&(l(0,"sup",65),p(1,"*"),r())}function xo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Ro(i,t){i&1&&ae(0)}function Lo(i,t){if(i&1){let e=I();l(0,"app-size",64),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",42),g(2,Mo,2,0,"sup",65),p(3),g(4,xo,2,1,"sh-icon",44),H(5,Ro,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17);u("inputType",e.Name)("ngModel",o)("customId",_),c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(12,_e,me(9,Te,e.fieldGroup,e.formView)))}}function bo(i,t){i&1&&(l(0,"sup",66),p(1,"*"),r())}function wo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Go(i,t){i&1&&ae(0)}function $o(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,bo,2,0,"sup",66),p(3),g(4,wo,2,1,"sh-icon",44),H(5,Go,1,0,"ng-container",25),r(),l(6,"input",67),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",51),p(8,"numpad"),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17);c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(11,_e,me(8,Te,e.fieldGroup,e.formView))),c(),u("id",_)("ngModel",o)}}function vo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Uo(i,t){i&1&&ae(0)}function ko(i,t){if(i&1){let e=I();l(0,"sh-toggle",39)(1,"label",42),p(2),g(3,vo,2,1,"sh-icon",44),H(4,Uo,1,0,"ng-container",25),r(),l(5,"input",68),T("change",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o.target.checked?"true":"false"))}),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(5);s();let _=Z(17),d=s();c(),u("for",a),c(),V(" ",n," "),c(),C(e.formView.longDescription?3:-1),c(),u("ngTemplateOutlet",_)("ngTemplateOutletContext",le(9,_e,me(6,Te,e.fieldGroup,e.formView))),c(),u("checked",d.isTrue(o))}}function Vo(i,t){i&1&&(l(0,"sup",70),p(1,"*"),r())}function Bo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function Ko(i,t){i&1&&ae(0)}function Jo(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function Xo(i,t){if(i&1){let e=I();l(0,"sh-select",69)(1,"label",42),g(2,Vo,2,0,"sup",70),p(3),g(4,Bo,2,1,"sh-icon",44),H(5,Ko,1,0,"ng-container",25),r(),l(6,"input",71),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,Jo,1,2,"ng-template",null,5,Je)}if(i&2){let e=Z(8);s();let n=E(0),o=s().$implicit,a=E(1),_=E(2),d=E(4),m=E(5);s();let N=Z(17);u("options",n)("selectMultiple",!0)("optionTemplate",e),c(),u("for",m),c(),C(o.formView.isMandatory&&d?2:-1),c(),V(" ",a," "),c(),C(o.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",N)("ngTemplateOutletContext",le(13,_e,me(10,Te,o.fieldGroup,o.formView))),c(),u("ngModel",_)}}function zo(i,t){if(i&1&&(de(0),g(1,Xo,9,15)),i&2){let e=s().$implicit,n=j(s(2).mapOptions(e.formView));c(),C(n?1:-1)}}function Wo(i,t){i&1&&(l(0,"sup",72),p(1,"*"),r())}function Ho(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function jo(i,t){i&1&&ae(0)}function qo(i,t){if(i&1){let e=I();l(0,"app-timespan",64),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label",42),g(2,Wo,2,0,"sup",72),p(3),g(4,Ho,2,1,"sh-icon",44),H(5,jo,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17);u("inputType",e.formView.name)("ngModel",o)("customId",_),c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(12,_e,me(9,Te,e.fieldGroup,e.formView)))}}function Qo(i,t){i&1&&(l(0,"sup",74),p(1,"*"),r())}function Yo(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(2).$implicit;u("shTooltip",e.formView.longDescription)}}function Zo(i,t){i&1&&ae(0)}function ea(i,t){if(i&1){let e=I();l(0,"app-file-drop-textarea",73),T("ngModelChange",function(o){S(e);let a=s().$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),l(1,"label"),g(2,Qo,2,0,"sup",74),p(3),g(4,Yo,2,1,"sh-icon",44),H(5,Zo,1,0,"ng-container",25),r()()}if(i&2){let e=s().$implicit,n=E(2),o=E(4),a=E(5);s();let _=Z(17);u("ngModel",n)("customId",a)("placeholder",e.formView.longDescription),c(2),C(e.formView.isMandatory&&o?2:-1),c(),V(" ",e.formView.shortDescription??e.formView.name," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",_)("ngTemplateOutletContext",le(11,_e,me(8,Te,e.fieldGroup,e.formView)))}}function ta(i,t){i&1&&(P(0,"sh-spinner"),l(1,"span"),y(2,10),r()),i&2&&Ct("--spinner-size","16px")("--spinner-thickness","2px")}function na(i,t){if(i&1){let e=I();l(0,"div",77)(1,"span"),y(2,11),r(),l(3,"button",32),T("click",function(){S(e);let o=s(6);return f(o.reloadTrigger.set(!o.reloadTrigger()))}),y(4,12),r()()}}function ia(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;at(" ",e.key," ",e.value&&e.value!=e.key?"("+e.value+")":""," ")}}function oa(i,t){if(i&1){let e=I();l(0,"sh-select",78)(1,"label",42)(2,"sup",79),p(3,"*"),r(),l(4,"span"),y(5,13),r()(),l(6,"input",45),T("ngModelChange",function(o){S(e);let a=s(4).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r()(),H(7,ia,1,2,"ng-template",null,6,Je)}if(i&2){s(4);let e=E(2),n=E(5),o=s(2);u("options",o.restoreBackupIdOptions())("isClearable",!1),c(),u("for",n),c(5),u("id",n)("ngModel",e)}}function aa(i,t){if(i&1&&g(0,ta,3,4)(1,na,5,0,"div",77)(2,oa,9,5),i&2){let e=s(5);C(e.isLoadingRestoreBackupIdOptions()?0:e.restoreBackupIdOptions().length==0?1:2)}}function la(i,t){i&1&&(l(0,"sup",80),p(1,"*"),r())}function ra(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(4).$implicit;u("shTooltip",e.formView.longDescription)}}function sa(i,t){i&1&&ae(0)}function _a(i,t){if(i&1){let e=I();l(0,"button",82),T("click",function(){S(e),s(4);let o=E(5),a=s(2);return f(a.toggleDisabled(o))}),M(1,14),P(2,"sh-icon"),x(),r()}}function ca(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"label",42),g(2,la,2,0,"sup",80),p(3),g(4,ra,2,1,"sh-icon",44),H(5,sa,1,0,"ng-container",25),r(),l(6,"input",81),T("ngModelChange",function(o){S(e);let a=s(3).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(7,"sh-icon",51),p(8,"textbox"),r()(),g(9,_a,3,0,"button",41)}if(i&2){let e=s(3).$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17),m=s();c(),u("for",_),c(),C(e.formView.isMandatory&&a?2:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?4:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(15,_e,me(12,Te,e.fieldGroup,e.formView))),c(),u("type","text")("id",_)("ngModel",o)("placeholder",e.formView.longDescription)("disabled",!0),c(3),C(m.getIsDisabled(_)?9:-1)}}function da(i,t){if(i&1&&(l(0,"div",75),g(1,aa,3,1)(2,ca,10,17),r()),i&2){let e=s(4);c(),C(e.isRestoreFlow()?1:2)}}function ua(i,t){if(i&1){let e=I();l(0,"div",83),M(1,15),P(2,"div")(3,"div"),x(),r(),l(4,"button",82),T("click",function(){S(e);let o=s(5);return f(o.openConsole())}),M(5,16),P(6,"sh-icon"),x(),r()}}function pa(i,t){i&1&&(l(0,"div",83),y(1,17),r(),l(2,"button",84),M(3,18),P(4,"sh-icon"),x(),r()),i&2&&(c(2),u("routerLink",Ae(1,bi)))}function ma(i,t){if(i&1&&(l(0,"div",76),g(1,ua,7,0)(2,pa,5,2),r()),i&2){let e=s(4);c(),C(e.isConnectedToConsole()?1:2)}}function ga(i,t){if(i&1&&g(0,da,3,1,"div",75)(1,ma,3,1,"div",76),i&2){let e=s(3);C(e.isConnectedToConsole()&&e.hasStorageApiKey()?0:1)}}function Ca(i,t){i&1&&(l(0,"sup",86),p(1,"*"),r())}function Ta(i,t){if(i&1&&(l(0,"sh-icon",44),p(1,"question"),r()),i&2){let e=s(3).$implicit;u("shTooltip",e.formView.longDescription)}}function Sa(i,t){i&1&&ae(0)}function fa(i,t){if(i&1){let e=I();l(0,"div",85)(1,"sh-form-field")(2,"label",42),g(3,Ca,2,0,"sup",86),p(4),g(5,Ta,2,1,"sh-icon",44),H(6,Sa,1,0,"ng-container",25),r(),l(7,"input",87),T("ngModelChange",function(o){S(e);let a=s(2).$implicit,_=s(2);return f(_.updateFieldValue(a.fieldGroup,a.formView.name,o))}),r(),l(8,"sh-icon",51),p(9,"textbox"),r()(),l(10,"button",88),T("click",function(){S(e);let o=s(4);return f(o.authenticateFilen())}),M(11,19),P(12,"sh-icon"),x(),r()()}if(i&2){let e=s(2).$implicit,n=E(1),o=E(2),a=E(4),_=E(5);s();let d=Z(17),m=s();c(2),u("for",_),c(),C(e.formView.isMandatory&&a?3:-1),c(),V(" ",n," "),c(),C(e.formView.longDescription?5:-1),c(),u("ngTemplateOutlet",d)("ngTemplateOutletContext",le(12,_e,me(9,Te,e.fieldGroup,e.formView))),c(),u("id",_)("ngModel",o),c(3),u("disabled",m.isAuthenticatingFilen())}}function Ea(i,t){if(i&1&&g(0,fa,13,14,"div",85),i&2){let e=s(3);C(e.hasFilenApiKey()?-1:0)}}function ha(i,t){if(i&1){let e=I();l(0,"button",82),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.removeAdvancedOption(o.formView.name))}),l(1,"sh-icon"),p(2,"x-circle"),r()()}}function Fa(i,t){if(i&1&&(l(0,"div",35),de(1)(2)(3)(4)(5),g(6,Hi,6,13,"app-file-tree",36)(7,Qi,6,10,"app-file-tree",37)(8,ro,15,18,"sh-form-field")(9,Co,11,16,"sh-form-field")(10,Fo,2,2)(11,Oo,3,2)(12,Lo,6,14,"app-size",38)(13,$o,9,13,"sh-form-field")(14,ko,6,11,"sh-toggle",39)(15,zo,2,2)(16,qo,6,14,"app-timespan",38)(17,ea,6,13,"app-file-drop-textarea",40)(18,ga,2,1)(19,Ea,1,1),g(20,ha,3,0,"button",41),r()),i&2){let e=t.$implicit;s();let n=E(0),o=s();Fe("single-field",e.fieldGroup!=="advanced"),c(),j(e.formView.shortDescription??e.formView.name),c(),j(o.getFieldGroup(n,e.fieldGroup)[e.formView.name]),c();let a=j(o.getFieldValue(e.fieldGroup,e.formView.name));c(),j((a??"").toString().trim()===""),c(),j("destination-"+e.fieldGroup+"-"+e.index+"-"+(e.asHttpOptions?"http":"other")),c(),C(e.formView.type==="FileTree"?6:e.formView.type==="FolderTree"?7:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"||e.formView.type==="Hostname"||e.formView.type==="Bucketname"||e.formView.type==="BucketnameB2"?8:e.formView.type==="Password"?9:e.formView.type==="Enumeration"?10:e.formView.type==="NonValidatedSelectableString"?11:e.formView.type==="Size"?12:e.formView.type==="Integer"?13:e.formView.type==="Boolean"?14:e.formView.type==="Flags"?15:e.formView.type==="Timespan"||e.formView.type==="DateTime"?16:e.formView.type==="FreeText"?17:e.formView.type==="DuplicatiBackupId"?18:e.formView.type==="Filen2FACode"?19:-1),c(14),C(e.fieldGroup==="advanced"?20:-1)}}function Na(i,t){if(i&1&&(l(0,"sh-icon",89),p(1,"x-circle"),r()),i&2){s();let e=E(0);u("shTooltip",(e==null?null:e.message)??"Invalid value")}}function Da(i,t){if(i&1&&(l(0,"sh-icon",90),p(1,"warning"),r()),i&2){s();let e=E(0);u("shTooltip",(e==null?null:e.message)??"Invalid value")}}function ya(i,t){if(i&1&&(de(0),g(1,Na,2,1,"sh-icon",89)(2,Da,2,1,"sh-icon",90)),i&2){let e=s().$implicit,n=E(0),o=j(e.formView.validate(n));c(),C((o==null?null:o.type)==="error"?1:(o==null?null:o.type)==="warning"?2:-1)}}function Aa(i,t){if(i&1&&(de(0),g(1,ya,3,2)),i&2){let e=t.$implicit,o=(j(s(2).getFieldValue(e.fieldGroup,e.formView.name))??"").toString().trim()==="";c(),C(!o&&e.formView.validate?1:-1)}}function Ia(i,t){if(i&1&&(de(0),fe(1,Gi,1,9,"ng-container",null,Se),fe(3,vi,1,9,"ng-container",null,Se),l(5,"sh-toggle-card",20),pe(6,21)(7),y(8,7),ce(),de(9),g(10,Ui,3,0,"button",22)(11,Vi,17,2,"div",23),ce(),g(12,Bi,1,3,"textarea",24)(13,Xi,2,0),r(),H(14,Fa,21,9,"ng-template",null,0,Je)(16,Aa,2,2,"ng-template",null,1,Je)),i&2){let e=s(),n=E(1);j(e.destinationForm()),c(),Ee(n.custom),c(2),Ee(n.dynamic),c(2),u("disableToggle",!0),c(4),j(e.nonSelectedAdvancedFormViews()),c(),C(e.showTextArea()?10:11),c(2),C(e.showTextArea()?12:13)}}var Kt=class i{#e=O(Oe);#t=O(ge);#n=O(Rt);#i=O(tt);#o=O(Pn);#s=O(On);#a=O(Ge);injector=O(We);targetUrl=be.required();useBackupState=G(!1);#l=null;destinationType=R(()=>{let t=this.targetUrl();if(!t)return null;let e=Pe(t);return this.#l=e?.customKey??e?.key,this.#l});refreshView=h(!1);destinationForm=h({custom:{},dynamic:{},advanced:{}});advancedFormFieldNames=R(()=>Object.keys(this.destinationForm().advanced??{}));destinationFormConfig=h(null);showTextArea=h(!1);isLoadingRestoreBackupIdOptions=h(!1);isRestoreFlow=R(()=>!this.useBackupState());reloadTrigger=h(!1);hasLoadedBackupIdOptions=h(!1);restoreBackupIdOptions=Ue(_n(Wt(this.targetUrl).pipe(dn(),ot(t=>({url:t,isReload:!1}))),Wt(this.reloadTrigger).pipe(ot(()=>({url:this.targetUrl(),isReload:!0})))).pipe(dt(({url:t,isReload:e})=>t&&t.startsWith("duplicati://")&&this.hasStorageApiKey()&&this.isRestoreFlow()&&(e||!this.hasLoadedBackupIdOptions())?(this.hasLoadedBackupIdOptions.set(!0),this.isLoadingRestoreBackupIdOptions.set(!0),this.#s.getDuplicatiStorageBackups(t).pipe(cn(a=>(console.error("Error loading Duplicati storage backups",a),Ve([]))),Be(()=>this.isLoadingRestoreBackupIdOptions.set(!1)))):Ve([]))),{initialValue:[]});isConnectedToConsole=R(()=>this.#o.state()==="connected");hasStorageApiKey=R(()=>{let t=this.destinationForm();return(this.#n.serverSettings()?.["remote-control-storage-api-id"]??"").length>0||t.advanced["duplicati-auth-apiid"]});isAuthenticatingFilen=h(!1);hasFilenApiKey=R(()=>{let e=this.destinationForm().advanced["api-key"];return e&&e.length>0});nonSelectedAdvancedFormViews=R(()=>{let t=this.destinationFormConfig();if(!t)return[];let e=this.advancedFormFieldNames();return t.advanced.filter(n=>e.findIndex(o=>o===n.name)===-1)});destinationTypeEffect=q(()=>{let t=this.targetUrl(),e=Pe(t??""),n=e.key,o=e.customKey??n,a=this.#i.allModules().find(v=>v.Key===n)??{Key:n,DisplayName:e.displayName,Description:e.description,Options:[]};if(!a||!a.Options||!n)return;let _=e&&e.oauthField?e.oauthField:null,d=e&&e.customFields?e.customFields:{},m=e&&e.dynamicFields?e.dynamicFields:[],N=e&&e.advancedFields?e.advancedFields:[],F=e&&e.ignoredAdvancedFields?e.ignoredAdvancedFields:[],A={destinationType:o,oauthField:_,custom:[],dynamic:[],advanced:[]};d&&Object.entries(d).forEach(([v,D],K)=>{let J=D.order??K,b=D.validate;!b&&D.type==="Bucketname"&&(b=w=>bn(w)?null:{type:"error",message:$localize`Invalid bucket name.`}),b&&D.type==="Hostname"&&(b=w=>wn(w)?null:{type:"error",message:$localize`Invalid hostname.`}),A.custom.push(W({order:900+J,validate:b},D))});for(let v=0;v<a.Options.length;v++){let D=a.Options[v];if(D.Deprecated)continue;let K=m.find(J=>J===D.Name||D.Aliases?.includes(J.name)||J.name===D.Name);if(K){let J=D.Aliases?.indexOf(K.name)??-1,b=D.Aliases&&J>-1?D.Aliases[J]:D.Name,w=K&&typeof K!="string",Me=w?K?.defaultValue??D.DefaultValue:D.DefaultValue,xe=w&&K?.order!==void 0?K.order:v,B={name:b,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,order:900+xe},ze=w?W(W({},B),K):B;A.dynamic.push(ze)}else{let J=D.Name;if(F.find(Re=>Re===J))continue;let w=N.find(Re=>Re===J||Re.name===J),Me=w&&typeof w!="string",xe=Me&&w?.order!==void 0?w.order:v,B={name:J,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,defaultValue:D.DefaultValue,order:900+xe},ze=Me?W(W({},B),w):B;A.advanced.push(ze)}}if(A.custom.sort((v,D)=>v.order-D.order),A.dynamic.sort((v,D)=>v.order-D.order),A.advanced.sort((v,D)=>v.order-D.order),this.destinationFormConfig.set(A),!t)return;let L=bt(t);L&&this.destinationForm.set({custom:L.custom,dynamic:L.dynamic,advanced:L.advanced})});destinationFormEffect=q(()=>{let t=this.#l,e=this.destinationForm(),n=this.refreshView();if(!e||!t)return;let o=Rn({destinationType:t,custom:e.custom,dynamic:e.dynamic,advanced:e.advanced});o&&this.targetUrl.set(o)});getFieldValue(t,e){let o=this.destinationForm()[t][e];return o||null}getFormView(t,e){let o=this.destinationFormConfig()?.[t].find(a=>a.name===e);return o||null}getDefaultFormView(t){return{name:t,type:"String",shortDescription:t,longDescription:$localize`This is an undocumented option.`}}getFieldGroup(t,e){return t[e]}hasLeadingSlash(t){return t?.startsWith("/")??!1}addAdvancedOption(t){let e=this.destinationForm();e.advanced[t.name]=t.defaultValue,this.destinationForm.set(W({},e))}isTrue(t){if(typeof t=="boolean")return t;if(typeof t=="string"){let e=t.toLowerCase();return e==="true"||e==="1"||e==="yes"||e==="on"}return!1}onKeyDown(t,e,n,o){if(n==="Hostname"||n==="Bucketname"){if(["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End"].includes(o.key))return;if(o.key=="/"||o.key=="\\"||o.key==":"){o.preventDefault();return}}}updateFieldValue(t,e,n){let o=this.destinationForm();o[t][e]=n,this.destinationForm.set(W({},o))}removeAdvancedOption(t){let e=this.destinationForm();delete e.advanced[t],this.destinationForm.set(W({},e))}mapOptions(t){let e=t.loadOptions;if(e)return e(this.injector)();let n=t.options;return n?n.map(o=>({key:o,value:o})):null}mapOptionsWithFreeText(t,e){let n=this.mapOptions(t);return n?(e&&e.length>0&&(n.find(a=>a.value===e)||n.push({key:e,value:e})),n):null}#r=h(!1);oauthStartTokenCreation(t,e,n,o){this.#r.set(!0);let a=(o??1)==2?this.#t.defaultOAuthUrlV2():this.#t.defaultOAuthUrl(),_=this.#n.serverSettings()?.["--oauth-url"];if(_&&_.length>0&&(a=_),this.useBackupState()){let D=this.#e.mapFormsToSettings().find(K=>K.Name==="--oauth-url")?.Value;D&&D.length>0&&(a=D)}let d=this.destinationForm().advanced["oauth-url"];d&&d.length>0&&(a=d);let m=`${a}?type=${t}`,N=450,F=600,A=screen.width/2-N/2,L=screen.height/2-F/2,v=window.open(m,"_blank","height="+F+",width="+N+",menubar=0,status=0,titlebar=0,toolbar=0,left="+A+",top="+L);return window.addEventListener("message",D=>{let K=D.data.startsWith("authid:"),J=K?D.data.replace("authid:",""):null;K&&(this.destinationForm.update(b=>(b[e][n]=J,b)),this.#r.set(!1),this.refreshView.set(!this.refreshView()),v?.close())}),!1}settingsAsText=R(()=>{let t=this.destinationForm().advanced;return Object.entries(t).map(([e,n])=>{let o=e??"",a="";return typeof n=="boolean"?a=this.isTrue(n)?"True":"False":(typeof n=="number"||n!=null)&&(a=n.toString()),`${o}=${a}`}).join(`
4
+ `)});updateSettingsFromText(t){if(typeof t!="string")return;let e=Ln(t);this.destinationForm.update(n=>oe(W({},n),{advanced:e}))}getIsDisabled(t){return document.getElementById(t)?.disabled??!0}toggleDisabled(t){let e=document.getElementById(t);e&&(e.disabled=!e.disabled)}openConsole(){this.#o.openConsole()}#_(t){var e=this.useBackupState()?this.#e.backupId():null;this.isAuthenticatingFilen.set(!0),this.#s.getFilenApiKey(t,e).pipe(Be(()=>this.isAuthenticatingFilen.set(!1))).subscribe({next:n=>{if(n.length===0){this.#a.open(ne,{data:{title:$localize`Authentication failed`,message:$localize`No API key was returned from the Filen server.`,confirmText:$localize`OK`}});return}this.destinationForm.update(o=>(o.advanced["api-key"]=n,o.dynamic["two-factor-code"]=null,o)),this.refreshView.set(!this.refreshView())},error:n=>{console.error("Error authenticating Filen",n),this.#a.open(ne,{data:{title:$localize`Authentication failed`,message:$localize`An error occurred while requesting the Filen API key: ${n.message}`,confirmText:$localize`OK`}})}})}authenticateFilen(){let t=this.targetUrl();if(!t)return;let n=this.destinationForm().advanced["api-key"];if(n&&n.length>0){this.#a.open(ne,{data:{title:$localize`Confirm re-authenticate?`,message:$localize`You already have an API key. Are you sure you want to re-authenticate?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:o=>{if(o){var a=new URL(t);a.searchParams.delete("api-key"),this.#_(a.toString())}}});return}this.#_(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-single-destination"]],inputs:{targetUrl:[1,"targetUrl"],useBackupState:[1,"useBackupState"]},outputs:{targetUrl:"targetUrlChange"},decls:3,vars:3,consts:()=>{let t;t=$localize`Advanced options`;let e;e=$localize` Show editor ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let n;n=$localize` Add advanced option ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:plus${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let o;o=$localize`This field is mandatory`;let a;a=$localize`This field is mandatory`;let _;_=$localize`This field is mandatory`;let d;d=$localize`An empty path means storing data in the initial or root folder, which is not recommended`;let m;m=$localize`This field is mandatory`;let N;N=$localize`This field is mandatory`;let F;F=$localize`This field is mandatory`;let A;A=$localize`This field is mandatory`;let L;L=$localize`This field is mandatory`;let v;v=$localize`This field is mandatory`;let D;D=$localize`This field is mandatory`;let K;K=$localize`This field is mandatory`;let J;J=$localize`Loading available backups...`;let b;b=$localize`No backups found from this machine, contact support`;let w;w=$localize` Try again `;let Me;Me=$localize`This field is mandatory`;let xe;xe=$localize`Pick the backup to restore from`;let B;B=$localize`This field is mandatory`;let ze;ze=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:pencil${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Re;Re=$localize`${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:An API key with storage access is required to use Duplicati storage.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:${"[\uFFFD#2\uFFFD|\uFFFD#3\uFFFD]"}:START_TAG_DIV:Visit the console and assign an API key to this machine.${"[\uFFFD/#2\uFFFD|\uFFFD/#3\uFFFD]"}:CLOSE_TAG_DIV:`,Re=Ke(Re);let tn;tn=$localize` Visit console ${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON:`;let nn;nn=$localize`Connect to the console to use Duplicati storage.`;let on;on=$localize` Connect now ${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON:`;let an;an=$localize`This field is mandatory`;let ln;return ln=$localize` Authenticate now ${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["fieldTemplate",""],["validateTemplate",""],["option",""],["enumOptionTemplate",""],["nonValidatedOptionTemplate",""],["optionTemplate",""],["backupIdOptionTemplate",""],t,e,n,J,b,w,xe,ze,Re,tn,nn,on,ln,[1,"advanced-options",3,"disableToggle"],["title",""],["shButton","","type","button",1,"outlined","small"],[1,"actions"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModel","ngModelOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["shButton","","type","button",1,"outlined","small",3,"click"],[3,"searchable"],["shButton","","type","button",1,"outlined","small",3,"disabled"],["menu",""],["type","button"],["shButton","","type","button",1,"small"],["shButton","","type","button",1,"small",3,"click"],["type","button",3,"click"],["wrap","off","placeholder","Paste advanced options here, one per line.",1,"raw-text-area",3,"ngModelChange","ngModel","ngModelOptions"],[1,"field-row"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles","resolvePaths"],[3,"hideShortcuts","enableCreateFolder","startingPath","resolvePaths"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],[3,"ngModel","customId","placeholder"],["shButton","","type","button",1,"outlined"],[3,"for"],["shTooltip",o],[1,"primary",3,"shTooltip"],["type","text",3,"ngModelChange","id","ngModel"],["shTooltip",a],["shTooltip",_],["shTooltip",d,1,"warn"],["autocomplete","off",3,"keydown","ngModelChange","type","id","ngModel"],["prefix","",3,"error","warn","shTooltip"],["prefix",""],["prefix","",3,"shTooltip"],["shTooltip",m],["autocomplete","new-password",3,"ngModelChange","type","id","ngModel"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],["label","key","value","value",3,"options","isClearable","optionTemplate"],["shTooltip",N],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["shTooltip",F],[3,"ngModelChange","inputType","ngModel","customId"],["shTooltip",A],["shTooltip",L],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"change","checked"],["key","key","value","value",1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["shTooltip",v],["type","text","id","text",3,"ngModelChange","ngModel"],["shTooltip",D],[3,"ngModelChange","ngModel","customId","placeholder"],["shTooltip",K],[1,"duplicati-backup-id"],[1,"duplicati-backup-id-console"],[1,"no-backups-found"],[3,"options","isClearable"],["shTooltip",Me],["shTooltip",B],["autocomplete","off",3,"ngModelChange","type","id","ngModel","placeholder","disabled"],["shButton","","type","button",1,"outlined",3,"click"],[1,"info"],["shButton","","type","button",1,"outlined",3,"routerLink"],[1,"filen-2fa-setup"],["shTooltip",an],["type","text","autocomplete","off",3,"ngModelChange","id","ngModel"],["shButton","","type","button",1,"outlined",3,"click","disabled"],[1,"error",3,"shTooltip"],[1,"warn",3,"shTooltip"]]},template:function(e,n){if(e&1&&(de(0)(1),g(2,Ia,18,5)),e&2){let o=j(n.destinationType());c();let a=j(n.destinationFormConfig());c(),C(o&&a?2:-1)}},dependencies:[qe,ee,ht,te,se,re,Tn,Sn,Ye,Gt,Gn,Bt,ue,Y,Q,Ot,Qe,$e,Mt,ve,It,Pt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.advanced-options[_ngcontent-%COMP%]{position:relative;z-index:1}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-8)}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-8)}label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}label[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.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}.actions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.raw-text-area[_ngcontent-%COMP%]{min-height:12rem;white-space:pre}.filen-2fa-setup[_ngcontent-%COMP%], .duplicati-backup-id[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:flex-end}.duplicati-backup-id[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{width:100%}.duplicati-backup-id-console[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:8px;align-items:center}.duplicati-backup-id-console[_ngcontent-%COMP%] .info[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:4px}.no-backups-found[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{margin-left:4px;margin-right:4px}"],changeDetection:0})};var Jt=class i{#e=O(xt);#t=O(Ge);#n=O(ge);testDestination(t,e,n,o,a,_,d,m,N){return this.#n.hasV2TestOperations()?this.testDestinationv2(t,e,n,o,a,_,d,m,N):this.testDestinationv1(t,e,n,o,a,_,d,m,N)}testDestinationv2(t,e,n,o,a,_,d,m,N){return new ct(F=>{this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:t,ConnectionStringId:n??null,BackupId:e=="new"?null:e,AutoCreate:m==="create",ReadOnlyTest:N,Options:null,DestinationType:_,SourcePrefix:e=="new"?null:o}}).subscribe({next:A=>{if(A.Success){this.emitSuccessV2(F,t,a,A);return}this.handleGenericError(F,t,a,A.Error??"Unknown error",d)},error:A=>{let L=A?.error?.body??A?.error?.requestBody;if(L?.Data?.FolderExists===!1||L?.StatusCode==="missing-folder"){this.handleMissingFolder(F,t,e,n,a,d,m,N);return}if(L?.Data?.HostCertificate){this.handleMissingCertificate(F,t,a,L.Data?.HostCertificate,d);return}if(L?.Data?.ReportedHostKey){this.handleIncorrectKey(F,t,a,L.Data.ReportedHostKey,L.Data.AcceptedHostKey??null,d);return}this.handleGenericError(F,t,a,A?.message??"Unknown error",d)}})})}testDestinationv1(t,e,n,o,a,_,d,m,N){return new ct(F=>{this.#e.postApiV1RemoteoperationTest({requestBody:{path:t,backupId:e=="new"?null:e,connectionStringId:n??null,sourcePrefix:e=="new"?null:o},type:_}).subscribe({next:A=>{F.next({action:"success",targetUrl:t,testAgain:!1,destinationIndex:a}),F.complete()},error:A=>{this.handleDestinationErrorv1(A.message,t,e,n,a,d,m,N).subscribe(L=>{F.next(L)})}})})}handleMissingFolder(t,e,n,o,a,_,d,m){function N(){t.next({action:"missing-folder",targetUrl:e,testAgain:!1,destinationIndex:a,errorMessage:$localize`The remote destination folder does not exist.`}),t.complete()}if(_||d==="error"){N();return}this.#t.open(ne,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`,confirmText:$localize`Create folder`,cancelText:$localize`Cancel`},closed:F=>{if(!F){this.reportNoAction(t,e,a,$localize`The remote folder does not exist.`);return}this.#n.hasV2TestOperations()?this.#e.postApiV2DestinationTest({requestBody:{DestinationUrl:e,ConnectionStringId:o,AutoCreate:!0,ReadOnlyTest:m,Options:null,BackupId:n=="new"?null:n}}).subscribe({next:A=>{if(A.Success){this.emitSuccessV2(t,e,a,A);return}else this.handleFolderCreateFailure(t,e,a,A.Error??$localize`Unknown error`)},error:A=>{this.handleFolderCreateFailure(t,e,a,A.message??$localize`Unknown error`)}}):this.#e.postApiV1RemoteoperationCreate({requestBody:{path:e,backupId:n=="new"?null:n}}).subscribe({next:()=>{this.handleFolderCreated(t,e,a)},error:A=>{this.handleFolderCreateFailure(t,e,a,A.message??$localize`Unknown error`)}})}})}handleFolderCreateFailure(t,e,n,o){this.#t.open(ne,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:n}),t.complete()}})}emitSuccessV2(t,e,n,o){t.next({action:"success",targetUrl:e,testAgain:!1,destinationIndex:n,anyFilesFound:!o.Data?.FolderIsEmpty,containsBackup:o.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:o.Data?.FolderContainsEncryptedBackupFiles??void 0}),t.complete()}handleFolderCreated(t,e,n){this.#t.open(ne,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{t.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:n}),t.complete()}})}reportNoAction(t,e,n,o){t.next({action:"generic-error",targetUrl:e,errorMessage:o,testAgain:!1,destinationIndex:n}),t.complete()}handleMissingCertificate(t,e,n,o,a){let _=$localize`The server is using a certificate that is not trusted.
5
+ If this is a self-signed certificate, you can choose to trust this certificate.
6
+ The server reported the certificate hash: ${o}`,d=e.includes("?");function m(){t.next({action:"trust-cert",targetUrl:e,suggestedUrl:e+`${d?"&":"?"}accept-specified-ssl-hash=${o}`,testAgain:!0,certData:o,errorMessage:_,destinationIndex:n}),t.complete()}if(a){m();return}this.#t.open(ne,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:_,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:N=>{if(!N){this.reportNoAction(t,e,n,$localize`The server certificate is not trusted.`);return}m()}})}handleIncorrectKey(t,e,n,o,a,_){if(a){let F=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:N,testAgain:!0,reportedHostKey:o,errorMessage:m,destinationIndex:n}),t.complete()};var d=F;let m=$localize`The host key has changed, please check with the server administrator if this is correct,
7
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
8
+ Do you want to REPLACE your CURRENT host key ${a}
9
+ with the REPORTED host key: ${o}?`,N=e;try{let L=new URL(e);L.searchParams.set("ssh-fingerprint",o),N=L.toString()}catch{let L=e.replace(/([?&])ssh-fingerprint=[^&]*/,""),v=L.includes("?");N=L+`${v?"&":"?"}ssh-fingerprint=${o}`}if(_){F();return}this.#t.open(ne,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:m,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:L=>{if(!L){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}F()}})}else{let F=function(){t.next({action:"approve-host-key",targetUrl:e,suggestedUrl:e+`${N?"&":"?"}ssh-fingerprint=${o}`,testAgain:!0,reportedHostKey:o,errorMessage:m,destinationIndex:n}),t.complete()};var d=F;let m=$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,N=e.includes("?");if(_){F();return}this.#t.open(ne,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:m,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:A=>{if(!A){this.reportNoAction(t,e,n,$localize`The host key was not approved.`);return}F()}})}}handleGenericError(t,e,n,o,a){function _(){t.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:n,errorMessage:o}),t.complete()}if(a){_();return}this.#t.open(ne,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:d=>_()})}handleDestinationErrorv1(t,e,n,o,a,_,d,m){return new ct(N=>{if(t==="missing-folder"){this.handleMissingFolder(N,e,n,o,a,_,d,m);return}if(t.startsWith("incorrect-cert:")){let F=t.split("incorrect-cert:")[1];this.handleMissingCertificate(N,e,a,F,_);return}if(t.startsWith("incorrect-host-key:")){let F=t.split('incorrect-host-key:"')[1].split('",')[0],A=t.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(N,e,a,F,A,_);return}this.handleGenericError(N,e,a,t,_)})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};function Pa(i,t){if(i&1){let e=I();l(0,"sh-alert",13),M(1,0),l(2,"button",14),T("click",function(){S(e);let o=s(2);return f(o.testDestinationClick())}),r(),x(),r()}}function Oa(i,t){i&1&&(l(0,"sh-alert",13),M(1,1),P(2,"sh-icon"),l(3,"div",15),P(4,"sh-spinner"),r(),x(),r()),i&2&&(c(4),Ct("--spinner-size","16px")("--spinner-thickness","2px"))}function Ma(i,t){i&1&&(l(0,"sh-alert",17),y(1,2),r())}function xa(i,t){i&1&&(l(0,"sh-alert",16),y(1,3),r())}function Ra(i,t){if(i&1&&g(0,Ma,2,0,"sh-alert",17)(1,xa,2,0,"sh-alert",16),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:1)}}function La(i,t){i&1&&(l(0,"sh-alert",18),y(1,4),r())}function ba(i,t){i&1&&(l(0,"sh-alert",16),y(1,5),r())}function wa(i,t){i&1&&(l(0,"sh-alert",17),y(1,6),r())}function Ga(i,t){if(i&1&&g(0,La,2,0,"sh-alert",18)(1,ba,2,0,"sh-alert",16)(2,wa,2,0,"sh-alert",17),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:(e=n.testResponse())!=null&&e.anyFilesFound?1:2)}}function $a(i,t){i&1&&(l(0,"sh-alert",17),y(1,7),r())}function va(i,t){i&1&&(l(0,"sh-alert",16),y(1,8),r())}function Ua(i,t){if(i&1&&g(0,$a,2,0,"sh-alert",17)(1,va,2,0,"sh-alert",16),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.anyFilesFound?0:1)}}function ka(i,t){i&1&&(l(0,"sh-alert",17),y(1,9),r())}function Va(i,t){i&1&&(l(0,"sh-alert",17),y(1,10),r())}function Ba(i,t){i&1&&(l(0,"sh-alert",17),y(1,11),r())}function Ka(i,t){if(i&1&&g(0,ka,2,0,"sh-alert",17)(1,Va,2,0,"sh-alert",17)(2,Ba,2,0,"sh-alert",17),i&2){let e,n=s(4);C((e=n.testResponse())!=null&&e.containsBackup?0:(e=n.testResponse())!=null&&e.anyFilesFound?1:2)}}function Ja(i,t){if(i&1&&g(0,Ra,2,1)(1,Ga,3,1)(2,Ua,2,1)(3,Ka,3,1),i&2){let e=s(3);C(e.testExpectation()==="containsBackup"?0:e.testExpectation()==="destinationEmpty"?1:e.testExpectation()==="destinationNotEmpty"?2:3)}}function Xa(i,t){if(i&1){let e=I();M(0,12,1),l(1,"button",14),T("click",function(){S(e);let o=s(4);return f(o.createFolder())}),r(),x()}}function za(i,t){if(i&1&&(l(0,"sh-alert",16),M(1,12),g(2,Xa,2,0,"button",19),x(),r()),i&2){let e=s(3);c(2),C(e.askToCreate()?2:-1)}}function Wa(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.useSuggestedUrl())}),p(3,"Approve"),r()()}if(i&2){let e,n=s(3);c(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function Ha(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.useSuggestedUrl())}),p(3,"Approve"),r()()}if(i&2){let e,n=s(3);c(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function ja(i,t){if(i&1){let e=I();l(0,"sh-alert",16),p(1),l(2,"button",14),T("click",function(){S(e);let o=s(3);return f(o.testDestinationClick())}),p(3,"Test again"),r()()}if(i&2){let e,n=s(3);c(),V(" ",(e=n.testResponse())==null?null:e.errorMessage," ")}}function qa(i,t){if(i&1&&g(0,Ja,4,1)(1,za,3,1,"sh-alert",16)(2,Wa,4,1,"sh-alert",16)(3,Ha,4,1,"sh-alert",16)(4,ja,4,1,"sh-alert",16),i&2){let e,n=s(2);C(((e=n.testResponse())==null?null:e.action)==="success"?0:((e=n.testResponse())==null?null:e.action)==="missing-folder"?1:((e=n.testResponse())==null?null:e.action)==="trust-cert"?2:((e=n.testResponse())==null?null:e.action)==="approve-host-key"?3:((e=n.testResponse())==null?null:e.action)==="generic-error"?4:-1)}}function Qa(i,t){if(i&1&&g(0,Pa,3,0,"sh-alert",13)(1,Oa,5,4,"sh-alert",13)(2,qa,5,1),i&2){let e=s();C(e.testSignal()===null?0:e.testSignal()==="testing"?1:2)}}var Xt=class i{#e=O(Jt);targetUrl=be.required();testSignal=be.required();connectionStringId=G(null);backupId=G.required();sourcePrefix=G.required();suppressErrorDialogs=G.required();askToCreate=G.required();readOnlyTest=G.required();testExpectation=G.required();moduleType=G.required();testResponse=R(()=>{let t=this.testSignal();return t&&typeof t!="string"?t:null});isExpectedValidTargetUrl=R(()=>{let t=this.targetUrl();return!(!t||!bt(t))});prevTargetUrl=null;targetUrlEffect=q(()=>{let t=this.targetUrl(),e=this.prevTargetUrl;t!==e&&(this.prevTargetUrl=t,this.testSignal()!=="testing"&&e!==null&&this.testSignal.set(null))});useSuggestedUrl(){let t=this.targetUrl(),e=this.testSignal(),n=e&&typeof e!="string"?e?.targetUrl:null,o=e&&typeof e!="string"?e?.suggestedUrl:null;return!t||!o||n!==t||(this.targetUrl.set(o),this.testDestinationClick()),!1}createFolder(){return this.testDestination(!0),!1}testDestinationClick(){return this.testDestination(!1),!1}testDestination(t){let e=this.targetUrl();if(!e)return;this.testSignal.set("testing");let n=t?"create":this.askToCreate()?"prompt":"error";return new Promise(o=>{this.#e.testDestination(e,this.backupId(),this.connectionStringId(),this.sourcePrefix(),0,this.moduleType(),this.suppressErrorDialogs(),n,this.readOnlyTest())?.subscribe({next:a=>{if(!this.suppressErrorDialogs()&&a.testAgain){let _=a.suggestedUrl;_&&this.targetUrl.set(_),this.testSignal.set("testing"),this.#e.testDestination(_??e,this.backupId(),this.connectionStringId(),this.sourcePrefix(),0,this.moduleType(),this.suppressErrorDialogs(),n,this.readOnlyTest())?.subscribe({next:d=>{this.testSignal.set(d),o(d)}})}else this.testSignal.set(a),o(a)}})})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-test-url"]],inputs:{targetUrl:[1,"targetUrl"],testSignal:[1,"testSignal"],connectionStringId:[1,"connectionStringId"],backupId:[1,"backupId"],sourcePrefix:[1,"sourcePrefix"],suppressErrorDialogs:[1,"suppressErrorDialogs"],askToCreate:[1,"askToCreate"],readOnlyTest:[1,"readOnlyTest"],testExpectation:[1,"testExpectation"],moduleType:[1,"moduleType"]},outputs:{targetUrl:"targetUrlChange",testSignal:"testSignalChange"},decls:1,vars:1,consts:()=>{let t;t=$localize` Make sure to test the configuration ${"\uFFFD#2\uFFFD"}:START_TAG_BUTTON:Test now${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_BUTTON:`;let e;e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV: Testing connection... ${"\uFFFD#4\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_DIV:`;let n;n=$localize`Success! Test completed, backup found.`;let o;o=$localize`No backup found at the specified destination.`;let a;a=$localize` The remote destination already contains a backup. Please use a different folder for each backup. `;let _;_=$localize` The remote destination is not empty. It is recommended to use an empty folder for the backup. `;let d;d=$localize`Success! Test completed, destination is empty.`;let m;m=$localize`Success! Test completed, destination contains files.`;let N;N=$localize`The remote destination is empty.`;let F;F=$localize`Success! Test completed, backup found.`;let A;A=$localize`Success! Test completed, destination contains files.`;let L;L=$localize`Success! Test completed, destination is empty.`;let v;return v=$localize` The specified folder does not exist. ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:Create now${"\uFFFD/#1:1\uFFFD"}:CLOSE_TAG_BUTTON:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:`,[t,e,n,o,a,_,d,m,N,F,A,L,v,[1,"simple","primary"],["shButton","",1,"primary","small",3,"click"],[1,"testing"],[1,"simple","warn"],[1,"simple","success"],[1,"simple","error"],["shButton","",1,"primary","small"]]},template:function(e,n){e&1&&g(0,Qa,3,1),e&2&&C(n.isExpectedValidTargetUrl()?0:-1)},dependencies:[yt,Y,Q,Pt],styles:["[_nghost-%COMP%]{display:block}.testing[_ngcontent-%COMP%]{display:flex;flex-direction:row;align-items:center;gap:8px;justify-content:space-between}"],changeDetection:0})};function Ya(i,t){if(i&1){let e=I();l(0,"app-destination-list",10),T("setDestination",function(o){S(e);let a=s();return f(a.setDestination(o))}),r()}if(i&2){let e=s();u("showAsSources",!0)("moduleType",e.moduleType())}}function Za(i,t){if(i&1){let e=I();l(0,"app-destination-list-item",11)(1,"button",8),T("click",function(){S(e);let o=s();return f(o.removeDestination())}),y(2,3),r()(),l(3,"app-test-url",12),k("targetUrlChange",function(o){S(e);let a=s();return $(a.targetUrlModel,o)||(a.targetUrlModel=o),f(o)})("testSignalChange",function(o){S(e);let a=s();return $(a.testSignal,o)||(a.testSignal=o),f(o)}),r(),l(4,"app-single-destination",13),k("targetUrlChange",function(o){S(e);let a=s();return $(a.targetUrlModel,o)||(a.targetUrlModel=o),f(o)}),r()}if(i&2){let e=s();u("targetUrl",e.targetUrlModel()),c(3),U("targetUrl",e.targetUrlModel)("testSignal",e.testSignal),u("backupId",e.backupId())("sourcePrefix",e.sourcePrefix())("suppressErrorDialogs",e.suppressErrorDialogs())("askToCreate",e.askToCreate())("testExpectation",e.expectedResult())("readOnlyTest",!0)("moduleType",e.moduleType()),c(),U("targetUrl",e.targetUrlModel)}}function el(i,t){i&1&&y(0,2,1)}function tl(i,t){i&1&&y(0,2,2)}function nl(i,t){i&1&&y(0,2,3)}function il(i,t){i&1&&y(0,2,4)}var st=class i{data=G();closed=Le();targetUrlModel=h(null);moduleType=h("Backend");askToCreate=h(!1);expectedResult=h("any");suppressErrorDialogs=h(!1);backupId=h(null);sourcePrefix=h(null);dataEffect=q(()=>{let t=this.data();t?.targetUrlModel&&this.targetUrlModel.set(t.targetUrlModel),t?.moduleType&&this.moduleType.set(t.moduleType),t?.askToCreate!==null&&t?.askToCreate!==void 0&&this.askToCreate.set(t.askToCreate),t?.expectedResult&&this.expectedResult.set(t.expectedResult),t?.suppressErrorDialogs!==null&&t?.suppressErrorDialogs!==void 0&&this.suppressErrorDialogs.set(t.suppressErrorDialogs),t?.backupId&&this.backupId.set(t.backupId),t?.sourcePrefix&&this.sourcePrefix.set(t.sourcePrefix)});testSignal=h(null);setTargetUrl(t,e=!1){this.targetUrlModel.set(t)}setDestination(t){let e=Lt(t??"");if(e){if(e.mapper.default){let n=e.mapper.default("");this.setTargetUrl(n,!0);return}this.setTargetUrl(`${t}://`,!0)}}submit(){this.closed.emit(this.targetUrlModel())}removeDestination(){this.setTargetUrl(null,!0)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-target-url-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:15,vars:6,consts:()=>{let t;t=$localize`Remote source`;let e;e=$localize`Cancel`;let n;n=$localize`${"\uFFFD*11:1\uFFFD"}:START_BLOCK_IF: Use storage destination ${"\uFFFD/*11:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*12:2\uFFFD"}:START_BLOCK_ELSE_IF: Use remote source ${"[\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*13:3\uFFFD"}:START_BLOCK_ELSE_IF_1: Use remote destination ${"[\uFFFD/*12:2\uFFFD|\uFFFD/*13:3\uFFFD]"}:CLOSE_BLOCK_ELSE_IF:${"\uFFFD*14:4\uFFFD"}:START_BLOCK_ELSE: Use remote URL ${"\uFFFD/*14:4\uFFFD"}:CLOSE_BLOCK_ELSE:`,n=Ke(n);let o;return o=$localize`Change`,[t,e,n,o,[1,"title-30"],["content",""],[3,"showAsSources","moduleType"],["footer","",1,"sticky"],["shButton","","type","button",3,"click"],["shButton","","type","button",1,"raised","primary",3,"click","disabled"],[3,"setDestination","showAsSources","moduleType"],[1,"current-destination",3,"targetUrl"],[3,"targetUrlChange","testSignalChange","targetUrl","testSignal","backupId","sourcePrefix","suppressErrorDialogs","askToCreate","testExpectation","readOnlyTest","moduleType"],[3,"targetUrlChange","targetUrl"]]},template:function(e,n){if(e&1&&(l(0,"header")(1,"h3",4),y(2,0),r()(),l(3,"section",5),g(4,Ya,1,2,"app-destination-list",6),g(5,Za,5,11),r(),l(6,"footer",7)(7,"button",8),T("click",function(){return n.closed.emit(null)}),y(8,1),r(),l(9,"button",9),T("click",function(){return n.submit()}),M(10,2),g(11,el,1,0)(12,tl,1,0)(13,nl,1,0)(14,il,1,0),x(),r()()),e&2){let o=!!n.targetUrlModel();c(4),C(o?-1:4),c(),C(o?5:-1),c(4),Fe("loading",n.testSignal()==="testing"),u("disabled",!o||n.testSignal()===null||n.testSignal()==="testing"),c(2),C(n.moduleType()==="Backend"?11:n.moduleType()==="SourceProvider"?12:n.moduleType()==="RestoreDestinationProvider"?13:14)}},dependencies:[Kt,Vt,et,Y,Xt],styles:["[_nghost-%COMP%]{--dialog-p: 1.5rem;display:flex;flex-direction:column;gap:1rem}header[_ngcontent-%COMP%]{display:flex;padding:1.5rem 1.5rem 0}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}footer[_ngcontent-%COMP%]{z-index:1}"],changeDetection:0})};var ol=["formRef"],al=()=>({updateOn:"blur",standalone:!0}),Yt=()=>({standalone:!0});function ll(i,t){if(i&1){let e=I();l(0,"button",41),T("click",function(){S(e);let o=s(2);return f(o.openLocalDiskDialog())}),M(1,12),P(2,"sh-icon"),x(),r()}}function rl(i,t){if(i&1){let e=I();g(0,ll,3,0,"button",40),l(1,"button",41),T("click",function(){S(e);let o=s();return f(o.openRemoteDestinationDialog())}),M(2,11),P(3,"sh-icon"),x(),r()}if(i&2){let e=s();C(e.isLocalDiskSupported()?0:-1)}}function sl(i,t){i&1&&y(0,7,1)}function _l(i,t){i&1&&y(0,7,2)}function cl(i,t){i&1&&(l(0,"p",34),y(1,13),r())}function dl(i,t){i&1&&(l(0,"p",34),y(1,14),r())}function ul(i,t){if(i&1){let e=I();l(0,"sh-form-field")(1,"textarea",42),k("ngModelChange",function(o){S(e);let a=s();return $(a.bulkPaths,o)||(a.bulkPaths=o),f(o)}),T("ngModelChange",function(){S(e);let o=s();return f(o.savePathBulkEdit())}),r()()}if(i&2){let e=s();c(),U("ngModel",e.bulkPaths),u("ngModelOptions",Ae(2,al))}}function pl(i,t){if(i&1){let e=I();l(0,"sh-form-field",46)(1,"input",47),k("ngModelChange",function(o){S(e);let a=s(3);return $(a.editingPath,o)||(a.editingPath=o),f(o)}),r()(),l(2,"button",24),T("click",function(){S(e);let o=s(3);return f(o.updatePath())}),l(3,"sh-icon"),p(4,"floppy-disk"),r()(),l(5,"button",24),T("click",function(){S(e);let o=s(3);return f(o.cancelEditPath())}),l(6,"sh-icon"),p(7,"x-bold"),r()()}if(i&2){let e=s(3);c(),U("ngModel",e.editingPath),u("ngModelOptions",Ae(2,Yt))}}function ml(i,t){if(i&1&&(l(0,"sh-chip"),P(1,"img",48),p(2),r()),i&2){let e=s(2).$implicit,n=s(2);c(),u("src",n.getBackendIcon(e),pt),c(),V(" ",n.getRemotePathDisplayName(e)," ")}}function gl(i,t){if(i&1&&(l(0,"sh-form-field",46),P(1,"input",49),r()),i&2){let e=s(2).$implicit;gt("readonly",!0),c(),u("ngModel",e)("ngModelOptions",Ae(3,Yt))}}function Cl(i,t){if(i&1){let e=I();g(0,ml,3,2,"sh-chip")(1,gl,2,4,"sh-form-field",46),l(2,"button",24),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.editPath(o))}),l(3,"sh-icon"),p(4,"pen"),r()(),l(5,"button",24),T("click",function(){S(e);let o=s().$implicit,a=s(2);return f(a.removePath(o))}),l(6,"sh-icon"),p(7,"trash-simple"),r()()}if(i&2){let e=s().$implicit;C(e.startsWith("@")?0:1)}}function Tl(i,t){if(i&1&&(l(0,"div",43),g(1,pl,8,3)(2,Cl,8,1),r()),i&2){let e=t.$implicit,n=s(2);c(),C(n.oldPath()===e?1:2)}}function Sl(i,t){if(i&1){let e=I();fe(0,Tl,3,1,"div",43,Se),l(2,"div",39)(3,"sh-form-field"),P(4,"input",44),r(),l(5,"button",45),T("click",function(){S(e);let o=s();return f(o.addNewPath())}),l(6,"sh-icon"),p(7,"plus"),r()()()}if(i&2){let e=s();Ee(e.nonFilterPaths()),c(4),u("formControl",e.newPathCtrl)}}function fl(i,t){if(i&1){let e=I();l(0,"div",39)(1,"app-size",50),T("ngModelChange",function(o){S(e);let a=s();return f(a.updateFilesLargerThan(o))}),r()()}if(i&2){let e=s();c(),u("ngModel",e.filesLargerThan())("ngModelOptions",Ae(2,Yt))}}var nt=new Dt,Vn=(i={path:"",filters:[],excludes:{filesLargerThan:null}})=>nt.group({path:nt.control(i.path),excludes:nt.group({filesLargerThan:nt.group({size:nt.control(null),unit:nt.control(null)})})}),Qt=class i{#e=O(Oe);#t=O(Ge);#n=O(we);#i=O(je);#o=O(ge);formRef=Ie.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;newPathCtrl=new hn("");filesLargerThan=R(()=>{let t=this.sourceDataFormSignal()?.excludes?.filesLargerThan??{};return t.size!==null&&t.unit!==null?`${t.size}${t.unit}`:null});osType=this.#e.osType;pathSignal=Ue(this.sourceDataForm.controls.path.valueChanges);pathArray=R(()=>this.pathSignal()?.split("\0").filter(t=>t.startsWith("-")||t.startsWith("+")||t==="___none___")??[]);nonFilterPaths=R(()=>this.pathSignal()?.split("\0").filter(t=>!t.startsWith("-")&&!t.startsWith("+")&&t!==""));oldPath=h(null);editingPath=h(null);addingNewPath=h(!1);bulkPathEditMode=h(!1);bulkPaths=h("");mobileMenuOpen=h(!1);isLocalDiskSupported=R(()=>this.#o.systemInfo()?.SourceProviderModules?.find(t=>t.Key=="diskimage"));filters=h([]);#s=q(()=>{let e=this.pathSignal()?.split("\0").filter(n=>n!=="___none___"&&(n.startsWith("-")||n.startsWith("+")))??[];this.filters.set(e)});openRemoteDestinationDialog(){this.#t.open(st,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:null,moduleType:"SourceProvider",askToCreate:!1,expectedResult:"destinationNotEmpty",suppressErrorDialogs:!0,backupId:null,sourcePrefix:null}}).component.closed.subscribe(e=>{if(!e)return;let n=Math.random().toString(36).substring(2,10),o=e.split("://")[0],_=`@${this.#o.systemInfo()?.DirectorySeparator==="\\"?"X:\\":"/"}dupl-${o}-${n}|${e}`;this.addPath(_)})}openLocalDiskDialog(){this.#t.open(rt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:null}}).closed.subscribe(e=>{if(!e)return;let n=Math.random().toString(36).substring(2,10),a=`@${this.#o.systemInfo()?.DirectorySeparator==="\\"?"X:\\":"/"}dupl-disk-${n}|diskimage://${e}`;this.addPath(a)})}togglePathBulkEdit(){if(this.bulkPathEditMode())this.bulkPathEditMode.set(!1);else{let t=this.nonFilterPaths()?.join(`
10
+ `)??"";this.bulkPaths.set(t),this.bulkPathEditMode.set(!0)}}savePathBulkEdit(){let t=this.bulkPaths().split(`
11
+ `).filter(a=>a.trim()!=="")??[],e=this.pathArray(),n=[...t,...e],o=[...new Set(n)].join("\0");this.sourceDataForm.controls.path.setValue(o)}editPath(t){if(t&&t.startsWith("@")){let e=t.split("|");if(e.length!==2)return;e[1].startsWith("diskimage://")?this.editLocalDiskSource(t,e[0],e[1].substring(12)):this.editTargetUrlPath(t,e[0],e[1]);return}this.oldPath.set(t),this.editingPath.set(t)}editLocalDiskSource(t,e,n){this.#t.open(rt,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{initialPath:n}}).closed.subscribe(a=>{if(!a)return;let _=`${e}|diskimage://${a}`,d=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(d?.replace(t,_)??"")})}editTargetUrlPath(t,e,n){this.#t.open(st,{maxWidth:"700px",maxHeight:"80vh",width:"100%",closeOnOutsideClick:!1,data:{targetUrlModel:n,moduleType:"SourceProvider",askToCreate:!1,expectedResult:"destinationNotEmpty",suppressErrorDialogs:!0,backupId:this.#e.backupId(),sourcePrefix:e}}).closed.subscribe(a=>{if(!a)return;let _=`${e}|${a}`,d=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(d?.replace(t,_)??"")})}updateFilesLargerThan(t){let{size:e,unit:n}=wt(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"),o=n.indexOf(t);if(o===-1)return;n.splice(o,1);let a=n.filter(_=>_&&_!=="").join("\0");this.sourceDataForm.controls.path.setValue(a)}addPath(t){let n=[this.sourceDataForm.controls.path.value,t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}updateFilters(t){let n=[...this.nonFilterPaths()??[],...t].filter(o=>o&&o!=="").join("\0");this.sourceDataForm.controls.path.setValue(n)}getPath(){return this.sourceDataForm.value.path??null}getBackendIcon(t){if(!t)return"";let e=t.split("|")[1];return e.startsWith("diskimage:")?"assets/dest-icons/external-harddrive.png":Pe(e).icon??"database"}getRemotePathDisplayName(t){if(!t)return"";let e=t.split("|")[1];if(e.startsWith("diskimage:"))return $localize`Local disk`;let n=Pe(e);return n?n.displayName:"Unknown"}toggleFilesLargerThan(t){t?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 o=n.filter(a=>a&&a!=="").join("\0");this.sourceDataForm.controls.path.setValue(o),this.newPathCtrl.setValue("")}goBack(){this.#n.navigate(["destination"],{relativeTo:this.#i.parent})}next(){this.#e.shouldAutoSave()&&this.#e.submit(!0),this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-source-data"]],viewQuery:function(e,n){e&1&&De(n.formRef,ol,5),e&2&&ye()},decls:57,vars:16,consts:()=>{let t;t=$localize`Path`;let e;e=$localize`Source Data`;let n;n=$localize`Folder path`;let o;o=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let a;a=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Continue `;let _;_=$localize`Options`;let d;d=$localize`Paths`;let m;m=$localize`${"\uFFFD#40\uFFFD"}:START_TAG_SH_ICON:link${"\uFFFD/#40\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD*41:1\uFFFD"}:START_BLOCK_IF: Edit contents as list ${"\uFFFD/*41:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*42:2\uFFFD"}:START_BLOCK_ELSE: Edit contents as text ${"\uFFFD/*42:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let N;N=$localize`Exclude`;let F;F=$localize`Choose if there’s any files you want to exclude.`;let A;A=$localize` Files larger than `;let L;L=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:cloud-arrow-down${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_ICON: Add remote path `;let v;v=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:hard-drive${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Add local disk `;let D;D=$localize`Manually add a path.`;let K;K=$localize`Edit paths as text, one per line.`;let J;J=$localize`Add a direct path`;let b;return b=$localize`Edit path`,[["formRef",""],e,n,o,a,_,d,m,N,F,A,L,v,D,K,[3,"submit","formGroup"],[1,"left"],[1,"header-row"],[1,"title-30"],["shButton","","type","button",1,"small","ghost","mobile-menu-toggle",3,"click"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",t,"formControlName","path"],[1,"form-actions"],["shButton","","type","button",1,"small",3,"click"],["shButton","","type","submit",1,"raised","primary","small"],[1,"right"],[1,"mobile-header"],["shButton","","type","button",1,"small","ghost",3,"click"],[3,"disableToggle"],["title",""],[1,"spacer"],["shButton","","type","button",1,"small"],["menu",""],["description",""],[1,"paths"],[3,"filtersChange","filters","osType"],["formGroupName","excludes",3,"disableToggle"],[1,"raised","primary",3,"checkedChange","checked"],[1,"row-inputs"],["shButton","","type","button",1,"small","rowbutton"],["shButton","","type","button",1,"small","rowbutton",3,"click"],["wrap","off","rows","10",1,"bulk-textarea",3,"ngModelChange","ngModel","ngModelOptions"],[1,"path"],["type","text","placeholder",J,3,"formControl"],["shButton","","type","button",1,"raised","primary",3,"click"],[1,"small"],["type","text","placeholder",b,3,"ngModelChange","ngModel","ngModelOptions"],["alt","",1,"provider-icon",3,"src"],["type","text",3,"ngModel","ngModelOptions"],[3,"ngModelChange","ngModel","ngModelOptions"]]},template:function(e,n){if(e&1){let o=I();l(0,"form",15,0),T("submit",function(){return n.next()}),l(2,"div",16)(3,"div",17)(4,"h3",18),y(5,1),r(),l(6,"button",19),T("click",function(){return n.mobileMenuOpen.set(!0)}),l(7,"sh-icon"),p(8,"sliders"),r()()(),l(9,"app-file-tree",20)(10,"label",21),y(11,2),r(),P(12,"input",22),r(),l(13,"div",23)(14,"button",24),T("click",function(){return n.goBack()}),M(15,3),P(16,"sh-icon"),x(),r(),l(17,"button",25),M(18,4),P(19,"sh-icon"),x(),r()()(),l(20,"div",26)(21,"div",27)(22,"span",18),y(23,5),r(),l(24,"button",28),T("click",function(){return n.mobileMenuOpen.set(!1)}),l(25,"sh-icon"),p(26,"x-bold"),r()()(),l(27,"app-toggle-card",29),pe(28,30),l(29,"span"),y(30,6),r(),P(31,"div",31),g(32,rl,4,1),l(33,"sh-menu")(34,"button",32)(35,"sh-icon"),p(36,"dots-three-vertical"),r()(),pe(37,33),l(38,"button",24),T("click",function(){return n.togglePathBulkEdit()}),M(39,7),P(40,"sh-icon"),g(41,sl,1,0)(42,_l,1,0),x(),r(),ce(),r(),ce(),g(43,cl,2,0,"p",34)(44,dl,2,0,"p",34),l(45,"div",35),g(46,ul,2,3,"sh-form-field")(47,Sl,8,1),r()(),l(48,"app-filters",36),k("filtersChange",function(_){return S(o),$(n.filters,_)||(n.filters=_),f(_)}),T("filtersChange",function(_){return n.updateFilters(_)}),r(),l(49,"app-toggle-card",37),pe(50,30),y(51,8),ce(),l(52,"p",34),y(53,9),r(),l(54,"sh-toggle",38),T("checkedChange",function(_){return n.toggleFilesLargerThan(_)}),y(55,10),r(),g(56,fl,2,3,"div",39),r()()()}e&2&&(u("formGroup",n.sourceDataForm),c(9),u("multiSelect",!0)("startingPath",n.getPath())("showFiles",!0),c(11),Fe("open",n.mobileMenuOpen()),c(7),u("disableToggle",!0),c(5),C(n.bulkPathEditMode()?-1:32),c(9),C(n.bulkPathEditMode()?41:42),c(2),C(n.bulkPathEditMode()?44:43),c(3),C(n.bulkPathEditMode()?46:47),c(2),U("filters",n.filters),u("osType",n.osType()??""),c(),u("disableToggle",!0),c(5),u("checked",n.filesLargerThan()!==null),c(2),C(n.filesLargerThan()?56:-1))},dependencies:[se,Et,ee,te,ft,re,qe,Fn,Nt,Ft,Nn,ue,Q,Y,ve,Qe,kt,Ye,Xe,Gt,At],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}@media only screen and (max-width:768px){form[_ngcontent-%COMP%]{display:block;position:relative}}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.header-row[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.mobile-header[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:1.5rem}}.mobile-menu-toggle[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.mobile-menu-toggle[_ngcontent-%COMP%]{display:inline-flex}}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-4)}@media only screen and (max-width:768px){.left[_ngcontent-%COMP%]{border-right:none;padding:1.5rem 1.5rem 4.5rem;height:100%;width:100%}}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}@media only screen and (max-width:768px){.right[_ngcontent-%COMP%]{position:absolute;inset:0;z-index:10;background:var(--base-1);padding:1.5rem;transform:translate(100%);transition:transform .3s cubic-bezier(.4,0,.2,1)}.right.open[_ngcontent-%COMP%]{transform:translate(0)}}.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}.path[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content min-content;gap:.25rem;align-items:center}.path[_ngcontent-%COMP%] sh-chip[_ngcontent-%COMP%]{width:100%}.path[_ngcontent-%COMP%] .provider-icon[_ngcontent-%COMP%]{width:1rem;height:1rem;margin-right:.5rem}.bulk-textarea[_ngcontent-%COMP%]{width:100%;font-family:monospace;min-height:12.5rem}.paths[_ngcontent-%COMP%]{max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:.5rem}"],changeDetection:0})};var Bn="1W:1D,4W:1W,12M:1M",Zt=!1,Oe=class i{#e=O(we);#t=O(ge);#n=O(Ge);#i=O(xt);#o=O(Rt);#s=O($t);#a=O(Ze);generalForm=Kn();sourceDataForm=Vn();scheduleFields=qt();scheduleType=h("daily");settings=h([]);optionsFields={backupRetention:h("all"),backupRetentionTime:h(""),backupRetentionVersions:h(0),backupRetentionCustom:h("")};targetUrls=h([]);targetUrlModel=R(()=>this.targetUrls()[0]?.url??null);connectionStringId=R(()=>this.targetUrls()[0]?.connectionStringId??null);targetUrlTestSignal=h(null);backupMetadata=h(null);isDraft=h(!1);backupId=h(null);backupName=R(()=>this.generalFormSignal()?.name??"");isSubmitting=h(!1);finishedLoading=h(!1);backupDefaults=h(null);applicationOptions=h(null);isNew=R(()=>this.backupId()==="new");shouldAutoSave=R(()=>!this.isDraft()&&!this.isNew());osType=R(()=>this.#t.systemInfo()?.OSType);isConnectionStringSaved=R(()=>{let t=this.targetUrlModel();return t?this.#a.destinations().some(e=>e.BaseUrl===t):!1});selectedOptions=h([]);sourceDataFormSignal=Ue(this.sourceDataForm.valueChanges);generalFormSignal=Ue(this.generalForm.valueChanges);encryptionFieldSignal=Ue(this.generalForm.controls.encryption.valueChanges);advancedOptions=R(()=>this.#t.systemInfo()?.Options?.map(this.#u)??[]);#l=h(null);#r=null;testSignal=this.#l.asReadonly();#_=q(()=>{let t=this.targetUrlModel(),e=this.#l(),n=this.#r;this.#r=t,!(e==="testing"||n===null||n===t)&&this.#l.set(null)});#g=q(()=>{let t=this.targetUrlModel(),e=this.connectionStringId();if(e){let n=this.#a.destinations();if(n.length===0)return;let o=n.find(a=>a.ID===e);!o||o.BaseUrl}});setTestState(t){this.#l.set(t)}#u(t){return{name:t.Name,type:t.Type,shortDescription:t.ShortDescription??void 0,longDescription:t.LongDescription??void 0,options:t.ValidValues}}encryptionOptions=R(()=>{let t=this.#t.systemInfo()?.EncryptionModules??[];return[_t,...t]});nonSelectedOptions=R(()=>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),this.#p().pipe(dt(e=>{let n=this.#c(),o=this.backupId(),a=n;if(a.Backup){e.length>0&&e[0]!==null?n.Backup.ConnectionStringID=e[0]:e.length>0&&e[0]===null&&(n.Backup.ConnectionStringID=void 0);let d=this.targetUrls().slice(1).map((m,N)=>{let F=e[N+1];return{TargetUrl:m.url,ConnectionStringID:F??void 0,UrlKey:m.urlKey}});d.length>0&&(a.Backup.AdditionalTargetURLs=d)}return this.isDraft()&&n.Backup&&(n.Backup.Metadata=this.backupMetadata()),o==="new"||!o||this.isDraft()?this.#i.postApiV1Backups({requestBody:n}):this.#i.putApiV1BackupById({id:o,requestBody:n})}),Be(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{t||this.exit(!1)},error:()=>{}})}validateBeforeSubmit(){this.generalForm.markAllAsTouched(),this.sourceDataForm.markAllAsTouched();let t=this.#c(),e=(t.Backup.Name??"").trim()!=="",o=(this.generalForm.controls.encryption.value!==""&&this.generalForm.controls.encryption.value!=="-")===!1||this.generalForm.controls.password.value===this.generalForm.controls.repeatPassword.value&&this.generalForm.controls.password.value!=="";if(!e||!o)return this.#n.open(ne,{data:{title:$localize`Validation Error`,message:this.isNew()?$localize`Please fix the errors indicated before creating the backup.`:$localize`Please fix the errors indicated before saving.`,confirmText:$localize`OK`}}),"general";let a=this.targetUrls();if(!(a.length>0&&a.some(m=>m.url.trim()!=="")))return this.#n.open(ne,{data:{title:$localize`Destination required`,message:this.isNew()?$localize`You must setup a destination before creating the backup.`:$localize`Please setup a destination before saving.`,confirmText:$localize`OK`}}),"destination";var d=(t.Backup.Sources??[]).filter(m=>m.trim()!=="").length>0;return!d||!this.sourceDataForm.valid?(this.#n.open(ne,{data:{title:$localize`Source data required`,message:this.isNew()?$localize`You must setup source data before creating the backup.`:$localize`Please add at least one source path before saving.`,confirmText:$localize`OK`}}),"source"):""}exit(t){if(!t){this.#d(),this.#e.navigate(["/"]);return}this.#n.open(ne,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#d(),this.#e.navigate(["/"]))}})}mapSourceDataToForm(t){let e=t.Sources??"",n=t.Filters?.map(_=>`${_.Include?"+":"-"}${_.Expression}`)??[],o=t.Settings?.find(_=>_.Name==="--skip-files-larger-than")?.Value?.toUpperCase()??null,a={path:[...e,...n].join("\0"),excludes:{filesLargerThan:o===null?void 0:wt(o)}};this.sourceDataForm.patchValue(a)}mapDestinationToForm(t){let e=t,n=t.TargetURL??"",o=(t.ConnectionStringID===-1?null:t.ConnectionStringID)??null,a=n?[{url:n,connectionStringId:o,urlKey:null,save:!!o}]:[],_=e.AdditionalTargetURLs?.map(d=>({url:d.TargetUrl,urlKey:d.UrlKey,connectionStringId:d.ConnectionStringID??null,save:!!d.ConnectionStringID}))??[];this.targetUrls.set([...a,..._])}mapGeneralToForm(t){let e=t.Name??"",n=t.Description??"",o=t.Settings?.find(m=>m.Name==="encryption-module"),a=t.Settings?.find(m=>m.Name==="passphrase")?.Value??"",_=o?.Value&&o.Value.length?o.Value:"",d={name:t.Name??"",description:t.Description??""};e&&e!==""&&(d.name=e),n&&n!==""&&(d.description=n),_&&_!==""&&(d.encryption=_),a&&a!==""&&(d.password=a,d.repeatPassword=a),this.generalForm.patchValue(d)}mapScheduleToForm(t){if(!t){this.scheduleType.set("disabled"),this.scheduleFields.autoRun.set(!1);return}let e=this.#s.fromString(t.Repeat)??null,n=this.#m(t.Time);this.scheduleFields.autoRun.set(!0),n.date&&this.scheduleFields.nextTime.date.set(n.date),this.scheduleFields.nextTime.time.set(n.time),this.scheduleFields.runAgain.repeatUnit.set(e?.unit??"D"),this.scheduleFields.runAgain.repeatValue.set(e?.value??1),this.scheduleFields.runAgain.allowedDays.mon.set(t.AllowedDays?.includes("mon")??!1),this.scheduleFields.runAgain.allowedDays.tue.set(t.AllowedDays?.includes("tue")??!1),this.scheduleFields.runAgain.allowedDays.wed.set(t.AllowedDays?.includes("wed")??!1),this.scheduleFields.runAgain.allowedDays.thu.set(t.AllowedDays?.includes("thu")??!1),this.scheduleFields.runAgain.allowedDays.fri.set(t.AllowedDays?.includes("fri")??!1),this.scheduleFields.runAgain.allowedDays.sat.set(t.AllowedDays?.includes("sat")??!1),this.scheduleFields.runAgain.allowedDays.sun.set(t.AllowedDays?.includes("sun")??!1);let o=lt(this.scheduleFields),a=vt.find(_=>JSON.stringify(_.data)===JSON.stringify(o));a?this.scheduleType.set(a.value):this.scheduleType.set("custom")}mapOptionsToForms(t,e=!1){let n=["--no-encryption","--skip-files-larger-than","passphrase","keep-time","keep-versions","retention-policy"],o=(t.Settings??[]).map(m=>m);if(e){let m=this.#o.serverSettings()??{};Object.keys(m).filter(N=>N.startsWith("--")).forEach(N=>{o.find(A=>A.Name===N)||o.push({Name:N,Value:m[N],Filter:null})})}let a=o.filter(m=>!n.includes(m.Name)),_=o.filter(m=>n.includes(m.Name));this.settings.set(a??[]),a?.forEach(m=>{if(m.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(m.Value??"")});var d="all";_?.forEach(m=>{if(m.Name==="keep-time"&&(m.Value??"")!=="")return d="time",this.optionsFields.backupRetentionTime.set(m.Value??"");if(m.Name==="keep-versions"&&(m.Value??"")!=="")return d="versions",this.optionsFields.backupRetentionVersions.set(m.Value?parseInt(m.Value):null);if(m.Name==="retention-policy"&&(m.Value??"")!=="")if(m.Value===Bn)d="smart";else return d="custom",this.optionsFields.backupRetentionCustom.set(m.Value??"")}),this.optionsFields.backupRetention.set(d)}storeMetadata(t,e){this.backupMetadata.set(e?t.Metadata??null:null)}getScheduleFormValue(){let t=lt(this.scheduleFields);return kn(t)}#c(){let t=this.generalForm.value,e=this.getScheduleFormValue(),n=this.sourceDataForm.value,a=this.targetUrls()[0],_=a?.url??null,d=n.path?.split("\0")??[],m=this.mapFormsToSettings(),N=n.excludes?.filesLargerThan;return N&&N.size!==null&&N.unit!==null&&m.push({Name:"--skip-files-larger-than",Value:`${N.size}${N.unit}`}),{Backup:{Name:t.name,Description:t.description,TargetURL:_??null,ConnectionStringID:a?.connectionStringId??null,Sources:d.filter(F=>!(F.startsWith("-")||F.startsWith("+"))),Settings:m,Filters:d.filter(F=>F.startsWith("-")||F.startsWith("+")).map((F,A)=>({Order:A,Include:F.startsWith("+"),Expression:F.slice(1)}))},Schedule:e}}mapFormsToSettings(t=[]){let e=this.generalForm.value,n=["dblock-size","compression-module"],o=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy",...n,...n.map(F=>`--${F}`)],a=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&e.encryption!==_t.Key&&(a=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let _=n.map(F=>{let A=this.settings().find(L=>L.Name===F||L.Name==="--"+F);return A?{Name:F,Value:A.Value}:null}).filter(F=>F!==null),d=[];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:Bn});break}let m=[...t,...o],N=this.settings().filter(F=>!m.includes(F.Name)).map(F=>{let A=F.Value;return typeof F.Value=="number"&&(A=F.Value.toString()),typeof F.Value=="boolean"&&(A=F.Value?"True":"False"),{Name:F.Name?.startsWith("--")?F.Name:`--${F.Name}`,Value:A}});return[...a,..._,...d,...N]}#p(){let t=this.targetUrls();if(t.length===0)return Ve([]);let e=t.map(n=>{if(n.connectionStringId)return Ve(n.connectionStringId);if(!n.save)return Ve(null);let o=n.url,_=Pe(o)?.displayName??"Destination",m=this.#a.destinations().filter(A=>A.Name?.startsWith(_)).length,F={Name:`${_} ${new Date().toISOString()}`,Description:null,BaseUrl:o};return this.#a.save("new",F).pipe(ot(A=>A.Data?.ID??null))});return sn(e).pipe(un(n=>{let o=this.targetUrls();n.forEach((a,_)=>{if(a&&_<o.length&&(this.#a.reload(),o[_].connectionStringId!==a)){let d=o[_].urlKey;this.updateTargetUrl(_,o[_].url,a,d)}})}))}#m(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.getFullYear()).padStart(4,"0")}-${(""+(e.getMonth()+1)).padStart(2,"0")}-${(""+e.getDate()).padStart(2,"0")}`}}setTargetUrl(t,e=!1,n=null,o=null){if(e&&(this.#r=null),t===null){this.targetUrls.set([]);return}this.targetUrls.update(a=>{let _=[...a];return _.length===0?_.push({url:t,urlKey:o,connectionStringId:n,save:n?!0:Zt}):_[0]={url:t,urlKey:o,connectionStringId:n,save:n?!0:Zt},_})}addTargetUrl(t,e,n){this.targetUrls.update(o=>[...o,{url:t,connectionStringId:e,urlKey:n,save:e?!0:Zt}])}updateTargetUrl(t,e,n,o){this.targetUrls.update(a=>{if(t<0||t>=a.length)return a;let _=[...a],d=_[t].save;return _[t]={url:e,connectionStringId:n,urlKey:o,save:n?!0:d},_})}toggleSaveConnectionString(t){this.targetUrls.update(e=>{if(t<0||t>=e.length)return e;let n=[...e];return n[t]=oe(W({},n[t]),{save:!n[t].save}),n})}removeTargetUrl(t){this.targetUrls.update(e=>e.filter((n,o)=>o!==t))}#d(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleFields=qt(),this.optionsFields.backupRetention.set("all"),this.settings.set([]),this.targetUrls.set([])}static \u0275fac=function(e){return new(e||i)};static \u0275prov=Ne({token:i,factory:i.\u0275fac,providedIn:"root"})};var El=["formRef"];function hl(i,t){i&1&&(l(0,"sh-alert",17),M(1,5),P(2,"sh-icon",26),x(),r())}function Fl(i,t){if(i&1&&p(0),i&2){let e=t.$implicit;V(" ",e.DisplayName," ")}}function Nl(i,t){if(i&1&&P(0,"sh-progress-bar",40),i&2){let e=s(3);Fe("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),u("value",e.calculatePasswordStrength()*(100/5))}}function Dl(i,t){i&1&&(l(0,"span",35),y(1,10),r())}function yl(i,t){i&1&&(M(0,8,1),P(1,"sh-icon"),x())}function Al(i,t){i&1&&(M(0,8,2),P(1,"sh-icon"),x())}function Il(i,t){i&1&&(M(0,11,1),P(1,"sh-icon",42),x())}function Pl(i,t){i&1&&(M(0,11,2),P(1,"sh-icon"),x())}function Ol(i,t){if(i&1){let e=I();l(0,"button",41),T("click",function(){S(e);let o=s(3);return f(o.copyPassword())}),M(1,11),g(2,Il,2,0)(3,Pl,2,0),x(),r()}if(i&2){let e=s(3);c(2),C(e.copiedPassword()?2:3)}}function Ml(i,t){i&1&&(l(0,"sh-alert",39),y(1,12),r())}function xl(i,t){if(i&1){let e=I();l(0,"div",30)(1,"sh-form-field")(2,"label",31),M(3,7),P(4,"sup"),x(),r(),P(5,"input",32),r(),g(6,Nl,1,9,"sh-progress-bar",33),l(7,"sh-form-field"),P(8,"input",34),g(9,Dl,2,0,"span",35),r(),l(10,"div",36)(11,"button",37),T("click",function(){S(e);let o=s(2);return f(o.showPassword.set(!o.showPassword()))}),M(12,8),g(13,yl,2,0)(14,Al,2,0),x(),r(),l(15,"button",37),T("click",function(){S(e);let o=s(2);return f(o.generatePassword())}),M(16,9),P(17,"sh-icon"),x(),r(),g(18,Ol,4,1,"button",38),r(),g(19,Ml,2,0,"sh-alert",39),r()}if(i&2){let e=s(2);c(5),u("type",e.showPassword()?"text":"password"),c(),C(e.generalForm.value.password?6:-1),c(2),u("type",e.showPassword()?"text":"password"),c(),C(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),c(4),C(e.showPassword()?13:14),c(5),C(e.showCopyPassword()?18:-1),c(),C(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function Rl(i,t){if(i&1&&(l(0,"sh-select",27)(1,"label",28),y(2,6),r(),P(3,"input",29),H(4,Fl,1,1,"ng-template"),r(),g(5,xl,20,7,"div",30)),i&2){let e=s();u("options",e.encryptionOptions())("isClearable",!1),c(5),C(e.encryptionFieldSignal()!==e.noneOptionKey?5:-1)}}function Ll(i,t){if(i&1&&(l(0,"button",24),M(1,13),P(2,"sh-icon"),x(),r()),i&2){let e=s();u("disabled",e.nameAndDescriptionValid()===!1)}}function bl(i,t){if(i&1&&(l(0,"button",25),M(1,14),P(2,"sh-icon"),x(),r()),i&2){let e=s();u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var it=new Dt,Kn=(i={name:"",description:"",encryption:"",password:"",repeatPassword:"",compression:""})=>it.group({name:it.control(i.name,[St.required]),description:it.control(i.description),encryption:it.control(i.encryption,[vn()]),password:it.control(i.password,[Ht(t=>t?.value.encryption!=="-",[St.required])]),repeatPassword:it.control(i.repeatPassword,[Ht(t=>t?.value.encryption!=="-",[St.required])])}),_t={Key:"-",DisplayName:"None"},en=class i{#e=O(we);#t=O(je);#n=O($n);#i=O(Oe);formRef=Ie.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=h(!1);copiedPassword=h(!1);showCopyPassword=h(!1);noneOptionKey=_t.Key;encryptionEffect=q(()=>{this.encryptionFieldSignal()===_t.Key&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=R(()=>{let t=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=R(()=>{let e=this.generalFormSignal()?.password??"";return this.#n.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.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.#n.generate(41);this.generalForm.controls.password.setValue(t),this.generalForm.controls.repeatPassword.setValue(t),this.showCopyPassword.set(!0)}next(){this.#i.shouldAutoSave()&&this.#i.submit(!0),this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=z({type:i,selectors:[["app-general"]],viewQuery:function(e,n){e&1&&De(n.formRef,El,5),e&2&&ye()},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 o;o=$localize`General backup settings`;let a;a=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let _;_=$localize`Backup description`;let d;d=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Exit `;let m;m=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Encrypted backup `;let N;N=$localize`Encryption`;let F;F=$localize`Encryption`;let A;A=$localize`Password`;let L;L=$localize`Repeat password`;let v;v=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let D;D=$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:`,D=Ke(D);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON: Generate password `;let J;J=$localize`Passwords do not match`;let b;b=$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:`,b=Ke(b);let w;w=$localize` Tip: Be sure to save your password. If you lose it, you will lose access to your backups. `;let Me;Me=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let xe;return xe=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`,[["formRef",""],o,a,_,d,m,F,v,D,K,J,b,w,Me,xe,["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",N,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",A,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",L,"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&&(l(0,"form",15,0),T("submit",function(){return n.next()}),l(2,"h3",16),y(3,1),r(),g(4,hl,3,0,"sh-alert",17),l(5,"sh-form-field")(6,"label",18),M(7,2),P(8,"sup"),x(),r(),P(9,"input",19),r(),l(10,"sh-form-field")(11,"label",20),y(12,3),r(),P(13,"textarea",21),r(),g(14,Rl,6,3),l(15,"div",22)(16,"button",23),T("click",function(){return n.exit()}),M(17,4),P(18,"sh-icon"),x(),r(),g(19,Ll,3,1,"button",24)(20,bl,3,1,"button",25),r()()),e&2){let o;u("formGroup",n.generalForm),c(4),C(!n.isNew()&&((o=n.generalFormSignal())==null?null:o.encryption)!==""?4:-1),c(10),C(n.isNew()?14:-1),c(5),C(n.encryptionFieldSignal()===n.noneOptionKey||!n.isNew()?19:20)}},dependencies:[qe,Et,ee,te,ft,Nt,Ft,ue,$e,Y,Q,It,yt,Mt],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{Ze as a,et as b,Vt as c,Kn as d,_t as e,en as f,vt as g,kn as h,qt as i,jt as j,Xe as k,kt as l,Xt as m,st as n,Vn as o,Qt as p,Oe as q,Kt as r};
@@ -0,0 +1 @@
1
+ import{a as D}from"./chunk-NUV5LHQV.js";import{c as j,e as V}from"./chunk-PDZNQW6F.js";import{z as b}from"./chunk-CJKZ27FM.js";import{a as x,d as v}from"./chunk-KNSQLQC6.js";import{ma as L}from"./chunk-YF6JHIN5.js";import{$ as a,Gc as W,Hb as N,Ib as C,Ic as $,Jb as _,N as R,Rc as p,Ta as M,Ub as A,Vb as w,W as h,Wb as P,Xb as F,Yb as G,f as m,g as y,hb as I,qa as n,sa as O}from"./chunk-K5XGRFWJ.js";var S=class r{reconnectTimer=n(15e3);countdown=n(0);connectTimerEffect=O(()=>{let e=this.reconnectTimer();this.countdown.set(e/1e3)});interval=setInterval(()=>{if(this.countdown()<=1){this.countdown.set(this.reconnectTimer()/1e3);return}this.countdown.set(this.countdown()-1)},1e3);ngOnDestroy(){clearInterval(this.interval)}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=I({type:r,selectors:[["app-disconnected-dialog"]],decls:8,vars:4,consts:()=>{let e;e=$localize`Reconnecting...`;let t;return t=$localize` The connection to the server is lost, attempting again in ${"\uFFFD#6\uFFFD"}:START_TAG_STRONG:0:${"\uFFFD0\uFFFD"}:INTERPOLATION:${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_STRONG:`,[e,t,["header",""],["content",""]]},template:function(t,s){t&1&&(N(0,"header",2)(1,"h3"),P(2,0),C()(),N(3,"div",3)(4,"p"),A(5,1),_(6,"strong"),W(7,"number"),w(),C()()),t&2&&(M(7),F($(7,1,s.countdown(),"2.0-0")),G(5))},dependencies:[L],styles:["[_nghost-%COMP%]{display:block;padding:1rem}"],changeDetection:0})};var l=!1,T=class r{#e=a(V);#n=a(D);dialog=a(b);#s=null;#t=n("disconnected");#i=n(null);#a=n(null);#u=n(null);#o=n(null);#r=n(null);#d=n(null);#c=n(null);#h=void 0;#l=n({legacystatus:!0});shouldConnect=n(!0);connectionStatus=this.#t.asReadonly();serverState=this.#i.asReadonly();serverProgress=this.#a.asReadonly();serverSettings=this.#u.asReadonly();subscriptions=this.#l.asReadonly();serverTaskQueue=this.#o.asReadonly();backupListState=this.#r.asReadonly();notificationState=this.#d.asReadonly();remoteControlState=this.#c.asReadonly();#S=null;taskCompleted=new m(e=>{this.#S=e});#f=0;#p=null;start(){this.shouldConnect.set(!0),this.#m()}#m(){this.#p&&(clearTimeout(this.#p),this.#p=null);let e=this.#e.token();if(!e){console.error("No access token available");return}let t=window.location.protocol==="https:"?"wss:":"ws:",s=window.location.port?`:${window.location.port}`:"";window.location.port==="4200"&&(s=":8200");let u=window.location.hostname,g=x.BASE||"",f=this.#e.xsrfQueryParam(),Q=this.#n.hasWebSocketAuth()?`${t}//${u}${s}${g}/notifications${f?`?${f}`:""}`:`${t}//${u}${s}${g}/notifications?token=${e}${f?`&${f}`:""}`;this.#t.set("connecting"),this.#s=new WebSocket(Q),this.#s.onopen=()=>{l&&console.log("WebSocket connection established"),this.#n.hasWebSocketAuth()?(this.#t.set("authenticating"),this.#s?.send(JSON.stringify({Version:1,Token:e,Action:"auth"}))):this.#g()},this.#s.onmessage=d=>{if(this.#t()==="authenticating")try{let i=JSON.parse(d.data);if(i.Success){l&&console.log("WebSocket authentication successful"),this.#g();return}else if(i?.Type==="legacystatus")l&&console.log("WebSocket authentication successful"),this.#g();else{console.error("WebSocket authentication failed:",i.Message),this.#t.set("disconnected"),this.#e.refreshToken().subscribe({next:()=>{this.reconnect()},error:o=>{console.error("Error refreshing token after WebSocket auth failed",o)}});return}}catch(i){console.error("Error parsing WebSocket authentication reply",i),this.#t.set("disconnected");return}try{let i=JSON.parse(d.data),c=i?.Type;if(c==="legacystatus"||c==null)l&&console.log("Received legacy status update:",i),this.#i.set(i);else if(c==="reply"){let o=i;o.Success||console.error("WebSocket reply error:",o.Message)}else if(c==="progress"){let o=i;l&&console.log("Received progress update:",o.Data),this.#a.set(o.Data)}else if(c==="serversettings"){let o=i;l&&console.log("Received server settings update:",o.Data),this.#u.set(o.Data)}else if(c==="taskqueue"){let o=i;l&&console.log("Received task update:",o.Data),this.#o.set(o.Data)}else if(c==="taskcompleted"){let o=i;l&&console.log("Received task completed:",o.Data),this.#S?.next(o.Data)}else if(c==="backuplist"){let o=i;l&&console.log("Received backup list update:",o.Data),this.#r.set(o.Data)}else if(c==="notifications"){let o=i;l&&console.log("Received notification update:",o.Data),this.#d.set(o.Data)}else if(c==="remotecontrol"){let o=i;l&&console.log("Received remote control update:",o.Data),this.#c.set(o.Data)}else console.warn("Unknown WebSocket message type:",c)}catch(i){console.error("Error parsing WebSocket message",i)}},this.#s.onclose=d=>{l&&console.log("WebSocket connection closed",d),this.#t.set("disconnected");var i=d.code===4401;i&&this.#e.refreshToken().subscribe({next:()=>{this.reconnect()},error:c=>{console.error("Error refreshing token",c)}}),this.shouldConnect()&&(this.#h||(this.#h=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1}),this.#h.component.reconnectTimer.set(15e3)),this.#p&&clearTimeout(this.#p),this.#p=setTimeout(()=>this.#m(),5e3))},this.#s.onerror=d=>{console.error("WebSocket error",d),this.#t.set("disconnected")}}#g(){this.#t.set("connected");let e=this.#l();Object.keys(e).length>0&&Object.entries(e).forEach(([t,s])=>{s!=null&&this.sendSubscribeRequest(t,s)}),this.#h&&this.#h.close()}stop(){this.shouldConnect.set(!1),this.#s?.close()}reconnect(){this.#s?.close(),this.start()}reconnectIfNeeded(){this.#s?.readyState!==WebSocket.OPEN&&this.reconnect()}sendSubscribeRequest(e,t){this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#f}`,Action:"sub",Service:e,Data:t||null}))}subscribe(e,t=void 0){let s=this.#l(),u=s[e];(!u||JSON.stringify(u)!==JSON.stringify(t||!0))&&(s[e]=t||!0,this.#l.set(s),this.#t()=="connected"&&this.sendSubscribeRequest(e,t))}unsubscribe(e){let t=this.#l();t[e]&&(delete t[e],this.#l.set(t),this.#t()=="connected"&&this.#s?.send(JSON.stringify({Version:1,Id:`req-${++this.#f}`,Action:"unsub",Service:e})))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var k=class r{dialog=a(b);#e=a(v);#n=n("disconnected");#s=n(null);#t=n(-1);#i=n(0);#a=n(!1);#u=new y;connectionStatus=this.#n.asReadonly();serverState=this.#s.asReadonly();#o=void 0;duration=a(j).relayIsEnabled()?"94s":"299s";start(){this.#a.set(!0),this.#u=new y,this.#r()}stop(){this.#u.next(),this.#u.complete(),this.#a.set(!1)}reconnect(){this.stop(),this.start()}reconnectIfNeeded(){this.#a()||this.reconnect()}#r(){this.#n.set("connecting"),this.#e.getApiV1Serverstate({lastEventId:this.#t(),longpoll:this.#t()>=0,duration:this.duration}).pipe(R(this.#u)).subscribe({next:e=>{e&&this.#d(e),this.#c()},error:e=>{let s=this.#i()+1,u=Math.min(5e3*s,3e4);this.#i.set(s),s>3&&this.#n.set("disconnected"),this.#o||(this.#o=this.dialog.open(S,{closeOnButton:!1,closeOnEsc:!1,closeOnOutsideClick:!1})),this.#o.component.reconnectTimer.set(u),setTimeout(()=>{this.#r()},u)}})}#d(e){this.#n.set("connected"),this.#s.set(e),this.#t.set(e.LastEventID??-1),this.#i.set(0)}#c(){this.#a()&&this.#r()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};var q=10,J=class r{#e=a(T);#n=a(k);#s=a(v);#t=a(D);#i=n("longpoll");#a=n(!1);#u=p(()=>this.#t.hasTaskCompletedOption()&&this.#i()==="websocket");#o={};#r=null;#d=!1;#c=[];constructor(){this.#e.subscribe("taskcompleted"),this.#e.taskCompleted.subscribe(e=>{if(this.#c.unshift(e),this.#c.length>q&&this.#c.pop(),!e.ID)return;let t=this.#o[e.ID];t&&(t.forEach(s=>{s.next(e),s.complete()}),delete this.#o[e.ID])})}connectionStatus=p(()=>this.#i()==="websocket"?this.#e.connectionStatus():this.#n.connectionStatus());isConnectionMethodSet=this.#a.asReadonly();serverState=p(()=>this.#i()==="websocket"?this.#e.serverState():this.#n.serverState());progressState=this.#e.serverProgress;taskQueueState=this.#e.serverTaskQueue;activeTaskQueueState=p(()=>this.#i()==="websocket"?this.#e.serverTaskQueue()?.map(t=>t.ID).filter(t=>t)??[]:(this.#n.serverState()?.SchedulerQueueIds??[]).map(t=>t.Item1).filter(t=>t));backupListState=p(()=>this.#e.backupListState());setConnectionMethod(e){e==="websocket"?(this.#e.reconnectIfNeeded(),this.#n.stop()):(this.#n.reconnectIfNeeded(),this.#e.stop()),this.#i.set(e),this.#a.set(!0)}getConnectionMethod(){return this.#i()}subscribe(e,t=null){this.#e.subscribe(e,t)}unsubscribe(e){this.#e.unsubscribe(e)}waitForTaskToComplete(e){return new m(t=>{let s=this.#c.find(u=>u.ID===e);if(s){t.next(s),t.complete();return}this.#o[e]=this.#o[e]||[],this.#o[e].push(t),this.#h()})}#h(){this.#d||this.#u()||(this.#d=!0,this.#l())}#l(){let e=Object.keys(this.#o).map(s=>parseInt(s,10));if(e.length===0){this.#S();return}let t=Math.min(...e);this.#s.getApiV1TaskByTaskid({taskid:t}).subscribe({next:s=>{s.TaskFinished!=null&&(this.#c.unshift(s),this.#c.length>q&&this.#c.pop(),this.#o[t].forEach(g=>{g.next(s),g.complete()}),delete this.#o[t])},complete:()=>{this.#r=window.setTimeout(()=>{this.#l()},1e3)},error:s=>{this.#r=window.setTimeout(()=>{this.#l()},3e3)}})}#S(){this.#r!==null&&(clearTimeout(this.#r),this.#r=null),this.#d=!1}static \u0275fac=function(t){return new(t||r)};static \u0275prov=h({token:r,factory:r.\u0275fac,providedIn:"root"})};export{T as a,J as b};
@@ -0,0 +1 @@
1
+ import{a as ne}from"./chunk-VZNLMGYP.js";import{q as ee}from"./chunk-O2L2FRYE.js";import"./chunk-PNQ5BDQN.js";import{d as Z}from"./chunk-2EX5HS5X.js";import"./chunk-EVEI25GQ.js";import"./chunk-6Q6SSTBK.js";import"./chunk-COEGVUM3.js";import"./chunk-KZYRTI62.js";import"./chunk-TSVSMVY4.js";import"./chunk-2KD757N6.js";import"./chunk-OP7MDR2B.js";import"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import{B as j,H as Q,P as q,c as X,e as W,i as z,k as V,s as H,v as Y}from"./chunk-CJKZ27FM.js";import"./chunk-KNSQLQC6.js";import{b as U,d as J}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as C,Bc as D,Db as m,Eb as i,Fb as a,Gb as P,Nb as g,Ta as p,Ub as N,Vb as E,Wb as l,Yc as K,_b as f,ac as c,ea as O,fa as S,hb as $,hc as v,ic as B,lc as x,qa as w,tc as d,uc as T,vc as u,xb as L,yb as G}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var te=["formRef"],ie=()=>["--skip-files-larger-than","encryption-module","no-encryption","--no-encryption","--dbpath","keep-time","keep-versions","retention-policy"];function oe(s,r){s&1&&(i(0,"p"),l(1,4),a())}function ae(s,r){if(s&1){let n=g();i(0,"p"),l(1,5),a(),i(2,"app-timespan",21),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionTime,o)||(t.optionsFields.backupRetentionTime=o),S(o)}),i(3,"label",22),l(4,6),a()()}if(s&2){let n=c();p(2),m("customId","backupRetentionTime"),d("ngModel",n.optionsFields.backupRetentionTime)}}function se(s,r){if(s&1){let n=g();i(0,"p"),l(1,7),a(),i(2,"sh-form-field")(3,"label",23),l(4,8),a(),i(5,"input",24),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionVersions,o)||(t.optionsFields.backupRetentionVersions=o),S(o)}),a()()}if(s&2){let n=c();p(5),d("ngModel",n.optionsFields.backupRetentionVersions)}}function _e(s,r){s&1&&(i(0,"p"),l(1,9),a())}function le(s,r){if(s&1){let n=g();i(0,"p"),l(1,10),a(),i(2,"sh-form-field")(3,"p"),l(4,11),a(),i(5,"label",25),l(6,12),a(),i(7,"input",26),u("ngModelChange",function(o){O(n);let t=c();return T(t.optionsFields.backupRetentionCustom,o)||(t.optionsFields.backupRetentionCustom=o),S(o)}),a()()}if(s&2){let n=c();p(7),d("ngModel",n.optionsFields.backupRetentionCustom)}}var re=[{value:"all",name:$localize`Keep all backups`},{value:"time",name:$localize`Delete backups that are older than`},{value:"versions",name:$localize`Keep a specific number of backups`},{value:"smart",name:$localize`Smart backup retention`},{value:"custom",name:$localize`Custom backup retention`}],h=class s{#e=C(ee);#n=C(J);#t=C(U);formRef=K.required("formRef");isSubmitting=this.#e.isSubmitting;settings=this.#e.settings;optionsFields=this.#e.optionsFields;applicationOptions=this.#e.applicationOptions;retentionOptions=w(re);goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#t.parent})}submit(){switch(this.#e.validateBeforeSubmit()){case"general":this.#n.navigate(["general"],{relativeTo:this.#t.parent});return;case"destination":this.#n.navigate(["destination"],{relativeTo:this.#t.parent});return;case"source":this.#n.navigate(["source-data"],{relativeTo:this.#t.parent});return}this.#e.submit()}static \u0275fac=function(n){return new(n||s)};static \u0275cmp=$({type:s,selectors:[["app-advanced-options-settings"]],viewQuery:function(n,e){n&1&&v(e.formRef,te,5),n&2&&B()},decls:20,vars:12,consts:()=>{let r;r=$localize`Options`;let n;n=$localize`Backup retention`;let e;e=$localize`${"\uFFFD#16\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#16\uFFFD"}:CLOSE_TAG_SH_ICON: Go back `;let o;o=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SH_ICON: Submit `;let t;t=$localize`Nothing will be deleted. The backup size will grow with each change.`;let M;M=$localize`If at least one newer backup is found, all backups older than this date are deleted.`;let I;I=$localize`Time to keep versions`;let R;R=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let b;b=$localize`Number of versions`;let y;y=$localize` Over time backups will be deleted automatically. There will remain one backup for each of the last 7 days, each of the last 4 weeks, each of the last 12 months. There will always be at least one remaining backup. `;let A;A=$localize` Enter a retention strategy manually. Placeholders are D/W/Y for days/weeks/years and U for unlimited. The syntax is: 7D:1D,4W:1W,36M:1M. This example keeps one backup for each of the next 7 days, one for each of the next 4 weeks, and one for each of the next 36 months. This can also be written as 1W:1D,1M:1W,3Y:1M. `;let k;k=$localize`Once there are more backups than the specified number, the oldest backups are deleted.`;let F;return F=$localize`Retention expression`,[r,n,e,o,t,M,I,R,b,y,A,k,F,[1,"title-30"],["value","value","label","name",3,"options","inlineSearch","isClearable"],["for","size"],["type","text",3,"ngModelChange","ngModel"],[3,"optionsChange","options","applicationOptions","hasFreeTextSettings","hiddenOptions"],[1,"form-actions"],["shButton","","type","button",3,"click"],["shButton","",1,"raised","primary",3,"click"],[3,"ngModelChange","customId","ngModel"],["for","backupRetentionTime"],["for","backupRetentionVersions"],["type","number","id","backupRetentionVersions",3,"ngModelChange","ngModel"],["for","backupRetentionCustom"],["type","text","id","backupRetentionCustom",3,"ngModelChange","ngModel"]]},template:function(n,e){n&1&&(i(0,"section")(1,"h3",13),l(2,0),a(),i(3,"sh-select",14)(4,"label",15),l(5,1),a(),i(6,"input",16),u("ngModelChange",function(t){return T(e.optionsFields.backupRetention,t)||(e.optionsFields.backupRetention=t),t}),a()(),L(7,oe,2,0,"p")(8,ae,5,2)(9,se,6,1)(10,_e,2,0,"p")(11,le,8,1),i(12,"app-options-list",17),u("optionsChange",function(t){return T(e.settings,t)||(e.settings=t),t}),a(),i(13,"div",18)(14,"button",19),f("click",function(){return e.goBack()}),N(15,2),P(16,"sh-icon"),E(),a(),i(17,"button",20),f("click",function(){return e.submit()}),N(18,3),P(19,"sh-icon"),E(),a()()()),n&2&&(p(3),m("options",e.retentionOptions())("inlineSearch",!0)("isClearable",!1),p(3),d("ngModel",e.optionsFields.backupRetention),p(),G(e.optionsFields.backupRetention()==="all"?7:e.optionsFields.backupRetention()==="time"?8:e.optionsFields.backupRetention()==="versions"?9:e.optionsFields.backupRetention()==="smart"?10:e.optionsFields.backupRetention()==="custom"?11:-1),p(5),d("options",e.settings),m("applicationOptions",e.applicationOptions())("hasFreeTextSettings",!0)("hiddenOptions",D(11,ie)),p(5),x("loading",e.isSubmitting()))},dependencies:[H,X,V,W,z,ne,Z,j,Y,q,Q],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:37.5rem;padding:2.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 2.5rem;gap:.5rem;align-items:flex-end}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.remote-volume-wrap[_ngcontent-%COMP%] p.warning[_ngcontent-%COMP%]{color:#7d7d00}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 2.5rem;align-items:flex-end}sh-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{h as default};
@@ -0,0 +1 @@
1
+ import{g as q}from"./chunk-6WX2UOAN.js";import{a as K}from"./chunk-3HYQMG65.js";import"./chunk-O2HQIEE4.js";import"./chunk-VZNLMGYP.js";import{b as Z}from"./chunk-3PARK7B7.js";import"./chunk-O2L2FRYE.js";import"./chunk-PNQ5BDQN.js";import"./chunk-2EX5HS5X.js";import"./chunk-EVEI25GQ.js";import"./chunk-NE255HQN.js";import{b as V}from"./chunk-UIVZWXBK.js";import"./chunk-E4CYVUYG.js";import"./chunk-6Q6SSTBK.js";import{a as j}from"./chunk-COEGVUM3.js";import"./chunk-YS4B2B5N.js";import"./chunk-KZYRTI62.js";import"./chunk-TSVSMVY4.js";import"./chunk-2KD757N6.js";import{b as H}from"./chunk-OP7MDR2B.js";import"./chunk-PEOYNJJM.js";import"./chunk-NUV5LHQV.js";import"./chunk-PDZNQW6F.js";import{C as W,L as X,O as z,v as J}from"./chunk-CJKZ27FM.js";import{d as B}from"./chunk-KNSQLQC6.js";import{b as w}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import{ma as k}from"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as S,Db as C,Eb as i,Fb as s,Gb as c,Gc as T,Hc as d,Kb as P,Lb as m,Rc as x,Ta as a,Ub as A,Vb as D,Wb as r,Xb as b,Yb as v,ac as g,ga as u,ha as f,hb as I,oc as M,qa as y,rc as N,xb as O,yb as p}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";function Q(n,t){n&1&&(i(0,"div",17),u(),i(1,"svg",19),c(2,"circle",20),s(),f(),i(3,"sh-icon",21),r(4,3),s()())}function U(n,t){n&1&&(i(0,"div",18),u(),i(1,"svg",19),c(2,"circle",20),s(),f(),i(3,"sh-icon",22),r(4,4),s()())}function Y(n,t){if(n&1&&(i(0,"sh-card",10),P(1,16),r(2,2),m(),O(3,Q,5,0,"div",17)(4,U,5,0,"div",18),s()),n&2){let e=g();a(3),p(e.restoreResult()=="success"?3:4)}}function ee(n,t){if(n&1&&(M(0),T(1,"number"),T(2,"number")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileCount)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileCount)," ")}}function te(n,t){n&1&&(P(0),r(1,8),m())}function ne(n,t){if(n&1&&(M(0),T(1,"bytes"),T(2,"bytes")),n&2){let e,o=g(2);N(" ",d(1,2,(e=o.statusData())==null?null:e.ProcessedFileSize)," of ",d(2,4,(e=o.statusData())==null?null:e.TotalFileSize)," ")}}function oe(n,t){n&1&&(P(0),r(1,9),m())}function ie(n,t){if(n&1&&(i(0,"sh-card",10)(1,"h3"),A(2,5),c(3,"sh-spinner",23),D(),s(),i(4,"div",24),c(5,"sh-progress-bar",25),i(6,"p")(7,"span"),r(8,6),s(),O(9,ee,3,6)(10,te,2,0,"ng-container"),s(),i(11,"p")(12,"span"),r(13,7),s(),O(14,ne,3,6)(15,oe,2,0,"ng-container"),s()()()),n&2){let e,o,l,E,R=g();a(3),b((e=R.statusData())==null?null:e.statusText),v(2),a(2),C("value",(o=R.statusData())==null?null:o.OverallProgress),a(4),p((l=R.statusData())!=null&&l.ProcessedFileCount?9:10),a(5),p((E=R.statusData())!=null&&E.ProcessedFileSize?14:15)}}var G=class n{#i=S(B);#s=S(H);#t=S(V);#n=S(q);#r=S(w);statusData=this.#t.statusData;backupId=this.#n.backupId;restoreResult=y("");#e=null;lastRestoreStarted=x(()=>{if(this.#e)return this.#e;let t=this.#t.statusData()?.backup?.Backup?.Metadata?.LastRestoreStarted??null;if(!t)return null;let e=this.fixDate(t);return this.#e=e,e});notificationFilterPredicate=()=>{let t=this.lastRestoreStarted();return{predicate:e=>(e.BackupID===this.#n.backupId()&&t&&t.getTime()<=new Date(e.Timestamp).getTime())??!1}};ngOnInit(){let t=this.#r.snapshot.params.taskid?.toString()??"";this.#i.getApiV1TaskByTaskid({taskid:t}).subscribe({next:e=>{if(e.TaskStarted&&(this.#e=new Date(e.TaskStarted)),!e.TaskFinished&&e.ID){this.#_(e.ID);return}this.#o(e)},error:e=>{console.error("Error fetching task:",e),this.restoreResult.set("error"),alert("Failed to fetch task details. Please try again later.")}})}#_(t){this.#s.waitForTaskToComplete(t).subscribe(e=>{this.#o(e)})}#o(t){t.TaskFinished!=null&&this.restoreResult.set(t.Status==="Completed"&&t.ErrorMessage==null?"success":"error")}fixDate(t){return new Date(`${t.slice(0,4)}-${t.slice(4,6)}-${t.slice(6,8)}T${t.slice(9,11)}:${t.slice(11,13)}:${t.slice(13,15)}Z`)}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["app-restore-progress"]],decls:12,vars:5,consts:()=>{let t;t=$localize`Notifications`;let e;e=$localize`Logs`;let o;o=$localize`Restore completed`;let l;l=$localize`check-bold`;let E;E=$localize`warning-octagon`;let R;R=$localize` Restore progress: ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#3\uFFFD"}:START_TAG_SH_SPINNER:${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SH_SPINNER:`;let h;h=$localize`Files processed:`;let F;F=$localize`Size processed:`;let L;L=$localize`N/A`;let $;return $=$localize`N/A`,[t,e,o,l,E,R,h,F,L,$,[1,"progress","type-a"],[1,"notifications","type-a"],[1,"notification-list"],[3,"notificationFilterPredicate"],[1,"logs","type-a"],[3,"polling","whenFilter","backupIdFilter"],["title",""],[1,"complete-success"],[1,"complete-failure"],[1,"border-svg"],["cx","50","cy","50","r","45",1,"border-circle"],[1,"success"],[1,"error"],[1,"primary"],[1,"progress-content"],[3,"value"]]},template:function(e,o){if(e&1&&(i(0,"section"),O(1,Y,5,1,"sh-card",10)(2,ie,16,4,"sh-card",10),i(3,"sh-card",11)(4,"h3"),r(5,0),s(),i(6,"div",12),c(7,"app-notifications",13),s()(),i(8,"sh-card",14)(9,"h3"),r(10,1),s(),c(11,"app-logs-live",15),s()()),e&2){let l;a(),p(o.restoreResult()!=""?1:2),a(6),C("notificationFilterPredicate",o.notificationFilterPredicate()),a(4),C("polling",o.restoreResult()=="")("whenFilter",(l=o.lastRestoreStarted())==null?null:l.getTime())("backupIdFilter",o.backupId())}},dependencies:[K,X,z,J,W,Z,j,k],styles:['[_nghost-%COMP%]{display:block;padding:0 1.25rem;margin-top:32px}section[_ngcontent-%COMP%]{display:grid;gap:1.25rem;grid-template-columns:2fr 1fr;grid-template-areas:"progress notifications" "logs logs"}section[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:1rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]{grid-area:progress}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%]:has(.complete-check){display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1.25rem}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between}section[_ngcontent-%COMP%] .progress[_ngcontent-%COMP%] sh-spinner[_ngcontent-%COMP%]{--spinner-size: 1.25rem;--spinner-thickness: .1875rem}section[_ngcontent-%COMP%] .notifications[_ngcontent-%COMP%]{grid-area:notifications}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%]{grid-area:logs}section[_ngcontent-%COMP%] .logs[_ngcontent-%COMP%] app-logs-live[_ngcontent-%COMP%]{max-height:50rem;overflow:auto}.notification-list[_ngcontent-%COMP%]{max-height:15rem;overflow:auto}.complete-success[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--success-8)}.complete-success[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-success[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--success-8)}.complete-failure[_ngcontent-%COMP%]{position:relative;width:6.25rem;height:6.25rem;display:flex;justify-content:center;align-items:center;color:var(--error-8)}.complete-failure[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:2.5rem;opacity:0;animation:_ngcontent-%COMP%_reveal-icon .2s linear forwards;animation-delay:1s}.complete-failure[_ngcontent-%COMP%] .border-circle[_ngcontent-%COMP%]{fill:none;stroke:var(--error-8)}.border-svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.border-circle[_ngcontent-%COMP%]{fill:none;stroke-width:.3125rem;stroke-dasharray:282.74;stroke-dashoffset:282.74;animation:_ngcontent-%COMP%_draw-border 1.2s linear forwards}@keyframes _ngcontent-%COMP%_draw-border{to{stroke-dashoffset:0}}@keyframes _ngcontent-%COMP%_reveal-icon{to{opacity:1}}.progress-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.progress-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{margin-bottom:.75rem}.progress-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{margin-right:.25rem}'],changeDetection:0})};export{G as default};
@@ -1 +1 @@
1
- import{a as z}from"./chunk-RGFJ5UMA.js";import{A as X,B as H,K as V,v as J}from"./chunk-VKQQDCUN.js";import"./chunk-DSYNIXJF.js";import{a as x,c as B,d as w,e as U,f as k}from"./chunk-NPFPMA4P.js";import"./chunk-O2SMJYPC.js";import"./chunk-N2AU7VKX.js";import"./chunk-ZC23RK4J.js";import"./chunk-OPHQNXYO.js";import{$b as c,Cb as P,Db as i,Eb as t,Fb as _,Jb as R,Kb as M,Mb as f,Sa as C,Tb as l,Ub as r,Vb as b,Wb as y,Xb as v,Zb as T,_ as g,da as F,ea as a,gb as m,pa as p,wb as $,xb as D}from"./chunk-TQTOIWBK.js";import"./chunk-7CGTOI24.js";function W(u,S){if(u&1){let n=f();i(0,"sh-menu",16)(1,"button",17),b(2,2),t(),R(3,18),i(4,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"sh-icon"),r(),t(),i(7,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"sh-icon"),r(),t(),i(10,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"sh-icon"),r(),t(),i(13,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"sh-icon"),r(),t(),i(16,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Retry"))}),l(17,7),_(18,"sh-icon"),r(),t(),i(19,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Information"))}),l(20,8),_(21,"sh-icon"),r(),t(),i(22,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"sh-icon"),r(),t(),i(25,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Warning"))}),l(26,10),_(27,"sh-icon"),r(),t(),i(28,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Error"))}),l(29,11),_(30,"sh-icon"),r(),t(),M(),t()}if(u&2){let n=c();P("openIndicator",!0),C(2),y(n.logLevelByLabel()),v(2)}}var O=class u{#n=g(w);#e=g(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=p(this.#n.url);constructor(){this.#n.events.subscribe(S=>{S instanceof x&&this.currentUrl.set(S.urlAfterRedirects)})}updateLogLevel(S){this.#e.isPolling.set(!0),this.#e.updateLogLevel(S)}static \u0275fac=function(n){return new(n||u)};static \u0275cmp=m({type:u,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let S;S=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Disabled `;let E;E=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Verbose `;let L;L=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Explicit only `;let N;N=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Profiling `;let I;I=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Retry `;let d;d=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Information `;let h;h=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Dry run `;let G;G=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON: Warning `;let A;return A=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: Error `,[S,n,o,e,E,L,N,I,d,h,G,A,[1,"filters"],[1,"type-b"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"sh-button-group",13)(2,"button",14),l(3,0),_(4,"sh-icon"),r(),t(),i(5,"button",15),l(6,1),_(7,"sh-icon"),r(),t()(),$(8,W,31,2,"sh-menu",16),t(),_(9,"router-outlet")),n&2&&(C(8),D(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[H,X,J,V,B,k,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:0 2rem;margin-bottom:1.25rem}"],changeDetection:0})};export{O as default};
1
+ import{a as z}from"./chunk-O2HQIEE4.js";import{A as X,B as H,K as V,v as J}from"./chunk-CJKZ27FM.js";import"./chunk-KNSQLQC6.js";import{a as x,c as B,d as w,e as U,f as k}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as g,Db as P,Eb as i,Fb as t,Gb as _,Kb as R,Lb as M,Nb as f,Ta as C,Ub as l,Vb as r,Wb as b,Xb as y,Yb as v,_b as T,ac as c,ea as F,fa as a,hb as m,qa as p,xb as $,yb as D}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";function W(u,S){if(u&1){let n=f();i(0,"sh-menu",16)(1,"button",17),b(2,2),t(),R(3,18),i(4,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Disabled"))}),l(5,3),_(6,"sh-icon"),r(),t(),i(7,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Verbose"))}),l(8,4),_(9,"sh-icon"),r(),t(),i(10,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("ExplicitOnly"))}),l(11,5),_(12,"sh-icon"),r(),t(),i(13,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Profiling"))}),l(14,6),_(15,"sh-icon"),r(),t(),i(16,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Retry"))}),l(17,7),_(18,"sh-icon"),r(),t(),i(19,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Information"))}),l(20,8),_(21,"sh-icon"),r(),t(),i(22,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("DryRun"))}),l(23,9),_(24,"sh-icon"),r(),t(),i(25,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Warning"))}),l(26,10),_(27,"sh-icon"),r(),t(),i(28,"button",19),T("click",function(){F(n);let e=c();return a(e.updateLogLevel("Error"))}),l(29,11),_(30,"sh-icon"),r(),t(),M(),t()}if(u&2){let n=c();P("openIndicator",!0),C(2),y(n.logLevelByLabel()),v(2)}}var O=class u{#n=g(w);#e=g(z);logLevel=this.#e.logLevel;logLevelByLabel=this.#e.logLevelByLabel;currentUrl=p(this.#n.url);constructor(){this.#n.events.subscribe(S=>{S instanceof x&&this.currentUrl.set(S.urlAfterRedirects)})}updateLogLevel(S){this.#e.isPolling.set(!0),this.#e.updateLogLevel(S)}static \u0275fac=function(n){return new(n||u)};static \u0275cmp=m({type:u,selectors:[["app-logs"]],decls:10,vars:1,consts:()=>{let S;S=$localize`${"\uFFFD#4\uFFFD"}:START_TAG_SH_ICON:archive${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SH_ICON: Stored `;let n;n=$localize`${"\uFFFD#7\uFFFD"}:START_TAG_SH_ICON:play${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SH_ICON: Live `;let o;o=$localize`Log level: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let e;e=$localize`${"\uFFFD#6\uFFFD"}:START_TAG_SH_ICON:bell-simple-slash${"\uFFFD/#6\uFFFD"}:CLOSE_TAG_SH_ICON: Disabled `;let E;E=$localize`${"\uFFFD#9\uFFFD"}:START_TAG_SH_ICON:megaphone-simple${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SH_ICON: Verbose `;let L;L=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SH_ICON:flow-arrow${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SH_ICON: Explicit only `;let N;N=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SH_ICON:speedometer${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SH_ICON: Profiling `;let I;I=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SH_ICON:arrow-arc-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SH_ICON: Retry `;let d;d=$localize`${"\uFFFD#21\uFFFD"}:START_TAG_SH_ICON:info${"\uFFFD/#21\uFFFD"}:CLOSE_TAG_SH_ICON: Information `;let h;h=$localize`${"\uFFFD#24\uFFFD"}:START_TAG_SH_ICON:person-simple-run${"\uFFFD/#24\uFFFD"}:CLOSE_TAG_SH_ICON: Dry run `;let G;G=$localize`${"\uFFFD#27\uFFFD"}:START_TAG_SH_ICON:warning${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_SH_ICON: Warning `;let A;return A=$localize`${"\uFFFD#30\uFFFD"}:START_TAG_SH_ICON:warning-octagon${"\uFFFD/#30\uFFFD"}:CLOSE_TAG_SH_ICON: Error `,[S,n,o,e,E,L,N,I,d,h,G,A,[1,"filters"],[1,"type-b"],["type","button","routerLink","/about/logs/stored","routerLinkActive","active"],["type","button","routerLink","/about/logs/live","routerLinkActive","active"],[3,"openIndicator"],["shButton","","type","button"],["menu",""],["shButton","","type","button",1,"small",3,"click"]]},template:function(n,o){n&1&&(i(0,"div",12)(1,"sh-button-group",13)(2,"button",14),l(3,0),_(4,"sh-icon"),r(),t(),i(5,"button",15),l(6,1),_(7,"sh-icon"),r(),t()(),$(8,W,31,2,"sh-menu",16),t(),_(9,"router-outlet")),n&2&&(C(8),D(o.currentUrl().startsWith("/about/logs/live")?8:-1))},dependencies:[H,X,J,V,B,k,U],styles:["[_nghost-%COMP%]{display:block}.filters[_ngcontent-%COMP%]{display:flex;align-items:center;gap:1rem;padding:0 2rem;margin-bottom:1.25rem}"],changeDetection:0})};export{O as default};
@@ -1 +1 @@
1
- import{a as l,d as w}from"./chunk-DSYNIXJF.js";import{d as k}from"./chunk-NPFPMA4P.js";import{a as b,d as O}from"./chunk-N2AU7VKX.js";import{xa as T,ya as s}from"./chunk-ZC23RK4J.js";import{A as N,D as u,F as p,J as P,N as f,V as c,_ as i,f as R,i as y,l as E,pa as a,q as m,za as v}from"./chunk-TQTOIWBK.js";import{a as A}from"./chunk-7CGTOI24.js";var h=class r{platformId=i(v);STORAGE_VERSION="v1";APP_NAME="duplicati";PERSISTED_PREFIX="persist:";getItemParsed(e,t=!1){return s(this.platformId)?null:JSON.parse(localStorage.getItem(`${this.STORAGE_VERSION}:${t?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${e}`)??"null")}setItemParsed(e,t,o=!1){if(!s(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${o?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${e}`,JSON.stringify(t))}get length(){return T(this.platformId)?localStorage.length:0}getItem(e){return s(this.platformId)?null:localStorage.getItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`)??null}setItem(e,t){if(!s(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`,t)}removeItem(e){s(this.platformId)||(localStorage.removeItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`),localStorage.removeItem(`${this.STORAGE_VERSION}:${this.PERSISTED_PREFIX}${this.APP_NAME}:${e}`))}clearAllNotCurrentVersion(){if(!s(this.platformId))for(var e in localStorage)!e.startsWith(this.STORAGE_VERSION)&&e.includes(this.APP_NAME)&&localStorage.removeItem(e)}clearAll(){s(this.platformId)||localStorage.clear()}clear(){if(!s(this.platformId))for(var e in localStorage)e.includes(this.APP_NAME)&&!e.includes(this.PERSISTED_PREFIX)&&localStorage.removeItem(e)}key(e){return s(this.platformId)?null:localStorage.key(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac})};function V(){try{let r=document.querySelector('meta[name="duplicati-proxy-config"]');if(r){let e=(r.getAttribute("content")||"").trim();if(e&&e.startsWith("/"))return e}}catch(r){console.warn("Failed to read proxy configuration from meta tag:",r)}return null}function L(){try{let r=document.querySelector('meta[name="duplicati-enable-iframe-hosting"]');if(r){let e=(r.getAttribute("content")||"").trim();if(e&&e.length>0)return e.toLowerCase()!=="true"}}catch(r){console.warn("Failed to read disable relay support configuration from meta tag:",r)}return!0}function $(){try{let r=document.querySelector('meta[name="duplicati-xsrf-config"]');if(r){let e=(r.getAttribute("data-header-name")||"").trim(),t=(r.getAttribute("data-query-name")||"").trim();if(e&&t&&e.length>0&&t.length>0){let n=new URLSearchParams(window.location.search).get(t);if(n)return{headerName:e,queryName:t,headerValue:n}}}}catch(r){console.warn("Failed to read XSRF configuration from meta tags:",r)}return null}function x(){let r=$();return r?`${r.queryName}=${encodeURIComponent(r.headerValue)}`:null}function X(){let r=V();if(r&&r.length>0){let t=r;t.startsWith("/")||(t=`/${t}`),t.endsWith("/")&&(t=t.slice(0,-1)),l.BASE=t}else l.BASE="";let e=$();e&&(l.HEADERS={[e.headerName]:e.headerValue})}var g=class r{#i=i(h);#o=a(null);#t=window.self!==window.top&&L();#r=a(this.#t);relayIsEnabled=this.#r.asReadonly();config=this.#o.asReadonly();configLoaded=this.#t?new y:null;isLoading=a(this.#t);parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#s(),this.#t&&(this.#r.set(!0),this.parentIframeListner=new AbortController,this.#e("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),o=JSON.parse(t);if(!o?.accessToken||!o?.clientId||!o?.machineServerUrl){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.clientId!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.accessToken!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.machineServerUrl!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}let n=this.#i.getItem("locale")??"en-US",I=o.locale??"en-US";n!==I&&(this.#i.setItem("locale",I),window.location.reload()),this.#o.set(o),this.configLoaded?.next(!0),this.isLoading.set(!1),this.#e("handshake-complete")}},{signal:this.parentIframeListner.signal}))}#e(e){window.parent.postMessage(e,"*")}#s(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})};var D="PROXY_AUTHED_FAKE_TOKEN",d="refreshNonce",S="v1:persist:duplicati:refreshNonce",M=class r{#i=i(k);#o=i(O);#t=i(w);#r=i(g);#e=a(null);#s=a(!1);#a=a(!1);#l=a(x());xsrfQueryParam=this.#l.asReadonly();token=this.#e.asReadonly();isLoggingOut=this.#s.asReadonly();setRefreshNonce(e,t){if(!e){sessionStorage.removeItem(d);return}t?localStorage.setItem(S,e||""):sessionStorage.setItem(d,e||"")}getRefreshNonceBody(){let e=sessionStorage.getItem(d),t=localStorage.getItem(S),o=e||t;return{requestBody:o?{requestBody:{Nonce:o}}:void 0,local:o===t}}login(e,t){return this.#t.postApiV1AuthLogin({requestBody:{Password:e,RememberMe:t}}).pipe(u(1),f(o=>{o.AccessToken?(this.#e.set(o.AccessToken),this.setRefreshNonce(o.RefreshNonce,t)):this.#e.set(null)}))}#n=null;refreshToken(){if(this.#r.relayIsEnabled())return this.#e.set(D),new R(o=>{o.next({AccessToken:D}),o.complete()});if(this.#a())return this.#t.postApiV1AuthIssuetokenByOperation({operation:"websocket"}).pipe(u(1),f(o=>{o.Token&&this.#e.set(o.Token)}),m(o=>({AccessToken:o.Token})));if(this.#n)return this.#n;let{requestBody:e,local:t}=this.getRefreshNonceBody();return this.#n=this.#t.postApiV1AuthRefresh(e).pipe(u(1),f(o=>{o.AccessToken&&(this.#e.set(o.AccessToken),this.setRefreshNonce(o.RefreshNonce,t))}),p(()=>{this.#n=null}),P(1)),this.#n}checkProxyAuthed(){let e=new b(A({"custom-proxy-check":"true"},l.HEADERS??{})),t=l.BASE||"";return this.#o.post(`${t}/api/v1/auth/status`,null,{headers:e}).pipe(m(o=>{let n=o;return n?.authorized&&n?.socketToken?(this.#e.set(n.socketToken),this.#a.set(!0),!0):!1}),N(()=>E(!1)))}logout(){this.#s.set(!0);let{requestBody:e,local:t}=this.getRefreshNonceBody();sessionStorage.removeItem(d),t&&localStorage.removeItem(S),this.#t.postApiV1AuthRefreshLogout(e).pipe(u(1),p(()=>{this.#s.set(!1),this.#e.set(null),this.#i.navigate(["/login"])})).subscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})};export{h as a,X as b,g as c,D as d,M as e};
1
+ import{a as l,d as w}from"./chunk-KNSQLQC6.js";import{d as k}from"./chunk-CQJRBQ6I.js";import{a as b,d as O}from"./chunk-HDDAGHHE.js";import{xa as T,ya as s}from"./chunk-YF6JHIN5.js";import{$ as i,Aa as v,B as N,E as u,G as p,K as P,O as f,W as c,f as R,i as y,l as E,q as m,qa as a}from"./chunk-K5XGRFWJ.js";import{a as A}from"./chunk-7CGTOI24.js";var h=class r{platformId=i(v);STORAGE_VERSION="v1";APP_NAME="duplicati";PERSISTED_PREFIX="persist:";getItemParsed(e,t=!1){return s(this.platformId)?null:JSON.parse(localStorage.getItem(`${this.STORAGE_VERSION}:${t?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${e}`)??"null")}setItemParsed(e,t,o=!1){if(!s(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${o?this.PERSISTED_PREFIX:""}${this.APP_NAME}:${e}`,JSON.stringify(t))}get length(){return T(this.platformId)?localStorage.length:0}getItem(e){return s(this.platformId)?null:localStorage.getItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`)??null}setItem(e,t){if(!s(this.platformId))return localStorage.setItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`,t)}removeItem(e){s(this.platformId)||(localStorage.removeItem(`${this.STORAGE_VERSION}:${this.APP_NAME}:${e}`),localStorage.removeItem(`${this.STORAGE_VERSION}:${this.PERSISTED_PREFIX}${this.APP_NAME}:${e}`))}clearAllNotCurrentVersion(){if(!s(this.platformId))for(var e in localStorage)!e.startsWith(this.STORAGE_VERSION)&&e.includes(this.APP_NAME)&&localStorage.removeItem(e)}clearAll(){s(this.platformId)||localStorage.clear()}clear(){if(!s(this.platformId))for(var e in localStorage)e.includes(this.APP_NAME)&&!e.includes(this.PERSISTED_PREFIX)&&localStorage.removeItem(e)}key(e){return s(this.platformId)?null:localStorage.key(e)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac})};function V(){try{let r=document.querySelector('meta[name="duplicati-proxy-config"]');if(r){let e=(r.getAttribute("content")||"").trim();if(e&&e.startsWith("/"))return e}}catch(r){console.warn("Failed to read proxy configuration from meta tag:",r)}return null}function L(){try{let r=document.querySelector('meta[name="duplicati-enable-iframe-hosting"]');if(r){let e=(r.getAttribute("content")||"").trim();if(e&&e.length>0)return e.toLowerCase()!=="true"}}catch(r){console.warn("Failed to read disable relay support configuration from meta tag:",r)}return!0}function $(){try{let r=document.querySelector('meta[name="duplicati-xsrf-config"]');if(r){let e=(r.getAttribute("data-header-name")||"").trim(),t=(r.getAttribute("data-query-name")||"").trim();if(e&&t&&e.length>0&&t.length>0){let n=new URLSearchParams(window.location.search).get(t);if(n)return{headerName:e,queryName:t,headerValue:n}}}}catch(r){console.warn("Failed to read XSRF configuration from meta tags:",r)}return null}function x(){let r=$();return r?`${r.queryName}=${encodeURIComponent(r.headerValue)}`:null}function X(){let r=V();if(r&&r.length>0){let t=r;t.startsWith("/")||(t=`/${t}`),t.endsWith("/")&&(t=t.slice(0,-1)),l.BASE=t}else l.BASE="";let e=$();e&&(l.HEADERS={[e.headerName]:e.headerValue})}var g=class r{#i=i(h);#o=a(null);#t=window.self!==window.top&&L();#r=a(this.#t);relayIsEnabled=this.#r.asReadonly();config=this.#o.asReadonly();configLoaded=this.#t?new y:null;isLoading=a(this.#t);parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#s(),this.#t&&(this.#r.set(!0),this.parentIframeListner=new AbortController,this.#e("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),o=JSON.parse(t);if(!o?.accessToken||!o?.clientId||!o?.machineServerUrl){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.clientId!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.accessToken!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}if(typeof o.machineServerUrl!="string"){this.#e("error:invalid-config"),this.#r.set(!1);return}let n=this.#i.getItem("locale")??"en-US",I=o.locale??"en-US";n!==I&&(this.#i.setItem("locale",I),window.location.reload()),this.#o.set(o),this.configLoaded?.next(!0),this.isLoading.set(!1),this.#e("handshake-complete")}},{signal:this.parentIframeListner.signal}))}#e(e){window.parent.postMessage(e,"*")}#s(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})};var D="PROXY_AUTHED_FAKE_TOKEN",d="refreshNonce",S="v1:persist:duplicati:refreshNonce",M=class r{#i=i(k);#o=i(O);#t=i(w);#r=i(g);#e=a(null);#s=a(!1);#a=a(!1);#l=a(x());xsrfQueryParam=this.#l.asReadonly();token=this.#e.asReadonly();isLoggingOut=this.#s.asReadonly();setRefreshNonce(e,t){if(!e){sessionStorage.removeItem(d);return}t?localStorage.setItem(S,e||""):sessionStorage.setItem(d,e||"")}getRefreshNonceBody(){let e=sessionStorage.getItem(d),t=localStorage.getItem(S),o=e||t;return{requestBody:o?{requestBody:{Nonce:o}}:void 0,local:o===t}}login(e,t){return this.#t.postApiV1AuthLogin({requestBody:{Password:e,RememberMe:t}}).pipe(u(1),f(o=>{o.AccessToken?(this.#e.set(o.AccessToken),this.setRefreshNonce(o.RefreshNonce,t)):this.#e.set(null)}))}#n=null;refreshToken(){if(this.#r.relayIsEnabled())return this.#e.set(D),new R(o=>{o.next({AccessToken:D}),o.complete()});if(this.#a())return this.#t.postApiV1AuthIssuetokenByOperation({operation:"websocket"}).pipe(u(1),f(o=>{o.Token&&this.#e.set(o.Token)}),m(o=>({AccessToken:o.Token})));if(this.#n)return this.#n;let{requestBody:e,local:t}=this.getRefreshNonceBody();return this.#n=this.#t.postApiV1AuthRefresh(e).pipe(u(1),f(o=>{o.AccessToken&&(this.#e.set(o.AccessToken),this.setRefreshNonce(o.RefreshNonce,t))}),p(()=>{this.#n=null}),P(1)),this.#n}checkProxyAuthed(){let e=new b(A({"custom-proxy-check":"true"},l.HEADERS??{})),t=l.BASE||"";return this.#o.post(`${t}/api/v1/auth/status`,null,{headers:e}).pipe(m(o=>{let n=o;return n?.authorized&&n?.socketToken?(this.#e.set(n.socketToken),this.#a.set(!0),!0):!1}),N(()=>E(!1)))}logout(){this.#s.set(!0);let{requestBody:e,local:t}=this.getRefreshNonceBody();sessionStorage.removeItem(d),t&&localStorage.removeItem(S),this.#t.postApiV1AuthRefreshLogout(e).pipe(u(1),p(()=>{this.#s.set(!1),this.#e.set(null),this.#i.navigate(["/login"])})).subscribe()}static \u0275fac=function(t){return new(t||r)};static \u0275prov=c({token:r,factory:r.\u0275fac,providedIn:"root"})};export{h as a,X as b,g as c,D as d,M as e};
@@ -1 +1 @@
1
- import{B as y}from"./chunk-VKQQDCUN.js";import{$b as r,Db as i,Eb as o,Mb as C,Qc as D,Sa as n,Vc as b,Wc as T,Zb as g,da as u,ea as _,gb as x,nc as l,oc as m,wb as s,xb as d}from"./chunk-TQTOIWBK.js";import{a as f}from"./chunk-7CGTOI24.js";function v(t,a){if(t&1&&(i(0,"p"),l(1),o()),t&2){let e=r();n(),m(e._data().message)}}function S(t,a){if(t&1){let e=C();i(0,"button",5),g("click",function(){u(e);let p=r();return _(p.close("cancel"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().cancelText)}}function k(t,a){if(t&1){let e=C();i(0,"button",6),g("click",function(){u(e);let p=r();return _(p.close("confirm"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},h=class t{data=T();_data=D(()=>f(f({},w),this.data()));closed=b();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=x({type:t,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["shButton","",1,""],["shButton","",1,"raised","primary"],["shButton","",1,"",3,"click"],["shButton","",1,"raised","primary",3,"click"]],template:function(e,c){e&1&&(i(0,"header",0)(1,"h3"),l(2),o()(),i(3,"div",1),s(4,v,2,1,"p"),o(),i(5,"footer",2),s(6,S,2,1,"button",3),s(7,k,2,1,"button",4),o()),e&2&&(n(2),m(c._data().title),n(2),d(c._data().message?4:-1),n(2),d(c._data().cancelText?6:-1),n(),d(c._data().confirmText?7:-1))},dependencies:[y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{h as a};
1
+ import{B as y}from"./chunk-CJKZ27FM.js";import{Eb as i,Fb as o,Nb as C,Rc as D,Ta as n,Wc as b,Xc as T,_b as g,ac as r,ea as u,fa as _,hb as x,oc as l,pc as m,xb as s,yb as d}from"./chunk-K5XGRFWJ.js";import{a as f}from"./chunk-7CGTOI24.js";function v(t,a){if(t&1&&(i(0,"p"),l(1),o()),t&2){let e=r();n(),m(e._data().message)}}function S(t,a){if(t&1){let e=C();i(0,"button",5),g("click",function(){u(e);let p=r();return _(p.close("cancel"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().cancelText)}}function k(t,a){if(t&1){let e=C();i(0,"button",6),g("click",function(){u(e);let p=r();return _(p.close("confirm"))}),l(1),o()}if(t&2){let e=r();n(),m(e._data().confirmText)}}var w={title:$localize`Are you sure?`,confirmText:void 0,cancelText:$localize`Cancel`},h=class t{data=T();_data=D(()=>f(f({},w),this.data()));closed=b();close(a="confirm"){this.closed.emit(a==="confirm")}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=x({type:t,selectors:[["app-confirm-dialog"]],inputs:{data:[1,"data"]},outputs:{closed:"closed"},decls:8,vars:4,consts:[["header",""],["content",""],["footer",""],["shButton","",1,""],["shButton","",1,"raised","primary"],["shButton","",1,"",3,"click"],["shButton","",1,"raised","primary",3,"click"]],template:function(e,c){e&1&&(i(0,"header",0)(1,"h3"),l(2),o()(),i(3,"div",1),s(4,v,2,1,"p"),o(),i(5,"footer",2),s(6,S,2,1,"button",3),s(7,k,2,1,"button",4),o()),e&2&&(n(2),m(c._data().title),n(2),d(c._data().message?4:-1),n(2),d(c._data().cancelText?6:-1),n(),d(c._data().confirmText?7:-1))},dependencies:[y],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{h as a};
@@ -0,0 +1 @@
1
+ import{a as Q}from"./chunk-SKLSR5GH.js";import{a as B}from"./chunk-YS4B2B5N.js";import{e as j}from"./chunk-PDZNQW6F.js";import{B as H,D as K,H as V,b as y,c as D,d as R,e as $,f as A,j as v,p as k,q as x,r as J,t as X,v as q,w as z}from"./chunk-CJKZ27FM.js";import"./chunk-KNSQLQC6.js";import{d as G}from"./chunk-CQJRBQ6I.js";import"./chunk-V2UO7ES2.js";import"./chunk-HDDAGHHE.js";import"./chunk-YF6JHIN5.js";import"./chunk-2YUSBRXY.js";import{$ as _,Db as d,Eb as t,Fb as i,G as C,Gb as r,Ta as a,Ub as g,Vb as u,Wb as I,Yc as w,_b as p,hb as S,hc as E,ic as M,lc as O,oc as P,pc as b,qa as s,sa as N,xb as T,yb as L}from"./chunk-K5XGRFWJ.js";import"./chunk-7CGTOI24.js";var U=["passwordInput"];function W(l,n){l&1&&(t(0,"sh-alert",6),I(1,4),i())}var f=new J,F=class l{#e=_(G);#n=_(j);rememberMe=B("rememberMe",!1,!0);failedLogin=s(!1);successLogin=s(!1);isLoading=s(!1);loginForm=f.group({pass:f.control("",R.required),rememberMe:f.control(this.rememberMe())});showPassword=s(!1);passwordInput=w("passwordInput");passwordEffect=N(()=>{this.failedLogin()&&queueMicrotask(()=>this.passwordInput()?.nativeElement?.focus())});ngOnInit(){this.loginForm.controls.rememberMe.valueChanges.subscribe(n=>this.rememberMe.set(n??!1)),queueMicrotask(()=>this.passwordInput()?.nativeElement?.focus())}submit(){let n=this.loginForm.value.pass;this.rememberMe.set(this.loginForm.value.rememberMe??!1),n&&(this.isLoading.set(!0),this.#n.login(n,this.rememberMe()).pipe(C(()=>{this.isLoading.set(!1),this.failedLogin.set(!0)})).subscribe({next:()=>{this.successLogin.set(!0),this.#e.navigate(["/"])}}))}static \u0275fac=function(o){return new(o||l)};static \u0275cmp=S({type:l,selectors:[["app-login"]],viewQuery:function(o,e){o&1&&E(e.passwordInput,U,5),o&2&&M()},decls:23,vars:6,consts:()=>{let n;n=$localize`Enter your password`;let o;o=$localize` Password ${"\uFFFD#9\uFFFD"}:START_LINK:${"\uFFFD#10\uFFFD"}:START_TAG_SH_ICON:question${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#9\uFFFD"}:CLOSE_LINK:`;let e;e=$localize` Login ${"\uFFFD#17\uFFFD"}:START_TAG_SH_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SH_ICON:`;let m;m=$localize` Keep me logged in ${"\uFFFD#20\uFFFD\uFFFD/#20\uFFFD"}:TAG_INPUT:`;let h;return h=$localize` Remember to enter a password, if you can't remember the password open the duplicati client on the machine in question and make sure you open it through the tray icon then go into settings to change the password. `,[["passwordInput",""],o,e,m,h,[3,"submit","formGroup"],["type","warning"],[1,"logo-login"],[1,"inner"],[1,"login-row"],["for","password"],["href","https://docs.duplicati.com/configuration-and-management/duplicati-access-password#access-from-the-trayicon","target","_blank","rel","noopener noreferrer"],["name","password","autocomplete","current-password","placeholder",n,"tabindex","1","formControlName","pass",3,"type"],["suffix","",3,"click"],["shButton","","type","submit",1,"raised","primary","login-button"],[1,"raised","primary"],["type","checkbox","id","rememberMe","tabindex","2","formControlName","rememberMe"],[1,"login-row","checkbox"],["for","rememberMe",1,"remember-me"]]},template:function(o,e){o&1&&(t(0,"form",5),p("submit",function(){return e.submit()}),T(1,W,2,0,"sh-alert",6),t(2,"div",7),r(3,"app-logo"),i(),t(4,"div",8)(5,"div",9)(6,"sh-form-field")(7,"label",10),g(8,1),t(9,"a",11),r(10,"sh-icon"),i(),u(),i(),r(11,"input",12,0),t(13,"sh-icon",13),p("click",function(){return e.showPassword.set(!e.showPassword())}),P(14),i()(),t(15,"button",14),g(16,2),r(17,"sh-icon"),u(),i()(),t(18,"sh-checkbox",15),g(19,3),r(20,"input",16),u(),i(),t(21,"div",17),r(22,"label",18),i()()()),o&2&&(d("formGroup",e.loginForm),a(),L(e.failedLogin()&&!e.successLogin()?1:-1),a(10),d("type",e.showPassword()?"text":"password"),a(3),b(e.showPassword()?"eye":"eye-slash"),a(),O("loading",e.isLoading()))},dependencies:[X,v,D,y,$,A,x,k,Q,V,q,H,z,K],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{width:100vw;min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.75rem}form[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;gap:1rem}form[_ngcontent-%COMP%] .inner[_ngcontent-%COMP%] .checkbox[_ngcontent-%COMP%]{align-self:flex-start}sh-alert[_ngcontent-%COMP%]{max-width:20rem;margin:0 auto}h3[_ngcontent-%COMP%]{font:var(--title-30)}.login-row[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.logo-login[_ngcontent-%COMP%]{top:0;left:0;padding:1.25rem;position:fixed}.login-button[_ngcontent-%COMP%]{padding-left:1.5rem;padding-right:1.5rem}"],changeDetection:0})};export{F as default};
@@ -1 +1 @@
1
- import{b as s}from"./chunk-6Q6SSTBK.js";import{V as c}from"./chunk-TQTOIWBK.js";import{a as i}from"./chunk-7CGTOI24.js";var d=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,m=class n{generate(r,t=d){let a;do a=this.generatePassword(r,t);while(this.calculatePasswordStrength(a)<5);return a}generatePassword(r,t=d){return Array.apply(null,{length:r}).map(()=>{let a;for(;;)if(a=String.fromCharCode(s()),t.test(a))return a},this).join("")}calculatePasswordStrength(r){let t=1;return r.length>=8&&t++,r.match(/[a-z]/)&&r.match(/[A-Z]/)&&t++,r.match(/\d+/)&&t++,r.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function y(n,r,t="conditional"){return a=>{if(!a.parent)return null;let e=null;if(n(a.parent)&&(e=(Array.isArray(r)?r:[r]).find(l=>l(a)!==null)??null),t&&e){let o={};o[t]=e,e=o}return e}}function F(){return n=>(n.parent&&Object.values(n.parent.controls).forEach(r=>{r!==n&&r.updateValueAndValidity()}),null)}function C(n,r,t,a="conditional"){return e=>{if(!e.parent)return null;let o={},l=e.parent.get(n);if(!l)return console.warn("Conditional field not found"),null;if(Array.isArray(r)?l.value?.includes(r):l.value===r){let f=Array.isArray(t)?t:[t];for(let A of f){let u=A(e),p=o||{};if(u!==null){o=i(i({},p),u);break}}}return o}}export{m as a,y as b,F as c,C as d};
1
+ import{b as s}from"./chunk-6Q6SSTBK.js";import{W as c}from"./chunk-K5XGRFWJ.js";import{a as i}from"./chunk-7CGTOI24.js";var d=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,m=class n{generate(r,t=d){let a;do a=this.generatePassword(r,t);while(this.calculatePasswordStrength(a)<5);return a}generatePassword(r,t=d){return Array.apply(null,{length:r}).map(()=>{let a;for(;;)if(a=String.fromCharCode(s()),t.test(a))return a},this).join("")}calculatePasswordStrength(r){let t=1;return r.length>=8&&t++,r.match(/[a-z]/)&&r.match(/[A-Z]/)&&t++,r.match(/\d+/)&&t++,r.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=c({token:n,factory:n.\u0275fac,providedIn:"root"})};function y(n,r,t="conditional"){return a=>{if(!a.parent)return null;let e=null;if(n(a.parent)&&(e=(Array.isArray(r)?r:[r]).find(l=>l(a)!==null)??null),t&&e){let o={};o[t]=e,e=o}return e}}function F(){return n=>(n.parent&&Object.values(n.parent.controls).forEach(r=>{r!==n&&r.updateValueAndValidity()}),null)}function C(n,r,t,a="conditional"){return e=>{if(!e.parent)return null;let o={},l=e.parent.get(n);if(!l)return console.warn("Conditional field not found"),null;if(Array.isArray(r)?l.value?.includes(r):l.value===r){let f=Array.isArray(t)?t:[t];for(let A of f){let u=A(e),p=o||{};if(u!==null){o=i(i({},p),u);break}}}return o}}export{m as a,y as b,F as c,C as d};