@duplicati/ngclient 0.0.112 → 0.0.115

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 (121) hide show
  1. package/assets/spk.woff2 +0 -0
  2. package/{chunk-OHQK4UOI.js → chunk-36NW32TN.js} +1 -1
  3. package/chunk-3MWN54TU.js +1 -0
  4. package/{chunk-3W6M5IZL.js → chunk-45NW2WR4.js} +1 -1
  5. package/{chunk-2LP4DYGQ.js → chunk-4E7QE6GD.js} +1 -1
  6. package/chunk-4WQHUN4Y.js +1 -0
  7. package/chunk-7L2WUS2V.js +1 -0
  8. package/chunk-7RELJ5CQ.js +1 -0
  9. package/{chunk-YDR42CNA.js → chunk-7T6RGHZV.js} +1 -1
  10. package/{chunk-N5ASXZEE.js → chunk-B2RFNJKM.js} +1 -1
  11. package/chunk-BEA3HPFS.js +1 -0
  12. package/{chunk-7L42EO7J.js → chunk-BIZAKOYU.js} +1 -1
  13. package/{chunk-F4EEOSGJ.js → chunk-BJGA55H2.js} +1 -1
  14. package/{chunk-WLIE4IB5.js → chunk-BMGMPYWQ.js} +1 -1
  15. package/chunk-C6XTRC7P.js +1 -0
  16. package/{chunk-ULHQZGHN.js → chunk-CK7BEV2X.js} +1 -1
  17. package/chunk-CKS3VATQ.js +1 -0
  18. package/{chunk-DMDYUREZ.js → chunk-CW3Y4RRU.js} +3 -3
  19. package/{chunk-EF7JWRDC.js → chunk-DOP6RFEG.js} +1 -1
  20. package/{chunk-BVTZNGGE.js → chunk-E6YEUK4V.js} +1 -1
  21. package/chunk-EBDDRAQ5.js +1 -0
  22. package/{chunk-T2OUHRUV.js → chunk-ELMONRIG.js} +1 -1
  23. package/{chunk-KSP3JQHY.js → chunk-EQWH3TBL.js} +1 -1
  24. package/{chunk-GJROCOAD.js → chunk-F2GEUOGZ.js} +1 -1
  25. package/{chunk-THDYLLMU.js → chunk-FAB4IY5W.js} +1 -1
  26. package/{chunk-OTLEEXAA.js → chunk-FJVMA6GA.js} +1 -1
  27. package/chunk-FTPARAAG.js +1 -0
  28. package/{chunk-EP7S6KOG.js → chunk-GKYC6XK5.js} +1 -1
  29. package/{chunk-KHC3VCF4.js → chunk-GXRQHMLN.js} +1 -1
  30. package/chunk-HFIC4JNY.js +1 -0
  31. package/chunk-I7KXABQT.js +1 -0
  32. package/chunk-IINSQSHJ.js +1 -0
  33. package/{chunk-NHQOHNI2.js → chunk-IK7CPFZB.js} +1 -1
  34. package/{chunk-TK4BPZWA.js → chunk-JC5OEIB3.js} +1 -1
  35. package/chunk-JFNFY6VY.js +1 -0
  36. package/chunk-JSZOZDJQ.js +1 -0
  37. package/{chunk-KXLXF2JD.js → chunk-JXQXCHPY.js} +1 -1
  38. package/{chunk-RTXTOPSU.js → chunk-K7WOLKTB.js} +1 -1
  39. package/{chunk-CIGZ6WGG.js → chunk-KQCGQDTS.js} +1 -1
  40. package/chunk-KRXMGGJO.js +1 -0
  41. package/chunk-L2M4ZKII.js +1 -0
  42. package/chunk-L72ALLHJ.js +7 -0
  43. package/chunk-LRF5G4S6.js +1 -0
  44. package/chunk-MAVZY7BL.js +1 -0
  45. package/chunk-MQJUTAQD.js +1 -0
  46. package/chunk-NDO7MKXC.js +1 -0
  47. package/chunk-NF45E5CN.js +1 -0
  48. package/{chunk-AX5RFEOL.js → chunk-NMMRBG2U.js} +1 -1
  49. package/chunk-O4S6BJVY.js +1 -0
  50. package/chunk-P4ZFQZCA.js +1 -0
  51. package/{chunk-CD3DB23J.js → chunk-P7IBR2UW.js} +1 -1
  52. package/{chunk-JPF4Y3PP.js → chunk-PHPGQ5OC.js} +1 -1
  53. package/{chunk-6DH6O5YE.js → chunk-PUEJXHBQ.js} +1 -1
  54. package/chunk-PVY4CFCN.js +1 -0
  55. package/{chunk-IPRTKJDE.js → chunk-Q52UOSQY.js} +1 -1
  56. package/chunk-QPMF3OND.js +1 -0
  57. package/{chunk-XJXOUOD5.js → chunk-R3PVYKQS.js} +1 -1
  58. package/chunk-R43XF3RF.js +1 -0
  59. package/chunk-RU2M6EPT.js +1 -0
  60. package/chunk-RUGSDKDK.js +1 -0
  61. package/chunk-RZ6B5C2M.js +1 -0
  62. package/{chunk-JSGFZ2GA.js → chunk-S5EF63OY.js} +1 -1
  63. package/{chunk-H632X43F.js → chunk-S5FFZRTF.js} +1 -1
  64. package/chunk-T5U3AMRL.js +1 -0
  65. package/{chunk-SQQMYNOF.js → chunk-TCJ2X76T.js} +1 -1
  66. package/{chunk-HTNYQE2B.js → chunk-TQHNKGRL.js} +1 -1
  67. package/chunk-TRCPJYNH.js +1 -0
  68. package/{chunk-VN7JM6M3.js → chunk-U467ZTQ4.js} +1 -1
  69. package/{chunk-TSIPKXNX.js → chunk-UBBFB6RT.js} +1 -1
  70. package/chunk-URYEQA3U.js +1 -0
  71. package/chunk-WFR2V6TK.js +1 -0
  72. package/chunk-XER6OR26.js +2 -0
  73. package/chunk-XMYCIQBS.js +1 -0
  74. package/chunk-XP7PWMT2.js +1 -0
  75. package/{chunk-KIUU6RPZ.js → chunk-XYLMZK7X.js} +1 -1
  76. package/{chunk-6HTVIY6O.js → chunk-XYMSYNUD.js} +1 -1
  77. package/{chunk-RRBU7RBN.js → chunk-Y7YR7HTF.js} +1 -1
  78. package/{chunk-PQVEQNEN.js → chunk-YCAQITZE.js} +1 -1
  79. package/{chunk-VZBHJ6AU.js → chunk-Z75HLGYD.js} +1 -1
  80. package/chunk-ZGKHK6QQ.js +2 -0
  81. package/index.html +2 -2
  82. package/main-U4R24N47.js +1 -0
  83. package/package.json +1 -1
  84. package/styles-NHBDA2ZX.css +1 -0
  85. package/chunk-2JKJCHMV.js +0 -1
  86. package/chunk-2N2WJIUS.js +0 -1
  87. package/chunk-3AU26GAL.js +0 -1
  88. package/chunk-6JLZLD5D.js +0 -1
  89. package/chunk-6OAGVTHV.js +0 -1
  90. package/chunk-7JUYF3HW.js +0 -1
  91. package/chunk-7NFVFBIE.js +0 -1
  92. package/chunk-7ROGJAJZ.js +0 -1
  93. package/chunk-7RTXH4CB.js +0 -1
  94. package/chunk-CETM57LL.js +0 -1
  95. package/chunk-CKPICCFH.js +0 -1
  96. package/chunk-DDIVZTRS.js +0 -1
  97. package/chunk-DMZ5CRRQ.js +0 -2
  98. package/chunk-I3C2AEHI.js +0 -1
  99. package/chunk-IDOYGPGZ.js +0 -1
  100. package/chunk-J7PTPA7J.js +0 -1
  101. package/chunk-JP7GZSDH.js +0 -1
  102. package/chunk-JV6DGJII.js +0 -1
  103. package/chunk-MHO7INGX.js +0 -1
  104. package/chunk-NQNRR7VE.js +0 -1
  105. package/chunk-O2YN63YI.js +0 -1
  106. package/chunk-ORDORLQT.js +0 -1
  107. package/chunk-OWDXYX4N.js +0 -1
  108. package/chunk-Q6GENX6C.js +0 -1
  109. package/chunk-QVIZK4WW.js +0 -1
  110. package/chunk-SEA4YEEO.js +0 -1
  111. package/chunk-T5X5KX6A.js +0 -1
  112. package/chunk-TMD3MDHS.js +0 -1
  113. package/chunk-VINJGSIH.js +0 -1
  114. package/chunk-W2F756OF.js +0 -7
  115. package/chunk-WMTA6PZM.js +0 -1
  116. package/chunk-WX7L7V6J.js +0 -1
  117. package/chunk-XL2NKFYE.js +0 -1
  118. package/chunk-ZXWA7BUQ.js +0 -1
  119. package/chunk-ZYGT7OII.js +0 -2
  120. package/main-3OUIM37D.js +0 -1
  121. package/styles-V3SS5M3J.css +0 -1
@@ -1,8 +1,8 @@
1
- import{a as qt,b as Yt}from"./chunk-6DH6O5YE.js";import{a as _t}from"./chunk-ORDORLQT.js";import{a as qe}from"./chunk-VN7JM6M3.js";import{a as Xt,b as Mt,c as jt}from"./chunk-KSP3JQHY.js";import{a as j}from"./chunk-HTNYQE2B.js";import{a as Le}from"./chunk-GJROCOAD.js";import{a as J}from"./chunk-7L42EO7J.js";import{b as Ve,c as _e,d as Fe,e as ge,f as Ue,g as ut,h as Be,i as Ke,j as We,m as dt,n as ze,o as mt,p as Ht,q as He,r as Ce,s as Xe,t as je}from"./chunk-T2OUHRUV.js";import{b as Ae,d as pe}from"./chunk-QVIZK4WW.js";import{A as pt,a as ue,b as lt,d as Wt,e as ve,g as be,l as de,o as zt,p as ct,t as me,z as Ge}from"./chunk-WX7L7V6J.js";import{h as Ie}from"./chunk-JSGFZ2GA.js";import{i as Kt}from"./chunk-CKPICCFH.js";import{$b as m,Ab as X,Ac as b,Bb as et,Bc as st,Cb as G,F as Ze,Gb as y,Hb as A,Ib as R,Jb as At,Kb as Pt,Lb as Oe,Mb as P,Nb as p,Qa as l,Qb as ce,S as ye,Sb as Bt,Tb as W,Xa as Me,Y as O,Yb as we,Zb as Re,_b as re,ab as le,ac as xe,bc as Y,cc as Nt,da as F,ea as g,ec as U,f as at,fb as _,fc as B,gc as K,hc as kt,ic as Ot,ja as Vt,jc as $t,lc as tt,mb as Ut,mc as nt,nb as u,oc as it,pb as ke,qa as Et,r as Je,ra as yt,sb as T,sc as ot,tb as te,ua as E,ub as ne,vb as ie,wb as s,xb as a,yb as d,zb as H}from"./chunk-W2F756OF.js";import{a as h,b as Ee,c as Lt}from"./chunk-7CGTOI24.js";var Ft=class t{#n=O(Ie);#t=O(ve);#e=O(Le);testDestination(n,e,i){return this.#e.hasV2TestOperations()?this.testDestinationv2(n,e,i):this.testDestinationv1(n,e,i)}testDestinationv2(n,e,i){return new at(o=>{this.#n.postApiV2DestinationTest({requestBody:{DestinationUrl:n,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){o.next({action:"success",targetUrl:n,testAgain:!1,destinationIndex:e,anyFilesFound:!r.Data?.FolderIsEmpty,containsBackup:r.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:r.Data?.FolderContainsEncryptedBackupFiles??void 0}),o.complete();return}this.handleGenericError(o,n,e,r.Error??"Unknown error")},error:r=>{let c=r?.error?.body;if(c?.Data?.FolderExists===!1||c?.StatusCode==="missing-folder"){i?this.handleMissingFolder(o,n,e):this.handleGenericError(o,n,e,$localize`The remote destination folder does not exist.`);return}if(c?.Data?.HostCertificate){this.handleMissingCertificate(o,n,e,c.Data?.HostCertificate);return}if(c?.Data?.ReportedHostKey){this.handleIncorrectKey(o,n,e,c.Data.ReportedHostKey,c.Data.AcceptedHostKey??null);return}this.handleGenericError(o,n,e,r?.message??"Unknown error")}})})}testDestinationv1(n,e,i){return new at(o=>{this.#n.postApiV1RemoteoperationTest({requestBody:{path:n}}).subscribe({next:r=>{o.next({action:"success",targetUrl:n,testAgain:!1,destinationIndex:e}),o.complete()},error:r=>{this.handleDestinationErrorv1(r.message,n,e,i).subscribe(c=>{o.next(c)})}})})}handleMissingFolder(n,e,i){this.#t.open(J,{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:o=>{o&&(this.#e.hasV2TestOperations()?this.#n.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:r=>{r.Success?this.handleFolderCreated(n,e,i):this.handleFolderCreateFailure(n,e,i,r.Error??$localize`Unknown error`)},error:r=>{this.handleFolderCreateFailure(n,e,i,r.message??$localize`Unknown error`)}}):this.#n.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(n,e,i)},error:r=>{this.handleFolderCreateFailure(n,e,i,r.message??$localize`Unknown error`)}}))}})}handleFolderCreateFailure(n,e,i,o){this.#t.open(J,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}})}handleFolderCreated(n,e,i){this.#t.open(J,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{n.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),n.complete()}})}reportNoAction(n,e,i){n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}handleMissingCertificate(n,e,i,o){this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
1
+ import{a as qt,b as Yt}from"./chunk-PUEJXHBQ.js";import{a as gt}from"./chunk-NDO7MKXC.js";import{a as qe}from"./chunk-U467ZTQ4.js";import{a as Xt,b as Mt,c as jt}from"./chunk-EQWH3TBL.js";import{a as j}from"./chunk-TQHNKGRL.js";import{a as Le}from"./chunk-F2GEUOGZ.js";import{a as J}from"./chunk-BIZAKOYU.js";import{b as Ve,c as _e,d as Fe,e as ge,f as Ue,g as mt,h as Be,i as Ke,j as We,m as _t,n as ze,o as Ft,p as Ht,q as He,r as Ce,s as Xe,t as je}from"./chunk-ELMONRIG.js";import{b as Ae,d as pe}from"./chunk-C6XTRC7P.js";import{A as Ge,B as dt,a as ue,b as pt,d as Wt,e as ve,g as be,l as de,o as zt,p as ut,t as me}from"./chunk-P4ZFQZCA.js";import{h as Ie}from"./chunk-S5EF63OY.js";import{ia as Kt}from"./chunk-7L2WUS2V.js";import{$a as Me,$b as Bt,Ab as te,Bb as ne,Bc as ot,Cb as ie,Db as s,Eb as a,F as Ze,Fb as d,Gb as H,Hb as X,Ib as et,Jb as G,Oc as I,Pb as y,Pc as ct,Qb as A,Rb as R,Sb as st,T as ye,Tb as lt,Ua as l,Ub as Oe,Vb as P,Wb as p,Z as O,Zb as ce,ac as W,ea as F,f as at,fa as g,fc as we,gb as le,gc as Re,hc as re,ic as m,jc as xe,ka as Vt,kc as Y,lb as _,lc as Nt,nc as U,oc as B,pc as K,qc as kt,r as Je,ra as At,rc as Ot,sa as Pt,sc as $t,tb as Ut,ub as u,uc as tt,va as E,vc as nt,wb as ke,xc as it,zb as T}from"./chunk-L72ALLHJ.js";import{a as h,b as Ee,c as Lt}from"./chunk-7CGTOI24.js";var Ct=class t{#n=O(Ie);#t=O(ve);#e=O(Le);testDestination(n,e,i){return this.#e.hasV2TestOperations()?this.testDestinationv2(n,e,i):this.testDestinationv1(n,e,i)}testDestinationv2(n,e,i){return new at(o=>{this.#n.postApiV2DestinationTest({requestBody:{DestinationUrl:n,AutoCreate:!1,Options:null}}).subscribe({next:r=>{if(r.Success){o.next({action:"success",targetUrl:n,testAgain:!1,destinationIndex:e,anyFilesFound:!r.Data?.FolderIsEmpty,containsBackup:r.Data?.FolderContainsBackupFiles??void 0,containsEncryptedBackupFiles:r.Data?.FolderContainsEncryptedBackupFiles??void 0}),o.complete();return}this.handleGenericError(o,n,e,r.Error??"Unknown error")},error:r=>{let c=r?.error?.body;if(c?.Data?.FolderExists===!1||c?.StatusCode==="missing-folder"){i?this.handleMissingFolder(o,n,e):this.handleGenericError(o,n,e,$localize`The remote destination folder does not exist.`);return}if(c?.Data?.HostCertificate){this.handleMissingCertificate(o,n,e,c.Data?.HostCertificate);return}if(c?.Data?.ReportedHostKey){this.handleIncorrectKey(o,n,e,c.Data.ReportedHostKey,c.Data.AcceptedHostKey??null);return}this.handleGenericError(o,n,e,r?.message??"Unknown error")}})})}testDestinationv1(n,e,i){return new at(o=>{this.#n.postApiV1RemoteoperationTest({requestBody:{path:n}}).subscribe({next:r=>{o.next({action:"success",targetUrl:n,testAgain:!1,destinationIndex:e}),o.complete()},error:r=>{this.handleDestinationErrorv1(r.message,n,e,i).subscribe(c=>{o.next(c)})}})})}handleMissingFolder(n,e,i){this.#t.open(J,{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:o=>{o&&(this.#e.hasV2TestOperations()?this.#n.postApiV2DestinationTest({requestBody:{DestinationUrl:e,AutoCreate:!0,Options:null}}).subscribe({next:r=>{r.Success?this.handleFolderCreated(n,e,i):this.handleFolderCreateFailure(n,e,i,r.Error??$localize`Unknown error`)},error:r=>{this.handleFolderCreateFailure(n,e,i,r.message??$localize`Unknown error`)}}):this.#n.postApiV1RemoteoperationCreate({requestBody:{path:e}}).subscribe({next:()=>{this.handleFolderCreated(n,e,i)},error:r=>{this.handleFolderCreateFailure(n,e,i,r.message??$localize`Unknown error`)}}))}})}handleFolderCreateFailure(n,e,i,o){this.#t.open(J,{data:{title:$localize`Error creating folder`,message:$localize`The remote destination folder could not be created. ${o}`,confirmText:$localize`OK`,cancelText:null},closed:()=>{n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}})}handleFolderCreated(n,e,i){this.#t.open(J,{data:{title:$localize`Folder created`,message:$localize`The remote destination folder was created successfully.`,confirmText:$localize`OK`,cancelText:null},closed:()=>{n.next({action:"test-again",targetUrl:e,testAgain:!0,destinationIndex:i}),n.complete()}})}reportNoAction(n,e,i){n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}handleMissingCertificate(n,e,i,o){this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
2
2
  If this is a self-signed certificate, you can choose to trust this certificate.
3
3
  The server reported the certificate hash: ${o}`,confirmText:$localize`Trust the certificate`,cancelText:$localize`Cancel`},closed:r=>{if(!r){this.reportNoAction(n,e,i);return}n.next({action:"trust-cert",targetUrl:e,testAgain:!0,certData:o,destinationIndex:i}),n.complete()}})}handleIncorrectKey(n,e,i,o,r){r?this.#t.open(J,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
4
4
  otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
5
5
  Do you want to REPLACE your CURRENT host key ${r}
6
- with the REPORTED host key: ${o}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(n,e,i);return}n.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),n.complete()}}):this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(n,e,i);return}n.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),n.complete()}})}handleGenericError(n,e,i,o){this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:r=>{n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}})}handleDestinationErrorv1(n,e,i,o){return new at(r=>{if(n==="missing-folder"){o?this.handleMissingFolder(r,e,i):this.handleGenericError(r,e,i,$localize`The remote destination folder does not exist.`);return}if(n.startsWith("incorrect-cert:")){let c=n.split("incorrect-cert:")[1];this.handleMissingCertificate(r,e,i,c);return}if(n.startsWith("incorrect-host-key:")){let c=n.split('incorrect-host-key:"')[1].split('",')[0],f=n.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(r,e,i,c,f);return}this.handleGenericError(r,e,i,n)})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var gt=class t{fromString(n){if(!n)return null;let e=n.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(n,e){return`${n}${e}`}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var he=class t{#n=O(Ie);s3Providers=j(this.getS3Config("Providers"));s3Regions=j(this.getS3Config("Regions"));s3RegionHosts=j(this.getS3Config("RegionHosts"));s3StorageClasses=j(this.getS3Config("StorageClasses"));storjSatellites=j(this.getStorjConfig("Satellites"));storjAuthenticationMethods=j(this.getStorjConfig("AuthenticationMethods"));openstackProviders=j(this.getOpenstackConfig("Providers"));openstackVersions=j(this.getOpenstackConfig("Versions"));gcsLocations=j(this.getGcsConfig("Locations"));gcsStorageClasses=j(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(Je(e=>this.#t(e)))}createS3IamUser(n,e){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":e}})}createS3PolicyIAM(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(Je(e=>this.#t(e)))}getOpenstackConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(Je(e=>this.#t(e)))}getGcsConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(Je(e=>this.#t(e)))}#t(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([e,i])=>({key:e,value:i})))??[]}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};function Ne(t){return t==null||t===""?"":":"+t.toString()}function Q(t){return t==null?"":t.startsWith("/")?t:"/"+t}function $(t,n){let e={},i={},o=Se.find(r=>r.key===t);return n.searchParams.forEach((r,c)=>{o?.dynamicFields?.some(N=>N===c||N?.name===c)?i[c]=decodeURIComponent(r):e[c]=decodeURIComponent(r)}),{advanced:e,dynamic:i}}function M(t,n=!1){let e=t.map(([o,r])=>`${o}=${r?encodeURIComponent(r.toString()):""}`).join("&");return e?(n?"":"?")+e:""}function Ct(t){let n=t.destinationType,e=Se.find(i=>i.customKey===n||i.key===n);if(!e)throw new Error("Invalid destination type");return e?.mapper.to(t)??""}function wt(t){let n=URL.canParse(t),e=t.split("://")[0],i=t.split("://")[1],o="http://"+i;if(i.startsWith("%")&&e==="file")return Se.find(r=>r.customKey===e||r.key===e)?.mapper.from(e,new URL("http://localhost"),t);try{let r=new URL(o);return Se.find(c=>c.customKey===e||c.key===e)?.mapper.from(e,r,t)}catch(r){console.error("Error while parsing target path",r)}if(!n)throw new Error("Invalid target path");return null}var C=new Ce,Se=[{key:"file",displayName:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>C.control(t??"")}},mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>{let o=e.startsWith("file:///")?e.split("file:///")[1]:e.split("file://")[1],r=o.startsWith("%"),f=o.slice(1).startsWith(":\\")||r?o:"/"+o;return h({destinationType:t,custom:{path:f}},$(t,n))}}},{key:"ssh",displayName:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>C.control(t??"",[Fe.required,Fe.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"s3",displayName:"S3 compatible bucket",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).s3StorageClasses}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname,bucket:n.hostname}},$(t,n))}},{key:"gcs",displayName:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).gcsStorageClasses},"authid"],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"googledrive",displayName:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"authid",type:"Password"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"pcloud",displayName:"pCloud",description:"Store backups in pCloud.",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>E([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{server:e,path:i}=t.custom;return`${t.destinationType}://${e+Q(i)+n}`},from:(t,n,e)=>{let i=n.pathname.replace(/^\//,"");return h({destinationType:t,custom:{server:n.hostname,path:i}},$(t,n))}}},{key:"azure",displayName:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",shortDescription:"Container name",longDescription:"Container name",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"onedrivev2",displayName:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"sharepoint",displayName:"Microsoft SharePoint v2",description:"Store backups in Microsoft SharePoint.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"dropbox",displayName:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"box",displayName:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"jottacloud",displayName:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"b2",displayName:"B2 Cloud Storage",description:"Store backups in B2 Cloud Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{bucket:n.hostname,path:decodeURIComponent(n.pathname)}},$(t,n))}},{key:"e2",displayName:"IDrive e2",description:"Store backups in IDrive e2.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{bucket:n.hostname,path:n.pathname}},$(t,n))}},{key:"mega",displayName:"Mega.nz",description:"Store backups in Mega.nz.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"msgroup",displayName:"Microsoft Office 365 Group",description:"Store backups in Microsoft Office 365 Group.",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:"Group email",longDescription:"Group email",formElement:t=>C.control(t??"",[Fe.email])},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"rclone",displayName:"Rclone",description:"Store backups in Rclone.",dynamicFields:[{name:"rclone-local-repository",shortDescription:"Local repository",defaultValue:""},{name:"rclone-remote-repository",shortDescription:"Remote repository",defaultValue:""},{name:"rclone-remote-path",shortDescription:"Path on remote repository",defaultValue:""}],mapper:{to:t=>{let n=t.dynamic["rclone-remote-repository"],e=t.dynamic["rclone-remote-path"],i=Object.entries(t.dynamic).filter(([r])=>!["rclone-remote-repository","rclone-remote-path"].includes(r)),o=M([...Object.entries(t.advanced),...i]);return`${t.destinationType}://${n}/${e+o}`},from:(t,n,e)=>{let{advanced:i,dynamic:o}=$(t,n);return h({destinationType:t,dynamic:h({"rclone-remote-repository":n.hostname,"rclone-remote-path":n.pathname},o)},i)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:t=>t.get(he).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:t=>t.get(he).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{bucket:e}=t.custom;return`${t.destinationType}://${e+n}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname,bucket:n.hostname}},$(t,n))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:n,server:e,path:i}=t.custom,o=t.dynamic["use-ssl"],r=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([c])=>c!=="use-ssl")]);return`${t.destinationType}${o?"s":""}://${e+Ne(n)+Q(i)+r}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:n,server:e,path:i}=t.custom,o=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([r])=>r!=="use-ssl")]);return`${t.destinationType}://${e+Ne(n)+Q(i)+o}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"sia",displayName:"Sia Decentrilized Cloud",description:"Store backups in Sia Decentrilized Cloud.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:t=>{let n=t.custom.server,e=t.dynamic["sia-targetpath"],i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([o])=>o!=="sia-targetpath")]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname}},$(t,n))}},{key:"cos",displayName:"Tencent COS",description:"Store backups in Tencent COS.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"cos-bucket",shortDescription:"Bucket",order:1},{name:"cos-region",shortDescription:"Region",order:2},{name:"cos-app-id",shortDescription:"COS App Id",order:3},{name:"cos-secret-id",shortDescription:"COS Secret Id",order:4},{name:"cos-secret-key",shortDescription:"COS Secret Key",order:5}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([i])=>i!=="cos-targetpath")]);return`${t.destinationType}://${n+e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname}},$(t,n))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:t=>{let{port:n,server:e,path:i,username:o,password:r}=t.custom,c={"auth-username":o,"auth-password":r},f=t.dynamic["use-ssl"],N=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([I])=>I!=="use-ssl"),...Object.entries(c)]);return`${t.destinationType}${f?"s":""}://${e+Ne(n)+Q(i)+N}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"cifs",displayName:"CIFS",description:"Store backups in CIFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},share:{type:"String",name:"share",shortDescription:"Share Name",longDescription:"Share Name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["transport","auth-username","auth-password","auth-domain"],mapper:{to:t=>{let{share:n,server:e,path:i,username:o,password:r}=t.custom,c={"auth-username":o,"auth-password":r},f=new Map([...Object.entries(c),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),N=M(Array.from(f));return`${t.destinationType}://${e+Q(n)+Q(i)+N}`},from:(t,n,e)=>{let i=n.pathname.split("/")[1],o=n.pathname.split("/").slice(2).join("/");return h({destinationType:t,custom:{server:n.hostname,share:i,path:o}},$(t,n))}}},{key:"filen",displayName:"Filen.io",description:"Store backups in Filen.io.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filen",longDescription:"Path on Filen",formElement:t=>C.control(t??"")}},dynamicFields:["auth-username","auth-password"],mapper:{to:t=>{let{path:n,username:e,password:i}=t.custom,o={"auth-username":e,"auth-password":i},r=new Map([...Object.entries(o),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),c=M(Array.from(r));return`${t.destinationType}://${n+c}`},from:(t,n,e)=>{let i=n.hostname??"";return n.pathname&&i!==""&&n.pathname[0]!="/"&&(i+="/"),i+=n.pathname,h({destinationType:t,custom:{path:i}},$(t,n))}}},{key:"filejump",displayName:"Filejump",description:"Store backups in Filejump.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filejump",longDescription:"Path on Filejump",formElement:t=>C.control(t??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:"API Token",longDescription:"Filejump API Token",formElement:t=>C.control(t??"")}],mapper:{to:t=>{let{path:n,username:e,password:i,apitoken:o}=t.custom,r=(o||"").trim()===""?{"auth-username":e,"auth-password":i}:{"api-token":o},c=new Map([...Object.entries(r),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),f=M(Array.from(c));return`${t.destinationType}://${n+f}`},from:(t,n,e)=>{let i=n.hostname??"";return n.pathname&&i!==""&&n.pathname[0]!="/"&&(i+="/"),i+=n.pathname,h({destinationType:t,custom:{path:i}},$(t,n))}}},{key:"storj",customKey:"storjAccessGrant",displayName:"Storj Access Grant",description:"Store backups in Storj Access Grant.",dynamicFields:[{name:"storj-shared-access",shortDescription:"Access Grant"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${M([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,n,e)=>h({destinationType:t},$(t,n))}},{key:"storj",customKey:"storjApiKey",displayName:"Storj API Key",description:"Store backups in Storj API Key.",dynamicFields:[{name:"storj-satellite",shortDescription:"Satellite",type:"Enumeration",loadOptions:t=>t.get(he).storjSatellites},{name:"storj-api-key",shortDescription:"API Key"},{name:"storj-secret",shortDescription:"Secret"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=API%20key&${M([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,n,e)=>h({destinationType:t},$(t,n))}}];var on=["formRef"];function rn(t,n){t&1&&(s(0,"spk-alert",17),y(1,5),d(2,"spk-icon",26),A(),a())}function an(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Y(" ",e.DisplayName," ")}}function sn(t,n){if(t&1&&d(0,"spk-progress-bar",40),t&2){let e=p(3);ke("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),u("value",e.calculatePasswordStrength()*(100/5))}}function ln(t,n){t&1&&(s(0,"span",35),R(1,10),a())}function cn(t,n){t&1&&(y(0,8,1),d(1,"spk-icon"),A())}function pn(t,n){t&1&&(y(0,8,2),d(1,"spk-icon"),A())}function un(t,n){t&1&&(y(0,11,1),d(1,"spk-icon",42),A())}function dn(t,n){t&1&&(y(0,11,2),d(1,"spk-icon"),A())}function mn(t,n){if(t&1){let e=G();s(0,"button",41),P("click",function(){F(e);let o=p(3);return g(o.copyPassword())}),y(1,11),_(2,un,2,0)(3,dn,2,0),A(),a()}if(t&2){let e=p(3);l(2),T(e.copiedPassword()?2:3)}}function _n(t,n){t&1&&(s(0,"spk-alert",39),R(1,12),a())}function Fn(t,n){if(t&1){let e=G();s(0,"div",30)(1,"spk-form-field")(2,"label",31),y(3,7),d(4,"sup"),A(),a(),d(5,"input",32),a(),_(6,sn,1,9,"spk-progress-bar",33),s(7,"spk-form-field"),d(8,"input",34),_(9,ln,2,0,"span",35),a(),s(10,"div",36)(11,"button",37),P("click",function(){F(e);let o=p(2);return g(o.showPassword.set(!o.showPassword()))}),y(12,8),_(13,cn,2,0)(14,pn,2,0),A(),a(),s(15,"button",37),P("click",function(){F(e);let o=p(2);return g(o.generatePassword())}),y(16,9),d(17,"spk-icon"),A(),a(),_(18,mn,4,1,"button",38),a(),_(19,_n,2,0,"spk-alert",39),a()}if(t&2){let e=p(2);l(5),u("type",e.showPassword()?"text":"password"),l(),T(e.generalForm.value.password?6:-1),l(2),u("type",e.showPassword()?"text":"password"),l(),T(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),l(4),T(e.showPassword()?13:14),l(5),T(e.showCopyPassword()?18:-1),l(),T(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function gn(t,n){if(t&1&&(s(0,"spk-select",27)(1,"label",28),R(2,6),a(),d(3,"input",29),_(4,an,1,1,"ng-template"),a(),_(5,Fn,20,7,"div",30)),t&2){let e=p();u("options",e.encryptionOptions())("isClearable",!1),l(5),T(e.encryptionFieldSignal()!==""?5:-1)}}function Cn(t,n){if(t&1&&(s(0,"button",24),y(1,13),d(2,"spk-icon"),A(),a()),t&2){let e=p();u("disabled",e.nameAndDescriptionValid()===!1)}}function hn(t,n){if(t&1&&(s(0,"spk-tooltip",25)(1,"button",24),y(2,14),d(3,"spk-icon"),A(),a()()),t&2){let e=p();u("disabled",!(e.showCopyPassword()&&!e.copiedPassword())),l(),u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var Ye=new Ce,Qt=(t={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>Ye.group({name:Ye.control(t.name,[Fe.required]),description:Ye.control(t.description),encryption:Ye.control(t.encryption,[jt()]),password:Ye.control(t.password,[Mt(n=>n?.value.encryption!=="",[Fe.required])]),repeatPassword:Ye.control(t.repeatPassword,[Mt(n=>n?.value.encryption!=="",[Fe.required])])}),xt={Key:"",DisplayName:"None"},Rt=class t{#n=O(pe);#t=O(Ae);#e=O(Xt);#i=O(fe);#o=O(Le);formRef=Me.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=E(!1);copiedPassword=E(!1);showCopyPassword=E(!1);encryptionEffect=st(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=b(()=>{let n=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=b(()=>{let e=this.generalFormSignal()?.password??"";return this.#e.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit(!0)}async copyPassword(){let n=this.generalForm.controls.password.value;await this.#r(n??""),this.copiedPassword.set(!0)}async#r(n){try{await navigator.clipboard.writeText(n)}catch{try{let i=document.createElement("textarea");i.value=n,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}displayFn(){let n=this.#o.systemInfo()?.EncryptionModules??[];return e=>{let i=[xt,...n].find(o=>o.Key===e);return i?`${i.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#e.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#n.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&we(i.formRef,on,5),e&2&&Re()},decls:21,vars:4,consts:()=>{let n;n=$localize`Your backup name`;let e;e=$localize`Your backup description`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let f;f=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Encrypted backup `;let N;N=$localize`Encryption`;let I;I=$localize`Encryption`;let z;z=$localize`Password`;let w;w=$localize`Repeat password`;let v;v=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let V;V=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_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_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,V=Oe(V);let oe;oe=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let Z;Z=$localize`Passwords do not match`;let S;S=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,S=Oe(S);let D;D=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let L;L=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let q;return q=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],i,o,r,c,f,I,v,V,oe,Z,S,D,L,q,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"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",z,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",w,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,i){if(e&1){let o=G();s(0,"form",15,0),P("submit",function(){return F(o),g(i.next())}),s(2,"h3",16),R(3,1),a(),_(4,rn,3,0,"spk-alert",17),s(5,"spk-form-field")(6,"label",18),y(7,2),d(8,"sup"),A(),a(),d(9,"input",19),a(),s(10,"spk-form-field")(11,"label",20),R(12,3),a(),d(13,"textarea",21),a(),_(14,gn,6,3),s(15,"div",22)(16,"button",23),P("click",function(){return F(o),g(i.exit())}),y(17,4),d(18,"spk-icon"),A(),a(),_(19,Cn,3,1,"button",24)(20,hn,4,2,"spk-tooltip",25),a()()}if(e&2){let o;u("formGroup",i.generalForm),l(4),T(!i.isNew()&&((o=i.generalFormSignal())==null?null:o.encryption)!==""?4:-1),l(10),T(i.isNew()?14:-1),l(5),T(i.encryptionFieldSignal()===""||!i.isNew()?19:20)}},dependencies:[je,Ke,_e,ge,Ue,ze,He,de,me,be,ue,ct,lt,pt],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-500)}.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%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};function fn(t,n){if(t&1){let e=G();s(0,"div",24)(1,"spk-form-field")(2,"label",25),R(3,7),a(),s(4,"input",26,0),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.nextTime().time,o)||(r.scheduleFields.nextTime().time=o),g(o)}),P("focus",function(){F(e);let o=re(5);return g(o.showPicker())}),a(),s(6,"spk-icon",27),m(7,"clock"),a()(),s(8,"spk-form-field"),d(9,"label",28),s(10,"input",29,1),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.nextTime().date,o)||(r.scheduleFields.nextTime().date=o),g(o)}),P("focus",function(){F(e);let o=re(11);return g(o.showPicker())}),a(),s(12,"spk-icon",27),m(13,"calendar"),a()()(),s(14,"div",24)(15,"spk-form-field")(16,"label",30),R(17,8),a(),s(18,"input",31),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().repeatValue,o)||(r.scheduleFields.runAgain().repeatValue=o),g(o)}),a()(),s(19,"spk-select",32)(20,"input",33),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().repeatUnit,o)||(r.scheduleFields.runAgain().repeatUnit=o),g(o)}),a()()(),s(21,"app-toggle-card",34),H(22,35),R(23,9),X(),s(24,"div",36)(25,"spk-toggle",19),y(26,10),s(27,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.mon,o)||(r.scheduleFields.runAgain().allowedDays.mon=o),g(o)}),a(),A(),a(),s(28,"spk-toggle",19),y(29,11),s(30,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.tue,o)||(r.scheduleFields.runAgain().allowedDays.tue=o),g(o)}),a(),A(),a(),s(31,"spk-toggle",19),y(32,12),s(33,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.wed,o)||(r.scheduleFields.runAgain().allowedDays.wed=o),g(o)}),a(),A(),a(),s(34,"spk-toggle",19),y(35,13),s(36,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.thu,o)||(r.scheduleFields.runAgain().allowedDays.thu=o),g(o)}),a(),A(),a(),s(37,"spk-toggle",19),y(38,14),s(39,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.fri,o)||(r.scheduleFields.runAgain().allowedDays.fri=o),g(o)}),a(),A(),a(),s(40,"spk-toggle",19),y(41,15),s(42,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.sat,o)||(r.scheduleFields.runAgain().allowedDays.sat=o),g(o)}),a(),A(),a(),s(43,"spk-toggle",19),y(44,16),s(45,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.sun,o)||(r.scheduleFields.runAgain().allowedDays.sun=o),g(o)}),a(),A(),a()()()}if(t&2){let e=p();l(4),U("ngModel",e.scheduleFields.nextTime().time),l(6),U("ngModel",e.scheduleFields.nextTime().date),l(8),U("ngModel",e.scheduleFields.runAgain().repeatValue),l(),u("options",e.unitOptions)("isClearable",!1),l(),U("ngModel",e.scheduleFields.runAgain().repeatUnit),l(),u("disallowToggle",!0),l(6),U("ngModel",e.scheduleFields.runAgain().allowedDays.mon),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.tue),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.wed),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.thu),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.fri),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.sat),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var Sn=[{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`}],$e={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},It=class t{#n=O(fe);#t=O(pe);#e=O(Ae);unitOptions=Sn;scheduleFields=this.#n.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#e.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#e.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let n;n=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let i;i=$localize`If a date was missed, the job will run as soon as possible.`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let r;r=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let c;c=$localize`Next time`;let f;f=$localize`Run again every`;let N;N=$localize`Allowed days`;let I;I=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let z;z=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let V;V=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let oe;oe=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let Z;return Z=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],n,e,i,o,r,c,f,N,I,z,w,v,V,oe,Z,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,i){e&1&&(s(0,"h3",17),R(1,2),a(),s(2,"div",18)(3,"spk-toggle",19),y(4,3),s(5,"input",20),K("ngModelChange",function(r){return B(i.scheduleFields.autoRun,r)||(i.scheduleFields.autoRun=r),r}),a(),A(),a(),s(6,"p"),R(7,4),a()(),_(8,fn,46,14),s(9,"div",21)(10,"button",22),P("click",function(){return i.goBack()}),y(11,5),d(12,"spk-icon"),A(),a(),s(13,"button",23),P("click",function(){return i.next()}),y(14,6),d(15,"spk-icon"),A(),a()()),e&2&&(l(5),U("ngModel",i.scheduleFields.autoRun),l(3),T(i.scheduleFields.autoRun()?8:-1))},dependencies:[Xe,_e,We,Ve,ge,Be,de,Ge,ue,be,me,qe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Tn(t,n){if(t&1&&(H(0,4),m(1),X()),t&2){let e,i=p();l(),xe((e=i.currentExpressionOption())==null?null:e.startsWith)}}function Dn(t,n){if(t&1&&(H(0,5),m(1),X()),t&2){let e,i=p();l(),xe((e=i.currentExpressionOption())==null?null:e.endsWith)}}var En=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],St=class t{path=yt.required();osType=yt();pathChange=Et();remove=Et();internalPath=E("");pathType=E("-Expression");currentExpressionOption=b(()=>{let n=this.pathType();return this.expressionOptions().find(e=>e.value===n)});expressionOptions=b(()=>{let e=this.osType()==="Windows"?"\\":"/";return En.map(i=>i.value==="-Folder"||i.value==="+Folder"?Ee(h({},i),{startsWith:"",endsWith:""}):i.value==="-FolderName"||i.value==="+FolderName"?Ee(h({},i),{startsWith:"*",endsWith:`*${e}`}):i.value==="-FileName"||i.value==="+FileName"?Ee(h({},i),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):i.value==="-FileGroup"||i.value==="+FileGroup"?Ee(h({},i),{startsWith:"{",endsWith:"}"}):i.value==="-Regex"||i.value==="+Regex"?Ee(h({},i),{startsWith:"[",endsWith:"]"}):i.value==="-Extension"||i.value==="+Extension"?Ee(h({},i),{startsWith:"*.",endsWith:""}):Ee(h({},i),{startsWith:"",endsWith:""}))});pathEffect=st(()=>{let n=this.path(),e=n.slice(1),i=n.startsWith("-")?"-":"+",o=this.osType()==="Windows",r=o?"\\":"/";e.startsWith("%")&&e.endsWith(r)||o&&e.slice(2).startsWith(r)&&e.endsWith(r)||e.startsWith(r)&&e.endsWith(r)?(this.pathType.set(`${i}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${r}`)?(this.pathType.set(`${i}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${r}]*]`)?(this.pathType.set(`${i}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${i}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${i}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${i}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${i}Expression`),this.internalPath.set(e))});updateFilter(){let n=this.internalPath(),e=this.currentExpressionOption();n!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${n}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:9,vars:6,consts:()=>{let n;return n=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"expression-input"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""],[1,"filter-removal",3,"click"],[1,"spk-primary"]]},template:function(e,i){if(e&1&&(s(0,"spk-select",0)(1,"input",1),K("ngModelChange",function(r){return B(i.pathType,r)||(i.pathType=r),r}),P("ngModelChange",function(){return i.updateFilter()}),a()(),s(2,"spk-form-field",2)(3,"input",3),K("ngModelChange",function(r){return B(i.internalPath,r)||(i.internalPath=r),r}),P("ngModelChange",function(){return i.updateFilter()}),a(),_(4,Tn,2,1,"ng-container",4)(5,Dn,2,1,"ng-container",5),a(),s(6,"div",6),P("click",function(){return i.removeFilter()}),s(7,"spk-icon",7),m(8,"x-circle"),a()()),e&2){let o,r;u("options",i.expressionOptions())("isClearable",!1),l(),U("ngModel",i.pathType),l(2),U("ngModel",i.internalPath),l(),T(!((o=i.currentExpressionOption())==null||o.startsWith==null)&&o.startsWith.length?4:-1),l(),T(!((r=i.currentExpressionOption())==null||r.endsWith==null)&&r.endsWith.length?5:-1)}},dependencies:[Xe,_e,ge,Be,me,de,ue],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-level-20)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var yn=["formRef"],Jt=()=>({standalone:!0});function An(t,n){if(t&1){let e=G();s(0,"spk-form-field",42)(1,"input",43),K("ngModelChange",function(o){F(e);let r=p(2);return B(r.editingPath,o)||(r.editingPath=o),g(o)}),a()(),s(2,"button",44),P("click",function(){F(e);let o=p(2);return g(o.updatePath())}),s(3,"spk-icon"),m(4,"floppy-disk"),a()(),s(5,"button",44),P("click",function(){F(e);let o=p(2);return g(o.cancelEditPath())}),s(6,"spk-icon"),m(7,"x-bold"),a()()}if(t&2){let e=p(2);l(),U("ngModel",e.editingPath),u("ngModelOptions",tt(2,Jt))}}function Pn(t,n){if(t&1){let e=G();s(0,"spk-form-field",42),d(1,"input",45),a(),s(2,"button",44),P("click",function(){F(e);let o=p().$implicit,r=p();return g(r.editPath(o))}),s(3,"spk-icon"),m(4,"pen"),a()(),s(5,"button",44),P("click",function(){F(e);let o=p().$implicit,r=p();return g(r.removePath(o))}),s(6,"spk-icon"),m(7,"trash-simple"),a()()}if(t&2){let e=p().$implicit;Ut("readonly",!0),l(),u("ngModel",e)("ngModelOptions",tt(3,Jt))}}function Nn(t,n){if(t&1&&(s(0,"div",30),_(1,An,8,3)(2,Pn,8,4),a()),t&2){let e=n.$implicit,i=p();l(),T(i.oldPath()===e?1:2)}}function kn(t,n){if(t&1){let e=G();s(0,"app-new-filter",47),P("pathChange",function(o){let r=F(e).$index,c=p(2);return g(c.patchPathAt(o,r))})("remove",function(){let o=F(e).$index,r=p(2);return g(r.removePathAt(o))}),a()}if(t&2){let e,i=n.$implicit,o=p(2);u("path",i)("osType",(e=o.osType())!==null&&e!==void 0?e:"")}}function On(t,n){if(t&1&&ne(0,kn,1,2,"app-new-filter",46,te),t&2){let e=p();ie(e.pathArray())}}function $n(t,n){if(t&1&&(s(0,"div",41)(1,"spk-form-field"),d(2,"input",48),a(),s(3,"spk-select",49),d(4,"input",50),a()()),t&2){let e=p();l(3),u("options",e.sizeOptions())("isClearable",!1)}}var Te=new Ce,Mn=["Bytes","KB","MB","GB","TB","PB"],Zt=(t={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>Te.group({path:Te.control(t.path),excludes:Te.group({hidden:Te.control(t.excludes.hidden),system:Te.control(t.excludes.system),temporary:Te.control(t.excludes.temporary),filesLargerThan:Te.group({size:Te.control(null),unit:Te.control(null)})})}),vt=class t{#n=O(fe);#t=O(pe);#e=O(Ae);formRef=Me.required("formRef");sourceDataForm=this.#n.sourceDataForm;sourceDataFormSignal=this.#n.sourceDataFormSignal;newPathCtrl=new ut("");filesLargerThan=b(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=E(Mn);osType=this.#n.osType;pathSignal=j(this.sourceDataForm.controls.path.valueChanges);pathArray=b(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+")||n==="___none___")??[]);nonFilterPaths=b(()=>this.pathSignal()?.split("\0").filter(n=>!n.startsWith("-")&&!n.startsWith("+")&&n!==""));oldPath=E(null);editingPath=E(null);addingNewPath=E(!1);editPath(n){this.oldPath.set(n),this.editingPath.set(n)}updatePath(){let n=this.oldPath(),e=this.editingPath();if(!n||!e||e===n){this.oldPath.set(null),this.editingPath.set(null);return}let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(i?.replace(n,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(n){let e=this.sourceDataForm.controls.path.value??"",i=e.indexOf(n);if(i===-1)return;let o=i===0?n:"\0"+n,r=e.replace(o,"");this.sourceDataForm.controls.path.setValue(r)}addFilter(n="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${n}`)}patchPathAt(n,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),r=this.pathArray().map((c,f)=>f===e?`${n}`:`${c}`).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${r}`)}removePathAt(n){let i=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),o=this.pathArray().filter((r,c)=>c!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${o}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value;this.sourceDataForm.controls.path.setValue(`${n}\0${e}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#e.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#e.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&we(i.formRef,yn,5),e&2&&Re()},decls:56,vars:12,consts:()=>{let n;n=$localize`Path`;let e;e=$localize`Add a direct path`;let i;i=$localize`Hidden files`;let o;o=$localize`System files`;let r;r=$localize`Temporary files`;let c;c=$localize`Source Data`;let f;f=$localize`Folder path`;let N;N=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let I;I=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let z;z=$localize`Paths`;let w;w=$localize`Add a path directly from your machine.`;let v;v=$localize`Filters`;let V;V=$localize`Customize your filters.`;let oe;oe=$localize`Add filter`;let Z;Z=$localize`Exclude`;let S;S=$localize`Choose if there’s any files you want to exclude.`;let D;D=$localize` Hidden files ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let L;L=$localize` System files ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let q;q=$localize` Temporary files ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let k;k=$localize` Files larger than `;let ae;ae=$localize`Edit path`;let se;return se=$localize`Select an option...`,[["formRef",""],c,f,N,I,z,w,v,V,oe,Z,S,D,L,q,k,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",n,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",i,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",r,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"small"],["type","text","placeholder",ae,3,"ngModelChange","ngModel","ngModelOptions"],["spk-button","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",se]]},template:function(e,i){if(e&1){let o=G();s(0,"form",16,0),P("submit",function(){return F(o),g(i.next())}),s(2,"div",17)(3,"h3",18),R(4,1),a(),s(5,"app-file-tree",19)(6,"label",20),R(7,2),a(),d(8,"input",21),a(),s(9,"div",22)(10,"button",23),P("click",function(){return F(o),g(i.goBack())}),y(11,3),d(12,"spk-icon"),A(),a(),s(13,"button",24),y(14,4),d(15,"spk-icon"),A(),a()()(),s(16,"div",25)(17,"app-toggle-card",26),H(18,27),R(19,5),X(),s(20,"p",28),R(21,6),a(),s(22,"div",29),ne(23,Nn,3,1,"div",30,te),s(25,"div",31)(26,"spk-form-field"),d(27,"input",32),a(),s(28,"button",33),P("click",function(){return F(o),g(i.addNewPath())}),s(29,"spk-icon"),m(30,"plus"),a()()()()(),s(31,"app-toggle-card",26),H(32,27),R(33,7),X(),s(34,"p",28),R(35,8),a(),s(36,"button",34),P("click",function(){return F(o),g(i.addFilter())}),R(37,9),a(),_(38,On,2,0),a(),s(39,"app-toggle-card",35),H(40,27),R(41,10),X(),s(42,"p",28),R(43,11),a(),s(44,"spk-toggle",36),y(45,12),d(46,"input",37),A(),a(),s(47,"spk-toggle",36),y(48,13),d(49,"input",38),A(),a(),s(50,"spk-toggle",36),y(51,14),d(52,"input",39),A(),a(),s(53,"spk-toggle",40),P("click",function(){return F(o),g(i.toggleFilesLargerThan())}),R(54,15),a(),_(55,$n,5,2,"div",41),a()()()}if(e&2){let o;u("formGroup",i.sourceDataForm),l(5),u("multiSelect",!0)("startingPath",i.getPath())("showFiles",!0),l(12),u("disallowToggle",!0),l(6),ie(i.nonFilterPaths()),l(4),u("formControl",i.newPathCtrl),l(4),u("disallowToggle",!0),l(7),T((o=i.pathSignal())!=null&&o.length?38:-1),l(),u("disallowToggle",!0),l(14),ke("active",i.filesLargerThan()),l(2),T(i.filesLargerThan()?55:-1)}},dependencies:[Xe,Ke,_e,We,Ve,ge,Ue,Be,je,dt,ze,He,mt,de,ue,be,Ge,me,St,_t,qe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}spk-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var en="1W:1D,4W:1W,12M:1M",De=new Ce,fe=class t{#n=O(pe);#t=O(Le);#e=O(ve);#i=O(Ie);#o=O(gt);generalForm=Qt();sourceDataForm=Zt();scheduleFields={autoRun:E($e.autoRun),nextTime:E($e.nextTime),runAgain:E($e.runAgain)};destinationForm=tn();settings=E([]);optionsFields={remoteVolumeSize:E("50MB"),backupRetention:E("all"),backupRetentionTime:E(""),backupRetentionVersions:E(0),backupRetentionCustom:E("")};isDraft=E(!1);backupId=E(null);backupName=b(()=>this.generalFormSignal()?.name??"");isSubmitting=E(!1);finishedLoading=E(!1);backupDefaults=E(null);isNew=b(()=>this.backupId()==="new");osType=b(()=>this.#t.systemInfo()?.OSType);selectedOptions=E([]);selectedAdvancedFormPair=E([]);destinationFormPair=E({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=b(()=>{let n=this.destinationFormPair()?.advanced??[],e=this.selectedAdvancedFormPair()??[];return n.filter(i=>e.findIndex(o=>o.name===i.name)===-1)});selectedHttpOptions=E([]);notSelectedHttpOptions=b(()=>{let n=this.httpOptions(),e=this.selectedHttpOptions()??[];return n.filter(i=>e.findIndex(o=>o.name===i.name)===-1)});sourceDataFormSignal=j(this.sourceDataForm.valueChanges);destinationFormSignal=j(this.destinationForm.valueChanges);generalFormSignal=j(this.generalForm.valueChanges);encryptionFieldSignal=j(this.generalForm.controls.encryption.valueChanges);destinationOptions=b(()=>this.#t.backendModules()??[]);httpOptions=b(()=>this.#t.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#r)??[]);advancedOptions=b(()=>this.#t.systemInfo()?.Options?.map(this.#r)??[]);#r(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=b(()=>{let n=this.#t.systemInfo()?.EncryptionModules??[];return[xt,...n]});nonSelectedOptions=b(()=>this.advancedOptions().sort((n,e)=>n?.name&&e?.name?n?.name.localeCompare(e?.name):0).filter(n=>this.selectedOptions()?.findIndex(e=>e.name===n.name)===-1));addOrUpdateAdvancedFormPairByName(n,e,i){let o=this.selectedAdvancedFormPair().find(r=>r.name===n);if(o)this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.controls[o.name].setValue(i);else{let r=this.notSelectedAdvancedFormPair().find(c=>c.name===n);if(!r)return;this.addAdvancedFormPair(r,e,i)}}addAdvancedFormPairByName(n,e,i){let o=this.notSelectedAdvancedFormPair().find(r=>r.name===n);o&&this.addAdvancedFormPair(o,e,i)}addHttpOptionByName(n,e,i){let o=this.notSelectedHttpOptions().find(r=>r.name===n);o&&this.addHttpOption(o,e,i)}addAdvancedFormPair(n,e,i){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,r=i??n.defaultValue;this.createFormField(o,n,r),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,e,i){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,r=i??n.defaultValue;this.createFormField(o,n,r),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(o=>o.name===n.name)!==-1?this.selectedAdvancedFormPair.update(o=>(o=o.filter(r=>r.name!==n.name),o)):this.selectedHttpOptions.update(o=>(o=o.filter(r=>r.name!==n.name),o))}removeHttpOption(n,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(i=>(i=i.filter(o=>o.name!==n.name),i))}submit(){this.isSubmitting.set(!0);let n=this.#l(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#i.postApiV1Backups({requestBody:n}).pipe(Ze(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{this.exit(!1)},error:i=>{}}):this.#i.putApiV1BackupById({id:e,requestBody:n}).pipe(Ze(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{this.exit(!1)},error:i=>{}})}exit(n){if(!n){this.#p(),this.#n.navigate(["/"]);return}this.#e.open(J,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#p(),this.#n.navigate(["/"]))}})}updateFieldsFromTargetUrl(n){this.#s(),setTimeout(()=>{this.#a(n)})}#s(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(n){let e=n.Sources??"",i=n.Filters?.map(f=>`${f.Include?"":"-"}${f.Expression}`)??[],o=n.Settings?.find(f=>f.Name==="--exclude-files-attributes")?.Value??"",r=n.Settings?.find(f=>f.Name==="--skip-files-larger-than")??null,c={path:[...e,...i].join("\0"),excludes:{hiddenFiles:o.includes("hidden"),systemFiles:o.includes("system"),tempFiles:o.includes("temporary"),filesLargerThan:r?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(n){let e=n.TargetURL?wt(n.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}#a(n){let e=wt(n);e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}mapGeneralToForm(n){let e=n.Settings?.find(c=>c.Name==="encryption-module"),i=n.Settings?.find(c=>c.Name==="passphrase")?.Value??"",o=e?.Value&&e.Value.length?e.Value:"",r={name:n.Name??"",description:n.Description??""};o&&o!==""&&(r.encryption=o),i&&i!==""&&(r.password=i,r.repeatPassword=i),this.generalForm.patchValue(r)}mapScheduleToForm(n){if(!n){this.scheduleFields.autoRun.set(!1);return}let e=this.#o.fromString(n.Repeat)??null,i=this.#u(n.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(o=>h(h({},o),i)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:n.AllowedDays?.includes("mon")??!1,tue:n.AllowedDays?.includes("tue")??!1,wed:n.AllowedDays?.includes("wed")??!1,thu:n.AllowedDays?.includes("thu")??!1,fri:n.AllowedDays?.includes("fri")??!1,sat:n.AllowedDays?.includes("sat")??!1,sun:n.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(n){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=n.Settings?.filter(c=>!e.includes(c.Name)),o=n.Settings?.filter(c=>e.includes(c.Name));this.settings.set(i??[]),i?.forEach(c=>{if(c.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(c.Value??"")});var r="all";o?.forEach(c=>{if(c.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(c.Value??"50MB"),c.Name==="keep-time"&&(c.Value??"")!=="")return r="time",this.optionsFields.backupRetentionTime.set(c.Value??"");if(c.Name==="keep-versions"&&(c.Value??"")!=="")return r="versions",this.optionsFields.backupRetentionVersions.set(c.Value?parseInt(c.Value):null);if(c.Name==="retention-policy"&&(c.Value??"")!=="")if(c.Value===en)r="smart";else return r="custom",this.optionsFields.backupRetentionCustom.set(c.Value??"")}),this.optionsFields.backupRetention.set(r)}getCurrentTargetUrl(){return this.#c(this.destinationForm.controls.destinations)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#l(){let n=this.generalForm.value,e=this.getScheduleFormValue(),i=this.sourceDataForm.value,r=this.destinationForm.value.destinations?.length?this.#c(this.destinationForm.controls.destinations):[],c=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(c=this.#o.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let f=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([v,V])=>V).map(([v,V])=>v):[],N=i.path?.split("\0")??[],I=this.mapFormsToSettings(),z=Object.entries(i.excludes??{}).filter(([v,V])=>V&&v!=="filesLargerThan").map(([v])=>v),w=i.excludes?.filesLargerThan;return z.length&&I.push({Name:"--exclude-files-attributes",Value:z.join(",")}),w&&w.size!==null&&w.unit!==null&&I.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:r[0]??null,Sources:N.filter(v=>!v.startsWith("-")),Settings:I,Filters:N.filter(v=>v.startsWith("-")).map((v,V)=>({Order:V,Include:!1,Expression:v.slice(1)}))},Schedule:e.autoRun?{Repeat:c,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:f}:null}}mapFormsToSettings(n=[]){let e=this.generalForm.value,i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size"],o=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&(o=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:en});break}let c=[...n,...i],f=this.settings().filter(N=>!c.includes(N.Name)).map(N=>{let I=N.Value;return typeof N.Value=="number"&&(I=N.Value.toString()),typeof N.Value=="boolean"&&(I=N.Value?"True":"False"),{Name:N.Name,Value:I}});return[...o,...r,...f]}#c(n){return n.controls.map(e=>Ct(e.value))}#u(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let e=new Date(n);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}createFormField(n,e,i){if(e.type==="String"||e.type==="FileTree"||e.type==="FolderTree"||e.type==="Password"||e.type==="Enumeration"||e.type==="NonValidatedSelectableString"||e.type==="Path"){n.addControl(e.name,De.control(i));return}if(e.type==="Size"){n.addControl(e.name,De.control(i));return}if(e.type==="Integer"){n.addControl(e.name,De.control(i?parseInt(i):0));return}if(e.type==="Boolean"){n.addControl(e.name,De.control(i==="true"||i==="True"));return}if(e.type==="Flags"){n.addControl(e.name,De.control(i??""));return}if(e.type==="Timespan"||e.type==="DateTime"){n.addControl(e.name,De.control(i,[Fe.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,e,i=!1){let o=Se.find(S=>S.customKey===n||S.key===n),r=o?.key,c=this.destinationOptions().find(S=>S.Key===r),f=this.httpOptions();if(!c||!c.Options)return;let N=o&&o.oauthField?o.oauthField:null,I=o&&o.customFields?o.customFields:{},z=o&&o.dynamicFields?o.dynamicFields:[],w=o&&o.advancedFields?o.advancedFields:[],v=o&&o.ignoredAdvancedFields?o.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:N,custom:[],dynamic:[],advanced:[]});let V=De.group({}),oe=De.group({}),Z=De.group({});I&&Object.entries(I).forEach(([S,D],L)=>{let ae=D,{formElement:q}=ae,k=Lt(ae,["formElement"]);V.addControl(S,q(e?.custom[S])),this.destinationFormPair.update(se=>(se.custom.push(h({order:900+L},k)),se))});for(let S=0;S<c.Options.length;S++){let D=c.Options[S];if(D.Deprecated)continue;let L=z.find(q=>q===D.Name||D.Aliases?.includes(q.name)||q.name===D.Name);if(L){let q=D.Aliases?.indexOf(L.name)??-1,k=D.Aliases&&q>-1?D.Aliases[q]:D.Name,ae=L&&typeof L!="string",se=ae?L?.defaultValue??D.DefaultValue:D.DefaultValue,x={name:k,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,order:900+S},Qe=ae?h(h({},x),L):x,ee=e?.dynamic[k]??se??D.DefaultValue;this.createFormField(oe,Qe,ee),this.destinationFormPair.update(Gt=>(Gt.dynamic.push(Qe),Gt))}else{if(v.find(ee=>ee===D.Name))continue;let k=w.find(ee=>ee===D.Name||ee.name===D.Name),ae=k&&typeof k!="string",se=e?.advanced[D.Name],x=se??D.DefaultValue,Qe={name:D.Name,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,defaultValue:x,order:900+S},rt=ae?h(h({},Qe),k):Qe;i&&se&&(this.createFormField(Z,rt,x),this.selectedAdvancedFormPair.update(ee=>(ee.push(rt),ee))),this.destinationFormPair.update(ee=>(ee.advanced.push(rt),ee))}}for(let S=0;S<f.length;S++){let D=f[S],L=e?.advanced[D.name],q=L??D.defaultValue;i&&L&&(this.createFormField(Z,D,q),this.selectedHttpOptions.update(k=>(k.push(D),k)))}this.destinationFormPair.update(S=>({oauthField:S.oauthField,custom:S.custom.sort((D,L)=>D.order-L.order),dynamic:S.dynamic.sort((D,L)=>D.order-L.order),advanced:S.advanced.sort((D,L)=>D.order-L.order)})),this.destinationForm.controls.destinations.push(nn({key:o?.customKey??n,customGroup:V,dynamicGroup:oe,advancedGroup:Z}))}#p(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set($e.autoRun),this.scheduleFields.nextTime.set($e.nextTime),this.scheduleFields.runAgain.set($e.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([])}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var wn=["formRef"],Rn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"custom",destinationType:e,oauthField:i}),Dt=t=>({$implicit:t}),xn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"dynamic",destinationType:e,oauthField:i}),In=(t,n,e,i)=>({index:t,formView:n,formGroupName:"advanced",destinationType:e,oauthField:i}),vn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:e,oauthField:i}),bn=()=>({maxWidth:"700px",width:"100%"});function Gn(t,n){t&1&&(y(0,5,2),d(1,"spk-icon"),A())}function Ln(t,n){t&1&&R(0,5,3)}function Vn(t,n){if(t&1){let e=G();y(0,5,1),s(1,"button",21),P("click",function(){F(e);let o=p();return g(o.testDestination())}),_(2,Gn,2,0)(3,Ln,1,0),a(),A()}if(t&2){let e=p();l(),ke("loader",e.testLoading())("success",e.successfulTest()),l(),T(e.successfulTest()?2:3)}}function Un(t,n){if(t&1){let e=G();s(0,"p",27),P("click",function(){F(e);let o=p();return g(o.removeDestinationFormGroup(o.destinationCount()-1))}),y(1,8),d(2,"span",28),A(),a()}}function Bn(t,n){if(t&1){let e=G();s(0,"div",34),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addDestinationFormGroup(o.key))}),s(1,"h3"),m(2),a(),s(3,"p"),m(4),a()()}if(t&2){let e=n.$implicit;l(2),xe(e.displayName),l(2),xe(e.description)}}function Kn(t,n){if(t&1){let e=G();s(0,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addDestinationFormGroup(o.key))}),m(2),a()}if(t&2){let e=n.$implicit;l(2),Y(" ",e.displayName," ")}}function Wn(t,n){if(t&1&&(s(0,"div",29),ne(1,Bn,5,2,"div",30,te),a(),s(3,"spk-menu",31)(4,"button",32),R(5,9),a(),H(6,20),ne(7,Kn,3,1,"button",33,te),X(),a()),t&2){let e=p();l(),ie(e.destinationTypeOptionsFocused()),l(2),u("searchable",!0),l(4),ie(e.destinationTypeOptionsNotFocused())}}function zn(t,n){t&1&&et(0)}function Hn(t,n){if(t&1&&_(0,zn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,Dt,it(2,Rn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function Xn(t,n){t&1&&et(0)}function jn(t,n){if(t&1&&_(0,Xn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,Dt,it(2,xn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function qn(t,n){if(t&1){let e=G();y(0,10,1),s(1,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addAdvancedFormPair(o,0))}),a(),A()}if(t&2){let e=n.$implicit;l(),At(e.name),Pt(0)}}function Yn(t,n){t&1&&et(0)}function Qn(t,n){if(t&1&&_(0,Yn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,Dt,it(2,In,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function Jn(t,n){if(t&1){let e=G();y(0,11,1),s(1,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addHttpOption(o,0))}),a(),A()}if(t&2){let e=n.$implicit;l(),At(e.name),Pt(0)}}function Zn(t,n){t&1&&et(0)}function ei(t,n){if(t&1&&_(0,Zn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,Dt,it(2,vn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function ti(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function ni(t,n){if(t&1&&(s(0,"app-file-tree",43)(1,"label",47),m(2),_(3,ti,3,1,"spk-tooltip",48),a(),d(4,"input",49),a()),t&2){let e,i=p().$implicit,o=p(2);u("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name))("accepts",i.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function ii(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function oi(t,n){if(t&1&&(s(0,"app-file-tree",44)(1,"label",47),m(2),_(3,ii,3,1,"spk-tooltip",48),a(),d(4,"input",49),a()),t&2){let e,i=p().$implicit,o=p(2);u("hideShortcuts",!0)("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name)),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function ri(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function ai(t,n){t&1&&(s(0,"spk-icon",51),m(1,"link"),a())}function si(t,n){t&1&&(s(0,"spk-icon",51),m(1,"envelope"),a())}function li(t,n){t&1&&(s(0,"spk-icon",51),m(1,"textbox"),a())}function ci(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),_(3,ri,3,1,"spk-tooltip",48),a(),d(4,"input",50),_(5,ai,2,0,"spk-icon",51)(6,si,2,0,"spk-icon",51)(7,li,2,0,"spk-icon",51),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name),u("type",i.formView.type==="Email"?"email":"text"),l(),T(i.formView.type==="Path"?5:i.formView.type==="Email"?6:7)}}function pi(t,n){if(t&1){let e=G();s(0,"span",55),P("click",function(){F(e);let o=p(2).$implicit,r=p(2);return g(r.oauthStartTokenCreation(o.destinationType,o))}),m(1," AuthID "),a()}}function ui(t,n){t&1&&(s(0,"spk-icon",51),m(1,"password"),a())}function di(t,n){if(t&1){let e=G();s(0,"spk-icon",56),P("click",function(){F(e);let o=p(2).$implicit;return g(o.formView.showPassword=!o.formView.showPassword)}),m(1," eye "),a()}}function mi(t,n){if(t&1){let e=G();s(0,"spk-icon",56),P("click",function(){F(e);let o=p(2).$implicit;return g(o.formView.showPassword=!o.formView.showPassword)}),m(1," eye-slash "),a()}}function _i(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),a(),d(3,"input",52),_(4,pi,2,0,"span",53)(5,ui,2,0,"spk-icon",51)(6,di,2,0,"spk-icon",54)(7,mi,2,0,"spk-icon",54),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name),u("type",i.formView.showPassword?"text":"password"),l(),T(i.oauthField===i.formView.name?4:5),l(2),T(i.formView.showPassword?6:7)}}function Fi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(3).$implicit;u("message",e.formView.longDescription)}}function gi(t,n){if(t&1&&m(0),t&2){let e=p().$implicit;Nt(" ",e==null?null:e.key," (",e==null?null:e.value,") ")}}function Ci(t,n){if(t&1&&m(0),t&2){let e=p().$implicit;Y(" ",e," ")}}function hi(t,n){if(t&1&&_(0,gi,1,2)(1,Ci,1,1),t&2){let e=p(3).$implicit;T(e.formView.loadOptions?0:1)}}function fi(t,n){if(t&1&&(s(0,"spk-select",57)(1,"label",47),m(2),_(3,Fi,3,1,"spk-tooltip",48),a(),d(4,"input",49),a(),_(5,hi,2,1,"ng-template",null,3,ot)),t&2){let e,i=re(6);p();let o=$t(0),r=p().$implicit;u("options",o)("isClearable",!1)("optionTemplate",i),l(),W("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),Y(" ",(e=r.formView.shortDescription)!==null&&e!==void 0?e:r.formView.name," "),l(),T(r.formView.longDescription?3:-1),l(),W("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),ce("formControlName",r.formView.name)}}function Si(t,n){if(t&1&&(kt(0),_(1,fi,7,14)),t&2){let e=p().$implicit,i=Ot(e.formView.loadOptions?e.formView.loadOptions(p(2).injector)():e.formView.options);l(),T(i?1:-1)}}function Ti(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(3).$implicit;u("message",e.formView.longDescription)}}function Di(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Nt(" ",e.key," ",e.value?"("+e.value+")":""," ")}}function Ei(t,n){if(t&1&&(s(0,"spk-select",59)(1,"label",47),m(2),_(3,Ti,3,1,"spk-tooltip",48),a(),d(4,"input",49),a(),_(5,Di,1,2,"ng-template",null,4,ot)),t&2){let e,i=re(6);p();let o=$t(0),r=p().$implicit;u("options",o)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",i),l(),W("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),Y(" ",(e=r.formView.shortDescription)!==null&&e!==void 0?e:r.formView.name," "),l(),T(r.formView.longDescription?3:-1),l(),W("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),ce("formControlName",r.formView.name)}}function yi(t,n){t&1&&d(0,"spk-progress-bar",58)}function Ai(t,n){if(t&1&&(kt(0),_(1,Ei,7,15)(2,yi,1,0,"spk-progress-bar",58)),t&2){let e=p().$implicit,i=Ot(e.formView.loadOptions?e.formView.loadOptions(p(2).injector)():e.formView.options);l(),T(i?1:2)}}function Pi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Ni(t,n){if(t&1&&(s(0,"app-size",45)(1,"label",47),m(2),_(3,Pi,3,1,"spk-tooltip",48),a()()),t&2){let e,i=p().$implicit;u("inputType",i.Name)("formControlName",i.formView.name)("customId",`destination-{{ item.formGroupName }}-{{ item.index }}-{{
6
+ with the REPORTED host key: ${o}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(n,e,i);return}n.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),n.complete()}}):this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${o}`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:c=>{if(!c){this.reportNoAction(n,e,i);return}n.next({action:"approve-host-key",targetUrl:e,testAgain:!0,reportedHostKey:o,destinationIndex:i}),n.complete()}})}handleGenericError(n,e,i,o){this.#t.open(J,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:o,cancelText:$localize`OK`},closed:r=>{n.next({action:"generic-error",targetUrl:e,testAgain:!1,destinationIndex:i}),n.complete()}})}handleDestinationErrorv1(n,e,i,o){return new at(r=>{if(n==="missing-folder"){o?this.handleMissingFolder(r,e,i):this.handleGenericError(r,e,i,$localize`The remote destination folder does not exist.`);return}if(n.startsWith("incorrect-cert:")){let c=n.split("incorrect-cert:")[1];this.handleMissingCertificate(r,e,i,c);return}if(n.startsWith("incorrect-host-key:")){let c=n.split('incorrect-host-key:"')[1].split('",')[0],f=n.split('accepted-host-key:"')[1].split('",')[0];this.handleIncorrectKey(r,e,i,c,f);return}this.handleGenericError(r,e,i,n)})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var ht=class t{fromString(n){if(!n)return null;let e=n.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(n,e){return`${n}${e}`}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var he=class t{#n=O(Ie);s3Providers=j(this.getS3Config("Providers"));s3Regions=j(this.getS3Config("Regions"));s3RegionHosts=j(this.getS3Config("RegionHosts"));s3StorageClasses=j(this.getS3Config("StorageClasses"));storjSatellites=j(this.getStorjConfig("Satellites"));storjAuthenticationMethods=j(this.getStorjConfig("AuthenticationMethods"));openstackProviders=j(this.getOpenstackConfig("Providers"));openstackVersions=j(this.getOpenstackConfig("Versions"));gcsLocations=j(this.getGcsConfig("Locations"));gcsStorageClasses=j(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(Je(e=>this.#t(e)))}createS3IamUser(n,e){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":e}})}createS3PolicyIAM(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(Je(e=>this.#t(e)))}getOpenstackConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(Je(e=>this.#t(e)))}getGcsConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(Je(e=>this.#t(e)))}#t(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([e,i])=>({key:e,value:i})))??[]}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};function Ne(t){return t==null||t===""?"":":"+t.toString()}function Q(t){return t==null?"":t.startsWith("/")?t:"/"+t}function $(t,n){let e={},i={},o=Se.find(r=>r.key===t);return n.searchParams.forEach((r,c)=>{o?.dynamicFields?.some(N=>N===c||N?.name===c)?i[c]=decodeURIComponent(r):e[c]=decodeURIComponent(r)}),{advanced:e,dynamic:i}}function M(t,n=!1){let e=t.map(([o,r])=>`${o}=${r?encodeURIComponent(r.toString()):""}`).join("&");return e?(n?"":"?")+e:""}function ft(t){let n=t.destinationType,e=Se.find(i=>i.customKey===n||i.key===n);if(!e)throw new Error("Invalid destination type");return e?.mapper.to(t)??""}function wt(t){let n=URL.canParse(t),e=t.split("://")[0],i=t.split("://")[1],o="http://"+i;if(i.startsWith("%")&&e==="file")return Se.find(r=>r.customKey===e||r.key===e)?.mapper.from(e,new URL("http://localhost"),t);try{let r=new URL(o);return Se.find(c=>c.customKey===e||c.key===e)?.mapper.from(e,r,t)}catch(r){console.error("Error while parsing target path",r)}if(!n)throw new Error("Invalid target path");return null}var C=new Ce,Se=[{key:"file",displayName:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>C.control(t??"")}},mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>{let o=e.startsWith("file:///")?e.split("file:///")[1]:e.split("file://")[1],r=o.startsWith("%"),f=o.slice(1).startsWith(":\\")||r?o:"/"+o;return h({destinationType:t,custom:{path:f}},$(t,n))}}},{key:"ssh",displayName:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>C.control(t??"",[Fe.required,Fe.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"s3",displayName:"S3 compatible bucket",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).s3StorageClasses}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname,bucket:n.hostname}},$(t,n))}},{key:"gcs",displayName:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:t=>t.get(he).gcsStorageClasses},"authid"],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"googledrive",displayName:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"authid",type:"Password"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"pcloud",displayName:"pCloud",description:"Store backups in pCloud.",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>E([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{server:e,path:i}=t.custom;return`${t.destinationType}://${e+Q(i)+n}`},from:(t,n,e)=>{let i=n.pathname.replace(/^\//,"");return h({destinationType:t,custom:{server:n.hostname,path:i}},$(t,n))}}},{key:"azure",displayName:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",shortDescription:"Container name",longDescription:"Container name",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"onedrivev2",displayName:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"sharepoint",displayName:"Microsoft SharePoint v2",description:"Store backups in Microsoft SharePoint.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"dropbox",displayName:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"box",displayName:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"jottacloud",displayName:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"b2",displayName:"B2 Cloud Storage",description:"Store backups in B2 Cloud Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{bucket:n.hostname,path:decodeURIComponent(n.pathname)}},$(t,n))}},{key:"e2",displayName:"IDrive e2",description:"Store backups in IDrive e2.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:t=>{let{bucket:n,path:e}=t.custom,i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{bucket:n.hostname,path:n.pathname}},$(t,n))}},{key:"mega",displayName:"Mega.nz",description:"Store backups in Mega.nz.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"msgroup",displayName:"Microsoft Office 365 Group",description:"Store backups in Microsoft Office 365 Group.",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:"Group email",longDescription:"Group email",formElement:t=>C.control(t??"",[Fe.email])},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["authid"],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.hostname+n.pathname}},$(t,n))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{port:e,server:i,path:o}=t.custom;return`${t.destinationType}://${i+Ne(e)+Q(o)+n}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"rclone",displayName:"Rclone",description:"Store backups in Rclone.",dynamicFields:[{name:"rclone-local-repository",shortDescription:"Local repository",defaultValue:""},{name:"rclone-remote-repository",shortDescription:"Remote repository",defaultValue:""},{name:"rclone-remote-path",shortDescription:"Path on remote repository",defaultValue:""}],mapper:{to:t=>{let n=t.dynamic["rclone-remote-repository"],e=t.dynamic["rclone-remote-path"],i=Object.entries(t.dynamic).filter(([r])=>!["rclone-remote-repository","rclone-remote-path"].includes(r)),o=M([...Object.entries(t.advanced),...i]);return`${t.destinationType}://${n}/${e+o}`},from:(t,n,e)=>{let{advanced:i,dynamic:o}=$(t,n);return h({destinationType:t,dynamic:h({"rclone-remote-repository":n.hostname,"rclone-remote-path":n.pathname},o)},i)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:t=>t.get(he).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:t=>t.get(he).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:t=>{let n=M([...Object.entries(t.advanced),...Object.entries(t.dynamic)]),{bucket:e}=t.custom;return`${t.destinationType}://${e+n}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname,bucket:n.hostname}},$(t,n))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:n,server:e,path:i}=t.custom,o=t.dynamic["use-ssl"],r=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([c])=>c!=="use-ssl")]);return`${t.destinationType}${o?"s":""}://${e+Ne(n)+Q(i)+r}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:t=>{let{port:n,server:e,path:i}=t.custom,o=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([r])=>r!=="use-ssl")]);return`${t.destinationType}://${e+Ne(n)+Q(i)+o}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"sia",displayName:"Sia Decentrilized Cloud",description:"Store backups in Sia Decentrilized Cloud.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:t=>{let n=t.custom.server,e=t.dynamic["sia-targetpath"],i=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([o])=>o!=="sia-targetpath")]);return`${t.destinationType}://${n+Q(e)+i}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname}},$(t,n))}},{key:"cos",displayName:"Tencent COS",description:"Store backups in Tencent COS.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"cos-bucket",shortDescription:"Bucket",order:1},{name:"cos-region",shortDescription:"Region",order:2},{name:"cos-app-id",shortDescription:"COS App Id",order:3},{name:"cos-secret-id",shortDescription:"COS Secret Id",order:4},{name:"cos-secret-key",shortDescription:"COS Secret Key",order:5}],mapper:{to:t=>{let n=t.custom.path,e=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([i])=>i!=="cos-targetpath")]);return`${t.destinationType}://${n+e}`},from:(t,n,e)=>h({destinationType:t,custom:{path:n.pathname}},$(t,n))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:t=>{let{port:n,server:e,path:i,username:o,password:r}=t.custom,c={"auth-username":o,"auth-password":r},f=t.dynamic["use-ssl"],N=M([...Object.entries(t.advanced),...Object.entries(t.dynamic).filter(([v])=>v!=="use-ssl"),...Object.entries(c)]);return`${t.destinationType}${f?"s":""}://${e+Ne(n)+Q(i)+N}`},from:(t,n,e)=>h({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},$(t,n))}},{key:"cifs",displayName:"CIFS",description:"Store backups in CIFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:t=>C.control(t??"")},share:{type:"String",name:"share",shortDescription:"Share Name",longDescription:"Share Name",formElement:t=>C.control(t??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:t=>C.control(t??"")}},dynamicFields:["transport","auth-username","auth-password","auth-domain"],mapper:{to:t=>{let{share:n,server:e,path:i,username:o,password:r}=t.custom,c={"auth-username":o,"auth-password":r},f=new Map([...Object.entries(c),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),N=M(Array.from(f));return`${t.destinationType}://${e+Q(n)+Q(i)+N}`},from:(t,n,e)=>{let i=n.pathname.split("/")[1],o=n.pathname.split("/").slice(2).join("/");return h({destinationType:t,custom:{server:n.hostname,share:i,path:o}},$(t,n))}}},{key:"filen",displayName:"Filen.io",description:"Store backups in Filen.io.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filen",longDescription:"Path on Filen",formElement:t=>C.control(t??"")}},dynamicFields:["auth-username","auth-password"],mapper:{to:t=>{let{path:n,username:e,password:i}=t.custom,o={"auth-username":e,"auth-password":i},r=new Map([...Object.entries(o),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),c=M(Array.from(r));return`${t.destinationType}://${n+c}`},from:(t,n,e)=>{let i=n.hostname??"";return n.pathname&&i!==""&&n.pathname[0]!="/"&&(i+="/"),i+=n.pathname,h({destinationType:t,custom:{path:i}},$(t,n))}}},{key:"filejump",displayName:"Filejump",description:"Store backups in Filejump.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filejump",longDescription:"Path on Filejump",formElement:t=>C.control(t??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:"API Token",longDescription:"Filejump API Token",formElement:t=>C.control(t??"")}],mapper:{to:t=>{let{path:n,username:e,password:i,apitoken:o}=t.custom,r=(o||"").trim()===""?{"auth-username":e,"auth-password":i}:{"api-token":o},c=new Map([...Object.entries(r),...Object.entries(t.advanced),...Object.entries(t.dynamic)]),f=M(Array.from(c));return`${t.destinationType}://${n+f}`},from:(t,n,e)=>{let i=n.hostname??"";return n.pathname&&i!==""&&n.pathname[0]!="/"&&(i+="/"),i+=n.pathname,h({destinationType:t,custom:{path:i}},$(t,n))}}},{key:"storj",customKey:"storjAccessGrant",displayName:"Storj Access Grant",description:"Store backups in Storj Access Grant.",dynamicFields:[{name:"storj-shared-access",shortDescription:"Access Grant"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${M([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,n,e)=>h({destinationType:t},$(t,n))}},{key:"storj",customKey:"storjApiKey",displayName:"Storj API Key",description:"Store backups in Storj API Key.",dynamicFields:[{name:"storj-satellite",shortDescription:"Satellite",type:"Enumeration",loadOptions:t=>t.get(he).storjSatellites},{name:"storj-api-key",shortDescription:"API Key"},{name:"storj-secret",shortDescription:"Secret"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:t=>`storj://storj.io/config?storj-auth-method=API%20key&${M([...Object.entries(t.advanced),...Object.entries(t.dynamic)],!0)}`,from:(t,n,e)=>h({destinationType:t},$(t,n))}}];var on=["formRef"];function rn(t,n){t&1&&(s(0,"spk-alert",17),y(1,5),d(2,"spk-icon",26),A(),a())}function an(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Y(" ",e.DisplayName," ")}}function sn(t,n){if(t&1&&d(0,"spk-progress-bar",40),t&2){let e=p(3);ke("error",e.calculatePasswordStrength()===1)("warn",e.calculatePasswordStrength()===2)("primary",e.calculatePasswordStrength()===4)("success",e.calculatePasswordStrength()===5),u("value",e.calculatePasswordStrength()*(100/5))}}function ln(t,n){t&1&&(s(0,"span",35),R(1,10),a())}function cn(t,n){t&1&&(y(0,8,1),d(1,"spk-icon"),A())}function pn(t,n){t&1&&(y(0,8,2),d(1,"spk-icon"),A())}function un(t,n){t&1&&(y(0,11,1),d(1,"spk-icon",42),A())}function dn(t,n){t&1&&(y(0,11,2),d(1,"spk-icon"),A())}function mn(t,n){if(t&1){let e=G();s(0,"button",41),P("click",function(){F(e);let o=p(3);return g(o.copyPassword())}),y(1,11),_(2,un,2,0)(3,dn,2,0),A(),a()}if(t&2){let e=p(3);l(2),T(e.copiedPassword()?2:3)}}function _n(t,n){t&1&&(s(0,"spk-alert",39),R(1,12),a())}function Fn(t,n){if(t&1){let e=G();s(0,"div",30)(1,"spk-form-field")(2,"label",31),y(3,7),d(4,"sup"),A(),a(),d(5,"input",32),a(),_(6,sn,1,9,"spk-progress-bar",33),s(7,"spk-form-field"),d(8,"input",34),_(9,ln,2,0,"span",35),a(),s(10,"div",36)(11,"button",37),P("click",function(){F(e);let o=p(2);return g(o.showPassword.set(!o.showPassword()))}),y(12,8),_(13,cn,2,0)(14,pn,2,0),A(),a(),s(15,"button",37),P("click",function(){F(e);let o=p(2);return g(o.generatePassword())}),y(16,9),d(17,"spk-icon"),A(),a(),_(18,mn,4,1,"button",38),a(),_(19,_n,2,0,"spk-alert",39),a()}if(t&2){let e=p(2);l(5),u("type",e.showPassword()?"text":"password"),l(),T(e.generalForm.value.password?6:-1),l(2),u("type",e.showPassword()?"text":"password"),l(),T(e.generalForm.value.repeatPassword&&e.generalForm.value.repeatPassword!==e.generalForm.value.password?9:-1),l(4),T(e.showPassword()?13:14),l(5),T(e.showCopyPassword()?18:-1),l(),T(e.generalForm.value.password&&e.generalForm.value.password===e.generalForm.value.repeatPassword?19:-1)}}function gn(t,n){if(t&1&&(s(0,"spk-select",27)(1,"label",28),R(2,6),a(),d(3,"input",29),_(4,an,1,1,"ng-template"),a(),_(5,Fn,20,7,"div",30)),t&2){let e=p();u("options",e.encryptionOptions())("isClearable",!1),l(5),T(e.encryptionFieldSignal()!==""?5:-1)}}function Cn(t,n){if(t&1&&(s(0,"button",24),y(1,13),d(2,"spk-icon"),A(),a()),t&2){let e=p();u("disabled",e.nameAndDescriptionValid()===!1)}}function hn(t,n){if(t&1&&(s(0,"spk-tooltip",25)(1,"button",24),y(2,14),d(3,"spk-icon"),A(),a()()),t&2){let e=p();u("disabled",!(e.showCopyPassword()&&!e.copiedPassword())),l(),u("disabled",e.generalForm.invalid||e.showCopyPassword()&&!e.copiedPassword())}}var Ye=new Ce,Qt=(t={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>Ye.group({name:Ye.control(t.name,[Fe.required]),description:Ye.control(t.description),encryption:Ye.control(t.encryption,[jt()]),password:Ye.control(t.password,[Mt(n=>n?.value.encryption!=="",[Fe.required])]),repeatPassword:Ye.control(t.repeatPassword,[Mt(n=>n?.value.encryption!=="",[Fe.required])])}),xt={Key:"",DisplayName:"None"},Rt=class t{#n=O(pe);#t=O(Ae);#e=O(Xt);#i=O(fe);#o=O(Le);formRef=Me.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=E(!1);copiedPassword=E(!1);showCopyPassword=E(!1);encryptionEffect=ct(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});nameAndDescriptionValid=I(()=>{let n=this.generalFormSignal(),e=this.generalForm.controls;return e?.name&&e.name.valid&&e?.description&&e.description.valid});calculatePasswordStrength=I(()=>{let e=this.generalFormSignal()?.password??"";return this.#e.calculatePasswordStrength(e)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit(!0)}async copyPassword(){let n=this.generalForm.controls.password.value;await this.#r(n??""),this.copiedPassword.set(!0)}async#r(n){try{await navigator.clipboard.writeText(n)}catch{try{let i=document.createElement("textarea");i.value=n,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}displayFn(){let n=this.#o.systemInfo()?.EncryptionModules??[];return e=>{let i=[xt,...n].find(o=>o.Key===e);return i?`${i.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#e.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#n.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&we(i.formRef,on,5),e&2&&Re()},decls:21,vars:4,consts:()=>{let n;n=$localize`Your backup name`;let e;e=$localize`Your backup description`;let i;i=$localize`General backup settings`;let o;o=$localize` Backup name ${"\uFFFD#8\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#8\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let c;c=$localize`${"\uFFFD#18\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#18\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let f;f=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:lock${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON: Encrypted backup `;let N;N=$localize`Encryption`;let v;v=$localize`Encryption`;let z;z=$localize`Password`;let w;w=$localize`Repeat password`;let b;b=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let V;V=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_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_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,V=Oe(V);let oe;oe=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let Z;Z=$localize`Passwords do not match`;let S;S=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,S=Oe(S);let D;D=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let L;L=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let q;return q=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],i,o,r,c,f,v,b,V,oe,Z,S,D,L,q,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],[1,"primary"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",e,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"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",z,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",w,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(e,i){if(e&1){let o=G();s(0,"form",15,0),P("submit",function(){return F(o),g(i.next())}),s(2,"h3",16),R(3,1),a(),_(4,rn,3,0,"spk-alert",17),s(5,"spk-form-field")(6,"label",18),y(7,2),d(8,"sup"),A(),a(),d(9,"input",19),a(),s(10,"spk-form-field")(11,"label",20),R(12,3),a(),d(13,"textarea",21),a(),_(14,gn,6,3),s(15,"div",22)(16,"button",23),P("click",function(){return F(o),g(i.exit())}),y(17,4),d(18,"spk-icon"),A(),a(),_(19,Cn,3,1,"button",24)(20,hn,4,2,"spk-tooltip",25),a()()}if(e&2){let o;u("formGroup",i.generalForm),l(4),T(!i.isNew()&&((o=i.generalFormSignal())==null?null:o.encryption)!==""?4:-1),l(10),T(i.isNew()?14:-1),l(5),T(i.encryptionFieldSignal()===""||!i.isNew()?19:20)}},dependencies:[je,Ke,_e,ge,Ue,ze,He,de,me,be,ue,ut,pt,dt],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-500)}.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%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};function fn(t,n){if(t&1){let e=G();s(0,"div",24)(1,"spk-form-field")(2,"label",25),R(3,7),a(),s(4,"input",26,0),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.nextTime().time,o)||(r.scheduleFields.nextTime().time=o),g(o)}),P("focus",function(){F(e);let o=re(5);return g(o.showPicker())}),a(),s(6,"spk-icon",27),m(7,"clock"),a()(),s(8,"spk-form-field"),d(9,"label",28),s(10,"input",29,1),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.nextTime().date,o)||(r.scheduleFields.nextTime().date=o),g(o)}),P("focus",function(){F(e);let o=re(11);return g(o.showPicker())}),a(),s(12,"spk-icon",27),m(13,"calendar"),a()()(),s(14,"div",24)(15,"spk-form-field")(16,"label",30),R(17,8),a(),s(18,"input",31),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().repeatValue,o)||(r.scheduleFields.runAgain().repeatValue=o),g(o)}),a()(),s(19,"spk-select",32)(20,"input",33),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().repeatUnit,o)||(r.scheduleFields.runAgain().repeatUnit=o),g(o)}),a()()(),s(21,"app-toggle-card",34),H(22,35),R(23,9),X(),s(24,"div",36)(25,"spk-toggle",19),y(26,10),s(27,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.mon,o)||(r.scheduleFields.runAgain().allowedDays.mon=o),g(o)}),a(),A(),a(),s(28,"spk-toggle",19),y(29,11),s(30,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.tue,o)||(r.scheduleFields.runAgain().allowedDays.tue=o),g(o)}),a(),A(),a(),s(31,"spk-toggle",19),y(32,12),s(33,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.wed,o)||(r.scheduleFields.runAgain().allowedDays.wed=o),g(o)}),a(),A(),a(),s(34,"spk-toggle",19),y(35,13),s(36,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.thu,o)||(r.scheduleFields.runAgain().allowedDays.thu=o),g(o)}),a(),A(),a(),s(37,"spk-toggle",19),y(38,14),s(39,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.fri,o)||(r.scheduleFields.runAgain().allowedDays.fri=o),g(o)}),a(),A(),a(),s(40,"spk-toggle",19),y(41,15),s(42,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.sat,o)||(r.scheduleFields.runAgain().allowedDays.sat=o),g(o)}),a(),A(),a(),s(43,"spk-toggle",19),y(44,16),s(45,"input",20),K("ngModelChange",function(o){F(e);let r=p();return B(r.scheduleFields.runAgain().allowedDays.sun,o)||(r.scheduleFields.runAgain().allowedDays.sun=o),g(o)}),a(),A(),a()()()}if(t&2){let e=p();l(4),U("ngModel",e.scheduleFields.nextTime().time),l(6),U("ngModel",e.scheduleFields.nextTime().date),l(8),U("ngModel",e.scheduleFields.runAgain().repeatValue),l(),u("options",e.unitOptions)("isClearable",!1),l(),U("ngModel",e.scheduleFields.runAgain().repeatUnit),l(),u("disallowToggle",!0),l(6),U("ngModel",e.scheduleFields.runAgain().allowedDays.mon),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.tue),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.wed),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.thu),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.fri),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.sat),l(3),U("ngModel",e.scheduleFields.runAgain().allowedDays.sun)}}var Sn=[{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`}],$e={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}},It=class t{#n=O(fe);#t=O(pe);#e=O(Ae);unitOptions=Sn;scheduleFields=this.#n.scheduleFields;goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#e.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#e.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-schedule"]],decls:16,vars:2,consts:()=>{let n;n=$localize`Schedule`;let e;e=$localize` Automatically run backups ${"\uFFFD#5\uFFFD\uFFFD/#5\uFFFD"}:TAG_INPUT:`;let i;i=$localize`If a date was missed, the job will run as soon as possible.`;let o;o=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let r;r=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let c;c=$localize`Next time`;let f;f=$localize`Run again every`;let N;N=$localize`Allowed days`;let v;v=$localize` Monday ${"\uFFFD#27\uFFFD\uFFFD/#27\uFFFD"}:TAG_INPUT:`;let z;z=$localize` Tuesday ${"\uFFFD#30\uFFFD\uFFFD/#30\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Wednesday ${"\uFFFD#33\uFFFD\uFFFD/#33\uFFFD"}:TAG_INPUT:`;let b;b=$localize` Thursday ${"\uFFFD#36\uFFFD\uFFFD/#36\uFFFD"}:TAG_INPUT:`;let V;V=$localize` Friday ${"\uFFFD#39\uFFFD\uFFFD/#39\uFFFD"}:TAG_INPUT:`;let oe;oe=$localize` Saturday ${"\uFFFD#42\uFFFD\uFFFD/#42\uFFFD"}:TAG_INPUT:`;let Z;return Z=$localize` Sunday ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`,[["timeRef",""],["dateRef",""],n,e,i,o,r,c,f,N,v,z,w,b,V,oe,Z,[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","",1,"raised","primary",3,"click"],[1,"row-inputs"],["for","time"],["type","time","id","time",3,"ngModelChange","focus","ngModel"],["suffix",""],["for","date"],["type","date","id","date",3,"ngModelChange","focus","ngModel"],["for","repeatValue"],["type","number","id","repeatValue",3,"ngModelChange","ngModel"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit",3,"ngModelChange","ngModel"],[3,"disallowToggle"],["title",""],[1,"days-wrap"]]},template:function(e,i){e&1&&(s(0,"h3",17),R(1,2),a(),s(2,"div",18)(3,"spk-toggle",19),y(4,3),s(5,"input",20),K("ngModelChange",function(r){return B(i.scheduleFields.autoRun,r)||(i.scheduleFields.autoRun=r),r}),a(),A(),a(),s(6,"p"),R(7,4),a()(),_(8,fn,46,14),s(9,"div",21)(10,"button",22),P("click",function(){return i.goBack()}),y(11,5),d(12,"spk-icon"),A(),a(),s(13,"button",23),P("click",function(){return i.next()}),y(14,6),d(15,"spk-icon"),A(),a()()),e&2&&(l(5),U("ngModel",i.scheduleFields.autoRun),l(3),T(i.scheduleFields.autoRun()?8:-1))},dependencies:[Xe,_e,We,Ve,ge,Be,de,Ge,ue,be,me,qe],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem 2.5rem 1.5rem;display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function Tn(t,n){if(t&1&&(H(0,4),m(1),X()),t&2){let e,i=p();l(),xe((e=i.currentExpressionOption())==null?null:e.startsWith)}}function Dn(t,n){if(t&1&&(H(0,5),m(1),X()),t&2){let e,i=p();l(),xe((e=i.currentExpressionOption())==null?null:e.endsWith)}}var En=[{key:"Excludes folders where name contains",value:"-FolderName"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileName"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],Dt=class t{path=Pt.required();osType=Pt();pathChange=At();remove=At();internalPath=E("");pathType=E("-Expression");currentExpressionOption=I(()=>{let n=this.pathType();return this.expressionOptions().find(e=>e.value===n)});expressionOptions=I(()=>{let e=this.osType()==="Windows"?"\\":"/";return En.map(i=>i.value==="-Folder"||i.value==="+Folder"?Ee(h({},i),{startsWith:"",endsWith:""}):i.value==="-FolderName"||i.value==="+FolderName"?Ee(h({},i),{startsWith:"*",endsWith:`*${e}`}):i.value==="-FileName"||i.value==="+FileName"?Ee(h({},i),{startsWith:"[.*",endsWith:`[^\\${e}]*]`}):i.value==="-FileGroup"||i.value==="+FileGroup"?Ee(h({},i),{startsWith:"{",endsWith:"}"}):i.value==="-Regex"||i.value==="+Regex"?Ee(h({},i),{startsWith:"[",endsWith:"]"}):i.value==="-Extension"||i.value==="+Extension"?Ee(h({},i),{startsWith:"*.",endsWith:""}):Ee(h({},i),{startsWith:"",endsWith:""}))});pathEffect=ct(()=>{let n=this.path(),e=n.slice(1),i=n.startsWith("-")?"-":"+",o=this.osType()==="Windows",r=o?"\\":"/";e.startsWith("%")&&e.endsWith(r)||o&&e.slice(2).startsWith(r)&&e.endsWith(r)||e.startsWith(r)&&e.endsWith(r)?(this.pathType.set(`${i}Folder`),this.internalPath.set(e)):e.startsWith("*")&&e.endsWith(`*${r}`)?(this.pathType.set(`${i}FolderName`),this.internalPath.set(e.slice(1,-2))):e.startsWith("[.*")&&e.endsWith(`[^\\${r}]*]`)?(this.pathType.set(`${i}FileName`),this.internalPath.set(e.slice(3,-7))):e.startsWith("{")&&e.endsWith("}")?(this.pathType.set(`${i}FileGroup`),this.internalPath.set(e.slice(1,-1))):e.startsWith("[")&&e.endsWith("]")?(this.pathType.set(`${i}Regex`),this.internalPath.set(e.slice(1,-1))):e.startsWith("*.")?(this.pathType.set(`${i}Extension`),this.internalPath.set(e.slice(2))):(this.pathType.set(`${i}Expression`),this.internalPath.set(e))});updateFilter(){let n=this.internalPath(),e=this.currentExpressionOption();n!==""&&this.pathChange.emit(`${e?.value.slice(0,1)}${e?.startsWith??""}${n}${e?.endsWith??""}`)}removeFilter(){this.remove.emit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-new-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:9,vars:6,consts:()=>{let n;return n=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"expression-input"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],["suffix",""],[1,"filter-removal",3,"click"],[1,"spk-primary"]]},template:function(e,i){if(e&1&&(s(0,"spk-select",0)(1,"input",1),K("ngModelChange",function(r){return B(i.pathType,r)||(i.pathType=r),r}),P("ngModelChange",function(){return i.updateFilter()}),a()(),s(2,"spk-form-field",2)(3,"input",3),K("ngModelChange",function(r){return B(i.internalPath,r)||(i.internalPath=r),r}),P("ngModelChange",function(){return i.updateFilter()}),a(),_(4,Tn,2,1,"ng-container",4)(5,Dn,2,1,"ng-container",5),a(),s(6,"div",6),P("click",function(){return i.removeFilter()}),s(7,"spk-icon",7),m(8,"x-circle"),a()()),e&2){let o,r;u("options",i.expressionOptions())("isClearable",!1),l(),U("ngModel",i.pathType),l(2),U("ngModel",i.internalPath),l(),T(!((o=i.currentExpressionOption())==null||o.startsWith==null)&&o.startsWith.length?4:-1),l(),T(!((r=i.currentExpressionOption())==null||r.endsWith==null)&&r.endsWith.length?5:-1)}},dependencies:[Xe,_e,ge,Be,me,de,ue],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-level-20)}.filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var yn=["formRef"],Jt=()=>({standalone:!0});function An(t,n){if(t&1){let e=G();s(0,"spk-form-field",42)(1,"input",43),K("ngModelChange",function(o){F(e);let r=p(2);return B(r.editingPath,o)||(r.editingPath=o),g(o)}),a()(),s(2,"button",44),P("click",function(){F(e);let o=p(2);return g(o.updatePath())}),s(3,"spk-icon"),m(4,"floppy-disk"),a()(),s(5,"button",44),P("click",function(){F(e);let o=p(2);return g(o.cancelEditPath())}),s(6,"spk-icon"),m(7,"x-bold"),a()()}if(t&2){let e=p(2);l(),U("ngModel",e.editingPath),u("ngModelOptions",tt(2,Jt))}}function Pn(t,n){if(t&1){let e=G();s(0,"spk-form-field",42),d(1,"input",45),a(),s(2,"button",44),P("click",function(){F(e);let o=p().$implicit,r=p();return g(r.editPath(o))}),s(3,"spk-icon"),m(4,"pen"),a()(),s(5,"button",44),P("click",function(){F(e);let o=p().$implicit,r=p();return g(r.removePath(o))}),s(6,"spk-icon"),m(7,"trash-simple"),a()()}if(t&2){let e=p().$implicit;Ut("readonly",!0),l(),u("ngModel",e)("ngModelOptions",tt(3,Jt))}}function Nn(t,n){if(t&1&&(s(0,"div",30),_(1,An,8,3)(2,Pn,8,4),a()),t&2){let e=n.$implicit,i=p();l(),T(i.oldPath()===e?1:2)}}function kn(t,n){if(t&1){let e=G();s(0,"app-new-filter",47),P("pathChange",function(o){let r=F(e).$index,c=p(2);return g(c.patchPathAt(o,r))})("remove",function(){let o=F(e).$index,r=p(2);return g(r.removePathAt(o))}),a()}if(t&2){let e,i=n.$implicit,o=p(2);u("path",i)("osType",(e=o.osType())!==null&&e!==void 0?e:"")}}function On(t,n){if(t&1&&ne(0,kn,1,2,"app-new-filter",46,te),t&2){let e=p();ie(e.pathArray())}}function $n(t,n){if(t&1&&(s(0,"div",41)(1,"spk-form-field"),d(2,"input",48),a(),s(3,"spk-select",49),d(4,"input",50),a()()),t&2){let e=p();l(3),u("options",e.sizeOptions())("isClearable",!1)}}var Te=new Ce,Mn=["Bytes","KB","MB","GB","TB","PB"],Zt=(t={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>Te.group({path:Te.control(t.path),excludes:Te.group({hidden:Te.control(t.excludes.hidden),system:Te.control(t.excludes.system),temporary:Te.control(t.excludes.temporary),filesLargerThan:Te.group({size:Te.control(null),unit:Te.control(null)})})}),vt=class t{#n=O(fe);#t=O(pe);#e=O(Ae);formRef=Me.required("formRef");sourceDataForm=this.#n.sourceDataForm;sourceDataFormSignal=this.#n.sourceDataFormSignal;newPathCtrl=new mt("");filesLargerThan=I(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=E(Mn);osType=this.#n.osType;pathSignal=j(this.sourceDataForm.controls.path.valueChanges);pathArray=I(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+")||n==="___none___")??[]);nonFilterPaths=I(()=>this.pathSignal()?.split("\0").filter(n=>!n.startsWith("-")&&!n.startsWith("+")&&n!==""));oldPath=E(null);editingPath=E(null);addingNewPath=E(!1);editPath(n){this.oldPath.set(n),this.editingPath.set(n)}updatePath(){let n=this.oldPath(),e=this.editingPath();if(!n||!e||e===n){this.oldPath.set(null),this.editingPath.set(null);return}let i=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(i?.replace(n,e)??""),this.oldPath.set(null),this.editingPath.set(null)}cancelEditPath(){this.oldPath.set(null),this.editingPath.set(null)}removePath(n){let e=this.sourceDataForm.controls.path.value??"",i=e.indexOf(n);if(i===-1)return;let o=i===0?n:"\0"+n,r=e.replace(o,"");this.sourceDataForm.controls.path.setValue(r)}addFilter(n="-*"){let e=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${e}\0${n}`)}patchPathAt(n,e){let o=this.sourceDataForm.controls.path.value.split("\0").filter(c=>!c.startsWith("-")&&!c.startsWith("+")).join("\0"),r=this.pathArray().map((c,f)=>f===e?`${n}`:`${c}`).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${r}`)}removePathAt(n){let i=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),o=this.pathArray().filter((r,c)=>c!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${o}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value,e=this.newPathCtrl.value;this.sourceDataForm.controls.path.setValue(`${n}\0${e}`),this.newPathCtrl.setValue("")}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#e.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#e.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&we(i.formRef,yn,5),e&2&&Re()},decls:56,vars:12,consts:()=>{let n;n=$localize`Path`;let e;e=$localize`Add a direct path`;let i;i=$localize`Hidden files`;let o;o=$localize`System files`;let r;r=$localize`Temporary files`;let c;c=$localize`Source Data`;let f;f=$localize`Folder path`;let N;N=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let v;v=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let z;z=$localize`Paths`;let w;w=$localize`Add a path directly from your machine.`;let b;b=$localize`Filters`;let V;V=$localize`Customize your filters.`;let oe;oe=$localize`Add filter`;let Z;Z=$localize`Exclude`;let S;S=$localize`Choose if there’s any files you want to exclude.`;let D;D=$localize` Hidden files ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`;let L;L=$localize` System files ${"\uFFFD#49\uFFFD\uFFFD/#49\uFFFD"}:TAG_INPUT:`;let q;q=$localize` Temporary files ${"\uFFFD#52\uFFFD\uFFFD/#52\uFFFD"}:TAG_INPUT:`;let k;k=$localize` Files larger than `;let ae;ae=$localize`Edit path`;let se;return se=$localize`Select an option...`,[["formRef",""],c,f,N,v,z,w,b,V,oe,Z,S,D,L,q,k,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",n,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"paths"],[1,"path"],[1,"row-inputs"],["type","text","placeholder",e,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",i,"formControlName","hidden"],["type","checkbox","placeholder",o,"formControlName","system"],["type","checkbox","placeholder",r,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"small"],["type","text","placeholder",ae,3,"ngModelChange","ngModel","ngModelOptions"],["spk-button","","type","button",1,"small",3,"click"],["type","text",3,"ngModel","ngModelOptions"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",se]]},template:function(e,i){if(e&1){let o=G();s(0,"form",16,0),P("submit",function(){return F(o),g(i.next())}),s(2,"div",17)(3,"h3",18),R(4,1),a(),s(5,"app-file-tree",19)(6,"label",20),R(7,2),a(),d(8,"input",21),a(),s(9,"div",22)(10,"button",23),P("click",function(){return F(o),g(i.goBack())}),y(11,3),d(12,"spk-icon"),A(),a(),s(13,"button",24),y(14,4),d(15,"spk-icon"),A(),a()()(),s(16,"div",25)(17,"app-toggle-card",26),H(18,27),R(19,5),X(),s(20,"p",28),R(21,6),a(),s(22,"div",29),ne(23,Nn,3,1,"div",30,te),s(25,"div",31)(26,"spk-form-field"),d(27,"input",32),a(),s(28,"button",33),P("click",function(){return F(o),g(i.addNewPath())}),s(29,"spk-icon"),m(30,"plus"),a()()()()(),s(31,"app-toggle-card",26),H(32,27),R(33,7),X(),s(34,"p",28),R(35,8),a(),s(36,"button",34),P("click",function(){return F(o),g(i.addFilter())}),R(37,9),a(),_(38,On,2,0),a(),s(39,"app-toggle-card",35),H(40,27),R(41,10),X(),s(42,"p",28),R(43,11),a(),s(44,"spk-toggle",36),y(45,12),d(46,"input",37),A(),a(),s(47,"spk-toggle",36),y(48,13),d(49,"input",38),A(),a(),s(50,"spk-toggle",36),y(51,14),d(52,"input",39),A(),a(),s(53,"spk-toggle",40),P("click",function(){return F(o),g(i.toggleFilesLargerThan())}),R(54,15),a(),_(55,$n,5,2,"div",41),a()()()}if(e&2){let o;u("formGroup",i.sourceDataForm),l(5),u("multiSelect",!0)("startingPath",i.getPath())("showFiles",!0),l(12),u("disallowToggle",!0),l(6),ie(i.nonFilterPaths()),l(4),u("formControl",i.newPathCtrl),l(4),u("disallowToggle",!0),l(7),T((o=i.pathSignal())!=null&&o.length?38:-1),l(),u("disallowToggle",!0),l(14),ke("active",i.filesLargerThan()),l(2),T(i.filesLargerThan()?55:-1)}},dependencies:[Xe,Ke,_e,We,Ve,ge,Ue,Be,je,_t,ze,He,Ft,de,ue,be,Ge,me,Dt,gt,qe],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}spk-divider[_ngcontent-%COMP%]{margin:.75rem 0}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.25rem}.paths[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.path[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr min-content min-content;gap:.25rem}"],changeDetection:0})};var en="1W:1D,4W:1W,12M:1M",De=new Ce,fe=class t{#n=O(pe);#t=O(Le);#e=O(ve);#i=O(Ie);#o=O(ht);generalForm=Qt();sourceDataForm=Zt();scheduleFields={autoRun:E($e.autoRun),nextTime:E($e.nextTime),runAgain:E($e.runAgain)};destinationForm=tn();settings=E([]);optionsFields={remoteVolumeSize:E("50MB"),backupRetention:E("all"),backupRetentionTime:E(""),backupRetentionVersions:E(0),backupRetentionCustom:E("")};isDraft=E(!1);backupId=E(null);backupName=I(()=>this.generalFormSignal()?.name??"");isSubmitting=E(!1);finishedLoading=E(!1);backupDefaults=E(null);isNew=I(()=>this.backupId()==="new");osType=I(()=>this.#t.systemInfo()?.OSType);selectedOptions=E([]);selectedAdvancedFormPair=E([]);destinationFormPair=E({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=I(()=>{let n=this.destinationFormPair()?.advanced??[],e=this.selectedAdvancedFormPair()??[];return n.filter(i=>e.findIndex(o=>o.name===i.name)===-1)});selectedHttpOptions=E([]);notSelectedHttpOptions=I(()=>{let n=this.httpOptions(),e=this.selectedHttpOptions()??[];return n.filter(i=>e.findIndex(o=>o.name===i.name)===-1)});sourceDataFormSignal=j(this.sourceDataForm.valueChanges);destinationFormSignal=j(this.destinationForm.valueChanges);generalFormSignal=j(this.generalForm.valueChanges);encryptionFieldSignal=j(this.generalForm.controls.encryption.valueChanges);destinationOptions=I(()=>this.#t.backendModules()??[]);httpOptions=I(()=>this.#t.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#r)??[]);advancedOptions=I(()=>this.#t.systemInfo()?.Options?.map(this.#r)??[]);#r(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=I(()=>{let n=this.#t.systemInfo()?.EncryptionModules??[];return[xt,...n]});nonSelectedOptions=I(()=>this.advancedOptions().sort((n,e)=>n?.name&&e?.name?n?.name.localeCompare(e?.name):0).filter(n=>this.selectedOptions()?.findIndex(e=>e.name===n.name)===-1));addOrUpdateAdvancedFormPairByName(n,e,i){let o=this.selectedAdvancedFormPair().find(r=>r.name===n);if(o)this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.controls[o.name].setValue(i);else{let r=this.notSelectedAdvancedFormPair().find(c=>c.name===n);if(!r)return;this.addAdvancedFormPair(r,e,i)}}addAdvancedFormPairByName(n,e,i){let o=this.notSelectedAdvancedFormPair().find(r=>r.name===n);o&&this.addAdvancedFormPair(o,e,i)}addHttpOptionByName(n,e,i){let o=this.notSelectedHttpOptions().find(r=>r.name===n);o&&this.addHttpOption(o,e,i)}addAdvancedFormPair(n,e,i){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,r=i??n.defaultValue;this.createFormField(o,n,r),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,e,i){let o=this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced,r=i??n.defaultValue;this.createFormField(o,n,r),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(o=>o.name===n.name)!==-1?this.selectedAdvancedFormPair.update(o=>(o=o.filter(r=>r.name!==n.name),o)):this.selectedHttpOptions.update(o=>(o=o.filter(r=>r.name!==n.name),o))}removeHttpOption(n,e){this.destinationForm.controls.destinations.controls.at(e)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(i=>(i=i.filter(o=>o.name!==n.name),i))}submit(){this.isSubmitting.set(!0);let n=this.#l(),e=this.backupId();e==="new"||!e||this.isDraft()?this.#i.postApiV1Backups({requestBody:n}).pipe(Ze(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{this.exit(!1)},error:i=>{}}):this.#i.putApiV1BackupById({id:e,requestBody:n}).pipe(Ze(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{this.exit(!1)},error:i=>{}})}exit(n){if(!n){this.#p(),this.#n.navigate(["/"]);return}this.#e.open(J,{data:{title:$localize`Confirm exit?`,message:$localize`Are you sure you want to exit?`,confirmText:$localize`Yes`,cancelText:$localize`Cancel`},closed:e=>{e&&(this.#p(),this.#n.navigate(["/"]))}})}updateFieldsFromTargetUrl(n){this.#s(),setTimeout(()=>{this.#a(n)})}#s(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(n){let e=n.Sources??"",i=n.Filters?.map(f=>`${f.Include?"":"-"}${f.Expression}`)??[],o=n.Settings?.find(f=>f.Name==="--exclude-files-attributes")?.Value??"",r=n.Settings?.find(f=>f.Name==="--skip-files-larger-than")??null,c={path:[...e,...i].join("\0"),excludes:{hiddenFiles:o.includes("hidden"),systemFiles:o.includes("system"),tempFiles:o.includes("temporary"),filesLargerThan:r?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(c)}mapDestinationToForm(n){let e=n.TargetURL?wt(n.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}#a(n){let e=wt(n);e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced},!0)}mapGeneralToForm(n){let e=n.Settings?.find(c=>c.Name==="encryption-module"),i=n.Settings?.find(c=>c.Name==="passphrase")?.Value??"",o=e?.Value&&e.Value.length?e.Value:"",r={name:n.Name??"",description:n.Description??""};o&&o!==""&&(r.encryption=o),i&&i!==""&&(r.password=i,r.repeatPassword=i),this.generalForm.patchValue(r)}mapScheduleToForm(n){if(!n){this.scheduleFields.autoRun.set(!1);return}let e=this.#o.fromString(n.Repeat)??null,i=this.#u(n.Time);this.scheduleFields.autoRun.set(!0),this.scheduleFields.nextTime.update(o=>h(h({},o),i)),this.scheduleFields.runAgain.set({repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:n.AllowedDays?.includes("mon")??!1,tue:n.AllowedDays?.includes("tue")??!1,wed:n.AllowedDays?.includes("wed")??!1,thu:n.AllowedDays?.includes("thu")??!1,fri:n.AllowedDays?.includes("fri")??!1,sat:n.AllowedDays?.includes("sat")??!1,sun:n.AllowedDays?.includes("sun")??!1}})}mapOptionsToForms(n){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","passphrase","keep-time","keep-versions","retention-policy"],i=n.Settings?.filter(c=>!e.includes(c.Name)),o=n.Settings?.filter(c=>e.includes(c.Name));this.settings.set(i??[]),i?.forEach(c=>{if(c.Name==="encryption-module"&&this.isNew())return this.generalForm.controls.encryption.setValue(c.Value??"")});var r="all";o?.forEach(c=>{if(c.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(c.Value??"50MB"),c.Name==="keep-time"&&(c.Value??"")!=="")return r="time",this.optionsFields.backupRetentionTime.set(c.Value??"");if(c.Name==="keep-versions"&&(c.Value??"")!=="")return r="versions",this.optionsFields.backupRetentionVersions.set(c.Value?parseInt(c.Value):null);if(c.Name==="retention-policy"&&(c.Value??"")!=="")if(c.Value===en)r="smart";else return r="custom",this.optionsFields.backupRetentionCustom.set(c.Value??"")}),this.optionsFields.backupRetention.set(r)}getCurrentTargetUrl(){return this.#c(this.destinationForm.controls.destinations)}getScheduleFormValue(){return{autoRun:this.scheduleFields.autoRun(),nextTime:this.scheduleFields.nextTime(),runAgain:this.scheduleFields.runAgain()}}#l(){let n=this.generalForm.value,e=this.getScheduleFormValue(),i=this.sourceDataForm.value,r=this.destinationForm.value.destinations?.length?this.#c(this.destinationForm.controls.destinations):[],c=null;e.runAgain?.repeatUnit&&e.runAgain?.repeatValue&&(c=this.#o.toString(e.runAgain.repeatValue,e.runAgain.repeatUnit));let f=e.runAgain?.allowedDays?Object.entries(e.runAgain?.allowedDays).filter(([b,V])=>V).map(([b,V])=>b):[],N=i.path?.split("\0")??[],v=this.mapFormsToSettings(),z=Object.entries(i.excludes??{}).filter(([b,V])=>V&&b!=="filesLargerThan").map(([b])=>b),w=i.excludes?.filesLargerThan;return z.length&&v.push({Name:"--exclude-files-attributes",Value:z.join(",")}),w&&w.size!==null&&w.unit!==null&&v.push({Name:"--skip-files-larger-than",Value:`${w.size}${w.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:r[0]??null,Sources:N.filter(b=>!b.startsWith("-")),Settings:v,Filters:N.filter(b=>b.startsWith("-")).map((b,V)=>({Order:V,Include:!1,Expression:b.slice(1)}))},Schedule:e.autoRun?{Repeat:c,Time:e.nextTime?.date?new Date(`${e.nextTime.date}T${e.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:f}:null}}mapFormsToSettings(n=[]){let e=this.generalForm.value,i=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","encryption-module","passphrase","keep-time","keep-versions","retention-policy","dblock-size"],o=[{Name:"--no-encryption",Value:"True"}];e.encryption!==""&&(o=[{Name:"encryption-module",Value:e.encryption??null},{Name:"passphrase",Value:e.password??null}]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:en});break}let c=[...n,...i],f=this.settings().filter(N=>!c.includes(N.Name)).map(N=>{let v=N.Value;return typeof N.Value=="number"&&(v=N.Value.toString()),typeof N.Value=="boolean"&&(v=N.Value?"True":"False"),{Name:N.Name,Value:v}});return[...o,...r,...f]}#c(n){return n.controls.map(e=>ft(e.value))}#u(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let e=new Date(n);return{time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`,date:e.toISOString().split("T")[0]}}createFormField(n,e,i){if(e.type==="String"||e.type==="FileTree"||e.type==="FolderTree"||e.type==="Password"||e.type==="Enumeration"||e.type==="NonValidatedSelectableString"||e.type==="Path"){n.addControl(e.name,De.control(i));return}if(e.type==="Size"){n.addControl(e.name,De.control(i));return}if(e.type==="Integer"){n.addControl(e.name,De.control(i?parseInt(i):0));return}if(e.type==="Boolean"){n.addControl(e.name,De.control(i==="true"||i==="True"));return}if(e.type==="Flags"){n.addControl(e.name,De.control(i??""));return}if(e.type==="Timespan"||e.type==="DateTime"){n.addControl(e.name,De.control(i,[Fe.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,e,i=!1){let o=Se.find(S=>S.customKey===n||S.key===n),r=o?.key,c=this.destinationOptions().find(S=>S.Key===r),f=this.httpOptions();if(!c||!c.Options)return;let N=o&&o.oauthField?o.oauthField:null,v=o&&o.customFields?o.customFields:{},z=o&&o.dynamicFields?o.dynamicFields:[],w=o&&o.advancedFields?o.advancedFields:[],b=o&&o.ignoredAdvancedFields?o.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:N,custom:[],dynamic:[],advanced:[]});let V=De.group({}),oe=De.group({}),Z=De.group({});v&&Object.entries(v).forEach(([S,D],L)=>{let ae=D,{formElement:q}=ae,k=Lt(ae,["formElement"]);V.addControl(S,q(e?.custom[S])),this.destinationFormPair.update(se=>(se.custom.push(h({order:900+L},k)),se))});for(let S=0;S<c.Options.length;S++){let D=c.Options[S];if(D.Deprecated)continue;let L=z.find(q=>q===D.Name||D.Aliases?.includes(q.name)||q.name===D.Name);if(L){let q=D.Aliases?.indexOf(L.name)??-1,k=D.Aliases&&q>-1?D.Aliases[q]:D.Name,ae=L&&typeof L!="string",se=ae?L?.defaultValue??D.DefaultValue:D.DefaultValue,x={name:k,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,order:900+S},Qe=ae?h(h({},x),L):x,ee=e?.dynamic[k]??se??D.DefaultValue;this.createFormField(oe,Qe,ee),this.destinationFormPair.update(Gt=>(Gt.dynamic.push(Qe),Gt))}else{if(b.find(ee=>ee===D.Name))continue;let k=w.find(ee=>ee===D.Name||ee.name===D.Name),ae=k&&typeof k!="string",se=e?.advanced[D.Name],x=se??D.DefaultValue,Qe={name:D.Name,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,defaultValue:x,order:900+S},rt=ae?h(h({},Qe),k):Qe;i&&se&&(this.createFormField(Z,rt,x),this.selectedAdvancedFormPair.update(ee=>(ee.push(rt),ee))),this.destinationFormPair.update(ee=>(ee.advanced.push(rt),ee))}}for(let S=0;S<f.length;S++){let D=f[S],L=e?.advanced[D.name],q=L??D.defaultValue;i&&L&&(this.createFormField(Z,D,q),this.selectedHttpOptions.update(k=>(k.push(D),k)))}this.destinationFormPair.update(S=>({oauthField:S.oauthField,custom:S.custom.sort((D,L)=>D.order-L.order),dynamic:S.dynamic.sort((D,L)=>D.order-L.order),advanced:S.advanced.sort((D,L)=>D.order-L.order)})),this.destinationForm.controls.destinations.push(nn({key:o?.customKey??n,customGroup:V,dynamicGroup:oe,advancedGroup:Z}))}#p(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleFields.autoRun.set($e.autoRun),this.scheduleFields.nextTime.set($e.nextTime),this.scheduleFields.runAgain.set($e.runAgain),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([])}static \u0275fac=function(e){return new(e||t)};static \u0275prov=ye({token:t,factory:t.\u0275fac,providedIn:"root"})};var wn=["formRef"],Rn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"custom",destinationType:e,oauthField:i}),yt=t=>({$implicit:t}),xn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"dynamic",destinationType:e,oauthField:i}),In=(t,n,e,i)=>({index:t,formView:n,formGroupName:"advanced",destinationType:e,oauthField:i}),vn=(t,n,e,i)=>({index:t,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:e,oauthField:i}),bn=()=>({maxWidth:"700px",width:"100%"});function Gn(t,n){t&1&&(y(0,5,2),d(1,"spk-icon"),A())}function Ln(t,n){t&1&&R(0,5,3)}function Vn(t,n){if(t&1){let e=G();y(0,5,1),s(1,"button",21),P("click",function(){F(e);let o=p();return g(o.testDestination())}),_(2,Gn,2,0)(3,Ln,1,0),a(),A()}if(t&2){let e=p();l(),ke("loader",e.testLoading())("success",e.successfulTest()),l(),T(e.successfulTest()?2:3)}}function Un(t,n){if(t&1){let e=G();s(0,"p",27),P("click",function(){F(e);let o=p();return g(o.removeDestinationFormGroup(o.destinationCount()-1))}),y(1,8),d(2,"strong")(3,"br")(4,"span",28),A(),a()}if(t&2){let e,i=p();l(4),st((e=i.selectedDestinationType())==null?null:e.displayName),lt(1)}}function Bn(t,n){if(t&1){let e=G();s(0,"div",34),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addDestinationFormGroup(o.key))}),s(1,"h3"),m(2),a(),s(3,"p"),m(4),a()()}if(t&2){let e=n.$implicit;l(2),xe(e.displayName),l(2),xe(e.description)}}function Kn(t,n){if(t&1){let e=G();s(0,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addDestinationFormGroup(o.key))}),m(2),a()}if(t&2){let e=n.$implicit;l(2),Y(" ",e.displayName," ")}}function Wn(t,n){if(t&1&&(s(0,"div",29),ne(1,Bn,5,2,"div",30,te),a(),s(3,"spk-menu",31)(4,"button",32),R(5,9),a(),H(6,20),ne(7,Kn,3,1,"button",33,te),X(),a()),t&2){let e=p();l(),ie(e.destinationTypeOptionsFocused()),l(2),u("searchable",!0),l(4),ie(e.destinationTypeOptionsNotFocused())}}function zn(t,n){t&1&&et(0)}function Hn(t,n){if(t&1&&_(0,zn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,yt,it(2,Rn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function Xn(t,n){t&1&&et(0)}function jn(t,n){if(t&1&&_(0,Xn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,yt,it(2,xn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function qn(t,n){if(t&1){let e=G();y(0,10,1),s(1,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addAdvancedFormPair(o,0))}),a(),A()}if(t&2){let e=n.$implicit;l(),st(e.name),lt(0)}}function Yn(t,n){t&1&&et(0)}function Qn(t,n){if(t&1&&_(0,Yn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,yt,it(2,In,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function Jn(t,n){if(t&1){let e=G();y(0,11,1),s(1,"button",35,1),P("click",function(){let o=F(e).$implicit,r=p(2);return g(r.addHttpOption(o,0))}),a(),A()}if(t&2){let e=n.$implicit;l(),st(e.name),lt(0)}}function Zn(t,n){t&1&&et(0)}function ei(t,n){if(t&1&&_(0,Zn,1,0,"ng-container",40),t&2){let e,i=n.$implicit,o=n.$index;p();let r=re(29),c=p();u("ngTemplateOutlet",r)("ngTemplateOutletContext",nt(7,yt,it(2,vn,o,i,(e=c.destinationFormSignal())==null||e.destinations==null||e.destinations[0]==null?null:e.destinations[0].destinationType,c.destinationFormPair().oauthField)))}}function ti(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function ni(t,n){if(t&1&&(s(0,"app-file-tree",43)(1,"label",47),m(2),_(3,ti,3,1,"spk-tooltip",48),a(),d(4,"input",49),a()),t&2){let e,i=p().$implicit,o=p(2);u("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name))("accepts",i.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function ii(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function oi(t,n){if(t&1&&(s(0,"app-file-tree",44)(1,"label",47),m(2),_(3,ii,3,1,"spk-tooltip",48),a(),d(4,"input",49),a()),t&2){let e,i=p().$implicit,o=p(2);u("hideShortcuts",!0)("startingPath",o.getFormFieldValue(0,i.formGroupName,i.formView.name)),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function ri(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function ai(t,n){t&1&&(s(0,"spk-icon",51),m(1,"link"),a())}function si(t,n){t&1&&(s(0,"spk-icon",51),m(1,"envelope"),a())}function li(t,n){t&1&&(s(0,"spk-icon",51),m(1,"textbox"),a())}function ci(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),_(3,ri,3,1,"spk-tooltip",48),a(),d(4,"input",50),_(5,ai,2,0,"spk-icon",51)(6,si,2,0,"spk-icon",51)(7,li,2,0,"spk-icon",51),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name),u("type",i.formView.type==="Email"?"email":"text"),l(),T(i.formView.type==="Path"?5:i.formView.type==="Email"?6:7)}}function pi(t,n){if(t&1){let e=G();s(0,"span",55),P("click",function(){F(e);let o=p(2).$implicit,r=p(2);return g(r.oauthStartTokenCreation(o.destinationType,o))}),m(1," AuthID "),a()}}function ui(t,n){t&1&&(s(0,"spk-icon",51),m(1,"password"),a())}function di(t,n){if(t&1){let e=G();s(0,"spk-icon",56),P("click",function(){F(e);let o=p(2).$implicit;return g(o.formView.showPassword=!o.formView.showPassword)}),m(1," eye "),a()}}function mi(t,n){if(t&1){let e=G();s(0,"spk-icon",56),P("click",function(){F(e);let o=p(2).$implicit;return g(o.formView.showPassword=!o.formView.showPassword)}),m(1," eye-slash "),a()}}function _i(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),a(),d(3,"input",52),_(4,pi,2,0,"span",53)(5,ui,2,0,"spk-icon",51)(6,di,2,0,"spk-icon",54)(7,mi,2,0,"spk-icon",54),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name),u("type",i.formView.showPassword?"text":"password"),l(),T(i.oauthField===i.formView.name?4:5),l(2),T(i.formView.showPassword?6:7)}}function Fi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(3).$implicit;u("message",e.formView.longDescription)}}function gi(t,n){if(t&1&&m(0),t&2){let e=p().$implicit;Nt(" ",e==null?null:e.key," (",e==null?null:e.value,") ")}}function Ci(t,n){if(t&1&&m(0),t&2){let e=p().$implicit;Y(" ",e," ")}}function hi(t,n){if(t&1&&_(0,gi,1,2)(1,Ci,1,1),t&2){let e=p(3).$implicit;T(e.formView.loadOptions?0:1)}}function fi(t,n){if(t&1&&(s(0,"spk-select",57)(1,"label",47),m(2),_(3,Fi,3,1,"spk-tooltip",48),a(),d(4,"input",49),a(),_(5,hi,2,1,"ng-template",null,3,ot)),t&2){let e,i=re(6);p();let o=$t(0),r=p().$implicit;u("options",o)("isClearable",!1)("optionTemplate",i),l(),W("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),Y(" ",(e=r.formView.shortDescription)!==null&&e!==void 0?e:r.formView.name," "),l(),T(r.formView.longDescription?3:-1),l(),W("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),ce("formControlName",r.formView.name)}}function Si(t,n){if(t&1&&(kt(0),_(1,fi,7,14)),t&2){let e=p().$implicit,i=Ot(e.formView.loadOptions?e.formView.loadOptions(p(2).injector)():e.formView.options);l(),T(i?1:-1)}}function Ti(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(3).$implicit;u("message",e.formView.longDescription)}}function Di(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Nt(" ",e.key," ",e.value?"("+e.value+")":""," ")}}function Ei(t,n){if(t&1&&(s(0,"spk-select",59)(1,"label",47),m(2),_(3,Ti,3,1,"spk-tooltip",48),a(),d(4,"input",49),a(),_(5,Di,1,2,"ng-template",null,4,ot)),t&2){let e,i=re(6);p();let o=$t(0),r=p().$implicit;u("options",o)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",i),l(),W("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),Y(" ",(e=r.formView.shortDescription)!==null&&e!==void 0?e:r.formView.name," "),l(),T(r.formView.longDescription?3:-1),l(),W("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),ce("formControlName",r.formView.name)}}function yi(t,n){t&1&&d(0,"spk-progress-bar",58)}function Ai(t,n){if(t&1&&(kt(0),_(1,Ei,7,15)(2,yi,1,0,"spk-progress-bar",58)),t&2){let e=p().$implicit,i=Ot(e.formView.loadOptions?e.formView.loadOptions(p(2).injector)():e.formView.options);l(),T(i?1:2)}}function Pi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Ni(t,n){if(t&1&&(s(0,"app-size",45)(1,"label",47),m(2),_(3,Pi,3,1,"spk-tooltip",48),a()()),t&2){let e,i=p().$implicit;u("inputType",i.Name)("formControlName",i.formView.name)("customId",`destination-{{ item.formGroupName }}-{{ item.index }}-{{
7
7
  item.asHttpOptions ? 'http' : 'other'
8
- }}`),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1)}}function ki(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Oi(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),_(3,ki,3,1,"spk-tooltip",48),a(),d(4,"input",60),s(5,"spk-icon",51),m(6,"numpad"),a()()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function $i(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Mi(t,n){if(t&1&&(s(0,"spk-toggle",46)(1,"label",47),m(2),_(3,$i,3,1,"spk-tooltip",48),a(),d(4,"input",61),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function wi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Ri(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Y(" ",e," ")}}function xi(t,n){if(t&1&&(s(0,"spk-select",62)(1,"label",47),m(2),_(3,wi,3,1,"spk-tooltip",48),a(),d(4,"input",63),a(),_(5,Ri,1,1,"ng-template",null,4,ot)),t&2){let e,i=re(6),o=p().$implicit;u("options",o.formView.options)("selectMultiple",!0)("optionTemplate",i),l(),Bt("for","destination-",o.formGroupName,"-",o.index,""),l(),Y(" ",(e=o.formView.shortDescription)!==null&&e!==void 0?e:o.formView.name," "),l(),T(o.formView.longDescription?3:-1),l(),ce("formControlName",o.formView.name)}}function Ii(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function vi(t,n){if(t&1&&(s(0,"app-timespan",45)(1,"label",47),m(2),_(3,Ii,3,1,"spk-tooltip",48),a()()),t&2){let e,i=p().$implicit;u("inputType",i.formView.name)("formControlName",i.formView.name)("customId","destination-"+i.formGroupName+"-"+i.index+"-"+(i.asHttpOptions?"http":"other")),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1)}}function bi(t,n){if(t&1){let e=G();s(0,"button",64),P("click",function(){F(e);let o=p().$implicit,r=p(2);return g(r.removeFormView(o.formView,0))}),s(1,"spk-icon"),m(2,"x-circle"),a()()}}function Gi(t,n){if(t&1&&(s(0,"div",41),H(1,42),_(2,ni,5,17,"app-file-tree",43)(3,oi,5,13,"app-file-tree",44)(4,ci,8,13,"spk-form-field")(5,_i,8,13,"spk-form-field")(6,Si,2,2)(7,Ai,3,2)(8,Ni,4,9,"app-size",45)(9,Oi,7,11,"spk-form-field")(10,Mi,5,11,"spk-toggle",46)(11,xi,7,9)(12,vi,4,9,"app-timespan",45),X(),_(13,bi,3,0,"button",32),a()),t&2){let e=n.$implicit;ke("single-field",e.formGroupName!=="advanced"),l(),u("formGroupName",e.formGroupName),l(),T(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="NonValidatedSelectableString"?7:e.formView.type==="Size"?8:e.formView.type==="Integer"?9:e.formView.type==="Boolean"?10:e.formView.type==="Flags"?11:e.formView.type==="Timespan"||e.formView.type==="DateTime"?12:-1),l(11),T(e.formGroupName==="advanced"?13:-1)}}function Li(t,n){if(t&1&&(H(0,22)(1,36),ne(2,Hn,1,9,"ng-container",null,te),ne(4,jn,1,9,"ng-container",null,te),s(6,"app-toggle-card",37),H(7,38),y(8,10),s(9,"spk-menu",31)(10,"button",39),d(11,"spk-icon"),a(),H(12,20),ne(13,qn,3,1,"button",33,te),X(),a(),A(),X(),ne(15,Qn,1,9,"ng-container",null,te),a(),s(17,"app-toggle-card",37),H(18,38),y(19,11),s(20,"spk-menu",31)(21,"button",39),d(22,"spk-icon"),a(),H(23,20),ne(24,Jn,3,1,"button",33,te),X(),a(),A(),X(),ne(26,ei,1,9,"ng-container",null,te),a(),_(28,Gi,14,5,"ng-template",null,2,ot),X()()),t&2){let e=p();l(2),ie(e.destinationFormPair().custom),l(2),ie(e.destinationFormPair().dynamic),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",e.notSelectedAdvancedFormPair().length===0),l(3),ie(e.notSelectedAdvancedFormPair()),l(2),ie(e.selectedAdvancedFormPair()),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",e.notSelectedHttpOptions().length===0),l(3),ie(e.notSelectedHttpOptions()),l(2),ie(e.selectedHttpOptions())}}function Vi(t,n){if(t&1){let e=G();s(0,"spk-dialog",65),K("isOpenChange",function(o){F(e);let r=p();return B(r.targetUrlDialogOpen,o)||(r.targetUrlDialogOpen=o),g(o)}),s(1,"header",66)(2,"h2"),R(3,12),a(),s(4,"spk-alert",67),R(5,13),a()(),s(6,"div",68)(7,"spk-form-field"),d(8,"textarea",69),a()(),s(9,"footer",70)(10,"button",24),P("click",function(){F(e);let o=p();return g(o.closeTargetUrlDialog(!1))}),m(11,"Cancel"),a(),s(12,"button",71),P("click",function(){F(e);let o=p();return g(o.closeTargetUrlDialog(!0))}),y(13,14),d(14,"spk-icon"),A(),a()()()}if(t&2){let e=p();U("isOpen",e.targetUrlDialogOpen),u("options",tt(3,bn)),l(8),u("formControl",e.targetUrlCtrl)}}var Tt=new Ce,tn=(t={destinations:[]})=>Tt.group({destinations:Tt.array(t.destinations)}),nn=({key:t,customGroup:n,dynamicGroup:e,advancedGroup:i})=>Tt.group({destinationType:Tt.control(t),custom:n,dynamic:e,advanced:i}),bt=class t{#n=O(pe);#t=O(Ae);#e=O(fe);#i=O(ve);#o=O(Ft);injector=O(Vt);formRef=Me.required("formRef");destinationForm=this.#e.destinationForm;destinationFormPair=this.#e.destinationFormPair;selectedAdvancedFormPair=this.#e.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#e.notSelectedAdvancedFormPair;selectedHttpOptions=this.#e.selectedHttpOptions;notSelectedHttpOptions=this.#e.notSelectedHttpOptions;destinationOptions=this.#e.destinationOptions;destinationFormSignal=this.#e.destinationFormSignal;destinationCount=b(()=>this.destinationFormSignal()?.destinations?.length??0);successfulTest=E(!1);testLoading=E(!1);destinationTypeOptionsInFocus=E(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=E(Se.map(n=>({key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description})));destinationTypeOptionsFocused=b(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(o=>o.key===i))});destinationTypeOptionsNotFocused=b(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(i=>!n.includes(i.key))});getFormFieldValue(n,e,i){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[e]).controls[i].value}getFormControl(n,e,i){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[e]).controls[i]}addDestinationFormGroup(n){this.#e.addDestinationFormGroup(n)}addAdvancedFormPair(n,e){this.#e.addAdvancedFormPair(n,e)}removeFormView(n,e){this.#e.removeAdvancedFormPair(n,e)}addHttpOption(n,e){this.#e.addHttpOption(n,e)}targetUrl=b(()=>this.#e.getCurrentTargetUrl()[0]);targetUrlCtrl=new ut;targetUrlInitial=E(null);targetUrlDialogOpen=E(!1);openTargetUrlDialog(){let e=this.#e.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl.value,i=this.targetUrlInitial();!n||e===i||this.#e.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let i=this.#e.getCurrentTargetUrl()[n];i&&(this.testLoading.set(!0),this.#o.testDestination(i,n,!0).pipe(Ze(()=>this.testLoading.set(!1))).subscribe({next:o=>{if(o.action==="success"){this.#e.isNew()&&(o.containsBackup===!0?this.#i.open(J,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}}):o.anyFilesFound===!0&&this.#i.open(J,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}})),this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3);return}if(o.action==="generic-error"){this.successfulTest.set(!1);return}o.action==="trust-cert"&&this.#e.addHttpOptionByName("accept-specified-ssl-hash",o.destinationIndex,o.certData),o.action==="approve-host-key"&&this.#e.addOrUpdateAdvancedFormPairByName("ssh-fingerprint",o.destinationIndex,o.reportedHostKey),o.testAgain&&this.testDestination(o.destinationIndex)}}))}mapToTargetUrl(n){return Ct(n.value)}removeDestinationFormGroup(n){this.destinationForm.controls.destinations.removeAt(n)}displayFn(n){let e=this.destinationOptions().find(i=>i.Key===n);return e?`${e.DisplayName}`:""}goBack(){this.#n.navigate(["general"],{relativeTo:this.#t.parent})}next(){this.#n.navigate(["source-data"],{relativeTo:this.#t.parent})}#r=E("https://duplicati-oauth-handler.appspot.com/").asReadonly();#s=E(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#a=E(!1);#l=E(null);keyCreation(){}oauthStartTokenCreation(n,e){let i=this.getFormControl(e.index,e.formGroupName,e.formView.name);this.#a.set(!0);let o=this.#s(),r=450,c=600,f=this.#r()+"?type="+n+"&token="+o,N=screen.width/2-r/2,I=screen.height/2-c/2,z=window.open(f,"_blank","height="+c+",width="+r+",menubar=0,status=0,titlebar=0,toolbar=0,left="+N+",top="+I);return window.addEventListener("message",w=>{let v=w.data.startsWith("authid:"),V=v?w.data.replace("authid:",""):null;console.log("event",w),v&&(i.setValue(V),this.#a.set(!1),z?.close())}),!1}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-destination"]],viewQuery:function(e,i){e&1&&we(i.formRef,wn,5),e&2&&Re()},decls:24,vars:6,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=Oe(n);let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let i;i=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize` Want to select another destination? ${"\uFFFD#2\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPAN:`;let r;r=$localize`Other destinations`;let c;c=$localize` Advanced options ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#10\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#12\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_MENU:`,c=Oe(c);let f;f=$localize` Http options ${"\uFFFD#20\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON: Add http option ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#23\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*25:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_MENU:`,f=Oe(f);let N;N=$localize`Edit target URL`;let I;I=$localize` Be careful, this will overwrite everything you have in your destination. `;let z;return z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],["fieldTemplate",""],["enumOptionTemplate",""],["optionTemplate",""],n,e,i,o,r,c,f,N,I,z,[3,"submit","formGroup"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"loader","success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],["formGroupName","0"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small",3,"disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","startingPath"],[3,"inputType","formControlName","customId"],[1,"primary","raised"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],[3,"type","id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"formControlName"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"formControl"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let o=G();s(0,"form",15,0),P("submit",function(){return F(o),g(i.next())}),s(2,"header")(3,"h3",16),y(4,5),s(5,"div",17),_(6,Vn,4,5,"button",18),s(7,"spk-menu")(8,"button",19),d(9,"spk-icon"),a(),H(10,20),s(11,"button",21),P("click",function(){return F(o),g(i.openTargetUrlDialog())}),d(12,"spk-icon"),a(),X(),a()(),A(),a(),_(13,Un,3,0,"p"),a(),_(14,Wn,9,1)(15,Li,30,6,"ng-container",22),s(16,"div",23)(17,"button",24),P("click",function(){return F(o),g(i.goBack())}),y(18,6),d(19,"spk-icon"),A(),a(),s(20,"button",25),y(21,7),d(22,"spk-icon"),A(),a()()(),_(23,Vi,15,4,"spk-dialog",26)}if(e&2){let o;u("formGroup",i.destinationForm),l(6),T(i.destinationCount()>0?6:-1),l(7),T(i.destinationCount()>0?13:-1),l(),T(i.destinationCount()===0?14:-1),l(),T(!((o=i.destinationFormSignal())==null||o.destinations==null)&&o.destinations.length?15:-1),l(8),T(i.targetUrlDialogOpen()?23:-1)}},dependencies:[je,Ke,_e,We,Ve,ge,Ue,dt,ze,He,mt,Ht,Kt,de,zt,ue,Ge,pt,Wt,lt,me,ct,Yt,qe,_t,qt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{Ft as a,Ct as b,Se as c,tn as d,nn as e,bt as f,Qt as g,xt as h,Rt as i,$e as j,It as k,Zt as l,vt as m,fe as n};
8
+ }}`),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1)}}function ki(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Oi(t,n){if(t&1&&(s(0,"spk-form-field")(1,"label",47),m(2),_(3,ki,3,1,"spk-tooltip",48),a(),d(4,"input",60),s(5,"spk-icon",51),m(6,"numpad"),a()()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function $i(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Mi(t,n){if(t&1&&(s(0,"spk-toggle",46)(1,"label",47),m(2),_(3,$i,3,1,"spk-tooltip",48),a(),d(4,"input",61),a()),t&2){let e,i=p().$implicit;l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1),l(),W("id","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),ce("formControlName",i.formView.name)}}function wi(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function Ri(t,n){if(t&1&&m(0),t&2){let e=n.$implicit;Y(" ",e," ")}}function xi(t,n){if(t&1&&(s(0,"spk-select",62)(1,"label",47),m(2),_(3,wi,3,1,"spk-tooltip",48),a(),d(4,"input",63),a(),_(5,Ri,1,1,"ng-template",null,4,ot)),t&2){let e,i=re(6),o=p().$implicit;u("options",o.formView.options)("selectMultiple",!0)("optionTemplate",i),l(),Bt("for","destination-",o.formGroupName,"-",o.index,""),l(),Y(" ",(e=o.formView.shortDescription)!==null&&e!==void 0?e:o.formView.name," "),l(),T(o.formView.longDescription?3:-1),l(),ce("formControlName",o.formView.name)}}function Ii(t,n){if(t&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),m(2,"question"),a()()),t&2){let e=p(2).$implicit;u("message",e.formView.longDescription)}}function vi(t,n){if(t&1&&(s(0,"app-timespan",45)(1,"label",47),m(2),_(3,Ii,3,1,"spk-tooltip",48),a()()),t&2){let e,i=p().$implicit;u("inputType",i.formView.name)("formControlName",i.formView.name)("customId","destination-"+i.formGroupName+"-"+i.index+"-"+(i.asHttpOptions?"http":"other")),l(),W("for","destination-",i.formGroupName,"-",i.index,"-",i.asHttpOptions?"http":"other",""),l(),Y(" ",(e=i.formView.shortDescription)!==null&&e!==void 0?e:i.formView.name," "),l(),T(i.formView.longDescription?3:-1)}}function bi(t,n){if(t&1){let e=G();s(0,"button",64),P("click",function(){F(e);let o=p().$implicit,r=p(2);return g(r.removeFormView(o.formView,0))}),s(1,"spk-icon"),m(2,"x-circle"),a()()}}function Gi(t,n){if(t&1&&(s(0,"div",41),H(1,42),_(2,ni,5,17,"app-file-tree",43)(3,oi,5,13,"app-file-tree",44)(4,ci,8,13,"spk-form-field")(5,_i,8,13,"spk-form-field")(6,Si,2,2)(7,Ai,3,2)(8,Ni,4,9,"app-size",45)(9,Oi,7,11,"spk-form-field")(10,Mi,5,11,"spk-toggle",46)(11,xi,7,9)(12,vi,4,9,"app-timespan",45),X(),_(13,bi,3,0,"button",32),a()),t&2){let e=n.$implicit;ke("single-field",e.formGroupName!=="advanced"),l(),u("formGroupName",e.formGroupName),l(),T(e.formView.type==="FileTree"?2:e.formView.type==="FolderTree"?3:e.formView.type==="String"||e.formView.type==="Path"||e.formView.type==="Email"?4:e.formView.type==="Password"?5:e.formView.type==="Enumeration"?6:e.formView.type==="NonValidatedSelectableString"?7:e.formView.type==="Size"?8:e.formView.type==="Integer"?9:e.formView.type==="Boolean"?10:e.formView.type==="Flags"?11:e.formView.type==="Timespan"||e.formView.type==="DateTime"?12:-1),l(11),T(e.formGroupName==="advanced"?13:-1)}}function Li(t,n){if(t&1&&(H(0,22)(1,36),ne(2,Hn,1,9,"ng-container",null,te),ne(4,jn,1,9,"ng-container",null,te),s(6,"app-toggle-card",37),H(7,38),y(8,10),s(9,"spk-menu",31)(10,"button",39),d(11,"spk-icon"),a(),H(12,20),ne(13,qn,3,1,"button",33,te),X(),a(),A(),X(),ne(15,Qn,1,9,"ng-container",null,te),a(),s(17,"app-toggle-card",37),H(18,38),y(19,11),s(20,"spk-menu",31)(21,"button",39),d(22,"spk-icon"),a(),H(23,20),ne(24,Jn,3,1,"button",33,te),X(),a(),A(),X(),ne(26,ei,1,9,"ng-container",null,te),a(),_(28,Gi,14,5,"ng-template",null,2,ot),X()()),t&2){let e=p();l(2),ie(e.destinationFormPair().custom),l(2),ie(e.destinationFormPair().dynamic),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",e.notSelectedAdvancedFormPair().length===0),l(3),ie(e.notSelectedAdvancedFormPair()),l(2),ie(e.selectedAdvancedFormPair()),l(2),u("disallowToggle",!0),l(3),u("searchable",!0),l(),u("disabled",e.notSelectedHttpOptions().length===0),l(3),ie(e.notSelectedHttpOptions()),l(2),ie(e.selectedHttpOptions())}}function Vi(t,n){if(t&1){let e=G();s(0,"spk-dialog",65),K("isOpenChange",function(o){F(e);let r=p();return B(r.targetUrlDialogOpen,o)||(r.targetUrlDialogOpen=o),g(o)}),s(1,"header",66)(2,"h2"),R(3,12),a(),s(4,"spk-alert",67),R(5,13),a()(),s(6,"div",68)(7,"spk-form-field"),d(8,"textarea",69),a()(),s(9,"footer",70)(10,"button",24),P("click",function(){F(e);let o=p();return g(o.closeTargetUrlDialog(!1))}),m(11,"Cancel"),a(),s(12,"button",71),P("click",function(){F(e);let o=p();return g(o.closeTargetUrlDialog(!0))}),y(13,14),d(14,"spk-icon"),A(),a()()()}if(t&2){let e=p();U("isOpen",e.targetUrlDialogOpen),u("options",tt(3,bn)),l(8),u("formControl",e.targetUrlCtrl)}}var Et=new Ce,tn=(t={destinations:[]})=>Et.group({destinations:Et.array(t.destinations)}),nn=({key:t,customGroup:n,dynamicGroup:e,advancedGroup:i})=>Et.group({destinationType:Et.control(t),custom:n,dynamic:e,advanced:i}),bt=class t{#n=O(pe);#t=O(Ae);#e=O(fe);#i=O(ve);#o=O(Ct);injector=O(Vt);formRef=Me.required("formRef");destinationForm=this.#e.destinationForm;destinationFormPair=this.#e.destinationFormPair;selectedAdvancedFormPair=this.#e.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#e.notSelectedAdvancedFormPair;selectedHttpOptions=this.#e.selectedHttpOptions;notSelectedHttpOptions=this.#e.notSelectedHttpOptions;destinationOptions=this.#e.destinationOptions;destinationFormSignal=this.#e.destinationFormSignal;destinationCount=I(()=>this.destinationFormSignal()?.destinations?.length??0);successfulTest=E(!1);testLoading=E(!1);destinationTypeOptionsInFocus=E(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=E(Se.map(n=>({key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description})));destinationTypeOptionsFocused=I(()=>{let n=this.destinationTypeOptionsInFocus(),e=this.destinationTypeOptions();return n.map(i=>e.find(o=>o.key===i))});selectedDestinationType=I(()=>{let n=this.destinationFormSignal();return this.destinationTypeOptions().find(i=>n?.destinations?.[0]?.destinationType===i.key)});destinationTypeOptionsNotFocused=I(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(i=>!n.includes(i.key))});getFormFieldValue(n,e,i){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[e]).controls[i].value}getFormControl(n,e,i){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[e]).controls[i]}addDestinationFormGroup(n){this.#e.addDestinationFormGroup(n)}addAdvancedFormPair(n,e){this.#e.addAdvancedFormPair(n,e)}removeFormView(n,e){this.#e.removeAdvancedFormPair(n,e)}addHttpOption(n,e){this.#e.addHttpOption(n,e)}targetUrl=I(()=>this.#e.getCurrentTargetUrl()[0]);targetUrlCtrl=new mt;targetUrlInitial=E(null);targetUrlDialogOpen=E(!1);openTargetUrlDialog(){let e=this.#e.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(e),this.targetUrlInitial.set(e),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let e=this.targetUrlCtrl.value,i=this.targetUrlInitial();!n||e===i||this.#e.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let i=this.#e.getCurrentTargetUrl()[n];i&&(this.testLoading.set(!0),this.#o.testDestination(i,n,!0).pipe(Ze(()=>this.testLoading.set(!1))).subscribe({next:o=>{if(o.action==="success"){this.#e.isNew()&&(o.containsBackup===!0?this.#i.open(J,{data:{title:$localize`Folder contains backup`,message:$localize`The remote destination already contains a backup. You must use a different folder for each backup.`,confirmText:$localize`OK`,cancelText:void 0}}):o.anyFilesFound===!0&&this.#i.open(J,{data:{title:$localize`Folder is not empty`,message:$localize`The remote destination is not empty. It is recommended to use an empty folder for the backup.`,confirmText:$localize`OK`,cancelText:void 0}})),this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3);return}if(o.action==="generic-error"){this.successfulTest.set(!1);return}o.action==="trust-cert"&&this.#e.addHttpOptionByName("accept-specified-ssl-hash",o.destinationIndex,o.certData),o.action==="approve-host-key"&&this.#e.addOrUpdateAdvancedFormPairByName("ssh-fingerprint",o.destinationIndex,o.reportedHostKey),o.testAgain&&this.testDestination(o.destinationIndex)}}))}mapToTargetUrl(n){return ft(n.value)}removeDestinationFormGroup(n){this.destinationForm.controls.destinations.removeAt(n)}displayFn(n){let e=this.destinationOptions().find(i=>i.Key===n);return e?`${e.DisplayName}`:""}goBack(){this.#n.navigate(["general"],{relativeTo:this.#t.parent})}next(){this.#n.navigate(["source-data"],{relativeTo:this.#t.parent})}#r=E("https://duplicati-oauth-handler.appspot.com/").asReadonly();#s=E(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#a=E(!1);#l=E(null);keyCreation(){}oauthStartTokenCreation(n,e){let i=this.getFormControl(e.index,e.formGroupName,e.formView.name);this.#a.set(!0);let o=this.#s(),r=450,c=600,f=this.#r()+"?type="+n+"&token="+o,N=screen.width/2-r/2,v=screen.height/2-c/2,z=window.open(f,"_blank","height="+c+",width="+r+",menubar=0,status=0,titlebar=0,toolbar=0,left="+N+",top="+v);return window.addEventListener("message",w=>{let b=w.data.startsWith("authid:"),V=b?w.data.replace("authid:",""):null;console.log("event",w),b&&(i.setValue(V),this.#a.set(!1),z?.close())}),!1}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=le({type:t,selectors:[["app-destination"]],viewQuery:function(e,i){e&1&&we(i.formRef,wn,5),e&2&&Re()},decls:24,vars:6,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=Oe(n);let e;e=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let i;i=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let o;o=$localize` Current destination type ${"\uFFFD#2\uFFFD"}:START_TAG_STRONG:${"\uFFFD0\uFFFD"}:INTERPOLATION:.${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_STRONG:${"\uFFFD#3\uFFFD\uFFFD/#3\uFFFD"}:LINE_BREAK: Want to select another? ${"\uFFFD#4\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_SPAN:`;let r;r=$localize`Other destinations`;let c;c=$localize` Advanced options ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#10\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#12\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_MENU:`,c=Oe(c);let f;f=$localize` Http options ${"\uFFFD#20\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON: Add http option ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#23\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*25:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_MENU:`,f=Oe(f);let N;N=$localize`Edit target URL`;let v;v=$localize` Be careful, this will overwrite everything you have in your destination. `;let z;return z=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],["fieldTemplate",""],["enumOptionTemplate",""],["optionTemplate",""],n,e,i,o,r,c,f,N,v,z,[3,"submit","formGroup"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"loader","success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],["formGroupName","0"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small",3,"disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","startingPath"],[3,"inputType","formControlName","customId"],[1,"primary","raised"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],[3,"type","id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"formControlName"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"formControl"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(e,i){if(e&1){let o=G();s(0,"form",15,0),P("submit",function(){return F(o),g(i.next())}),s(2,"header")(3,"h3",16),y(4,5),s(5,"div",17),_(6,Vn,4,5,"button",18),s(7,"spk-menu")(8,"button",19),d(9,"spk-icon"),a(),H(10,20),s(11,"button",21),P("click",function(){return F(o),g(i.openTargetUrlDialog())}),d(12,"spk-icon"),a(),X(),a()(),A(),a(),_(13,Un,5,1,"p"),a(),_(14,Wn,9,1)(15,Li,30,6,"ng-container",22),s(16,"div",23)(17,"button",24),P("click",function(){return F(o),g(i.goBack())}),y(18,6),d(19,"spk-icon"),A(),a(),s(20,"button",25),y(21,7),d(22,"spk-icon"),A(),a()()(),_(23,Vi,15,4,"spk-dialog",26)}if(e&2){let o;u("formGroup",i.destinationForm),l(6),T(i.destinationCount()>0?6:-1),l(7),T(i.destinationCount()>0?13:-1),l(),T(i.destinationCount()===0?14:-1),l(),T(!((o=i.destinationFormSignal())==null||o.destinations==null)&&o.destinations.length?15:-1),l(8),T(i.targetUrlDialogOpen()?23:-1)}},dependencies:[je,Ke,_e,We,Ve,ge,Ue,_t,ze,He,Ft,Ht,Kt,de,zt,ue,Ge,dt,Wt,pt,me,ut,Yt,qe,gt,qt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{Ct as a,ft as b,Se as c,tn as d,nn as e,bt as f,Qt as g,xt as h,Rt as i,$e as j,It as k,Zt as l,vt as m,fe as n};