@sync-in/server 2.0.0 → 2.1.0

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 (232) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +38 -28
  3. package/environment/environment.dist.yaml +4 -0
  4. package/package.json +17 -17
  5. package/server/applications/files/utils/doc-textify/adapters/pdf.js +1 -1
  6. package/server/applications/files/utils/doc-textify/adapters/pdf.js.map +1 -1
  7. package/server/applications/files/utils/files.js +37 -24
  8. package/server/applications/files/utils/files.js.map +1 -1
  9. package/server/applications/notifications/i18n/index.js +5 -0
  10. package/server/applications/notifications/i18n/index.js.map +1 -1
  11. package/server/applications/notifications/i18n/nl.js +54 -0
  12. package/server/applications/notifications/i18n/nl.js.map +1 -0
  13. package/server/applications/sync/services/sync-clients-manager.service.js +1 -1
  14. package/server/applications/sync/services/sync-clients-manager.service.js.map +1 -1
  15. package/server/authentication/providers/oidc/auth-oidc.config.js +5 -0
  16. package/server/authentication/providers/oidc/auth-oidc.config.js.map +1 -1
  17. package/server/authentication/providers/oidc/auth-provider-oidc.service.js +10 -7
  18. package/server/authentication/providers/oidc/auth-provider-oidc.service.js.map +1 -1
  19. package/server/authentication/providers/oidc/auth-provider-oidc.service.spec.js +16 -0
  20. package/server/authentication/providers/oidc/auth-provider-oidc.service.spec.js.map +1 -1
  21. package/server/common/i18n.js +1 -0
  22. package/server/common/i18n.js.map +1 -1
  23. package/server/infrastructure/database/database.module.js +7 -0
  24. package/server/infrastructure/database/database.module.js.map +1 -1
  25. package/server/infrastructure/database/scripts/check-db.js +20 -0
  26. package/server/infrastructure/database/scripts/check-db.js.map +1 -0
  27. package/static/3rdpartylicenses.txt +391 -391
  28. package/static/assets/pdfjs/build/pdf.mjs +512 -417
  29. package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
  30. package/static/assets/pdfjs/build/pdf.sandbox.mjs +390 -4
  31. package/static/assets/pdfjs/build/pdf.sandbox.mjs.map +1 -1
  32. package/static/assets/pdfjs/build/pdf.worker.mjs +2378 -401
  33. package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
  34. package/static/assets/pdfjs/version +1 -1
  35. package/static/assets/pdfjs/web/debugger.mjs +6 -15
  36. package/static/assets/pdfjs/web/locale/be/viewer.ftl +78 -0
  37. package/static/assets/pdfjs/web/locale/cs/viewer.ftl +82 -0
  38. package/static/assets/pdfjs/web/locale/cy/viewer.ftl +90 -0
  39. package/static/assets/pdfjs/web/locale/de/viewer.ftl +75 -0
  40. package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +82 -0
  41. package/static/assets/pdfjs/web/locale/el/viewer.ftl +74 -0
  42. package/static/assets/pdfjs/web/locale/en-CA/viewer.ftl +74 -0
  43. package/static/assets/pdfjs/web/locale/en-GB/viewer.ftl +81 -0
  44. package/static/assets/pdfjs/web/locale/en-US/viewer.ftl +14 -14
  45. package/static/assets/pdfjs/web/locale/eo/viewer.ftl +74 -0
  46. package/static/assets/pdfjs/web/locale/es-AR/viewer.ftl +74 -0
  47. package/static/assets/pdfjs/web/locale/es-CL/viewer.ftl +74 -0
  48. package/static/assets/pdfjs/web/locale/es-ES/viewer.ftl +74 -0
  49. package/static/assets/pdfjs/web/locale/es-MX/viewer.ftl +75 -0
  50. package/static/assets/pdfjs/web/locale/eu/viewer.ftl +74 -0
  51. package/static/assets/pdfjs/web/locale/fi/viewer.ftl +74 -0
  52. package/static/assets/pdfjs/web/locale/fr/viewer.ftl +81 -0
  53. package/static/assets/pdfjs/web/locale/fy-NL/viewer.ftl +74 -0
  54. package/static/assets/pdfjs/web/locale/gn/viewer.ftl +77 -0
  55. package/static/assets/pdfjs/web/locale/he/viewer.ftl +81 -0
  56. package/static/assets/pdfjs/web/locale/hsb/viewer.ftl +87 -0
  57. package/static/assets/pdfjs/web/locale/hu/viewer.ftl +74 -0
  58. package/static/assets/pdfjs/web/locale/hy-AM/viewer.ftl +10 -10
  59. package/static/assets/pdfjs/web/locale/ia/viewer.ftl +75 -0
  60. package/static/assets/pdfjs/web/locale/it/viewer.ftl +81 -0
  61. package/static/assets/pdfjs/web/locale/ja/viewer.ftl +58 -0
  62. package/static/assets/pdfjs/web/locale/ka/viewer.ftl +74 -0
  63. package/static/assets/pdfjs/web/locale/kk/viewer.ftl +81 -0
  64. package/static/assets/pdfjs/web/locale/km/viewer.ftl +44 -0
  65. package/static/assets/pdfjs/web/locale/ko/viewer.ftl +65 -0
  66. package/static/assets/pdfjs/web/locale/nb-NO/viewer.ftl +74 -0
  67. package/static/assets/pdfjs/web/locale/nl/viewer.ftl +81 -0
  68. package/static/assets/pdfjs/web/locale/nn-NO/viewer.ftl +75 -0
  69. package/static/assets/pdfjs/web/locale/pa-IN/viewer.ftl +74 -0
  70. package/static/assets/pdfjs/web/locale/pl/viewer.ftl +78 -0
  71. package/static/assets/pdfjs/web/locale/pt-BR/viewer.ftl +74 -0
  72. package/static/assets/pdfjs/web/locale/ro/viewer.ftl +81 -3
  73. package/static/assets/pdfjs/web/locale/ru/viewer.ftl +85 -0
  74. package/static/assets/pdfjs/web/locale/sk/viewer.ftl +83 -1
  75. package/static/assets/pdfjs/web/locale/sl/viewer.ftl +82 -0
  76. package/static/assets/pdfjs/web/locale/sv-SE/viewer.ftl +81 -0
  77. package/static/assets/pdfjs/web/locale/tg/viewer.ftl +74 -0
  78. package/static/assets/pdfjs/web/locale/th/viewer.ftl +58 -0
  79. package/static/assets/pdfjs/web/locale/tr/viewer.ftl +74 -0
  80. package/static/assets/pdfjs/web/locale/uk/viewer.ftl +144 -0
  81. package/static/assets/pdfjs/web/locale/vi/viewer.ftl +65 -0
  82. package/static/assets/pdfjs/web/locale/zh-CN/viewer.ftl +61 -3
  83. package/static/assets/pdfjs/web/locale/zh-TW/viewer.ftl +65 -0
  84. package/static/assets/pdfjs/web/viewer.css +292 -152
  85. package/static/assets/pdfjs/web/viewer.html +14 -21
  86. package/static/assets/pdfjs/web/viewer.mjs +782 -327
  87. package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
  88. package/static/assets/pdfjs/web/wasm/jbig2.wasm +0 -0
  89. package/static/{chunk-7WOPGQXB.js → chunk-25XD7GNL.js} +1 -1
  90. package/static/{chunk-E5WI5725.js → chunk-2W4Z5VTY.js} +1 -1
  91. package/static/chunk-2XNPCG4F.js +1 -0
  92. package/static/chunk-3B2RHO2H.js +1 -0
  93. package/static/{chunk-UMDRE4S7.js → chunk-3DNAFXGN.js} +1 -1
  94. package/static/{chunk-OANZITPM.js → chunk-3EPN4WD7.js} +1 -1
  95. package/static/chunk-4L2WBHB6.js +1 -0
  96. package/static/chunk-4RYZNAIZ.js +1 -0
  97. package/static/chunk-5C77PEFA.js +1 -0
  98. package/static/chunk-5JA3DZWQ.js +1 -0
  99. package/static/chunk-5MSTJGPE.js +1 -0
  100. package/static/{chunk-VSBFNFOM.js → chunk-5O7KTREI.js} +1 -1
  101. package/static/chunk-6KORLSUZ.js +1 -0
  102. package/static/chunk-6LIHQVPW.js +2 -0
  103. package/static/{chunk-2CKLZ3FM.js → chunk-72BXGTUG.js} +1 -1
  104. package/static/chunk-7423QJQN.js +1 -0
  105. package/static/chunk-77HB4DE6.js +1 -0
  106. package/static/{chunk-RWAAC3A4.js → chunk-7PVTMTWH.js} +1 -1
  107. package/static/{chunk-IWWBV6EM.js → chunk-7UIOW5AD.js} +1 -1
  108. package/static/chunk-7YMONFZZ.js +1 -0
  109. package/static/chunk-AUPNSQGJ.js +1 -0
  110. package/static/chunk-AYF6ZI6L.js +5 -0
  111. package/static/chunk-BEESW4BF.js +1 -0
  112. package/static/{chunk-2R6IBBPZ.js → chunk-BI3VI6XG.js} +1 -1
  113. package/static/chunk-BMGKB3JK.js +4 -0
  114. package/static/chunk-CFXAKPPB.js +563 -0
  115. package/static/chunk-CGYZG6CB.js +2 -0
  116. package/static/{chunk-K25E7YGG.js → chunk-CHAYERHQ.js} +1 -1
  117. package/static/chunk-CLNKPQMZ.js +1 -0
  118. package/static/{chunk-ISV3BO6R.js → chunk-CVLSRA2W.js} +1 -1
  119. package/static/chunk-D373HBMN.js +1 -0
  120. package/static/{chunk-MTRXBVWZ.js → chunk-D43PHZEY.js} +1 -1
  121. package/static/chunk-D44RAVFK.js +1 -0
  122. package/static/chunk-DFVVEGWC.js +1 -0
  123. package/static/chunk-E43LXI27.js +1 -0
  124. package/static/{chunk-GQFMWVFD.js → chunk-E5M4ZDID.js} +1 -1
  125. package/static/chunk-F7JS3YWP.js +2 -0
  126. package/static/chunk-FRWEEOOM.js +1 -0
  127. package/static/chunk-HIZGSP7R.js +1 -0
  128. package/static/chunk-HX6ZWXQD.js +1 -0
  129. package/static/chunk-HZ6LLXLE.js +1 -0
  130. package/static/{chunk-RLL634K4.js → chunk-IFHFPV5W.js} +1 -1
  131. package/static/{chunk-KJD3KFF3.js → chunk-JICKUOQ6.js} +1 -1
  132. package/static/chunk-KY2BW2LP.js +1 -0
  133. package/static/{chunk-CWYHOPOP.js → chunk-KYA3HPDX.js} +1 -1
  134. package/static/{chunk-RWCNTCU5.js → chunk-KYLATNX5.js} +1 -1
  135. package/static/chunk-LCZNSV4Z.js +1 -0
  136. package/static/{chunk-GVNTC564.js → chunk-MA6DYTMQ.js} +1 -1
  137. package/static/{chunk-KZS7CTNR.js → chunk-MXH5XYBD.js} +1 -1
  138. package/static/{chunk-NMTBMHUL.js → chunk-MXIJGSDQ.js} +1 -1
  139. package/static/{chunk-RS2OFKWP.js → chunk-NE75E3GD.js} +1 -1
  140. package/static/{chunk-MZQK6LNV.js → chunk-NJKIHMOH.js} +1 -1
  141. package/static/chunk-NMDGST45.js +1 -0
  142. package/static/{chunk-CU76ATCF.js → chunk-OF7P4LTI.js} +1 -1
  143. package/static/chunk-OK5K5CYJ.js +13 -0
  144. package/static/chunk-OZ6LXMUH.js +1 -0
  145. package/static/chunk-PFY6YUPS.js +2 -0
  146. package/static/chunk-PQ2YFCVM.js +1 -0
  147. package/static/{chunk-Y4AUYQTG.js → chunk-QPX34S6P.js} +4 -4
  148. package/static/{chunk-27ATUHBH.js → chunk-QQO7S2VY.js} +1 -1
  149. package/static/chunk-RANZZPRG.js +1 -0
  150. package/static/{chunk-WN4WXCVK.js → chunk-RNQB2QJB.js} +1 -1
  151. package/static/{chunk-Q3EGCMF5.js → chunk-S7QYAKG5.js} +1 -1
  152. package/static/chunk-SCEWOW5C.js +2 -0
  153. package/static/chunk-SQ2KIOJ7.js +1 -0
  154. package/static/{chunk-QVRVFYJH.js → chunk-SW5GCGOI.js} +1 -1
  155. package/static/chunk-SWCYWB2T.js +1 -0
  156. package/static/{chunk-4FIGEBNL.js → chunk-SWZ3L2LK.js} +1 -1
  157. package/static/{chunk-TWCGKSYE.js → chunk-TDK62XEQ.js} +1 -1
  158. package/static/chunk-TH4L5H6P.js +1 -0
  159. package/static/chunk-U3ZGYOLA.js +1 -0
  160. package/static/chunk-U6V4Y234.js +1 -0
  161. package/static/chunk-U7KNV64D.js +2 -0
  162. package/static/chunk-UC66HJV4.js +1 -0
  163. package/static/{chunk-7GWW6MJO.js → chunk-V4HAIERK.js} +1 -1
  164. package/static/chunk-V55LDRV7.js +1 -0
  165. package/static/{chunk-5CZOSAMZ.js → chunk-WF6D7CQ4.js} +1 -1
  166. package/static/chunk-WJPVHM7T.js +1 -0
  167. package/static/chunk-WM4XBDC2.js +1 -0
  168. package/static/chunk-X2EKQYMZ.js +1 -0
  169. package/static/{chunk-L5IHUVXL.js → chunk-XEDABMM5.js} +1 -1
  170. package/static/{chunk-OGE4SAHU.js → chunk-Y3YKVK3K.js} +1 -1
  171. package/static/{chunk-QIGUDEZF.js → chunk-YEOAMYRK.js} +1 -1
  172. package/static/{chunk-A4UGPSWX.js → chunk-ZLTL7I7D.js} +1 -1
  173. package/static/chunk-ZYNBYM7I.js +3 -0
  174. package/static/index.html +2 -2
  175. package/static/main-KFUSRCP5.js +5 -0
  176. package/static/media/inter-cyrillic-ext-wght-normal-IYF56FF6.woff2 +0 -0
  177. package/static/media/inter-cyrillic-wght-normal-JEOLYBOO.woff2 +0 -0
  178. package/static/media/inter-greek-ext-wght-normal-EOVOK2B5.woff2 +0 -0
  179. package/static/media/inter-greek-wght-normal-IRE366VL.woff2 +0 -0
  180. package/static/media/inter-latin-ext-wght-normal-HA22NDSG.woff2 +0 -0
  181. package/static/media/inter-latin-wght-normal-NRMW37G5.woff2 +0 -0
  182. package/static/media/inter-vietnamese-wght-normal-CE5GGD3W.woff2 +0 -0
  183. package/static/styles-66AEF62D.css +1 -0
  184. package/static/chunk-22TZP6HW.js +0 -1
  185. package/static/chunk-2QZPX7LO.js +0 -1
  186. package/static/chunk-4P3JABAP.js +0 -13
  187. package/static/chunk-677WUBCT.js +0 -1
  188. package/static/chunk-74CAHBFM.js +0 -1
  189. package/static/chunk-AHO37FKW.js +0 -1
  190. package/static/chunk-AQCXMKP3.js +0 -1
  191. package/static/chunk-B6PDYCRO.js +0 -3
  192. package/static/chunk-FC5HTKVM.js +0 -1
  193. package/static/chunk-FOSM7EYI.js +0 -1
  194. package/static/chunk-GAZO25PI.js +0 -1
  195. package/static/chunk-GB7ABR5N.js +0 -1
  196. package/static/chunk-GEHFKZQ5.js +0 -2
  197. package/static/chunk-HGL3NYP2.js +0 -2
  198. package/static/chunk-HLIWPWRA.js +0 -1
  199. package/static/chunk-HNYB3M4S.js +0 -1
  200. package/static/chunk-HUXAUQMN.js +0 -1
  201. package/static/chunk-I2XA6PPK.js +0 -1
  202. package/static/chunk-JV3AGU5B.js +0 -1
  203. package/static/chunk-K46PUTZB.js +0 -1
  204. package/static/chunk-KERFLJ56.js +0 -1
  205. package/static/chunk-KPKSI23S.js +0 -1
  206. package/static/chunk-L7RRX2M3.js +0 -1
  207. package/static/chunk-LGWJ2WKU.js +0 -1
  208. package/static/chunk-LUSVISM6.js +0 -1
  209. package/static/chunk-MLC7JK2H.js +0 -2
  210. package/static/chunk-MOHNYW2A.js +0 -1
  211. package/static/chunk-NCDUOVMW.js +0 -1
  212. package/static/chunk-NGUAJIGI.js +0 -1
  213. package/static/chunk-NIPP6JDI.js +0 -1
  214. package/static/chunk-O4XXMZFX.js +0 -4
  215. package/static/chunk-OI3ME22C.js +0 -1
  216. package/static/chunk-QF2NSHZA.js +0 -1
  217. package/static/chunk-QJVC3SRJ.js +0 -562
  218. package/static/chunk-QKN6LAAA.js +0 -1
  219. package/static/chunk-QRFESU5O.js +0 -2
  220. package/static/chunk-RFJIPIOK.js +0 -2
  221. package/static/chunk-S5Y64DDS.js +0 -1
  222. package/static/chunk-SLG5KDU6.js +0 -1
  223. package/static/chunk-TJ4CVFEL.js +0 -1
  224. package/static/chunk-VRIOLRYR.js +0 -5
  225. package/static/chunk-VS4O2XDP.js +0 -1
  226. package/static/chunk-WX7RXW7K.js +0 -1
  227. package/static/chunk-XC4POKR3.js +0 -2
  228. package/static/chunk-Y67J3BOL.js +0 -1
  229. package/static/chunk-YMIXHRJQ.js +0 -1
  230. package/static/chunk-ZUNKFAKP.js +0 -1
  231. package/static/main-QN4UCOC5.js +0 -5
  232. package/static/styles-46GLIE7Y.css +0 -1
@@ -0,0 +1,5 @@
1
+ import{a as Yc}from"./chunk-LCZNSV4Z.js";import{a as An,b as no,c as ri,d as qc,e as oo,f as ai,g as Qc,h as it,i as Dn,j as si}from"./chunk-77HB4DE6.js";import{a as Ne,e as Pc,g as Ic,i as Rc,j as fr,k as Oc,l as Lc,m as Bc,n as Uc,o as $c,p as va,q as Hc,r as kn,s as zc,t as Gc,u as Wc,v as xr,w as jc,x as Kc,y as Sr,z as Le}from"./chunk-AYF6ZI6L.js";import{a as Xc,b as Mn,c as de}from"./chunk-MA6DYTMQ.js";import{b as Zc,c as Jc,d as ep,h as ro}from"./chunk-RNQB2QJB.js";import{c as oi,d as Nc,h as io,i as hr,j as gr,k as Vc,m as Cr}from"./chunk-RTNEBRKJ.js";import{a as Ki,c as ni,d as Sa,e as Fc}from"./chunk-FRWEEOOM.js";import{a as Di,b as Mi,c as Fi,d as Pi}from"./chunk-QQO7S2VY.js";import"./chunk-BEESW4BF.js";import"./chunk-OK5K5CYJ.js";import{a as kc,b as cr,c as Tn,d as _r}from"./chunk-S7QYAKG5.js";import{a as qe}from"./chunk-CLNKPQMZ.js";import{b as Mc}from"./chunk-JXZCNFW7.js";import{a as Dc}from"./chunk-25XD7GNL.js";import{a as qi,d as tc}from"./chunk-U3ZGYOLA.js";import{a as tt,c as En}from"./chunk-BMGKB3JK.js";import{a as Pe}from"./chunk-D43PHZEY.js";import{a as xa,b as Tt}from"./chunk-5C77PEFA.js";import{a as qs,b as Qs,c as Ys,f as Xs,g as fa,h as ln,i as Zs,j as Js,k as nl,l as Cc,m as bc,n as sr,o as je,q as wc,t as Tc,v as Ec,y as oe}from"./chunk-WM4XBDC2.js";import{a as ki}from"./chunk-SQ2KIOJ7.js";import{a as ht}from"./chunk-WJPVHM7T.js";import{a as Re,b as Ke,c as Bt}from"./chunk-U6V4Y234.js";import{a as pr,b as dr,c as mr,d as ur,e as Qe}from"./chunk-7UIOW5AD.js";import{a as lr,b as Ac}from"./chunk-NJKIHMOH.js";import"./chunk-V4HAIERK.js";import{$a as mc,A as Zn,Aa as Jn,B as Wi,Ba as ft,Ca as vn,D as _t,Da as nc,E as Jo,Ea as oc,Eb as I,F as Ee,Fa as eo,G as ji,Ga as rc,H as jl,I as Ei,J as Wt,Ka as ac,L as ha,La as sc,Lb as di,M as Kl,Ma as lc,Mb as xc,N as ql,Nb as Sc,O as Ql,Ob as Lt,P as Yl,Pb as ie,Q as Xl,Qb as G,R as Zl,Ra as cc,Rb as vc,S as Jl,T as er,Ta as yn,Tb as yc,U as ec,Ua as pc,V as tr,Va as fe,W as ic,Wa as dc,Xa as bn,a as pe,ab as ir,b as Gt,db as nr,e as Ks,eb as ga,f as _a,hb as Fe,i as Gi,ib as uc,j as Mo,jb as or,k as Yn,kb as _c,lb as fc,n as pi,nb as to,pb as hc,q as il,r as Po,s as Me,sb as rr,t as Ge,tb as ye,ub as gc,v as ol,vb as wn,w as rl,wa as Nt,x as al,xa as Vt,xb as te,ya as Ot,za as We}from"./chunk-ZYNBYM7I.js";import{a as Gs,b as Mt,c as an,d as Ce,e as sn,f as Ws,g as js}from"./chunk-NMDGST45.js";import{$a as A,$b as Kn,$c as zs,$d as Vo,$e as Go,$f as Ul,Ab as y,Ad as un,Af as Nl,Bb as Ao,Bd as Te,Be as Ho,Bf as qo,Cc as Ds,Cd as yi,Ce as Sl,Da as la,Db as f,Dc as Ms,Dd as z,E as At,Eb as Gn,Ec as Fs,Ef as dt,Fb as c,Ff as Vl,G as yo,Ga as zn,Gb as ys,Gc as Ps,Gd as el,Ge as vl,Gf as Qo,Ha as X,Hb as bs,Hd as tl,He as zo,I as ms,Ib as Wn,Ic as Is,Id as J,If as Ol,Jb as Z,Jd as P,Ka as Eo,Kb as j,Kd as bi,Kf as ti,L as ce,La as gi,Lb as K,Lc as zt,M as us,Ma as ca,Mc as rn,Mf as ii,Na as a,Nd as Io,Nf as Ll,O as bo,Oa as gs,Ob as at,Oc as De,Od as sl,Oe as yl,Of as gn,Pa as ae,Pb as B,Pc as Rs,Pd as _n,Pe as bl,Qa as $i,Qb as L,Qe as wl,Rb as V,Rc as Ns,Re as Tl,Rf as Bl,Sa as Cs,Sb as d,Sc as Vs,Sd as ll,T as _s,Tb as w,Tc as Os,Td as cl,Te as El,Ua as xs,Ub as k,Uf as Cn,Va as Dt,Vb as ke,Vc as Ls,Ve as Al,Vf as Yo,W as fs,Wb as me,Wd as pl,We as kl,Xa as Ss,Xb as ue,Xc as Bs,Xf as et,Yb as _e,Yc as Us,Ye as Dl,Yf as xn,Z as $n,Zb as ko,Zc as $s,Zd as Ro,Zf as mt,_b as jn,_c as Hs,_d as No,aa as ge,ab as pa,ac as ma,ae as Oo,bb as Ci,bc as q,bg as $l,cb as on,cc as ws,ce as dl,cf as hn,da as kt,dc as ua,dd as Ft,dg as Xo,ea as sa,eb as N,ec as qn,ed as ze,ef as Wo,f as So,fc as Je,fe as ml,ff as pt,fg as Hl,g as ps,gc as Ts,gd as wt,ge as Pt,ha as wo,hc as Es,he as ul,hf as wi,ia as S,ic as Do,id as xe,if as Ti,ig as ut,jb as Xt,jc as b,jd as cn,jf as Xn,jg as Sn,ka as hs,kb as C,kc as $,ke as Lo,kg as Zo,lb as x,lc as E,lf as ei,mb as He,mc as $t,mf as jo,mg as zl,na as h,nb as vs,nc as Zt,nd as we,ne as _l,nf as Ml,ng as Gl,oa as g,ob as D,od as pn,of as Oe,og as Wl,p as fi,pa as Hn,pb as M,pc as As,pe as fl,pf as Fl,pg as Rt,q as vo,qa as To,qb as m,qe as hl,qf as Pl,rb as s,rc as ve,rd as dn,re as gl,sb as l,sc as Ht,sd as mn,se as Bo,tb as _,td as xi,te as fn,tf as Ko,ua as Ze,ub as Hi,uc as Qn,ud as Si,uf as Il,ug as F,v as bt,vb as zi,vc as se,vd as vi,ve as Cl,w as ds,wa as nn,wb as da,we as xl,wg as ar,xd as Jt,xe as Uo,xg as Ca,yc as ks,yd as Fo,yf as Rl,za as hi,zb as ct,ze as $o,zf as It}from"./chunk-CFXAKPPB.js";import{n as Ai}from"./chunk-DM4NXKEP.js";import"./chunk-ZIJQRARU.js";import{a as re,b as Se,d as cs,i as yt}from"./chunk-KAVP6UXH.js";var tp=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-root"]],decls:1,vars:0,template:function(o,r){o&1&&_(0,"router-outlet")},dependencies:[an],encapsulation:2});let i=n;return i})();function ip(i){return new ge(3e3,!1)}function qm(){return new ge(3100,!1)}function Qm(){return new ge(3101,!1)}function Ym(i){return new ge(3001,!1)}function Xm(i){return new ge(3003,!1)}function Zm(i){return new ge(3004,!1)}function op(i,n){return new ge(3005,!1)}function rp(){return new ge(3006,!1)}function ap(){return new ge(3007,!1)}function sp(i,n){return new ge(3008,!1)}function lp(i){return new ge(3002,!1)}function cp(i,n,e,t,o){return new ge(3010,!1)}function pp(){return new ge(3011,!1)}function dp(){return new ge(3012,!1)}function mp(){return new ge(3200,!1)}function up(){return new ge(3202,!1)}function _p(){return new ge(3013,!1)}function fp(i){return new ge(3014,!1)}function hp(i){return new ge(3015,!1)}function gp(i){return new ge(3016,!1)}function Cp(i,n){return new ge(3404,!1)}function Jm(i){return new ge(3502,!1)}function xp(i){return new ge(3503,!1)}function Sp(){return new ge(3300,!1)}function vp(i){return new ge(3504,!1)}function yp(i){return new ge(3301,!1)}function bp(i,n){return new ge(3302,!1)}function wp(i){return new ge(3303,!1)}function Tp(i,n){return new ge(3400,!1)}function Ep(i){return new ge(3401,!1)}function Ap(i){return new ge(3402,!1)}function kp(i,n){return new ge(3505,!1)}function mi(i){switch(i.length){case 0:return new Gi;case 1:return i[0];default:return new Mo(i)}}function Ta(i,n,e=new Map,t=new Map){let o=[],r=[],p=-1,u=null;if(n.forEach(v=>{let T=v.get("offset"),R=T==p,O=R&&u||new Map;v.forEach((le,Y)=>{let W=Y,ne=le;if(Y!=="offset")switch(W=i.normalizePropertyName(W,o),ne){case Yn:ne=e.get(Y);break;case Gt:ne=t.get(Y);break;default:ne=i.normalizeStyleValue(Y,W,ne,o);break}O.set(W,ne)}),R||r.push(O),u=O,p=T}),o.length)throw Jm(o);return r}function vr(i,n,e,t){switch(n){case"start":i.onStart(()=>t(e&&ya(e,"start",i)));break;case"done":i.onDone(()=>t(e&&ya(e,"done",i)));break;case"destroy":i.onDestroy(()=>t(e&&ya(e,"destroy",i)));break}}function ya(i,n,e){let t=e.totalTime,o=!!e.disabled,r=yr(i.element,i.triggerName,i.fromState,i.toState,n||i.phaseName,t??i.totalTime,o),p=i._data;return p!=null&&(r._data=p),r}function yr(i,n,e,t,o="",r=0,p){return{element:i,triggerName:n,fromState:e,toState:t,phaseName:o,totalTime:r,disabled:!!p}}function gt(i,n,e){let t=i.get(n);return t||i.set(n,t=e),t}function Ea(i){let n=i.indexOf(":"),e=i.substring(1,n),t=i.slice(n+1);return[e,t]}var e0=typeof document>"u"?null:document.documentElement;function br(i){let n=i.parentNode||i.host||null;return n===e0?null:n}function t0(i){return i.substring(1,6)=="ebkit"}var Qi=null,np=!1;function Dp(i){Qi||(Qi=i0()||{},np=Qi.style?"WebkitAppearance"in Qi.style:!1);let n=!0;return Qi.style&&!t0(i)&&(n=i in Qi.style,!n&&np&&(n="Webkit"+i.charAt(0).toUpperCase()+i.slice(1)in Qi.style)),n}function i0(){return typeof document<"u"?document.body:null}function Aa(i,n){for(;n;){if(n===i)return!0;n=br(n)}return!1}function ka(i,n,e){if(e)return Array.from(i.querySelectorAll(n));let t=i.querySelector(n);return t?[t]:[]}var n0=1e3,Da="{{",o0="}}",Ma="ng-enter",wr="ng-leave",ao="ng-trigger",so=".ng-trigger",Fa="ng-animating",Tr=".ng-animating";function li(i){if(typeof i=="number")return i;let n=i.match(/^(-?[\.\d]+)(m?s)/);return!n||n.length<2?0:ba(parseFloat(n[1]),n[2])}function ba(i,n){switch(n){case"s":return i*n0;default:return i}}function lo(i,n,e){return i.hasOwnProperty("duration")?i:a0(i,n,e)}var r0=/^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;function a0(i,n,e){let t,o=0,r="";if(typeof i=="string"){let p=i.match(r0);if(p===null)return n.push(ip(i)),{duration:0,delay:0,easing:""};t=ba(parseFloat(p[1]),p[2]);let u=p[3];u!=null&&(o=ba(parseFloat(u),p[4]));let v=p[5];v&&(r=v)}else t=i;if(!e){let p=!1,u=n.length;t<0&&(n.push(qm()),p=!0),o<0&&(n.push(Qm()),p=!0),p&&n.splice(u,0,ip(i))}return{duration:t,delay:o,easing:r}}function Mp(i){return i.length?i[0]instanceof Map?i:i.map(n=>new Map(Object.entries(n))):[]}function jt(i,n,e){n.forEach((t,o)=>{let r=Er(o);e&&!e.has(o)&&e.set(o,i.style[r]),i.style[r]=t})}function Ii(i,n){n.forEach((e,t)=>{let o=Er(t);i.style[o]=""})}function Fn(i){return Array.isArray(i)?i.length==1?i[0]:Ks(i):i}function Fp(i,n,e){let t=n.params||{},o=Pa(i);o.length&&o.forEach(r=>{t.hasOwnProperty(r)||e.push(Ym(r))})}var wa=new RegExp(`${Da}\\s*(.+?)\\s*${o0}`,"g");function Pa(i){let n=[];if(typeof i=="string"){let e;for(;e=wa.exec(i);)n.push(e[1]);wa.lastIndex=0}return n}function Pn(i,n,e){let t=`${i}`,o=t.replace(wa,(r,p)=>{let u=n[p];return u==null&&(e.push(Xm(p)),u=""),u.toString()});return o==t?i:o}var s0=/-+([a-z0-9])/g;function Er(i){return i.replace(s0,(...n)=>n[1].toUpperCase())}function Pp(i,n){return i===0||n===0}function Ip(i,n,e){if(e.size&&n.length){let t=n[0],o=[];if(e.forEach((r,p)=>{t.has(p)||o.push(p),t.set(p,r)}),o.length)for(let r=1;r<n.length;r++){let p=n[r];o.forEach(u=>p.set(u,Ar(i,u)))}}return n}function Ct(i,n,e){switch(n.type){case pe.Trigger:return i.visitTrigger(n,e);case pe.State:return i.visitState(n,e);case pe.Transition:return i.visitTransition(n,e);case pe.Sequence:return i.visitSequence(n,e);case pe.Group:return i.visitGroup(n,e);case pe.Animate:return i.visitAnimate(n,e);case pe.Keyframes:return i.visitKeyframes(n,e);case pe.Style:return i.visitStyle(n,e);case pe.Reference:return i.visitReference(n,e);case pe.AnimateChild:return i.visitAnimateChild(n,e);case pe.AnimateRef:return i.visitAnimateRef(n,e);case pe.Query:return i.visitQuery(n,e);case pe.Stagger:return i.visitStagger(n,e);default:throw Zm(n.type)}}function Ar(i,n){return window.getComputedStyle(i)[n]}var Qa=(()=>{class i{validateStyleProperty(e){return Dp(e)}containsElement(e,t){return Aa(e,t)}getParentElement(e){return br(e)}query(e,t,o){return ka(e,t,o)}computeStyle(e,t,o){return o||""}animate(e,t,o,r,p,u=[],v){return new Gi(o,r)}static \u0275fac=function(t){return new(t||i)};static \u0275prov=kt({token:i,factory:i.\u0275fac})}return i})(),Xi=class{static NOOP=new Qa},Zi=class{};var l0=new Set(["width","height","minWidth","minHeight","maxWidth","maxHeight","left","top","bottom","right","fontSize","outlineWidth","outlineOffset","paddingTop","paddingLeft","paddingBottom","paddingRight","marginTop","marginLeft","marginBottom","marginRight","borderRadius","borderWidth","borderTopWidth","borderLeftWidth","borderRightWidth","borderBottomWidth","textIndent","perspective"]),Pr=class extends Zi{normalizePropertyName(n,e){return Er(n)}normalizeStyleValue(n,e,t,o){let r="",p=t.toString().trim();if(l0.has(e)&&t!==0&&t!=="0")if(typeof t=="number")r="px";else{let u=t.match(/^[+-]?[\d\.]+([a-z]*)$/);u&&u[1].length==0&&o.push(op(n,t))}return p+r}};var Ir="*";function c0(i,n){let e=[];return typeof i=="string"?i.split(/\s*,\s*/).forEach(t=>p0(t,e,n)):e.push(i),e}function p0(i,n,e){if(i[0]==":"){let v=d0(i,e);if(typeof v=="function"){n.push(v);return}i=v}let t=i.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);if(t==null||t.length<4)return e.push(hp(i)),n;let o=t[1],r=t[2],p=t[3];n.push(Rp(o,p));let u=o==Ir&&p==Ir;r[0]=="<"&&!u&&n.push(Rp(p,o))}function d0(i,n){switch(i){case":enter":return"void => *";case":leave":return"* => void";case":increment":return(e,t)=>parseFloat(t)>parseFloat(e);case":decrement":return(e,t)=>parseFloat(t)<parseFloat(e);default:return n.push(gp(i)),"* => *"}}var kr=new Set(["true","1"]),Dr=new Set(["false","0"]);function Rp(i,n){let e=kr.has(i)||Dr.has(i),t=kr.has(n)||Dr.has(n);return(o,r)=>{let p=i==Ir||i==o,u=n==Ir||n==r;return!p&&e&&typeof o=="boolean"&&(p=o?kr.has(i):Dr.has(i)),!u&&t&&typeof r=="boolean"&&(u=r?kr.has(n):Dr.has(n)),p&&u}}var Gp=":self",m0=new RegExp(`s*${Gp}s*,?`,"g");function Wp(i,n,e,t){return new La(i).build(n,e,t)}var Np="",La=class{_driver;constructor(n){this._driver=n}build(n,e,t){let o=new Ba(e);return this._resetContextStyleTimingState(o),Ct(this,Fn(n),o)}_resetContextStyleTimingState(n){n.currentQuerySelector=Np,n.collectedStyles=new Map,n.collectedStyles.set(Np,new Map),n.currentTime=0}visitTrigger(n,e){let t=e.queryCount=0,o=e.depCount=0,r=[],p=[];return n.name.charAt(0)=="@"&&e.errors.push(rp()),n.definitions.forEach(u=>{if(this._resetContextStyleTimingState(e),u.type==pe.State){let v=u,T=v.name;T.toString().split(/\s*,\s*/).forEach(R=>{v.name=R,r.push(this.visitState(v,e))}),v.name=T}else if(u.type==pe.Transition){let v=this.visitTransition(u,e);t+=v.queryCount,o+=v.depCount,p.push(v)}else e.errors.push(ap())}),{type:pe.Trigger,name:n.name,states:r,transitions:p,queryCount:t,depCount:o,options:null}}visitState(n,e){let t=this.visitStyle(n.styles,e),o=n.options&&n.options.params||null;if(t.containsDynamicStyles){let r=new Set,p=o||{};t.styles.forEach(u=>{u instanceof Map&&u.forEach(v=>{Pa(v).forEach(T=>{p.hasOwnProperty(T)||r.add(T)})})}),r.size&&e.errors.push(sp(n.name,[...r.values()]))}return{type:pe.State,name:n.name,style:t,options:o?{params:o}:null}}visitTransition(n,e){e.queryCount=0,e.depCount=0;let t=Ct(this,Fn(n.animation),e),o=c0(n.expr,e.errors);return{type:pe.Transition,matchers:o,animation:t,queryCount:e.queryCount,depCount:e.depCount,options:Yi(n.options)}}visitSequence(n,e){return{type:pe.Sequence,steps:n.steps.map(t=>Ct(this,t,e)),options:Yi(n.options)}}visitGroup(n,e){let t=e.currentTime,o=0,r=n.steps.map(p=>{e.currentTime=t;let u=Ct(this,p,e);return o=Math.max(o,e.currentTime),u});return e.currentTime=o,{type:pe.Group,steps:r,options:Yi(n.options)}}visitAnimate(n,e){let t=h0(n.timings,e.errors);e.currentAnimateTimings=t;let o,r=n.styles?n.styles:_a({});if(r.type==pe.Keyframes)o=this.visitKeyframes(r,e);else{let p=n.styles,u=!1;if(!p){u=!0;let T={};t.easing&&(T.easing=t.easing),p=_a(T)}e.currentTime+=t.duration+t.delay;let v=this.visitStyle(p,e);v.isEmptyStep=u,o=v}return e.currentAnimateTimings=null,{type:pe.Animate,timings:t,style:o,options:null}}visitStyle(n,e){let t=this._makeStyleAst(n,e);return this._validateStyleAst(t,e),t}_makeStyleAst(n,e){let t=[],o=Array.isArray(n.styles)?n.styles:[n.styles];for(let u of o)typeof u=="string"?u===Gt?t.push(u):e.errors.push(lp(u)):t.push(new Map(Object.entries(u)));let r=!1,p=null;return t.forEach(u=>{if(u instanceof Map&&(u.has("easing")&&(p=u.get("easing"),u.delete("easing")),!r)){for(let v of u.values())if(v.toString().indexOf(Da)>=0){r=!0;break}}}),{type:pe.Style,styles:t,easing:p,offset:n.offset,containsDynamicStyles:r,options:null}}_validateStyleAst(n,e){let t=e.currentAnimateTimings,o=e.currentTime,r=e.currentTime;t&&r>0&&(r-=t.duration+t.delay),n.styles.forEach(p=>{typeof p!="string"&&p.forEach((u,v)=>{let T=e.collectedStyles.get(e.currentQuerySelector),R=T.get(v),O=!0;R&&(r!=o&&r>=R.startTime&&o<=R.endTime&&(e.errors.push(cp(v,R.startTime,R.endTime,r,o)),O=!1),r=R.startTime),O&&T.set(v,{startTime:r,endTime:o}),e.options&&Fp(u,e.options,e.errors)})})}visitKeyframes(n,e){let t={type:pe.Keyframes,styles:[],options:null};if(!e.currentAnimateTimings)return e.errors.push(pp()),t;let o=1,r=0,p=[],u=!1,v=!1,T=0,R=n.steps.map(Be=>{let Ue=this._makeStyleAst(Be,e),ot=Ue.offset!=null?Ue.offset:f0(Ue.styles),Ye=0;return ot!=null&&(r++,Ye=Ue.offset=ot),v=v||Ye<0||Ye>1,u=u||Ye<T,T=Ye,p.push(Ye),Ue});v&&e.errors.push(dp()),u&&e.errors.push(mp());let O=n.steps.length,le=0;r>0&&r<O?e.errors.push(up()):r==0&&(le=o/(O-1));let Y=O-1,W=e.currentTime,ne=e.currentAnimateTimings,be=ne.duration;return R.forEach((Be,Ue)=>{let ot=le>0?Ue==Y?1:le*Ue:p[Ue],Ye=ot*be;e.currentTime=W+ne.delay+Ye,ne.duration=Ye,this._validateStyleAst(Be,e),Be.offset=ot,t.styles.push(Be)}),t}visitReference(n,e){return{type:pe.Reference,animation:Ct(this,Fn(n.animation),e),options:Yi(n.options)}}visitAnimateChild(n,e){return e.depCount++,{type:pe.AnimateChild,options:Yi(n.options)}}visitAnimateRef(n,e){return{type:pe.AnimateRef,animation:this.visitReference(n.animation,e),options:Yi(n.options)}}visitQuery(n,e){let t=e.currentQuerySelector,o=n.options||{};e.queryCount++,e.currentQuery=n;let[r,p]=u0(n.selector);e.currentQuerySelector=t.length?t+" "+r:r,gt(e.collectedStyles,e.currentQuerySelector,new Map);let u=Ct(this,Fn(n.animation),e);return e.currentQuery=null,e.currentQuerySelector=t,{type:pe.Query,selector:r,limit:o.limit||0,optional:!!o.optional,includeSelf:p,animation:u,originalSelector:n.selector,options:Yi(n.options)}}visitStagger(n,e){e.currentQuery||e.errors.push(_p());let t=n.timings==="full"?{duration:0,delay:0,easing:"full"}:lo(n.timings,e.errors,!0);return{type:pe.Stagger,animation:Ct(this,Fn(n.animation),e),timings:t,options:null}}};function u0(i){let n=!!i.split(/\s*,\s*/).find(e=>e==Gp);return n&&(i=i.replace(m0,"")),i=i.replace(/@\*/g,so).replace(/@\w+/g,e=>so+"-"+e.slice(1)).replace(/:animating/g,Tr),[i,n]}function _0(i){return i?re({},i):null}var Ba=class{errors;queryCount=0;depCount=0;currentTransition=null;currentQuery=null;currentQuerySelector=null;currentAnimateTimings=null;currentTime=0;collectedStyles=new Map;options=null;unsupportedCSSPropertiesFound=new Set;constructor(n){this.errors=n}};function f0(i){if(typeof i=="string")return null;let n=null;if(Array.isArray(i))i.forEach(e=>{if(e instanceof Map&&e.has("offset")){let t=e;n=parseFloat(t.get("offset")),t.delete("offset")}});else if(i instanceof Map&&i.has("offset")){let e=i;n=parseFloat(e.get("offset")),e.delete("offset")}return n}function h0(i,n){if(i.hasOwnProperty("duration"))return i;if(typeof i=="number"){let r=lo(i,n).duration;return Ia(r,0,"")}let e=i;if(e.split(/\s+/).some(r=>r.charAt(0)=="{"&&r.charAt(1)=="{")){let r=Ia(0,0,"");return r.dynamic=!0,r.strValue=e,r}let o=lo(e,n);return Ia(o.duration,o.delay,o.easing)}function Yi(i){return i?(i=re({},i),i.params&&(i.params=_0(i.params))):i={},i}function Ia(i,n,e){return{duration:i,delay:n,easing:e}}function Ya(i,n,e,t,o,r,p=null,u=!1){return{type:1,element:i,keyframes:n,preStyleProps:e,postStyleProps:t,duration:o,delay:r,totalTime:o+r,easing:p,subTimeline:u}}var po=class{_map=new Map;get(n){return this._map.get(n)||[]}append(n,e){let t=this._map.get(n);t||this._map.set(n,t=[]),t.push(...e)}has(n){return this._map.has(n)}clear(){this._map.clear()}},g0=1,C0=":enter",x0=new RegExp(C0,"g"),S0=":leave",v0=new RegExp(S0,"g");function jp(i,n,e,t,o,r=new Map,p=new Map,u,v,T=[]){return new Ua().buildKeyframes(i,n,e,t,o,r,p,u,v,T)}var Ua=class{buildKeyframes(n,e,t,o,r,p,u,v,T,R=[]){T=T||new po;let O=new $a(n,e,T,o,r,R,[]);O.options=v;let le=v.delay?li(v.delay):0;O.currentTimeline.delayNextStep(le),O.currentTimeline.setStyles([p],null,O.errors,v),Ct(this,t,O);let Y=O.timelines.filter(W=>W.containsAnimation());if(Y.length&&u.size){let W;for(let ne=Y.length-1;ne>=0;ne--){let be=Y[ne];if(be.element===e){W=be;break}}W&&!W.allowOnlyTimelineStyles()&&W.setStyles([u],null,O.errors,v)}return Y.length?Y.map(W=>W.buildKeyframes()):[Ya(e,[],[],[],0,le,"",!1)]}visitTrigger(n,e){}visitState(n,e){}visitTransition(n,e){}visitAnimateChild(n,e){let t=e.subInstructions.get(e.element);if(t){let o=e.createSubContext(n.options),r=e.currentTimeline.currentTime,p=this._visitSubInstructions(t,o,o.options);r!=p&&e.transformIntoNewTimeline(p)}e.previousNode=n}visitAnimateRef(n,e){let t=e.createSubContext(n.options);t.transformIntoNewTimeline(),this._applyAnimationRefDelays([n.options,n.animation.options],e,t),this.visitReference(n.animation,t),e.transformIntoNewTimeline(t.currentTimeline.currentTime),e.previousNode=n}_applyAnimationRefDelays(n,e,t){for(let o of n){let r=o?.delay;if(r){let p=typeof r=="number"?r:li(Pn(r,o?.params??{},e.errors));t.delayNextStep(p)}}}_visitSubInstructions(n,e,t){let r=e.currentTimeline.currentTime,p=t.duration!=null?li(t.duration):null,u=t.delay!=null?li(t.delay):null;return p!==0&&n.forEach(v=>{let T=e.appendInstructionToTimeline(v,p,u);r=Math.max(r,T.duration+T.delay)}),r}visitReference(n,e){e.updateOptions(n.options,!0),Ct(this,n.animation,e),e.previousNode=n}visitSequence(n,e){let t=e.subContextCount,o=e,r=n.options;if(r&&(r.params||r.delay)&&(o=e.createSubContext(r),o.transformIntoNewTimeline(),r.delay!=null)){o.previousNode.type==pe.Style&&(o.currentTimeline.snapshotCurrentStyles(),o.previousNode=Rr);let p=li(r.delay);o.delayNextStep(p)}n.steps.length&&(n.steps.forEach(p=>Ct(this,p,o)),o.currentTimeline.applyStylesToKeyframe(),o.subContextCount>t&&o.transformIntoNewTimeline()),e.previousNode=n}visitGroup(n,e){let t=[],o=e.currentTimeline.currentTime,r=n.options&&n.options.delay?li(n.options.delay):0;n.steps.forEach(p=>{let u=e.createSubContext(n.options);r&&u.delayNextStep(r),Ct(this,p,u),o=Math.max(o,u.currentTimeline.currentTime),t.push(u.currentTimeline)}),t.forEach(p=>e.currentTimeline.mergeTimelineCollectedStyles(p)),e.transformIntoNewTimeline(o),e.previousNode=n}_visitTiming(n,e){if(n.dynamic){let t=n.strValue,o=e.params?Pn(t,e.params,e.errors):t;return lo(o,e.errors)}else return{duration:n.duration,delay:n.delay,easing:n.easing}}visitAnimate(n,e){let t=e.currentAnimateTimings=this._visitTiming(n.timings,e),o=e.currentTimeline;t.delay&&(e.incrementTime(t.delay),o.snapshotCurrentStyles());let r=n.style;r.type==pe.Keyframes?this.visitKeyframes(r,e):(e.incrementTime(t.duration),this.visitStyle(r,e),o.applyStylesToKeyframe()),e.currentAnimateTimings=null,e.previousNode=n}visitStyle(n,e){let t=e.currentTimeline,o=e.currentAnimateTimings;!o&&t.hasCurrentStyleProperties()&&t.forwardFrame();let r=o&&o.easing||n.easing;n.isEmptyStep?t.applyEmptyStep(r):t.setStyles(n.styles,r,e.errors,e.options),e.previousNode=n}visitKeyframes(n,e){let t=e.currentAnimateTimings,o=e.currentTimeline.duration,r=t.duration,u=e.createSubContext().currentTimeline;u.easing=t.easing,n.styles.forEach(v=>{let T=v.offset||0;u.forwardTime(T*r),u.setStyles(v.styles,v.easing,e.errors,e.options),u.applyStylesToKeyframe()}),e.currentTimeline.mergeTimelineCollectedStyles(u),e.transformIntoNewTimeline(o+r),e.previousNode=n}visitQuery(n,e){let t=e.currentTimeline.currentTime,o=n.options||{},r=o.delay?li(o.delay):0;r&&(e.previousNode.type===pe.Style||t==0&&e.currentTimeline.hasCurrentStyleProperties())&&(e.currentTimeline.snapshotCurrentStyles(),e.previousNode=Rr);let p=t,u=e.invokeQuery(n.selector,n.originalSelector,n.limit,n.includeSelf,!!o.optional,e.errors);e.currentQueryTotal=u.length;let v=null;u.forEach((T,R)=>{e.currentQueryIndex=R;let O=e.createSubContext(n.options,T);r&&O.delayNextStep(r),T===e.element&&(v=O.currentTimeline),Ct(this,n.animation,O),O.currentTimeline.applyStylesToKeyframe();let le=O.currentTimeline.currentTime;p=Math.max(p,le)}),e.currentQueryIndex=0,e.currentQueryTotal=0,e.transformIntoNewTimeline(p),v&&(e.currentTimeline.mergeTimelineCollectedStyles(v),e.currentTimeline.snapshotCurrentStyles()),e.previousNode=n}visitStagger(n,e){let t=e.parentContext,o=e.currentTimeline,r=n.timings,p=Math.abs(r.duration),u=p*(e.currentQueryTotal-1),v=p*e.currentQueryIndex;switch(r.duration<0?"reverse":r.easing){case"reverse":v=u-v;break;case"full":v=t.currentStaggerTime;break}let R=e.currentTimeline;v&&R.delayNextStep(v);let O=R.currentTime;Ct(this,n.animation,e),e.previousNode=n,t.currentStaggerTime=o.currentTime-O+(o.startTime-t.currentTimeline.startTime)}},Rr={},$a=class i{_driver;element;subInstructions;_enterClassName;_leaveClassName;errors;timelines;parentContext=null;currentTimeline;currentAnimateTimings=null;previousNode=Rr;subContextCount=0;options={};currentQueryIndex=0;currentQueryTotal=0;currentStaggerTime=0;constructor(n,e,t,o,r,p,u,v){this._driver=n,this.element=e,this.subInstructions=t,this._enterClassName=o,this._leaveClassName=r,this.errors=p,this.timelines=u,this.currentTimeline=v||new Nr(this._driver,e,0),u.push(this.currentTimeline)}get params(){return this.options.params}updateOptions(n,e){if(!n)return;let t=n,o=this.options;t.duration!=null&&(o.duration=li(t.duration)),t.delay!=null&&(o.delay=li(t.delay));let r=t.params;if(r){let p=o.params;p||(p=this.options.params={}),Object.keys(r).forEach(u=>{(!e||!p.hasOwnProperty(u))&&(p[u]=Pn(r[u],p,this.errors))})}}_copyOptions(){let n={};if(this.options){let e=this.options.params;if(e){let t=n.params={};Object.keys(e).forEach(o=>{t[o]=e[o]})}}return n}createSubContext(n=null,e,t){let o=e||this.element,r=new i(this._driver,o,this.subInstructions,this._enterClassName,this._leaveClassName,this.errors,this.timelines,this.currentTimeline.fork(o,t||0));return r.previousNode=this.previousNode,r.currentAnimateTimings=this.currentAnimateTimings,r.options=this._copyOptions(),r.updateOptions(n),r.currentQueryIndex=this.currentQueryIndex,r.currentQueryTotal=this.currentQueryTotal,r.parentContext=this,this.subContextCount++,r}transformIntoNewTimeline(n){return this.previousNode=Rr,this.currentTimeline=this.currentTimeline.fork(this.element,n),this.timelines.push(this.currentTimeline),this.currentTimeline}appendInstructionToTimeline(n,e,t){let o={duration:e??n.duration,delay:this.currentTimeline.currentTime+(t??0)+n.delay,easing:""},r=new Ha(this._driver,n.element,n.keyframes,n.preStyleProps,n.postStyleProps,o,n.stretchStartingKeyframe);return this.timelines.push(r),o}incrementTime(n){this.currentTimeline.forwardTime(this.currentTimeline.duration+n)}delayNextStep(n){n>0&&this.currentTimeline.delayNextStep(n)}invokeQuery(n,e,t,o,r,p){let u=[];if(o&&u.push(this.element),n.length>0){n=n.replace(x0,"."+this._enterClassName),n=n.replace(v0,"."+this._leaveClassName);let v=t!=1,T=this._driver.query(this.element,n,v);t!==0&&(T=t<0?T.slice(T.length+t,T.length):T.slice(0,t)),u.push(...T)}return!r&&u.length==0&&p.push(fp(e)),u}},Nr=class i{_driver;element;startTime;_elementTimelineStylesLookup;duration=0;easing=null;_previousKeyframe=new Map;_currentKeyframe=new Map;_keyframes=new Map;_styleSummary=new Map;_localTimelineStyles=new Map;_globalTimelineStyles;_pendingStyles=new Map;_backFill=new Map;_currentEmptyStepKeyframe=null;constructor(n,e,t,o){this._driver=n,this.element=e,this.startTime=t,this._elementTimelineStylesLookup=o,this._elementTimelineStylesLookup||(this._elementTimelineStylesLookup=new Map),this._globalTimelineStyles=this._elementTimelineStylesLookup.get(e),this._globalTimelineStyles||(this._globalTimelineStyles=this._localTimelineStyles,this._elementTimelineStylesLookup.set(e,this._localTimelineStyles)),this._loadKeyframe()}containsAnimation(){switch(this._keyframes.size){case 0:return!1;case 1:return this.hasCurrentStyleProperties();default:return!0}}hasCurrentStyleProperties(){return this._currentKeyframe.size>0}get currentTime(){return this.startTime+this.duration}delayNextStep(n){let e=this._keyframes.size===1&&this._pendingStyles.size;this.duration||e?(this.forwardTime(this.currentTime+n),e&&this.snapshotCurrentStyles()):this.startTime+=n}fork(n,e){return this.applyStylesToKeyframe(),new i(this._driver,n,e||this.currentTime,this._elementTimelineStylesLookup)}_loadKeyframe(){this._currentKeyframe&&(this._previousKeyframe=this._currentKeyframe),this._currentKeyframe=this._keyframes.get(this.duration),this._currentKeyframe||(this._currentKeyframe=new Map,this._keyframes.set(this.duration,this._currentKeyframe))}forwardFrame(){this.duration+=g0,this._loadKeyframe()}forwardTime(n){this.applyStylesToKeyframe(),this.duration=n,this._loadKeyframe()}_updateStyle(n,e){this._localTimelineStyles.set(n,e),this._globalTimelineStyles.set(n,e),this._styleSummary.set(n,{time:this.currentTime,value:e})}allowOnlyTimelineStyles(){return this._currentEmptyStepKeyframe!==this._currentKeyframe}applyEmptyStep(n){n&&this._previousKeyframe.set("easing",n);for(let[e,t]of this._globalTimelineStyles)this._backFill.set(e,t||Gt),this._currentKeyframe.set(e,Gt);this._currentEmptyStepKeyframe=this._currentKeyframe}setStyles(n,e,t,o){e&&this._previousKeyframe.set("easing",e);let r=o&&o.params||{},p=y0(n,this._globalTimelineStyles);for(let[u,v]of p){let T=Pn(v,r,t);this._pendingStyles.set(u,T),this._localTimelineStyles.has(u)||this._backFill.set(u,this._globalTimelineStyles.get(u)??Gt),this._updateStyle(u,T)}}applyStylesToKeyframe(){this._pendingStyles.size!=0&&(this._pendingStyles.forEach((n,e)=>{this._currentKeyframe.set(e,n)}),this._pendingStyles.clear(),this._localTimelineStyles.forEach((n,e)=>{this._currentKeyframe.has(e)||this._currentKeyframe.set(e,n)}))}snapshotCurrentStyles(){for(let[n,e]of this._localTimelineStyles)this._pendingStyles.set(n,e),this._updateStyle(n,e)}getFinalKeyframe(){return this._keyframes.get(this.duration)}get properties(){let n=[];for(let e in this._currentKeyframe)n.push(e);return n}mergeTimelineCollectedStyles(n){n._styleSummary.forEach((e,t)=>{let o=this._styleSummary.get(t);(!o||e.time>o.time)&&this._updateStyle(t,e.value)})}buildKeyframes(){this.applyStylesToKeyframe();let n=new Set,e=new Set,t=this._keyframes.size===1&&this.duration===0,o=[];this._keyframes.forEach((u,v)=>{let T=new Map([...this._backFill,...u]);T.forEach((R,O)=>{R===Yn?n.add(O):R===Gt&&e.add(O)}),t||T.set("offset",v/this.duration),o.push(T)});let r=[...n.values()],p=[...e.values()];if(t){let u=o[0],v=new Map(u);u.set("offset",0),v.set("offset",1),o=[u,v]}return Ya(this.element,o,r,p,this.duration,this.startTime,this.easing,!1)}},Ha=class extends Nr{keyframes;preStyleProps;postStyleProps;_stretchStartingKeyframe;timings;constructor(n,e,t,o,r,p,u=!1){super(n,e,p.delay),this.keyframes=t,this.preStyleProps=o,this.postStyleProps=r,this._stretchStartingKeyframe=u,this.timings={duration:p.duration,delay:p.delay,easing:p.easing}}containsAnimation(){return this.keyframes.length>1}buildKeyframes(){let n=this.keyframes,{delay:e,duration:t,easing:o}=this.timings;if(this._stretchStartingKeyframe&&e){let r=[],p=t+e,u=e/p,v=new Map(n[0]);v.set("offset",0),r.push(v);let T=new Map(n[0]);T.set("offset",Vp(u)),r.push(T);let R=n.length-1;for(let O=1;O<=R;O++){let le=new Map(n[O]),Y=le.get("offset"),W=e+Y*t;le.set("offset",Vp(W/p)),r.push(le)}t=p,e=0,o="",n=r}return Ya(this.element,n,this.preStyleProps,this.postStyleProps,t,e,o,!0)}};function Vp(i,n=3){let e=Math.pow(10,n-1);return Math.round(i*e)/e}function y0(i,n){let e=new Map,t;return i.forEach(o=>{if(o==="*"){t??=n.keys();for(let r of t)e.set(r,Gt)}else for(let[r,p]of o)e.set(r,p)}),e}function Op(i,n,e,t,o,r,p,u,v,T,R,O,le){return{type:0,element:i,triggerName:n,isRemovalTransition:o,fromState:e,fromStyles:r,toState:t,toStyles:p,timelines:u,queriedElements:v,preStyleProps:T,postStyleProps:R,totalTime:O,errors:le}}var Ra={},Vr=class{_triggerName;ast;_stateStyles;constructor(n,e,t){this._triggerName=n,this.ast=e,this._stateStyles=t}match(n,e,t,o){return b0(this.ast.matchers,n,e,t,o)}buildStyles(n,e,t){let o=this._stateStyles.get("*");return n!==void 0&&(o=this._stateStyles.get(n?.toString())||o),o?o.buildStyles(e,t):new Map}build(n,e,t,o,r,p,u,v,T,R){let O=[],le=this.ast.options&&this.ast.options.params||Ra,Y=u&&u.params||Ra,W=this.buildStyles(t,Y,O),ne=v&&v.params||Ra,be=this.buildStyles(o,ne,O),Be=new Set,Ue=new Map,ot=new Map,Ye=o==="void",en={params:Kp(ne,le),delay:this.ast.options?.delay},Qt=R?[]:jp(n,e,this.ast.animation,r,p,W,be,en,T,O),rt=0;return Qt.forEach(lt=>{rt=Math.max(lt.duration+lt.delay,rt)}),O.length?Op(e,this._triggerName,t,o,Ye,W,be,[],[],Ue,ot,rt,O):(Qt.forEach(lt=>{let Li=lt.element,tn=gt(Ue,Li,new Set);lt.preStyleProps.forEach(Bi=>tn.add(Bi));let rs=gt(ot,Li,new Set);lt.postStyleProps.forEach(Bi=>rs.add(Bi)),Li!==e&&Be.add(Li)}),Op(e,this._triggerName,t,o,Ye,W,be,Qt,[...Be.values()],Ue,ot,rt))}};function b0(i,n,e,t,o){return i.some(r=>r(n,e,t,o))}function Kp(i,n){let e=re({},n);return Object.entries(i).forEach(([t,o])=>{o!=null&&(e[t]=o)}),e}var za=class{styles;defaultParams;normalizer;constructor(n,e,t){this.styles=n,this.defaultParams=e,this.normalizer=t}buildStyles(n,e){let t=new Map,o=Kp(n,this.defaultParams);return this.styles.styles.forEach(r=>{typeof r!="string"&&r.forEach((p,u)=>{p&&(p=Pn(p,o,e));let v=this.normalizer.normalizePropertyName(u,e);p=this.normalizer.normalizeStyleValue(u,v,p,e),t.set(u,p)})}),t}};function w0(i,n,e){return new Ga(i,n,e)}var Ga=class{name;ast;_normalizer;transitionFactories=[];fallbackTransition;states=new Map;constructor(n,e,t){this.name=n,this.ast=e,this._normalizer=t,e.states.forEach(o=>{let r=o.options&&o.options.params||{};this.states.set(o.name,new za(o.style,r,t))}),Lp(this.states,"true","1"),Lp(this.states,"false","0"),e.transitions.forEach(o=>{this.transitionFactories.push(new Vr(n,o,this.states))}),this.fallbackTransition=T0(n,this.states)}get containsQueries(){return this.ast.queryCount>0}matchTransition(n,e,t,o){return this.transitionFactories.find(p=>p.match(n,e,t,o))||null}matchStyles(n,e,t){return this.fallbackTransition.buildStyles(n,e,t)}};function T0(i,n,e){let t=[(p,u)=>!0],o={type:pe.Sequence,steps:[],options:null},r={type:pe.Transition,animation:o,matchers:t,options:null,queryCount:0,depCount:0};return new Vr(i,r,n)}function Lp(i,n,e){i.has(n)?i.has(e)||i.set(e,i.get(n)):i.has(e)&&i.set(n,i.get(e))}var E0=new po,Wa=class{bodyNode;_driver;_normalizer;_animations=new Map;_playersById=new Map;players=[];constructor(n,e,t){this.bodyNode=n,this._driver=e,this._normalizer=t}register(n,e){let t=[],o=[],r=Wp(this._driver,e,t,o);if(t.length)throw xp(t);this._animations.set(n,r)}_buildPlayer(n,e,t){let o=n.element,r=Ta(this._normalizer,n.keyframes,e,t);return this._driver.animate(o,r,n.duration,n.delay,n.easing,[],!0)}create(n,e,t={}){let o=[],r=this._animations.get(n),p,u=new Map;if(r?(p=jp(this._driver,e,r,Ma,wr,new Map,new Map,t,E0,o),p.forEach(R=>{let O=gt(u,R.element,new Map);R.postStyleProps.forEach(le=>O.set(le,null))})):(o.push(Sp()),p=[]),o.length)throw vp(o);u.forEach((R,O)=>{R.forEach((le,Y)=>{R.set(Y,this._driver.computeStyle(O,Y,Gt))})});let v=p.map(R=>{let O=u.get(R.element);return this._buildPlayer(R,new Map,O)}),T=mi(v);return this._playersById.set(n,T),T.onDestroy(()=>this.destroy(n)),this.players.push(T),T}destroy(n){let e=this._getPlayer(n);e.destroy(),this._playersById.delete(n);let t=this.players.indexOf(e);t>=0&&this.players.splice(t,1)}_getPlayer(n){let e=this._playersById.get(n);if(!e)throw yp(n);return e}listen(n,e,t,o){let r=yr(e,"","","");return vr(this._getPlayer(n),t,r,o),()=>{}}command(n,e,t,o){if(t=="register"){this.register(n,o[0]);return}if(t=="create"){let p=o[0]||{};this.create(n,e,p);return}let r=this._getPlayer(n);switch(t){case"play":r.play();break;case"pause":r.pause();break;case"reset":r.reset();break;case"restart":r.restart();break;case"finish":r.finish();break;case"init":r.init();break;case"setPosition":r.setPosition(parseFloat(o[0]));break;case"destroy":this.destroy(n);break}}},Bp="ng-animate-queued",A0=".ng-animate-queued",Na="ng-animate-disabled",k0=".ng-animate-disabled",D0="ng-star-inserted",M0=".ng-star-inserted",F0=[],qp={namespaceId:"",setForRemoval:!1,setForMove:!1,hasAnimation:!1,removedBeforeQueried:!1},P0={namespaceId:"",setForMove:!1,setForRemoval:!1,hasAnimation:!1,removedBeforeQueried:!0},Kt="__ng_removed",mo=class{namespaceId;value;options;get params(){return this.options.params}constructor(n,e=""){this.namespaceId=e;let t=n&&n.hasOwnProperty("value"),o=t?n.value:n;if(this.value=R0(o),t){let r=n,{value:p}=r,u=cs(r,["value"]);this.options=u}else this.options={};this.options.params||(this.options.params={})}absorbOptions(n){let e=n.params;if(e){let t=this.options.params;Object.keys(e).forEach(o=>{t[o]==null&&(t[o]=e[o])})}}},co="void",Va=new mo(co),ja=class{id;hostElement;_engine;players=[];_triggers=new Map;_queue=[];_elementListeners=new Map;_hostClassName;constructor(n,e,t){this.id=n,this.hostElement=e,this._engine=t,this._hostClassName="ng-tns-"+n,Ut(e,this._hostClassName)}listen(n,e,t,o){if(!this._triggers.has(e))throw bp(t,e);if(t==null||t.length==0)throw wp(e);if(!N0(t))throw Tp(t,e);let r=gt(this._elementListeners,n,[]),p={name:e,phase:t,callback:o};r.push(p);let u=gt(this._engine.statesByElement,n,new Map);return u.has(e)||(Ut(n,ao),Ut(n,ao+"-"+e),u.set(e,Va)),()=>{this._engine.afterFlush(()=>{let v=r.indexOf(p);v>=0&&r.splice(v,1),this._triggers.has(e)||u.delete(e)})}}register(n,e){return this._triggers.has(n)?!1:(this._triggers.set(n,e),!0)}_getTrigger(n){let e=this._triggers.get(n);if(!e)throw Ep(n);return e}trigger(n,e,t,o=!0){let r=this._getTrigger(e),p=new uo(this.id,e,n),u=this._engine.statesByElement.get(n);u||(Ut(n,ao),Ut(n,ao+"-"+e),this._engine.statesByElement.set(n,u=new Map));let v=u.get(e),T=new mo(t,this.id);if(!(t&&t.hasOwnProperty("value"))&&v&&T.absorbOptions(v.options),u.set(e,T),v||(v=Va),!(T.value===co)&&v.value===T.value){if(!L0(v.params,T.params)){let ne=[],be=r.matchStyles(v.value,v.params,ne),Be=r.matchStyles(T.value,T.params,ne);ne.length?this._engine.reportError(ne):this._engine.afterFlush(()=>{Ii(n,be),jt(n,Be)})}return}let le=gt(this._engine.playersByElement,n,[]);le.forEach(ne=>{ne.namespaceId==this.id&&ne.triggerName==e&&ne.queued&&ne.destroy()});let Y=r.matchTransition(v.value,T.value,n,T.params),W=!1;if(!Y){if(!o)return;Y=r.fallbackTransition,W=!0}return this._engine.totalQueuedPlayers++,this._queue.push({element:n,triggerName:e,transition:Y,fromState:v,toState:T,player:p,isFallbackTransition:W}),W||(Ut(n,Bp),p.onStart(()=>{In(n,Bp)})),p.onDone(()=>{let ne=this.players.indexOf(p);ne>=0&&this.players.splice(ne,1);let be=this._engine.playersByElement.get(n);if(be){let Be=be.indexOf(p);Be>=0&&be.splice(Be,1)}}),this.players.push(p),le.push(p),p}deregister(n){this._triggers.delete(n),this._engine.statesByElement.forEach(e=>e.delete(n)),this._elementListeners.forEach((e,t)=>{this._elementListeners.set(t,e.filter(o=>o.name!=n))})}clearElementCache(n){this._engine.statesByElement.delete(n),this._elementListeners.delete(n);let e=this._engine.playersByElement.get(n);e&&(e.forEach(t=>t.destroy()),this._engine.playersByElement.delete(n))}_signalRemovalForInnerTriggers(n,e){let t=this._engine.driver.query(n,so,!0);t.forEach(o=>{if(o[Kt])return;let r=this._engine.fetchNamespacesByElement(o);r.size?r.forEach(p=>p.triggerLeaveAnimation(o,e,!1,!0)):this.clearElementCache(o)}),this._engine.afterFlushAnimationsDone(()=>t.forEach(o=>this.clearElementCache(o)))}triggerLeaveAnimation(n,e,t,o){let r=this._engine.statesByElement.get(n),p=new Map;if(r){let u=[];if(r.forEach((v,T)=>{if(p.set(T,v.value),this._triggers.has(T)){let R=this.trigger(n,T,co,o);R&&u.push(R)}}),u.length)return this._engine.markElementAsRemoved(this.id,n,!0,e,p),t&&mi(u).onDone(()=>this._engine.processLeaveNode(n)),!0}return!1}prepareLeaveAnimationListeners(n){let e=this._elementListeners.get(n),t=this._engine.statesByElement.get(n);if(e&&t){let o=new Set;e.forEach(r=>{let p=r.name;if(o.has(p))return;o.add(p);let v=this._triggers.get(p).fallbackTransition,T=t.get(p)||Va,R=new mo(co),O=new uo(this.id,p,n);this._engine.totalQueuedPlayers++,this._queue.push({element:n,triggerName:p,transition:v,fromState:T,toState:R,player:O,isFallbackTransition:!0})})}}removeNode(n,e){let t=this._engine;if(n.childElementCount&&this._signalRemovalForInnerTriggers(n,e),this.triggerLeaveAnimation(n,e,!0))return;let o=!1;if(t.totalAnimations){let r=t.players.length?t.playersByQueriedElement.get(n):[];if(r&&r.length)o=!0;else{let p=n;for(;p=p.parentNode;)if(t.statesByElement.get(p)){o=!0;break}}}if(this.prepareLeaveAnimationListeners(n),o)t.markElementAsRemoved(this.id,n,!1,e);else{let r=n[Kt];(!r||r===qp)&&(t.afterFlush(()=>this.clearElementCache(n)),t.destroyInnerAnimations(n),t._onRemovalComplete(n,e))}}insertNode(n,e){Ut(n,this._hostClassName)}drainQueuedTransitions(n){let e=[];return this._queue.forEach(t=>{let o=t.player;if(o.destroyed)return;let r=t.element,p=this._elementListeners.get(r);p&&p.forEach(u=>{if(u.name==t.triggerName){let v=yr(r,t.triggerName,t.fromState.value,t.toState.value);v._data=n,vr(t.player,u.phase,v,u.callback)}}),o.markedForDestroy?this._engine.afterFlush(()=>{o.destroy()}):e.push(t)}),this._queue=[],e.sort((t,o)=>{let r=t.transition.ast.depCount,p=o.transition.ast.depCount;return r==0||p==0?r-p:this._engine.driver.containsElement(t.element,o.element)?1:-1})}destroy(n){this.players.forEach(e=>e.destroy()),this._signalRemovalForInnerTriggers(this.hostElement,n)}},Ka=class{bodyNode;driver;_normalizer;players=[];newHostElements=new Map;playersByElement=new Map;playersByQueriedElement=new Map;statesByElement=new Map;disabledNodes=new Set;totalAnimations=0;totalQueuedPlayers=0;_namespaceLookup={};_namespaceList=[];_flushFns=[];_whenQuietFns=[];namespacesByHostElement=new Map;collectedEnterElements=[];collectedLeaveElements=[];onRemovalComplete=(n,e)=>{};_onRemovalComplete(n,e){this.onRemovalComplete(n,e)}constructor(n,e,t){this.bodyNode=n,this.driver=e,this._normalizer=t}get queuedPlayers(){let n=[];return this._namespaceList.forEach(e=>{e.players.forEach(t=>{t.queued&&n.push(t)})}),n}createNamespace(n,e){let t=new ja(n,e,this);return this.bodyNode&&this.driver.containsElement(this.bodyNode,e)?this._balanceNamespaceList(t,e):(this.newHostElements.set(e,t),this.collectEnterElement(e)),this._namespaceLookup[n]=t}_balanceNamespaceList(n,e){let t=this._namespaceList,o=this.namespacesByHostElement;if(t.length-1>=0){let p=!1,u=this.driver.getParentElement(e);for(;u;){let v=o.get(u);if(v){let T=t.indexOf(v);t.splice(T+1,0,n),p=!0;break}u=this.driver.getParentElement(u)}p||t.unshift(n)}else t.push(n);return o.set(e,n),n}register(n,e){let t=this._namespaceLookup[n];return t||(t=this.createNamespace(n,e)),t}registerTrigger(n,e,t){let o=this._namespaceLookup[n];o&&o.register(e,t)&&this.totalAnimations++}destroy(n,e){n&&(this.afterFlush(()=>{}),this.afterFlushAnimationsDone(()=>{let t=this._fetchNamespace(n);this.namespacesByHostElement.delete(t.hostElement);let o=this._namespaceList.indexOf(t);o>=0&&this._namespaceList.splice(o,1),t.destroy(e),delete this._namespaceLookup[n]}))}_fetchNamespace(n){return this._namespaceLookup[n]}fetchNamespacesByElement(n){let e=new Set,t=this.statesByElement.get(n);if(t){for(let o of t.values())if(o.namespaceId){let r=this._fetchNamespace(o.namespaceId);r&&e.add(r)}}return e}trigger(n,e,t,o){if(Mr(e)){let r=this._fetchNamespace(n);if(r)return r.trigger(e,t,o),!0}return!1}insertNode(n,e,t,o){if(!Mr(e))return;let r=e[Kt];if(r&&r.setForRemoval){r.setForRemoval=!1,r.setForMove=!0;let p=this.collectedLeaveElements.indexOf(e);p>=0&&this.collectedLeaveElements.splice(p,1)}if(n){let p=this._fetchNamespace(n);p&&p.insertNode(e,t)}o&&this.collectEnterElement(e)}collectEnterElement(n){this.collectedEnterElements.push(n)}markElementAsDisabled(n,e){e?this.disabledNodes.has(n)||(this.disabledNodes.add(n),Ut(n,Na)):this.disabledNodes.has(n)&&(this.disabledNodes.delete(n),In(n,Na))}removeNode(n,e,t){if(Mr(e)){let o=n?this._fetchNamespace(n):null;o?o.removeNode(e,t):this.markElementAsRemoved(n,e,!1,t);let r=this.namespacesByHostElement.get(e);r&&r.id!==n&&r.removeNode(e,t)}else this._onRemovalComplete(e,t)}markElementAsRemoved(n,e,t,o,r){this.collectedLeaveElements.push(e),e[Kt]={namespaceId:n,setForRemoval:o,hasAnimation:t,removedBeforeQueried:!1,previousTriggersValues:r}}listen(n,e,t,o,r){return Mr(e)?this._fetchNamespace(n).listen(e,t,o,r):()=>{}}_buildInstruction(n,e,t,o,r){return n.transition.build(this.driver,n.element,n.fromState.value,n.toState.value,t,o,n.fromState.options,n.toState.options,e,r)}destroyInnerAnimations(n){let e=this.driver.query(n,so,!0);e.forEach(t=>this.destroyActiveAnimationsForElement(t)),this.playersByQueriedElement.size!=0&&(e=this.driver.query(n,Tr,!0),e.forEach(t=>this.finishActiveQueriedAnimationOnElement(t)))}destroyActiveAnimationsForElement(n){let e=this.playersByElement.get(n);e&&e.forEach(t=>{t.queued?t.markedForDestroy=!0:t.destroy()})}finishActiveQueriedAnimationOnElement(n){let e=this.playersByQueriedElement.get(n);e&&e.forEach(t=>t.finish())}whenRenderingDone(){return new Promise(n=>{if(this.players.length)return mi(this.players).onDone(()=>n());n()})}processLeaveNode(n){let e=n[Kt];if(e&&e.setForRemoval){if(n[Kt]=qp,e.namespaceId){this.destroyInnerAnimations(n);let t=this._fetchNamespace(e.namespaceId);t&&t.clearElementCache(n)}this._onRemovalComplete(n,e.setForRemoval)}n.classList?.contains(Na)&&this.markElementAsDisabled(n,!1),this.driver.query(n,k0,!0).forEach(t=>{this.markElementAsDisabled(t,!1)})}flush(n=-1){let e=[];if(this.newHostElements.size&&(this.newHostElements.forEach((t,o)=>this._balanceNamespaceList(t,o)),this.newHostElements.clear()),this.totalAnimations&&this.collectedEnterElements.length)for(let t=0;t<this.collectedEnterElements.length;t++){let o=this.collectedEnterElements[t];Ut(o,D0)}if(this._namespaceList.length&&(this.totalQueuedPlayers||this.collectedLeaveElements.length)){let t=[];try{e=this._flushAnimations(t,n)}finally{for(let o=0;o<t.length;o++)t[o]()}}else for(let t=0;t<this.collectedLeaveElements.length;t++){let o=this.collectedLeaveElements[t];this.processLeaveNode(o)}if(this.totalQueuedPlayers=0,this.collectedEnterElements.length=0,this.collectedLeaveElements.length=0,this._flushFns.forEach(t=>t()),this._flushFns=[],this._whenQuietFns.length){let t=this._whenQuietFns;this._whenQuietFns=[],e.length?mi(e).onDone(()=>{t.forEach(o=>o())}):t.forEach(o=>o())}}reportError(n){throw Ap(n)}_flushAnimations(n,e){let t=new po,o=[],r=new Map,p=[],u=new Map,v=new Map,T=new Map,R=new Set;this.disabledNodes.forEach(H=>{R.add(H);let Q=this.driver.query(H,A0,!0);for(let ee=0;ee<Q.length;ee++)R.add(Q[ee])});let O=this.bodyNode,le=Array.from(this.statesByElement.keys()),Y=Hp(le,this.collectedEnterElements),W=new Map,ne=0;Y.forEach((H,Q)=>{let ee=Ma+ne++;W.set(Q,ee),H.forEach(he=>Ut(he,ee))});let be=[],Be=new Set,Ue=new Set;for(let H=0;H<this.collectedLeaveElements.length;H++){let Q=this.collectedLeaveElements[H],ee=Q[Kt];ee&&ee.setForRemoval&&(be.push(Q),Be.add(Q),ee.hasAnimation?this.driver.query(Q,M0,!0).forEach(he=>Be.add(he)):Ue.add(Q))}let ot=new Map,Ye=Hp(le,Array.from(Be));Ye.forEach((H,Q)=>{let ee=wr+ne++;ot.set(Q,ee),H.forEach(he=>Ut(he,ee))}),n.push(()=>{Y.forEach((H,Q)=>{let ee=W.get(Q);H.forEach(he=>In(he,ee))}),Ye.forEach((H,Q)=>{let ee=ot.get(Q);H.forEach(he=>In(he,ee))}),be.forEach(H=>{this.processLeaveNode(H)})});let en=[],Qt=[];for(let H=this._namespaceList.length-1;H>=0;H--)this._namespaceList[H].drainQueuedTransitions(e).forEach(ee=>{let he=ee.player,$e=ee.element;if(en.push(he),this.collectedEnterElements.length){let Xe=$e[Kt];if(Xe&&Xe.setForMove){if(Xe.previousTriggersValues&&Xe.previousTriggersValues.has(ee.triggerName)){let Ui=Xe.previousTriggersValues.get(ee.triggerName),Et=this.statesByElement.get(ee.element);if(Et&&Et.has(ee.triggerName)){let xo=Et.get(ee.triggerName);xo.value=Ui,Et.set(ee.triggerName,xo)}}he.destroy();return}}let Yt=!O||!this.driver.containsElement(O,$e),vt=ot.get($e),_i=W.get($e),Ae=this._buildInstruction(ee,t,_i,vt,Yt);if(Ae.errors&&Ae.errors.length){Qt.push(Ae);return}if(Yt){he.onStart(()=>Ii($e,Ae.fromStyles)),he.onDestroy(()=>jt($e,Ae.toStyles)),o.push(he);return}if(ee.isFallbackTransition){he.onStart(()=>Ii($e,Ae.fromStyles)),he.onDestroy(()=>jt($e,Ae.toStyles)),o.push(he);return}let ls=[];Ae.timelines.forEach(Xe=>{Xe.stretchStartingKeyframe=!0,this.disabledNodes.has(Xe.element)||ls.push(Xe)}),Ae.timelines=ls,t.append($e,Ae.timelines);let Km={instruction:Ae,player:he,element:$e};p.push(Km),Ae.queriedElements.forEach(Xe=>gt(u,Xe,[]).push(he)),Ae.preStyleProps.forEach((Xe,Ui)=>{if(Xe.size){let Et=v.get(Ui);Et||v.set(Ui,Et=new Set),Xe.forEach((xo,aa)=>Et.add(aa))}}),Ae.postStyleProps.forEach((Xe,Ui)=>{let Et=T.get(Ui);Et||T.set(Ui,Et=new Set),Xe.forEach((xo,aa)=>Et.add(aa))})});if(Qt.length){let H=[];Qt.forEach(Q=>{H.push(kp(Q.triggerName,Q.errors))}),en.forEach(Q=>Q.destroy()),this.reportError(H)}let rt=new Map,lt=new Map;p.forEach(H=>{let Q=H.element;t.has(Q)&&(lt.set(Q,Q),this._beforeAnimationBuild(H.player.namespaceId,H.instruction,rt))}),o.forEach(H=>{let Q=H.element;this._getPreviousPlayers(Q,!1,H.namespaceId,H.triggerName,null).forEach(he=>{gt(rt,Q,[]).push(he),he.destroy()})});let Li=be.filter(H=>zp(H,v,T)),tn=new Map;$p(tn,this.driver,Ue,T,Gt).forEach(H=>{zp(H,v,T)&&Li.push(H)});let Bi=new Map;Y.forEach((H,Q)=>{$p(Bi,this.driver,new Set(H),v,Yn)}),Li.forEach(H=>{let Q=tn.get(H),ee=Bi.get(H);tn.set(H,new Map([...Q?.entries()??[],...ee?.entries()??[]]))});let ra=[],as=[],ss={};p.forEach(H=>{let{element:Q,player:ee,instruction:he}=H;if(t.has(Q)){if(R.has(Q)){ee.onDestroy(()=>jt(Q,he.toStyles)),ee.disabled=!0,ee.overrideTotalTime(he.totalTime),o.push(ee);return}let $e=ss;if(lt.size>1){let vt=Q,_i=[];for(;vt=vt.parentNode;){let Ae=lt.get(vt);if(Ae){$e=Ae;break}_i.push(vt)}_i.forEach(Ae=>lt.set(Ae,$e))}let Yt=this._buildAnimation(ee.namespaceId,he,rt,r,Bi,tn);if(ee.setRealPlayer(Yt),$e===ss)ra.push(ee);else{let vt=this.playersByElement.get($e);vt&&vt.length&&(ee.parentPlayer=mi(vt)),o.push(ee)}}else Ii(Q,he.fromStyles),ee.onDestroy(()=>jt(Q,he.toStyles)),as.push(ee),R.has(Q)&&o.push(ee)}),as.forEach(H=>{let Q=r.get(H.element);if(Q&&Q.length){let ee=mi(Q);H.setRealPlayer(ee)}}),o.forEach(H=>{H.parentPlayer?H.syncPlayerEvents(H.parentPlayer):H.destroy()});for(let H=0;H<be.length;H++){let Q=be[H],ee=Q[Kt];if(In(Q,wr),ee&&ee.hasAnimation)continue;let he=[];if(u.size){let Yt=u.get(Q);Yt&&Yt.length&&he.push(...Yt);let vt=this.driver.query(Q,Tr,!0);for(let _i=0;_i<vt.length;_i++){let Ae=u.get(vt[_i]);Ae&&Ae.length&&he.push(...Ae)}}let $e=he.filter(Yt=>!Yt.destroyed);$e.length?V0(this,Q,$e):this.processLeaveNode(Q)}return be.length=0,ra.forEach(H=>{this.players.push(H),H.onDone(()=>{H.destroy();let Q=this.players.indexOf(H);this.players.splice(Q,1)}),H.play()}),ra}afterFlush(n){this._flushFns.push(n)}afterFlushAnimationsDone(n){this._whenQuietFns.push(n)}_getPreviousPlayers(n,e,t,o,r){let p=[];if(e){let u=this.playersByQueriedElement.get(n);u&&(p=u)}else{let u=this.playersByElement.get(n);if(u){let v=!r||r==co;u.forEach(T=>{T.queued||!v&&T.triggerName!=o||p.push(T)})}}return(t||o)&&(p=p.filter(u=>!(t&&t!=u.namespaceId||o&&o!=u.triggerName))),p}_beforeAnimationBuild(n,e,t){let o=e.triggerName,r=e.element,p=e.isRemovalTransition?void 0:n,u=e.isRemovalTransition?void 0:o;for(let v of e.timelines){let T=v.element,R=T!==r,O=gt(t,T,[]);this._getPreviousPlayers(T,R,p,u,e.toState).forEach(Y=>{let W=Y.getRealPlayer();W.beforeDestroy&&W.beforeDestroy(),Y.destroy(),O.push(Y)})}Ii(r,e.fromStyles)}_buildAnimation(n,e,t,o,r,p){let u=e.triggerName,v=e.element,T=[],R=new Set,O=new Set,le=e.timelines.map(W=>{let ne=W.element;R.add(ne);let be=ne[Kt];if(be&&be.removedBeforeQueried)return new Gi(W.duration,W.delay);let Be=ne!==v,Ue=O0((t.get(ne)||F0).map(rt=>rt.getRealPlayer())).filter(rt=>{let lt=rt;return lt.element?lt.element===ne:!1}),ot=r.get(ne),Ye=p.get(ne),en=Ta(this._normalizer,W.keyframes,ot,Ye),Qt=this._buildPlayer(W,en,Ue);if(W.subTimeline&&o&&O.add(ne),Be){let rt=new uo(n,u,ne);rt.setRealPlayer(Qt),T.push(rt)}return Qt});T.forEach(W=>{gt(this.playersByQueriedElement,W.element,[]).push(W),W.onDone(()=>I0(this.playersByQueriedElement,W.element,W))}),R.forEach(W=>Ut(W,Fa));let Y=mi(le);return Y.onDestroy(()=>{R.forEach(W=>In(W,Fa)),jt(v,e.toStyles)}),O.forEach(W=>{gt(o,W,[]).push(Y)}),Y}_buildPlayer(n,e,t){return e.length>0?this.driver.animate(n.element,e,n.duration,n.delay,n.easing,t):new Gi(n.duration,n.delay)}},uo=class{namespaceId;triggerName;element;_player=new Gi;_containsRealPlayer=!1;_queuedCallbacks=new Map;destroyed=!1;parentPlayer=null;markedForDestroy=!1;disabled=!1;queued=!0;totalTime=0;constructor(n,e,t){this.namespaceId=n,this.triggerName=e,this.element=t}setRealPlayer(n){this._containsRealPlayer||(this._player=n,this._queuedCallbacks.forEach((e,t)=>{e.forEach(o=>vr(n,t,void 0,o))}),this._queuedCallbacks.clear(),this._containsRealPlayer=!0,this.overrideTotalTime(n.totalTime),this.queued=!1)}getRealPlayer(){return this._player}overrideTotalTime(n){this.totalTime=n}syncPlayerEvents(n){let e=this._player;e.triggerCallback&&n.onStart(()=>e.triggerCallback("start")),n.onDone(()=>this.finish()),n.onDestroy(()=>this.destroy())}_queueEvent(n,e){gt(this._queuedCallbacks,n,[]).push(e)}onDone(n){this.queued&&this._queueEvent("done",n),this._player.onDone(n)}onStart(n){this.queued&&this._queueEvent("start",n),this._player.onStart(n)}onDestroy(n){this.queued&&this._queueEvent("destroy",n),this._player.onDestroy(n)}init(){this._player.init()}hasStarted(){return this.queued?!1:this._player.hasStarted()}play(){!this.queued&&this._player.play()}pause(){!this.queued&&this._player.pause()}restart(){!this.queued&&this._player.restart()}finish(){this._player.finish()}destroy(){this.destroyed=!0,this._player.destroy()}reset(){!this.queued&&this._player.reset()}setPosition(n){this.queued||this._player.setPosition(n)}getPosition(){return this.queued?0:this._player.getPosition()}triggerCallback(n){let e=this._player;e.triggerCallback&&e.triggerCallback(n)}};function I0(i,n,e){let t=i.get(n);if(t){if(t.length){let o=t.indexOf(e);t.splice(o,1)}t.length==0&&i.delete(n)}return t}function R0(i){return i??null}function Mr(i){return i&&i.nodeType===1}function N0(i){return i=="start"||i=="done"}function Up(i,n){let e=i.style.display;return i.style.display=n??"none",e}function $p(i,n,e,t,o){let r=[];e.forEach(v=>r.push(Up(v)));let p=[];t.forEach((v,T)=>{let R=new Map;v.forEach(O=>{let le=n.computeStyle(T,O,o);R.set(O,le),(!le||le.length==0)&&(T[Kt]=P0,p.push(T))}),i.set(T,R)});let u=0;return e.forEach(v=>Up(v,r[u++])),p}function Hp(i,n){let e=new Map;if(i.forEach(u=>e.set(u,[])),n.length==0)return e;let t=1,o=new Set(n),r=new Map;function p(u){if(!u)return t;let v=r.get(u);if(v)return v;let T=u.parentNode;return e.has(T)?v=T:o.has(T)?v=t:v=p(T),r.set(u,v),v}return n.forEach(u=>{let v=p(u);v!==t&&e.get(v).push(u)}),e}function Ut(i,n){i.classList?.add(n)}function In(i,n){i.classList?.remove(n)}function V0(i,n,e){mi(e).onDone(()=>i.processLeaveNode(n))}function O0(i){let n=[];return Qp(i,n),n}function Qp(i,n){for(let e=0;e<i.length;e++){let t=i[e];t instanceof Mo?Qp(t.players,n):n.push(t)}}function L0(i,n){let e=Object.keys(i),t=Object.keys(n);if(e.length!=t.length)return!1;for(let o=0;o<e.length;o++){let r=e[o];if(!n.hasOwnProperty(r)||i[r]!==n[r])return!1}return!0}function zp(i,n,e){let t=e.get(i);if(!t)return!1;let o=n.get(i);return o?t.forEach(r=>o.add(r)):n.set(i,t),e.delete(i),!0}var Rn=class{_driver;_normalizer;_transitionEngine;_timelineEngine;_triggerCache={};onRemovalComplete=(n,e)=>{};constructor(n,e,t){this._driver=e,this._normalizer=t,this._transitionEngine=new Ka(n.body,e,t),this._timelineEngine=new Wa(n.body,e,t),this._transitionEngine.onRemovalComplete=(o,r)=>this.onRemovalComplete(o,r)}registerTrigger(n,e,t,o,r){let p=n+"-"+o,u=this._triggerCache[p];if(!u){let v=[],T=[],R=Wp(this._driver,r,v,T);if(v.length)throw Cp(o,v);u=w0(o,R,this._normalizer),this._triggerCache[p]=u}this._transitionEngine.registerTrigger(e,o,u)}register(n,e){this._transitionEngine.register(n,e)}destroy(n,e){this._transitionEngine.destroy(n,e)}onInsert(n,e,t,o){this._transitionEngine.insertNode(n,e,t,o)}onRemove(n,e,t){this._transitionEngine.removeNode(n,e,t)}disableAnimations(n,e){this._transitionEngine.markElementAsDisabled(n,e)}process(n,e,t,o){if(t.charAt(0)=="@"){let[r,p]=Ea(t),u=o;this._timelineEngine.command(r,e,p,u)}else this._transitionEngine.trigger(n,e,t,o)}listen(n,e,t,o,r){if(t.charAt(0)=="@"){let[p,u]=Ea(t);return this._timelineEngine.listen(p,e,u,r)}return this._transitionEngine.listen(n,e,t,o,r)}flush(n=-1){this._transitionEngine.flush(n)}get players(){return[...this._transitionEngine.players,...this._timelineEngine.players]}whenRenderingDone(){return this._transitionEngine.whenRenderingDone()}afterFlushAnimationsDone(n){this._transitionEngine.afterFlushAnimationsDone(n)}};function B0(i,n){let e=null,t=null;return Array.isArray(n)&&n.length?(e=Oa(n[0]),n.length>1&&(t=Oa(n[n.length-1]))):n instanceof Map&&(e=Oa(n)),e||t?new U0(i,e,t):null}var U0=(()=>{class i{_element;_startStyles;_endStyles;static initialStylesByElement=new WeakMap;_state=0;_initialStyles;constructor(e,t,o){this._element=e,this._startStyles=t,this._endStyles=o;let r=i.initialStylesByElement.get(e);r||i.initialStylesByElement.set(e,r=new Map),this._initialStyles=r}start(){this._state<1&&(this._startStyles&&jt(this._element,this._startStyles,this._initialStyles),this._state=1)}finish(){this.start(),this._state<2&&(jt(this._element,this._initialStyles),this._endStyles&&(jt(this._element,this._endStyles),this._endStyles=null),this._state=1)}destroy(){this.finish(),this._state<3&&(i.initialStylesByElement.delete(this._element),this._startStyles&&(Ii(this._element,this._startStyles),this._endStyles=null),this._endStyles&&(Ii(this._element,this._endStyles),this._endStyles=null),jt(this._element,this._initialStyles),this._state=3)}}return i})();function Oa(i){let n=null;return i.forEach((e,t)=>{$0(t)&&(n=n||new Map,n.set(t,e))}),n}function $0(i){return i==="display"||i==="position"}var Or=class{element;keyframes;options;_specialStyles;_onDoneFns=[];_onStartFns=[];_onDestroyFns=[];_duration;_delay;_initialized=!1;_finished=!1;_started=!1;_destroyed=!1;_finalKeyframe;_originalOnDoneFns=[];_originalOnStartFns=[];domPlayer=null;time=0;parentPlayer=null;currentSnapshot=new Map;constructor(n,e,t,o){this.element=n,this.keyframes=e,this.options=t,this._specialStyles=o,this._duration=t.duration,this._delay=t.delay||0,this.time=this._duration+this._delay}_onFinish(){this._finished||(this._finished=!0,this._onDoneFns.forEach(n=>n()),this._onDoneFns=[])}init(){this._buildPlayer()&&this._preparePlayerBeforeStart()}_buildPlayer(){if(this._initialized)return this.domPlayer;this._initialized=!0;let n=this.keyframes,e=this._triggerWebAnimation(this.element,n,this.options);if(!e)return this._onFinish(),null;this.domPlayer=e,this._finalKeyframe=n.length?n[n.length-1]:new Map;let t=()=>this._onFinish();return e.addEventListener("finish",t),this.onDestroy(()=>{e.removeEventListener("finish",t)}),e}_preparePlayerBeforeStart(){this._delay?this._resetDomPlayerState():this.domPlayer?.pause()}_convertKeyframesToObject(n){let e=[];return n.forEach(t=>{e.push(Object.fromEntries(t))}),e}_triggerWebAnimation(n,e,t){let o=this._convertKeyframesToObject(e);try{return n.animate(o,t)}catch{return null}}onStart(n){this._originalOnStartFns.push(n),this._onStartFns.push(n)}onDone(n){this._originalOnDoneFns.push(n),this._onDoneFns.push(n)}onDestroy(n){this._onDestroyFns.push(n)}play(){let n=this._buildPlayer();n&&(this.hasStarted()||(this._onStartFns.forEach(e=>e()),this._onStartFns=[],this._started=!0,this._specialStyles&&this._specialStyles.start()),n.play())}pause(){this.init(),this.domPlayer?.pause()}finish(){this.init(),this.domPlayer&&(this._specialStyles&&this._specialStyles.finish(),this._onFinish(),this.domPlayer.finish())}reset(){this._resetDomPlayerState(),this._destroyed=!1,this._finished=!1,this._started=!1,this._onStartFns=this._originalOnStartFns,this._onDoneFns=this._originalOnDoneFns}_resetDomPlayerState(){this.domPlayer?.cancel()}restart(){this.reset(),this.play()}hasStarted(){return this._started}destroy(){this._destroyed||(this._destroyed=!0,this._resetDomPlayerState(),this._onFinish(),this._specialStyles&&this._specialStyles.destroy(),this._onDestroyFns.forEach(n=>n()),this._onDestroyFns=[])}setPosition(n){this.domPlayer||this.init(),this.domPlayer&&(this.domPlayer.currentTime=n*this.time)}getPosition(){return this.domPlayer?+(this.domPlayer.currentTime??0)/this.time:this._initialized?1:0}get totalTime(){return this._delay+this._duration}beforeDestroy(){let n=new Map;this.hasStarted()&&this._finalKeyframe.forEach((t,o)=>{o!=="offset"&&n.set(o,this._finished?t:Ar(this.element,o))}),this.currentSnapshot=n}triggerCallback(n){let e=n==="start"?this._onStartFns:this._onDoneFns;e.forEach(t=>t()),e.length=0}},Lr=class{validateStyleProperty(n){return!0}validateAnimatableStyleProperty(n){return!0}containsElement(n,e){return Aa(n,e)}getParentElement(n){return br(n)}query(n,e,t){return ka(n,e,t)}computeStyle(n,e,t){return Ar(n,e)}animate(n,e,t,o,r,p=[]){let u=o==0?"both":"forwards",v={duration:t,delay:o,fill:u};r&&(v.easing=r);let T=new Map,R=p.filter(Y=>Y instanceof Or);Pp(t,o)&&R.forEach(Y=>{Y.currentSnapshot.forEach((W,ne)=>T.set(ne,W))});let O=Mp(e).map(Y=>new Map(Y));O=Ip(n,O,T);let le=B0(n,O);return new Or(n,O,v,le)}};var Fr="@",Yp="@.disabled",Br=class{namespaceId;delegate;engine;_onDestroy;\u0275type=0;constructor(n,e,t,o){this.namespaceId=n,this.delegate=e,this.engine=t,this._onDestroy=o}get data(){return this.delegate.data}destroyNode(n){this.delegate.destroyNode?.(n)}destroy(){this.engine.destroy(this.namespaceId,this.delegate),this.engine.afterFlushAnimationsDone(()=>{queueMicrotask(()=>{this.delegate.destroy()})}),this._onDestroy?.()}createElement(n,e){return this.delegate.createElement(n,e)}createComment(n){return this.delegate.createComment(n)}createText(n){return this.delegate.createText(n)}appendChild(n,e){this.delegate.appendChild(n,e),this.engine.onInsert(this.namespaceId,e,n,!1)}insertBefore(n,e,t,o=!0){this.delegate.insertBefore(n,e,t),this.engine.onInsert(this.namespaceId,e,n,o)}removeChild(n,e,t,o){if(o){this.delegate.removeChild(n,e,t,o);return}this.parentNode(e)&&this.engine.onRemove(this.namespaceId,e,this.delegate)}selectRootElement(n,e){return this.delegate.selectRootElement(n,e)}parentNode(n){return this.delegate.parentNode(n)}nextSibling(n){return this.delegate.nextSibling(n)}setAttribute(n,e,t,o){this.delegate.setAttribute(n,e,t,o)}removeAttribute(n,e,t){this.delegate.removeAttribute(n,e,t)}addClass(n,e){this.delegate.addClass(n,e)}removeClass(n,e){this.delegate.removeClass(n,e)}setStyle(n,e,t,o){this.delegate.setStyle(n,e,t,o)}removeStyle(n,e,t){this.delegate.removeStyle(n,e,t)}setProperty(n,e,t){e.charAt(0)==Fr&&e==Yp?this.disableAnimations(n,!!t):this.delegate.setProperty(n,e,t)}setValue(n,e){this.delegate.setValue(n,e)}listen(n,e,t,o){return this.delegate.listen(n,e,t,o)}disableAnimations(n,e){this.engine.disableAnimations(n,e)}},qa=class extends Br{factory;constructor(n,e,t,o,r){super(e,t,o,r),this.factory=n,this.namespaceId=e}setProperty(n,e,t){e.charAt(0)==Fr?e.charAt(1)=="."&&e==Yp?(t=t===void 0?!0:!!t,this.disableAnimations(n,t)):this.engine.process(this.namespaceId,n,e.slice(1),t):this.delegate.setProperty(n,e,t)}listen(n,e,t,o){if(e.charAt(0)==Fr){let r=H0(n),p=e.slice(1),u="";return p.charAt(0)!=Fr&&([p,u]=z0(p)),this.engine.listen(this.namespaceId,r,p,u,v=>{let T=v._data||-1;this.factory.scheduleListenerCallback(T,t,v)})}return this.delegate.listen(n,e,t,o)}};function H0(i){switch(i){case"body":return document.body;case"document":return document;case"window":return window;default:return i}}function z0(i){let n=i.indexOf("."),e=i.substring(0,n),t=i.slice(n+1);return[e,t]}var Ur=class{delegate;engine;_zone;_currentId=0;_microtaskId=1;_animationCallbacksBuffer=[];_rendererCache=new Map;_cdRecurDepth=0;constructor(n,e,t){this.delegate=n,this.engine=e,this._zone=t,e.onRemovalComplete=(o,r)=>{r?.removeChild(null,o)}}createRenderer(n,e){let o=this.delegate.createRenderer(n,e);if(!n||!e?.data?.animation){let T=this._rendererCache,R=T.get(o);if(!R){let O=()=>T.delete(o);R=new Br("",o,this.engine,O),T.set(o,R)}return R}let r=e.id,p=e.id+"-"+this._currentId;this._currentId++,this.engine.register(p,n);let u=T=>{Array.isArray(T)?T.forEach(u):this.engine.registerTrigger(r,p,n,T.name,T)};return e.data.animation.forEach(u),new qa(this,p,o,this.engine)}begin(){this._cdRecurDepth++,this.delegate.begin&&this.delegate.begin()}_scheduleCountTask(){queueMicrotask(()=>{this._microtaskId++})}scheduleListenerCallback(n,e,t){if(n>=0&&n<this._microtaskId){this._zone.run(()=>e(t));return}let o=this._animationCallbacksBuffer;o.length==0&&queueMicrotask(()=>{this._zone.run(()=>{o.forEach(r=>{let[p,u]=r;p(u)}),this._animationCallbacksBuffer=[]})}),o.push([e,t])}end(){this._cdRecurDepth--,this._cdRecurDepth==0&&this._zone.runOutsideAngular(()=>{this._scheduleCountTask(),this.engine.flush(this._microtaskId)}),this.delegate.end&&this.delegate.end()}whenRenderingDone(){return this.engine.whenRenderingDone()}componentReplaced(n){this.engine.flush(),this.delegate.componentReplaced?.(n)}};var W0=(()=>{class i extends Rn{constructor(e,t,o){super(e,t,o)}ngOnDestroy(){this.flush()}static \u0275fac=function(t){return new(t||i)(wo(To),wo(Xi),wo(Zi))};static \u0275prov=kt({token:i,factory:i.\u0275fac})}return i})();function j0(){return new Pr}function K0(i,n,e){return new Ur(i,n,e)}var Xp=[{provide:Zi,useFactory:j0},{provide:Rn,useClass:W0},{provide:xs,useFactory:K0,deps:[Vs,Rn,$i]}],ob=[{provide:Xi,useClass:Qa},{provide:la,useValue:"NoopAnimations"},...Xp],q0=[{provide:Xi,useFactory:()=>new Lr},{provide:la,useFactory:()=>"BrowserAnimations"},...Xp];function Zp(){return gs("NgEagerAnimations"),[...q0]}var _o=i=>i.url;var Jp=()=>S(oe).user.isAdmin;var ed=[{path:qi.BASE,pathMatch:"prefix",canActivate:[Jp],children:[{path:qi.USERS,data:{type:Zn.USER},loadComponent:()=>import("./chunk-V55LDRV7.js").then(i=>i.AdminUsersComponent)},{path:qi.GUESTS,data:{type:Zn.GUEST},loadComponent:()=>import("./chunk-V55LDRV7.js").then(i=>i.AdminUsersComponent)},{path:qi.GROUPS,children:[{path:"**",resolve:{routes:_o},data:{type:Ki.USER},loadComponent:()=>import("./chunk-HIZGSP7R.js").then(i=>i.AdminGroupsComponent)}]},{path:qi.PGROUPS,children:[{path:"**",resolve:{routes:_o},data:{type:Ki.PERSONAL},loadComponent:()=>import("./chunk-HIZGSP7R.js").then(i=>i.AdminGroupsComponent)}]},{path:"**",redirectTo:qi.USERS}]}];var td=i=>S(si).linkValidation(i.params.uuid).pipe($n(n=>n===!1?fi(!1):(i.data=Se(re({},i.data),{link:n}),fi(!0))));var id=[{path:Ca.LINK,children:[{path:":uuid",loadComponent:()=>import("./chunk-RANZZPRG.js").then(i=>i.PublicLinkComponent),canActivate:[td]},{path:`:uuid/${Ca.AUTH}`,loadComponent:()=>import("./chunk-CHAYERHQ.js").then(i=>i.PublicLinkAuthComponent)},{path:":uuid/:error",loadComponent:()=>import("./chunk-KYLATNX5.js").then(i=>i.PublicLinkErrorComponent)}]}];var $r={BASE:`${ic}/comments`,RECENTS:"recents",SPACES:"spaces"},fo=`${$r.BASE}/${$r.SPACES}`,nd=`${$r.BASE}/${$r.RECENTS}`;var Hr=class{constructor(n){Object.assign(this,n),this.author&&(this.author.avatarUrl=wn(this.author.login)),this.mimeUrl=io(this.file.mime),this.icon=this.file.fromShare?ie.SHARES:this.file.fromSpace?ie.SPACES:ie.PERSONAL,this.iconClass=this.file.fromShare?"purple":"primary",this.showedPath=[...this.file.path.split("/").slice(this.file.path.split("/")[1]===ft.PERSONAL?2:1),this.file.name].join("/")}};var Nn=class{constructor(n){this.wasModified=!1,Object.assign(this,n),this.author.avatarUrl=wn(this.author.login),this.wasModified=this.createdAt!==this.modifiedAt,this.dateToShow=this.wasModified?this.modifiedAt:this.createdAt}};var zr=(()=>{let n=class n{constructor(){this.store=S(te),this.layout=S(I),this.http=S(Bs)}getComments(t){return this.http.get(`${fo}/${t.path}`).pipe(bt(o=>o.map(r=>new Nn(r))))}createComment(t,o){return this.http.post(`${fo}/${t.path}`,o).pipe(bt(r=>new Nn(r)))}updateComment(t,o){return this.http.patch(`${fo}/${t.path}`,o).pipe(bt(r=>new Nn(r)))}deleteComment(t,o){return this.http.request("delete",`${fo}/${t.path}`,{body:o})}loadRecents(t){this.http.get(nd,{params:new Ls().set("limit",t)}).pipe(bt(o=>o.map(r=>new Hr(r)))).subscribe({next:o=>{this.store.commentsRecents.update(r=>[...o,...r.slice(t)])},error:o=>this.layout.sendNotification("error","Comments","Unable to load",o)})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();var Q0=(i,n)=>n.id;function Y0(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c(2);m("icon",e.icons.faTrashAlt)}}function X0(i,n){if(i&1){let e=y();s(0,"button",10),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),s(1,"span",11),_(2,"app-user-avatar",12),l(),s(3,"span",13)(4,"span",14),d(5),l(),s(6,"span"),C(7,Y0,1,1,"fa-icon",4),_(8,"fa-icon",15),s(9,"span"),d(10),l()()(),s(11,"span",16),d(12),b(13,"amTimeAgo"),l()()}if(i&2){let e=n.$implicit,t=n.$index;B("animation-delay",t*22,"ms"),a(2),m("user",e.author)("container","body")("width",29)("height",29),a(3),w(e.content),a(),V(q("recent-item-card__path text-",e.iconClass)),a(),x(e.file.inTrash?7:-1),a(),m("icon",e.icon),a(2),w(e.showedPath),a(2),w($(13,14,e.modifiedAt))}}function Z0(i,n){if(i&1&&(s(0,"div",9),_(1,"fa-icon",17),s(2,"div",18),d(3,"No recent comments"),l()()),i&2){let e=c();a(),m("icon",e.icons.faCommentDots)}}var od=(()=>{let n=class n{constructor(){this.moreElements=!1,this.icons={faCommentDots:xr,faMagnifyingGlassPlus:Uo,faMagnifyingGlassMinus:Bo,faTrashAlt:Ti},this.router=S(Ce),this.layout=S(I),this.store=S(te),this.commentsService=S(zr),this.nbInitialComments=10,this.nbComments=this.nbInitialComments,this.comments=ve(()=>this.store.commentsRecents().slice(0,this.nbComments)),this.load()}switchMore(){this.moreElements?(this.moreElements=!1,this.nbComments=this.nbInitialComments):(this.moreElements=!0,this.nbComments*=5),this.load()}goToFile(t){this.router.navigate([G.SPACES,...t.file.path.split("/")],{queryParams:{select:t.file.name}}).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}load(){this.commentsService.loadRecents(this.nbComments)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-comments-recents-widget"]],decls:13,vars:3,consts:[[1,"recents-widget-card"],[1,"recents-widget-card__header"],[1,"recents-widget-card__title-wrap"],[1,"recents-widget-card__title-icon"],[3,"icon"],["l10nTranslate","",1,"recents-widget-card__title"],["type","button",1,"recents-widget-card__toggle",3,"click"],[1,"recents-widget-card__body"],["type","button",1,"recent-item-card",3,"animation-delay"],[1,"recent-empty-state"],["type","button",1,"recent-item-card",3,"click"],[1,"recent-item-card__media"],[3,"user","container","width","height"],[1,"recent-item-card__content"],[1,"recent-item-card__title"],[1,"me-1",3,"icon"],[1,"recent-item-card__time"],["size","2x",3,"icon"],["l10nTranslate","",1,"mt-3"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),_(4,"fa-icon",4),l(),s(5,"span",5),d(6,"Comments"),l()(),s(7,"button",6),f("click",function(){return r.switchMore()}),_(8,"fa-icon",4),l()(),s(9,"div",7),D(10,X0,14,16,"button",8,Q0,!1,Z0,4,1,"div",9),l()()),o&2&&(a(4),m("icon",r.icons.faCommentDots),a(4),m("icon",r.moreElements?r.icons.faMagnifyingGlassMinus:r.icons.faMagnifyingGlassPlus),a(2),M(r.comments()))},dependencies:[P,F,qe,Qe],styles:[".recent-item-card__media[_ngcontent-%COMP%]{border-radius:999px;display:flex;align-items:center;justify-content:center}"]});let i=n;return i})();var J0=(i,n)=>n.id;function eu(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c(2);m("icon",e.icons.faTrashAlt)}}function tu(i,n){if(i&1){let e=y();s(0,"button",10),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),s(1,"span",11)(2,"img",12),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l()(),s(3,"span",13)(4,"span",14),d(5),l(),s(6,"span"),C(7,eu,1,1,"fa-icon",4),_(8,"fa-icon",15),s(9,"span"),d(10),l()()(),s(11,"span",16),d(12),b(13,"amTimeAgo"),l()()}if(i&2){let e=n.$implicit,t=n.$index;B("animation-delay",t*22,"ms"),a(2),m("src",e.mimeUrl,X),a(3),w(e.name),a(),V(q("recent-item-card__path text-",e.iconClass)),a(),x(e.inTrash?7:-1),a(),m("icon",e.icon),a(2),w(e.showedPath),a(2),w($(13,11,e.mtime))}}function iu(i,n){if(i&1&&(s(0,"div",9),_(1,"fa-icon",17),s(2,"div",18),d(3,"No recent files"),l()()),i&2){let e=c();a(),m("icon",e.icons.faFileLines)}}var rd=(()=>{let n=class n{constructor(){this.moreElements=!1,this.icons={faFileLines:Wc,faMagnifyingGlassPlus:Uo,faMagnifyingGlassMinus:Bo,faTrashAlt:Ti},this.router=S(Ce),this.store=S(te),this.filesService=S(Le),this.nbInitialFiles=10,this.nbFiles=this.nbInitialFiles,this.files=ve(()=>this.store.filesRecents().slice(0,this.nbFiles)),this.load()}switchMore(){this.moreElements?(this.moreElements=!1,this.nbFiles=this.nbInitialFiles):(this.moreElements=!0,this.nbFiles*=5),this.load()}goToFile(t){this.router.navigate([G.SPACES,...t.path.split("/")],{queryParams:{select:t.name}}).catch(console.error)}load(){this.filesService.loadRecents(this.nbFiles)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-recents-widget"]],decls:13,vars:3,consts:[[1,"recents-widget-card"],[1,"recents-widget-card__header"],[1,"recents-widget-card__title-wrap"],[1,"recents-widget-card__title-icon"],[3,"icon"],["l10nTranslate","",1,"recents-widget-card__title"],["type","button",1,"recents-widget-card__toggle",3,"click"],[1,"recents-widget-card__body"],["type","button",1,"recent-item-card",3,"animation-delay"],[1,"recent-empty-state"],["type","button",1,"recent-item-card",3,"click"],[1,"recent-item-card__media"],["alt","",3,"error","src"],[1,"recent-item-card__content"],[1,"recent-item-card__title"],[1,"me-1",3,"icon"],[1,"recent-item-card__time"],["size","2x",3,"icon"],["l10nTranslate","",1,"mt-3"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"span",3),_(4,"fa-icon",4),l(),s(5,"span",5),d(6,"Files"),l()(),s(7,"button",6),f("click",function(){return r.switchMore()}),_(8,"fa-icon",4),l()(),s(9,"div",7),D(10,tu,14,13,"button",8,J0,!1,iu,4,1,"div",9),l()()),o&2&&(a(4),m("icon",r.icons.faFileLines),a(4),m("icon",r.moreElements?r.icons.faMagnifyingGlassMinus:r.icons.faMagnifyingGlassPlus),a(2),M(r.files()))},dependencies:[P,F,Qe],styles:[".recent-item-card__media[_ngcontent-%COMP%]{border-radius:.55rem;display:grid;place-items:center}.recent-item-card__media[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:1.15rem;height:1.15rem;object-fit:contain}"]});let i=n;return i})();var ad=(()=>{let n=class n{constructor(){this.layout=S(I),this.layout.setBreadcrumbIcon(Sc),this.layout.setBreadcrumbNav({url:`/${di.BASE}/${xc}`,translating:!0,sameLink:!0})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-recents"]],decls:6,vars:2,consts:[["appAutoResize","",1,"recents-dashboard",3,"useMaxHeight","resizeOffset"],[1,"row","recents-grid","g-3"],[1,"col-md-6"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),_(3,"app-files-recents-widget"),l(),s(4,"div",2),_(5,"app-comments-recents-widget"),l()()()),o&2&&m("useMaxHeight",!1)("resizeOffset",40)},dependencies:[de,rd,od],encapsulation:2});let i=n;return i})();var sd=[{path:er.BASE,pathMatch:"full",redirectTo:di.BASE},{path:di.BASE,component:ad}];var ho={BASE:"search"},nu="Search",Gr=Oo,ld={title:nu,link:ho.BASE,icon:Gr,submenus:[]};function ru(i,n){if(i&1){let e=y();s(0,"span",6)(1,"fa-icon",14),f("click",function(){h(e);let o=c();return g(o.clearSearch())}),l()()}if(i&2){let e=c();a(),m("icon",e.icons.faTimes)}}function au(i,n){if(i&1&&(s(0,"div",12),d(1),l()),i&2){let e=c();a(),w(e.errorMessage)}}function su(i,n){if(i&1&&_(0,"p",23),i&2){let e=n.$implicit;m("innerHTML",e,zn)}}function lu(i,n){if(i&1&&(s(0,"div",22),D(1,su,1,1,"p",23,He),l()),i&2){let e=c().$implicit;a(),M(e.matches)}}function cu(i,n){if(i&1){let e=y();s(0,"article",15),f("click",function(){let o=h(e).$index,r=c();return g(r.selectedId=o)})("appTap",function(){let o=h(e).$implicit,r=c();return g(r.goTo(o))}),s(1,"div",16)(2,"img",17),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),s(3,"div",18)(4,"span",19),d(5),l(),s(6,"div"),_(7,"fa-icon",20),s(8,"span",21),d(9),l()()()(),C(10,lu,3,0,"div",22),l()}if(i&2){let e=n.$implicit,t=n.$index,o=c();L("selected",t===o.selectedId),a(2),m("src",e.mimeUrl,X),a(3),w(e.name),a(),V(q("search-result-path d-flex align-items-center text-",e.iconClass)),a(),m("icon",e.icon),a(2),w(e.showedPath),a(),x(e.matches!=null&&e.matches.length?10:-1)}}var cd=(()=>{let n=class n{constructor(){this.locale=S(z),this.store=S(te),this.searchContent=ve(()=>this.store.currentSearch().content),this.icons={SEARCH_ICON:Gr,faSpinner:Oe,faTrashCan:wi,faTimes:It,faFont:Bl,faMapMarkerAlt:Sn},this.minCharsToSearch=3,this.loading=!1,this.errorMessage=null,this.selectedId=null,this.router=S(Ce),this.layout=S(I),this.filesService=S(Le),this.layout.setBreadcrumbIcon(Gr),this.layout.setBreadcrumbNav({url:`/${ho.BASE}`,translating:!1,sameLink:!0})}setCurrentSearch(t){this.store.currentSearch.update(o=>Se(re({},o),{content:t.target.value}))}doSearch(){this.searchContent().length<this.minCharsToSearch||(this.errorMessage=null,this.loading=!0,this.selectedId=null,this.filesService.search(this.store.currentSearch()).subscribe({next:t=>{this.store.filesSearch.set(t),this.loading=!1},error:t=>{this.store.filesSearch.set([]),this.errorMessage=t.error.message,this.loading=!1}}))}toggleFullText(){this.store.currentSearch.update(t=>Se(re({},t),{fullText:!t.fullText}))}clearSearch(){this.store.currentSearch.update(t=>Se(re({},t),{content:""})),this.store.filesSearch.set([])}goTo(t,o){if(!t){let r=this.store.filesSearch(),p=this.inputFilter?.search?.()??"";t=(p?uc(p,r):r).find((v,T)=>T===o)}t&&this.router.navigate([G.SPACES,...t.path.split("/")],{queryParams:{select:t.name}}).catch(console.error)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-search"]],viewQuery:function(o,r){if(o&1&&Z(Re,7),o&2){let p;j(p=K())&&(r.inputFilter=p.first)}},decls:20,vars:25,consts:[[1,"app-top-menu"],[1,"col-12","col-md-6","col-lg-4"],[1,"input-group"],["role","button","type","button",1,"btn","btn-default",3,"click","disabled"],[3,"icon","animation"],["name","search","type","text","appAutofocus","","autocomplete","",1,"search-input","flex-fill","form-control",3,"input","keyup.enter","keyup.escape","value","placeholder"],[1,"search-clear-btn"],["container","body","placement","bottom","role","button","type","button","btnCheckbox","",1,"btn","btn-custom",3,"ngModelChange","ngModel","tooltip"],[3,"icon"],["container","body","type","button",1,"search-go-to-btn","d-none","d-md-block","btn","btn-default",3,"click","disabled","tooltip"],[1,"d-none","d-md-block","ms-auto"],["appAutoResize","","role","list",1,"search-results-list"],["l10nTranslate","",1,"p-3","text-danger","fw-500"],[1,"app-div-striped","search-result-item",3,"selected"],["role","button",3,"click","icon"],[1,"app-div-striped","search-result-item",3,"click","appTap"],[1,"search-result-header","d-flex","align-items-start"],["alt","","draggable","false",1,"search-result-mime",3,"error","src"],[1,"search-result-meta","d-flex","flex-column"],[1,"search-result-name","text-truncate"],[1,"search-result-path-icon",3,"icon"],[1,"text-truncate","search-result-path-text"],[1,"search-result-matches"],[1,"search-result-match",3,"innerHTML"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"button",3),f("click",function(){return r.doSearch()}),_(4,"fa-icon",4),l(),s(5,"input",5),b(6,"translate"),f("input",function(u){return r.setCurrentSearch(u)})("keyup.enter",function(){return r.doSearch()})("keyup.escape",function(){return r.clearSearch()}),l(),C(7,ru,2,1,"span",6),s(8,"button",7),b(9,"translate"),f("ngModelChange",function(){return r.toggleFullText()}),_(10,"fa-icon",8),l()()(),s(11,"button",9),b(12,"translate"),f("click",function(){return r.goTo(null,r.selectedId)}),_(13,"fa-icon",8),l(),_(14,"app-input-filter",10),l(),s(15,"div",11),C(16,au,2,1,"div",12),D(17,cu,11,10,"article",13,He),b(19,"searchFilter"),l()),o&2&&(a(3),m("disabled",r.searchContent().length<r.minCharsToSearch),a(),m("icon",r.loading?r.icons.faSpinner:r.icons.SEARCH_ICON)("animation",r.loading?"spin":null),a(),m("value",r.searchContent())("placeholder",E(6,13,r.store.currentSearch().fullText?"Search for content":"Search for files",r.locale.language)),a(2),x(r.searchContent()?7:-1),a(),m("ngModel",r.store.currentSearch().fullText)("tooltip",E(9,16,"Search for content",r.locale.language)),a(2),m("icon",r.icons.faFont),a(),m("disabled",r.selectedId===null)("tooltip",E(12,19,"Go to",r.locale.language)),a(2),m("icon",r.icons.faMapMarkerAlt),a(3),x(r.errorMessage?16:-1),a(),M(E(19,22,r.store.filesSearch(),r.inputFilter.search())))},dependencies:[Re,F,je,lr,Te,xe,we,de,Me,P,tt,J,ht],encapsulation:2});let i=n;return i})();var pd=[{path:ho.BASE,component:cd}];var pu=(i,n)=>n.key;function du(i,n){i&1&&(s(0,"span",0),d(1,"No permissions"),l())}function mu(i,n){if(i&1&&(s(0,"span",2),b(1,"translate"),_(2,"fa-icon",3),l()),i&2){let e=n.$implicit,t=c(3);m("tooltip",E(1,4,e.value.text,t.locale.language))("placement",t.tooltipPlacement)("container","body"),a(2),m("icon",e.value.icon)}}function uu(i,n){if(i&1&&(s(0,"span",1),D(1,mu,3,7,"span",2,pu),l()),i&2){let e=c(2);a(),M(e.permissionEntries)}}function _u(i,n){if(i&1&&C(0,uu,3,0,"span",1),i&2){let e=c();x(e.permissionEntries.length?0:-1)}}var St=(()=>{let n=class n{constructor(){this.permissions={},this.tooltipPlacement="top",this.replaceEmptyPermissions=!1,this.permissionEntries=[],this.locale=S(z)}ngOnChanges(){this.permissionEntries=this.buildPermissionEntries()}buildPermissionEntries(){return Object.entries(this.permissions).filter(t=>t[1]!==void 0).map(([t,o])=>({key:t,value:o}))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-badge-permissions"]],inputs:{permissions:"permissions",tooltipPlacement:"tooltipPlacement",replaceEmptyPermissions:"replaceEmptyPermissions"},features:[nn],decls:2,vars:1,consts:[["l10nTranslate",""],[1,"badge","bg-secondary-alt","permission-badge"],[1,"permission-icon",3,"tooltip","placement","container"],[1,"cursor-pointer",3,"icon"]],template:function(o,r){o&1&&C(0,du,2,0,"span",0)(1,_u,1,1),o&2&&x(r.replaceEmptyPermissions&&!r.permissionEntries.length?0:1)},dependencies:[Ge,Me,P,F,J],styles:["[_nghost-%COMP%]{--permission-icon-color: #2f4558;--permission-icon-hover-color: #22384b;display:inline-block;max-width:100%;vertical-align:middle}body.theme-dark[_nghost-%COMP%], body.theme-dark [_nghost-%COMP%]{--permission-icon-color: #c2ccd8;--permission-icon-hover-color: #d8e3ef}.permission-badge[_ngcontent-%COMP%]{display:inline-block;width:fit-content;max-width:100%;min-width:0;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}.permission-icon[_ngcontent-%COMP%]{display:inline-block;margin-right:.1rem;vertical-align:middle}.permission-icon[_ngcontent-%COMP%]:last-child{margin-right:0}.permission-icon[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{display:inline-block;color:var(--permission-icon-color);vertical-align:0;font-size:var(--font-size-base)}"],changeDetection:0});let i=n;return i})();var dd=(i,n)=>n.key;function fu(i,n){if(i&1){let e=y();s(0,"li",6)(1,"a",8),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.setView(o.key))}),s(2,"span"),_(3,"fa-icon",2),d(4),l()()()}if(i&2){let e=n.$implicit;a(3),m("icon",e.value.icon),a(),k(" ",e.value.text)}}function hu(i,n){if(i&1&&_(0,"fa-icon",10),i&2){let e=c(3);m("icon",e.sortParams.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function gu(i,n){if(i&1){let e=y();s(0,"li",6)(1,"a",8),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.sortBy.emit(o.key))}),s(2,"span",9),d(3),C(4,hu,1,1,"fa-icon",10),l()()()}if(i&2){let e=n.$implicit,t=c(2);a(3),k(" ",e.value," "),a(),x(t.sortParams.column===e.key?4:-1)}}function Cu(i,n){if(i&1&&(s(0,"ul",4)(1,"li",5),d(2,"Display"),l(),D(3,fu,5,2,"li",6,dd),b(5,"keyvalue"),s(6,"li",7),d(7,"Sort by"),l(),D(8,gu,5,2,"li",6,dd),b(10,"keyvalue"),l()),i&2){let e=c();a(3),M(E(5,0,e.viewsMode,e.originalOrderKeyValue)),a(5),M(E(10,3,e.sortFields,e.originalOrderKeyValue))}}var st=(()=>{let n=class n{constructor(){this.switchView=new ae,this.sortBy=new ae,this.originalOrderKeyValue=Fe,this.icons={faSliders:Fl,faArrowDown:ut,faArrowUp:pt},this.viewsMode={tl:{enabled:!1,text:"List",icon:Dl},th:{enabled:!0,text:"S",icon:Xn,maxBadges:0,dimensions:96,image:56,imageRes:128,faSize:30,textSize:11,margins:18},thM:{enabled:!0,text:"M",icon:Xn,maxBadges:1,dimensions:112,image:72,imageRes:192,faSize:34,textSize:11,margins:18},thL:{enabled:!0,text:"L",icon:Xn,maxBadges:2,dimensions:152,image:112,imageRes:256,faSize:50,textSize:12,margins:18},thXl:{enabled:!0,text:"XL",icon:Xn,maxBadges:6,dimensions:192,image:152,imageRes:512,faSize:65,textSize:13,margins:18},thXxl:{enabled:!0,text:"XXL",icon:Wl,maxBadges:6,dimensions:232,image:192,imageRes:1024,faSize:80,textSize:14,margins:18}},this.layout=S(I),this.viewsMode.tl.text=this.layout.translateString(this.viewsMode.tl.text)}get viewMode(){return localStorage.getItem("viewMode")||"tl"}set viewMode(t){localStorage.setItem("viewMode",t)}currentView(){return this.viewsMode[this.viewMode]}setView(t){this.viewMode=t,this.switchView.emit(this.viewsMode[t])}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-navigation-view"]],inputs:{sortParams:"sortParams",sortFields:"sortFields"},outputs:{switchView:"switchView",sortBy:"sortBy"},decls:4,vars:1,consts:[["dropdown","",1,"btn-group"],["dropdownToggle","","type","button",1,"btn","btn-default","dropdown-toggle"],[3,"icon"],["class","dropdown-menu dropdown-menu-right","role","menu",4,"dropdownMenu"],["role","menu",1,"dropdown-menu","dropdown-menu-right"],["l10nTranslate","",1,"dropdown-header","text-bold"],["role","menuitem"],["l10nTranslate","",1,"dropdown-header","text-bold","mt-1"],[1,"dropdown-item",3,"click"],["l10nTranslate","",1,"me-2"],["size","xs",1,"ms-1",3,"icon"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"button",1),_(2,"fa-icon",2),l(),N(3,Cu,11,6,"ul",3),l()),o&2&&(a(2),m("icon",r.icons.faSliders))},dependencies:[Pi,Mi,Fi,Di,F,P,De],encapsulation:2,changeDetection:0});let i=n;return i})();var xu=["MainContextMenu"],Su=["TargetContextMenu"],ud=(i,n)=>n.id,_d=(i,n)=>n.key;function vu(i,n){if(i&1&&(s(0,"span",33),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),k(" ",e.hTimeAccessAgo," ")}}function yu(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c().$implicit;V(q("badge ",e.link.nbAccess>=e.link.limitAccess?"bg-danger":"bg-success")),a(),ke(" ",e.link.nbAccess,"/",e.link.limitAccess," ")}}function bu(i,n){if(i&1&&(s(0,"span",28),d(1),l()),i&2){let e=c().$implicit;a(),w(e.link.nbAccess)}}function wu(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c(2).$implicit,t=c(2);ke(" ",e.hTimeExpirationAgo,"\xA0",E(1,2,e.hTimeExpirationAgo===1?"day":"days",t.locale.language)," ")}}function Tu(i,n){if(i&1&&(s(0,"span"),_(1,"fa-icon",34),C(2,wu,2,5),l()),i&2){let e=c().$implicit,t=c(2);V(q("badge bg-",e.hTimeExpirationAgo>=1?"warning":"danger"," ms-1")),a(),m("icon",t.icons.faClock)("fixedWidth",!1),a(),x(e.hTimeExpirationAgo>=1?2:-1)}}function Eu(i,n){if(i&1){let e=y();s(0,"div",21),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openLinkDialog())}),s(1,"div",22)(2,"img",23),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),s(3,"span",24),C(4,vu,2,3,"span",25),l(),s(5,"span",26),C(6,yu,2,5,"span",27)(7,bu,2,1,"span",28),C(8,Tu,3,6,"span",27),l(),s(9,"span",29),_(10,"app-share-repository",30),l()(),s(11,"div",31)(12,"span",32),d(13),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),L("selected",e.id===(o.selected==null?null:o.selected.id))("disabled",!e.link.isActive),a(),Xt("rowIndex",t),a(),m("src",e.mimeUrl,X)("height",o.galleryMode.image)("width",o.galleryMode.image),a(2),x(e.newly?4:-1),a(2),x(e.link.limitAccess?6:7),a(2),x(e.link.expiresAt?8:-1),a(2),m("share",e)("galleryMode",o.galleryMode),a(2),B("font-size",o.galleryMode.textSize,"px"),a(),w(e.name)}}function Au(i,n){if(i&1){let e=y();s(0,"div",13)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),s(3,"div",19),D(4,Eu,14,20,"div",20,ud),l()()()}if(i&2){let e=c();a(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),a(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function ku(i,n){if(i&1&&_(0,"fa-icon",34),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Du(i,n){if(i&1){let e=y();s(0,"th",40),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,ku,1,2,"fa-icon",34),l()}if(i&2){let e=c().$implicit,t=c(2);V(e.value.class),B("width",e.value.width,"%"),L("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),k(" ",e.value.label," "),a(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function Mu(i,n){if(i&1&&C(0,Du,3,10,"th",39),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Fu(i,n){if(i&1){let e=y();s(0,"div",43)(1,"img",46),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),s(2,"div",47)(3,"span",32),d(4),l(),s(5,"span",48),d(6),l()()()}if(i&2){let e=c(3).$implicit;a(),m("src",e.mimeUrl,X),a(3),w(e.name),a(2),w(e.description)}}function Pu(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(4).$implicit;a(),w(e.link.email||"")}}function Iu(i,n){if(i&1&&(s(0,"span",44)(1,"span"),d(2),l(),C(3,Pu,2,1,"span"),l()),i&2){let e=c(3).$implicit;a(2),w(e.link.name),a(),x(e.link.email?3:-1)}}function Ru(i,n){if(i&1&&_(0,"app-share-repository",45),i&2){let e=c(3).$implicit;m("share",e)}}function Nu(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(4).$implicit;V(q("badge ",e.link.nbAccess>=e.link.limitAccess?"bg-danger":"bg-success")),a(),ke(" ",e.link.nbAccess,"/",e.link.limitAccess," ")}}function Vu(i,n){if(i&1&&(s(0,"span",28),d(1),l()),i&2){let e=c(4).$implicit;a(),w(e.link.nbAccess)}}function Ou(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c(5).$implicit,t=c(2);ke(" ",e.hTimeExpirationAgo,"\xA0",E(1,2,e.hTimeExpirationAgo===1?"day":"days",t.locale.language)," ")}}function Lu(i,n){if(i&1&&(s(0,"span"),_(1,"fa-icon",34),C(2,Ou,2,5),l()),i&2){let e=c(4).$implicit,t=c(2);V(q("badge bg-",e.hTimeExpirationAgo>=1?"warning":"danger"," ms-1")),a(),m("icon",t.icons.faClock)("fixedWidth",!1),a(),x(e.hTimeExpirationAgo>=1?2:-1)}}function Bu(i,n){if(i&1&&(s(0,"span",49),_(1,"fa-icon",6),l()),i&2){let e=c(6);a(),m("icon",e.icons.faLock)}}function Uu(i,n){if(i&1&&(C(0,Nu,2,5,"span",27)(1,Vu,2,1,"span",28),C(2,Lu,3,6,"span",27),C(3,Bu,2,1,"span",49)),i&2){let e=c(3).$implicit;x(e.link.limitAccess?0:1),a(2),x(e.link.expiresAt?2:-1),a(),x(e.link.requireAuth?3:-1)}}function $u(i,n){if(i&1&&_(0,"app-badge-permissions",50),i&2){let e=c(4).$implicit;m("permissions",e.hPerms)}}function Hu(i,n){if(i&1&&C(0,$u,1,1,"app-badge-permissions",50),i&2){let e=c(3).$implicit;x(e.link.permissions?0:-1)}}function zu(i,n){if(i&1&&d(0),i&2){let e=c(4).$implicit;k(" ",e.hTimeAccessAgo," ")}}function Gu(i,n){i&1&&(s(0,"span",51),d(1,"never"),l())}function Wu(i,n){if(i&1&&(s(0,"span"),C(1,zu,1,1)(2,Gu,2,0,"span",51),l()),i&2){let e=c(2).$implicit,t=c().$implicit;V(e.value.newly!==void 0&&t[e.value.newly]?"badge prop-newly-"+t[e.value.newly]:""),a(),x(t.link.currentAccess?1:2)}}function ju(i,n){if(i&1&&(s(0,"td"),C(1,Fu,7,3,"div",43)(2,Iu,4,2,"span",44)(3,Ru,1,1,"app-share-repository",45)(4,Uu,4,3)(5,Hu,1,1)(6,Wu,3,3,"span",27),l()),i&2){let e,t=c().$implicit;V(t.value.class),B("width",t.value.width,"%"),L("text-align-center",t.value.textCenter),a(),x((e=t.key)==="name"?1:e==="link"?2:e==="from"?3:e==="info"?4:e==="permissions"?5:e==="accessed"?6:-1)}}function Ku(i,n){if(i&1&&C(0,ju,7,7,"td",42),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function qu(i,n){if(i&1){let e=y();s(0,"tr",41),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openLinkDialog())}),D(1,Ku,1,1,null,null,_d),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);L("selected",e.id===(t.selected==null?null:t.selected.id))("disabled",!e.link.isActive),a(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function Qu(i,n){if(i&1){let e=y();s(0,"table",35)(1,"thead")(2,"tr"),D(3,Mu,1,1,null,null,_d),b(5,"keyvalue"),l()()(),s(6,"app-virtual-scroll",36),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),s(8,"table",35)(9,"tbody",37),D(10,qu,4,7,"tr",38,ud),l()()()}if(i&2){let e=c();a(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",E(7,5,e.shares,e.inputFilter.search())),a(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Yu(i,n){if(i&1&&(s(0,"span",52),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();a(),m("icon",e.icons.faArrowRotateRight)}}function Xu(i,n){if(i&1&&(s(0,"span",52),_(1,"fa-icon",6),d(2,"Go to"),l()),i&2){let e=c();a(),m("icon",e.icons.faMapMarkerAlt)}}function Zu(i,n){if(i&1&&(s(0,"span",52),_(1,"fa-icon",6),d(2,"Edit link"),l()),i&2){let e=c();a(),m("icon",e.icons.faPen)}}function Ju(i,n){if(i&1&&(s(0,"span",52),_(1,"fa-icon",6),d(2,"Copy link"),l()),i&2){let e=c();a(),m("icon",e.icons.faClipboard)}}function e_(i,n){}function t_(i,n){if(i&1&&(s(0,"span",52),_(1,"fa-icon",6),d(2,"Info"),l()),i&2){let e=c();a(),m("icon",e.icons.faCircleInfo)}}var fd=(()=>{let n=class n{constructor(){this.locale=S(z),this.layout=S(I),this.icons={faLink:Go,faArrowRotateRight:mt,faArrowDown:ut,faArrowUp:pt,faMapMarkerAlt:Sn,faPen:dt,faEllipsisH:No,faClock:gl,faLock:ti,faClipboard:Sl,faClipboardCheck:Lo,faCircleInfo:Rt},this.originalOrderKeyValue=Fe,this.TAB_MENU=fe,this.loading=!1,this.linkWasCopied=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},link:{label:"Link",width:15,textCenter:!1,class:"d-none d-sm-table-cell",show:!0,sortable:!0},from:{label:"Shared from",width:15,textCenter:!1,class:"d-none d-md-table-cell",show:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},permissions:{label:"Permissions",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},accessed:{label:"Accessed",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",link:"Link",accessed:"Accessed"},this.activatedRoute=S(Mt),this.store=S(te),this.linksService=S(si),this.sharesService=S(ai),this.sortSettings={default:[{prop:"name",type:"string"}],link:[{prop:"link.name",type:"string"}],name:[{prop:"name",type:"string"}],info:[{prop:"link.nbAccess",type:"number"}],permissions:[{prop:"link.permissions",type:"length"}],accessed:[{prop:"link.currentAccess",type:"date"}]},this.sortTable=new Bt(this.constructor.name,this.sortSettings),this.loadShareLinks(),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(this.icons.faLink),this.layout.setBreadcrumbNav({url:`/${G.LINKS}/${Lt.SHARED_BY_LINKS}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShareLinks(){this.loading=!0,this.onSelect(),this.linksService.shareLinksList().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Links",t.error.message)}})}sortBy(t,o=!0,r){this.shares=this.sortTable.sortBy(t,o,r||this.shares)}onSelect(t=null){this.selected=t,this.store.linkSelection.set(this.selected)}openLinkDialog(){this.linksService.shareLink(this.selected.id).subscribe(t=>{this.layout.openDialog(Dn,"lg",{initialState:{share:t}}).content.shareChange.pipe(ce(1)).subscribe(r=>{let[p,u]=r;p==="update"?this.selected=Object.assign(this.selected,u):p==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(v=>v.id!==u.id)))})})}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}copyToClipboard(){this.selected&&(this.linksService.copyLinkToClipboard(this.selected.link.uuid),this.linkWasCopied=!0,this.layout.sendNotification("info","Link copied",this.selected.file.name||this.selected.name),setTimeout(()=>this.linkWasCopied=!1,3e3))}goTo(t){t=t||this.selected,this.sharesService.goTo(t).catch(console.error)}focusOn(t){let o=this.shares.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-shared-links"]],viewQuery:function(o,r){if(o&1&&(Z(Ke,5),Z(Re,7),Z(st,7),Z(xu,7),Z(Su,7)),o&2){let p;j(p=K())&&(r.scrollView=p.first),j(p=K())&&(r.inputFilter=p.first),j(p=K())&&(r.btnNavigationView=p.first),j(p=K())&&(r.mainContextMenu=p.first),j(p=K())&&(r.targetContextMenu=p.first)}},decls:33,vars:36,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-default","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","disabled","tooltip"],[3,"icon"],["container","body","type","button",3,"click","disabled","tooltip"],["container","body","type","button",1,"btn","btn-default",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","disabled","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","bg-purple",3,"font-size"],[1,"label-bottom-right"],[3,"class"],[1,"badge","bg-success"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events","text-file-name-preserve"],[1,"badge","bg-purple"],[3,"icon","fixedWidth"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected","disabled"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[1,"d-flex","flex-column"],[3,"share"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xs"],[1,"badge","bg-gray-dark","ms-1"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate","",1,"badge","sync-newly-0"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();s(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadShareLinks())}),_(3,"fa-icon",4),l(),s(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openLinkDialog())}),_(6,"fa-icon",6),l(),s(7,"button",7),b(8,"translate"),f("click",function(){return h(p),g(r.copyToClipboard())}),_(9,"fa-icon",6),l(),s(10,"button",8),b(11,"translate"),f("click",function(){return h(p),g(r.goTo())}),_(12,"fa-icon",6),l(),s(13,"div",9)(14,"div",10),_(15,"app-input-filter",11),l(),s(16,"app-navigation-view",12),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(17,Au,6,8,"div",13)(18,Qu,12,8),s(19,"div",14)(20,"span",15),d(21),b(22,"translate"),l()(),s(23,"context-menu",null,0),N(25,Yu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.loadShareLinks())}),l(),s(26,"context-menu",null,1),N(28,Xu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.goTo())}),N(29,Zu,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.openLinkDialog())}),N(30,Ju,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.copyToClipboard())}),N(31,e_,0,0,"ng-template",17)(32,t_,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(a(),m("tooltip",E(2,21,"Refresh",r.locale.language)),a(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),a(),m("disabled",!r.selected)("tooltip",E(5,24,"Edit link",r.locale.language)),a(2),m("icon",r.icons.faPen),a(),V(q("btn me-1 ",r.linkWasCopied?"btn-primary":"btn-default")),m("disabled",!r.selected)("tooltip",E(8,27,"Copy link",r.locale.language)),a(2),m("icon",r.linkWasCopied?r.icons.faClipboardCheck:r.icons.faClipboard),a(),m("disabled",!r.selected)("tooltip",E(11,30,"Go to",r.locale.language)),a(2),m("icon",r.icons.faMapMarkerAlt),a(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),a(),x(r.galleryMode!=null&&r.galleryMode.enabled?17:18),a(4),ke("",r.shares.length," ",E(22,33,"shares",r.locale.language)),a(10),m("divider",!0))},dependencies:[Ot,Vt,Nt,F,P,st,Ge,Me,Re,Ke,ri,St,tt,De,J,ht],encapsulation:2});let i=n;return i})();var Wr=class{constructor(n){this.syncs=[],this.newly=0,Object.assign(this,n),qc(this),this.hTimeAgo=Ai(this.createdAt).fromNow(!0),this.newly=ir(this.createdAt)}fallBackMimeUrl(){this.mimeUrl=Cr}};var jr=(()=>{let n=class n{transform(t,o=0,r=void 0){return bn(t,o,r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=on({name:"pathSlice",type:n,pure:!0});let i=n;return i})();var i_=i=>({$implicit:i});function n_(i,n){i&1&&(s(0,"span"),d(1,"loading..."),l())}var o_=["*"];function r_(i,n){if(i&1){let e=y();Hi(0,"span",2),Gn("click",function(o){h(e);let r=c();return g(r.node().mouseAction("expanderClick",o))}),da(1,"span",3),zi()}if(i&2){let e=c();L("toggle-children-wrapper-expanded",e.node().isExpanded)("toggle-children-wrapper-collapsed",e.node().isCollapsed)}}function a_(i,n){i&1&&da(0,"span",1)}var s_=(i,n,e)=>({$implicit:i,node:n,index:e});function l_(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c();a(),w(e.node().displayField)}}var yd=(i,n,e,t)=>({$implicit:i,node:n,index:e,templates:t});function c_(i,n){if(i&1&&_(0,"tree-node-checkbox",3),i&2){let e=c(2);m("node",e.node())}}function p_(i,n){if(i&1){let e=y();s(0,"div",2),C(1,c_,1,1,"tree-node-checkbox",3),_(2,"tree-node-expander",3),s(3,"div",4),f("click",function(o){h(e);let r=c();return g(r.node().mouseAction("click",o))})("dblclick",function(o){h(e);let r=c();return g(r.node().mouseAction("dblClick",o))})("mouseover",function(o){h(e);let r=c();return g(r.node().mouseAction("mouseOver",o))})("mouseout",function(o){h(e);let r=c();return g(r.node().mouseAction("mouseOut",o))})("contextmenu",function(o){h(e);let r=c();return g(r.node().mouseAction("contextMenu",o))})("treeDrop",function(o){h(e);let r=c();return g(r.node().onDrop(o))})("treeDropDragOver",function(o){h(e);let r=c();return g(r.node().mouseAction("dragOver",o))})("treeDropDragLeave",function(o){h(e);let r=c();return g(r.node().mouseAction("dragLeave",o))})("treeDropDragEnter",function(o){h(e);let r=c();return g(r.node().mouseAction("dragEnter",o))}),_(4,"tree-node-content",5),l()()}if(i&2){let e=c();B("padding-left",e.node().getNodePadding()),a(),x(e.node().options.useCheckbox?1:-1),a(),m("node",e.node()),a(),L("node-content-wrapper-active",e.node().isActive)("node-content-wrapper-focused",e.node().isFocused),m("treeAllowDrop",e.node().allowDrop)("allowDragoverStyling",e.node().allowDragoverStyling())("treeDrag",e.node())("treeDragEnabled",e.node().allowDrag()),a(),m("node",e.node())("index",e.index())("template",e.templates().treeNodeTemplate)}}function d_(i,n){if(i&1&&_(0,"tree-node-collection",1),i&2){let e=c(2);m("nodes",e.children())("templates",e.templates())("treeModel",e.node().treeModel)}}function m_(i,n){if(i&1&&_(0,"tree-loading-component",3),i&2){let e=c(2);B("padding-left",e.node().getNodePadding()),m("template",e.templates().loadingTemplate)("node",e.node())}}function u_(i,n){if(i&1&&(s(0,"div"),C(1,d_,1,3,"tree-node-collection",1),C(2,m_,1,4,"tree-loading-component",2),l()),i&2){let e=c();L("tree-children",!0)("tree-children-no-padding",e.node().options.levelPadding),a(),x(e.children()?1:-1),a(),x(e.children()?-1:2)}}function __(i,n){if(i&1&&_(0,"tree-node",0),i&2){let e=n.$implicit,t=n.$index,o=c();m("node",e)("index",t)("templates",o.templates())}}function f_(i,n){if(i&1&&_(0,"tree-node-drop-slot",2),i&2){let e=c(2);m("dropIndex",e.node().index)("node",e.node().parent)}}function h_(i,n){if(i&1&&(s(0,"div"),C(1,f_,1,2,"tree-node-drop-slot",2),_(2,"tree-node-wrapper",3)(3,"tree-node-children",4)(4,"tree-node-drop-slot",2),l()),i&2){let e=c();V(e.node().getClass()),L("tree-node",!0)("tree-node-expanded",e.node().isExpanded&&e.node().hasChildren)("tree-node-collapsed",e.node().isCollapsed&&e.node().hasChildren)("tree-node-leaf",e.node().isLeaf)("tree-node-active",e.node().isActive)("tree-node-focused",e.node().isFocused),a(),x(e.index()===0?1:-1),a(),m("node",e.node())("index",e.index())("templates",e.templates()),a(),m("node",e.node())("templates",e.templates()),a(),m("dropIndex",e.node().index+1)("node",e.node().parent)}}var g_=["loadingTemplate"],C_=["treeNodeTemplate"],x_=["treeNodeWrapperTemplate"],S_=["treeNodeFullTemplate"],v_=["viewport"],y_=(i,n,e,t)=>({loadingTemplate:i,treeNodeTemplate:n,treeNodeWrapperTemplate:e,treeNodeFullTemplate:t});function b_(i,n){if(i&1&&_(0,"tree-node-collection",4),i&2){let e=c();m("nodes",e.treeModel.roots)("treeModel",e.treeModel)("templates",Do(3,y_,e.loadingTemplate,e.treeNodeTemplate,e.treeNodeWrapperTemplate,e.treeNodeFullTemplate))}}function w_(i,n){if(i&1&&_(0,"tree-node-drop-slot",5),i&2){let e=c();m("dropIndex",0)("node",e.treeModel.virtualRoot)}}var nt={LEFT:37,UP:38,RIGHT:39,DOWN:40,ENTER:13,SPACE:32,CONTEXT_MENU:32},Ie={TOGGLE_ACTIVE:(i,n,e)=>n&&n.toggleActivated(),TOGGLE_ACTIVE_MULTI:(i,n,e)=>n&&n.toggleActivated(!0),TOGGLE_SELECTED:(i,n,e)=>n&&n.toggleSelected(),ACTIVATE:(i,n,e)=>n.setIsActive(!0),DEACTIVATE:(i,n,e)=>n.setIsActive(!1),SELECT:(i,n,e)=>n.setIsSelected(!0),DESELECT:(i,n,e)=>n.setIsSelected(!1),FOCUS:(i,n,e)=>n.focus(),TOGGLE_EXPANDED:(i,n,e)=>n.hasChildren&&n.toggleExpanded(),EXPAND:(i,n,e)=>n.expand(),COLLAPSE:(i,n,e)=>n.collapse(),DRILL_DOWN:(i,n,e)=>i.focusDrillDown(),DRILL_UP:(i,n,e)=>i.focusDrillUp(),NEXT_NODE:(i,n,e)=>i.focusNextNode(),PREVIOUS_NODE:(i,n,e)=>i.focusPreviousNode(),MOVE_NODE:(i,n,e,{from:t,to:o})=>{e.ctrlKey?i.copyNode(t,o):i.moveNode(t,o)}},Vn={mouse:{click:Ie.TOGGLE_ACTIVE,dblClick:null,contextMenu:null,expanderClick:Ie.TOGGLE_EXPANDED,checkboxClick:Ie.TOGGLE_SELECTED,drop:Ie.MOVE_NODE},keys:{[nt.RIGHT]:Ie.DRILL_DOWN,[nt.LEFT]:Ie.DRILL_UP,[nt.DOWN]:Ie.NEXT_NODE,[nt.UP]:Ie.PREVIOUS_NODE,[nt.SPACE]:Ie.TOGGLE_ACTIVE,[nt.ENTER]:Ie.TOGGLE_ACTIVE}},qr=class{get hasChildrenField(){return this.options.hasChildrenField||"hasChildren"}get childrenField(){return this.options.childrenField||"children"}get displayField(){return this.options.displayField||"name"}get idField(){return this.options.idField||"id"}get isExpandedField(){return this.options.isExpandedField||"isExpanded"}get getChildren(){return this.options.getChildren}get levelPadding(){return this.options.levelPadding||0}get useVirtualScroll(){return this.options.useVirtualScroll}get animateExpand(){return this.options.animateExpand}get animateSpeed(){return this.options.animateSpeed||1}get animateAcceleration(){return this.options.animateAcceleration||1.2}get scrollOnActivate(){return this.options.scrollOnActivate===void 0?!0:this.options.scrollOnActivate}get rtl(){return!!this.options.rtl}get rootId(){return this.options.rootId}get useCheckbox(){return this.options.useCheckbox}get useTriState(){return this.options.useTriState===void 0?!0:this.options.useTriState}get scrollContainer(){return this.options.scrollContainer}get allowDragoverStyling(){return this.options.allowDragoverStyling===void 0?!0:this.options.allowDragoverStyling}constructor(n={}){this.options=n,this.actionMapping={mouse:{click:this.options?.actionMapping?.mouse?.click??Vn.mouse.click,dblClick:this.options?.actionMapping?.mouse?.dblClick??Vn.mouse.dblClick,contextMenu:this.options?.actionMapping?.mouse?.contextMenu??Vn.mouse.contextMenu,expanderClick:this.options?.actionMapping?.mouse?.expanderClick??Vn.mouse.expanderClick,checkboxClick:this.options?.actionMapping?.mouse?.checkboxClick??Vn.mouse.checkboxClick,drop:this.options?.actionMapping?.mouse?.drop??Vn.mouse.drop,dragStart:this.options?.actionMapping?.mouse?.dragStart??void 0,drag:this.options?.actionMapping?.mouse?.drag??void 0,dragEnd:this.options?.actionMapping?.mouse?.dragEnd??void 0,dragOver:this.options?.actionMapping?.mouse?.dragOver??void 0,dragLeave:this.options?.actionMapping?.mouse?.dragLeave??void 0,dragEnter:this.options?.actionMapping?.mouse?.dragEnter??void 0,mouseOver:this.options?.actionMapping?.mouse?.mouseOver??void 0,mouseOut:this.options?.actionMapping?.mouse?.mouseOut??void 0},keys:{[nt.RIGHT]:Ie.DRILL_DOWN,[nt.LEFT]:Ie.DRILL_UP,[nt.DOWN]:Ie.NEXT_NODE,[nt.UP]:Ie.PREVIOUS_NODE,[nt.SPACE]:Ie.TOGGLE_ACTIVE,[nt.ENTER]:Ie.TOGGLE_ACTIVE}},this.options?.actionMapping?.keys&&(this.actionMapping.keys=re(re({},this.actionMapping.keys),this.options.actionMapping.keys)),n.rtl&&(this.actionMapping.keys[nt.RIGHT]=n.actionMapping?.keys[nt.RIGHT]||Ie.DRILL_UP,this.actionMapping.keys[nt.LEFT]=n.actionMapping?.keys[nt.LEFT]||Ie.DRILL_DOWN)}getNodeClone(n){if(this.options.getNodeClone)return this.options.getNodeClone(n);let e=Object.assign({},n.data);return e.id&&delete e.id,e}allowDrop(n,e,t){return this.options.allowDrop instanceof Function?this.options.allowDrop(n,e,t):this.options.allowDrop===void 0?!0:this.options.allowDrop}allowDrag(n){return this.options.allowDrag instanceof Function?this.options.allowDrag(n):this.options.allowDrag}nodeClass(n){return this.options.nodeClass?this.options.nodeClass(n):""}nodeHeight(n){if(n.data.virtual)return 0;let e=this.options.nodeHeight||22;return typeof e=="function"&&(e=e(n)),e+(n.index===0?2:1)*this.dropSlotHeight}get dropSlotHeight(){return typeof this.options.dropSlotHeight=="number"?this.options.dropSlotHeight:2}},Ve={toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",initialized:"initialized",updateData:"updateData",moveNode:"moveNode",copyNode:"copyNode",event:"event",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",stateChange:"stateChange"},Xa=class i{get children(){return this._children()}set children(n){this._children.set(n)}get index(){return this._index()}set index(n){this._index.set(n)}get position(){return this._position()}set position(n){this._position.set(n)}get height(){return this._height()}set height(n){this._height.set(n)}get isHidden(){return this.treeModel.isHidden(this)}get isExpanded(){return this.treeModel.isExpanded(this)}get isActive(){return this.treeModel.isActive(this)}get isFocused(){return this.treeModel.isNodeFocused(this)}get isSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children?.some(n=>n.isSelected)}get isAllSelected(){return this.isSelectable()?this.treeModel.isSelected(this):this.children?.every(n=>n.isAllSelected)}get isPartiallySelected(){return this.isSelected&&!this.isAllSelected}get level(){return this.parent?this.parent.level+1:0}get path(){return this.parent?[...this.parent.path,this.id]:[]}get elementRef(){throw`Element Ref is no longer supported since introducing virtual scroll
2
+
3
+ You may use a template to obtain a reference to the element`}get originalNode(){return this._originalNode}constructor(n,e,t,o){this.data=n,this.parent=e,this.treeModel=t,this._isLoadingChildren=!1,this._children=Ze(void 0),this._index=Ze(void 0),this._position=Ze(0),this._height=Ze(void 0),this.allowDrop=(r,p)=>this.options.allowDrop(r,{parent:this,index:0},p),this.allowDragoverStyling=()=>this.options.allowDragoverStyling,(this.id===void 0||this.id===null)&&(this.id=T_()),this.index=o,this.getField("children")&&this._initChildren(),this.autoLoadChildren()}get hasChildren(){return!!(this.getField("hasChildren")||this.children&&this.children.length>0)}get isCollapsed(){return!this.isExpanded}get isLeaf(){return!this.hasChildren}get isRoot(){return this.parent.data.virtual}get realParent(){return this.isRoot?null:this.parent}get options(){return this.treeModel.options}fireEvent(n){this.treeModel.fireEvent(n)}get displayField(){return this.getField("display")}get id(){return this.getField("id")}set id(n){this.setField("id",n)}getField(n){return this.data[this.options[`${n}Field`]]}setField(n,e){this.data[this.options[`${n}Field`]]=e}_findAdjacentSibling(n,e=!1){let t=this._getParentsChildren(e),o=t.indexOf(this);return t.length>o+n?t[o+n]:null}findNextSibling(n=!1){return this._findAdjacentSibling(1,n)}findPreviousSibling(n=!1){return this._findAdjacentSibling(-1,n)}getVisibleChildren(){return this.visibleChildren}get visibleChildren(){return(this.children||[]).filter(n=>!n.isHidden)}getFirstChild(n=!1){let e=n?this.visibleChildren:this.children;return e!=null&&e.length?e[0]:null}getLastChild(n=!1){let e=n?this.visibleChildren:this.children;return e!=null&&e.length?e[e.length-1]:null}findNextNode(n=!0,e=!1){return n&&this.isExpanded&&this.getFirstChild(e)||this.findNextSibling(e)||this.parent&&this.parent.findNextNode(!1,e)}findPreviousNode(n=!1){let e=this.findPreviousSibling(n);return e?e._getLastOpenDescendant(n):this.realParent}_getLastOpenDescendant(n=!1){let e=this.getLastChild(n);return this.isCollapsed||!e?this:e._getLastOpenDescendant(n)}_getParentsChildren(n=!1){return this.parent&&(n?this.parent.getVisibleChildren():this.parent.children)||[]}getIndexInParent(n=!1){return this._getParentsChildren(n).indexOf(this)}isDescendantOf(n){return this===n?!0:this.parent&&this.parent.isDescendantOf(n)}getNodePadding(){return this.options.levelPadding*(this.level-1)+"px"}getClass(){return[this.options.nodeClass(this),`tree-node-level-${this.level}`].join(" ")}onDrop(n){this.mouseAction("drop",n.event,{from:n.element,to:{parent:this,index:0,dropOnNode:!0}})}allowDrag(){return this.options.allowDrag(this)}loadNodeChildren(){return this.options.getChildren?Promise.resolve(this.options.getChildren(this)).then(n=>{n&&(this.setField("children",n),this._initChildren(),this.options.useTriState&&this.treeModel.isSelected(this)&&this.setIsSelected(!0),this.children.forEach(e=>{e.getField("isExpanded")&&e.hasChildren&&e.expand()}))}).then(()=>{this.fireEvent({eventName:Ve.loadNodeChildren,node:this})}):Promise.resolve()}expand(){return this.isExpanded||this.toggleExpanded(),this}collapse(){return this.isExpanded&&this.toggleExpanded(),this}doForAll(n){Promise.resolve(n(this)).then(()=>{this.children&&this.children.forEach(e=>e.doForAll(n))})}expandAll(){this.doForAll(n=>n.expand())}collapseAll(){this.doForAll(n=>n.collapse())}ensureVisible(){return this.realParent&&(this.realParent.expand(),this.realParent.ensureVisible()),this}toggleExpanded(){return this.setIsExpanded(!this.isExpanded),this}setIsExpanded(n){return this.hasChildren&&(this.treeModel.setExpandedNode(this,n),n&&!this.children&&this.hasChildren&&!this._isLoadingChildren&&(this._isLoadingChildren=!0,this.loadNodeChildren().finally(()=>{this._isLoadingChildren=!1}))),this}autoLoadChildren(){this.isExpanded&&!this.children&&this.hasChildren&&this.loadNodeChildren()}dispose(){this.children&&this.children.forEach(n=>n.dispose()),this.parent=null,this.children=null}setIsActive(n,e=!1){return this.treeModel.setActiveNode(this,n,e),n&&this.focus(this.options.scrollOnActivate),this}isSelectable(){return this.isLeaf||!this.children||!this.options.useTriState}setIsSelected(n){return this.isSelectable()?this.treeModel.setSelectedNode(this,n):this.visibleChildren.forEach(e=>e.setIsSelected(n)),this}toggleSelected(){return this.setIsSelected(!this.isSelected),this}toggleActivated(n=!1){return this.setIsActive(!this.isActive,n),this}setActiveAndVisible(n=!1){return this.setIsActive(!0,n).ensureVisible(),setTimeout(this.scrollIntoView.bind(this)),this}scrollIntoView(n=!1){this.treeModel.virtualScroll.scrollIntoView(this,n)}focus(n=!0){let e=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(this),n&&this.scrollIntoView(),e&&this.fireEvent({eventName:Ve.blur,node:e}),this.fireEvent({eventName:Ve.focus,node:this}),this}blur(){let n=this.treeModel.getFocusedNode();return this.treeModel.setFocusedNode(null),n&&this.fireEvent({eventName:Ve.blur,node:this}),this}setIsHidden(n){this.treeModel.setIsHidden(this,n)}hide(){this.setIsHidden(!0)}show(){this.setIsHidden(!1)}mouseAction(n,e,t=null){this.treeModel.setFocus(!0);let r=this.options.actionMapping.mouse[n];r&&r(this.treeModel,this,e,t)}getSelfHeight(){return this.options.nodeHeight(this)}_initChildren(){this.children=this.getField("children").map((n,e)=>new i(n,this,this.treeModel,e))}};function T_(){return Math.floor(Math.random()*1e13)}var Za=(()=>{let n=class n{constructor(){this.options=new qr,this.eventNames=Object.keys(Ve),this._roots=Ze(void 0),this._expandedNodeIds=Ze({}),this._selectedLeafNodeIds=Ze({}),this._activeNodeIds=Ze({}),this._hiddenNodeIds=Ze({}),this._focusedNodeId=Ze(null),this._virtualRoot=Ze(void 0),this.firstUpdate=!0,this.subscriptions=[]}get roots(){return this._roots()}set roots(t){this._roots.set(t)}get virtualRoot(){return this._virtualRoot()}get focusedNode(){let t=this._focusedNodeId();return t?this.getNodeById(t):null}get expandedNodes(){let t=this._expandedNodeIds();return Object.keys(t).filter(r=>t[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get activeNodes(){let t=this._activeNodeIds();return Object.keys(t).filter(r=>t[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get hiddenNodes(){let t=this._hiddenNodeIds();return Object.keys(t).filter(r=>t[r]).map(r=>this.getNodeById(r)).filter(Boolean)}get selectedLeafNodes(){let t=this._selectedLeafNodeIds();return Object.keys(t).filter(r=>t[r]).map(r=>this.getNodeById(r)).filter(Boolean)}fireEvent(t){t.treeModel=this,this.events[t.eventName].emit(t),this.events.event.emit(t)}subscribe(t,o){let r=this.events[t].subscribe(o);this.subscriptions.push(r)}getFocusedNode(){return this.focusedNode}getActiveNode(){return this.activeNodes[0]}getActiveNodes(){return this.activeNodes}getVisibleRoots(){return this._virtualRoot()?.visibleChildren}getFirstRoot(t=!1){let o=t?this.getVisibleRoots():this.roots;return o!=null&&o.length?o[0]:null}getLastRoot(t=!1){let o=t?this.getVisibleRoots():this.roots;return o!=null&&o.length?o[o.length-1]:null}get isFocused(){return n.focusedTree===this}isNodeFocused(t){return this.focusedNode===t}isEmptyTree(){let t=this.roots;return t&&t.length===0}getNodeByPath(t,o=null){if(!t)return null;if(o=o||this._virtualRoot(),t.length===0)return o;if(!o.children)return null;let r=t.shift(),p=o.children.find(u=>u.id===r);return p?this.getNodeByPath(t,p):null}getNodeById(t){let o=t.toString();return this.getNodeBy(r=>r.id.toString()===o)}getNodeBy(t,o=null){if(o=o||this._virtualRoot(),!o.children)return null;let r=o.children.find(t);if(r)return r;for(let p of o.children){let u=this.getNodeBy(t,p);if(u)return u}}isExpanded(t){return this._expandedNodeIds()[t.id]}isHidden(t){return this._hiddenNodeIds()[t.id]}isActive(t){return this._activeNodeIds()[t.id]}isSelected(t){return this._selectedLeafNodeIds()[t.id]}ngOnDestroy(){this.dispose(),this.unsubscribeAll()}dispose(){let t=this._virtualRoot();t&&t.dispose()}unsubscribeAll(){this.subscriptions.forEach(t=>t.unsubscribe()),this.subscriptions=[]}setData({nodes:t,options:o=null,events:r=null}){o&&(this.options=new qr(o)),r&&(this.events=r),t&&(this.nodes=t),this.update()}update(){let t={id:this.options.rootId,virtual:!0,[this.options.childrenField]:this.nodes};this.dispose();let o=new Xa(t,null,this,0);this._virtualRoot.set(o),this.roots=o.children;let r=this.roots;this.firstUpdate?r&&(this.firstUpdate=!1,this._calculateExpandedNodes()):this.fireEvent({eventName:Ve.updateData})}setFocusedNode(t){this._focusedNodeId.set(t?t.id:null)}setFocus(t){n.focusedTree=t?this:null}doForAll(t){this.roots.forEach(o=>o.doForAll(t))}focusNextNode(){let t=this.getFocusedNode(),o=t?t.findNextNode(!0,!0):this.getFirstRoot(!0);o&&o.focus()}focusPreviousNode(){let t=this.getFocusedNode(),o=t?t.findPreviousNode(!0):this.getLastRoot(!0);o&&o.focus()}focusDrillDown(){let t=this.getFocusedNode();if(t&&t.isCollapsed&&t.hasChildren)t.toggleExpanded();else{let o=t?t.getFirstChild(!0):this.getFirstRoot(!0);o&&o.focus()}}focusDrillUp(){let t=this.getFocusedNode();if(t)if(t.isExpanded)t.toggleExpanded();else{let o=t.realParent;o&&o.focus()}}setActiveNode(t,o,r=!1){r?this._setActiveNodeMulti(t,o):this._setActiveNodeSingle(t,o),o?(t.focus(this.options.scrollOnActivate),this.fireEvent({eventName:Ve.activate,node:t}),this.fireEvent({eventName:Ve.nodeActivate,node:t})):(this.fireEvent({eventName:Ve.deactivate,node:t}),this.fireEvent({eventName:Ve.nodeDeactivate,node:t}))}setSelectedNode(t,o){this._selectedLeafNodeIds.update(r=>Se(re({},r),{[t.id]:o})),o?(t.focus(),this.fireEvent({eventName:Ve.select,node:t})):this.fireEvent({eventName:Ve.deselect,node:t})}setExpandedNode(t,o){this._expandedNodeIds.update(r=>Se(re({},r),{[t.id]:o})),this.fireEvent({eventName:Ve.toggleExpanded,node:t,isExpanded:o})}expandAll(){this.roots.forEach(t=>t.expandAll())}collapseAll(){this.roots.forEach(t=>t.collapseAll())}setIsHidden(t,o){this._hiddenNodeIds.update(r=>Se(re({},r),{[t.id]:o}))}setHiddenNodeIds(t){let o=t.reduce((r,p)=>Se(re({},r),{[p]:!0}),{});this._hiddenNodeIds.set(o)}performKeyAction(t,o){let r=this.options.actionMapping.keys[o.keyCode];return r?(o.preventDefault(),r(this,t,o),!0):!1}filterNodes(t,o=!0){let r;if(!t)return this.clearFilter();if(t&&typeof t.valueOf()=="string")r=u=>u.displayField.toLowerCase().indexOf(t.toLowerCase())!==-1;else if(t&&typeof t=="function")r=t;else{console.error("Don't know what to do with filter",t),console.error("Should be either a string or function");return}let p={};this.roots.forEach(u=>this._filterNode(p,u,r,o)),this._hiddenNodeIds.set(p),this.fireEvent({eventName:Ve.changeFilter})}clearFilter(){this._hiddenNodeIds.set({}),this.fireEvent({eventName:Ve.changeFilter})}moveNode(t,o){let r=t.getIndexInParent(),p=t.parent;if(!this.canMoveNode(t,o,r))return;let u=p.getField("children");o.parent.getField("children")||o.parent.setField("children",[]);let v=o.parent.getField("children"),T=u.splice(r,1)[0],R=p===o.parent&&o.index>r?o.index-1:o.index;v.splice(R,0,T),p.treeModel.update(),o.parent.treeModel!==p.treeModel&&o.parent.treeModel.update(),this.fireEvent({eventName:Ve.moveNode,node:T,to:{parent:o.parent.data,index:R},from:{parent:p.data,index:r}})}copyNode(t,o){let r=t.getIndexInParent();if(!this.canMoveNode(t,o,r))return;o.parent.getField("children")||o.parent.setField("children",[]);let p=o.parent.getField("children"),u=this.options.getNodeClone(t);p.splice(o.index,0,u),t.treeModel.update(),o.parent.treeModel!==t.treeModel&&o.parent.treeModel.update(),this.fireEvent({eventName:Ve.copyNode,node:u,to:{parent:o.parent.data,index:o.index}})}getState(){return{expandedNodeIds:this._expandedNodeIds(),selectedLeafNodeIds:this._selectedLeafNodeIds(),activeNodeIds:this._activeNodeIds(),hiddenNodeIds:this._hiddenNodeIds(),focusedNodeId:this._focusedNodeId()}}setState(t){t&&(this._expandedNodeIds.set(t.expandedNodeIds||{}),this._selectedLeafNodeIds.set(t.selectedLeafNodeIds||{}),this._activeNodeIds.set(t.activeNodeIds||{}),this._hiddenNodeIds.set(t.hiddenNodeIds||{}),this._focusedNodeId.set(t.focusedNodeId))}subscribeToState(t){Ht(()=>t(this.getState()))}canMoveNode(t,o,r=void 0){let p=r||t.getIndexInParent();return t.parent===o.parent&&r===o.index?!1:!o.parent.isDescendantOf(t)}calculateExpandedNodes(){this._calculateExpandedNodes()}_filterNode(t,o,r,p){let u=r(o);return o.children&&o.children.forEach(v=>{this._filterNode(t,v,r,p)&&(u=!0)}),u||(t[o.id]=!0),p&&u&&o.ensureVisible(),u}_calculateExpandedNodes(t=null){t=t||this._virtualRoot(),t.data[this.options.isExpandedField]&&this._expandedNodeIds.update(o=>Se(re({},o),{[t.id]:!0})),t.children&&t.children.forEach(o=>this._calculateExpandedNodes(o))}_setActiveNodeSingle(t,o){this.activeNodes.filter(r=>r!==t).forEach(r=>{this.fireEvent({eventName:Ve.deactivate,node:r}),this.fireEvent({eventName:Ve.nodeDeactivate,node:r})}),o?this._activeNodeIds.set({[t.id]:!0}):this._activeNodeIds.set({})}_setActiveNodeMulti(t,o){this._activeNodeIds.update(r=>Se(re({},r),{[t.id]:o}))}};n.focusedTree=null,n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac});let i=n;return i})(),Ja=(()=>{let n=class n{constructor(){this._draggedElement=null}set(t){this._draggedElement=t}get(){return this._draggedElement}isDragging(){return!!this.get()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})(),hd=500,Kr=150,gd=(()=>{let n=class n{get yBlocks(){return this._yBlocks()}set yBlocks(t){this._yBlocks.set(t)}get x(){return this._x()}set x(t){this._x.set(t)}get viewportHeight(){return this._viewportHeight()}set viewportHeight(t){this._viewportHeight.set(t)}get y(){return this.yBlocks*Kr}get totalHeight(){let t=this.treeModel._virtualRoot();return t?t.height:0}constructor(){this.treeModel=S(Za),this._dispose=[],this._yBlocks=Ze(0),this._x=Ze(0),this._viewportHeight=Ze(null),this.viewport=null;let t=this.treeModel;t.virtualScroll=this}fireEvent(t){this.treeModel.fireEvent(t)}init(){let t=this.recalcPositions.bind(this);t(),this.treeModel.subscribe(Ve.loadNodeChildren,t)}setupWatchers(t){let o=this.recalcPositions.bind(this),r=Ht(()=>{let T=this._yBlocks(),R=this.totalHeight,O=this._viewportHeight();this.fixScroll()},{injector:t}),p=Ht(()=>{let T=this.treeModel.roots;o()},{injector:t}),u=Ht(()=>{let T=this.treeModel.expandedNodes;o()},{injector:t}),v=Ht(()=>{let T=this.treeModel.hiddenNodes;o()},{injector:t});this._dispose=[()=>r.destroy(),()=>p.destroy(),()=>u.destroy(),()=>v.destroy()]}isEnabled(){return this.treeModel.options.useVirtualScroll}_setYBlocks(t){this.yBlocks=t}recalcPositions(){let t=this.treeModel._virtualRoot();t&&(t.height=this._getPositionAfter(this.treeModel.getVisibleRoots(),0))}_getPositionAfter(t,o){let r=o;return t.forEach(p=>{p.position=r,r=this._getPositionAfterNode(p,r)}),r}_getPositionAfterNode(t,o){let r=t.getSelfHeight()+o;return t.children&&t.isExpanded&&(r=this._getPositionAfter(t.visibleChildren,r)),t.height=r-o,r}clear(){this._dispose.forEach(t=>t())}setViewport(t){Object.assign(this,{viewport:t,x:t.scrollLeft,yBlocks:Math.round(t.scrollTop/Kr),viewportHeight:t.getBoundingClientRect?t.getBoundingClientRect().height:0})}scrollIntoView(t,o,r=!0){if(t.options.scrollContainer){let p=t.options.scrollContainer,u=p.getBoundingClientRect().height,v=p.getBoundingClientRect().top,T=this.viewport.getBoundingClientRect().top+t.position-v;(o||T<p.scrollTop||T+t.getSelfHeight()>p.scrollTop+u)&&(p.scrollTop=r?T-u/2:T)}else(o||t.position<this.y||t.position+t.getSelfHeight()>this.y+this.viewportHeight)&&this.viewport&&(this.viewport.scrollTop=r?t.position-this.viewportHeight/2:t.position,this._setYBlocks(Math.floor(this.viewport.scrollTop/Kr)))}getViewportNodes(t){if(!t)return[];let o=t.filter(T=>!T.isHidden);if(!this.isEnabled())return o;if(!this.viewportHeight||!o.length)return[];let r=o.slice(-1)[0];if(!r.height&&r.position===0)return[];let p=Cd(o,T=>T.position+hd>this.y||T.position+T.height>this.y),u=Cd(o,T=>T.position-hd>this.y+this.viewportHeight,p),v=[];for(let T=p;T<=u;T++)v.push(o[T]);return v}fixScroll(){let t=Math.max(0,this.totalHeight-this.viewportHeight);this.y<0&&this._setYBlocks(0),this.y>t&&this._setYBlocks(t/Kr)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac});let i=n;return i})();function Cd(i,n,e=0){let t=e,o=i.length-1;for(;t!==o;){let r=Math.floor((t+o)/2);n(i[r])?o=r:t===r?t=o:t=r}return t}var E_=(()=>{let n=class n{constructor(){this.template=se(void 0),this.node=se(void 0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-loading-component"]],inputs:{template:[1,"template"],node:[1,"node"]},decls:2,vars:5,consts:[[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(o,r){o&1&&(C(0,n_,2,0,"span"),ct(1,0)),o&2&&(x(r.template()?-1:0),a(),m("ngTemplateOutlet",r.template())("ngTemplateOutletContext",Je(3,i_,r.node())))},dependencies:[zt],encapsulation:2});let i=n;return i})(),A_=(()=>{let n=class n{constructor(){this.elementRef=S(hi),this.virtualScroll=S(gd),this.injector=S(Hn),this.setViewport=this.throttle(()=>{this.virtualScroll.setViewport(this.elementRef.nativeElement)},17),this.scrollEventHandler=this.setViewport.bind(this)}ngOnInit(){this.virtualScroll.init(),this.virtualScroll.setupWatchers(this.injector)}ngAfterViewInit(){setTimeout(()=>{this.setViewport(),this.virtualScroll.fireEvent({eventName:Ve.initialized})}),this.elementRef.nativeElement.addEventListener("scroll",this.scrollEventHandler)}ngOnDestroy(){this.virtualScroll.clear(),this.elementRef.nativeElement.removeEventListener("scroll",this.scrollEventHandler)}getTotalHeight(){return this.virtualScroll.isEnabled()&&this.virtualScroll.totalHeight+"px"||"auto"}throttle(t,o){let r=0;return function(){let p=Date.now();p-r>=o&&(t(),r=p)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-viewport"]],features:[ua([gd])],ngContentSelectors:o_,decls:2,vars:2,template:function(o,r){o&1&&(ys(),Hi(0,"div"),bs(1),zi()),o&2&&B("height",r.getTotalHeight())},encapsulation:2});let i=n;return i})(),xd="is-dragging-over",Sd="is-dragging-over-disabled",bd=(()=>{let n=class n{allowDrop(t){return this._allowDrop(this.treeDraggedElement.get(),t)}constructor(){this.el=S(hi),this.renderer=S(Dt),this.treeDraggedElement=S(Ja),this.ngZone=S($i),this.allowDragoverStyling=se(!0),this.treeAllowDrop=se(void 0),this.onDropCallback=Qn({alias:"treeDrop"}),this.onDragOverCallback=Qn({alias:"treeDropDragOver"}),this.onDragLeaveCallback=Qn({alias:"treeDropDragLeave"}),this.onDragEnterCallback=Qn({alias:"treeDropDragEnter"}),this._allowDrop=(t,o)=>!0,this.dragOverEventHandler=this.onDragOver.bind(this),this.dragEnterEventHandler=this.onDragEnter.bind(this),this.dragLeaveEventHandler=this.onDragLeave.bind(this),Ht(()=>{let t=this.treeAllowDrop();t instanceof Function?this._allowDrop=t:t!==void 0&&(this._allowDrop=(o,r)=>t)})}ngAfterViewInit(){let t=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{t.addEventListener("dragover",this.dragOverEventHandler),t.addEventListener("dragenter",this.dragEnterEventHandler),t.addEventListener("dragleave",this.dragLeaveEventHandler)})}ngOnDestroy(){let t=this.el.nativeElement;t.removeEventListener("dragover",this.dragOverEventHandler),t.removeEventListener("dragenter",this.dragEnterEventHandler),t.removeEventListener("dragleave",this.dragLeaveEventHandler)}onDragOver(t){if(!this.allowDrop(t))return this.allowDragoverStyling()?this.addDisabledClass():void 0;this.onDragOverCallback.emit({event:t,element:this.treeDraggedElement.get()}),t.preventDefault(),this.allowDragoverStyling()&&this.addClass()}onDragEnter(t){this.allowDrop(t)&&(t.preventDefault(),this.onDragEnterCallback.emit({event:t,element:this.treeDraggedElement.get()}))}onDragLeave(t){if(!this.allowDrop(t))return this.allowDragoverStyling()?this.removeDisabledClass():void 0;this.onDragLeaveCallback.emit({event:t,element:this.treeDraggedElement.get()}),this.allowDragoverStyling()&&this.removeClass()}onDrop(t){this.allowDrop(t)&&(t.preventDefault(),this.onDropCallback.emit({event:t,element:this.treeDraggedElement.get()}),this.allowDragoverStyling()&&this.removeClass(),this.treeDraggedElement.set(null))}addClass(){this.renderer.addClass(this.el.nativeElement,xd)}removeClass(){this.renderer.removeClass(this.el.nativeElement,xd)}addDisabledClass(){this.renderer.addClass(this.el.nativeElement,Sd)}removeDisabledClass(){this.renderer.removeClass(this.el.nativeElement,Sd)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Ci({type:n,selectors:[["","treeDrop",""]],hostBindings:function(o,r){o&1&&f("drop",function(u){return r.onDrop(u)})},inputs:{allowDragoverStyling:[1,"allowDragoverStyling"],treeAllowDrop:[1,"treeAllowDrop"]},outputs:{onDropCallback:"treeDrop",onDragOverCallback:"treeDropDragOver",onDragLeaveCallback:"treeDropDragLeave",onDragEnterCallback:"treeDropDragEnter"}});let i=n;return i})(),wd=(()=>{let n=class n{constructor(){this.node=se(void 0),this.dropIndex=se(void 0)}onDrop(t){this.node().mouseAction("drop",t.event,{from:t.element,to:{parent:this.node(),index:this.dropIndex()}})}allowDrop(t,o){return this.node().options.allowDrop(t,{parent:this.node(),index:this.dropIndex()},o)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["TreeNodeDropSlot"],["tree-node-drop-slot"]],inputs:{node:[1,"node"],dropIndex:[1,"dropIndex"]},decls:1,vars:2,consts:[[1,"node-drop-slot",3,"treeDrop","treeAllowDrop","allowDragoverStyling"]],template:function(o,r){o&1&&(s(0,"div",0),f("treeDrop",function(u){return r.onDrop(u)}),l()),o&2&&m("treeAllowDrop",r.allowDrop.bind(r))("allowDragoverStyling",!0)},dependencies:[bd],encapsulation:2});let i=n;return i})(),k_=(()=>{let n=class n{constructor(){this.node=se(void 0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-checkbox"]],inputs:{node:[1,"node"]},decls:1,vars:2,consts:[["type","checkbox",1,"tree-node-checkbox",3,"click","checked","indeterminate"]],template:function(o,r){o&1&&(Hi(0,"input",0),Gn("click",function(u){return r.node().mouseAction("checkboxClick",u)}),zi()),o&2&&Ao("checked",r.node().isSelected)("indeterminate",r.node().isPartiallySelected)},encapsulation:2});let i=n;return i})(),es=(()=>{let n=class n{constructor(){this.node=se(),this.hasChildren=ve(()=>this.node().hasChildren)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-expander"]],inputs:{node:[1,"node"]},decls:2,vars:2,consts:[[1,"toggle-children-wrapper",3,"toggle-children-wrapper-expanded","toggle-children-wrapper-collapsed"],[1,"toggle-children-placeholder"],[1,"toggle-children-wrapper",3,"click"],[1,"toggle-children"]],template:function(o,r){o&1&&(C(0,r_,2,4,"span",0),C(1,a_,1,0,"span",1)),o&2&&(x(r.hasChildren()?0:-1),a(),x(r.hasChildren()?-1:1))},encapsulation:2});let i=n;return i})();var D_=(()=>{let n=class n{constructor(){this.el=S(hi),this.renderer=S(Dt),this.treeDraggedElement=S(Ja),this.ngZone=S($i),this.draggedElement=se(void 0,{alias:"treeDrag"}),this.treeDragEnabled=se(void 0),this.dragEventHandler=this.onDrag.bind(this)}ngAfterViewInit(){let t=this.el.nativeElement;this.ngZone.runOutsideAngular(()=>{t.addEventListener("drag",this.dragEventHandler)})}ngDoCheck(){this.renderer.setAttribute(this.el.nativeElement,"draggable",this.treeDragEnabled()?"true":"false")}ngOnDestroy(){this.el.nativeElement.removeEventListener("drag",this.dragEventHandler)}onDragStart(t){t.dataTransfer.setData("text",t.target.id);let o=this.draggedElement();this.treeDraggedElement.set(o),o.mouseAction&&o.mouseAction("dragStart",t)}onDrag(t){let o=this.draggedElement();o.mouseAction&&o.mouseAction("drag",t)}onDragEnd(){let t=this.draggedElement();t.mouseAction&&t.mouseAction("dragEnd"),this.treeDraggedElement.set(null)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Ci({type:n,selectors:[["","treeDrag",""]],hostBindings:function(o,r){o&1&&f("dragstart",function(u){return r.onDragStart(u)})("dragend",function(){return r.onDragEnd()})},inputs:{draggedElement:[1,"treeDrag","draggedElement"],treeDragEnabled:[1,"treeDragEnabled"]}});let i=n;return i})(),ts=(()=>{let n=class n{constructor(){this.node=se(void 0),this.index=se(void 0),this.template=se(void 0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-content"]],inputs:{node:[1,"node"],index:[1,"index"],template:[1,"template"]},decls:2,vars:7,consts:[[3,"ngTemplateOutlet","ngTemplateOutletContext"]],template:function(o,r){o&1&&(C(0,l_,2,1,"span"),ct(1,0)),o&2&&(x(r.template()?-1:0),a(),m("ngTemplateOutlet",r.template())("ngTemplateOutletContext",Es(3,s_,r.node(),r.node(),r.index())))},dependencies:[zt],encapsulation:2});let i=n;return i})(),M_=(()=>{let n=class n{constructor(){this.node=se(),this.index=se(void 0),this.templates=se(),this.treeNodeWrapperTemplate=ve(()=>this.templates().treeNodeWrapperTemplate)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-wrapper"]],inputs:{node:[1,"node"],index:[1,"index"],templates:[1,"templates"]},decls:2,vars:8,consts:[[1,"node-wrapper",3,"padding-left"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"node-wrapper"],[3,"node"],[1,"node-content-wrapper",3,"click","dblclick","mouseover","mouseout","contextmenu","treeDrop","treeDropDragOver","treeDropDragLeave","treeDropDragEnter","treeAllowDrop","allowDragoverStyling","treeDrag","treeDragEnabled"],[3,"node","index","template"]],template:function(o,r){o&1&&(C(0,p_,5,15,"div",0),ct(1,1)),o&2&&(x(r.treeNodeWrapperTemplate()?-1:0),a(),m("ngTemplateOutlet",r.treeNodeWrapperTemplate())("ngTemplateOutletContext",Do(3,yd,r.node(),r.node(),r.index(),r.templates())))},dependencies:[k_,es,D_,bd,ts,zt],encapsulation:2});let i=n;return i})(),vd=1.005,F_=(()=>{let n=class n{constructor(){this.renderer=S(Dt),this.templateRef=S(Cs),this.viewContainerRef=S(Ss),this.isOpen=se(void 0,{alias:"treeAnimateOpen"}),this.animateSpeed=se(void 0,{alias:"treeAnimateOpenSpeed"}),this.animateAcceleration=se(void 0,{alias:"treeAnimateOpenAcceleration"}),this.isEnabled=se(void 0,{alias:"treeAnimateOpenEnabled"}),Ht(()=>{let t=this.isOpen();t?(this._show(),this.isEnabled()&&this.previousIsOpen===!1&&this._animateOpen()):this.isEnabled()?this._animateClose():this._hide(),this.previousIsOpen=!!t})}_show(){this.innerElement||(this.innerElement=this.viewContainerRef.createEmbeddedView(this.templateRef).rootNodes[0])}_hide(){this.viewContainerRef.clear(),this.innerElement=null}_animateOpen(){let t=this.animateSpeed(),o=this.animateAcceleration(),r=0;this.renderer.setStyle(this.innerElement,"max-height","0"),setTimeout(()=>{let p=setInterval(()=>{if(!this.isOpen()||!this.innerElement)return clearInterval(p);r+=t;let u=Math.round(r);this.renderer.setStyle(this.innerElement,"max-height",`${u}px`);let v=this.innerElement.getBoundingClientRect?this.innerElement.getBoundingClientRect().height:0;t*=o,o*=vd,v<u&&(this.renderer.setStyle(this.innerElement,"max-height",null),clearInterval(p))},17)})}_animateClose(){if(!this.innerElement)return;let t=this.animateSpeed(),o=this.animateAcceleration(),r=this.innerElement.getBoundingClientRect().height,p=setInterval(()=>{if(this.isOpen()||!this.innerElement)return clearInterval(p);r-=t,this.renderer.setStyle(this.innerElement,"max-height",`${r}px`),t*=o,o*=vd,r<=0&&(this.viewContainerRef.clear(),this.innerElement=null,clearInterval(p))},17)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Ci({type:n,selectors:[["","treeAnimateOpen",""]],inputs:{isOpen:[1,"treeAnimateOpen","isOpen"],animateSpeed:[1,"treeAnimateOpenSpeed","animateSpeed"],animateAcceleration:[1,"treeAnimateOpenAcceleration","animateAcceleration"],isEnabled:[1,"treeAnimateOpenEnabled","isEnabled"]}});let i=n;return i})(),P_=(()=>{let n=class n{constructor(){this.node=se(),this.templates=se(void 0),this.children=ve(()=>this.node().children)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-children"]],inputs:{node:[1,"node"],templates:[1,"templates"]},decls:1,vars:4,consts:[[3,"tree-children","tree-children-no-padding",4,"treeAnimateOpen","treeAnimateOpenSpeed","treeAnimateOpenAcceleration","treeAnimateOpenEnabled"],[3,"nodes","templates","treeModel"],[1,"tree-node-loading",3,"padding-left","template","node"],[1,"tree-node-loading",3,"template","node"]],template:function(o,r){o&1&&N(0,u_,3,6,"div",0),o&2&&m("treeAnimateOpen",r.node().isExpanded)("treeAnimateOpenSpeed",r.node().options.animateSpeed)("treeAnimateOpenAcceleration",r.node().options.animateAcceleration)("treeAnimateOpenEnabled",r.node().options.animateExpand)},dependencies:()=>[F_,Td,E_],encapsulation:2});let i=n;return i})(),Td=(()=>{let n=class n{constructor(){this.nodes=se(void 0),this.treeModel=se(void 0),this.injector=S(Hn),this.templates=se(void 0),this.viewportNodes=Ze([]),this.marginTop=ve(()=>{let t=this.viewportNodes(),o=t&&t.length&&t[0];return`${o&&o.parent?o.position-o.parent.position-o.parent.getSelfHeight():0}px`}),this._disposeEffects=[]}ngOnInit(){this.virtualScroll=this.treeModel().virtualScroll;let t=Ht(()=>{let o=this.nodes();if(o&&this.virtualScroll){let r=this.virtualScroll.getViewportNodes(o);this.viewportNodes.set(r)}},{injector:this.injector});this._disposeEffects=[()=>t.destroy()]}ngOnDestroy(){this._disposeEffects.forEach(t=>t())}trackNode(t,o){return o.id}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["tree-node-collection"]],inputs:{nodes:[1,"nodes"],treeModel:[1,"treeModel"],templates:[1,"templates"]},decls:3,vars:2,consts:[[3,"node","index","templates"]],template:function(o,r){o&1&&(s(0,"div"),D(1,__,1,3,"tree-node",0,r.trackNode,!0),l()),o&2&&(B("margin-top",r.marginTop()),a(),M(r.viewportNodes()))},dependencies:()=>[I_],encapsulation:2});let i=n;return i})(),I_=(()=>{let n=class n{constructor(){this.node=se(void 0),this.index=se(void 0),this.templates=se(),this.treeNodeFullTemplate=ve(()=>this.templates().treeNodeFullTemplate)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["TreeNode"],["tree-node"]],inputs:{node:[1,"node"],index:[1,"index"],templates:[1,"templates"]},decls:2,vars:8,consts:[[3,"class","tree-node","tree-node-expanded","tree-node-collapsed","tree-node-leaf","tree-node-active","tree-node-focused"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"dropIndex","node"],[3,"node","index","templates"],[3,"node","templates"]],template:function(o,r){o&1&&(C(0,h_,5,22,"div",0),ct(1,1)),o&2&&(x(r.treeNodeFullTemplate()?-1:0),a(),m("ngTemplateOutlet",r.treeNodeFullTemplate())("ngTemplateOutletContext",Do(3,yd,r.node(),r.node(),r.index(),r.templates())))},dependencies:[wd,M_,P_,zt],encapsulation:2});let i=n;return i})(),Ed=(()=>{let n=class n{set nodes(t){}set options(t){}set focused(t){this.treeModel.setFocus(t)}set state(t){this.treeModel.setState(t)}constructor(){this.treeModel=S(Za),this.treeDraggedElement=S(Ja);let t=this.treeModel;t.eventNames.forEach(o=>this[o]=new ae),t.subscribeToState(o=>this.stateChange.emit(o))}onKeydown(t){if(!this.treeModel.isFocused||["input","textarea"].includes(document.activeElement.tagName.toLowerCase()))return;let o=this.treeModel.getFocusedNode();this.treeModel.performKeyAction(o,t)}onMousedown(t){function o(r,p){return r?r.localName===p?!1:o(r.parentElement,p):!0}o(t.target,"tree-root")&&this.treeModel.setFocus(!1)}ngOnChanges(t){(t.options||t.nodes)&&this.treeModel.setData({options:t.options&&t.options.currentValue,nodes:t.nodes&&t.nodes.currentValue,events:this.pick(this,this.treeModel.eventNames)})}sizeChanged(){this.viewportComponent.setViewport()}pick(t,o){return o.reduce((r,p)=>(t&&t.hasOwnProperty(p)&&(r[p]=t[p]),r),{})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["Tree"],["tree-root"]],contentQueries:function(o,r,p){if(o&1&&(Wn(p,g_,5),Wn(p,C_,5),Wn(p,x_,5),Wn(p,S_,5)),o&2){let u;j(u=K())&&(r.loadingTemplate=u.first),j(u=K())&&(r.treeNodeTemplate=u.first),j(u=K())&&(r.treeNodeWrapperTemplate=u.first),j(u=K())&&(r.treeNodeFullTemplate=u.first)}},viewQuery:function(o,r){if(o&1&&Z(v_,5),o&2){let p;j(p=K())&&(r.viewportComponent=p.first)}},hostBindings:function(o,r){o&1&&f("keydown",function(u){return r.onKeydown(u)},ca)("mousedown",function(u){return r.onMousedown(u)},ca)},inputs:{nodes:"nodes",options:"options",focused:"focused",state:"state"},outputs:{toggleExpanded:"toggleExpanded",activate:"activate",deactivate:"deactivate",nodeActivate:"nodeActivate",nodeDeactivate:"nodeDeactivate",select:"select",deselect:"deselect",focus:"focus",blur:"blur",updateData:"updateData",initialized:"initialized",moveNode:"moveNode",copyNode:"copyNode",loadNodeChildren:"loadNodeChildren",changeFilter:"changeFilter",event:"event",stateChange:"stateChange"},features:[ua([Za]),nn],decls:5,vars:6,consts:[["viewport",""],[1,"angular-tree-component"],[3,"nodes","treeModel","templates",4,"ngIf"],["class","empty-tree-drop-slot",3,"dropIndex","node",4,"ngIf"],[3,"nodes","treeModel","templates"],[1,"empty-tree-drop-slot",3,"dropIndex","node"]],template:function(o,r){o&1&&(s(0,"tree-viewport",null,0)(2,"div",1),N(3,b_,1,8,"tree-node-collection",2)(4,w_,1,2,"tree-node-drop-slot",3),l()()),o&2&&(a(2),L("node-dragging",r.treeDraggedElement.isDragging())("angular-tree-component-rtl",r.treeModel.options.rtl),a(),m("ngIf",r.treeModel.roots),a(),m("ngIf",r.treeModel.isEmptyTree()))},dependencies:[A_,Is,Td,wd],encapsulation:2});let i=n;return i})(),Ad=(()=>{let n=class n{};n.\u0275fac=function(o){return new(o||n)},n.\u0275mod=pa({type:n}),n.\u0275inj=sa({imports:[Rs]});let i=n;return i})();var N_=["tree"];function V_(i,n){if(i&1&&(s(0,"span",8),d(1),l()),i&2){let e=c(2);a(),w(e.errorMsg)}}function O_(i,n){i&1&&(s(0,"span",9),d(1,"Navigation Tree"),l())}function L_(i,n){if(i&1){let e=y();s(0,"div",3)(1,"button",6),f("click",function(){h(e);let o=c();return g(o.onRefresh())}),_(2,"fa-icon",7),l(),C(3,V_,2,1,"span",8)(4,O_,2,0,"span",9),l()}if(i&2){let e=c();a(2),m("icon",e.icons.faArrowRotateRight),a(),x(e.errorMsg?3:4)}}function B_(i,n){if(i&1&&(s(0,"span")(1,"span"),d(2),l()()),i&2){let e=c(2);a(2),w(e.store.filesSelection()[0].name)}}function U_(i,n){if(i&1&&(s(0,"span"),_(1,"fa-icon",19),l()),i&2){let e=c(2);a(),m("icon",e.icons.faQuestion)}}function $_(i,n){if(i&1&&(s(0,"span")(1,"span"),d(2),l(),d(3,"\xA0"),s(4,"span",9),d(5,"items"),l()()),i&2){let e=c(2);a(2),w(e.store.filesSelection().length)}}function H_(i,n){if(i&1){let e=y();s(0,"div",10)(1,"div",11)(2,"span",12)(3,"span",9),d(4,"Source"),l(),d(5,":"),l(),C(6,B_,3,1,"span")(7,U_,2,1,"span")(8,$_,6,1,"span"),l(),s(9,"div",13)(10,"span",12)(11,"span",9),d(12,"Destination"),l(),d(13,":"),l(),s(14,"span"),d(15),l()(),s(16,"div",14)(17,"button",15),f("click",function(){h(e);let o=c();return g(o.actionMove())}),_(18,"fa-icon",7),d(19," Move "),l(),s(20,"button",16),f("click",function(){h(e);let o=c();return g(o.actionCopy())}),_(21,"fa-icon",7),d(22," Copy "),l(),s(23,"button",17),f("click",function(){h(e);let o=c();return g(o.actionCancel())}),_(24,"fa-icon",7),d(25," Cancel "),l()()(),_(26,"hr",18)}if(i&2){let e,t=c();a(6),x((e=t.store.filesSelection().length)===1?6:e===0?7:8),a(9),w((t.selection==null?null:t.selection.data.name)||""),a(2),m("disabled",!t.selection||!t.store.filesSelection().length||!t.srcAllowed||!t.dstAllowed),a(),m("icon",t.icons.faArrowsAlt),a(2),m("disabled",!t.selection||!t.store.filesSelection().length||!t.dstAllowed),a(),m("icon",t.icons.faClone),a(3),m("icon",t.icons.faTimes)}}function z_(i,n){if(i&1){let e=y();s(0,"div",20),f("click",function(o){let r=h(e).$implicit;return g(r.mouseAction("click",o))})("appTap",function(o){let r=h(e).$implicit;return g(r.mouseAction("dblClick",o))}),_(1,"tree-node-expander",21),s(2,"div",22),_(3,"tree-node-content",23),l()()}if(i&2){let e=n.index,t=n.$implicit;B("padding-left",t.getNodePadding()),L("tree-selected",t.isActive)("tree-disabled",!t.data.enabled),a(),L("toggle-children-file",!t.data.isDir)("toggle-children-shared",t.data.inShare),m("node",t),a(),L("node-content-wrapper-active",t.isActive),a(),m("index",e)("node",t)}}function G_(i,n){if(i&1&&(s(0,"span"),_(1,"fa-icon",24),l()),i&2){let e=c();a(),m("icon",e.icons.faSpinner)}}var Qr=(()=>{let n=class n{constructor(){this.selected=new ae,this.showFiles=!1,this.allowShares=!0,this.allowSpaces=!0,this.enableCopyMove=!0,this.enableNavigateTo=!0,this.sideBarHeader=!0,this.resizeOffset=80,this.toggleNodesAtStartup=!1,this.store=S(te),this.icons={faArrowRotateRight:mt,faArrowsAlt:ei,faClone:fn,faTimes:It,faFolder:Al,faFile:kn,faQuestion:Io,faAnglesRight:Hl,faSpinner:Oe},this.options={actionMapping:{mouse:{click:(t,o,r)=>this.onSelect(t,o,r),dblClick:(t,o)=>this.onOpen(o),expanderClick:()=>null}},animateExpand:!1,levelPadding:10,useVirtualScroll:!1,nodeHeight:30,dropSlotHeight:0,allowDrag:!1,allowDrop:!1,getChildren:t=>this.getTreeNode(t)},this.srcAllowed=!0,this.dstAllowed=!0,this.errorMsg=null,this.layout=S(I),this.router=S(Ce),this.user=S(oe),this.filesService=S(Le),this.copyMoveOnHeight=80,this.subscriptions=[],this.preventDblClick=!1,this._copyMoveOn=!1,this.enableCopyMove&&this.subscriptions.push(pi(this.store.filesSelection).subscribe(()=>this.checkAllowed(this.selection)))}get copyMoveOn(){return this._copyMoveOn}set copyMoveOn(t){this._copyMoveOn!==t&&(this._copyMoveOn=t,t?this.resizeOffset+=this.copyMoveOnHeight:this.resizeOffset-=this.copyMoveOnHeight,setTimeout(()=>this.layout.resizeEvent.next(),0))}get selection(){return this.filesService.treeNodeSelected}set selection(t){this.filesService.treeNodeSelected=t,t&&([0,-1,-2].indexOf(t.data.id)===-1?this.selected.emit(t.data):this.selected.emit(null))}ngOnInit(){this.enableCopyMove&&this.subscriptions.push(this.filesService.treeCopyMoveOn.subscribe(()=>this.onCopyMove())),this.initRoot(),setTimeout(()=>this.focusLastNode(),100)}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onRefresh(){this.tree.treeModel.activeNodes.length?this.tree.treeModel.activeNodes.forEach(t=>{t.loadNodeChildren().then(()=>this.tree.treeModel.update())}):(this.user.userHavePermission(_t.PERSONAL_SPACE)&&this.tree.treeModel.getNodeById(0).loadNodeChildren().then(()=>this.tree.treeModel.update()),this.user.userHavePermission(_t.SPACES)&&this.tree.treeModel.getNodeById(-1).loadNodeChildren().then(()=>this.tree.treeModel.update()),this.allowShares&&this.user.userHavePermission(_t.SHARES)&&this.tree.treeModel.getNodeById(-2).loadNodeChildren().then(()=>this.tree.treeModel.update()))}actionCancel(){this.copyMoveOn=!1,this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!0}actionCopy(){this.filesService.copyMove(this.store.filesSelection(),this.selection.data.path,Ne.COPY),this.copyMoveOn=!1}actionMove(){this.filesService.copyMove(this.store.filesSelection(),this.selection.data.path,Ne.MOVE),this.copyMoveOn=!1}initRoot(){if(this.nodes=[],this.user.userHavePermission(_t.PERSONAL_SPACE)){let t={id:0,name:this.layout.translateString(Lt.PERSONAL_FILES),path:`${G.FILES}/${ft.PERSONAL}`,isDir:!0,inShare:!1,mime:oi,quotaIsExceeded:this.store.user.getValue().quotaIsExceeded,enabled:!0,permissions:nc,children:null,hasChildren:!0,isExpanded:!1};this.checkToggleNodeAtStartup(t,!0)}if(this.allowSpaces&&this.user.userHavePermission(_t.SPACES)){let t={id:-1,name:this.layout.translateString(Lt.SPACES),path:G.SPACES,isDir:!0,mime:oi,inShare:!1,hasChildren:!0,quotaIsExceeded:!1,enabled:!0,permissions:"",children:null,isExpanded:!1};this.checkToggleNodeAtStartup(t)}if(this.allowShares&&this.user.userHavePermission(_t.SHARES)){let t={id:-2,name:this.layout.translateString(Lt.SHARES),path:G.SHARES,isDir:!0,mime:oi,inShare:!0,hasChildren:!0,quotaIsExceeded:!1,enabled:!0,permissions:"",children:null,isExpanded:!1};this.checkToggleNodeAtStartup(t)}}checkToggleNodeAtStartup(t,o=!1){this.toggleNodesAtStartup?this.getTreeNode(t).then(r=>{t.children=r,o?this.nodes.unshift(t):this.nodes.push(t),this.tree.treeModel.update(),this.toggleExpand(this.tree,this.tree.treeModel.getNodeById(t.id),null)}):(o?this.nodes.unshift(t):this.nodes.push(t),this.tree.treeModel.update())}focusLastNode(){this.selection&&(this.selection=this.tree.treeModel.getNodeById(this.selection.data.id),this.selection&&Ie.ACTIVATE(this.tree,this.selection,null))}getTreeNode(t){return this.filesService.getTreeNode(t?.data?.path||t?.path||t,this.showFiles)}collapseChildren(t,o){for(let r of o)r.id!==t.id&&(r.data.isExpanded=!1,r.collapse())}toggleExpand(t,o,r){Ie.TOGGLE_EXPANDED(t,o,r),o.data.isExpanded=!!o.data.isExpanded}onOpen(t){if(!this.copyMoveOn&&this.enableNavigateTo&&t.data.enabled){clearTimeout(this.preventTimer),this.preventDblClick=!0;let o=t.data.path.split("/");o[0]!==G.SPACES&&o.unshift(G.SPACES),this.router.navigate(o).catch(console.error)}}onSelect(t,o,r){if(!o.data.enabled){this.layout.sendNotification("warning",o.data.name,`${o.data.inShare?"Share":"Space"} is disabled`);return}Ie.ACTIVATE(t,o,r),this.preventTimer=setTimeout(()=>{this.checkAllowed(o),this.selection=o,this.preventDblClick||o.hasChildren&&(this.collapseChildren(o,o.parent.children),this.toggleExpand(t,o,r)),this.preventDblClick=!1},200)}checkAllowed(t){if(this.copyMoveOn){if(this.store.filesSelection().length)for(let o of this.store.filesSelection()){if(o.root?.alias){this.errorMsg="You can not move an anchored file",this.srcAllowed=!1,this.dstAllowed=!0;return}if(o.lock&&o.lock.owner.login!==this.store.user.getValue().login){this.errorMsg="You can not move a locked file",this.srcAllowed=!1,this.dstAllowed=!0;return}}if(t){if([-1,-2].indexOf(t.data.id)>-1){this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!1;return}else if(t.data.permissions.indexOf(We.ADD)===-1){this.errorMsg="You are not allowed to write here",this.srcAllowed=!0,this.dstAllowed=!1;return}else if(t.data.quotaIsExceeded){this.errorMsg="No more space available",this.srcAllowed=!0,this.dstAllowed=!1;return}}this.errorMsg=null,this.srcAllowed=!0,this.dstAllowed=!0}}onCopyMove(){this.onRefresh(),this.copyMoveOn=!0,this.checkAllowed(this.selection)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-tree"]],viewQuery:function(o,r){if(o&1&&Z(N_,7),o&2){let p;j(p=K())&&(r.tree=p.first)}},inputs:{showFiles:"showFiles",allowShares:"allowShares",allowSpaces:"allowSpaces",enableCopyMove:"enableCopyMove",enableNavigateTo:"enableNavigateTo",sideBarHeader:"sideBarHeader",resizeOffset:"resizeOffset",toggleNodesAtStartup:"toggleNodesAtStartup"},outputs:{selected:"selected"},decls:9,vars:7,consts:[["tree",""],["treeNodeWrapperTemplate",""],["loadingTemplate",""],[1,"sidebar-component-title"],["appAutoResize","",3,"overFlowX","resizeOffset","useMaxHeight"],[3,"nodes","options"],[1,"btn","btn-default",3,"click"],[3,"icon"],["l10nTranslate","",1,"text-danger","fs-sm","p-1"],["l10nTranslate",""],[1,"bg-white","px-2","pt-2","pb-0","fs-sm"],[1,"text-start","text-truncate"],["l10nTranslate","",1,"fs-sm","text-bold","me-2"],[1,"text-start","text-truncate","mt-1"],[1,"d-flex","gap-2","pt-1","w-100","mt-2"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-warning","flex-fill",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary","flex-fill",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-secondary","flex-fill",3,"click"],[1,"mx-0","mt-2","mb-0"],[1,"text-bold","me-1",3,"icon"],[1,"node-wrapper",3,"click","appTap"],[3,"node"],[1,"node-content-wrapper"],[3,"index","node"],["animation","spin",1,"text-bold",3,"icon"]],template:function(o,r){o&1&&(C(0,L_,5,2,"div",3),C(1,H_,27,7),s(2,"div",4)(3,"tree-root",5,0),N(5,z_,4,15,"ng-template",null,1,Zt)(7,G_,2,1,"ng-template",null,2,Zt),l()()),o&2&&(x(r.sideBarHeader?0:-1),a(),x(r.copyMoveOn?1:-1),a(),m("overFlowX","auto")("resizeOffset",r.resizeOffset)("useMaxHeight",!1),a(),m("nodes",r.nodes)("options",r.options))},dependencies:[de,Ad,Ed,ts,es,P,F,tt],encapsulation:2});let i=n;return i})();function W_(i,n){if(i&1&&(s(0,"span"),_(1,"fa-icon",10),d(2),b(3,"pathSlice"),l()),i&2){let e=c();a(),m("icon",e.selection.isDir?e.icons.faFolderClosed:e.icons.faFile),a(),k(" ",E(3,2,e.selection.path,-1)," ")}}function j_(i,n){i&1&&(s(0,"span",2),d(1,"Select a file"),l())}function K_(i,n){if(i&1&&(s(0,"span",7),d(1),l()),i&2){let e=c();a(),w(e.errorSelection)}}var On=(()=>{let n=class n{constructor(){this.currentRoots=[],this.submitEvent=new ae,this.allowSpaces=!1,this.toggleNodesAtStartup=!0,this.mustHaveShareOutsidePermission=!1,this.layout=S(I),this.icons={faFile:kn,faFolderClosed:Sr},this.errorSelection=null,this.selection=null}onSelect(t){if(t){if(this.mustHaveShareOutsidePermission){if(t.permissions.indexOf(We.SHARE_OUTSIDE)===-1){this.errorSelection=this.layout.translateString("You do not have share permission"),this.selection=null;return}if(t.path.split("/").length<=2){this.errorSelection=this.layout.translateString("You can not share a space"),this.selection=null;return}}let o=t,r=this.currentRoots.find(p=>p.file.id===o.id);r?(this.errorSelection=this.layout.translateString("This item is already selected"),this.selection=null):(r=this.currentRoots.find(p=>o.path.startsWith(p.file.path)),r?(this.errorSelection=`${this.layout.translateString("Parent item is already selected")}: ${r.file.path}`,this.selection=null):(this.errorSelection=null,this.selection=o))}else this.selection=null,this.errorSelection=null}onSubmit(){this.submitEvent.emit({id:this.selection.id,name:this.selection.name,path:this.selection.path,mime:this.selection.mime,permissions:this.selection.permissions}),this.layout.closeDialog()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-tree-dialog"]],inputs:{currentRoots:"currentRoots",allowSpaces:"allowSpaces",toggleNodesAtStartup:"toggleNodesAtStartup",mustHaveShareOutsidePermission:"mustHaveShareOutsidePermission"},outputs:{submitEvent:"submitEvent"},decls:13,vars:11,consts:[[1,"modal-header"],[1,"modal-title"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","py-2","px-0"],[3,"selected","enableNavigateTo","enableCopyMove","showFiles","allowShares","allowSpaces","sideBarHeader","toggleNodesAtStartup","resizeOffset"],[1,"modal-footer"],[1,"me-auto","fs-sm","text-danger","text-truncate"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click","disabled"],[3,"icon"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),C(2,W_,4,5,"span")(3,j_,2,0,"span",2),l(),s(4,"button",3),f("click",function(){return r.layout.closeDialog()}),l()(),s(5,"div",4)(6,"app-files-tree",5),f("selected",function(u){return r.onSelect(u)}),l()(),s(7,"div",6),C(8,K_,2,1,"span",7),s(9,"button",8),f("click",function(){return r.layout.closeDialog()}),d(10,"Cancel"),l(),s(11,"button",9),f("click",function(){return r.onSubmit()}),d(12,"Confirm"),l()()),o&2&&(a(2),x(r.selection?2:3),a(4),m("enableNavigateTo",!1)("enableCopyMove",!1)("showFiles",!0)("allowShares",!1)("allowSpaces",r.allowSpaces)("sideBarHeader",!1)("toggleNodesAtStartup",r.toggleNodesAtStartup)("resizeOffset",200),a(2),x(r.errorSelection?8:-1),a(3),m("disabled",!r.selection))},dependencies:[P,Qr,F,jr],encapsulation:2});let i=n;return i})();function q_(i,n){if(i&1){let e=y();s(0,"input",12),b(1,"translate"),f("ngModelChange",function(o){h(e);let r=c();return g(r.checkInput(o,!0))}),l()}if(i&2){let e=c();L("is-invalid",!e.rootNameIsValid),m("ngModel",e.newSpaceRoot.name)("placeholder",E(1,4,"Name",e.locale.language))}}function Q_(i,n){if(i&1&&(s(0,"span",9),d(1),l()),i&2){let e=c();a(),w(e.error)}}function Y_(i,n){if(i&1){let e=y();s(0,"button",13),f("click",function(){h(e);let o=c();return g(o.onSubmit())}),d(1,"Confirm"),l()}}function X_(i,n){if(i&1){let e=y();s(0,"button",14),f("click",function(){h(e);let o=c();return g(o.onValidRoot())}),d(1,"Check the location"),l()}}var Yr=(()=>{let n=class n{constructor(){this.currentRoots=[],this.submitEvent=new ae,this.withRootName=!0,this.locale=S(z),this.layout=S(I),this.icons={faFolderClosed:Zo},this.newSpaceRoot={name:"",externalPath:""},this.rootNameIsValid=!1,this.rootPathIsValid=!1,this.rootIsValid=!1,this.spacesService=S(it)}ngOnInit(){this.withRootName||(this.rootNameIsValid=!0)}keyEnter(){this.rootIsValid?this.onSubmit():this.onValidRoot()}onValidRoot(){if(this.withRootName&&!this.newSpaceRoot.name||!this.newSpaceRoot.externalPath){this.error="Name and location are required";return}this.newSpaceRoot.externalPath[0]!=="/"&&(this.newSpaceRoot.externalPath="/"+this.newSpaceRoot.externalPath);for(let t of this.currentRoots){let o=t.externalPath[t.externalPath.length-1]==="/"?t.externalPath:`${t.externalPath}/`;if(this.newSpaceRoot.externalPath.startsWith(o)){this.rootPathIsValid=!1,this.error="Parent location already exists in files";return}}this.spacesService.checkSpaceRootPath(this.newSpaceRoot.externalPath).subscribe({next:()=>{this.rootPathIsValid=!0,this.rootNameIsValid=!0,this.rootIsValid=!0,this.error=null},error:t=>{this.rootPathIsValid=!1,this.error=t.error.message}})}onSubmit(){this.submitEvent.emit(this.newSpaceRoot),this.layout.closeDialog()}checkInput(t,o=!1){o?(this.newSpaceRoot.name=t,this.rootNameIsValid=!!t):(this.newSpaceRoot.externalPath=t,this.rootPathIsValid=!!t),this.rootIsValid&&(this.rootIsValid=!1)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-root-path-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.keyEnter()})},inputs:{currentRoots:"currentRoots",withRootName:"withRootName"},outputs:{submitEvent:"submitEvent"},decls:14,vars:13,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body","form-validation"],["appAutofocus","","type","text","required","",1,"form-control","my-2",3,"ngModel","is-invalid","placeholder"],["appAutofocus","","type","text","required","",1,"form-control","my-4",3,"ngModelChange","autoFocus","ngModel","placeholder"],[1,"modal-footer"],["l10nTranslate","",1,"me-auto","fs-sm","text-danger","text-truncate"],["type","button","l10nTranslate","",1,"btn","btn-primary"],["type","button","l10nTranslate","",1,"btn","btn-success"],["appAutofocus","","type","text","required","",1,"form-control","my-2",3,"ngModelChange","ngModel","placeholder"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-success",3,"click"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span",3),d(4,"Add an external location"),l()(),s(5,"button",4),f("click",function(){return r.layout.closeDialog()}),l()(),s(6,"div",5),C(7,q_,2,7,"input",6),s(8,"input",7),b(9,"translate"),f("ngModelChange",function(u){return r.checkInput(u)}),l()(),s(10,"div",8),C(11,Q_,2,1,"span",9),C(12,Y_,2,0,"button",10)(13,X_,2,0,"button",11),l()),o&2&&(a(2),m("icon",r.icons.faFolderClosed),a(5),x(r.withRootName?7:-1),a(),L("is-invalid",!r.rootPathIsValid),m("placeholder",q("",E(9,10,"Location",r.locale.language),": /home/sync-in/data"))("autoFocus",!r.withRootName)("ngModel",r.newSpaceRoot.externalPath),a(3),x(r.error?11:-1),a(),x(r.rootIsValid?12:13))},dependencies:[F,P,Te,ze,xe,Jt,we,je,J],encapsulation:2});let i=n;return i})();var kd=(()=>{let n=class n{constructor(){this.locale=S(z)}ngOnInit(){this.setFilePath()}ngOnChanges(){this.setFilePath()}setFilePath(){let t=this.share.file?bn(this.share.file.name,-1):"";t?this.fileName=t:this.share.parent?.id?this.fileName=this.share.parent.name:this.share instanceof oo&&this.share.externalPath&&(this.fileName=this.share.externalPath)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-share-file-name"]],inputs:{share:"share"},features:[nn],decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],["draggable","false","height","30","width","30","alt","",3,"error","src"],[1,"d-flex","flex-column","overflow-wrap-and-whitespace","ms-2"]],template:function(o,r){o&1&&(Hi(0,"div",0)(1,"img",1),Gn("error",function(){return r.share.fallBackMimeUrl()}),zi(),Hi(2,"div",2),d(3),zi()()),o&2&&(a(),Ao("src",r.share.mimeUrl,X),a(2),k(" ",r.fileName," "))},encapsulation:2});let i=n;return i})();function J_(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c();a(),w(e.share.name)}}function ef(i,n){i&1&&(s(0,"span",3),d(1,"Create a new share"),l())}function tf(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}function nf(i,n){i&1&&(s(0,"h4",5)(1,"span",3),d(2,"Edit share"),l()())}function of(i,n){if(i&1&&(s(0,"span",45),_(1,"fa-icon",2),s(2,"span",46),d(3,"Settings"),l()()),i&2){let e=c();a(),m("icon",e.icons.faCog)}}function rf(i,n){if(i&1&&(s(0,"div",50)(1,"label",51),d(2,"Storage Usage"),l(),_(3,"app-storage-usage",52),l()),i&2){let e=c(2);a(3),m("item",e.share)}}function af(i,n){if(i&1){let e=y();s(0,"div",20)(1,"div",47)(2,"div",48)(3,"app-storage-quota",49),_e("quotaChange",function(o){h(e);let r=c();return ue(r.share.storageQuota,o)||(r.share.storageQuota=o),g(o)}),l()(),C(4,rf,4,1,"div",50),l()()}if(i&2){let e=c();a(3),me("quota",e.share.storageQuota),m("fullWidth",!0),a(),x(e.share.storageUsage?4:-1)}}function sf(i,n){if(i&1){let e=y();s(0,"div",22),f("click",function(){h(e);let o=c();return g(o.toggleFullTextSearchFromCard())}),s(1,"div",23)(2,"label",53),f("click",function(o){return h(e),g(o.stopPropagation())}),d(3,"Full-text search"),l(),s(4,"div",25)(5,"input",54),_e("ngModelChange",function(o){h(e);let r=c();return ue(r.share.storageIndexing,o)||(r.share.storageIndexing=o),g(o)}),f("click",function(o){return h(e),g(o.stopPropagation())}),l(),s(6,"label",55),f("click",function(o){return h(e),g(o.stopPropagation())}),d(7),l()()()()}if(i&2){let e=c();L("dialog-check-card--active",e.share.storageIndexing),a(5),me("ngModel",e.share.storageIndexing),a(2),k(" ",e.share.storageIndexing?"enabled":"disabled"," ")}}function lf(i,n){if(i&1&&(s(0,"div",15)(1,"label",56),d(2,"File"),l(),_(3,"app-share-file-name",57),l()),i&2){let e=c();a(3),m("share",e.share)}}function cf(i,n){if(i&1&&(s(0,"div",60)(1,"label",66),d(2,"Deactivation date"),l(),s(3,"div",67),d(4),b(5,"amDateFormat"),l()()),i&2){let e=c(2);a(4),w($(5,1,e.share.disabledAt))}}function pf(i,n){if(i&1&&(s(0,"div",20)(1,"div",58)(2,"div",59),C(3,cf,6,3,"div",60),s(4,"div",61)(5,"label",62),d(6,"Creation date"),l(),s(7,"div",63),d(8),b(9,"amDateFormat"),l()(),s(10,"div",61)(11,"label",64),d(12,"Modification date"),l(),s(13,"div",65),d(14),b(15,"amDateFormat"),l()()()()()),i&2){let e=c();a(3),x(e.share.disabledAt&&!e.share.enabled?3:-1),a(5),w($(9,3,e.share.createdAt)),a(6),w($(15,5,e.share.modifiedAt))}}function df(i,n){if(i&1&&(s(0,"span",45),_(1,"fa-icon",2),s(2,"span",46),d(3,"Members"),l(),s(4,"span",68),d(5),l()()),i&2){let e=c();a(),m("icon",e.icons.faUsers),a(4),w(e.share.members.length)}}function mf(i,n){if(i&1&&(s(0,"span",45),_(1,"fa-icon",2),s(2,"span",46),d(3,"Links"),l(),s(4,"span",68),d(5),l()()),i&2){let e=c();a(),m("icon",e.icons.LINKS),a(4),w(e.share.links.length)}}function uf(i,n){if(i&1){let e=y();s(0,"button",70),f("click",function(){h(e);let o=c(2);return g(o.confirmDeletion=!0)}),d(1," Remove "),l()}if(i&2){let e=c(2);m("disabled",e.confirmDeletion)}}function _f(i,n){if(i&1){let e=y();s(0,"button",73),f("click",function(){h(e);let o=c(3);return g(o.openAdminRootDialog())}),_(1,"fa-icon",2),d(2," External location "),l()}if(i&2){let e=c(3);a(),m("icon",e.icons.faUserShield)}}function ff(i,n){if(i&1){let e=y();s(0,"button",71),f("click",function(){h(e);let o=c(2);return g(o.openSelectRootDialog())}),_(1,"fa-icon",2)(2,"fa-icon",2),d(3," File "),l(),C(4,_f,3,1,"button",72)}if(i&2){let e=c(2);a(),m("icon",e.icons.faPlus),a(),m("icon",e.icons.SHARES),a(2),x(e.user.isAdmin?4:-1)}}function hf(i,n){if(i&1&&C(0,uf,2,1,"button",69)(1,ff,5,3),i&2){let e=c();x(e.share.id?0:e.allowFilesOptions?1:-1)}}function gf(i,n){if(i&1){let e=y();s(0,"button",71),f("click",function(){h(e);let o=c();return g(o.openCreateLinkDialog())}),_(1,"fa-icon",2)(2,"fa-icon",2),d(3," Link "),l()}if(i&2){let e=c();a(),m("icon",e.icons.faPlus),a(),m("icon",e.icons.LINKS)}}var Ji=(()=>{let n=class n{constructor(){this.parentShareId=null,this.parentSpaceId=null,this.isSharesRepo=!1,this.inSharesList=!1,this.allowFilesOptions=!0,this.shareChange=new ae,this.locale=S(z),this.layout=S(I),this.icons={SHARED:ie.SHARED_WITH_OTHERS,SHARES:ie.SHARES,LINKS:ie.LINKS,faPlus:et,faSpinner:Oe,faUserShield:Ho,faUsers:$o,faCog:hn},this.allowedPermissions=[],this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=S(oe),this.user=this.userService.user,this.sharesService=S(ai),this.linksService=S(si),this.spacesService=S(it)}ngOnInit(){this.share||([this.share,this.parentShareId]=this.sharesService.initShareFromFile(this.user,this.file,this.isSharesRepo,this.inSharesList)),this.allowedPermissions=Object.keys(this.share.hPerms)}searchMembers(t){let o={search:t,ignoreUserIds:[this.user.id,...this.share.parent?.ownerId?[this.share.parent.ownerId]:[],...this.share.members.filter(r=>r.isUser).map(r=>r.id)],ignoreGroupIds:this.share.members.filter(r=>r.isGroup).map(r=>r.id)};return this.userService.searchMembers(o,[We.SHARE_INSIDE])}openSelectRootDialog(){this.layout.openDialog(On,"xl",{initialState:{toggleNodesAtStartup:!1,allowSpaces:!0,mustHaveShareOutsidePermission:!0}}).content.submitEvent.pipe(ce(1)).subscribe(o=>{let r=o.path.split("/"),p={id:o.id,name:o.name,path:bn(o.path,2),permissions:o.permissions,mime:o.mime,ownerId:r[1]===ft.PERSONAL?this.user.id:null,inTrash:!1,isDir:o.mime===oi,space:{alias:r[1],name:r[1],root:{alias:"",name:""}}},u=Se(re({},this.share),{file:p,externalPath:null});u.name=u.file.name,this.share=new oo(u),this.allowedPermissions=Object.keys(this.share.hPerms)})}openAdminRootDialog(){this.layout.openDialog(Yr,null,{initialState:{withRootName:!1}}).content.submitEvent.pipe(ce(1)).subscribe(o=>{let r=Se(re({},this.share),{file:null,externalPath:o.externalPath,name:o.externalPath.split("/").at(-1)});this.share=new oo(r),this.allowedPermissions=Object.keys(this.share.hPerms)})}openEditLinkDialog(t){this.linksService.editLinkDialog(t,this.share,ar.SHARE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.share)}setShareStatus(t){this.share.enabled=t,this.share.disabledAt=t?null:new Date}toggleShareStatusFromCard(){this.setShareStatus(!this.share.enabled)}toggleFullTextSearchFromCard(){this.share.storageIndexing=!this.share.storageIndexing}cantSubmit(){return this.submitted||!this.share.externalPath&&!this.share.file}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.parentShareId?this.sharesService.deleteShareChild(this.parentShareId,this.share.id):this.parentSpaceId?this.spacesService.deleteSpaceShare(this.parentSpaceId,this.share.id):this.sharesService.deleteShare(this.share.id)).subscribe({next:()=>{this.loading=!1,this.shareChange.emit(["delete",this.share]),this.layout.closeDialog()},error:o=>{this.onError(),this.layout.sendNotification("error","Delete share",this.share.name,o)}}):this.share.id===0?this.sharesService.createShare(this.share).subscribe({next:t=>{this.loading=!1,this.share=t,this.shareChange.emit(["add",t]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Create share",this.share.name,t)}}):(this.parentShareId?this.sharesService.updateShareChild(this.parentShareId,this.share.id,this.share):this.parentSpaceId?this.spacesService.updateSpaceShare(this.parentSpaceId,this.share):this.sharesService.updateShare(this.share)).subscribe({next:o=>{this.loading=!1,this.share=o,this.shareChange.emit(["update",o]),this.layout.closeDialog()},error:o=>{this.onError(),this.layout.sendNotification("error","Edit share",this.share.name,o)}})}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-share-dialog"]],inputs:{share:"share",file:"file",parentShareId:"parentShareId",parentSpaceId:"parentSpaceId",isSharesRepo:"isSharesRepo",inSharesList:"inSharesList",allowFilesOptions:"allowFilesOptions"},outputs:{shareChange:"shareChange"},decls:64,vars:43,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],["type","pills",3,"justified"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"app-tab-content","row","g-3"],[1,"col-12","col-lg-6","d-flex","flex-column"],[1,"card","dialog-tab-card","w-100","flex-grow-1","d-flex"],[1,"card-body","d-flex","flex-column","h-100"],[1,"mb-3","px-0"],["for","name","l10nTranslate","",1,"form-label"],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate","",1,"form-label"],["id","description","type","text",1,"form-control",3,"ngModelChange","ngModel"],[1,"card","dialog-tab-card","mt-2"],[1,"d-flex","justify-content-between","gap-2","mt-2"],[1,"card","dialog-check-card","dialog-check-card--interactive","flex-fill",3,"click"],[1,"card-body","p-2"],["for","switchStatus","l10nTranslate","",1,"form-label",3,"click"],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","click","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-label","form-check-label","mb-0","ms-2",3,"click"],[1,"card","dialog-check-card","dialog-check-card--interactive","flex-fill",3,"dialog-check-card--active"],[1,"card","dialog-tab-card","flex-grow-1","d-flex"],[1,"card-body","d-flex","flex-column"],[1,"mb-3"],["for","from","l10nTranslate","",1,"form-label"],["id","from",3,"share","showFullPath"],["for","permissions","l10nTranslate","",1,"form-label"],[1,"d-flex"],["id","permissions",3,"permissions","replaceEmptyPermissions"],["customClass","tab-dialog",3,"selectTab"],[1,"app-tab-content","my-3"],[3,"membersChange","members","withPermissions","filterPermissions","allowedPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"app-tab-heading"],["l10nTranslate","",1,"app-tab-label"],[1,"card-body","p-2","d-flex","flex-column","gap-2"],[1,"d-flex","flex-column","align-items-start"],[1,"w-100","mb-3",3,"quotaChange","quota","fullWidth"],[1,"d-flex","flex-column","mb-3"],["for","storage","l10nTranslate","",1,"form-label"],["id","storage",3,"item"],["for","switchFullText","l10nTranslate","",1,"form-label",3,"click"],["id","switchFullText","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","click","ngModel"],["for","switchFullText","l10nTranslate","",1,"form-label","form-check-label","mb-0","ms-2",3,"click"],["for","shareFilePath","l10nTranslate","",1,"form-label","no-select"],["id","shareFilePath",3,"share"],[1,"card-body"],[1,"d-flex","align-items-end","flex-fill","justify-content-between","gap-3","flex-wrap"],[1,"d-flex","flex-column","text-danger","px-0"],[1,"d-flex","flex-column","px-0"],["for","created","l10nTranslate","",1,"form-label"],["id","created",1,"fs-sm"],["for","modified","l10nTranslate","",1,"form-label"],["id","modified",1,"fs-sm"],["for","disabled","l10nTranslate","",1,"form-label"],["id","disabled"],[1,"app-tab-count"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-warning",3,"click"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),C(3,J_,2,1,"span")(4,ef,2,0,"span",3),C(5,tf,1,1,"fa-icon",4),l(),C(6,nf,3,0,"h4",5),s(7,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),s(8,"div",7)(9,"tabset",8)(10,"tab",9),f("selectTab",function(){return r.tabView=null}),N(11,of,4,1,"ng-template",10),s(12,"div",11)(13,"div",12)(14,"div",13)(15,"div",14)(16,"div",15)(17,"label",16),d(18," Share name "),l(),s(19,"input",17),_e("ngModelChange",function(u){return ue(r.share.name,u)||(r.share.name=u),u}),l()(),s(20,"div",15)(21,"label",18),d(22," Description "),l(),s(23,"input",19),_e("ngModelChange",function(u){return ue(r.share.description,u)||(r.share.description=u),u}),l()()()(),C(24,af,5,3,"div",20),s(25,"div",21)(26,"div",22),f("click",function(){return r.toggleShareStatusFromCard()}),s(27,"div",23)(28,"label",24),f("click",function(u){return u.stopPropagation()}),d(29,"Share status"),l(),s(30,"div",25)(31,"input",26),f("ngModelChange",function(u){return r.setShareStatus(u)})("click",function(u){return u.stopPropagation()}),l(),s(32,"label",27),f("click",function(u){return u.stopPropagation()}),d(33),l()()()(),C(34,sf,8,4,"div",28),l()(),s(35,"div",12)(36,"div",29)(37,"div",30),C(38,lf,4,1,"div",15),s(39,"div",31)(40,"label",32),d(41,"Shared from"),l(),_(42,"app-share-repository",33),l(),s(43,"div",31)(44,"label",34),d(45,"Permissions inherited from the file"),l(),s(46,"div",35),_(47,"app-badge-permissions",36),l()()()(),C(48,pf,16,7,"div",20),l()()(),s(49,"tab",37),f("selectTab",function(){return r.tabView="members"}),N(50,df,6,2,"ng-template",10),s(51,"div",38)(52,"app-user-search",39),_e("membersChange",function(u){return ue(r.share.members,u)||(r.share.members=u),u}),l()()(),s(53,"tab",37),f("selectTab",function(){return r.tabView="links"}),N(54,mf,6,2,"ng-template",10),s(55,"div",38)(56,"app-user-search",40),_e("membersChange",function(u){return ue(r.share.links,u)||(r.share.links=u),u}),l()()()()(),s(57,"div",41),C(58,hf,2,1),C(59,gf,4,2,"button",42),s(60,"button",43),f("click",function(){return r.onCancel()}),d(61,"Cancel"),l(),s(62,"button",44),f("click",function(){return r.onSubmit()}),d(63),l()()),o&2&&(a(2),m("icon",r.icons.SHARED),a(),x(r.share.id?3:4),a(2),x(r.loading?5:-1),a(),x(r.share.id?6:-1),a(),V(q("btn-close btn-close-white ",r.share.id?"ms-2":"ms-auto"," ms-2")),a(2),m("justified",!0),a(10),V(q("form-control ",r.share.name?"":"is-invalid")),me("ngModel",r.share.name),a(4),me("ngModel",r.share.description),a(),x(r.share.externalPath?24:-1),a(2),L("dialog-check-card--active",r.share.enabled),a(5),m("ngModel",r.share.enabled),a(2),k(" ",r.share.enabled?"enabled":"disabled"," "),a(),x(r.share.externalPath?34:-1),a(4),x(r.share.file!=null&&r.share.file.name||r.share.externalPath?38:-1),a(4),m("share",r.share)("showFullPath",!0),a(5),m("permissions",r.share.hPerms)("replaceEmptyPermissions",!0),a(),x(r.share!=null&&r.share.id?48:-1),a(4),me("members",r.share.members),m("withPermissions",!0)("filterPermissions",!0)("allowedPermissions",r.allowedPermissions)("searchFunction",r.searchMembers.bind(r)),a(4),me("members",r.share.links),m("filterPermissions",!0)("allowedPermissions",r.allowedPermissions)("withPermissions",!0)("editFunction",r.openEditLinkDialog.bind(r))("hideInput",!0),a(2),x(r.tabView?-1:58),a(),x(r.tabView==="links"?59:-1),a(3),V(q("btn ",r.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",r.cantSubmit()),a(),k(" ",r.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[F,P,ur,dr,pr,mr,je,yi,ze,Ft,xe,Jt,Te,we,En,ri,kd,St,_r,Tn,Pe],encapsulation:2});let i=n;return i})();var Xr=class{constructor(n){this.isShareLink=!1,Object.assign(this,n),this.owner.avatarUrl=wn(this.owner.login),this.isShareLink=this.type===no.LINK,this.setMimeUrl()}fallBackMimeUrl(){this.mimeUrl=Cr}setMimeUrl(){!this.file||this.file.mime===oi?this.mimeUrl=io(Nc):this.mimeUrl=io(this.file.mime)}};var Dd=i=>({$implicit:i}),Cf=(i,n)=>n.id;function xf(i,n){if(i&1&&_(0,"fa-icon",17),i&2){let e=c(3);m("icon",e.icons.LINKS)}}function Sf(i,n){i&1&&ct(0)}function vf(i,n){if(i&1&&(s(0,"ul"),N(1,Sf,1,0,"ng-container",10),l()),i&2){let e=c().$implicit;c(2);let t=at(14);a(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Je(2,Dd,e.children))}}function yf(i,n){if(i&1){let e=y();s(0,"li")(1,"div",14),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("dblclick",function(){h(e);let o=c(2);return g(o.openChildShare())}),s(2,"div",15)(3,"img",16),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),C(4,xf,1,1,"fa-icon",17),s(5,"span",18),d(6),l()(),s(7,"div",19)(8,"span",20),d(9),l(),_(10,"app-user-avatar",21),l()(),C(11,vf,2,4,"ul"),l()}if(i&2){let e=n.$implicit,t=c(2);a(),L("selected",t.selected&&t.selected.id===e.id),a(2),m("src",e.mimeUrl,X),a(),x(e.isShareLink?4:-1),a(2),w(e.name),a(3),w(e.owner.fullName),a(),m("user",e.owner)("height",26)("width",26),a(),x((e.children==null?null:e.children.length)>0?11:-1)}}function bf(i,n){if(i&1&&D(0,yf,12,10,"li",null,Cf),i&2){let e=n.$implicit,t=c();M(t.toShares(e))}}function wf(i,n){i&1&&ct(0)}var Ni=(()=>{let n=class n{constructor(){this.fromAdmin=!1,this.sharesCountEvent=new ae,this.layout=S(I),this.icons={SHARED:ie.SHARED_WITH_OTHERS,LINKS:ie.LINKS},this.loading=!1,this.childSharesLength=0,this.sharesService=S(ai),this.linksService=S(si),this.spacesService=S(it)}ngOnInit(){this.loadChildShares()}toShares(t){return t}loadChildShares(){this.loading=!0;let t;if(this.share)t=this.sharesService.listChildShares(this.share.id);else if(this.space)t=this.spacesService.listSpaceShares(this.space.id);else{console.error("share or space not defined");return}t.subscribe({next:o=>{this.childSharesLength=o.length,this.sharesCountEvent.emit(o.length),this.setShares(o.map(r=>new Xr(r))),this.loading=!1},error:o=>{this.childShares=[],this.childSharesLength=0,this.loading=!1,this.layout.sendNotification("error","Child shares",o.error.message)}})}onSelect(t){this.selected=t}openChildShare(){if(this.selected.isShareLink){let t;if(this.share)t=this.linksService.shareLinkChild(this.share.id,this.selected.id);else if(this.space)t=this.spacesService.getSpaceShareLink(this.space.id,this.selected.id);else{console.error("share or space not defined");return}t.subscribe({next:o=>{this.layout.openDialog(Dn,"lg",{initialState:{share:o}}).content.shareChange.pipe(ce(1)).subscribe(p=>{let[u,v]=p;u==="update"?this.selected.name=v.name:this.loadChildShares()})},error:o=>this.layout.sendNotification("error","Edit children shares",this.selected.name,o)})}else{let t;if(this.share)t=this.sharesService.getShareChild(this.share.id,this.selected.id);else if(this.space)t=this.spacesService.getSpaceShare(this.space.id,this.selected.id);else{console.error("share or space not defined");return}t.subscribe({next:o=>{this.layout.openDialog(Ji,"lg",{initialState:Se(re(re({},this.share?{parentShareId:this.share.id}:{}),this.space?{parentSpaceId:this.space.id}:{}),{share:o})}).content.shareChange.pipe(ce(1)).subscribe(p=>{let[u,v]=p;u==="update"?(this.selected.name=v.name,this.selected.alias=v.alias):this.loadChildShares()})},error:o=>this.layout.sendNotification("error","Edit children shares",this.selected.name,o)})}}setShares(t){let o={id:this.share?.id||0,children:[]};this.recurseChildrenShares(t,o),this.childShares=o.children}recurseChildrenShares(t,o){for(let r of t)r.parentId===o.id?(o.children=o.children??[],o.children.push(r),this.recurseChildrenShares(t,r)):o.id===0&&!r.parentId&&(o.children=o.children??[],o.children.push(r),this.recurseChildrenShares(t,r))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-shared-children-dialog"]],inputs:{fromAdmin:"fromAdmin",share:"share",space:"space"},outputs:{sharesCountEvent:"sharesCountEvent"},decls:21,vars:9,consts:[["recursiveList",""],[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],[1,"badge","bg-secondary-alt","ms-2"],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],["appAutoResize","",1,"modal-body",2,"padding-right","24px",3,"resizeOffset"],[1,"tree"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"modal-footer"],["l10nTranslate","","type","button",1,"btn","btn-primary",3,"click","disabled"],["data-dismiss","modal","l10nTranslate","","type","button",1,"btn","btn-secondary",3,"click"],[1,"app-div-hovered",3,"click","dblclick"],[1,"me-auto","text-truncate"],["alt","","draggable","false","height","28",3,"error","src"],[1,"align-middle","ms-1",3,"icon"],[1,"ms-1","align-middle"],[1,"d-flex","align-items-center"],[1,"fs-2xs","me-2"],["tooltipPlacement","top","container","body",3,"user","height","width"]],template:function(o,r){if(o&1){let p=y();s(0,"div",1)(1,"h4",2),_(2,"fa-icon",3),s(3,"span"),d(4),l()(),s(5,"h4",4)(6,"span",5),d(7,"Child shares"),l(),s(8,"span",6),d(9),l()(),s(10,"button",7),f("click",function(){return h(p),g(r.layout.closeDialog())}),l()(),s(11,"div",8)(12,"ul",9),N(13,bf,2,0,"ng-template",null,0,Zt)(15,wf,1,0,"ng-container",10),l()(),s(16,"div",11)(17,"button",12),f("click",function(){return h(p),g(r.openChildShare())}),d(18,"Edit"),l(),s(19,"button",13),f("click",function(){return h(p),g(r.layout.closeDialog())}),d(20,"Close"),l()()}if(o&2){let p=at(14);a(2),m("icon",r.icons.SHARED),a(2),w((r.share==null?null:r.share.name)||(r.space==null?null:r.space.name)),a(5),w(r.childSharesLength||0),a(2),m("resizeOffset",170),a(4),m("ngTemplateOutlet",p)("ngTemplateOutletContext",Je(7,Dd,r.childShares)),a(2),m("disabled",!r.selected)}},dependencies:[de,zt,P,F,qe],styles:['ul.tree[_ngcontent-%COMP%], ul.tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0}ul.tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%]{margin-left:18px}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin:0;padding:0;line-height:30px;border-left:1px solid rgb(100,100,100);white-space:nowrap}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{display:inline-flex;width:100%;cursor:pointer;border-radius:4px}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child{border-left:none}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:before{position:relative;top:-.3em;height:1.2rem;width:1rem;color:#fff;border-bottom:1px solid rgb(100,100,100);content:"";display:inline-block}ul.tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%]:last-child:before{border-left:1px solid rgb(100,100,100)}']});let i=n;return i})();var Tf=["MainContextMenu"],Ef=["TargetContextMenu"],Md=(i,n)=>n.id,Fd=(i,n)=>n.key;function Af(i,n){if(i&1&&(s(0,"span",33),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),w(e.hTimeAgo)}}function kf(i,n){if(i&1){let e=y();s(0,"span",34),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.goToComments(o))}),_(1,"fa-icon",6),l()}if(i&2){let e=c(3);B("font-size",e.galleryMode.textSize,"px"),a(),m("icon",e.icons.faCommentDots)}}function Df(i,n){if(i&1){let e=y();s(0,"div",35),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",6),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),m("icon",t.icons.SHARED),a(),k(" ",e.counts.shares," ")}}function Mf(i,n){if(i&1){let e=y();s(0,"div",21),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openShareDialog())}),s(1,"div",22)(2,"img",23),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),s(3,"span",24),C(4,Af,2,3,"span",25),l(),s(5,"span",26),C(6,kf,2,3,"span",27),C(7,Df,3,4,"div",28),l(),s(8,"span",29),_(9,"app-share-repository",30),l()(),s(10,"div",31)(11,"span",32),d(12),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),L("disabled",!e.enabled)("selected",e.id===(o.selected==null?null:o.selected.id)),a(),Xt("rowIndex",t),a(),m("src",e.mimeUrl,X)("height",o.galleryMode.image)("width",o.galleryMode.image),a(2),x(e.newly?4:-1),a(2),x(e.hasComments?6:-1),a(),x(e.counts.shares?7:-1),a(2),m("share",e)("galleryMode",o.galleryMode),a(2),B("font-size",o.galleryMode.textSize,"px"),a(),w(e.name)}}function Ff(i,n){if(i&1){let e=y();s(0,"div",12)(1,"app-virtual-scroll",18),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),s(3,"div",19),D(4,Mf,13,20,"div",20,Md),l()()()}if(i&2){let e=c();a(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),a(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Pf(i,n){if(i&1&&_(0,"fa-icon",6),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)}}function If(i,n){if(i&1){let e=y();s(0,"th",41),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,Pf,1,1,"fa-icon",6),l()}if(i&2){let e=c().$implicit,t=c(2);V(e.value.class),B("width",e.value.width,"%"),L("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),k(" ",e.value.label," "),a(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function Rf(i,n){if(i&1&&C(0,If,3,10,"th",40),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Nf(i,n){if(i&1){let e=y();s(0,"div",44)(1,"img",48),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),s(2,"div",49)(3,"span",32),d(4),l(),s(5,"span",50),d(6),l()()()}if(i&2){let e=c(3).$implicit;a(),m("src",e.mimeUrl,X),a(3),w(e.name),a(2),w(e.description)}}function Vf(i,n){if(i&1&&_(0,"app-share-repository",45),i&2){let e=c(3).$implicit;m("share",e)}}function Of(i,n){if(i&1&&_(0,"app-badge-members",46),i&2){let e=c(3).$implicit;m("members",e.counts)}}function Lf(i,n){if(i&1){let e=y();s(0,"span",53),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",6),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);a(),m("icon",t.icons.SHARED),a(),k(" ",e.counts.shares," ")}}function Bf(i,n){if(i&1){let e=y();s(0,"span",34),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.goToComments(o))}),_(1,"fa-icon",6),l()}if(i&2){let e=c(6);a(),m("icon",e.icons.faCommentDots)}}function Uf(i,n){if(i&1&&(C(0,Lf,3,2,"span",51),C(1,Bf,2,1,"span",52)),i&2){let e=c(3).$implicit;x(e.counts.shares?0:-1),a(),x(e.hasComments?1:-1)}}function $f(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(2).$implicit,t=c().$implicit;V(e.value.newly&&t[e.value.newly]?"badge prop-newly-"+t[e.value.newly]:""),a(),k(" ",t.hTimeAgo," ")}}function Hf(i,n){if(i&1&&(s(0,"td"),C(1,Nf,7,3,"div",44)(2,Vf,1,1,"app-share-repository",45)(3,Of,1,1,"app-badge-members",46)(4,Uf,2,2)(5,$f,2,3,"span",47),l()),i&2){let e,t=c().$implicit;V(t.value.class),B("width",t.value.width,"%"),L("text-align-center",t.value.textCenter),a(),x((e=t.key)==="name"?1:e==="from"?2:e==="members"?3:e==="info"?4:e==="created"?5:-1)}}function zf(i,n){if(i&1&&C(0,Hf,6,7,"td",43),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Gf(i,n){if(i&1){let e=y();s(0,"tr",42),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){h(e);let o=c(2);return g(o.openShareDialog())}),D(1,zf,1,1,null,null,Fd),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);L("disabled",!e.enabled)("selected",e.id===(t.selected==null?null:t.selected.id)),a(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function Wf(i,n){if(i&1){let e=y();s(0,"table",36)(1,"thead")(2,"tr"),D(3,Rf,1,1,null,null,Fd),b(5,"keyvalue"),l()()(),s(6,"app-virtual-scroll",37),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),s(8,"table",36)(9,"tbody",38),D(10,Gf,4,7,"tr",39,Md),l()()()}if(i&2){let e=c();a(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",E(7,5,e.shares,e.inputFilter.search())),a(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function jf(i,n){if(i&1&&(s(0,"span",54),_(1,"fa-icon",6),d(2,"New share"),l()),i&2){let e=c();a(),m("icon",e.icons.faPlus)}}function Kf(i,n){}function qf(i,n){if(i&1&&(s(0,"span",54),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();a(),m("icon",e.icons.faArrowRotateRight)}}function Qf(i,n){if(i&1&&(s(0,"span",54),_(1,"fa-icon",6),d(2,"Go to"),l()),i&2){let e=c();a(),m("icon",e.icons.faMapMarkerAlt)}}function Yf(i,n){if(i&1&&(s(0,"span",54),_(1,"fa-icon",6),d(2,"Edit"),l()),i&2){let e=c();a(),m("icon",e.icons.faPen)}}function Xf(i,n){if(i&1&&(s(0,"span",54),_(1,"fa-icon",6),d(2,"Edit children shares"),l()),i&2){let e=c(2);a(),m("icon",e.icons.SHARED)}}function Zf(i,n){if(i&1){let e=y();N(0,Xf,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openChildShareDialog())})}}function Jf(i,n){}function eh(i,n){if(i&1&&(s(0,"span",54),_(1,"fa-icon",6),d(2,"Info"),l()),i&2){let e=c();a(),m("icon",e.icons.faCircleInfo)}}var Pd=(()=>{let n=class n{constructor(){this.locale=S(z),this.layout=S(I),this.icons={SHARED:ie.SHARED_WITH_OTHERS,faArrowRotateRight:mt,faArrowDown:ut,faArrowUp:pt,faRotate:bi,faPlus:et,faMinus:_n,faPen:dt,faEllipsisH:No,faMapMarkerAlt:Sn,faCircleInfo:Rt,faCommentDots:Qo},this.originalOrderKeyValue=Fe,this.TAB_MENU=fe,this.loading=!1,this.shares=[],this.selected=null,this.tableHeaders={name:{label:"Name",width:40,textCenter:!1,class:"",show:!0,sortable:!0},from:{label:"Shared from",width:20,textCenter:!1,class:"d-none d-md-table-cell",show:!0},members:{label:"Members",width:16,class:"d-none d-md-table-cell",textCenter:!1,show:!0},info:{label:"Info",width:14,textCenter:!0,class:"d-none d-md-table-cell",show:!0},created:{label:"Created",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",created:"Created"},this.activatedRoute=S(Mt),this.store=S(te),this.sharesService=S(ai),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],created:[{prop:"createdAt",type:"date"}]},this.sortTable=new Bt(this.constructor.name,this.sortSettings),this.loadShares(),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(this.icons.SHARED),this.layout.setBreadcrumbNav({url:`/${G.SHARED}/${Lt.SHARED_WITH_OTHER}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShares(){this.loading=!0,this.onSelect(),this.sharesService.listShares().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t.map(o=>new Wr(o))),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Shares",t.error.message)}})}sortBy(t,o=!0,r){this.shares=this.sortTable.sortBy(t,o,r||this.shares)}onSelect(t=null){this.selected=t,this.store.shareSelection.set(this.selected)}openShareDialog(t=!1){t?this.layout.openDialog(Ji,"lg").content.shareChange.pipe(ce(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.focusOnSelect=u.name,this.loadShares())}):this.sharesService.getShare(this.selected.id).subscribe({next:o=>{this.layout.openDialog(Ji,"lg",{initialState:{share:o}}).content.shareChange.pipe(ce(1)).subscribe(p=>{let[u,v]=p;if(u==="update"){this.selected.name=v.name,this.selected.alias=v.alias,this.selected.description=v.description,this.selected.modifiedAt=v.modifiedAt,this.selected.enabled=v.enabled;let T={users:0,groups:0,links:v.links.length};for(let R of v.members)R.isUser?T.users++:T.groups++;this.selected.counts=re(re({},this.selected.counts),T)}else u==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(T=>T.id!==v.id)))})},error:o=>this.layout.sendNotification("error","Edit share",this.selected.name,o)})}openChildShareDialog(t){t&&this.onSelect(t),this.layout.openDialog(Ni,null,{initialState:{share:this.selected}}).content.sharesCountEvent.subscribe(r=>this.selected.counts.shares=r)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}goTo(t){t=t||this.selected,this.sharesService.goTo(t).catch(console.error)}goToComments(t){this.sharesService.goTo(t).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}focusOn(t){let o=this.shares.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-shared"]],viewQuery:function(o,r){if(o&1&&(Z(Ke,5),Z(Re,7),Z(st,7),Z(Tf,7),Z(Ef,7)),o&2){let p;j(p=K())&&(r.scrollView=p.first),j(p=K())&&(r.inputFilter=p.first),j(p=K())&&(r.btnNavigationView=p.first),j(p=K())&&(r.mainContextMenu=p.first),j(p=K())&&(r.targetContextMenu=p.first)}},decls:38,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-default","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","tooltip"],[3,"icon"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["contextMenuItem",""],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","bg-purple",3,"font-size"],[1,"label-bottom-right"],[1,"badge","bg-success","cursor-pointer",3,"font-size"],[1,"badge","bg-purple","cursor-pointer",3,"font-size"],[1,"label-bottom-left"],[3,"share","galleryMode"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events","text-file-name-preserve"],[1,"badge","bg-purple"],[1,"badge","bg-success","cursor-pointer",3,"click"],[1,"badge","bg-purple","cursor-pointer",3,"click"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[3,"share"],[3,"members"],[3,"class"],["alt","","draggable","false","height","30","width","30",3,"error","src"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xs"],[1,"badge","bg-purple","cursor-pointer","me-1"],[1,"badge","bg-success","cursor-pointer"],[1,"badge","bg-purple","cursor-pointer","me-1",3,"click"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();s(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadShares())}),_(3,"fa-icon",4),l(),s(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openShareDialog(!0))}),_(6,"fa-icon",6),l(),s(7,"button",7),b(8,"translate"),f("click",function(){return h(p),g(r.openShareDialog())}),_(9,"fa-icon",6),l(),s(10,"button",7),b(11,"translate"),f("click",function(){return h(p),g(r.openChildShareDialog())}),_(12,"fa-icon",6),l(),s(13,"button",7),b(14,"translate"),f("click",function(){return h(p),g(r.goTo())}),_(15,"fa-icon",6),l(),s(16,"div",8)(17,"div",9),_(18,"app-input-filter",10),l(),s(19,"app-navigation-view",11),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(20,Ff,6,8,"div",12)(21,Wf,12,8),s(22,"div",13)(23,"span",14),d(24),b(25,"translate"),l()(),s(26,"context-menu",null,0),N(28,jf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.openShareDialog(!0))}),N(29,Kf,0,0,"ng-template",16)(30,qf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.loadShares())}),l(),s(31,"context-menu",null,1),N(33,Qf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.goTo())}),N(34,Yf,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.openShareDialog())}),C(35,Zf,1,0,null,17),N(36,Jf,0,0,"ng-template",16)(37,eh,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(a(),m("tooltip",E(2,22,"Refresh",r.locale.language)),a(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),a(),m("tooltip",E(5,25,"New share",r.locale.language)),a(2),m("icon",r.icons.faPlus),a(),m("disabled",!r.selected)("tooltip",E(8,28,"Edit share",r.locale.language)),a(2),m("icon",r.icons.faPen),a(),m("disabled",!(r.selected!=null&&r.selected.counts.shares))("tooltip",E(11,31,"Edit children shares",r.locale.language)),a(2),m("icon",r.icons.SHARED),a(),m("disabled",!r.selected)("tooltip",E(14,34,"Go to",r.locale.language)),a(2),m("icon",r.icons.faMapMarkerAlt),a(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),a(),x(r.galleryMode!=null&&r.galleryMode.enabled?20:21),a(4),ke("",r.shares.length," ",E(25,37,"shares",r.locale.language)),a(5),m("divider",!0),a(6),x(r.selected!=null&&r.selected.counts.shares?35:-1),a(),m("divider",!0))},dependencies:[F,P,st,Re,Ge,Me,Ke,Pi,Ot,Vt,Nt,ri,tt,ni,De,J,ht],encapsulation:2});let i=n;return i})();var Zr=(()=>{let n=class n{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new ae(!0),this.renamingInProgress=new ae(!0),this.elementRef=S(hi),this.renderer=S(Dt),this.dangerColor="#dd4b39",this.primaryColor="#3c8dbc"}ngOnInit(){this.initStyles(),this.renamingInProgress.emit(!0),this.elementRef.nativeElement.value=this.inputObject[this.inputField],setTimeout(()=>{this.setParentDraggable("false"),this.disableFocus||(this.elementRef.nativeElement.focus(),this.elementRef.nativeElement.select())},5)}onBlur(){this.validateInput(),this.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||this.validateInput()}onEscape(){this.disableKeyboard||this.disableEdit()}initStyles(){this.renderer.setStyle(this.elementRef.nativeElement,"display","inline"),this.renderer.setStyle(this.elementRef.nativeElement,"height","100%"),this.renderer.setStyle(this.elementRef.nativeElement,"min-height","20px"),this.renderer.addClass(this.elementRef.nativeElement,"form-control"),this.textCenter?(this.renderer.addClass(this.elementRef.nativeElement,"text-center"),this.renderer.setStyle(this.elementRef.nativeElement,"padding","0")):this.renderer.setStyle(this.elementRef.nativeElement,"padding","2px"),this.fullWidth?this.renderer.addClass(this.elementRef.nativeElement,"w-100"):this.renderer.addClass(this.elementRef.nativeElement,"w-75")}setIncorrectForm(){this.renderer.addClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.dangerColor)}setCorrectForm(){this.renderer.removeClass(this.elementRef.nativeElement,"is-invalid"),this.renderer.setStyle(this.elementRef.nativeElement,"border-color",this.primaryColor)}validateInput(){this.elementRef.nativeElement.value?this.elementRef.nativeElement.value===this.inputObject[this.inputField]?(this.setCorrectForm(),this.disableEdit()):(this.setCorrectForm(),this.updateObject.next({object:this.inputObject,name:this.elementRef.nativeElement.value}),this.disableEdit()):this.setIncorrectForm()}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(t){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",t)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Ci({type:n,selectors:[["","appInputEdit",""]],hostBindings:function(o,r){o&1&&f("blur",function(){return r.onBlur()})("keyup.enter",function(){return r.onEnter()})("keyup.esc",function(){return r.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=n;return i})();var Id=(()=>{let n=class n{constructor(){this.uploadFiles=new ae,this.elementRef=S(hi),this.renderer=S(Dt)}ngOnInit(){let t=document.createElement("input");this.renderer.setAttribute(t,"type","file"),this.renderer.setStyle(t,"display","none"),this.renderer.setStyle(t,"position","absolute"),this.elementRef.nativeElement.appendChild(t),this.eventElement=this.renderer.listen(this.elementRef.nativeElement,"click",()=>t.click()),this.options?.isMultiple&&this.renderer.setAttribute(t,"multiple","multiple"),this.options?.isDirectory&&this.renderer.setAttribute(t,"webkitdirectory","webkitdirectory"),this.eventInput=this.renderer.listen(t,"change",o=>{o.target.value&&(this.uploadFiles.next({files:o.target.files,isDirectory:this.options?.isDirectory||!1}),o.target.value="")})}ngOnDestroy(){try{this.eventElement(),this.eventInput()}catch(t){console.warn(t)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275dir=Ci({type:n,selectors:[["","appUploadFiles",""]],inputs:{options:"options"},outputs:{uploadFiles:"uploadFiles"}});let i=n;return i})();function ih(i,n){i&1&&(s(0,"span",3),d(1,"Compress and Save"),l())}function nh(i,n){i&1&&(s(0,"span",3),d(1,"Compress and Download"),l())}function oh(i,n){if(i&1){let e=y();s(0,"div",16)(1,"label",13)(2,"input",14),_e("ngModelChange",function(o){h(e);let r=c();return ue(r.archiveProps.compressInDirectory,o)||(r.archiveProps.compressInDirectory=o),g(o)}),l(),s(3,"span",3),d(4,"Save in the current directory"),l()()()}if(i&2){let e=c();a(2),me("ngModel",e.archiveProps.compressInDirectory)}}var Jr=(()=>{let n=class n{constructor(){this.archiveProps={name:"",files:[],compressInDirectory:!0,extension:"tar"},this.submitEvent=new ae,this.disableInDirCompression=!1,this.locale=S(z),this.layout=S(I),this.compression=!1,this.icons={faFileArchive:Vo},this.submitted=!1,this.filesService=S(Le)}ngOnInit(){this.disableInDirCompression&&(this.archiveProps.compressInDirectory=!1)}onEnter(){this.onSubmit()}onSubmit(){this.archiveProps.name&&!this.submitted&&(this.submitted=!0,this.filesService.compress(this.archiveProps),this.submitEvent.emit(),this.layout.closeDialog())}setCompression(t){this.archiveProps.extension=t?"tgz":"tar"}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-compression-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},gi)},inputs:{archiveProps:"archiveProps"},outputs:{submitEvent:"submitEvent"},decls:30,vars:16,consts:[[1,"modal-header"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],[1,"modal-title","ms-auto"],[1,"fs-sm"],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[1,"input-group"],["appAutofocus","","type","text",1,"form-control",3,"ngModelChange","ngModel","placeholder"],[1,"input-group-text"],[2,"min-width","40px"],[1,"form-check","mb-0","mt-2","ps-0"],[1,"form-check-label","ps-1"],["type","checkbox",3,"ngModelChange","ngModel"],["l10nTranslate","",1,"me-1"],[1,"form-check","mb-0","mt-1","ps-0"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["l10nTranslate","","type","button",1,"btn","btn-primary",3,"click","disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),C(3,ih,2,0,"span",3)(4,nh,2,0,"span",3),l(),s(5,"h4",4)(6,"span",5),d(7),b(8,"translate"),l()(),s(9,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),s(10,"div",7)(11,"div",8)(12,"input",9),b(13,"translate"),_e("ngModelChange",function(u){return ue(r.archiveProps.name,u)||(r.archiveProps.name=u),u}),l(),s(14,"div",10)(15,"span",11),d(16),l()()(),s(17,"div",12)(18,"label",13)(19,"input",14),_e("ngModelChange",function(u){return ue(r.compression,u)||(r.compression=u),u}),f("ngModelChange",function(u){return r.setCompression(u)}),l(),s(20,"span",15),d(21,"Enable compression"),l(),s(22,"small",3),d(23,"(this may take longer)"),l()()(),C(24,oh,5,1,"div",16),l(),s(25,"div",17)(26,"button",18),f("click",function(){return r.layout.closeDialog()}),d(27,"Cancel"),l(),s(28,"button",19),f("click",function(){return r.onSubmit()}),d(29,"Confirm"),l()()),o&2&&(a(2),m("icon",r.icons.faFileArchive),a(),x(r.archiveProps.compressInDirectory?3:4),a(4),ke("",r.archiveProps.files.length," ",E(8,10,r.archiveProps.files.length>1?"items":"item",r.locale.language)),a(5),me("ngModel",r.archiveProps.name),m("placeholder",E(13,13,"Archive name",r.locale.language)),a(4),k(".",r.archiveProps.extension),a(3),me("ngModel",r.compression),a(5),x(r.disableInDirCompression?-1:24),a(4),m("disabled",!r.archiveProps.name||r.submitted))},dependencies:[F,Te,ze,Ft,xe,we,je,P,J],encapsulation:2,changeDetection:0});let i=n;return i})();var Rd={"Microsoft Word":".docx","Microsoft Excel":".xlsx","Microsoft PowerPoint":".pptx","Open Document Text":".odt","Open Document Spreadsheet":".ods","Open Document Presentation":".odp","Rich Text Format":".rtf",Text:".txt"};var rh=["InputText"],ah=(i,n)=>n.key;function sh(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faGlobe)}}function lh(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFolderClosed)}}function ch(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFileAlt)}}function ph(i,n){if(i&1){let e=y();s(0,"li",19)(1,"a",20),f("click",function(){let o=h(e).$implicit,r=c(3);return g(r.onSelectDocType(o.key))}),d(2),l()()}if(i&2){let e=n.$implicit;a(2),w(e.key)}}function dh(i,n){if(i&1&&(s(0,"ul",18),D(1,ph,3,1,"li",19,ah),b(3,"keyvalue"),l()),i&2){let e=c(2);a(),M(E(3,0,e.docTypes,e.originalOrderKeyValue))}}function mh(i,n){if(i&1&&(s(0,"div",7)(1,"button",15)(2,"span",4),d(3),l(),_(4,"fa-icon",16),l(),N(5,dh,4,3,"ul",17),l()),i&2){let e=c();a(3),w(e.selectedDocType),a(),m("icon",e.icons.faCaretDown)}}function uh(i,n){if(i&1){let e=y();s(0,"div",8)(1,"span",9),_(2,"fa-icon",3),l(),s(3,"input",21),b(4,"translate"),_e("ngModelChange",function(o){h(e);let r=c();return ue(r.downloadProp.url,o)||(r.downloadProp.url=o),g(o)}),f("keydown.control.v",function(){h(e);let o=c();return g(o.pasteUrl())})("keydown.meta.v",function(){h(e);let o=c();return g(o.pasteUrl())}),l()()}if(i&2){let e=c();a(2),m("icon",e.icons.faGlobe),a(),me("ngModel",e.downloadProp.url),m("placeholder",E(4,3,e.downloadProp.placeholder,e.locale.language))}}function _h(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFolderClosed)}}function fh(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faFileAlt)}}function hh(i,n){if(i&1&&(s(0,"span",12),d(1),l()),i&2){let e=c();a(),w(e.error)}}var Nd=(()=>{let n=class n{constructor(){this.refreshFiles=new ae,this.locale=S(z),this.layout=S(I),this.originalOrderKeyValue=Fe,this.icons={faCaretDown:Ul,faGlobe:Cn,faFolderClosed:Zo,faFileAlt:qo},this.fileProp={title:"",name:"",placeholder:""},this.downloadProp={title:"Download from an external link",url:"",placeholder:"URL (https://...)"},this.selectedDocType="Text",this.docTypes=Rd,this.submitted=!1,this.filesService=S(Le)}ngOnInit(){this.inputType==="download"?(this.fileProp.title="Download from URL",this.fileProp.placeholder="File name"):this.inputType==="file"?(this.fileProp.name=`${this.layout.translateString("New document")}.txt`,this.fileProp.title="New document",this.fileProp.placeholder="Document name",this.updateFileSelection()):(this.fileProp.title="New folder",this.fileProp.placeholder="Folder name")}onSelectDocType(t){this.selectedDocType=t;let o=this.fileNamePosition();this.fileProp.name=`${this.fileProp.name.substring(0,o<0?this.fileProp.name.length:o)}${this.docTypes[t]}`,this.updateFileSelection()}onEnter(){this.fileProp.name&&this.onSubmit()}onSubmit(){if(this.submitted=!0,this.files.find(t=>t.name.toLowerCase()===this.fileProp.name.toLowerCase())){this.error="This name is already used",this.submitted=!1;return}if(this.inputType==="download"){if(!Mc.test(this.downloadProp.url)){this.error="Malformed URL",this.submitted=!1;return}this.filesService.downloadFromUrl(this.downloadProp.url,this.fileProp.name)}else this.filesService.make(this.inputType,this.fileProp.name);this.layout.closeDialog()}pasteUrl(){setTimeout(()=>{this.fileProp.name=this.downloadProp.url.split("/").slice(-1)[0]},200)}fileNamePosition(){return this.fileProp.name.lastIndexOf(".")}updateFileSelection(){setTimeout(()=>{this.inputText.nativeElement.focus(),this.inputText.nativeElement.setSelectionRange(0,this.fileNamePosition())},0)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-files-new-dialog"]],viewQuery:function(o,r){if(o&1&&Z(rh,7),o&2){let p;j(p=K())&&(r.inputText=p.first)}},hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},gi)},inputs:{files:"files",inputType:"inputType"},outputs:{refreshFiles:"refreshFiles"},decls:24,vars:12,consts:[["InputText",""],[1,"modal-header"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],["dropdown","",1,"btn-group","mb-3"],[1,"input-group","my-2"],[1,"input-group-text"],["type","text","appAutofocus","",1,"form-control",3,"ngModelChange","ngModel","placeholder"],[1,"modal-footer"],["l10nTranslate","",1,"me-auto","fs-sm","text-danger"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click","disabled"],["aria-controls","dropdown-animated","dropdownToggle","","id","button-animated","type","button",1,"btn","btn-primary","dropdown-toggle"],[1,"ms-3",3,"icon"],["aria-labelledby","button-animated","class","dropdown-menu","id","dropdown-animated","role","menu",4,"dropdownMenu"],["aria-labelledby","button-animated","id","dropdown-animated","role","menu",1,"dropdown-menu"],["role","menuitem"],["l10nTranslate","",1,"dropdown-item",3,"click"],["type","text","appAutofocus","",1,"form-control",3,"ngModelChange","keydown.control.v","keydown.meta.v","ngModel","placeholder"]],template:function(o,r){if(o&1){let p=y();s(0,"div",1)(1,"h4",2),C(2,sh,1,1,"fa-icon",3)(3,lh,1,1,"fa-icon",3)(4,ch,1,1,"fa-icon",3),s(5,"span",4),d(6),l()(),s(7,"button",5),f("click",function(){return h(p),g(r.layout.closeDialog())}),l()(),s(8,"div",6),C(9,mh,6,2,"div",7),C(10,uh,5,6,"div",8),s(11,"div",8)(12,"span",9),C(13,_h,1,1,"fa-icon",3)(14,fh,1,1,"fa-icon",3),l(),s(15,"input",10,0),b(17,"translate"),_e("ngModelChange",function(v){return h(p),ue(r.fileProp.name,v)||(r.fileProp.name=v),g(v)}),l()()(),s(18,"div",11),C(19,hh,2,1,"span",12),s(20,"button",13),f("click",function(){return h(p),g(r.layout.closeDialog())}),d(21,"Cancel"),l(),s(22,"button",14),f("click",function(){return h(p),g(r.onSubmit())}),d(23,"Confirm "),l()()}if(o&2){let p;a(2),x((p=r.inputType)==="download"?2:p==="directory"?3:p==="file"?4:-1),a(4),w(r.fileProp.title),a(3),x(r.inputType==="file"?9:-1),a(),x(r.inputType==="download"?10:-1),a(3),x(r.inputType==="directory"?13:14),a(2),me("ngModel",r.fileProp.name),m("placeholder",E(17,9,r.fileProp.placeholder,r.locale.language)),a(4),x(r.error?19:-1),a(3),m("disabled",!r.fileProp.name||r.inputType==="download"&&!r.downloadProp.url||r.submitted)}},dependencies:[F,P,Pi,Mi,Fi,Di,Te,ze,xe,we,je,J,De],encapsulation:2});let i=n;return i})();var Vd=i=>({arg:i});function gh(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}function Ch(i,n){if(i&1&&(_(0,"div",11),b(1,"translate")),i&2){let e=c(2);m("innerHTML",$t(1,1,e.permanently?"delete_multiple_files":"trash_multiple_files",e.locale.language,Je(5,Vd,e.files.length)),zn)}}function xh(i,n){if(i&1&&(_(0,"div",11),b(1,"translate")),i&2){let e=c(2);m("innerHTML",$t(1,1,e.permanently?"delete_one_file":"trash_one_file",e.locale.language,Je(5,Vd,e.files[0].name)),zn)}}function Sh(i,n){if(i&1&&C(0,Ch,2,7,"div",11)(1,xh,2,7,"div",11),i&2){let e=c();x(e.files.length>1?0:e.files.length===1?1:-1)}}function vh(i,n){if(i&1&&(s(0,"div",3),d(1),l()),i&2){let e=c();a(),w(e.permanently?"Permanent deletion":"Moving to trash")}}var Od=(()=>{let n=class n{constructor(){this.files=[],this.permanently=!1,this.removeFiles=new ae,this.locale=S(z),this.layout=S(I),this.icons={faTrashCan:wi,faSpinner:Oe},this.submitted=!1}onEnter(){this.onSubmit()}onSubmit(){this.submitted||(this.submitted=!0,this.removeFiles.next(),this.layout.closeDialog())}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-trash-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},gi)},inputs:{files:"files",permanently:"permanently"},outputs:{removeFiles:"removeFiles"},decls:16,vars:4,consts:[[1,"modal-header"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["animation","spin",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"overflow-wrap-and-whitespace"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"click","disabled"],[3,"innerHTML"]],template:function(o,r){if(o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span",3),d(4,"Trash"),l(),C(5,gh,1,1,"fa-icon",4),l(),s(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),s(7,"div",6)(8,"div",7),C(9,Sh,2,1)(10,vh,2,1,"div",3),l()(),s(11,"div",8)(12,"button",9),f("click",function(){return r.layout.closeDialog()}),d(13,"Cancel"),l(),s(14,"button",10),f("click",function(){return r.onSubmit()}),d(15,"Confirm"),l()()),o&2){let p;a(2),m("icon",r.icons.faTrashCan),a(3),x(r.submitted?5:-1),a(4),x((p=r.submitted)===!1?9:p===!0?10:-1),a(5),m("disabled",r.submitted)}},dependencies:[P,F,J],encapsulation:2,changeDetection:0});let i=n;return i})();function yh(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}var Ld=(()=>{let n=class n{constructor(){this.files=[],this.layout=S(I),this.icons={faTrashCan:wi,faSpinner:Oe},this.submitted=!1,this.filesService=S(Le)}onEnter(){this.onSubmit()}onSubmit(){this.submitted||(this.submitted=!0,this.filesService.delete(this.files),this.layout.closeDialog(),this.submitted=!1)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-trash-empty-dialog"]],hostBindings:function(o,r){o&1&&f("keyup.enter",function(){return r.onEnter()},gi)},inputs:{files:"files"},decls:17,vars:3,consts:[[1,"modal-header"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["animation","spin",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],["l10nTranslate","",1,"mb-3"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"click","disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span",3),d(4,"Trash"),l(),C(5,yh,1,1,"fa-icon",4),l(),s(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),s(7,"div",6)(8,"div",7),d(9,"Would you like to empty the trash ?"),l(),s(10,"small",3),d(11,"All items will be permanently deleted"),l()(),s(12,"div",8)(13,"button",9),f("click",function(){return r.layout.closeDialog()}),d(14,"Cancel"),l(),s(15,"button",10),f("click",function(){return r.onSubmit()}),d(16,"Confirm"),l()()),o&2&&(a(2),m("icon",r.icons.faTrashCan),a(3),x(r.submitted?5:-1),a(10),m("disabled",r.submitted))},dependencies:[F,P],encapsulation:2});let i=n;return i})();var bh=["InputRename"],wh=(i,n)=>n.alias,Th=(i,n)=>n.key;function Eh(i,n){if(i&1&&_(0,"app-user-avatar",14)(1,"div",9),i&2){let e=c().$implicit;m("user",e.owner)}}function Ah(i,n){if(i&1){let e=y();s(0,"input",15,0),f("updateObject",function(o){h(e);let r=c(2);return g(r.onRenameRoot(o))}),l()}if(i&2){let e=c().$implicit;m("inputObject",e)("fullWidth",!0)}}function kh(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(2).$implicit;a(),w(e.externalPath)}}function Dh(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"pathSlice"),l()),i&2){let e=c(2).$implicit;a(),w(E(2,1,e.file.path,-2))}}function Mh(i,n){if(i&1&&(s(0,"div",16)(1,"span"),d(2),l()(),s(3,"div",17),C(4,kh,2,1,"span")(5,Dh,3,4,"span"),l()),i&2){let e=c().$implicit,t=c();a(2),w(e.name),a(2),x(t.user.isAdmin&&e.externalPath?4:5)}}function Fh(i,n){if(i&1&&(s(0,"div",7)(1,"div",18),d(2),l(),s(3,"div",18),d(4),b(5,"amTimeAgo"),l()()),i&2){let e=c().$implicit;a(2),w(e.alias),a(2),w($(5,2,e.createdAt))}}function Ph(i,n){if(i&1){let e=y();s(0,"button",21),b(1,"translate"),_e("ngModelChange",function(o){h(e);let r=c().$implicit,p=c().$implicit;return ue(p.hPerms[r.key],o)||(p.hPerms[r.key]=o),g(o)}),f("ngModelChange",function(){h(e);let o=c(2).$implicit,r=c();return g(r.onPermissionChange(o))}),_(2,"fa-icon",22),l()}if(i&2){let e=c().$implicit,t=c().$implicit,o=c();V(q("btn btn-sm btn-custom ",!t.isDir&&(e.key==="a"||e.key==="d")?"disabled":"")),me("ngModel",t.hPerms[e.key]),m("tooltip",E(1,6,o.SPACES_PERMISSIONS_TEXT[e.key].text,o.locale.language)),a(2),m("icon",o.SPACES_PERMISSIONS_TEXT[e.key].icon)}}function Ih(i,n){if(i&1&&(s(0,"button",23),b(1,"translate"),_(2,"fa-icon",22),l()),i&2){let e=c().$implicit,t=c().$implicit,o=c();L("active",t.hPerms[e.key]),m("tooltip",E(1,4,o.SPACES_PERMISSIONS_TEXT[e.key].text,o.locale.language)),a(2),m("icon",o.SPACES_PERMISSIONS_TEXT[e.key].icon)}}function Rh(i,n){if(i&1&&C(0,Ph,3,9,"button",19)(1,Ih,3,7,"button",20),i&2){let e=c().$implicit,t=c();x(!(e.owner!=null&&e.owner.id)&&t.user.isAdmin||(e.owner==null?null:e.owner.id)===t.user.id?0:1)}}function Nh(i,n){if(i&1){let e=y();s(0,"div",1)(1,"div",2)(2,"div",3),C(3,Eh,2,1),_(4,"img",4),s(5,"div",5),C(6,Ah,2,2,"input",6)(7,Mh,6,2),l()(),C(8,Fh,6,4,"div",7),s(9,"div",8),_(10,"div",9),D(11,Rh,2,1,null,null,Th),b(13,"keyvalue"),_(14,"div",10),s(15,"button",11),b(16,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.setRenamed(o))}),_(17,"fa-icon",12),l(),s(18,"button",13),b(19,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.removeRoot(o))}),_(20,"fa-icon",12),l()()()()}if(i&2){let e=n.$implicit,t=c();a(3),x(t.showUsers?3:-1),a(),L("cursor-pointer",!!e.file.path),m("src",e.file.mimeUrl,X)("tooltip",e.file.path),a(2),x(e.isRenamed?6:7),a(2),x(t.showInfo?8:-1),a(3),M(E(13,14,e.hPerms,t.originalOrderKeyValue)),a(4),V(q("btn btn-sm ",e.isRenamed?"btn-success":"btn-secondary"," me-2")),m("tooltip",E(16,17,"Rename",t.locale.language)),a(2),m("icon",t.icons.faPen),a(),m("tooltip",E(19,20,"Remove",t.locale.language)),a(2),m("icon",t.icons.faTimes)}}var Bn=(()=>{let n=class n{constructor(){this.showInfo=!0,this.showUsers=!0,this.addRootFile=null,this.locale=S(z),this.icons={faTimes:It,faPen:dt},this.SPACES_PERMISSIONS_TEXT=vc,this.originalOrderKeyValue=Fe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(t=>this.addRoot(t)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(t){let o={id:0,alias:to(t.name,"alias",this.space.roots).toLowerCase(),name:to(t.name,"name",this.space.roots),permissions:"",createdAt:new Date};t.externalPath?(o.externalPath=t.externalPath,o.owner={id:null,login:null,email:null,fullName:null},o.file={id:0,path:null,mime:null}):(o.externalPath=null,o.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},o.file={id:t.id,path:t.path,mime:t.mime}),this.space.addRoot(o,!0)}removeRoot(t){this.space.roots=this.space.roots.filter(o=>t.alias!==o.alias)}onRenameRoot(t){let o=t.object;o.alias=to(sc(t.name,!0),"alias",this.space.roots.filter(r=>r.id!==o.id)).toLowerCase(),o.name=to(t.name.replace(rc,""),"name",this.space.roots.filter(r=>r.id!==o.id))}onPermissionChange(t){t.permissions=Tc(t.hPerms)}setRenamed(t){t.isRenamed?(this.onRenameRoot({object:t,name:this.inputRename.nativeElement.value}),t.isRenamed=!1):t.isRenamed=!0}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-manage-roots"]],viewQuery:function(o,r){if(o&1&&Z(bh,5),o&2){let p;j(p=K())&&(r.inputRename=p.first)}},inputs:{space:"space",user:"user",showInfo:"showInfo",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","px-3","py-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-sm",2,"max-height","38px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","35","width","35","alt","",3,"src","tooltip"],[1,"d-flex","flex-column","text-truncate","ms-2"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth"],[1,"d-flex","flex-column","fs-2xs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","no-select"],[1,"vr","mx-2"],[1,"vr","ms-1","me-2"],["type","button",3,"click","tooltip"],[3,"icon"],["type","button",1,"btn","btn-sm","btn-danger",3,"click","tooltip"],["tooltipPlacement","bottom",3,"user"],["appInputEdit","","type","text","required","",3,"updateObject","inputObject","fullWidth"],[1,"text-truncate"],[1,"d-none","d-lg-block","fs-xs","text-truncate","text-muted"],[1,"d-flex","justify-content-end"],["btnCheckbox","","type","button",3,"ngModel","tooltip","class"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip","active"],["btnCheckbox","","type","button",3,"ngModelChange","ngModel","tooltip"],["size","lg",3,"icon"],["type","button",1,"btn","btn-sm","btn-custom","disabled",3,"tooltip"]],template:function(o,r){o&1&&D(0,Nh,21,23,"div",1,wh),o&2&&M(r.space.roots)},dependencies:[Ac,lr,F,qe,Ge,Me,Te,xe,we,Zr,De,J,Qe,jr],encapsulation:2});let i=n;return i})();function Vh(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}var Bd=(()=>{let n=class n{constructor(){this.addAnchoredFiles=new ae,this.locale=S(z),this.layout=S(I),this.icons={faAnchor:ii,faPlus:et,faSpinner:Oe,SPACES:ie.SPACES},this.space={roots:[]},this.submitted=!1,this.loading=!1,this.userService=S(oe),this.user=this.userService.user,this.spacesService=S(it)}ngOnInit(){for(let t of this.files)this.space.roots.push({id:t.id,name:t.name,alias:t.name,permissions:"",createdAt:new Date,isRenamed:!1,hPerms:wc("",[We.SHARE_INSIDE]),isDir:t.mime===oi,owner:{id:this.user.id,login:this.user.login},file:t})}onSetSpace(t){this.selectedSpace=t}onSearchSpaces(t){return this.spacesService.searchSpaces({search:t,shareInsidePermission:!0,limit:6})}onSubmit(){!this.selectedSpace||!this.space.roots.length||(this.loading=!0,this.submitted=!0,this.spacesService.createUserSpaceRoots(this.selectedSpace.id,this.space.roots).subscribe({next:t=>{t.length&&this.addAnchoredFiles.emit({space:this.selectedSpace,rootFiles:t.map(o=>({id:o.file.id,name:o.file.path.split("/").at(-1)}))}),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Anchor files to a space",t.error.message),this.loading=!1,this.submitted=!1}}))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-anchor-file-dialog"]],inputs:{files:"files"},decls:22,vars:14,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"mb-3"],["for","space","l10nTranslate",""],["id","space",3,"data","searchFunction","active","itemIcon","placeholder"],["for","files","l10nTranslate",""],["id","files",3,"space","user","showInfo","showUsers"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click","disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span",3),d(4,"Anchor files to a space"),l()(),C(5,Vh,1,1,"fa-icon",4),s(6,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),s(7,"div",6)(8,"div",7)(9,"label",8),d(10,"Space"),l(),s(11,"app-select",9),b(12,"translate"),f("data",function(u){return r.onSetSpace(u)}),l()(),s(13,"div",7)(14,"label",10),d(15,"Files"),l(),_(16,"app-space-manage-roots",11),l()(),s(17,"div",12)(18,"button",13),f("click",function(){return r.layout.closeDialog()}),d(19,"Cancel"),l(),s(20,"button",14),f("click",function(){return r.onSubmit()}),d(21," Confirm "),l()()),o&2&&(a(2),m("icon",r.icons.faAnchor),a(3),x(r.loading?5:-1),a(6),m("searchFunction",r.onSearchSpaces.bind(r))("active",r.selectedSpace)("itemIcon",r.icons.SPACES)("placeholder",E(12,11,"Type to search for space to select",r.locale.language)),a(5),m("space",r.space)("user",r.user)("showInfo",!1)("showUsers",!1),a(4),m("disabled",r.submitted||!r.selectedSpace||!r.space.roots.length))},dependencies:[F,P,Bn,Fc,J],encapsulation:2});let i=n;return i})();var Oh=["MainContextMenu"],Lh=["MainReadOnlyContextMenu"],Bh=["FileContextMenu"],Uh=()=>({isMultiple:!0}),$h=()=>({isDirectory:!0}),Ud=(i,n)=>n.id,$d=(i,n)=>n.key;function Hh(i,n){if(i&1){let e=y();s(0,"a",33),f("uploadFiles",function(o){h(e);let r=c(3);return g(r.onUploadFiles(o,!0))}),s(1,"span",22),_(2,"fa-icon",10),d(3,"Upload folders"),l()()}if(i&2){let e=c(3);m("options",qn(2,$h)),a(2),m("icon",e.icons.faUpload)}}function zh(i,n){if(i&1){let e=y();s(0,"ul",28)(1,"li",29)(2,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("directory"))}),s(3,"span",22),_(4,"fa-icon",10),d(5,"New folder"),l()()(),s(6,"li",29)(7,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("file"))}),s(8,"span",22),_(9,"fa-icon",10),d(10,"New document"),l()()(),s(11,"li",29)(12,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openNewDialog("download"))}),s(13,"span",22),_(14,"fa-icon",10),d(15,"Download from URL"),l()()(),s(16,"li",29)(17,"a",31),f("uploadFiles",function(o){h(e);let r=c(2);return g(r.onUploadFiles(o))}),s(18,"span",22),_(19,"fa-icon",10),d(20,"Upload files"),l()(),C(21,Hh,4,3,"a",32),l()()}if(i&2){let e=c(2);a(4),m("icon",e.icons.PERSONAL),a(5),m("icon",e.icons.faFileAlt),a(5),m("icon",e.icons.faGlobe),a(3),m("options",qn(6,Uh)),a(2),m("icon",e.icons.faUpload),a(2),x(e.supportUploadFolder?21:-1)}}function Gh(i,n){if(i&1){let e=y();s(0,"div",26),f("onShown",function(){h(e);let o=c();return g(o.initUpload())}),s(1,"button",27),b(2,"translate"),_(3,"fa-icon",10),l(),N(4,zh,22,7,"ul",14),l()}if(i&2){let e=c();a(),m("tooltip",E(2,2,"New",e.locale.language)),a(2),m("icon",e.icons.faPlus)}}function Wh(i,n){if(i&1){let e=y();s(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openSpaceAnchorFileDialog())}),s(2,"span",22),_(3,"fa-icon",10),d(4,"Anchor to a space"),l()()()}if(i&2){let e=c(3);a(3),m("icon",e.icons.faAnchor)}}function jh(i,n){if(i&1){let e=y();s(0,"ul",28)(1,"li",29)(2,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openShareDialog())}),s(3,"span",22),_(4,"fa-icon",10),d(5,"New share"),l()()(),s(6,"li",29)(7,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openShareLinkDialog())}),s(8,"span",22),_(9,"fa-icon",10),d(10,"New share link"),l()()(),C(11,Wh,5,1,"li",29),l()}if(i&2){let e=c(2);a(4),m("icon",e.icons.SHARES),a(5),m("icon",e.icons.faLink),a(2),x(e.isFilesRepo?11:-1)}}function Kh(i,n){if(i&1&&(s(0,"div",11)(1,"button",27),b(2,"translate"),_(3,"fa-icon",10),l(),N(4,jh,12,3,"ul",14),l()),i&2){let e=c();m("isDisabled",!e.hasSelection||e.inSharesList&&!e.selection[0].canBeReShared),a(),m("tooltip",E(2,3,"Share",e.locale.language)),a(2),m("icon",e.icons.SHARES)}}function qh(i,n){if(i&1){let e=y();s(0,"button",9),b(1,"translate"),f("click",function(){h(e);let o=c(2);return g(o.openEmptyTrashDialog())}),_(2,"fa-icon",10),l()}if(i&2){let e=c(2);m("disabled",!e.stats.elements)("tooltip",E(1,3,"Empty",e.locale.language)),a(2),m("icon",e.icons.TRASH)}}function Qh(i,n){if(i&1){let e=y();s(0,"button",9),b(1,"translate"),f("click",function(){h(e);let o=c();return g(o.openTrashDialog(!0))}),_(2,"fa-icon",10),l(),C(3,qh,3,6,"button",34)}if(i&2){let e=c();m("disabled",!e.hasSelection)("tooltip",E(1,4,"Remove",e.locale.language)),a(2),m("icon",e.icons.faBan),a(),x(e.inRootSpace?3:-1)}}function Yh(i,n){if(i&1){let e=y();s(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.shortcutOpen())}),s(2,"span",22),_(3,"fa-icon",10),d(4,"Open"),l()()()}if(i&2){let e=c(3);a(3),m("icon",e.selection[0].isDir?e.icons.faFolderOpen:e.icons.faEye)}}function Xh(i,n){if(i&1){let e=y();s(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.shortcutRename())}),s(2,"span",22),_(3,"fa-icon",10),d(4,"Rename"),l()()()}if(i&2){let e=c(3);a(3),m("icon",e.icons.faSpellCheck)}}function Zh(i,n){if(i&1){let e=y();s(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.addToSync())}),s(2,"span",22),_(3,"fa-icon",10),d(4,"Synchronize"),l()()()}if(i&2){let e=c(3);a(3),m("icon",e.icons.faRotate)}}function Jh(i,n){if(i&1){let e=y();s(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(3);return g(o.decompressFile())}),s(2,"span",22),_(3,"fa-icon",10),d(4,"Decompress"),l()()()}if(i&2){let e=c(3);a(3),m("icon",e.icons.faFileArchive)}}function e1(i,n){if(i&1){let e=y();C(0,Yh,5,1,"li",29),C(1,Xh,5,1,"li",29),s(2,"li",29)(3,"a",30),f("click",function(){h(e);let o=c(2);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),s(4,"span",22),_(5,"fa-icon",10),d(6,"Comment"),l()()(),C(7,Zh,5,1,"li",29),C(8,Jh,5,1,"li",29)}if(i&2){let e=c(2);x(e.selection[0]?0:-1),a(),x(e.inSharesList?-1:1),a(4),m("icon",e.icons.faCommentDots),a(2),x(e.isElectronApp&&e.selection[0].isDir?7:-1),a(),x(!e.inSharesList&&!e.selection[0].isCompressible?8:-1)}}function t1(i,n){if(i&1){let e=y();s(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(2);return g(o.openCompressionDialog())}),s(2,"span",22),_(3,"fa-icon",10),d(4,"Compress"),l()()()}if(i&2){let e=c(2);a(3),m("icon",e.icons.faFileArchive)}}function i1(i,n){if(i&1){let e=y();s(0,"li",29)(1,"a",30),f("click",function(){h(e);let o=c(2);return g(o.copyMoveFiles())}),s(2,"span",22),_(3,"fa-icon",10),d(4,"Copy \xB7 Move"),l()()()}if(i&2){let e=c(2);a(3),m("icon",e.icons.faArrowsAlt)}}function n1(i,n){if(i&1){let e=y();s(0,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openTrashDialog(!0))}),s(1,"span",22),_(2,"fa-icon",10),d(3,"Remove"),l()()}if(i&2){let e=c(3);a(2),m("icon",e.icons.faBan)}}function o1(i,n){if(i&1){let e=y();s(0,"a",30),f("click",function(){h(e);let o=c(3);return g(o.openTrashDialog())}),s(1,"span",22),_(2,"fa-icon",10),d(3,"Trash"),l()()}if(i&2){let e=c(3);a(2),m("icon",e.icons.TRASH)}}function r1(i,n){if(i&1&&(_(0,"li",35),s(1,"li",29),C(2,n1,4,1,"a",36)(3,o1,4,1,"a",36),l()),i&2){let e=c(2);a(2),x(e.isTrashRepo?2:3)}}function a1(i,n){if(i&1){let e=y();s(0,"ul",28),C(1,e1,9,5),C(2,t1,5,1,"li",29),C(3,i1,5,1,"li",29),s(4,"li",29)(5,"a",30),f("click",function(){h(e);let o=c();return g(o.addToClipboard())}),s(6,"span",22),_(7,"fa-icon",10),d(8,"Clipboard"),l()()(),s(9,"li",29)(10,"a",30),f("click",function(){h(e);let o=c();return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION))}),s(11,"span",22),_(12,"fa-icon",10),d(13,"Info"),l()()(),C(14,r1,4,1),l()}if(i&2){let e=c();a(),x(e.selection.length===1?1:-1),a(),x(e.canCompress?2:-1),a(),x(e.hasDisabledItemsInSelection?-1:3),a(4),m("icon",e.icons.faClipboardList),a(5),m("icon",e.icons.faCircleInfo),a(2),x(e.inSharesList?-1:14)}}function s1(i,n){i&1&&_(0,"div")}function l1(i,n){if(i&1){let e=y();s(0,"img",52),f("error",function(){h(e);let o=c().$implicit;return g(o.isImage=!1)}),l()}if(i&2){let e=c().$implicit,t=c(2);B("max-height",t.galleryMode.image,"px"),m("src",ws("",e.thumbnailUrl,"?size=",t.galleryMode.imageRes),X)}}function c1(i,n){if(i&1){let e=y();s(0,"img",53),f("error",function(){h(e);let o=c().$implicit;return g(o.fallBackMimeUrl())}),l()}if(i&2){let e=c().$implicit,t=c(2);m("src",e.mimeUrl,X)("height",t.galleryMode.image)("width",t.galleryMode.image)}}function p1(i,n){if(i&1){let e=y();s(0,"span",56),b(1,"fileLockFormatPipe"),f("click",function(){h(e);let o=c(3).$implicit,r=c(2);return g(r.openLockDialog(o))}),_(2,"fa-icon",10),l()}if(i&2){let e=c(3).$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),m("tooltip",ma($(1,5,e.lock))),a(2),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faLockOpen)}}function d1(i,n){if(i&1){let e=y();s(0,"span",57),f("click",function(){h(e);let o=c(5);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),_(1,"fa-icon",10),l()}if(i&2){let e=c(5);B("font-size",e.galleryMode.textSize,"px"),a(),m("icon",e.icons.faCommentDots)}}function m1(i,n){if(i&1){let e=y();s(0,"span",58),f("click",function(){h(e);let o=c(5);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(3).$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),m("icon",t.icons.SHARES),a(),k(" ",e.shares.length," ")}}function u1(i,n){if(i&1){let e=y();s(0,"span",58),f("click",function(){h(e);let o=c(5);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(3).$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),m("icon",t.icons.SPACES),a(),k(" ",e.spaces.length," ")}}function _1(i,n){if(i&1){let e=y();s(0,"span",58),f("click",function(){h(e);let o=c(5);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(3).$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),m("icon",t.icons.LINKS),a(),k(" ",e.links.length," ")}}function f1(i,n){if(i&1){let e=y();s(0,"span",58),f("click",function(){h(e);let o=c(5);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(3).$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),m("icon",t.icons.SYNC),a(),k(" ",e.syncs.length," ")}}function h1(i,n){if(i&1&&C(0,p1,3,7,"span",54)(1,d1,2,3,"span",55)(2,m1,3,4,"span",46)(3,u1,3,4,"span",46)(4,_1,3,4,"span",46)(5,f1,3,4,"span",46),i&2){let e,t=c().$implicit;x((e=t)==="lock"?0:e==="comments"?1:e==="shares"?2:e==="spaces"?3:e==="links"?4:e==="syncs"?5:-1)}}function g1(i,n){if(i&1&&C(0,h1,6,1),i&2){let e=n.$index;c();let t=Kn(5);x(e<t?0:-1)}}function C1(i,n){if(i&1){let e=y();s(0,"span",58),f("click",function(){h(e);let o=c(3);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){c();let e=Kn(6),t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),m("icon",t.icons.faCirclePlus),a(),k(" ",e," ")}}function x1(i,n){if(i&1&&(s(0,"span",47),_(1,"app-user-avatar",59),l()),i&2){let e=c().$implicit,t=c(2);a(),m("user",e.root.owner)("height",t.galleryMode.dimensions/3.5)("width",t.galleryMode.dimensions/3.5)("fontSize",t.galleryMode.faSize/2.5)}}function S1(i,n){if(i&1&&(s(0,"span",48)(1,"span",60),d(2),l()()),i&2){let e=c().$implicit,t=c(2);a(),B("font-size",t.galleryMode.textSize,"px"),a(),w(e.hTimeAgo)}}function v1(i,n){if(i&1){let e=y();s(0,"input",61),f("renamingInProgress",function(o){h(e);let r=c(3);return g(r.setRenamingInProgress(o))})("updateObject",function(o){h(e);let r=c(3);return g(r.renameFile(o))}),l()}if(i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),m("inputObject",e)("fullWidth",!0)("textCenter",!0)}}function y1(i,n){if(i&1&&(s(0,"span",62),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),w(e.name)}}function b1(i,n){if(i&1){let e=y();s(0,"div",41),f("click",function(o){let r=h(e).$implicit,p=c(2);return g(p.onSelect(o,r))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),s(1,"div",42),C(2,l1,1,5,"img",43)(3,c1,1,3,"img",44),s(4,"span",45),ko(5)(6),D(7,g1,1,1,null,null,vs),C(9,C1,3,4,"span",46),l(),C(10,x1,2,4,"span",47),C(11,S1,3,3,"span",48),l(),s(12,"div",49),C(13,v1,1,5,"input",50)(14,y1,2,3,"span",51),l()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),L("disabled",e.isDisabled)("deleted",e.isBeingDeleted)("selected",e.isSelected),a(),Xt("rowIndex",t),a(),x(e.isImage?2:3),a(3);let r=jn(o.galleryMode.maxBadges||0);a();let p=jn(e.nbBadges-r);a(),M(e.galleryBadges),a(2),x(p>0?9:-1),a(),x(e.root?10:-1),a(),x(e.newly?11:-1),a(2),x(e.isRenamed?13:14)}}function w1(i,n){if(i&1){let e=y();s(0,"div",19)(1,"app-virtual-scroll",37),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),N(3,s1,1,0,"div",38),s(4,"div",39),D(5,b1,15,18,"div",40,Ud),l()()()}if(i&2){let e=c(),t=at(30);a(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",$t(2,6,e.files,e.inputFilter.search(),"name"))("galleryMode",!0)("resizeOffset",110),a(2),m("ngTemplateOutlet",t),a(2),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function T1(i,n){if(i&1&&_(0,"fa-icon",69),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function E1(i,n){if(i&1){let e=y();s(0,"th",68),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,T1,1,2,"fa-icon",69),l()}if(i&2){let e=c().$implicit,t=c(2);V(e.value.class),B("width",e.value.width,"%"),L("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),k(" ",e.value.label," "),a(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function A1(i,n){if(i&1&&C(0,E1,3,10,"th",67),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function k1(i,n){i&1&&_(0,"div")}function D1(i,n){if(i&1){let e=y();s(0,"input",77),f("renamingInProgress",function(o){h(e);let r=c(6);return g(r.setRenamingInProgress(o))})("updateObject",function(o){h(e);let r=c(6);return g(r.renameFile(o))}),l()}if(i&2){let e=c(4).$implicit;m("inputObject",e)}}function M1(i,n){if(i&1&&(s(0,"span",78),d(1),l()),i&2){let e=c(5).$implicit;a(),w(e.root.description)}}function F1(i,n){if(i&1&&(s(0,"div",76)(1,"span",62),d(2),l(),C(3,M1,2,1,"span",78),l()),i&2){let e=c(4).$implicit,t=c(2);a(2),w(e.name),a(),x(t.inSharesList&&(e.root!=null&&e.root.description)?3:-1)}}function P1(i,n){if(i&1){let e=y();s(0,"div",72)(1,"img",74),f("error",function(){h(e);let o=c(3).$implicit;return g(o.fallBackMimeUrl())}),l(),C(2,D1,1,1,"input",75)(3,F1,4,2,"div",76),l()}if(i&2){let e=c(3).$implicit;a(),m("src",e.mimeUrl,X),a(),x(e.isRenamed?2:3)}}function I1(i,n){if(i&1&&(s(0,"div",79),_(1,"app-user-avatar",80),l()),i&2){let e=c(4).$implicit;a(),m("user",e.root.owner)}}function R1(i,n){if(i&1&&C(0,I1,2,1,"div",79),i&2){let e=c(3).$implicit;x(e.root?0:-1)}}function N1(i,n){if(i&1){let e=y();s(0,"span",85),b(1,"fileLockFormatPipe"),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openLockDialog(o))}),_(2,"fa-icon",10),l()}if(i&2){let e=c(4).$implicit,t=c(2);m("tooltip",ma($(1,3,e.lock))),a(2),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faLockOpen)}}function V1(i,n){if(i&1){let e=y();s(0,"span",86),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),_(1,"fa-icon",10),l()}if(i&2){let e=c(6);a(),m("icon",e.icons.faCommentDots)}}function O1(i,n){if(i&1){let e=y();s(0,"span",87),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);a(),m("icon",t.icons.SHARES),a(),k(" ",e.shares.length," ")}}function L1(i,n){if(i&1){let e=y();s(0,"span",87),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);a(),m("icon",t.icons.LINKS),a(),k(" ",e.links.length," ")}}function B1(i,n){if(i&1){let e=y();s(0,"span",87),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);a(),m("icon",t.icons.SPACES),a(),k(" ",e.spaces.length," ")}}function U1(i,n){if(i&1){let e=y();s(0,"span",58),f("click",function(){h(e);let o=c(6);return g(o.layout.showRSideBarTab(o.TAB_MENU.SELECTION,!0))}),_(1,"fa-icon",10),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);a(),m("icon",t.icons.SYNC),a(),k(" ",e.syncs.length," ")}}function $1(i,n){if(i&1&&(C(0,N1,3,5,"span",81),C(1,V1,2,1,"span",82),C(2,O1,3,2,"span",83),C(3,L1,3,2,"span",83),C(4,B1,3,2,"span",83),C(5,U1,3,2,"span",84)),i&2){let e=c(3).$implicit;x(e.lock?0:-1),a(),x(e.hasComments?1:-1),a(),x(e.shares.length?2:-1),a(),x(e.links.length?3:-1),a(),x(e.spaces.length?4:-1),a(),x(e.syncs.length?5:-1)}}function H1(i,n){if(i&1&&_(0,"app-badge-permissions",88),i&2){let e=c(4).$implicit;m("permissions",e.root.hPerms)}}function z1(i,n){if(i&1&&C(0,H1,1,1,"app-badge-permissions",88),i&2){let e=c(3).$implicit;x(e.root&&e.root.permissions?0:-1)}}function G1(i,n){if(i&1&&d(0),i&2){let e=c(3).$implicit;k(" ",e.hSize," ")}}function W1(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(2).$implicit,t=c().$implicit;V(e.value.newly&&t[e.value.newly]?"badge prop-newly-"+t[e.value.newly]:""),a(),k(" ",t.hTimeAgo," ")}}function j1(i,n){if(i&1&&(s(0,"td"),C(1,P1,4,2,"div",72)(2,R1,1,1)(3,$1,6,6)(4,z1,1,1)(5,G1,1,1)(6,W1,2,3,"span",73),l()),i&2){let e,t=c().$implicit;V(t.value.class),B("width",t.value.width,"%"),L("text-align-center",t.value.textCenter),a(),x((e=t.key)==="name"?1:e==="anchored"?2:e==="info"?3:e==="permissions"?4:e==="size"?5:e==="mtime"?6:-1)}}function K1(i,n){if(i&1&&C(0,j1,7,7,"td",71),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function q1(i,n){if(i&1){let e=y();s(0,"tr",70),f("click",function(o){let r=h(e).$implicit,p=c(2);return g(p.onSelect(o,r))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),D(1,K1,1,1,null,null,$d),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);L("disabled",e.isDisabled)("deleted",e.isBeingDeleted)("selected",e.isSelected),a(),M(E(3,6,t.tableHeaders,t.originalOrderKeyValue))}}function Q1(i,n){if(i&1){let e=y();s(0,"table",63)(1,"thead")(2,"tr"),D(3,A1,1,1,null,null,$d),b(5,"keyvalue"),l()()(),s(6,"app-virtual-scroll",64),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),N(8,k1,1,0,"div",38),s(9,"table",63)(10,"tbody",65),D(11,q1,4,9,"tr",66,Ud),l()()()}if(i&2){let e=c(),t=at(30);a(3),M(E(5,3,e.tableHeaders,e.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",$t(7,6,e.files,e.inputFilter.search(),"name")),a(2),m("ngTemplateOutlet",t),a(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Y1(i,n){if(i&1&&(s(0,"span",21),d(1),b(2,"translate"),l()),i&2){let e=c();a(),ke("",e.stats.dirs," ",E(2,2,e.stats.dirs>1?"directories":"directory",e.locale.language))}}function X1(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();a(),ke("",e.stats.files," ",E(2,2,e.stats.files>1?"files":"file",e.locale.language))}}function Z1(i,n){i&1&&(s(0,"div",89)(1,"span",22),d(2,"Forbidden resource"),l()())}function J1(i,n){i&1&&(s(0,"div",89)(1,"span",22),d(2,"Location not found"),l()())}function eg(i,n){if(i&1&&(s(0,"div",89)(1,"span",22),d(2),l()()),i&2){let e=c(2);a(2),w(e.serverConnectionErrorMessage)}}function tg(i,n){i&1&&(s(0,"div",90)(1,"span",22),d(2,"Drag and drop your files here"),l()())}function ig(i,n){if(i&1&&C(0,Z1,3,0,"div",89)(1,J1,3,0,"div",89)(2,eg,3,1,"div",89)(3,tg,3,0,"div",90),i&2){let e=c();x(e.forbiddenResource?0:e.locationNotFound?1:e.serverConnectionError?2:!e.isTrashRepo&&!e.loading&&!e.stats.elements?3:-1)}}function ng(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Open"),l()),i&2){let e=c(3);a(),m("icon",e.selection[0].isDir?e.icons.faFolderOpen:e.icons.faEye)}}function og(i,n){if(i&1){let e=y();N(0,ng,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutOpen())})}}function rg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Rename"),l()),i&2){let e=c(3);a(),m("icon",e.icons.faSpellCheck)}}function ag(i,n){if(i&1){let e=y();N(0,rg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutRename())})}}function sg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Comment"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faCommentDots)}}function lg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Synchronize"),l()),i&2){let e=c(3);a(),m("icon",e.icons.faRotate)}}function cg(i,n){if(i&1){let e=y();N(0,lg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.addToSync())})}}function pg(i,n){if(i&1){let e=y();C(0,og,1,0,null,23),C(1,ag,1,0,null,23),N(2,sg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.layout.showRSideBarTab(o.TAB_MENU.COMMENTS,!0))}),C(3,cg,1,0,null,23)}if(i&2){let e=c();x(e.selection[0]?0:-1),a(),x(e.inSharesList?-1:1),a(2),x(e.isElectronApp&&e.selection[0].isDir?3:-1)}}function dg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Download"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faDownload)}}function mg(i,n){if(i&1){let e=y();N(0,dg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.downloadFiles())})}}function ug(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Compress"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faFileArchive)}}function _g(i,n){if(i&1){let e=y();N(0,ug,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openCompressionDialog())})}}function fg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Decompress"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faFileArchive)}}function hg(i,n){if(i&1){let e=y();N(0,fg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.decompressFile())})}}function gg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Copy \xB7 Move"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faArrowsAlt)}}function Cg(i,n){if(i&1){let e=y();N(0,gg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.copyMoveFiles())})}}function xg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Share"),l()),i&2){let e=c(2);a(),m("icon",e.icons.SHARES)}}function Sg(i,n){if(i&1&&N(0,xg,3,1,"ng-template",24),i&2){c();let e=at(42);m("subMenu",e)}}function vg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Clipboard"),l()),i&2){let e=c();a(),m("icon",e.icons.faClipboardList)}}function yg(i,n){}function bg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2),l()),i&2){let e=c(2);a(),m("icon",e.isTrashRepo?e.icons.faBan:e.icons.TRASH),a(),k(" ",e.isTrashRepo?"Remove":"Trash")}}function wg(i,n){if(i&1){let e=y();N(0,yg,0,0,"ng-template",91)(1,bg,3,2,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openTrashDialog(o.isTrashRepo))})}i&2&&m("divider",!0)}function Tg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"New share"),l()),i&2){let e=c();a(),m("icon",e.icons.SHARES)}}function Eg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"New share link"),l()),i&2){let e=c();a(),m("icon",e.icons.faLink)}}function Ag(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Anchor to a space"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faAnchor)}}function kg(i,n){if(i&1){let e=y();N(0,Ag,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openSpaceAnchorFileDialog())})}}function Dg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Empty"),l()),i&2){let e=c();a(),m("icon",e.icons.TRASH)}}function Mg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Refresh"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faArrowRotateRight)}}function Fg(i,n){if(i&1){let e=y();N(0,Mg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.loadFiles())})}}function Pg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"New folder"),l()),i&2){let e=c(2);a(),m("icon",e.icons.PERSONAL)}}function Ig(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"New document"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faFileAlt)}}function Rg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Download from URL"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faGlobe)}}function Ng(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Upload files"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faUpload)}}function Vg(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",10),d(2,"Upload folders"),l()),i&2){let e=c(3);a(),m("icon",e.icons.faUpload)}}function Og(i,n){if(i&1){let e=y();N(0,Vg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c(2);return g(o.shortcutUploadFolders())})}}function Lg(i,n){if(i&1){let e=y();N(0,Pg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("directory"))}),N(1,Ig,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("file"))}),N(2,Rg,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.openNewDialog("download"))}),N(3,Ng,3,1,"ng-template",25),f("execute",function(){h(e);let o=c();return g(o.shortcutUploadFiles())}),C(4,Og,1,0,null,23)}if(i&2){let e=c();a(4),x(e.supportUploadFolder?4:-1)}}var ea=(()=>{let n=class n{constructor(){this.locale=S(z),this.layout=S(I),this.icons={SPACES:ie.SPACES,SHARES:ie.SHARES,TRASH:ie.TRASH,PERSONAL:ie.PERSONAL,LINKS:ie.LINKS,SYNC:rr.SYNC,faArrowRotateRight:mt,faPlus:et,faCirclePlus:El,faFileAlt:qo,faGlobe:Cn,faUpload:Yo,faDownload:gn,faLink:Go,faAnchor:ii,faEllipsis:Ro,faPen:dt,faEye:ul,faFolderOpen:Cl,faRotate:bi,faCommentDots:Qo,faFileArchive:Vo,faSpellCheck:Il,faArrowsAlt:ei,faCircleInfo:Rt,faBan:dl,faArrowUp:pt,faArrowDown:ut,faLock:ti,faLockOpen:Nl,faClipboardList:zo},this.loading=!1,this.locationNotFound=!1,this.forbiddenResource=!1,this.serverConnectionError=!1,this.serverConnectionErrorMessage=tr,this.hasRoots=!1,this.canShare={inside:!1,outside:!1},this.multipleSelection=!1,this.hasSelection=!1,this.hasDisabledItemsInSelection=!1,this.canCompress=!0,this.renamingInProgress=!1,this.supportUploadFolder=!1,this.originalOrderKeyValue=Fe,this.TAB_MENU=fe,this.tableHeaders={name:{label:"Name",width:40,textCenter:!1,class:"",show:!0,sortable:!0},anchored:{label:"Anchored by",width:5,class:"d-none d-md-table-cell",textCenter:!0,show:this.hasRoots,sortable:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-md-table-cell",show:!0},permissions:{label:"Permissions",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:this.hasRoots},size:{label:"Size",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},mtime:{label:"Modified",width:10,textCenter:!0,class:"d-none d-sm-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",isDir:"Type",size:"Size",mtime:"Modified"},this.files=[],this.selection=[],this.stats={dirs:0,files:0,size:0,elements:0},this.router=S(Ce),this.activatedRoute=S(Mt),this.zone=S($i),this.renderer=S(Dt),this.store=S(te),this.isElectronApp=this.store.isElectronApp(),this.spacesBrowser=S(Rc),this.filesService=S(Le),this.filesUpload=S(Uc),this.uploadButtonsShowed=!1,this.subscriptions=[],this.sortSettings={default:[{prop:"name",type:"string"},{prop:"isDir",type:"number"}],name:[{prop:"name",type:"string"}],isDir:[{prop:"isDir",type:"number"}],anchored:[{prop:"root.id",type:"number"},{prop:"root.owner.fullName",type:"string"}],size:[{prop:"size",type:"number"}],mtime:[{prop:"mtime",type:"number"}]},this.sortTable=new Bt(this.constructor.name,this.sortSettings),this.moveFromDrag=!1}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView(),this.supportUploadFolder=this.filesUpload.supportUploadDirectory,this.activatedRoute.queryParams.subscribe(t=>this.focusOn(t.select)),this.activatedRoute.data.subscribe(t=>this.setSpace(t)),this.subscriptions.push(this.store.filesOnEvent.subscribe(t=>this.onFileEvent(t)))}ngAfterViewInit(){setTimeout(()=>this.initEventHandlers(),500)}ngOnDestroy(){this.destroyEventHandlers(),this.resetFilesSelection(),this.subscriptions.forEach(t=>t.unsubscribe())}onKeyPress(t){if((t.target.id==="table-files"||t.target.id==="thumb-files")&&(t.ctrlKey||t.metaKey))switch(t.which||t.keyCode){case 65:t.preventDefault(),t.stopPropagation(),this.updateSelection(this.files);return;case 67:case 88:t.preventDefault(),t.stopPropagation(),this.selection.length&&(this.filesService.clipboardAction=t.keyCode==67?"copyPaste":"cutPaste",this.filesService.addToClipboard(this.selection));return;case 86:t.preventDefault(),t.stopPropagation(),this.filesService.onPasteClipboard();return;default:return}}loadFiles(){this.loading=!0,this.forbiddenResource=!1,this.locationNotFound=!1,this.serverConnectionError=!1,this.inputFilter.clear(),this.resetFilesSelection(),this.spacesBrowser.loadFiles().subscribe({next:t=>{this.spacePermissions=t.permissions,this.canShare.outside=this.spacePermissions.indexOf(We.SHARE_OUTSIDE)>-1,this.canShare.inside=this.spacePermissions.indexOf(We.SHARE_INSIDE)>-1,this.hasRoots=t.hasRoots,this.tableHeaders.anchored.show=t.hasRoots,this.tableHeaders.anchored.label=this.isSharesRepo?"Owner":"Anchored by",this.tableHeaders.anchored.width=10,this.tableHeaders.permissions.show=t.hasRoots,this.sortBy(this.sortTable.sortParam.column,!1,t.files.map(o=>new Yc(o,this.baseRepoUrl,this.isSharesRepo,this.store.server().fileEditors))),this.updateFilesStats(this.files),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.files=[],this.updateFilesStats(this.files),t.status!==401&&(this.forbiddenResource=t.status===403,this.locationNotFound=t.status===404,this.serverConnectionError=t.status===0,this.layout.sendNotification("error","Files",t.error.message||this.serverConnectionErrorMessage)),this.loading=!1}})}sortBy(t,o=!0,r){this.files=this.sortTable.sortBy(t,o,r||this.files)}switchView(t){let o=this.galleryMode;this.galleryMode=t,this.galleryMode.enabled!==o.enabled&&(this.destroyEventHandlers(),setTimeout(()=>this.initEventHandlers(),500))}onSelect(t,o){this.loading||(t.shiftKey&&this.selection.length>0&&this.selection.indexOf(o)===-1?this.selectRangeFiles(o):!t.ctrlKey&&!t.metaKey?this.updateSelection([o]):this.modifySelection(o))}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.isTrashRepo||this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.selection.length<=1&&this.updateSelection([o]),this.layout.openContextMenu(t,this.fileContextMenu)}browse(t){if(t.isDisabled){this.layout.sendNotification("warning",t.name,"Share is disabled");return}t.isRenamed||(t.isDir?this.router.navigate([t.root?.alias||t.name],{relativeTo:this.activatedRoute}).catch(console.error):this.shortcutOpen())}copyMoveFiles(){this.layout.showRSideBarTab(fe.TREE,!0),setTimeout(()=>this.filesService.treeCopyMoveOn.next(),100)}downloadFiles(){this.multipleSelection?this.openCompressionDialog(!1):this.filesService.download(this.selection[0])}shortcutOpen(){this.selection[0].isDir?this.browse(this.selection[0]):this.selection[0].isViewable||this.selection[0].isEditable?this.openViewerDialog():this.downloadFiles()}shortcutUploadFiles(){this.uploadButtonsShowed||document.getElementById("newButton").click(),setTimeout(()=>document.getElementById("uploadFilesButton").click(),100)}shortcutUploadFolders(){if(!this.uploadButtonsShowed){let t=document.getElementById("newButton");t.click(),t.click()}setTimeout(()=>document.getElementById("uploadFoldersButton").click(),100)}shortcutRename(){this.selection[0].isRenamed=!this.selection[0].isRenamed}renameFile(t){return yt(this,null,function*(){let o=t.object,r=t.name,p=!1,u=this.files.find(v=>v.name.toLowerCase()===r.toLowerCase()&&v.id!==o.id);u&&(p=yield this.filesService.openOverwriteDialog([o],r),!p)||this.filesService.rename(o,r,p).pipe(ce(1)).subscribe({next:v=>{o.rename(v.name),o.isEditable=!1,p&&(o.updateMime(u.mime),this.sortBy(this.sortTable.sortParam.column,!1,this.files.filter(T=>T.id!==u.id)))},error:v=>this.layout.sendNotification("error","Rename",o.name,v)})})}setRenamingInProgress(t){this.renamingInProgress=t}addToSync(){this.router.navigate([ye.BASE,ye.WIZARD,ye.WIZARD_CLIENT],{state:{file:this.selection[0]}}).catch(console.error)}addToClipboard(){this.filesService.addToClipboard(this.selection)}openShareDialog(){let t=this.setFilePermissionsAndSpace();if(t===null)return;this.layout.openDialog(Ji,"lg",{initialState:{file:t,isSharesRepo:this.isSharesRepo,inSharesList:this.inSharesList,allowFilesOptions:!1}}).content.shareChange.pipe(ce(1)).subscribe(r=>{let p=r[1];this.selection[0].id<0&&(this.selection[0].id=p.file.id),this.selection[0].shares.push({id:p.id,alias:p.alias,name:p.name,type:no.COMMON}),this.selection[0].updateNbBadges()})}openShareLinkDialog(){let t=this.setFilePermissionsAndSpace();if(t===null)return;this.layout.openDialog(Dn,"lg",{initialState:{file:t,isSharesRepo:this.isSharesRepo,inSharesList:this.inSharesList}}).content.shareChange.pipe(ce(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.selection[0].id<0&&(this.selection[0].id=u.file.id),this.selection[0].links.push({id:u.id,alias:u.alias,name:u.name,type:no.LINK}),this.selection[0].updateNbBadges())})}openSpaceAnchorFileDialog(){this.layout.openDialog(Bd,"lg",{initialState:{files:this.selection}}).content.addAnchoredFiles.pipe(ce(1)).subscribe(o=>{for(let r of this.selection){let p=o.rootFiles.find(u=>u.name===r.name);p&&r.spaces.map(u=>u.id).indexOf(o.space.id)===-1&&(r.id<0&&(r.id=p.id),r.spaces.push(o.space),r.updateNbBadges())}})}initUpload(){!this.isTrashRepo&&!this.uploadButtonsShowed&&(this.uploadButtonsShowed=!0)}onUploadFiles(t,o=!1){return yt(this,null,function*(){let r=!1,p=[...t.files];if(o){let u=p[0].webkitRelativePath.split("/")[0].normalize(),v=this.files.find(T=>T.name.normalize().toLowerCase()===u.normalize().toLowerCase());if(v&&(r=yield this.filesService.openOverwriteDialog([v]),!r))return}else{let u=this.files.filter(v=>p.some(T=>T.name.normalize().toLowerCase()===v.name.normalize().toLowerCase()));if(u.length>0&&(r=yield this.filesService.openOverwriteDialog(u),!r))return}this.filesUpload.addFiles(p,r).catch(console.error)})}onDropFiles(t){let o=this.files.filter(r=>[...t.dataTransfer.files].some(p=>p.name.normalize().toLowerCase()===r.name.normalize().toLowerCase()));this.filesUpload.onDropFiles(t,o)}decompressFile(){this.filesService.decompress(this.selection[0])}openCompressionDialog(t=!0){let o={name:this.selection[0].name,compressInDirectory:this.inSharesList?!1:t,files:this.selection.map(r=>({name:r.name,rootAlias:r.root?.alias})),extension:"tar"};this.layout.openDialog(Jr,null,{initialState:{archiveProps:o,disableInDirCompression:this.inSharesList}})}openNewDialog(t){this.layout.openDialog(Nd,null,{initialState:{files:this.files,inputType:t}})}openEmptyTrashDialog(){this.isTrashRepo&&this.inRootSpace&&this.layout.openDialog(Ld,null,{initialState:{files:this.files}})}openTrashDialog(t=!1){if(!this.selection.length)return;this.layout.openDialog(Od,null,{initialState:{files:this.selection,permanently:t}}).content.removeFiles.pipe(ce(1)).subscribe(()=>this.removeFiles())}openLockDialog(t){this.filesService.openLockDialog(t)}setSpace(t){this.currentRoute=this.filesService.currentRoute=`${t.repository}${nr(t.routes)}`,this.baseRepoUrl=`${t.repository}${t.routes.length?`/${t.routes[0].path}`:""}`,this.isFilesRepo=t.repository===G.FILES,this.isSharesRepo=t.repository===G.SHARES,this.isTrashRepo=t.repository===G.TRASH,this.inRootSpace=this.isSharesRepo?t.routes.length===0:t.routes.length===1,this.inSharesList=this.isSharesRepo&&this.inRootSpace,this.spacesBrowser.setEnvironment(t.repository,t.routes),this.isPersonalSpace=this.spacesBrowser.inPersonalSpace,this.loadFiles()}onFileEvent(t){if(t.archiveId){this.filesService.downloadTaskArchive(t.archiveId);return}let o=t?.fileDstPath===this.currentRoute;if(t.filePath===this.currentRoute||o){let r=o&&t.reloadFocusOnDst;if(t.fileName&&((t.focus||r)&&(this.focusOnSelect=t.fileName),t.delete&&!r))if(t.status===Lc.SUCCESS)this.files=this.files.filter(p=>p.name!==t.fileName),this.updateFilesStats(this.files),this.resetFilesSelection();else{let p=this.files.find(u=>u.name===t.fileName);p&&(p.isBeingDeleted=!1)}(t.reload||r)&&this.loadFiles()}}removeFiles(){let t=this.selection.filter(o=>!o.root?.alias);this.selection.length!==t.length&&this.layout.sendNotification("warning","Remove","You can not remove an anchored file"),t.length&&this.filesService.delete(t)}setFilePermissionsAndSpace(){if(this.selection[0]?.root&&this.selection[0].root.permissions.indexOf(We.SHARE_OUTSIDE)===-1)return this.layout.sendNotification("warning",this.selection[0].name,"You do not have share permission"),null;let t=re({},this.selection[0]);if(this.isPersonalSpace)t.permissions=this.spacePermissions;else if(this.selection[0]?.root)if(t.permissions=this.selection[0].root.permissions,this.inSharesList)t.space={alias:this.selection[0].root.alias,name:this.selection[0].root.alias,root:void 0};else{let o=this.currentRoute.split("/")[1];t.space={alias:o,name:o,root:{alias:this.selection[0].root.alias,name:this.selection[0].name}}}else{t.permissions=this.spacePermissions;let[o,r]=this.currentRoute.split("/").slice(1,3);t.space={alias:o,name:o,root:{alias:r,name:r}}}return t}openViewerDialog(){let t=this.selection[0],o;this.inSharesList?o=t.root.permissions:o=t?.root?cc(this.spacePermissions,t?.root.permissions):this.spacePermissions,this.filesService.openViewerDialog(t,this.files,o).catch(console.error)}focusOn(t){if(!t){this.focusOnSelect=null;return}if(!this.files.length){this.focusOnSelect=t;return}let o=this.files.find(r=>r.name.toLowerCase()===t.toLowerCase());!o&&this.hasRoots&&(o=this.files.find(r=>r.root?.alias.toLowerCase()===t.toLowerCase())),o?(setTimeout(()=>this.scrollView.scrollInto(o),100),this.updateSelection([o])):this.focusOnSelect=t}updateFilesStats(t){this.stats={dirs:0,files:0,size:0,elements:0};for(let o of t)this.updateCounters(o)}updateCounters(t,o=!0){let r=o?_c:fc;this.stats.elements=r(this.stats.elements,1),this.stats.size=r(this.stats.size,t.size),t.isDir?this.stats.dirs=r(this.stats.dirs,1):this.stats.files=r(this.stats.files,1)}resetFilesSelection(){this.updateSelection([])}modifySelection(t){t&&(t.isSelected?this.updateSelection(this.selection.filter(o=>o.id!==t.id)):this.updateSelection([t,...this.selection]))}updateSelection(t){t.length?this.selection=this.files.filter(o=>t.indexOf(o)>-1?(o.isSelected=!0,!0):(o.isSelected=!1,!1)):this.selection=this.selection.filter(o=>(o.isSelected=!1,!1)),this.hasSelection=!!this.selection.length,this.hasDisabledItemsInSelection=!!this.selection.find(o=>o.isDisabled),this.canCompress=!this.hasDisabledItemsInSelection&&(this.selection.length>1||this.selection.length===1&&this.selection[0].isCompressible),this.multipleSelection=this.selection.length>1||this.selection.length===1&&this.selection[0].isDir,this.store.filesSelection.set(this.selection)}selectRangeFiles(t){let o=this.files.indexOf(t),r=this.selection.map(T=>this.files.indexOf(T)),p=[],u=Math.min(...r),v=Math.max(...r);if(o<u)for(let T=o;T<u;T++)p.push(this.files[T]);else if(o>v)for(let T=o;T>v;T--)p.push(this.files[T]);this.updateSelection([...this.selection,...p])}initEventHandlers(){this.zone.runOutsideAngular(()=>{this.eventDragOverHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragover",t=>{if(this.inSharesList||this.isTrashRepo&&!this.moveFromDrag)return t.preventDefault(),!1;["TD","TR","DIV","APP-VIRTUAL-SCROLL","IMG"].indexOf(t.target.nodeName)>-1&&(t.preventDefault(),this.moveFromDrag?t.dataTransfer.dropEffect="move":t.dataTransfer.dropEffect="copy")}),this.eventDragStartHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragstart",t=>{if(this.inSharesList&&t.preventDefault(),t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV"){let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&(this.selection.indexOf(o)===-1&&this.zone.run(()=>this.updateSelection([o])),this.moveFromDrag=!0)}}),this.eventDragEnterHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragenter",t=>{if(t.preventDefault(),this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV")){let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&o.isDir&&this.selection.indexOf(o)===-1&&(t.target.parentElement.nodeName==="TD"?this.renderer.addClass(t.target.parentElement,Mn):t.target.parentElement.classList.contains("card-body")&&this.renderer.addClass(t.target.parentElement.parentElement,Mn))}}),this.eventDragLeaveHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragleave",t=>{t.preventDefault(),this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"?this.renderer.removeClass(t.target.parentElement,Mn):t.target.parentElement.classList.contains("card-body")&&this.renderer.removeClass(t.target.parentElement.parentElement,Mn))}),this.eventDragEndHandler=this.renderer.listen(this.scrollView.element.nativeElement,"dragend",t=>{t.preventDefault(),this.moveFromDrag=!1}),this.eventDropHandler=this.renderer.listen(this.scrollView.element.nativeElement,"drop",t=>{if(this.inSharesList||this.isTrashRepo&&!this.moveFromDrag)return t.preventDefault(),!1;if(this.moveFromDrag&&(t.target.parentElement.nodeName==="TD"||t.target.parentElement.nodeName==="DIV")){t.preventDefault();let o=this.scrollView.viewPortItems[this.galleryMode.enabled?t.target.parentElement.getAttribute("rowIndex"):t.target.parentElement.parentElement.rowIndex];o&&o.isDir&&this.selection.indexOf(o)===-1&&(this.renderer.removeClass(t.target.parentElement,Mn),this.selection.length&&this.zone.run(()=>this.filesService.copyMove(this.selection,o.path,Ne.MOVE)))}else return t.dataTransfer.files.length?(t.preventDefault(),this.zone.run(()=>this.onDropFiles(t)),!1):(t.preventDefault(),!1)}),this.eventKeysHandler=this.renderer.listen(this.scrollView.element.nativeElement,"keydown",t=>{if(this.renamingInProgress)return;let o=t.keyCode||t.which;if([37,38,39,40].indexOf(o)===-1)return;if((o===37||o===39)&&!this.galleryMode.enabled)return;t.preventDefault(),t.stopPropagation();let r,p=this.selection.map(R=>this.files.indexOf(R)),u=this.galleryMode.enabled;o===37?(u=!1,o=38):o===39&&(u=!1,o=40),o===38?(u?r=Math.min(...p)-Math.ceil(this.scrollView.element.nativeElement.offsetWidth/(this.galleryMode.dimensions+this.galleryMode.margins)):r=Math.min(...p)-1,r<=-1&&(r=this.files.length-1)):(u?r=Math.max(...p)+Math.ceil(this.scrollView.element.nativeElement.offsetWidth/(this.galleryMode.dimensions+this.galleryMode.margins)):r=Math.max(...p)+1,r>=this.files.length&&(r=0));let v=this.files[r];this.zone.run(()=>{!t.shiftKey&&!t.ctrlKey&&!t.metaKey?this.updateSelection([v]):this.modifySelection(v)});let T=this.scrollView.element.nativeElement.querySelectorAll(Xc);if(T.length){let R;o===38?(R=T[0],ga(R)||R.scrollIntoView(!0)):(R=T[T.length-1],ga(R)||R.scrollIntoView(!1))}else setTimeout(()=>this.scrollView.scrollInto(v),0)})})}destroyEventHandlers(){for(let t of[this.eventDragStartHandler,this.eventDragOverHandler,this.eventDragEnterHandler,this.eventDragLeaveHandler,this.eventDragEndHandler,this.eventDropHandler,this.eventKeysHandler].filter(o=>o))try{t()}catch(o){console.warn(o)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-browser"]],viewQuery:function(o,r){if(o&1&&(Z(Ke,5),Z(Re,7),Z(st,7),Z(Oh,7),Z(Lh,7),Z(Bh,7)),o&2){let p;j(p=K())&&(r.scrollView=p.first),j(p=K())&&(r.inputFilter=p.first),j(p=K())&&(r.btnNavigationView=p.first),j(p=K())&&(r.mainContextMenu=p.first),j(p=K())&&(r.mainReadOnlyContextMenu=p.first),j(p=K())&&(r.fileContextMenu=p.first)}},hostBindings:function(o,r){o&1&&f("keydown",function(u){return r.onKeyPress(u)},Eo)},decls:53,vars:34,consts:[["CommonMessages",""],["FileContextMenu",""],["ShareContextMenu",""],["MainReadOnlyContextMenu",""],["MainContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-default","me-1",3,"click","tooltip"],[3,"icon","animation"],["dropdown","",1,"btn-group","me-1"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","disabled","tooltip"],[3,"icon"],["dropdown","",1,"d-none","d-sm-block","btn-group","me-1",3,"isDisabled"],["dropdown","",1,"btn-group","me-1",3,"isDisabled"],["dropdownToggle","","type","button",1,"btn","btn-default","dropdown-toggle"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],[1,"ms-auto"],[1,"btn-group","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"me-2"],["l10nTranslate",""],["contextMenuItem",""],["contextMenuItem","",3,"subMenu"],["contextMenuItem","",3,"execute"],["dropdown","",1,"btn-group","me-1",3,"onShown"],["dropdownToggle","","container","body","type","button",1,"btn","btn-default","dropdown-toggle",3,"tooltip"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["appUploadFiles","","id","uploadFilesButton",1,"dropdown-item",3,"uploadFiles","options"],["appUploadFiles","","id","uploadFoldersButton",1,"dropdown-item",3,"options"],["appUploadFiles","","id","uploadFoldersButton",1,"dropdown-item",3,"uploadFiles","options"],["container","body","type","button",1,"btn","btn-default","me-1",3,"disabled","tooltip"],[1,"dropdown-divider"],[1,"dropdown-item"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],[4,"ngTemplateOutlet"],["id","thumb-files","tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","deleted","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],["alt","","draggable","true",1,"img-fluid",3,"src","max-height"],["alt","","draggable","true",3,"src","height","width"],[1,"label-bottom-right"],[1,"badge","bg-primary","cursor-pointer",3,"font-size"],[1,"label-bottom-left"],[1,"label-top-right"],[1,"card-footer","text-center","text-truncate","p-1"],["appInputEdit","","type","text","required","",3,"inputObject","fullWidth","textCenter","font-size"],["draggable","false",1,"no-pointer-events","text-file-name-preserve",3,"font-size"],["alt","","draggable","true",1,"img-fluid",3,"error","src"],["alt","","draggable","true",3,"error","src","height","width"],["placement","auto",1,"badge","bg-maroon","cursor-pointer",3,"tooltip","font-size"],[1,"badge","bg-success","cursor-pointer",3,"font-size"],["placement","auto",1,"badge","bg-maroon","cursor-pointer",3,"click","tooltip"],[1,"badge","bg-success","cursor-pointer",3,"click"],[1,"badge","bg-primary","cursor-pointer",3,"click"],[3,"user","height","width","fontSize"],[1,"badge","bg-purple"],["appInputEdit","","type","text","required","",3,"renamingInProgress","updateObject","inputObject","fullWidth","textCenter"],["draggable","false",1,"no-pointer-events","text-file-name-preserve"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["id","table-files","tabindex","-1"],[3,"disabled","deleted","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],["draggable","true",1,"d-flex","align-items-center"],[3,"class"],["alt","","draggable","false","height","30","width","30",3,"error","src"],["appInputEdit","","required","","type","text",3,"inputObject"],[1,"d-flex","flex-column","text-truncate"],["appInputEdit","","required","","type","text",3,"renamingInProgress","updateObject","inputObject"],["draggable","false",1,"no-pointer-events","text-muted","fs-xs"],[1,"d-flex","flex-column","align-items-center"],[3,"user"],["placement","auto",1,"badge","bg-maroon","cursor-pointer","me-1",3,"tooltip"],[1,"badge","bg-success","cursor-pointer","me-1"],[1,"badge","bg-primary","cursor-pointer","me-1"],[1,"badge","bg-primary","cursor-pointer"],["placement","auto",1,"badge","bg-maroon","cursor-pointer","me-1",3,"click","tooltip"],[1,"badge","bg-success","cursor-pointer","me-1",3,"click"],[1,"badge","bg-primary","cursor-pointer","me-1",3,"click"],["tooltipPlacement","auto",3,"permissions"],[1,"fs-sm","text-center","text-danger","text-bold","no-select","p-4"],[1,"fs-base","text-center","text-gray","fw-bold","no-select","p-4"],["contextMenuItem","",3,"divider"]],template:function(o,r){if(o&1){let p=y();s(0,"div",5)(1,"button",6),b(2,"translate"),f("click",function(){return h(p),g(r.loadFiles())}),_(3,"fa-icon",7),l(),C(4,Gh,5,5,"div",8),s(5,"button",9),b(6,"translate"),f("click",function(){return h(p),g(r.downloadFiles())}),_(7,"fa-icon",10),l(),C(8,Kh,5,6,"div",11),C(9,Qh,4,7),s(10,"div",12)(11,"button",13),_(12,"fa-icon",10),l(),N(13,a1,15,6,"ul",14),l(),s(14,"div",15)(15,"div",16),_(16,"app-input-filter",17),l(),s(17,"app-navigation-view",18),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.switchView(v))}),l()()(),C(18,w1,7,10,"div",19)(19,Q1,13,10),s(20,"div",20)(21,"div"),C(22,Y1,3,5,"span",21),C(23,X1,3,5,"span"),l(),s(24,"div",15)(25,"span",22),d(26,"Total"),l(),d(27),b(28,"toBytes"),l()(),N(29,ig,4,1,"ng-template",null,0,Zt),s(31,"context-menu",null,1),C(33,pg,4,3),C(34,mg,1,0,null,23),C(35,_g,1,0,null,23),C(36,hg,1,0,null,23),C(37,Cg,1,0,null,23),C(38,Sg,1,1,null,24),N(39,vg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.addToClipboard())}),C(40,wg,2,1),l(),s(41,"context-menu",null,2),N(43,Tg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openShareDialog())}),N(44,Eg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openShareLinkDialog())}),C(45,kg,1,0,null,23),l(),s(46,"context-menu",null,3),N(48,Dg,3,1,"ng-template",25),f("execute",function(){return h(p),g(r.openEmptyTrashDialog())}),l(),s(49,"context-menu",null,4),C(51,Fg,1,0,null,23)(52,Lg,5,1),l()}o&2&&(a(),m("tooltip",E(2,26,"Refresh",r.locale.language)),a(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),a(),x(!r.isTrashRepo&&!r.inSharesList?4:-1),a(),m("disabled",!r.hasSelection||r.hasDisabledItemsInSelection)("tooltip",E(6,29,"Download",r.locale.language)),a(2),m("icon",r.icons.faDownload),a(),x(!r.isTrashRepo&&r.canShare.outside||r.inSharesList?8:-1),a(),x(r.isTrashRepo?9:-1),a(),m("isDisabled",!r.hasSelection),a(2),m("icon",r.icons.faEllipsis),a(5),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),a(),x(r.galleryMode!=null&&r.galleryMode.enabled?18:19),a(4),x(r.stats.dirs?22:-1),a(),x(r.stats.files?23:-1),a(4),k("\xA0",$(28,32,r.stats.size)),a(6),x(r.selection.length===1?33:-1),a(),x(r.hasDisabledItemsInSelection?-1:34),a(),x(r.canCompress?35:-1),a(),x(!r.inSharesList&&r.selection.length===1&&!r.selection[0].isCompressible?36:-1),a(),x(r.hasDisabledItemsInSelection?-1:37),a(),x(!r.isTrashRepo&&r.canShare.outside||r.inSharesList&&(r.selection[0]!=null&&r.selection[0].canBeReShared)?38:-1),a(2),x(r.inSharesList?-1:40),a(5),x(r.isFilesRepo?45:-1),a(6),x(r.inSharesList?51:52))},dependencies:[P,F,Ge,Me,Pi,Mi,Fi,Di,Re,Ot,Vt,Nt,Ke,Zr,st,zt,qe,Id,St,tt,J,cr,De,ht,fr],encapsulation:2});let i=n;return i})();var Un=(i,n)=>n.id;function Bg(i,n){if(i&1){let e=y();s(0,"div",2)(1,"div",3)(2,"button",4),f("click",function(){h(e);let o=c(2);return g(o.addToClipboard())}),_(3,"fa-icon",5),d(4," Send to Clipboard "),l()()(),_(5,"hr",6)}if(i&2){let e=c(2);a(3),m("icon",e.icons.faClipboardCheck)}}function Ug(i,n){if(i&1){let e=y();s(0,"div",7)(1,"img",8),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),s(2,"span",9),d(3),l()()}if(i&2){let e=n.$implicit;a(),m("src",e.mimeUrl,X),a(2),w(e.name)}}function $g(i,n){if(i&1&&(s(0,"div",1),D(1,Ug,4,2,"div",7,Un),l()),i&2){let e=c(2);a(),M(e.files())}}function Hg(i,n){if(i&1&&(s(0,"div",26),_(1,"img",27),l()),i&2){let e=c().$implicit,t=c(3);B("height",t.cardImageSize,"px"),a(),B("max-height",t.cardImageSize,"px"),m("src",q("",e.thumbnailUrl,"?size=256"),X)}}function zg(i,n){if(i&1&&_(0,"app-files-viewer-media",13),i&2){let e=c().$implicit,t=c(3);m("currentHeight",t.cardImageSize)("fileUrl",e.dataUrl)}}function Gg(i,n){if(i&1){let e=y();s(0,"img",28),f("error",function(){h(e);let o=c().$implicit;return g(o.fallBackMimeUrl())}),l()}if(i&2){let e=c().$implicit,t=c(3);B("height",t.cardImageSize,"px"),m("src",e.mimeUrl,X)}}function Wg(i,n){if(i&1&&_(0,"fa-icon",20),i&2){let e=c(4);m("icon",e.icons.faSpinner)}}function jg(i,n){if(i&1&&d(0),i&2){c();let e=Kn(15);k(" ",e," ")}}function Kg(i,n){if(i&1&&(s(0,"span",29),_(1,"fa-icon",5),s(2,"span",30),d(3,"Exclusive"),l()()),i&2){let e=c(5);a(),m("icon",e.icons.faLock)}}function qg(i,n){if(i&1&&(s(0,"span",29),_(1,"fa-icon",5),s(2,"span",30),d(3,"Shared"),l()()),i&2){let e=c(5);a(),m("icon",e.icons.faUnlock)}}function Qg(i,n){if(i&1&&C(0,Kg,4,1,"span",29)(1,qg,4,1,"span",29),i&2){let e=c().$implicit;x(e.lock.isExclusive?0:1)}}function Yg(i,n){i&1&&(s(0,"span",22),d(1,"no"),l())}function Xg(i,n){if(i&1&&(s(0,"span",24),_(1,"fa-icon",5),d(2),l()),i&2){let e=c().$implicit,t=c(3);a(),m("icon",t.icons.SHARES),a(),k(" ",e.shares.length+e.links.length," ")}}function Zg(i,n){i&1&&(s(0,"span",22),d(1,"no"),l())}function Jg(i,n){if(i&1&&(s(0,"span",24),_(1,"fa-icon",5),d(2),l()),i&2){let e=c().$implicit,t=c(3);a(),m("icon",t.icons.SPACES),a(),k(" ",e.spaces.length)}}function eC(i,n){i&1&&(s(0,"span",22),d(1,"no"),l())}function tC(i,n){if(i&1&&(s(0,"div",21)(1,"div",18),d(2,"Owner"),l(),_(3,"app-user-avatar",33),l()),i&2){let e=c(2).$implicit;a(3),m("user",e.root.owner)("height",26)("width",26)}}function iC(i,n){if(i&1&&_(0,"app-badge-permissions",32),i&2){let e=c(2).$implicit;m("permissions",e.root.hPerms)}}function nC(i,n){i&1&&(s(0,"span",22),d(1,"no"),l())}function oC(i,n){if(i&1&&(_(0,"hr",15),s(1,"div",31),C(2,tC,4,3,"div",21),s(3,"div",26)(4,"div",18),d(5,"Permissions"),l(),C(6,iC,1,1,"app-badge-permissions",32)(7,nC,2,0,"span",22),l()()),i&2){let e=c().$implicit;a(2),x(e.root.owner?2:-1),a(4),x(e.root.permissions?6:7)}}function rC(i,n){if(i&1){let e=y();s(0,"div",38),f("click",function(){h(e);let o=c(2).$implicit,r=c(3);return g(r.openLockDialog(o))}),_(1,"fa-icon",5),d(2),b(3,"fileLockFormatPipe"),l()}if(i&2){let e=c(2).$implicit,t=c(3);a(),m("icon",e.lock.isExclusive?t.icons.faLock:t.icons.faUnlock),a(),k(" ",$(3,2,e.lock)," ")}}function aC(i,n){if(i&1){let e=y();s(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToSpace(o))}),_(1,"fa-icon",5),d(2),l()}if(i&2){let e=n.$implicit,t=c(5);a(),m("icon",t.icons.SPACES),a(),k(" ",e.name," ")}}function sC(i,n){if(i&1){let e=y();s(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToShare(o))}),_(1,"fa-icon",5),d(2),l()}if(i&2){let e=n.$implicit,t=c(5);a(),m("icon",t.icons.SHARES),a(),k(" ",e.name," ")}}function lC(i,n){if(i&1){let e=y();s(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToShare(o))}),_(1,"fa-icon",5),d(2),l()}if(i&2){let e=n.$implicit,t=c(5);a(),m("icon",t.icons.LINKS),a(),k(" ",e.name," ")}}function cC(i,n){if(i&1){let e=y();s(0,"div",39),f("click",function(){let o=h(e).$implicit,r=c(5);return g(r.goToSync(o))}),_(1,"fa-icon",5),d(2),l()}if(i&2){let e=n.$implicit,t=c(5);a(),m("icon",t.icons.SYNC),a(),k(" ",e.clientName," ")}}function pC(i,n){if(i&1&&(_(0,"hr",34),s(1,"div",35),C(2,rC,4,4,"div",36),D(3,aC,3,2,"div",37,Un),D(5,sC,3,2,"div",37,Un),D(7,lC,3,2,"div",37,Un),D(9,cC,3,2,"div",37,Un),l()),i&2){let e=c().$implicit;a(2),x(e.lock?2:-1),a(),M(e.spaces),a(2),M(e.shares),a(2),M(e.links),a(2),M(e.syncs)}}function dC(i,n){if(i&1){let e=y();s(0,"div",10)(1,"div",11),C(2,Hg,2,6,"div",12)(3,zg,1,2,"app-files-viewer-media",13)(4,Gg,1,3,"img",14),l()(),_(5,"hr",15),s(6,"div",16)(7,"div",17)(8,"div",18),d(9,"Name"),l(),s(10,"div",19),d(11),l()(),s(12,"div",17)(13,"div",18),d(14,"Size"),l(),ko(15),b(16,"async"),C(17,Wg,1,1,"fa-icon",20)(18,jg,1,1),l(),s(19,"div",17)(20,"div",18),d(21,"Created"),l(),s(22,"div"),d(23),b(24,"amDateFormat"),l()(),s(25,"div",17)(26,"div",18),d(27,"Modified"),l(),s(28,"div"),d(29),b(30,"amDateFormat"),l()(),s(31,"div",21)(32,"div",18),d(33,"Lock"),l(),C(34,Qg,2,1)(35,Yg,2,0,"span",22),l(),s(36,"div",21)(37,"div",18),d(38,"Shared"),l(),s(39,"div",23),C(40,Xg,3,2,"span",24)(41,Zg,2,0,"span",22),l()(),s(42,"div",21)(43,"div",18),d(44,"Anchored"),l(),C(45,Jg,3,2,"span",24)(46,eC,2,0,"span",22),l(),s(47,"div",21)(48,"div",18),d(49,"Synced"),l(),s(50,"span"),d(51),b(52,"translate"),l()(),s(53,"div",21)(54,"div",18),d(55,"Comments"),l(),s(56,"span",25),f("click",function(){h(e);let o=c(3);return g(o.goToComments())}),d(57),b(58,"translate"),l()()(),C(59,oC,8,2),C(60,pC,11,1)}if(i&2){let e,t=n.$implicit,o=c(3);a(2),x((e=t.shortMime)==="image"?2:e==="media"?3:4),a(9),w(t.name),a(4);let r=jn($(16,18,o.getSizeLazy(t)));a(2),x(r===null?17:18),a(6),w($(24,21,t.ctime)),a(6),w($(30,23,t.mtime)),a(5),x(t.lock?34:35),a(6),x(t.shares.length||t.links.length?40:41),a(5),x(t.spaces.length?45:46),a(5),V(q("badge ",t.syncs.length?"bg-primary":"bg-secondary-alt")),a(),k(" ",E(52,25,t.syncs.length?"yes":"no",o.locale.language)," "),a(5),V(q("badge ",t.hasComments?"bg-success":"bg-secondary-alt"," cursor-pointer")),a(),k(" ",E(58,28,t.hasComments?"yes":"no",o.locale.language)," "),a(2),x(t.root?59:-1),a(),x(t.lock||t.spaces.length||t.shares.length||t.links.length||t.syncs.length?60:-1)}}function mC(i,n){if(i&1&&D(0,dC,61,31,null,null,Un),i&2){let e=c(2);M(e.files())}}function uC(i,n){if(i&1&&(C(0,Bg,6,1),s(1,"div",0),C(2,$g,3,0,"div",1)(3,mC,2,0),l()),i&2){let e=c();x(e.multiple()?0:-1),a(),m("resizeOffset",e.resizeOffset()),a(),x(e.multiple()?2:3)}}var Hd=(()=>{let n=class n{constructor(){this.files=se.required(),this.locale=S(z),this.multiple=ve(()=>this.files().length>1),this.resizeOffset=ve(()=>80+(this.multiple()?40:0)),this.cardImageSize=80,this.icons={SPACES:ie.SPACES,SHARES:ie.SHARES,LINKS:ie.LINKS,SYNC:rr.SYNC,faLock:ti,faUnlock:ml,faClipboardCheck:Lo,faArrowsAlt:ei,faSpinner:Oe},this.router=S(Ce),this.layout=S(I),this.filesService=S(Le)}goToShare(t){this.layout.toggleRSideBar(!1),this.router.navigate([t.type===0?G.SHARED:G.LINKS],{queryParams:{select:t.name}}).catch(console.error)}goToSpace(t){this.layout.toggleRSideBar(!1),this.router.navigate([G.SPACES],{queryParams:{select:t.name}}).catch(console.error)}goToComments(){this.layout.showRSideBarTab(fe.COMMENTS,!0)}addToClipboard(){this.filesService.addToClipboard(this.files()),this.layout.showRSideBarTab(fe.CLIPBOARD,!0)}goToSync(t){this.layout.toggleRSideBar(!1),this.router.navigate([Ee.BASE,Ee.CLIENTS],{state:{clientId:t.clientId,pathId:t.id}}).catch(console.error)}openLockDialog(t){this.filesService.openLockDialog(t)}getSizeLazy(t){return t.isDir?(t.hDirSize||(t.hDirSize=this.filesService.getSize(t).pipe(bt(o=>mc(o,0,!0)),yo(()=>t.hDirSize=fi(t.hSize)),fs(1))),t.hDirSize):fi(t.hSize)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-selection"]],inputs:{files:[1,"files"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-sm",3,"resizeOffset"],[1,"flex-column","p-2","w-100"],[1,"fs-sm"],[1,"d-flex","justify-content-center","mt-2"],["type","button","l10nTranslate","",1,"btn","btn-primary","me-1",3,"click"],[3,"icon"],[1,"mx-0","mt-3","mb-1"],[1,"d-inline-flex","w-100","align-content-center","align-items-center","mx-1"],["alt","","height","28","width","auto",1,"me-1",3,"error","src"],[1,"text-truncate"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"d-flex","align-items-center",3,"height"],[3,"currentHeight","fileUrl"],["alt","",3,"src","height"],[1,"my-1"],[1,"fs-sm","p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-5","col-sm-5","text-bold"],[1,"word-break-all"],["animation","spin-pulse",3,"icon"],[1,"d-flex","align-items-center","mb-1"],["l10nTranslate","",1,"badge","bg-secondary-alt"],[1,"d-flex","col-7","col-sm-7"],[1,"badge","bg-primary"],[3,"click"],[1,"d-flex","align-items-center"],["alt","",1,"img-fluid",3,"src"],["alt","",3,"error","src"],["l10nTranslate","",1,"badge","bg-maroon"],["l10nTranslate",""],[1,"p-2"],[3,"permissions"],["tooltipPlacement","bottom",3,"user","height","width"],[1,"mt-1","mb-2"],[1,"d-flex","flex-wrap","align-items-center","p-2","fs-sm"],[1,"badge","white-space-normal","bg-maroon","cursor-pointer","mb-2"],[1,"badge","white-space-normal","bg-primary","cursor-pointer","me-1","mb-2"],[1,"badge","white-space-normal","bg-maroon","cursor-pointer","mb-2",3,"click"],[1,"badge","white-space-normal","bg-primary","cursor-pointer","me-1","mb-2",3,"click"]],template:function(o,r){o&1&&C(0,uC,4,3),o&2&&x(r.files().length?0:-1)},dependencies:[de,P,F,Oc,qe,St,Pe,J,rn,fr],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function _C(i,n){if(i&1&&d(0),i&2){let e=c(2);k(" ",e.link().link.currentIp," ")}}function fC(i,n){if(i&1&&(d(0),b(1,"amDateFormat")),i&2){let e=c(2);k(" ",$(1,1,e.link().link.currentAccess)," ")}}function hC(i,n){if(i&1&&d(0),i&2){let e=c(2);k(" ",e.link().link.lastIp," ")}}function gC(i,n){if(i&1&&(d(0),b(1,"amDateFormat")),i&2){let e=c(2);k(" ",$(1,1,e.link().link.lastAccess)," ")}}function CC(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"translate"),b(3,"translate"),l()),i&2){let e=c(2);V(q("badge bg-",e.link().hTimeExpirationAgo>=1?"warning":"danger")),a(),k(" ",e.link().hTimeExpirationAgo>=1?e.link().hTimeExpirationAgo+"\xA0"+E(2,4,"days",e.locale.language):E(3,7,"expired",e.locale.language)," ")}}function xC(i,n){i&1&&(s(0,"span",13),d(1,"no"),l())}function SC(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(2);V(q("badge ",e.link().link.nbAccess>=e.link().link.limitAccess?"bg-danger":"bg-success")),a(),ke(" ",e.link().link.nbAccess,"/",e.link().link.limitAccess," ")}}function vC(i,n){if(i&1&&(s(0,"span",14),d(1),l()),i&2){let e=c(2);a(),w(e.link().link.nbAccess)}}function yC(i,n){if(i&1&&_(0,"app-badge-permissions",16),i&2){let e=c(2);m("permissions",e.link().hPerms)}}function bC(i,n){i&1&&(s(0,"span",13),d(1,"no"),l())}function wC(i,n){if(i&1){let e=y();s(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),f("error",function(){h(e);let o=c();return g(o.link().fallBackMimeUrl())}),l()()(),_(4,"hr",4),s(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),s(9,"div",8),d(10),l()(),s(11,"div",6)(12,"div",7),d(13,"Created"),l(),s(14,"div",9),d(15),b(16,"amDateFormat"),l()(),s(17,"div",10),f("mouseover",function(){h(e);let o=c();return g(o.accessHover=!0)})("mouseleave",function(){h(e);let o=c();return g(o.accessHover=!1)})("focus",function(){h(e);let o=c();return g(o.accessHover=!0)}),s(18,"div",7),d(19,"Accessed"),l(),s(20,"div",9),C(21,_C,1,1)(22,fC,2,3),l()(),s(23,"div",10),f("mouseover",function(){h(e);let o=c();return g(o.lastAccessHover=!0)})("mouseleave",function(){h(e);let o=c();return g(o.lastAccessHover=!1)})("focus",function(){h(e);let o=c();return g(o.accessHover=!0)}),s(24,"div",7),d(25,"Last access"),l(),s(26,"div",9),C(27,hC,1,1)(28,gC,2,3),l()(),s(29,"div",11)(30,"div",7),d(31,"Authentication"),l(),s(32,"span"),d(33),b(34,"translate"),l()(),s(35,"div",11)(36,"div",7),d(37,"Expired"),l(),C(38,CC,4,10,"span",12)(39,xC,2,0,"span",13),l(),s(40,"div",11)(41,"div",7),d(42,"Active"),l(),s(43,"span"),d(44),b(45,"translate"),l()(),s(46,"div",11)(47,"div",7),d(48,"Access"),l(),C(49,SC,2,5,"span",12)(50,vC,2,1,"span",14),l()(),_(51,"hr",4),s(52,"div",5)(53,"div",11)(54,"div",7),d(55,"Shared from"),l(),_(56,"app-share-repository",15),l(),s(57,"div",11)(58,"div",7),d(59,"Permissions"),l(),C(60,yC,1,1,"app-badge-permissions",16)(61,bC,2,0,"span",13),l()()()}if(i&2){let e=c();m("resizeOffset",e.resizeOffset),a(3),B("height",e.cardImageSize,"px"),m("src",e.link().mimeUrl,X),a(7),w(e.link().name),a(5),w($(16,21,e.link().link.createdAt)),a(6),x(e.accessHover?21:22),a(6),x(e.lastAccessHover?27:28),a(5),V(q("badge ",e.link().link.requireAuth?"bg-success":"bg-warning")),a(),k(" ",E(34,23,e.link().link.requireAuth?"yes":"no",e.locale.language)," "),a(5),x(e.link().link.expiresAt?38:39),a(5),V(q("badge ",e.link().link.isActive?"bg-primary":"bg-danger")),a(),k(" ",E(45,26,e.link().link.isActive?"yes":"no",e.locale.language)," "),a(5),x(e.link().link.limitAccess!==0?49:50),a(7),m("share",e.link())("showIcon",!1),a(4),x(e.link().link.permissions?60:61)}}var zd=(()=>{let n=class n{constructor(){this.link=se.required(),this.locale=S(z),this.cardImageSize=80,this.resizeOffset=80,this.accessHover=!1,this.lastAccessHover=!1}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-link-selection"]],inputs:{link:[1,"link"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-sm",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],["alt","","draggable","false",3,"error","src"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-5","col-sm-5","text-bold"],[1,"word-break-all","fs-sm"],[1,"fs-sm"],[1,"d-flex","mb-1",3,"mouseover","mouseleave","focus"],[1,"d-flex","align-items-center","mb-1"],[3,"class"],["l10nTranslate","",1,"badge","bg-secondary-alt"],[1,"badge","bg-success"],[3,"share","showIcon"],[3,"permissions"]],template:function(o,r){o&1&&C(0,wC,62,29,"div",0),o&2&&x(r.link()?0:-1)},dependencies:[de,P,ri,St,J,Pe],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function TC(i,n){if(i&1&&_(0,"app-badge-members",11),i&2){let e=c(2);m("members",e.share().counts)}}function EC(i,n){i&1&&(s(0,"span",12),d(1,"no"),l())}function AC(i,n){if(i&1){let e=y();s(0,"span",16),f("click",function(){h(e);let o=c(2);return g(o.childShareDialog(o.share()))}),_(1,"fa-icon",17),d(2),l()}if(i&2){let e=c(2);a(),m("icon",e.iconShared),a(),k(" ",e.share().counts.shares," ")}}function kC(i,n){i&1&&(s(0,"span",12),d(1,"no"),l())}function DC(i,n){if(i&1){let e=y();s(0,"div",0)(1,"div",1)(2,"div",2)(3,"img",3),f("error",function(){h(e);let o=c();return g(o.share().fallBackMimeUrl())}),l()()(),_(4,"hr",4),s(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),s(9,"div",8),d(10),l()(),s(11,"div",6)(12,"div",7),d(13,"Created"),l(),s(14,"div",9),d(15),b(16,"amDateFormat"),l()(),s(17,"div",6)(18,"div",7),d(19,"Modified"),l(),s(20,"div",9),d(21),b(22,"amDateFormat"),l()(),s(23,"div",10)(24,"div",7),d(25,"Members"),l(),C(26,TC,1,1,"app-badge-members",11)(27,EC,2,0,"span",12),l(),s(28,"div",10)(29,"div",7),d(30,"Child shares"),l(),C(31,AC,3,2,"span",13)(32,kC,2,0,"span",12),l(),s(33,"div",10)(34,"div",7),d(35,"Comments"),l(),s(36,"span",14),f("click",function(){h(e);let o=c();return g(o.goToComments())}),d(37),b(38,"translate"),l()()(),_(39,"hr",4),s(40,"div",5)(41,"div",10)(42,"div",7),d(43,"Shared from"),l(),_(44,"app-share-repository",15),l()()()}if(i&2){let e=c();m("resizeOffset",e.resizeOffset),a(3),B("height",e.cardImageSize,"px"),m("src",e.share().mimeUrl,X),a(7),w(e.share().name),a(5),w($(16,15,e.share().createdAt)),a(6),w($(22,17,e.share().modifiedAt)),a(5),x(e.share().counts.users||e.share().counts.groups?26:27),a(5),x(e.share().counts.shares?31:32),a(5),V(q("badge ",e.share().hasComments?"bg-success":"bg-secondary-alt"," cursor-pointer")),a(),k(" ",E(38,19,e.share().hasComments?"yes":"no",e.locale.language)," "),a(7),m("share",e.share())("showIcon",!1)}}var Gd=(()=>{let n=class n{constructor(){this.share=se.required(),this.locale=S(z),this.iconShared=ie.SHARED_WITH_OTHERS,this.cardImageSize=80,this.resizeOffset=80,this.layout=S(I),this.sharesService=S(ai)}childShareDialog(t){t.counts.shares&&this.layout.openDialog(Ni,null,{initialState:{share:t}})}goToComments(){this.share().hasComments&&this.sharesService.goTo(this.share()).then(()=>this.layout.showRSideBarTab(fe.COMMENTS,!0))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-share-selection"]],inputs:{share:[1,"share"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-sm",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],["alt","","draggable","false",3,"error","src"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-5","col-sm-5","text-bold"],[1,"word-break-all","fs-sm"],[1,"fs-sm"],[1,"d-flex","align-items-center","mb-1"],[3,"members"],["l10nTranslate","",1,"badge","bg-secondary-alt"],[1,"badge","bg-purple","cursor-pointer","me-1"],[3,"click"],[3,"share","showIcon"],[1,"badge","bg-purple","cursor-pointer","me-1",3,"click"],[3,"icon"]],template:function(o,r){o&1&&C(0,DC,45,22,"div",0),o&2&&x(r.share()?0:-1)},dependencies:[de,P,F,ri,ni,J,Pe],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function MC(i,n){if(i&1&&_(0,"fa-icon",3),i&2){let e=c();m("icon",e.icons.faSpinner)}}function FC(i,n){i&1&&(s(0,"span",5),d(1,"You have no files anchored on this space"),l())}var ta=(()=>{let n=class n{constructor(){this.layout=S(I),this.addRootFileEvent=new So,this.icons={faAnchor:ii,faPlus:et,faSpinner:Oe,SPACES:ie.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=S(it)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:t=>this.setSpaceRoots(t),error:t=>{this.layout.sendNotification("error","Manage my anchored files",t.error.message)}})}openSelectRootDialog(){this.layout.openDialog(On,"xl",{initialState:{currentRoots:this.space.roots.filter(o=>o.owner.id===this.user.id)}}).content.submitEvent.pipe(ce(1)).subscribe(o=>this.addRootFileEvent.next(o))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(t=>({id:t.id,alias:t.alias,name:t.name,permissions:t.permissions,file:{id:t.file.id,path:t.file.path,mime:t.file.mime}}))).subscribe({next:t=>{this.setSpaceRoots(t),this.layout.closeDialog()},error:t=>{this.layout.sendNotification("error","Manage my anchored files",t.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(t){this.space.roots=[];for(let o of t)this.space.addRoot(Se(re({},o),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-user-anchors-dialog"]],inputs:{space:"space",user:"user"},decls:22,vars:11,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[3,"space","user","showUsers","addRootFile"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-success",3,"click"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click","disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span"),d(4),l()(),C(5,MC,1,1,"fa-icon",3),s(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),l()(),s(9,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),s(10,"div",7),_(11,"app-space-manage-roots",8),C(12,FC,2,0,"span",5),l(),s(13,"div",9)(14,"button",10),f("click",function(){return r.openSelectRootDialog()}),_(15,"fa-icon",2)(16,"fa-icon",2),d(17," File "),l(),s(18,"button",11),f("click",function(){return r.layout.closeDialog()}),d(19,"Cancel"),l(),s(20,"button",12),f("click",function(){return r.onSubmit()}),d(21," Confirm "),l()()),o&2&&(a(2),m("icon",r.icons.SPACES),a(2),w(r.space.name),a(),x(r.loading?5:-1),a(6),m("space",r.space)("user",r.user)("showUsers",!1)("addRootFile",r.addRootFileEvent),a(),x(r.space.roots.length?-1:12),a(3),m("icon",r.icons.faPlus),a(),m("icon",r.icons.faAnchor),a(4),m("disabled",r.submitted))},dependencies:[F,P,Bn],encapsulation:2});let i=n;return i})();var PC=(i,n)=>n.id;function IC(i,n){if(i&1&&_(0,"app-badge-members",11),i&2){let e=c(2);m("members",e.space().counts)}}function RC(i,n){i&1&&(s(0,"span",12),d(1,"no"),l())}function NC(i,n){if(i&1){let e=y();s(0,"span",16),f("click",function(){h(e);let o=c(2);return g(o.openSpaceRootsDialog())}),_(1,"fa-icon",17),d(2),l()}if(i&2){let e=c(2);a(),m("icon",e.icons.ANCHORED),a(),k(" ",e.space().counts.roots," ")}}function VC(i,n){i&1&&(s(0,"span",12),d(1,"no"),l())}function OC(i,n){if(i&1){let e=y();s(0,"span",19),f("click",function(){h(e);let o=c(3);return g(o.openChildShareDialog(o.space()))}),_(1,"fa-icon",17),d(2),l()}if(i&2){let e=c(3);a(),m("icon",e.icons.SHARED),a(),k(" ",e.space().counts.shares," ")}}function LC(i,n){i&1&&(s(0,"span",12),d(1,"no"),l())}function BC(i,n){if(i&1&&(s(0,"div",10)(1,"div",7),d(2,"Child shares"),l(),C(3,OC,3,2,"span",18)(4,LC,2,0,"span",12),l()),i&2){let e=c(2);a(3),x(e.space().counts.shares?3:4)}}function UC(i,n){if(i&1&&_(0,"app-user-avatar",14),i&2){let e=n.$implicit;m("user",e)("isMember",!0)("height",26)("width",26)}}function $C(i,n){if(i&1&&_(0,"app-badge-permissions",15),i&2){let e=c(2);m("permissions",e.space().hPerms)}}function HC(i,n){i&1&&(s(0,"span",12),d(1,"no"),l())}function zC(i,n){if(i&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),_(3,"fa-icon",3),l()(),_(4,"hr",4),s(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),s(9,"div",8),d(10),l()(),s(11,"div",6)(12,"div",7),d(13,"Created"),l(),s(14,"div",9),d(15),b(16,"amDateFormat"),l()(),s(17,"div",6)(18,"div",7),d(19,"Modified"),l(),s(20,"div",9),d(21),b(22,"amDateFormat"),l()(),s(23,"div",10)(24,"div",7),d(25,"Members"),l(),C(26,IC,1,1,"app-badge-members",11)(27,RC,2,0,"span",12),l(),s(28,"div",10)(29,"div",7),d(30,"Anchored"),l(),C(31,NC,3,2,"span",13)(32,VC,2,0,"span",12),l(),C(33,BC,5,1,"div",10),l(),_(34,"hr",4),s(35,"div",5)(36,"div",10)(37,"div",7),d(38,"Managers"),l(),D(39,UC,1,4,"app-user-avatar",14,PC),l(),s(41,"div",10)(42,"div",7),d(43,"Permissions"),l(),C(44,$C,1,1,"app-badge-permissions",15)(45,HC,2,0,"span",12),l()()()),i&2){let e=c();m("resizeOffset",e.resizeOffset),a(3),B("width",e.cardImageSize,"px")("height",e.cardImageSize,"px"),m("icon",e.icons.SPACES)("fixedWidth",!1),a(7),w(e.space().name),a(5),w($(16,14,e.space().createdAt)),a(6),w($(22,16,e.space().modifiedAt)),a(5),x(e.space().counts.users||e.space().counts.groups?26:27),a(5),x(e.space().counts.roots?31:32),a(2),x(e.space().role===e.SPACE_ROLE.IS_MANAGER?33:-1),a(6),M(e.space().managers),a(5),x(e.space().permissions?44:45)}}var Wd=(()=>{let n=class n{constructor(){this.space=se.required(),this.locale=S(z),this.SPACE_ROLE=vn,this.icons={SPACES:ie.SPACES,ANCHORED:ie.ANCHORED,SHARED:ie.SHARED_WITH_OTHERS},this.cardImageSize=80,this.resizeOffset=80,this.userService=S(oe),this.layout=S(I)}openSpaceRootsDialog(){this.layout.openDialog(ta,"md",{initialState:{space:this.space(),user:this.userService.user}})}openChildShareDialog(t){t.counts.shares&&this.layout.openDialog(Ni,null,{initialState:{space:t}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-selection"]],inputs:{space:[1,"space"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-sm",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"circle-primary-icon",2,"font-size","calc(var(--font-size-md) * 3)",3,"icon","fixedWidth"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-5","col-sm-5","text-bold"],[1,"word-break-all","fs-sm"],[1,"fs-sm"],[1,"d-flex","align-items-center","mb-1"],[3,"members"],["l10nTranslate","",1,"badge","bg-secondary-alt"],[1,"badge","bg-primary","cursor-pointer","me-1"],["tooltipPlacement","bottom",3,"user","isMember","height","width"],[3,"permissions"],[1,"badge","bg-primary","cursor-pointer","me-1",3,"click"],[3,"icon"],[1,"badge","bg-purple","cursor-pointer","me-1"],[1,"badge","bg-purple","cursor-pointer","me-1",3,"click"]],template:function(o,r){o&1&&C(0,zC,46,18,"div",0),o&2&&x(r.space()?0:-1)},dependencies:[de,F,P,St,qe,ni,Pe],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function GC(i,n){if(i&1&&(s(0,"span",11),d(1),l()),i&2){let e=c(2);a(),w(e.trash().nb)}}function WC(i,n){i&1&&(s(0,"span",12),d(1,"no"),l())}function jC(i,n){if(i&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),_(3,"fa-icon",3),l()(),_(4,"hr",4),s(5,"div",5)(6,"div",6)(7,"div",7),d(8,"Name"),l(),s(9,"div",8),d(10),b(11,"translate"),l()(),s(12,"div",6)(13,"div",7),d(14,"Created"),l(),s(15,"div",9),d(16),b(17,"amDateFormat"),l()(),s(18,"div",6)(19,"div",7),d(20,"Modified"),l(),s(21,"div",9),d(22),b(23,"amDateFormat"),l()(),s(24,"div",10)(25,"div",7),d(26,"Elements"),l(),C(27,GC,2,1,"span",11)(28,WC,2,0,"span",12),l()()()),i&2){let e=c();m("resizeOffset",e.resizeOffset),a(3),B("width",e.cardImageSize,"px")("height",e.cardImageSize,"px"),m("icon",e.iconTrash)("fixedWidth",!1),a(7),w(e.trash().isPersonal?E(11,11,e.trash().name,e.locale.language):e.trash().name),a(6),w($(17,14,e.trash().ctime)),a(6),w($(23,16,e.trash().mtime)),a(5),x(e.trash().nb?27:28)}}var jd=(()=>{let n=class n{constructor(){this.trash=se.required(),this.locale=S(z),this.iconTrash=ie.TRASH,this.cardImageSize=80,this.resizeOffset=80}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-trash-selection"]],inputs:{trash:[1,"trash"]},decls:1,vars:1,consts:[["appAutoResize","",1,"fs-sm",3,"resizeOffset"],[1,"card","px-1","pt-1"],[1,"card-body","align-self-center","p-0","my-1"],[1,"circle-primary-icon",2,"font-size","calc(var(--font-size-md) * 3)",3,"icon","fixedWidth"],[1,"my-1"],[1,"p-2"],[1,"d-flex","mb-1"],["l10nTranslate","",1,"d-flex","col-5","col-sm-5","text-bold"],[1,"d-flex","col-7","col-sm-7","word-break-all","fs-sm"],[1,"d-flex","col-7","col-sm-7","fs-sm"],[1,"d-flex","align-items-center","mb-1"],[1,"badge","bg-danger"],["l10nTranslate","",1,"badge","bg-secondary-alt"]],template:function(o,r){o&1&&C(0,jC,29,18,"div",0),o&2&&x(r.trash()?0:-1)},dependencies:[de,F,P,Pe,J],styles:[".card[_ngcontent-%COMP%]{width:100%;background:transparent;border:none}"],changeDetection:0});let i=n;return i})();function KC(i,n){if(i&1&&_(0,"app-files-selection",0),i&2){let e=c();m("files",e.store.filesSelection())}}function qC(i,n){if(i&1&&_(0,"app-space-selection",1),i&2){let e=c();m("space",e.store.spaceSelection())}}function QC(i,n){if(i&1&&_(0,"app-share-selection",2),i&2){let e=c();m("share",e.store.shareSelection())}}function YC(i,n){if(i&1&&_(0,"app-trash-selection",3),i&2){let e=c();m("trash",e.store.trashSelection())}}function XC(i,n){if(i&1&&_(0,"app-link-selection",4),i&2){let e=c();m("link",e.store.linkSelection())}}var Kd=(()=>{let n=class n{constructor(){this.store=S(te),this.SPACES_PATH=G,this.selectionType=ve(()=>this.setRepository(this.store.repository()))}setRepository(t){return[G.SPACES,G.SHARED,G.LINKS,G.TRASHES].indexOf(t)>-1?t:G.FILES}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-selection"]],decls:5,vars:1,consts:[[3,"files"],[3,"space"],[3,"share"],[3,"trash"],[3,"link"]],template:function(o,r){if(o&1&&C(0,KC,1,1,"app-files-selection",0)(1,qC,1,1,"app-space-selection",1)(2,QC,1,1,"app-share-selection",2)(3,YC,1,1,"app-trash-selection",3)(4,XC,1,1,"app-link-selection",4),o&2){let p;x((p=r.selectionType())===r.SPACES_PATH.FILES?0:p===r.SPACES_PATH.SPACES?1:p===r.SPACES_PATH.SHARED?2:p===r.SPACES_PATH.TRASHES?3:p===r.SPACES_PATH.LINKS?4:-1)}},dependencies:[Hd,Gd,Wd,jd,zd],encapsulation:2,changeDetection:0});let i=n;return i})();var ZC=["CommentCreate"],JC=(i,n)=>n.id;function ex(i,n){if(i&1){let e=y();s(0,"i",14),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.onEditComment(o))}),_(1,"fa-icon",15),l()}if(i&2){let e=c(3);a(),m("icon",e.icons.faEdit)}}function tx(i,n){if(i&1){let e=y();s(0,"textarea",16,1),d(2," "),l(),s(3,"div",17)(4,"button",18),f("click",function(){h(e);let o=at(1),r=c().$implicit,p=c(2);return g(p.updateComment(r,o.value))}),d(5," Update "),l(),s(6,"button",19),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.onEditComment(o))}),d(7," Cancel "),l(),s(8,"button",20),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.removeComment(o))}),d(9," Remove "),l()()}if(i&2){let e=at(1),t=c().$implicit;m("ngModel",t.content)("disabled",!t.author.isAuthor&&t.isFileOwner),a(4),m("disabled",!e.value||t.content===e.value)}}function ix(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"amDateFormat"),l()),i&2){let e=c(2).$implicit;a(),w($(2,1,e.dateToShow))}}function nx(i,n){i&1&&(s(0,"span",22),d(1,"modified"),l())}function ox(i,n){if(i&1&&(C(0,nx,2,0,"span",22),s(1,"span"),d(2),b(3,"amTimeAgo"),l()),i&2){let e=c(2).$implicit;x(e.wasModified?0:-1),a(2),w($(3,2,e.dateToShow))}}function rx(i,n){if(i&1){let e=y();s(0,"div"),d(1),l(),s(2,"span",21),f("mouseleave",function(){h(e);let o=c().$implicit;return g(o.isHover=!1)})("mouseover",function(){h(e);let o=c().$implicit;return g(o.isHover=!0)})("focus",function(){h(e);let o=c().$implicit;return g(o.isHover=!0)}),C(3,ix,3,3,"span")(4,ox,4,4),l()}if(i&2){let e=c().$implicit;a(),w(e.content),a(2),x(e.isHover?3:4)}}function ax(i,n){if(i&1&&(s(0,"div",7)(1,"div",8),_(2,"app-user-avatar",9),s(3,"div",10)(4,"b"),d(5),b(6,"translate"),l()(),s(7,"div",11),C(8,ex,2,1,"i",12),l()(),s(9,"div",13),C(10,tx,10,3)(11,rx,5,2),l()()),i&2){let e=n.$implicit,t=c(2);a(2),m("user",e.author)("width",24)("height",24),a(3),w(e.author.isAuthor?E(6,6,"Me",t.locale.language):e.author.fullName),a(3),x(e.author.isAuthor||e.isFileOwner?8:-1),a(2),x(e.isEdited?10:11)}}function sx(i,n){if(i&1&&(s(0,"div",6),D(1,ax,12,9,"div",7,JC),l()),i&2){let e=c();a(),M(e.comments)}}var qd=(()=>{let n=class n{constructor(){this.locale=S(z),this.comments=[],this.icons={faEdit:fl},this.store=S(te),this.file=ve(()=>this.store.filesSelection().length?this.store.filesSelection()[0]:null),this.layout=S(I),this.commentsService=S(zr),this.subscriptions=[],this.subscriptions.push(pi(this.file).subscribe(t=>this.loadComments(t)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onEditComment(t){t.isEdited||this.comments.forEach(o=>o.isEdited=!1),t.isEdited=!t.isEdited}loadComments(t){t&&t.hasComments?this.commentsService.getComments(this.file()).subscribe({next:o=>this.comments=o,error:o=>this.layout.sendNotification("error","Comments","Unable to load",o)}):this.comments=[]}postComment(){let t=this.commentInput.nativeElement.value;this.commentsService.createComment(this.file(),{content:t,fileId:this.file().id}).subscribe({next:o=>{this.comments.unshift(o),this.commentInput.nativeElement.value="",this.file().id=o.fileId,this.file().hasComments=!!this.comments.length},error:o=>this.layout.sendNotification("error","Comment","Unable to create",o)})}removeComment(t){this.commentsService.deleteComment(this.file(),{commentId:t.id,fileId:this.file().id}).subscribe({next:()=>{this.comments=this.comments.filter(o=>o.id!==t.id),this.file().hasComments=!!this.comments.length},error:o=>this.layout.sendNotification("error","Comment","Unable to delete",o)})}updateComment(t,o){this.commentsService.updateComment(this.file(),{commentId:t.id,fileId:this.file().id,content:o}).subscribe({next:r=>{t.isEdited=!1,Object.assign(t,r)},error:r=>{this.layout.sendNotification("error","Comment","Unable to update",r)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-comments-selection"]],viewQuery:function(o,r){if(o&1&&Z(ZC,7),o&2){let p;j(p=K())&&(r.commentInput=p.first)}},decls:8,vars:7,consts:[["CommentCreate",""],["CommentUpdate",""],[1,"sidebar-component-title"],[1,"input-group","input-group-sm","mb-0"],["type","text","appAutofocus","",1,"form-control","form-control-sm",3,"keyup.enter","disabled","placeholder"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary",3,"click","disabled"],["appAutoResize","",1,"fs-sm","p-2"],[1,"mb-1","app-small-card","app-comment","rounded"],[1,"d-flex","px-2","pt-2","pb-1"],[1,"me-1",3,"user","width","height"],[1,"align-self-center"],[1,"ms-auto","align-self-center"],["role","button",1,"fs-md"],[1,"pb-2","px-2"],["role","button",1,"fs-md",3,"click"],[3,"icon"],["required","",1,"form-control","mt-1","mb-2",3,"ngModel","disabled"],[1,"d-flex","gap-2","w-100"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary","flex-fill",3,"click","disabled"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xs","btn-default","flex-fill",3,"click"],["role","button","type","button","l10nTranslate","",1,"btn","btn-xs","btn-danger","flex-fill",3,"click"],[1,"text-muted","no-select","pt-1","fs-2xs",3,"mouseleave","mouseover","focus"],["l10nTranslate","",1,"me-1"]],template:function(o,r){if(o&1){let p=y();s(0,"div",2)(1,"div",3)(2,"input",4,0),b(4,"translate"),f("keyup.enter",function(){return h(p),g(r.postComment())}),l(),s(5,"button",5),f("click",function(){return h(p),g(r.postComment())}),d(6," Add "),l()()(),C(7,sx,3,0,"div",6)}if(o&2){let p=at(3);a(2),m("disabled",!r.file())("placeholder",E(4,4,"Write a comment ...",r.locale.language)),a(3),m("disabled",!p.value),a(2),x(r.comments.length?7:-1)}},dependencies:[je,P,de,F,Te,ze,xe,Jt,we,qe,J,Pe,Qe],encapsulation:2});let i=n;return i})();var lx=(i,n)=>n.key,cx=(i,n)=>n.id;function px(i,n){if(i&1&&(s(0,"option",8),d(1),l()),i&2){let e=n.$implicit;m("ngValue",e.key),a(),w(e.value.text)}}function dx(i,n){if(i&1){let e=y();s(0,"div",12)(1,"div",13)(2,"img",14),f("error",function(){let o=h(e).$implicit;return g(o.fallBackMimeUrl())}),l(),s(3,"div",15),d(4),l(),s(5,"button",16),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.remove(o))}),_(6,"fa-icon",4),l()()()}if(i&2){let e=n.$implicit,t=c(2);a(),m("tooltip",e.path),a(),m("src",e.mimeUrl,X),a(2),w(e.name),a(2),m("icon",t.icons.faTimes)}}function mx(i,n){if(i&1){let e=y();s(0,"div",5)(1,"div",6)(2,"select",7),_e("ngModelChange",function(o){h(e);let r=c();return ue(r.selectedAction,o)||(r.selectedAction=o),g(o)}),D(3,px,2,2,"option",8,lx),b(5,"keyvalue"),l(),s(6,"button",9),f("click",function(){h(e);let o=c();return g(o.doAction())}),d(7,"Confirm"),l()()(),_(8,"hr",10),s(9,"div",11),D(10,dx,7,4,"div",12,cx),l()}if(i&2){let e=c();a(2),me("ngModel",e.selectedAction),a(),M(E(5,2,e.operations,e.originalOrderKeyValue)),a(6),m("resizeOffset",120),a(),M(e.files)}}var Qd=(()=>{let n=class n{constructor(){this.locale=S(z),this.icons={faTrashCan:wi,faTimes:It,faDownload:gn,faArrowsAlt:ei,faClone:fn,faQuestion:Io},this.originalOrderKeyValue=Fe,this.operations={copyPaste:{text:"Copy-Paste",operation:Ne.COPY},cutPaste:{text:"Cut-Paste",operation:Ne.MOVE},download:{text:"Download",operation:Ne.DOWNLOAD},compress:{text:"Compress",operation:Ne.COMPRESS}},this.files=[],this.layout=S(I),this.store=S(te),this.filesService=S(Le),this.selectedAction=this.filesService.clipboardAction,this.subscriptions=[],this.subscriptions.push(this.store.filesClipboard.subscribe(t=>this.files=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}clearAll(){this.layout.toggleRSideBar(!1),this.filesService.clearClipboard()}remove(t){this.files.length===1?this.clearAll():this.filesService.removeFromClipboard(t)}doAction(){if(this.selectedAction==="copyPaste"||this.selectedAction==="cutPaste")this.filesService.onPasteClipboard(this.selectedAction);else{let t={name:this.files[0].name,compressInDirectory:this.operations[this.selectedAction].operation===Ne.COMPRESS,files:this.files.map(r=>({name:r.name,rootAlias:r.root?.alias,path:r.path})),extension:"tar"};this.layout.openDialog(Jr,null,{initialState:{archiveProps:t}}).content.submitEvent.pipe(ce(1)).subscribe(()=>this.filesService.clearClipboard())}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-clipboard"]],decls:8,vars:7,consts:[[1,"sidebar-component-title"],["container","body","placement","left",1,"cursor-pointer",3,"icon","tooltip"],["l10nTranslate",""],[1,"btn","btn-default",3,"click"],[3,"icon"],[1,"px-2","pt-2","pb-2","fs-xs"],[1,"d-flex","justify-content-between","mt-2"],[1,"form-select","form-select-sm",3,"ngModelChange","ngModel"],["l10nTranslate","",3,"ngValue"],["type","button","l10nTranslate","",1,"btn","btn-xs","btn-primary","ms-1",3,"click"],[1,"mx-0","my-2"],["appAutoResize","",1,"sidebar-item",3,"resizeOffset"],[1,"sidebar-item-container"],[1,"sidebar-item-content",3,"tooltip"],["alt","","height","28","width","auto",1,"me-1",3,"error","src"],[1,"text-truncate","fs-sm"],[1,"btn","btn-xs","btn-danger","ms-auto",3,"click"]],template:function(o,r){o&1&&(s(0,"div",0),_(1,"fa-icon",1),b(2,"translate"),s(3,"span",2),d(4,"Clipboard"),l(),s(5,"button",3),f("click",function(){return r.clearAll()}),_(6,"fa-icon",4),l()(),C(7,mx,12,5)),o&2&&(a(),m("icon",r.icons.faQuestion)("tooltip",E(2,4,"Actions will be performed in the current folder",r.locale.language)),a(5),m("icon",r.icons.faTrashCan),a(),x(r.files.length?7:-1))},dependencies:[de,F,Ge,Me,P,Te,Si,vi,xi,xe,we,J,De],encapsulation:2});let i=n;return i})();var Yd=(()=>{let n=class n{constructor(){this.layout=S(I),this.store=S(te),this.tabs=[{label:fe.SELECTION,components:[Kd],loadComponent:!1,icon:Pl,count:{value:pi(ve(()=>this.store.filesSelection().length>1?this.store.filesSelection().length>1e3?"999+":this.store.filesSelection().length:0)),level:"primary"},title:"Info",active:!1},{label:fe.TREE,components:[Qr],loadComponent:!0,icon:zl,title:null,active:!1},{label:fe.COMMENTS,components:[qd],loadComponent:!1,icon:xr,title:null,active:!1},{label:fe.CLIPBOARD,components:[Qd],loadComponent:!1,icon:zo,count:{value:this.store.filesClipboard.pipe(bt(t=>t.length)),level:"maroon"},showOnCount:!0,title:null,active:!1}],this.layout.setTabsRSideBar(pc.FILES,this.tabs)}ngOnDestroy(){this.layout.setTabsRSideBar(null)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-nav"]],decls:1,vars:0,template:function(o,r){o&1&&_(0,"router-outlet")},dependencies:[an],encapsulation:2});let i=n;return i})();var Xd=(()=>{let n=class n{transform(t,o,r){if(typeof o>"u"||typeof o=="number"&&typeof r>"u")throw new Error("TimeAddPipe: missing required arguments");return Ai(t).add(o,r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=on({name:"amAdd",type:n,pure:!0});let i=n;return i})();var Zd=(()=>{let n=class n{transform(t,o){if(!o)throw new Error("TimeDurationPipe: missing required time unit argument");return Ai.duration({[o]:t}).humanize()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275pipe=on({name:"amDuration",type:n,pure:!1});let i=n;return i})();function _x(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c();a(),w(e.space.name)}}function fx(i,n){i&1&&(s(0,"span",3),d(1,"Create a new space"),l())}function hx(i,n){if(i&1&&_(0,"fa-icon",4),i&2){let e=c();m("icon",e.icons.faSpinner)}}function gx(i,n){i&1&&(s(0,"h4",5)(1,"span",3),d(2,"Edit space"),l()())}function Cx(i,n){if(i&1&&(s(0,"span",50),_(1,"fa-icon",2),s(2,"span",51),d(3,"Settings"),l()()),i&2){let e=c();a(),m("icon",e.icons.faCog)}}function xx(i,n){if(i&1&&(s(0,"div",24)(1,"label",52),d(2,"Storage Usage"),l(),_(3,"app-storage-usage",53),l()),i&2){let e=c();a(3),m("item",e.space)}}function Sx(i,n){i&1&&(s(0,"small",40),d(1,"At least one manager is required"),l())}function vx(i,n){if(i&1&&(s(0,"div",56)(1,"label",62),d(2,"Deactivation date"),l(),s(3,"div",63),d(4),b(5,"amDateFormat"),l()()),i&2){let e=c(2);a(4),w($(5,1,e.space.disabledAt))}}function yx(i,n){if(i&1&&(s(0,"div",41)(1,"div",54)(2,"div",55),C(3,vx,6,3,"div",56),s(4,"div",57)(5,"label",58),d(6,"Creation date"),l(),s(7,"div",59),d(8),b(9,"amDateFormat"),l()(),s(10,"div",57)(11,"label",60),d(12,"Modification date"),l(),s(13,"div",61),d(14),b(15,"amDateFormat"),l()()()()()),i&2){let e=c();a(3),x(e.space.disabledAt&&!e.space.enabled?3:-1),a(5),w($(9,3,e.space.createdAt)),a(6),w($(15,5,e.space.modifiedAt))}}function bx(i,n){if(i&1&&(s(0,"span",50),_(1,"fa-icon",2),s(2,"span",51),d(3,"Files"),l(),s(4,"span",64),d(5),l()()),i&2){let e=c();a(),m("icon",e.icons.faAnchor),a(4),w((e.space.roots==null?null:e.space.roots.length)||0)}}function wx(i,n){if(i&1&&(s(0,"span",50),_(1,"fa-icon",2),s(2,"span",51),d(3,"Members"),l(),s(4,"span",64),d(5),l()()),i&2){let e=c();a(),m("icon",e.icons.faUsers),a(4),w(e.space.members.length)}}function Tx(i,n){if(i&1&&(s(0,"span",50),_(1,"fa-icon",2),s(2,"span",51),d(3,"Links"),l(),s(4,"span",64),d(5),l()()),i&2){let e=c();a(),m("icon",e.icons.LINKS),a(4),w(e.space.links.length)}}function Ex(i,n){if(i&1){let e=y();s(0,"button",67),f("click",function(){h(e);let o=c(2);return g(o.confirmDeletion=!0)}),d(1," Remove "),l()}if(i&2){let e=c(2);m("disabled",e.confirmDeletion)}}function Ax(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"amAdd"),b(3,"amTimeAgo"),l()),i&2){let e=c(3);a(),k("\xA0",E(3,5,$t(2,1,e.space.disabledAt,e.SPACE_MAX_DISABLED_DAYS,"days"),!0))}}function kx(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"amDuration"),l()),i&2){let e=c(3);a(),k("\xA0",E(2,1,e.SPACE_MAX_DISABLED_DAYS,"days"))}}function Dx(i,n){if(i&1&&(s(0,"div")(1,"span",3),d(2,"Space and data will be deleted in"),l(),s(3,"span",68),C(4,Ax,4,8,"span")(5,kx,3,4,"span"),l()()),i&2){let e=c(2);V(q("text-danger white-space-truncate fs-sm ",e.user.isAdmin?"mx-auto":"me-auto")),a(4),x(e.space.disabledAt?4:5)}}function Mx(i,n){if(i&1&&(C(0,Ex,2,1,"button",65),C(1,Dx,6,4,"div",66)),i&2){let e=c();x(e.user.isAdmin?0:-1),a(),x(e.space.enabled?-1:1)}}function Fx(i,n){if(i&1){let e=y();s(0,"button",69),f("click",function(){h(e);let o=c();return g(o.openCreateLinkDialog())}),_(1,"fa-icon",2)(2,"fa-icon",2),d(3," Link "),l()}if(i&2){let e=c();a(),m("icon",e.icons.faPlus),a(),m("icon",e.icons.LINKS)}}function Px(i,n){if(i&1){let e=y();s(0,"button",71),f("click",function(){h(e);let o=c(2);return g(o.openAdminRootDialog())}),_(1,"fa-icon",2)(2,"fa-icon",2),d(3," External location "),l()}if(i&2){let e=c(2);a(),m("icon",e.icons.faPlus),a(),m("icon",e.icons.faUserShield)}}function Ix(i,n){if(i&1){let e=y();s(0,"button",69),f("click",function(){h(e);let o=c();return g(o.openSelectRootDialog())}),_(1,"fa-icon",2)(2,"fa-icon",2),d(3," File "),l(),C(4,Px,4,2,"button",70)}if(i&2){let e=c();a(),m("icon",e.icons.faPlus),a(),m("icon",e.icons.faAnchor),a(2),x(e.user.isAdmin?4:-1)}}var is=(()=>{let n=class n{constructor(){this.space=new Qc({id:0,name:"",createdAt:new Date,enabled:!0,storageUsage:0,storageQuota:null}),this.spaceChange=new ae,this.locale=S(z),this.layout=S(I),this.icons={SPACES:ie.SPACES,LINKS:ie.LINKS,faPen:dt,faAnchor:ii,faUserShield:Ho,faPlus:et,faSpinner:Oe,faCog:hn,faUsers:$o},this.SPACE_MAX_DISABLED_DAYS=30,this.addRootFileEvent=new So,this.allowedLinkPermissions=[We.ADD,We.DELETE,We.MODIFY],this.editManagers=!1,this.confirmDeletion=!1,this.loading=!1,this.submitted=!1,this.userService=S(oe),this.user=this.userService.user,this.spacesService=S(it),this.linksService=S(si)}ngOnInit(){this.space.id||this.space.managers.unshift(Ec(this.user,vn.IS_MANAGER))}searchManagers(t){let o={search:t,ignoreUserIds:[...this.space.managers.map(r=>r.id),...this.space.members.filter(r=>r.isUser).map(r=>r.id)],onlyUsers:!0};return this.userService.searchMembers(o)}searchMembers(t){let o={search:t,ignoreUserIds:[...this.space.managers.map(r=>r.id),...this.space.members.filter(r=>r.isUser).map(r=>r.id)],ignoreGroupIds:this.space.members.filter(r=>r.isGroup).map(r=>r.id)};return this.userService.searchMembers(o)}openSelectRootDialog(){this.layout.openDialog(On,"xl",{initialState:{currentRoots:this.space.roots.filter(o=>o.owner.id===this.user.id)}}).content.submitEvent.pipe(ce(1)).subscribe(o=>this.addRootFileEvent.next(o))}openAdminRootDialog(){this.layout.openDialog(Yr,null,{initialState:{currentRoots:this.space.roots.filter(o=>o.externalPath)}}).content.submitEvent.pipe(ce(1)).subscribe(o=>this.addRootFileEvent.next(o))}openEditLinkDialog(t){this.linksService.editLinkDialog(t,this.space,ar.SPACE)}openCreateLinkDialog(){this.linksService.createLinkDialog(this.space)}setSpaceStatus(t){this.space.enabled=t,this.space.disabledAt=t?null:new Date}toggleSpaceStatusFromCard(){this.setSpaceStatus(!this.space.enabled)}toggleFullTextSearchFromCard(){this.space.storageIndexing=!this.space.storageIndexing}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){this.loading=!0,this.submitted=!0,this.confirmDeletion?(this.space.id===0&&this.layout.closeDialog(),this.spacesService.deleteSpace(this.space.id,{deleteNow:!0}).subscribe({next:()=>{this.loading=!1,this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Delete space",this.space.name,t)}})):this.space.id===0?this.spacesService.createSpace(this.space).subscribe({next:t=>{this.loading=!1,this.space=t,this.spaceChange.emit(["add",t]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Create space",this.space.name,t)}}):this.spacesService.updateSpace(this.space).subscribe({next:t=>{this.loading=!1,t?(this.space=t,this.spaceChange.emit(["update",t])):this.spaceChange.emit(["delete",this.space]),this.layout.closeDialog()},error:t=>{this.onError(),this.layout.sendNotification("error","Edit space",this.space.name,t)}})}cantSubmit(){return this.submitted||!this.space.name||!this.space.managers.length}onError(){this.confirmDeletion=!1,this.submitted=!1,this.loading=!1}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-space-dialog"]],inputs:{space:"space"},outputs:{spaceChange:"spaceChange"},decls:76,vars:53,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body"],["type","pills",3,"justified"],["customClass","tab-dialog",3,"selectTab"],["tabHeading",""],[1,"app-tab-content","row","g-3"],[1,"col-12","col-lg-6","d-flex","flex-column"],[1,"card","dialog-tab-card","w-100","mb-3"],[1,"card-body","d-flex","flex-column"],[1,"mb-3","px-0"],["for","name","l10nTranslate","",1,"form-label"],["id","name","type","text","appAutofocus","","required","",3,"ngModelChange","ngModel"],["for","description","l10nTranslate","",1,"form-label"],["id","description","type","text",1,"form-control",3,"ngModelChange","ngModel"],[1,"card","dialog-tab-card","mb-3"],[1,"card-body","p-2","d-flex","flex-column","gap-2"],[1,"d-flex","flex-column","align-items-start"],[1,"w-100","mb-3",3,"quotaChange","quota","fullWidth"],[1,"d-flex","flex-column","mb-3"],[1,"d-flex","justify-content-between","gap-2"],[1,"card","dialog-check-card","dialog-check-card--interactive","flex-fill",3,"click"],[1,"card-body","p-2"],["for","switchStatus","l10nTranslate","",1,"form-label",3,"click"],[1,"d-flex","align-items-center","form-check","form-switch","cursor-pointer"],["id","switchStatus","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","click","ngModel"],["for","switchStatus","l10nTranslate","",1,"form-label","form-check-label","mb-0","ms-2",3,"click"],["for","switchFullText","l10nTranslate","",1,"form-label",3,"click"],["id","switchFullText","type","checkbox","role","button",1,"form-check-input",3,"ngModelChange","click","ngModel"],["for","switchFullText","l10nTranslate","",1,"form-label","form-check-label","mb-0","ms-2",3,"click"],[1,"card","dialog-tab-card","flex-grow-1","d-flex","mb-3"],["type","button",3,"click"],["for","editManagers","l10nTranslate","",1,"form-label","no-select-pointer"],["id","editManagers",1,"ms-1",3,"icon"],[3,"membersChange","members","searchFunction","editMode","hideInput","rowBackgroundClass","customPlaceholder"],["l10nTranslate","",1,"text-danger"],[1,"card","dialog-tab-card"],[1,"app-tab-content"],[3,"space","user","addRootFile"],[3,"membersChange","members","withPermissions","searchFunction"],[3,"membersChange","members","filterPermissions","allowedPermissions","withPermissions","editFunction","hideInput"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-success"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"app-tab-heading"],["l10nTranslate","",1,"app-tab-label"],["for","storage","l10nTranslate","",1,"form-label"],["id","storage",3,"item"],[1,"card-body"],[1,"d-flex","align-items-end","flex-fill","justify-content-between","gap-2","flex-wrap"],[1,"d-flex","flex-column","text-danger"],[1,"d-flex","flex-column"],["for","created","l10nTranslate","",1,"form-label"],["id","created",1,"fs-sm"],["for","modified","l10nTranslate","",1,"form-label"],["id","modified",1,"fs-sm"],["for","disabled","l10nTranslate","",1,"form-label"],["id","disabled"],[1,"app-tab-count"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"disabled"],[3,"class"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"click","disabled"],[1,"text-bold"],["type","button","l10nTranslate","",1,"btn","btn-success",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-warning"],["type","button","l10nTranslate","",1,"btn","btn-warning",3,"click"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),C(3,_x,2,1,"span")(4,fx,2,0,"span",3),C(5,hx,1,1,"fa-icon",4),l(),C(6,gx,3,0,"h4",5),s(7,"button",6),f("click",function(){return r.layout.closeDialog()}),l()(),s(8,"div",7)(9,"tabset",8)(10,"tab",9),f("selectTab",function(){return r.tabView=null}),N(11,Cx,4,1,"ng-template",10),s(12,"div",11)(13,"div",12)(14,"div",13)(15,"div",14)(16,"div",15)(17,"label",16),d(18," Space name "),l(),s(19,"input",17),_e("ngModelChange",function(u){return ue(r.space.name,u)||(r.space.name=u),u}),l()(),s(20,"div",15)(21,"label",18),d(22," Description "),l(),s(23,"input",19),_e("ngModelChange",function(u){return ue(r.space.description,u)||(r.space.description=u),u}),l()()()(),s(24,"div",20)(25,"div",21)(26,"div",22)(27,"app-storage-quota",23),_e("quotaChange",function(u){return ue(r.space.storageQuota,u)||(r.space.storageQuota=u),u}),l()(),C(28,xx,4,1,"div",24),l()(),s(29,"div",25)(30,"div",26),f("click",function(){return r.toggleSpaceStatusFromCard()}),s(31,"div",27)(32,"label",28),f("click",function(u){return u.stopPropagation()}),d(33,"Space status"),l(),s(34,"div",29)(35,"input",30),f("ngModelChange",function(u){return r.setSpaceStatus(u)})("click",function(u){return u.stopPropagation()}),l(),s(36,"label",31),f("click",function(u){return u.stopPropagation()}),d(37),l()()()(),s(38,"div",26),f("click",function(){return r.toggleFullTextSearchFromCard()}),s(39,"div",27)(40,"label",32),f("click",function(u){return u.stopPropagation()}),d(41,"Full-text search"),l(),s(42,"div",29)(43,"input",33),_e("ngModelChange",function(u){return ue(r.space.storageIndexing,u)||(r.space.storageIndexing=u),u}),f("click",function(u){return u.stopPropagation()}),l(),s(44,"label",34),f("click",function(u){return u.stopPropagation()}),d(45),l()()()()()(),s(46,"div",12)(47,"div",35)(48,"div",14)(49,"div",36),f("click",function(){return r.editManagers=!r.editManagers}),s(50,"label",37),d(51,"Managers"),l(),_(52,"fa-icon",38),l(),s(53,"app-user-search",39),_e("membersChange",function(u){return ue(r.space.managers,u)||(r.space.managers=u),u}),l(),C(54,Sx,2,0,"small",40),l()(),C(55,yx,16,7,"div",41),l()()(),s(56,"tab",9),f("selectTab",function(){return r.tabView="roots"}),N(57,bx,6,2,"ng-template",10),s(58,"div",42),_(59,"app-space-manage-roots",43),l()(),s(60,"tab",9),f("selectTab",function(){return r.tabView="members"}),N(61,wx,6,2,"ng-template",10),s(62,"div",42)(63,"app-user-search",44),_e("membersChange",function(u){return ue(r.space.members,u)||(r.space.members=u),u}),l()()(),s(64,"tab",9),f("selectTab",function(){return r.tabView="links"}),N(65,Tx,6,2,"ng-template",10),s(66,"div",42)(67,"app-user-search",45),_e("membersChange",function(u){return ue(r.space.links,u)||(r.space.links=u),u}),l()()()()(),s(68,"div",46),C(69,Mx,2,2),C(70,Fx,4,2,"button",47),C(71,Ix,5,3),s(72,"button",48),f("click",function(){return r.onCancel()}),d(73,"Cancel"),l(),s(74,"button",49),f("click",function(){return r.onSubmit()}),d(75),l()()),o&2&&(a(2),m("icon",r.icons.SPACES),a(),x(r.space.id?3:4),a(2),x(r.loading?5:-1),a(),x(r.space.id?6:-1),a(),V(q("btn-close btn-close-white ",r.space.id?"ms-2":"ms-auto"," ms-2")),a(2),m("justified",!0),a(10),V(q("form-control ",r.space.name?"":"is-invalid")),me("ngModel",r.space.name),a(4),me("ngModel",r.space.description),a(4),me("quota",r.space.storageQuota),m("fullWidth",!0),a(),x(r.space.storageUsage?28:-1),a(2),L("dialog-check-card--active",r.space.enabled),a(5),m("ngModel",r.space.enabled),a(2),k(" ",r.space.enabled?"enabled":"disabled"," "),a(),L("dialog-check-card--active",r.space.storageIndexing),a(5),me("ngModel",r.space.storageIndexing),a(2),k(" ",r.space.storageIndexing?"enabled":"disabled"," "),a(7),m("icon",r.icons.faPen),a(),me("members",r.space.managers),m("searchFunction",r.searchManagers.bind(r))("editMode",r.editManagers)("hideInput",!r.editManagers)("rowBackgroundClass","")("customPlaceholder","Type to search for managers to add"),a(),x(r.space.managers.length?-1:54),a(),x(r.space.id?55:-1),a(4),m("space",r.space)("user",r.user)("addRootFile",r.addRootFileEvent),a(4),me("members",r.space.members),m("withPermissions",!0)("searchFunction",r.searchMembers.bind(r)),a(4),me("members",r.space.links),m("filterPermissions",!0)("allowedPermissions",r.allowedLinkPermissions)("withPermissions",!0)("editFunction",r.openEditLinkDialog.bind(r))("hideInput",!0),a(2),x(!r.tabView&&r.space.id?69:-1),a(),x(r.tabView==="links"?70:-1),a(),x(r.tabView==="roots"?71:-1),a(3),V(q("btn ",r.confirmDeletion?"btn-danger":"btn-primary")),m("disabled",r.cantSubmit()),a(),k(" ",r.confirmDeletion?"Confirm permanent deletion of data":"Confirm"," "))},dependencies:[P,F,ur,dr,pr,mr,Te,ze,Ft,xe,Jt,we,je,_r,En,Bn,Tn,Qe,Xd,Zd,Pe],encapsulation:2});let i=n;return i})();var Rx=["MainContextMenu"],Nx=["TargetContextMenu"],Jd=(i,n)=>n.id,em=(i,n)=>n.mid,tm=(i,n)=>n.key;function Vx(i,n){if(i&1){let e=y();s(0,"button",18),b(1,"translate"),f("click",function(){h(e);let o=c();return g(o.openSpaceDialog(!0))}),_(2,"fa-icon",7),l()}if(i&2){let e=c();m("tooltip",E(1,2,"New space",e.locale.language)),a(2),m("icon",e.icons.faPlus)}}function Ox(i,n){if(i&1&&(s(0,"span",33),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),w(e.hTimeAgo)}}function Lx(i,n){if(i&1&&_(0,"app-user-avatar",34),i&2){let e=n.$implicit,t=c(4);m("user",e)("isMember",!0)("height",t.galleryMode.dimensions/3.5)("width",t.galleryMode.dimensions/3.5)("fontSize",t.galleryMode.faSize/2.5)}}function Bx(i,n){if(i&1&&(s(0,"span",27),D(1,Lx,1,5,"app-user-avatar",34,em),l()),i&2){let e=c().$implicit;a(),M(e.managers)}}function Ux(i,n){if(i&1){let e=y();s(0,"span",35),f("click",function(){h(e);let o=c(3);return g(o.openSpaceRootsDialog())}),_(1,"fa-icon",7),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);a(),m("icon",t.icons.faAnchor),a(),k(" ",e.counts.roots," ")}}function $x(i,n){if(i&1){let e=y();s(0,"span",36),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",7),d(2),l()}if(i&2){let e=c().$implicit,t=c(2);a(),m("icon",t.icons.SHARED),a(),k(" ",e.counts.shares," ")}}function Hx(i,n){if(i&1){let e=y();s(0,"div",22),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),s(1,"div",23),_(2,"fa-icon",24),s(3,"span",25),C(4,Ox,2,3,"span",26),l(),C(5,Bx,3,0,"span",27),s(6,"span",28),C(7,Ux,3,2,"span",29),C(8,$x,3,2,"span",30),l()(),s(9,"div",31)(10,"span",32),d(11),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),L("disabled",!e.enabled)("selected",e.id===(o.selected==null?null:o.selected.id)),a(),Xt("rowIndex",t),a(),B("min-width",o.galleryMode.image,"px")("min-height",o.galleryMode.image,"px")("font-size",o.galleryMode.faSize,"px"),m("icon",o.icons.SPACES),a(2),x(e.newly?4:-1),a(),x(e.managers.length?5:-1),a(2),x(e.counts!=null&&e.counts.roots?7:-1),a(),x(e.role===o.SPACE_ROLE.IS_MANAGER&&e.counts.shares?8:-1),a(2),B("font-size",o.galleryMode.textSize,"px"),a(),w(e.name)}}function zx(i,n){if(i&1){let e=y();s(0,"div",12)(1,"app-virtual-scroll",19),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),s(3,"div",20),D(4,Hx,12,23,"div",21,Jd),l()()()}if(i&2){let e=c();a(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.spaces,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),a(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Gx(i,n){if(i&1&&_(0,"fa-icon",43),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Wx(i,n){if(i&1){let e=y();s(0,"th",42),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,Gx,1,2,"fa-icon",43),l()}if(i&2){let e=c().$implicit,t=c(2);V(e.value.class),B("width",e.value.width,"%"),L("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),k(" ",e.value.label," "),a(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function jx(i,n){if(i&1&&C(0,Wx,3,10,"th",41),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Kx(i,n){if(i&1&&(s(0,"div",46),_(1,"fa-icon",50),s(2,"div",51)(3,"span",32),d(4),l(),s(5,"span",52),d(6),l()()()),i&2){let e=c(3).$implicit,t=c(2);a(),m("icon",t.icons.SPACES)("fixedWidth",!1),a(3),w(e.name),a(2),w(e.description)}}function qx(i,n){if(i&1&&_(0,"app-user-avatar",53),i&2){let e=n.$implicit;m("user",e)("isMember",!0)("container","body")}}function Qx(i,n){if(i&1&&(s(0,"div",47),D(1,qx,1,3,"app-user-avatar",53,em),l()),i&2){let e=c(3).$implicit;a(),M(e.managers)}}function Yx(i,n){if(i&1&&_(0,"app-badge-members",48),i&2){let e=c(3).$implicit;m("members",e.counts)}}function Xx(i,n){if(i&1){let e=y();s(0,"span",35),f("click",function(){h(e);let o=c(6);return g(o.openSpaceRootsDialog())}),_(1,"fa-icon",7),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);a(),m("icon",t.icons.faAnchor),a(),k(" ",e.counts.roots," ")}}function Zx(i,n){if(i&1){let e=y();s(0,"span",36),f("click",function(){h(e);let o=c(4).$implicit,r=c(2);return g(r.openChildShareDialog(o))}),_(1,"fa-icon",7),d(2),l()}if(i&2){let e=c(4).$implicit,t=c(2);a(),m("icon",t.icons.SHARED),a(),k(" ",e.counts.shares," ")}}function Jx(i,n){if(i&1&&(C(0,Xx,3,2,"span",29),C(1,Zx,3,2,"span",30)),i&2){let e=c(3).$implicit,t=c(2);x(e.counts!=null&&e.counts.roots?0:-1),a(),x(e.role===t.SPACE_ROLE.IS_MANAGER&&e.counts.shares?1:-1)}}function eS(i,n){if(i&1&&_(0,"app-badge-permissions",54),i&2){let e=c(4).$implicit;m("permissions",e.hPerms)}}function tS(i,n){if(i&1&&C(0,eS,1,1,"app-badge-permissions",54),i&2){let e=c(3).$implicit;x(e.permissions?0:-1)}}function iS(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(2).$implicit,t=c().$implicit;V(e.value.newly&&t[e.value.newly]?"badge prop-newly-"+t[e.value.newly]:""),a(),k(" ",t.hTimeAgo," ")}}function nS(i,n){if(i&1&&(s(0,"td"),C(1,Kx,7,4,"div",46)(2,Qx,3,0,"div",47)(3,Yx,1,1,"app-badge-members",48)(4,Jx,2,2)(5,tS,1,1)(6,iS,2,3,"span",49),l()),i&2){let e,t=c().$implicit;V(t.value.class),B("width",t.value.width,"%"),L("text-align-center",t.value.textCenter),a(),x((e=t.key)==="name"?1:e==="managers"?2:e==="members"?3:e==="info"?4:e==="permissions"?5:e==="modified"?6:-1)}}function oS(i,n){if(i&1&&C(0,nS,7,7,"td",45),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function rS(i,n){if(i&1){let e=y();s(0,"tr",44),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),D(1,oS,1,1,null,null,tm),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);L("disabled",!e.enabled)("selected",e.id===(t.selected==null?null:t.selected.id)),a(),M(E(3,4,t.tableHeaders,t.originalOrderKeyValue))}}function aS(i,n){if(i&1){let e=y();s(0,"table",37)(1,"thead")(2,"tr"),D(3,jx,1,1,null,null,tm),b(5,"keyvalue"),l()()(),s(6,"app-virtual-scroll",38),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),s(8,"table",37)(9,"tbody",39),D(10,rS,4,7,"tr",40,Jd),l()()()}if(i&2){let e=c();a(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",E(7,5,e.spaces,e.inputFilter.search())),a(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function sS(i,n){if(i&1&&(s(0,"span",55),_(1,"fa-icon",7),d(2,"New space"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faPlus)}}function lS(i,n){}function cS(i,n){if(i&1){let e=y();N(0,sS,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceDialog(!0))}),N(1,lS,0,0,"ng-template",17)}i&2&&(a(),m("divider",!0))}function pS(i,n){if(i&1&&(s(0,"span",55),_(1,"fa-icon",7),d(2,"Refresh"),l()),i&2){let e=c();a(),m("icon",e.icons.faArrowRotateRight)}}function dS(i,n){if(i&1&&(s(0,"span",55),_(1,"fa-icon",7),d(2,"Edit space"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faPen)}}function mS(i,n){if(i&1&&(s(0,"span",55),_(1,"fa-icon",7),d(2,"Edit children shares"),l()),i&2){let e=c(3);a(),m("icon",e.icons.SHARED)}}function uS(i,n){if(i&1){let e=y();N(0,mS,3,1,"ng-template",15),f("execute",function(){h(e);let o=c(2);return g(o.openChildShareDialog())})}}function _S(i,n){if(i&1){let e=y();N(0,dS,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceDialog())}),C(1,uS,1,0,null,16)}if(i&2){let e=c();a(),x(e.selected!=null&&e.selected.counts.shares?1:-1)}}function fS(i,n){if(i&1&&(s(0,"span",55),_(1,"fa-icon",7),d(2,"Manage my anchored files"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faAnchor)}}function hS(i,n){if(i&1){let e=y();N(0,fS,3,1,"ng-template",15),f("execute",function(){h(e);let o=c();return g(o.openSpaceRootsDialog())})}}function gS(i,n){}function CS(i,n){i&1&&N(0,gS,0,0,"ng-template",17),i&2&&m("divider",!0)}function xS(i,n){if(i&1&&(s(0,"span",55),_(1,"fa-icon",7),d(2,"Info"),l()),i&2){let e=c();a(),m("icon",e.icons.faCircleInfo)}}var im=(()=>{let n=class n{constructor(){this.locale=S(z),this.layout=S(I),this.SPACE_ROLE=vn,this.originalOrderKeyValue=Fe,this.TAB_MENU=fe,this.icons={SPACES:ie.SPACES,SHARED:ie.SHARED_WITH_OTHERS,faAnchor:ii,faArrowDown:ut,faArrowUp:pt,faRotate:bi,faArrowRotateRight:mt,faUpload:Yo,faPlus:et,faPen:dt,faCircleInfo:Rt},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},managers:{label:"Managers",width:10,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},members:{label:"Members",width:16,class:"d-none d-md-table-cell",textCenter:!1,show:!0},info:{label:"Info",width:15,textCenter:!0,class:"d-none d-md-table-cell",show:!0},permissions:{label:"Permissions",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",managers:"Managers",permissions:"Permissions",modified:"Modified"},this.loading=!1,this.spaces=[],this.selected=null,this.canCreateSpace=!1,this.canEditSpace=!1,this.canManageRoots=!1,this.router=S(Ce),this.activatedRoute=S(Mt),this.spacesService=S(it),this.store=S(te),this.userService=S(oe),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],managers:[{prop:"managers",type:"length"}],permissions:[{prop:"permissions",type:"length"}],modified:[{prop:"modified",type:"date"}]},this.sortTable=new Bt(this.constructor.name,this.sortSettings),this.loadSpaces(),this.canCreateSpace=this.userService.userHavePermission(_t.SPACES_ADMIN),this.layout.setBreadcrumbIcon(ie.SPACES),this.layout.setBreadcrumbNav({url:`/${G.SPACES}/${Lt.SPACES}`,translating:!0,sameLink:!0}),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select)}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadSpaces(){this.loading=!0,this.onSelect(),this.spacesService.listSpaces().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:t=>{this.spaces=[],this.loading=!1,this.layout.sendNotification("error","Spaces",t.error.message)}})}browse(t){t.enabled?this.router.navigate([G.FILES,t.alias],{relativeTo:this.activatedRoute}).catch(console.error):this.layout.sendNotification("warning",t.name,"Space is disabled")}onSelect(t=null){t?(this.selected=t,this.canEditSpace=!!t.managers.find(o=>o.id===this.userService.user.id),this.canManageRoots=this.canEditSpace||t.havePermission(We.SHARE_INSIDE)):(this.selected=null,this.canEditSpace=!1,this.canManageRoots=!1),this.store.spaceSelection.set(this.selected)}sortBy(t,o=!0,r){this.spaces=this.sortTable.sortBy(t,o,r||this.spaces)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}openSpaceDialog(t=!1){t?this.layout.openDialog(is,"xl").content.spaceChange.pipe(ce(1)).subscribe(r=>{let[p,u]=r;p==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.concat(u)),this.onSelect(u))}):this.selected&&this.canEditSpace&&this.spacesService.getSpace(this.selected.id).subscribe({next:o=>{this.layout.openDialog(is,"xl",{initialState:{space:o}}).content.spaceChange.pipe(ce(1)).subscribe(p=>{let[u,v]=p;u==="update"?(this.selected.name=v.name,this.selected.alias=v.alias,this.selected.description=v.description,this.selected.counts=Se(re({},v.counts),{shares:this.selected.counts.shares}),this.selected.modifiedAt=v.modifiedAt,this.selected.enabled=v.enabled,this.selected.managers=[...v.managers]):u==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.spaces.filter(T=>T.id!==v.id)))})},error:o=>this.layout.sendNotification("error","Edit space",this.selected.name,o)})}openSpaceRootsDialog(){setTimeout(()=>{this.layout.openDialog(ta,"md",{initialState:{space:this.selected,user:this.userService.user}})},this.selected?0:100)}openChildShareDialog(t){t&&this.onSelect(t),this.layout.openDialog(Ni,null,{initialState:{space:this.selected}}).content.sharesCountEvent.subscribe(r=>this.selected.counts.shares=r)}focusOn(t){let o=this.spaces.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces"]],viewQuery:function(o,r){if(o&1&&(Z(Ke,5),Z(Re,7),Z(st,7),Z(Rx,7),Z(Nx,7)),o&2){let p;j(p=K())&&(r.scrollView=p.first),j(p=K())&&(r.inputFilter=p.first),j(p=K())&&(r.btnNavigationView=p.first),j(p=K())&&(r.mainContextMenu=p.first),j(p=K())&&(r.targetContextMenu=p.first)}},decls:34,vars:37,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-default","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-default","me-1",3,"tooltip"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","disabled","tooltip"],[3,"icon"],[1,"ms-auto"],[1,"btn-group","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem",""],["contextMenuItem","",3,"divider"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","tooltip"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"disabled","selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],[1,"badge","bg-purple",3,"font-size"],[1,"label-bottom-left"],[1,"label-bottom-right"],[1,"badge","bg-primary","cursor-pointer","me-1"],[1,"badge","bg-purple","cursor-pointer","me-1"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events","text-file-name-preserve"],[1,"badge","bg-purple"],[3,"user","isMember","height","width","fontSize"],[1,"badge","bg-primary","cursor-pointer","me-1",3,"click"],[1,"badge","bg-purple","cursor-pointer","me-1",3,"click"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[1,"avatar-stack"],[3,"members"],[3,"class"],[1,"circle-primary-icon",3,"icon","fixedWidth"],[1,"d-flex","flex-column","text-truncate"],["draggable","false",1,"no-pointer-events","text-muted","fs-xs"],[3,"user","isMember","container"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,r){if(o&1){let p=y();s(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadSpaces())}),_(3,"fa-icon",4),l(),C(4,Vx,3,5,"button",5),s(5,"button",6),b(6,"translate"),f("click",function(){return h(p),g(r.openSpaceDialog())}),_(7,"fa-icon",7),l(),s(8,"button",6),b(9,"translate"),f("click",function(){return h(p),g(r.openChildShareDialog())}),_(10,"fa-icon",7),l(),s(11,"button",6),b(12,"translate"),f("click",function(){return h(p),g(r.openSpaceRootsDialog())}),_(13,"fa-icon",7),l(),s(14,"div",8)(15,"div",9),_(16,"app-input-filter",10),l(),s(17,"app-navigation-view",11),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(18,zx,6,8,"div",12)(19,aS,12,8),s(20,"div",13)(21,"span",14),d(22),b(23,"translate"),l()(),s(24,"context-menu",null,0),C(26,cS,2,1),N(27,pS,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.loadSpaces())}),l(),s(28,"context-menu",null,1),C(30,_S,2,1),C(31,hS,1,0,null,16),C(32,CS,1,1,null,17),N(33,xS,3,1,"ng-template",15),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l()}o&2&&(a(),m("tooltip",E(2,22,"Refresh",r.locale.language)),a(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),a(),x(r.canCreateSpace?4:-1),a(),m("disabled",!r.canEditSpace)("tooltip",E(6,25,"Edit space",r.locale.language)),a(2),m("icon",r.icons.faPen),a(),m("disabled",!r.canEditSpace||!(r.selected!=null&&r.selected.counts.shares))("tooltip",E(9,28,"Edit children shares",r.locale.language)),a(2),m("icon",r.icons.SHARED),a(),m("disabled",!r.canManageRoots)("tooltip",E(12,31,"Manage my anchored files",r.locale.language)),a(2),m("icon",r.icons.faAnchor),a(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),a(),x(r.galleryMode!=null&&r.galleryMode.enabled?18:19),a(4),ke("",r.spaces.length," ",E(23,34,"spaces",r.locale.language)),a(4),x(r.canCreateSpace?26:-1),a(4),x(r.canEditSpace?30:-1),a(),x(r.canManageRoots?31:-1),a(),x(r.canEditSpace||r.canManageRoots?32:-1))},dependencies:[P,F,qe,Ke,Ge,Me,Ot,Vt,Nt,st,Re,St,tt,ni,De,J,ht],encapsulation:2});let i=n;return i})();var ia=class{constructor(n){this.newly=0,this.isPersonal=!1,Object.assign(this,n),this.isPersonal=this.alias===ft.PERSONAL,this.hTimeAgo=Ai(this.mtime).fromNow(!0),this.newly=ir(this.mtime)}};var SS=["MainContextMenu"],vS=["TargetContextMenu"],nm=(i,n)=>n.id,om=(i,n)=>n.key;function yS(i,n){if(i&1&&(s(0,"span",25),d(1),l()),i&2){let e=c().$implicit,t=c(2);B("font-size",t.galleryMode.textSize,"px"),a(),w(e.hTimeAgo)}}function bS(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c().$implicit,t=c(2);k(" ",E(1,1,e.name,t.locale.language)," ")}}function wS(i,n){if(i&1&&d(0),i&2){let e=c().$implicit;k(" ",e.name," ")}}function TS(i,n){if(i&1){let e=y();s(0,"div",16),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),s(1,"div",17),_(2,"fa-icon",18),s(3,"span",19),C(4,yS,2,3,"span",20),l(),s(5,"span",21)(6,"span",22),d(7),l()()(),s(8,"div",23)(9,"span",24),C(10,bS,2,4)(11,wS,1,1),l()()()}if(i&2){let e=n.$implicit,t=n.$index,o=c(2);B("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),L("selected",e.id===(o.selected==null?null:o.selected.id)),a(),Xt("rowIndex",t),a(),B("min-width",o.galleryMode.image,"px")("min-height",o.galleryMode.image,"px")("font-size",o.galleryMode.faSize,"px"),m("icon",e.isPersonal?o.icons.PERSONAL:o.icons.SPACES),a(2),x(e.newly?4:-1),a(2),B("font-size",o.galleryMode.textSize,"px"),a(),w(e.nb),a(2),B("font-size",o.galleryMode.textSize,"px"),a(),x(e.isPersonal?10:11)}}function ES(i,n){if(i&1){let e=y();s(0,"div",9)(1,"app-virtual-scroll",13),b(2,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),s(3,"div",14),D(4,TS,12,21,"div",15,nm),l()()()}if(i&2){let e=c();a(),m("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",E(2,5,e.trashBins,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),a(3),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function AS(i,n){if(i&1&&_(0,"fa-icon",32),i&2){let e=c(4);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function kS(i,n){if(i&1){let e=y();s(0,"th",31),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.sortBy(o.key))}),d(1),C(2,AS,1,2,"fa-icon",32),l()}if(i&2){let e=c().$implicit,t=c(2);V(e.value.class),B("width",e.value.width,"%"),L("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),k(" ",e.value.label," "),a(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function DS(i,n){if(i&1&&C(0,kS,3,10,"th",30),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function MS(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c(4).$implicit,t=c(2);k(" ",E(1,1,e.name,t.locale.language)," ")}}function FS(i,n){if(i&1&&d(0),i&2){let e=c(4).$implicit;k(" ",e.name," ")}}function PS(i,n){if(i&1&&(s(0,"div",35),_(1,"fa-icon",18),s(2,"span",24),C(3,MS,2,4)(4,FS,1,1),l()()),i&2){let e=c(3).$implicit,t=c(2);a(),m("icon",e.isPersonal?t.icons.PERSONAL:t.icons.SPACES),a(2),x(e.isPersonal?3:4)}}function IS(i,n){if(i&1&&(s(0,"span",22),d(1),l()),i&2){let e=c(3).$implicit;a(),w(e.nb)}}function RS(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(2).$implicit,t=c().$implicit;V(e.value.newly&&t[e.value.newly]?"badge prop-newly-"+t[e.value.newly]:""),a(),k(" ",t.hTimeAgo," ")}}function NS(i,n){if(i&1&&(s(0,"td"),C(1,PS,5,2,"div",35)(2,IS,2,1,"span",22)(3,RS,2,3,"span",36),l()),i&2){let e,t=c().$implicit;V(t.value.class),B("width",t.value.width,"%"),L("text-align-center",t.value.textCenter),a(),x((e=t.key)==="name"?1:e==="nb"?2:e==="modified"?3:-1)}}function VS(i,n){if(i&1&&C(0,NS,4,7,"td",34),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function OS(i,n){if(i&1){let e=y();s(0,"tr",33),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c(2);return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c(2);return g(r.browse(o))}),D(1,VS,1,1,null,null,om),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c(2);L("selected",e.id===(t.selected==null?null:t.selected.id)),a(),M(E(3,2,t.tableHeaders,t.originalOrderKeyValue))}}function LS(i,n){if(i&1){let e=y();s(0,"table",26)(1,"thead")(2,"tr"),D(3,DS,1,1,null,null,om),b(5,"keyvalue"),l()()(),s(6,"app-virtual-scroll",27),b(7,"searchFilter"),f("contextmenu",function(o){h(e);let r=c();return g(r.onContextMenu(o))}),s(8,"table",26)(9,"tbody",28),D(10,OS,4,5,"tr",29,nm),l()()()}if(i&2){let e=c();a(3),M(E(5,2,e.tableHeaders,e.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",E(7,5,e.trashBins,e.inputFilter.search())),a(4),M(e.scrollView==null?null:e.scrollView.viewPortItems)}}function BS(i,n){if(i&1&&(s(0,"span",37),_(1,"fa-icon",38),d(2,"Refresh"),l()),i&2){let e=c();a(),m("icon",e.icons.faArrowRotateRight)}}function US(i,n){if(i&1&&(s(0,"span",37),_(1,"fa-icon",38),d(2,"Info"),l()),i&2){let e=c();a(),m("icon",e.icons.faCircleInfo)}}var rm=(()=>{let n=class n{constructor(){this.locale=S(z),this.layout=S(I),this.originalOrderKeyValue=Fe,this.icons={SPACES:ie.SPACES,PERSONAL:ie.PERSONAL,faArrowDown:ut,faArrowUp:pt,faArrowRotateRight:mt,faCircleInfo:Rt},this.TAB_MENU=fe,this.loading=!1,this.selected=null,this.trashBins=[],this.tableHeaders={name:{label:"Space",width:50,textCenter:!1,class:"",show:!0,sortable:!0},nb:{label:"Elements",width:10,textCenter:!0,class:"d-none d-md-table-cell",show:!0,sortable:!0},modified:{label:"Modified",width:10,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.btnSortFields={name:"Name",nb:"Elements",mtime:"Modified"},this.router=S(Ce),this.store=S(te),this.spacesService=S(it),this.sortSettings={default:[{prop:"isPersonal",type:"number"},{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],nb:[{prop:"nb",type:"number"}],modified:[{prop:"mtime",type:"date"}]},this.sortTable=new Bt(this.constructor.name,this.sortSettings),this.loadTrashBins(),this.layout.setBreadcrumbIcon(ie.TRASH),this.layout.setBreadcrumbNav({url:`/${G.TRASH}/${Lt.TRASH}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadTrashBins(){this.loading=!0,this.onSelect(),this.spacesService.listTrashBins().subscribe({next:t=>{this.sortBy(this.sortTable.sortParam.column,!1,t.map(o=>new ia(o))),this.loading=!1}})}onSelect(t=null){this.selected=t,this.store.trashSelection.set(this.selected)}sortBy(t,o=!0,r){this.trashBins=this.sortTable.sortBy(t,o,r||this.trashBins)}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}browse(t){this.router.navigate([G.SPACES_TRASH,t.alias]).catch(console.error)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-spaces-trash"]],viewQuery:function(o,r){if(o&1&&(Z(Ke,5),Z(Re,7),Z(st,7),Z(SS,7),Z(vS,7)),o&2){let p;j(p=K())&&(r.scrollView=p.first),j(p=K())&&(r.inputFilter=p.first),j(p=K())&&(r.btnNavigationView=p.first),j(p=K())&&(r.mainContextMenu=p.first),j(p=K())&&(r.targetContextMenu=p.first)}},decls:20,vars:14,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","tooltip"],[3,"icon","animation"],[1,"ms-auto"],[1,"btn-group","me-1"],[1,"d-none","d-sm-block"],[3,"sortBy","switchView","sortParams","sortFields"],[1,"app-thumbs"],["contextMenuItem","",3,"execute"],[1,"app-foot-menu"],[1,"mx-auto"],[3,"contextmenu","childHeight","childWidth","items","galleryMode","resizeOffset"],["tabindex","-1",1,"row","g-0"],[1,"card",3,"selected","height","width"],[1,"card",3,"click","contextmenu","appTap"],[1,"card-body"],[1,"circle-primary-icon",3,"icon"],[1,"label-top-right"],[1,"badge","bg-purple",3,"font-size"],[1,"label-bottom-right"],[1,"badge","bg-danger"],[1,"card-footer","text-center","text-truncate","p-1"],["draggable","false",1,"no-pointer-events","text-file-name-preserve"],[1,"badge","bg-purple"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center"],[3,"class"],["l10nTranslate",""],[3,"icon"]],template:function(o,r){if(o&1){let p=y();s(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.loadTrashBins())}),_(3,"fa-icon",4),l(),s(4,"div",5)(5,"div",6),_(6,"app-input-filter",7),l(),s(7,"app-navigation-view",8),f("sortBy",function(v){return h(p),g(r.sortBy(v))})("switchView",function(v){return h(p),g(r.galleryMode=v)}),l()()(),C(8,ES,6,8,"div",9)(9,LS,12,8),s(10,"context-menu",null,0),N(12,BS,3,1,"ng-template",10),f("execute",function(){return h(p),g(r.loadTrashBins())}),l(),s(13,"context-menu",null,1),N(15,US,3,1,"ng-template",10),f("execute",function(){return h(p),g(r.layout.showRSideBarTab(r.TAB_MENU.SELECTION))}),l(),s(16,"div",11)(17,"span",12),d(18),b(19,"translate"),l()()}o&2&&(a(),m("tooltip",E(2,8,"Refresh",r.locale.language)),a(2),m("icon",r.icons.faArrowRotateRight)("animation",r.loading?"spin":null),a(4),m("sortParams",r.sortTable.sortParam)("sortFields",r.btnSortFields),a(),x(r.galleryMode!=null&&r.galleryMode.enabled?8:9),a(10),ke("",r.trashBins.length," ",E(19,11,"trash bins",r.locale.language)))},dependencies:[F,st,Re,Ge,Me,Ke,P,Ot,Vt,Nt,tt,J,De,ht],encapsulation:2});let i=n;return i})();var Vi=i=>(S(te).repository.set(i.data.repository),i.url);var am=[{path:"",component:Yd,children:[{path:G.SPACES,pathMatch:"full",component:im,resolve:{routes:Vi},data:{repository:G.SPACES}},{path:G.TRASH,pathMatch:"full",component:rm,resolve:{routes:Vi},data:{repository:G.TRASHES}},{path:G.SHARED,pathMatch:"full",component:Pd,resolve:{routes:Vi},data:{repository:G.SHARED}},{path:G.LINKS,pathMatch:"full",component:fd,resolve:{routes:Vi},data:{repository:G.LINKS}},{path:G.SPACES_FILES,children:[{path:"**",component:ea,resolve:{routes:Vi},data:{repository:G.FILES}}]},{path:G.SPACES_SHARES,children:[{path:"**",component:ea,resolve:{routes:Vi},data:{repository:G.SHARES}}]},{path:G.SPACES_TRASH,children:[{path:"**",component:ea,resolve:{routes:Vi},data:{repository:G.TRASH}}]}]}];var sm=()=>S(oe).userHavePermission(_t.DESKTOP_APP),lm=()=>{let i=S(oe);return i.userHavePermission(_t.DESKTOP_APP_SYNC)&&!!i.user.clientId},cm=()=>{let i=S(ro),n=!!(i.wizard.localPath&&i.wizard.remotePath);return n||S(Ce).navigate([ye.BASE,ye.WIZARD,i.wizard.localPath?ye.WIZARD_SERVER:ye.WIZARD_CLIENT]).catch(console.error),n},pm=()=>{let n=!!S(ro).wizard.localPath;return n||S(Ce).navigate([ye.BASE,ye.WIZARD,ye.WIZARD_CLIENT]).catch(console.error),n};var dm=()=>S(ro).refreshPaths();var mm=[{path:ye.BASE,pathMatch:"prefix",canActivate:[lm],resolve:[dm],children:[{path:"",pathMatch:"full",redirectTo:ye.PATHS},{path:ye.PATHS,pathMatch:"full",loadComponent:()=>import("./chunk-5JA3DZWQ.js").then(i=>i.SyncPathsComponent)},{path:ye.TRANSFERS,pathMatch:"full",loadComponent:()=>import("./chunk-2XNPCG4F.js").then(i=>i.SyncTransfersComponent)},{path:ye.WIZARD,pathMatch:"full",redirectTo:`${ye.WIZARD}/${ye.WIZARD_CLIENT}`},{path:`${ye.WIZARD}/${ye.WIZARD_CLIENT}`,pathMatch:"full",loadComponent:()=>import("./chunk-HX6ZWXQD.js").then(i=>i.SyncWizardClientComponent)},{path:`${ye.WIZARD}/${ye.WIZARD_SERVER}`,canActivate:[pm],pathMatch:"full",loadComponent:()=>import("./chunk-TH4L5H6P.js").then(i=>i.SyncWizardServerComponent)},{path:`${ye.WIZARD}/${ye.WIZARD_SETTINGS}`,canActivate:[cm],pathMatch:"full",loadComponent:()=>import("./chunk-DFVVEGWC.js").then(i=>i.SyncWizardSettingsComponent)}]}];var Oi="webdav",ci={SERVER:oc,WEBDAV:Oi,PERSONAL:ft.PERSONAL,SPACES:ft.SPACES,SHARES:ft.SHARES,TRASH:ft.TRASH},cN={[ci.SERVER]:{route:"/",spaceRepository:null},[ci.WEBDAV]:{route:`/${Oi}`,spaceRepository:null},[ci.PERSONAL]:{route:`/${Oi}/${ci.PERSONAL}`,spaceRepository:[Jn.FILES,ft.PERSONAL]},[ci.SPACES]:{route:`/${Oi}/${ci.SPACES}`,spaceRepository:[Jn.FILES]},[ci.SHARES]:{route:`/${Oi}/${ci.SHARES}`,spaceRepository:[Jn.SHARES]},[ci.TRASH]:{route:`/${Oi}/${ci.TRASH}`,spaceRepository:[Jn.TRASH]}};function $S(i,n){if(i&1&&(s(0,"li",8),d(1),l()),i&2){let e=n.$implicit;a(),w(e)}}function HS(i,n){if(i&1){let e=y();s(0,"div",5),d(1," Keep these codes in a safe place. They will allow you to access your account if you lose access to your two-factor authentication. "),l(),s(2,"div",6),d(3," These recovery codes are for one-time use only and will only be displayed here once. "),l(),s(4,"ul",7),D(5,$S,2,1,"li",8,He),l(),s(7,"div",9)(8,"button",10),f("click",function(){h(e);let o=c();return g(o.downloadRecoveryCodes())}),d(9,"Download"),l(),s(10,"button",11),f("click",function(){h(e);let o=c();return g(o.clipBoardRecoveryCodes())}),d(11,"Copy"),l(),s(12,"button",12),f("click",function(){h(e);let o=c();return g(o.onClose(!0))}),d(13,"Close"),l()()}if(i&2){let e=c();a(5),M(e.recoveryCodes)}}function zS(i,n){if(i&1&&(s(0,"div",29),d(1),l()),i&2){let e=c(2);a(),w(e.hasError)}}function GS(i,n){if(i&1){let e=y();s(0,"div",13)(1,"div",14)(2,"div",15)(3,"div",3),d(4,"Scan this QR code using your authenticator app."),l(),s(5,"small",16),d(6,"(Such as FreeOTP, Proton Authenticator etc.)"),l()(),s(7,"div",15),_(8,"img",17),l(),s(9,"div",18),d(10,"Or enter this secret manually:"),l(),s(11,"div",19)(12,"div",20)(13,"div",21)(14,"a",22),f("click",function(){h(e);let o=c();return g(o.clipBoardSecret())}),_(15,"fa-icon",2),d(16),l()()()()()(),s(17,"div",19)(18,"div",14)(19,"form",23),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit())}),s(20,"div",24)(21,"label",25),d(22,"Enter your password"),l(),s(23,"app-input-password",26),f("passwordChange",function(o){h(e);let r=c();return g(r.twoFaForm.controls.password.setValue(o))}),l()(),s(24,"div",24)(25,"label",27),d(26,"Valid with your TOTP code"),l(),_(27,"input",28),l(),C(28,zS,2,1,"div",29),s(29,"div",30)(30,"button",12),f("click",function(){h(e);let o=c();return g(o.onClose())}),d(31,"Cancel"),l(),s(32,"button",31),d(33,"Confirm"),l()()()()()}if(i&2){let e=c();a(8),m("src",e.qrDataUrl,X),a(7),m("icon",e.icons.faCopy),a(),k(" ",e.secret," "),a(3),m("formGroup",e.twoFaForm),a(4),m("password",e.twoFaForm.value.password)("focus",!0)("centered",!0),a(4),m("maxlength",e.twoFaCodelength),a(),x(e.hasError?28:-1),a(4),m("disabled",e.twoFaForm.invalid||e.submitted)}}var um=(()=>{let n=class n{constructor(){this.isValid=new ae,this.wasEnabled=!1,this.submitted=!1,this.hasError=null,this.icons={faKey:Pt,faLock:ti,faCopy:xn},this.twoFaCodelength=ln,this.locale=S(z),this.layout=S(I),this.userService=S(oe),this.clipBoardService=S(An),this.fb=S(un),this.twoFaForm=this.fb.group({totpCode:this.fb.control("",[wt.required,wt.pattern(new RegExp(`^\\d{${ln}}$`))]),password:this.fb.control("")})}onClose(t=!1){this.layout.closeDialog(),this.isValid.emit(t)}onSubmit(){this.submitted=!0,this.userService.enable2Fa({code:this.twoFaForm.value.totpCode,password:this.twoFaForm.value.password}).subscribe({next:t=>{t.success?(this.wasEnabled=!0,this.recoveryCodes=t.recoveryCodes,this.isValid.emit(!0)):this.hasError="Invalid code",setTimeout(()=>this.submitted=!1,1e3)},error:t=>{this.hasError=t.error?t.error.message:t,setTimeout(()=>this.submitted=!1,1e3)}})}clipBoardSecret(){this.clipBoardService.copyFromContent(this.secret),this.layout.sendNotification("success","Two-Factor Authentication","Secret copied")}clipBoardRecoveryCodes(){this.clipBoardService.copyFromContent(this.recoveryCodes.join(`
4
+ `)),this.layout.sendNotification("success","Two-Factor Authentication","Recovery codes copied")}downloadRecoveryCodes(){let t=this.recoveryCodes.join(`
5
+ `),o=new Blob([t],{type:"text/plain;charset=utf-8"}),r=URL.createObjectURL(o);or(r,"sync-in.recovery-codes.txt"),URL.revokeObjectURL(r)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-auth-2fa-enable-dialog"]],inputs:{qrDataUrl:"qrDataUrl",secret:"secret"},outputs:{isValid:"isValid"},decls:8,vars:2,consts:[[1,"modal-header","align-items-center","justify-content-center"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],[1,"modal-body","modal-auth-verify-2fa","d-flex","flex-column","gap-3"],["l10nTranslate","",1,"alert","alert-primary","text-align-center","mb-0"],["l10nTranslate","",1,"alert","alert-warning","text-center","mb-0"],[1,"list-group","text-align-center","fs-sm"],[1,"list-group-item","font-monospace"],[1,"d-flex","w-100","pt-1","gap-2"],["type","button","l10nTranslate","",1,"btn","btn-primary","flex-fill",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-success","flex-fill",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-secondary","flex-fill",3,"click"],[1,"card","dialog-tab-card"],[1,"card-body","p-3"],[1,"text-center","mb-3"],["l10nTranslate","",1,"text-muted"],["alt","QR Code",1,"img-fluid","border","rounded","p-2",2,"max-width","150px",3,"src"],["l10nTranslate","",1,"text-center","mb-2"],[1,"card","dialog-check-card"],[1,"card-body","py-2","px-3"],[1,"d-flex","justify-content-center"],["role","button",1,"link-primary","text-decoration-none","font-monospace","fs-sm","cursor-pointer",3,"click"],[1,"d-flex","flex-column","gap-3","align-items-center",3,"ngSubmit","formGroup"],[1,"w-100",2,"max-width","360px"],["for","password","l10nTranslate","",1,"form-label","text-muted","text-uppercase","fs-sm","d-block","text-center","mb-2"],["id","password","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022",1,"d-block","w-100",3,"passwordChange","password","focus","centered"],["for","totp","l10nTranslate","",1,"form-label","text-muted","text-uppercase","fs-sm","d-block","text-center","mb-2"],["id","totp","type","text","formControlName","totpCode","placeholder","\u2022\u2022\u2022\u2022\u2022\u2022","inputmode","numeric","autocomplete","one-time-code","name","totp",1,"form-control","text-center","text-bold","font-monospace","w-100",3,"maxlength"],["l10nTranslate","",1,"alert","alert-danger","py-2","mb-0","text-center"],[1,"d-flex","gap-2","pt-1","w-100"],["type","submit","l10nTranslate","",1,"btn","btn-primary","flex-fill",3,"disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span",3),d(4,"Two-Factor Authentication"),l()()(),s(5,"div",4),C(6,HS,14,0)(7,GS,34,10),l()),o&2&&(a(2),m("icon",r.icons.faLock),a(4),x(r.wasEnabled?6:7))},dependencies:[F,P,yi,pn,ze,xe,cn,Fo,dn,mn,sr],encapsulation:2});let i=n;return i})();var na=(function(i){return i.WEBDAV="webdav",i.CLIENT="client",i})(na||{});var WS=i=>({dateInputFormat:"YYYY-MM-DD",containerClass:"theme-dark-blue",returnFocusToInput:!0,minDate:i,showWeekNumbers:!1}),jS=(i,n)=>n.name;function KS(i,n){if(i&1&&(s(0,"option",17),d(1),b(2,"capitalize"),l()),i&2){let e=n.$implicit;m("value",e),a(),w($(2,2,e))}}function qS(i,n){if(i&1&&(s(0,"div",22),d(1),l()),i&2){let e=c();a(),k(" ",e.hasError," ")}}function QS(i,n){i&1&&(s(0,"div",23),d(1," This password will only be shown once after it is generated "),l())}function YS(i,n){if(i&1&&(d(0),b(1,"amDateFormat")),i&2){let e=c(2);k(" ",E(1,1,e.generatedPassword.expiration,"L")," ")}}function XS(i,n){if(i&1&&(d(0),b(1,"translate")),i&2){let e=c(2);k(" ",E(1,1,"never",e.locale.language)," ")}}function ZS(i,n){if(i&1){let e=y();s(0,"div",26)(1,"div",8)(2,"div",29),_(3,"fa-icon",30),s(4,"span",3),d(5,"Password generated"),l()(),s(6,"div",31)(7,"div",12)(8,"div",32)(9,"div",33)(10,"div",34),d(11,"Password name"),l(),s(12,"div",35),d(13),l()()()(),s(14,"div",12)(15,"div",32)(16,"div",33)(17,"div",34),d(18,"Application"),l(),s(19,"div",35),d(20),b(21,"translate"),l()()()(),s(22,"div",12)(23,"div",32)(24,"div",33)(25,"div",34),d(26,"Expiration"),l(),s(27,"div",35),C(28,YS,2,4)(29,XS,2,4),l()()()()(),s(30,"div",36)(31,"div",33)(32,"div",37)(33,"div",38),d(34,"Generated password"),l(),s(35,"div",39),d(36),l(),s(37,"button",40),f("click",function(){h(e);let o=c();return g(o.clipBoardPassword())}),_(38,"fa-icon",41),s(39,"span",3),d(40,"Copy"),l()()()()()()()}if(i&2){let e=c();a(3),m("icon",e.icons.faKey),a(10),w(e.generatedPassword.name),a(7),w(E(21,6,e.generatedPassword.app,e.locale.language)),a(8),x(e.generatedPassword.expiration?28:29),a(8),w(e.generatedPassword.password),a(2),m("icon",e.icons.faCopy)}}function JS(i,n){if(i&1&&(s(0,"div"),d(1),b(2,"amDateFormat"),l()),i&2){let e=c().$implicit;a(),w($(2,1,e.lastAccess))}}function ev(i,n){if(i&1&&(s(0,"div"),d(1),l()),i&2){let e=c().$implicit;a(),w(e.lastIp)}}function tv(i,n){if(i&1){let e=y();s(0,"div",36)(1,"div",45)(2,"div",46)(3,"div",37)(4,"span",47),d(5),l(),s(6,"span",48),d(7),b(8,"translate"),l()(),s(9,"button",49),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.deleteAppPassword(o.name))}),d(10,"Delete"),l()(),s(11,"div",50)(12,"div",12)(13,"div",51),d(14,"Access"),l(),s(15,"div"),d(16),b(17,"amDateFormat"),l(),C(18,JS,3,3,"div"),l(),s(19,"div",52)(20,"div",53),d(21,"IP"),l(),s(22,"div"),d(23),l(),C(24,ev,2,1,"div"),l(),s(25,"div",54)(26,"div",51),d(27,"Expiration"),l(),s(28,"div"),d(29),b(30,"amDateFormat"),b(31,"translate"),l()(),s(32,"div",52)(33,"div",51),d(34,"Created"),l(),s(35,"div"),d(36),b(37,"amDateFormat"),l()()()()()}if(i&2){let e=n.$implicit,t=c(2);a(5),w(e.name),a(2),w(E(8,8,e.app,t.locale.language)),a(9),w(e.currentAccess?$(17,11,e.currentAccess):"-"),a(2),x(e.lastAccess?18:-1),a(5),w(e.currentIp||"-"),a(),x(e.lastIp?24:-1),a(5),w(e.expiration?E(30,13,e.expiration,"L"):E(31,16,"never",t.locale.language)),a(7),w($(37,19,e.createdAt))}}function iv(i,n){if(i&1&&(s(0,"div",7)(1,"div",42)(2,"div",43)(3,"span",3),d(4,"Existing passwords"),l(),s(5,"span",44),d(6),l()(),D(7,tv,38,21,"div",36,jS),l()()),i&2){let e=c();a(6),w(e.appPasswords.length),a(),M(e.appPasswords)}}function nv(i,n){i&1&&(s(0,"div",7)(1,"div",55),d(2," No application password "),l()())}var _m=(()=>{let n=class n{constructor(){this.appPasswords=[],this.nbAppPasswords=new ae,this.locale=S(z),this.availableApps=Object.values(na),this.minDate=ac(),this.submitted=!1,this.icons={faKey:Pt,faCopy:xn},this.fb=S(un),this.appPasswordForm=this.fb.group({name:this.fb.control("",[wt.required]),app:this.fb.control(na.WEBDAV,[wt.required]),expiration:this.fb.control(null)}),this.layout=S(I),this.userService=S(oe),this.clipBoardService=S(An),this.minDate.setDate(this.minDate.getDate()+1),this.appPasswordForm.controls.name.valueChanges.pipe(At(Boolean)).subscribe(t=>{this.hasError=void 0,this.appPasswordForm.controls.name.setValue(lc(t),{emitEvent:!1})})}onClose(){this.layout.closeDialog()}deleteAppPassword(t){this.userService.deleteAppPassword(t).subscribe({next:()=>{this.appPasswords=this.appPasswords.filter(o=>o.name!==t),this.nbAppPasswords.emit(this.appPasswords.length)},error:o=>this.layout.sendNotification("error","Application Passwords","Unable to revoke",o)})}genAppPassword(){return yt(this,null,function*(){for(let o of this.appPasswords)if(o.name===this.appPasswordForm.value.name){this.hasError="This name is already used";return}let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.generateAppPassword(this.appPasswordForm.value,t).subscribe({next:o=>{this.appPasswordForm.patchValue({name:"",expiration:null}),this.appPasswords.unshift(o),this.generatedPassword=o,this.nbAppPasswords.emit(this.appPasswords.length)},error:o=>this.layout.sendNotification("error","Application Passwords","Unable to generate",o)})})}clipBoardPassword(){this.clipBoardService.copyFromContent(this.generatedPassword.password),this.layout.sendNotification("success","Generated password","Copied")}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-auth-manage-app-passwords"]],inputs:{appPasswords:"appPasswords"},outputs:{nbAppPasswords:"nbAppPasswords"},decls:44,vars:19,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"d-flex","flex-column","gap-3"],[1,"card","dialog-tab-card"],[1,"card-body","p-3"],[1,"d-flex","align-items-center","text-muted","text-uppercase","fs-sm","text-bold","mb-3"],[3,"ngSubmit","formGroup"],[1,"row","g-2"],[1,"col-12","col-md-4"],["for","name","l10nTranslate","",1,"form-label"],["appAutofocus","","id","name","name","name","formControlName","name","type","text","required","",1,"form-control",3,"placeholder"],["for","app","l10nTranslate","",1,"form-label"],["id","app","formControlName","app",1,"form-select"],["l10nTranslate","",3,"value"],["for","expiration","l10nTranslate","",1,"form-label"],["bsDatepicker","","id","expiration","formControlName","expiration","placement","bottom","type","text",1,"form-control",3,"placeholder","bsConfig"],[1,"col-12","col-md-9","d-flex","align-items-end"],[1,"w-100"],["l10nTranslate","",1,"alert","alert-danger","py-2","px-3","mb-0","text-center"],["l10nTranslate","",1,"alert","alert-secondary","py-2","px-3","mb-0","text-center"],[1,"col-12","col-md-3","d-flex","align-items-end"],["type","submit","l10nTranslate","",1,"btn","btn-primary","ms-auto",3,"disabled"],[1,"card","dialog-check-card","border-success-subtle","bg-success-subtle"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary",3,"click"],[1,"d-flex","align-items-center","text-success-emphasis","text-uppercase","fs-sm","text-bold","mb-2"],[1,"me-2",3,"icon"],[1,"row","g-2","mb-2"],[1,"card","dialog-check-card","h-100"],[1,"card-body","py-2","px-3"],["l10nTranslate","",1,"text-muted","text-uppercase","fs-sm","mb-1"],[1,"fs-sm"],[1,"card","dialog-check-card"],[1,"d-flex","align-items-center","gap-2"],["l10nTranslate","",1,"text-muted","text-uppercase","fs-sm","flex-shrink-0"],[1,"font-monospace","fs-sm","text-center","flex-grow-1","text-truncate","px-2"],["type","button",1,"btn","btn-outline-success","flex-shrink-0",3,"click"],[1,"me-1",3,"icon"],[1,"card-body","p-2","d-flex","flex-column","gap-2"],[1,"d-flex","align-items-center","text-muted","text-uppercase","fs-sm","text-bold","px-1","pt-1"],[1,"badge","bg-secondary","ms-auto"],[1,"card-body","p-2"],[1,"d-flex","align-items-center","justify-content-between","gap-2","flex-wrap","mb-2"],[1,"text-bold","fs-sm"],[1,"badge","bg-success"],["l10nTranslate","",1,"btn","btn-outline-danger",3,"click"],[1,"row","g-2","fs-sm"],["l10nTranslate","",1,"text-muted","text-uppercase","text-bold"],[1,"col-12","col-md-3"],[1,"text-muted","text-uppercase","text-bold"],[1,"col-12","col-md-2"],["l10nTranslate","",1,"card-body","text-center","text-muted","py-4"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span",3),d(4,"Manage app passwords"),l()(),s(5,"button",4),f("click",function(){return r.onClose()}),l()(),s(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8)(10,"div",9)(11,"span",3),d(12,"Generate a new app password"),l()(),s(13,"form",10),f("ngSubmit",function(){return r.genAppPassword()}),s(14,"div",11)(15,"div",12)(16,"label",13),d(17,"Password name"),l(),_(18,"input",14),b(19,"translate"),l(),s(20,"div",12)(21,"label",15),d(22,"Application"),l(),s(23,"select",16),D(24,KS,3,4,"option",17,He),l()(),s(26,"div",12)(27,"label",18),d(28,"Expiration"),l(),_(29,"input",19),b(30,"translate"),l(),s(31,"div",20)(32,"div",21),C(33,qS,2,1,"div",22)(34,QS,2,0,"div",23),l()(),s(35,"div",24)(36,"button",25),d(37," Generate "),l()()()()()(),C(38,ZS,41,9,"div",26),C(39,iv,9,1,"div",7)(40,nv,3,0,"div",7),l()(),s(41,"div",27)(42,"button",28),f("click",function(){return r.onClose()}),d(43,"Close"),l()()),o&2&&(a(2),m("icon",r.icons.faKey),a(11),m("formGroup",r.appPasswordForm),a(5),L("is-invalid",r.appPasswordForm.controls.name.invalid),m("placeholder",E(19,11,"Password name",r.locale.language)),a(6),M(r.availableApps),a(5),m("placeholder",E(30,14,"Never expires",r.locale.language))("bsConfig",Je(17,WS,r.minDate)),a(4),x(r.hasError?33:34),a(3),m("disabled",r.appPasswordForm.invalid||r.submitted),a(2),x(r.generatedPassword?38:-1),a(),x(r.appPasswords.length?39:40))},dependencies:[F,P,je,rl,al,yi,pn,Si,vi,ze,xi,xe,cn,Jt,dn,mn,Pe,J,ki],encapsulation:2});let i=n;return i})();var ov=(i,n)=>n.key;function rv(i,n){if(i&1&&(s(0,"option",15),d(1),b(2,"translate"),b(3,"capitalize"),l()),i&2){let e=n.$implicit,t=c(2);m("ngValue",t.allOnlineStatus.indexOf(e)),a(),k(" ",$(3,5,E(2,2,e,t.locale.language))," ")}}function av(i,n){if(i&1&&(s(0,"span",38),_(1,"fa-icon",27),s(2,"span",41),d(3,"Administrator"),l()()),i&2){let e=c(3);a(),m("icon",e.icons.faKey)}}function sv(i,n){if(i&1&&(s(0,"span",42),d(1),l()),i&2){let e=n.$implicit;a(),w(e)}}function lv(i,n){if(i&1&&D(0,sv,2,1,"span",42,He),i&2){let e=c(3);M(e.user.applications)}}function cv(i,n){if(i&1&&(s(0,"div",17)(1,"label",18),d(2,"Permissions"),l(),s(3,"div",20),C(4,av,4,1,"span",38)(5,lv,2,0),l()(),s(6,"div",17)(7,"label",18),d(8,"Storage Space"),l(),s(9,"div",39),_(10,"app-storage-usage",40),l()()),i&2){let e=c(2);a(4),x(e.user.isAdmin?4:5),a(6),m("item",e.user)}}function pv(i,n){if(i&1&&(s(0,"option",15),d(1),l()),i&2){let e=n.$implicit;m("ngValue",e.value),a(),w(e.key)}}function dv(i,n){if(i&1){let e=y();s(0,"div",43)(1,"label",44),d(2,"Document editor"),l(),s(3,"div",45)(4,"select",46),f("ngModelChange",function(o){h(e);let r=c(2);return g(r.updateEditorPreference(o))}),s(5,"option",37),d(6,"Ask Me"),l(),D(7,pv,2,2,"option",15,ov),b(9,"keyvalue"),l()()(),s(10,"div",47),d(11," Used when both editors support the file type. "),l()}if(i&2){let e=c(2);a(4),m("ngModel",e.userEditorPreference),a(),m("ngValue",null),a(2),M(E(9,2,e.editors,e.originalOrderKeyValue))}}function mv(i,n){if(i&1){let e=y();s(0,"div",29)(1,"div",48)(2,"div",49),f("click",function(){h(e);let o=c(2);return g(o.updateStorageIndexing(!o.user.storageIndexing))}),s(3,"div",50)(4,"div",51)(5,"label",52),d(6,"Full-text search"),l(),s(7,"div",53)(8,"label",54),f("click",function(o){return h(e),g(o.stopPropagation())}),l(),s(9,"input",55),f("ngModelChange",function(o){h(e);let r=c(2);return g(r.updateStorageIndexing(o))})("click",function(o){return h(e),g(o.stopPropagation())}),l()()(),s(10,"div",56),d(11," Enable content indexation for personal files. "),l()()()()()}if(i&2){let e=c(2);a(2),L("dialog-check-card--active",e.user.storageIndexing),a(7),m("ngModel",e.user.storageIndexing)}}function uv(i,n){if(i&1){let e=y();s(0,"div",31)(1,"label",57),d(2,"Avatar"),l(),s(3,"div",33)(4,"div",58)(5,"button",59),f("click",function(){h(e);let o=c(2);return g(o.genAvatar())}),d(6,"Generate"),l(),s(7,"button",60)(8,"span",41),d(9,"Import"),l(),s(10,"input",61),f("change",function(o){h(e);let r=c(2);return g(r.uploadAvatar(o))}),l()()()()()}}function _v(i,n){if(i&1&&(s(0,"option",15),d(1),l()),i&2){let e=n.$implicit,t=c(2);m("ngValue",e),a(),w(t.i18nLanguageText[e])}}function fv(i,n){if(i&1&&(s(0,"option",37),d(1),l()),i&2){let e=n.$implicit,t=c(2);m("ngValue",t.allNotifications.indexOf(e)),a(),w(e)}}function hv(i,n){if(i&1&&(s(0,"div",64),_(1,"app-password-strength-bar",79),l()),i&2){let e=c(3);a(),m("passwordToCheck",e.newPassword)}}function gv(i,n){if(i&1){let e=y();s(0,"button",80),f("click",function(){h(e);let o=c(3);return g(o.disable2Fa())}),d(1," Disable "),l()}if(i&2){let e=c(3);m("disabled",!e.store.server().twoFaEnabled)}}function Cv(i,n){if(i&1&&(s(0,"div",78)(1,"span",41),d(2,"Manage"),l(),s(3,"span",81),d(4),l()()),i&2){let e=c(3);a(4),w(e.user.appPasswords)}}function xv(i,n){i&1&&(s(0,"span",41),d(1,"Generate"),l())}function Sv(i,n){if(i&1){let e=y();s(0,"div",4)(1,"div",5)(2,"div",62)(3,"div",63),d(4,"Password"),l(),C(5,hv,2,1,"div",64),l(),s(6,"div",30)(7,"div",31)(8,"label",65),d(9),b(10,"translate"),b(11,"capitalize"),l(),s(12,"div",33)(13,"app-input-password",66),_e("passwordChange",function(o){h(e);let r=c(2);return ue(r.oldPassword,o)||(r.oldPassword=o),g(o)}),l()()(),s(14,"div",31)(15,"label",65),d(16),b(17,"translate"),b(18,"capitalize"),l(),s(19,"div",33)(20,"app-input-password",67),_e("passwordChange",function(o){h(e);let r=c(2);return ue(r.newPassword,o)||(r.newPassword=o),g(o)}),l()()(),s(21,"div",68)(22,"div",69)(23,"button",70),f("click",function(){h(e);let o=c(2);return g(o.submitPassword())}),d(24," Update "),l()()()()()(),s(25,"div",71)(26,"div",5)(27,"div",28),d(28,"Security"),l(),s(29,"div",72)(30,"div",31)(31,"label",57),d(32,"Two-Factor Authentication"),l(),s(33,"div",73)(34,"button",74),f("click",function(){h(e);let o=c(2);return g(o.enable2Fa())}),d(35),l(),C(36,gv,2,1,"button",75),l()(),s(37,"div",31)(38,"label",57),d(39,"Application Passwords"),l(),s(40,"div",76)(41,"button",77),f("click",function(){h(e);let o=c(2);return g(o.manageAppPasswords())}),C(42,Cv,5,1,"div",78)(43,xv,2,0,"span",41),l()()()()()()}if(i&2){let e=c(2);a(5),x(e.newPassword?5:-1),a(4),w($(11,17,E(10,14,"current password",e.locale.language))),a(4),me("password",e.oldPassword),a(3),w($(18,22,E(17,19,"new password",e.locale.language))),a(4),me("password",e.newPassword),m("disabled",!(e.oldPassword!=null&&e.oldPassword.length))("isRequired",!!(e.oldPassword!=null&&e.oldPassword.length))("passwordMinLength",e.passwordMinLength)("showGenerator",!0),a(3),m("disabled",!e.newPassword||!e.oldPassword||e.newPassword.length<e.passwordMinLength),a(11),m("disabled",!e.store.server().twoFaEnabled),a(),k(" ",e.user.twoFaEnabled?"Reset":"Enable"," "),a(),x(e.user.twoFaEnabled?36:-1),a(6),x(e.user.appPasswords>0?42:43)}}function vv(i,n){if(i&1){let e=y();s(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"div",6)(5,"div",7)(6,"div",8),_(7,"img",9)(8,"span"),l()(),s(9,"div",10)(10,"div",11),d(11),l(),s(12,"div",12),d(13),l(),s(14,"div",13),d(15),b(16,"translate"),b(17,"amTimeAgo"),l(),s(18,"select",14),_e("ngModelChange",function(o){h(e);let r=c();return ue(r.user.onlineStatus,o)||(r.user.onlineStatus=o),g(o)}),f("ngModelChange",function(o){h(e);let r=c();return g(r.setOnlineStatus(o))}),D(19,rv,4,7,"option",15,He),l()()(),s(21,"div")(22,"div",16)(23,"div",17)(24,"label",18),d(25,"Login"),l(),s(26,"span",19),d(27),l()(),s(28,"div",17)(29,"label",18),d(30,"IP Addresses"),l(),s(31,"div",20)(32,"span",21),d(33),l(),s(34,"span",22),d(35),l()()(),s(36,"div",17)(37,"label",18),d(38,"Connections"),l(),s(39,"div",20)(40,"span",21),d(41),b(42,"amDateFormat"),l(),s(43,"span",22),d(44),b(45,"amDateFormat"),l()()(),C(46,cv,11,2),s(47,"div",23)(48,"label",24),d(49,"WebDAV"),l(),s(50,"div",25)(51,"span",26),f("click",function(){h(e);let o=c();return g(o.clipBoardLink())}),_(52,"fa-icon",27),d(53),l()()()()()()(),s(54,"div",4)(55,"div",5)(56,"div",28),d(57,"Preferences"),l(),C(58,dv,12,5),C(59,mv,12,3,"div",29),l()()(),s(60,"div",3)(61,"div",4)(62,"div",5)(63,"div",28),d(64,"Configuration"),l(),s(65,"div",30),C(66,uv,11,0,"div",31),s(67,"div",31)(68,"label",32),d(69,"Language"),l(),s(70,"div",33)(71,"select",34),_e("ngModelChange",function(o){h(e);let r=c();return ue(r.language,o)||(r.language=o),g(o)}),D(72,_v,2,2,"option",15,He),l()()(),s(74,"div",31)(75,"label",35),d(76,"Notification"),l(),s(77,"div",33)(78,"select",36),f("ngModelChange",function(o){h(e);let r=c();return g(r.updateNotification(o))}),D(79,fv,2,2,"option",37,He),l()()()()()(),C(81,Sv,44,24),l()()}if(i&2){let e=c();a(7),m("src",e.userAvatar,X),a(),V(q("avatar-",e.allOnlineStatus[e.user.onlineStatus])),a(3),w(e.user.fullName),a(2),w(e.user.email),a(2),ke(" ",E(16,24,"Member since",e.locale.language)," ",E(17,27,e.user.createdAt,!0)," "),a(3),me("ngModel",e.user.onlineStatus),a(),M(e.allOnlineStatus),a(8),w(e.user.login),a(6),w(e.user.currentIp),a(2),w(e.user.lastIp),a(6),w($(42,30,e.user.currentAccess)),a(3),w($(45,32,e.user.lastAccess)),a(2),x(e.user.isUser?46:-1),a(5),m("title",e.webdavUrl),a(),m("icon",e.icons.faCopy),a(),k(" ",e.webdavUrl," "),a(5),x(e.showEditorPreference?58:-1),a(),x(e.user.isUser?59:-1),a(7),x(e.user.isUser?66:-1),a(5),me("ngModel",e.language),a(),M(e.languages),a(6),m("ngModel",e.user.notification),a(),M(e.allNotifications),a(2),x(e.user.isUser?81:-1)}}var fm=(()=>{let n=class n{constructor(){this.locale=S(z),this.i18nLanguageText=ql,this.allNotifications=Object.values(jl),this.allOnlineStatus=Ei,this.passwordMinLength=8,this.icons={faCopy:xn,faKey:Pt},this.editors={[Pc]:"collabora",[Ic]:"onlyoffice"},this.userAvatar=null,this.webdavUrl=`${window.location.origin}/${Oi}`,this.store=S(te),this.showEditorPreference=!1,this.originalOrderKeyValue=Fe,this.layout=S(I),this.languages=this.layout.getLanguages(!0),this.userService=S(oe),this.clipBoardService=S(An),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t)),this.layout.setBreadcrumbIcon(Wt.ACCOUNT),this.layout.setBreadcrumbNav({url:`/${Ee.BASE}/${Ee.ACCOUNT}/${ji.ACCOUNT}`,splicing:2,translating:!0,sameLink:!0}),this.showEditorPreference=this.store.server().fileEditors.collabora&&this.store.server().fileEditors.onlyoffice,this.showEditorPreference&&(this.userEditorPreference=this.userService.getEditorProviderPreference())}get language(){return this.user?.language||ha}set language(t){t===ha&&(t=null),this.userService.changeLanguage({language:t}).subscribe({next:()=>this.updateLanguage(t),error:()=>this.layout.sendNotification("error","Configuration","Unable to update language")})}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}setOnlineStatus(t){this.userService.changeOnlineStatus(t)}genAvatar(){this.userService.genAvatar()}uploadAvatar(t){this.userService.uploadAvatar(t.target.files[0])}submitPassword(){return yt(this,null,function*(){if(!this.oldPassword){this.layout.sendNotification("error","Configuration","Current password missing !");return}if(!this.newPassword){this.layout.sendNotification("error","Configuration","New password missing !");return}if(this.newPassword.length<8){this.layout.sendNotification("warning","Configuration","New password must have 8 characters minimum");return}let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.changePassword({oldPassword:this.oldPassword,newPassword:this.newPassword},t).subscribe({next:()=>{this.oldPassword="",this.newPassword="",this.layout.sendNotification("info","Configuration","Password has been updated")},error:o=>{this.oldPassword="",o.status===403?this.layout.sendNotification("error","Configuration","Unable to update password",o):this.layout.sendNotification("warning","Configuration","Current password does not match")}})})}updateNotification(t){this.userService.changeNotification({notification:t}).subscribe({next:()=>{this.user.notification=t,this.layout.sendNotification("info","Configuration","Notification preference updated")},error:o=>this.layout.sendNotification("error","Configuration","Unable to update notification preference",o)})}updateStorageIndexing(t){this.userService.changeStorageIndexing({storageIndexing:t}).subscribe({next:()=>{this.user.storageIndexing=t,this.layout.sendNotification("info","Configuration","Full-text search preference updated")},error:o=>this.layout.sendNotification("error","Configuration","Unable to update full-text search preference",o)})}clipBoardLink(){this.clipBoardService.copyFromContent(this.webdavUrl),this.layout.sendNotification("info","Link copied",this.webdavUrl)}updateEditorPreference(t){this.userService.setEditorProviderPreference(t)}enable2Fa(){return yt(this,null,function*(){this.userService.init2Fa().subscribe({next:t=>{this.layout.openDialog(um,"xs",{initialState:{qrDataUrl:t.qrDataUrl,secret:t.secret}},{keyboard:!1}).content.isValid.pipe(At(r=>r),ce(1)).subscribe(()=>{this.layout.sendNotification("success","Configuration","Two-Factor Authentication is enabled"),this.store.user.next(Se(re({},this.store.user.getValue()),{twoFaEnabled:!0}))})},error:t=>this.layout.sendNotification("error","Configuration","Two-Factor Authentication",t)})})}disable2Fa(){return yt(this,null,function*(){let t=yield this.userService.auth2FaVerifyDialog(!0);t&&this.userService.disable2Fa({code:t.get(Zs),password:t.get(Js)}).subscribe({next:()=>{this.layout.sendNotification("success","Configuration","Two-Factor Authentication is disabled"),this.store.user.next(Se(re({},this.store.user.getValue()),{twoFaEnabled:!1}))},error:o=>{this.layout.sendNotification("error","Configuration","Two-Factor Authentication",o)}})})}manageAppPasswords(){return yt(this,null,function*(){let t=yield this.userService.auth2FaVerifyDialog();t!==!1&&this.userService.listAppPasswords(t).subscribe({next:o=>{this.layout.openDialog(_m,"md",{initialState:{appPasswords:o}}).content.nbAppPasswords.subscribe(p=>{this.store.user.next(Se(re({},this.store.user.getValue()),{appPasswords:p}))})},error:o=>this.layout.sendNotification("error","Configuration","Unable to get app passwords",o)})})}updateLanguage(t){this.user.language=t,this.layout.setLanguage(t).then(()=>this.layout.sendNotification("info","Configuration","Language updated"))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-account"]],decls:3,vars:2,consts:[["appAutoResize","",1,"profile-page",3,"resizeOffset"],[1,"container-fluid","p-2"],[1,"row","g-3"],[1,"col-12","col-lg-6","d-flex","flex-column","gap-3"],[1,"card","dialog-tab-card"],[1,"card-body"],[1,"user-header","p-0"],[1,"d-flex","flex-column","justify-content-center"],[1,"avatar-xl"],["alt","",1,"avatar-img","profile-user-img",3,"src"],[1,"user-details"],[1,"mb-1"],[1,"mb-2","fs-sm","text-nowrap"],[1,"text-muted","fs-sm"],[1,"form-select","my-auto","mt-2",3,"ngModelChange","ngModel"],[3,"ngValue"],[1,"px-1","mt-4"],[1,"row","g-2","align-items-center","py-2","border-bottom","border-secondary-subtle"],["for","","l10nTranslate","",1,"col-5","col-sm-4"],[1,"col-7","col-sm-8","text-end"],[1,"col-7","col-sm-8","d-flex","flex-wrap","justify-content-end"],[1,"badge","bg-warning"],[1,"badge","bg-secondary-alt","ms-1"],[1,"row","g-2","align-items-center","pt-2"],["for","",1,"col-5","col-sm-4"],[1,"col-7","col-sm-8","text-end","text-truncate"],[1,"badge","bg-primary","d-inline-flex","align-items-center","gap-1","cursor-pointer",3,"click","title"],[3,"icon"],["l10nTranslate","",1,"text-muted","text-uppercase","fs-sm","text-bold","mb-2"],[1,"row","g-0"],[1,"d-flex","flex-column","gap-2"],[1,"row","g-2","align-items-center"],["for","userLanguage","l10nTranslate","",1,"form-label","col-12","col-md-6","mb-0"],[1,"col-12","col-md-6"],["id","userLanguage",1,"form-select",3,"ngModelChange","ngModel"],["for","userNotification","l10nTranslate","",1,"form-label","col-12","col-md-6","mb-0"],["id","userNotification",1,"form-select",3,"ngModelChange","ngModel"],["l10nTranslate","",3,"ngValue"],[1,"badge","bg-purple"],[1,"col-7","col-sm-8","d-flex","justify-content-end"],[1,"w-100",2,"max-width","18rem",3,"item"],["l10nTranslate",""],["l10nTranslate","",1,"badge","bg-purple","m-1"],[1,"row","g-2","align-items-center","mb-2"],["for","","l10nTranslate","",1,"col-12","col-sm-6"],[1,"col-12","col-sm-6"],[1,"form-select",3,"ngModelChange","ngModel"],["l10nTranslate","",1,"text-muted","fs-sm","mb-3"],[1,"col-12"],[1,"card","dialog-check-card","dialog-check-card--interactive",3,"click"],[1,"card-body","p-2"],[1,"d-flex","align-items-center","cursor-pointer"],["for","prefSwitchFullText","l10nTranslate","",1,"form-label","me-auto","text-nowrap"],[1,"d-flex","align-items-center","form-check","form-switch","ps-0","mb-0"],["for","prefSwitchFullText",1,"form-check-label",3,"click"],["id","prefSwitchFullText","type","checkbox","role","button",1,"form-check-input","ms-2",3,"ngModelChange","click","ngModel"],["l10nTranslate","",1,"text-muted","fs-sm","mt-2","px-1"],["for","","l10nTranslate","",1,"form-label","col-12","col-md-6","mb-0"],[1,"d-flex","flex-wrap","gap-2"],["type","button","l10nTranslate","",1,"btn","btn-success",3,"click"],["type","button",1,"btn-file-upload","btn","btn-default"],["accept","image/*","name","file","role","button","type","file",3,"change"],[1,"d-flex","align-items-center","justify-content-between","flex-wrap","gap-2","mb-2"],["l10nTranslate","",1,"text-muted","text-uppercase","text-nowrap","fs-sm","text-bold"],[1,"ms-auto","d-flex","justify-content-end"],["for","",1,"form-label","col-12","col-md-6","mb-0"],[3,"passwordChange","password"],[3,"passwordChange","password","disabled","isRequired","passwordMinLength","showGenerator"],[1,"row","g-2"],[1,"col-12","col-md-6","offset-md-6"],["type","button","l10nTranslate","",1,"btn","btn-primary","text-nowrap",3,"click","disabled"],[1,"card","dialog-tab-card","flex-grow-1"],[1,"d-flex","flex-column","gap-3"],[1,"col-12","col-md-6","d-flex","flex-wrap","align-items-center","gap-2"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"disabled"],[1,"col-12","col-md-6","d-flex","align-items-center"],["type","button",1,"btn","btn-primary",3,"click"],[1,"d-flex","align-items-center","gap-2"],[3,"passwordToCheck"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"click","disabled"],[1,"badge","badge-small","bg-primary"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"div",1),C(2,vv,82,34,"div",2),l()()),o&2&&(m("resizeOffset",40),a(2),x(r.user?2:-1))},dependencies:[de,Te,Si,vi,Ft,xi,xe,we,Dc,P,F,Tn,sr,ki,J,Pe,Qe,De],encapsulation:2});let i=n;return i})();var Co=(function(i){return i.WIN="win",i.MAC="mac",i.LINUX="linux",i.NODE="node",i})(Co||{});function yv(i,n){if(i&1&&(s(0,"div",1)(1,"span",3)(2,"span",4),d(3,"Repository"),l(),d(4,":\xA0"),s(5,"span",5),d(6),l()(),s(7,"span",6)(8,"span",4),d(9,"Version"),l(),d(10,":\xA0"),s(11,"span",7),d(12),l()(),s(13,"span",8),d(14),b(15,"amDateFormat"),l()()),i&2){let e=c();a(6),w(e.store.appStoreManifest().repository),a(6),w(e.store.appStoreManifest().version),a(2),w(E(15,3,e.store.appStoreManifest().date,"L"))}}function bv(i,n){if(i&1&&_(0,"fa-icon",15),i&2){let e=c(3);m("icon",e.icons.faWindows)}}function wv(i,n){if(i&1&&_(0,"fa-icon",15),i&2){let e=c(3);m("icon",e.icons.faApple)}}function Tv(i,n){if(i&1&&_(0,"fa-icon",15),i&2){let e=c(3);m("icon",e.icons.faLinux)}}function Ev(i,n){if(i&1&&_(0,"fa-icon",15),i&2){let e=c(3);m("icon",e.icons.faTerminal)}}function Av(i,n){i&1&&(s(0,"h1",16),d(1,"Windows"),l())}function kv(i,n){i&1&&(s(0,"h1",16),d(1,"Mac"),l())}function Dv(i,n){i&1&&(s(0,"h1",16),d(1,"Linux"),l())}function Mv(i,n){i&1&&(s(0,"h1",16),d(1,"Command Line"),l())}function Fv(i,n){if(i&1){let e=y();s(0,"div",20)(1,"span",4),d(2,"System requirements"),l(),s(3,"span"),d(4,":\xA0Node.js 22+"),l()(),s(5,"a",21),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.download(o,!0))}),s(6,"span",4),d(7,"Download tar.gz version"),l(),d(8,"\xA0 "),l()}}function Pv(i,n){if(i&1){let e=y();s(0,"div",20)(1,"span",4),d(2,"System requirements"),l(),s(3,"span"),d(4),l()(),s(5,"a",21),f("click",function(){h(e);let o=c().$implicit,r=c(2);return g(r.download(o,!0))}),d(6),l()}if(i&2){let e=c().$implicit,t=c(2);a(4),k(":\xA0",e===t.APP_STORE_OS.MAC?"Intel 64bit":"64bit"),a(2),w(e===t.APP_STORE_OS.MAC?"Download Apple Silicon ARM64 version":"Download ARM64 version")}}function Iv(i,n){if(i&1){let e=y();s(0,"div",11)(1,"div",12)(2,"div",13)(3,"div",14),C(4,bv,1,1,"fa-icon",15)(5,wv,1,1,"fa-icon",15)(6,Tv,1,1,"fa-icon",15)(7,Ev,1,1,"fa-icon",15),l(),C(8,Av,2,0,"h1",16)(9,kv,2,0,"h1",16)(10,Dv,2,0,"h1",16)(11,Mv,2,0,"h1",16),s(12,"a",17),f("click",function(){let o=h(e).$implicit,r=c(2);return g(r.download(o))}),_(13,"fa-icon",18),s(14,"span",4),d(15,"Download"),l()(),s(16,"div",19),C(17,Fv,9,0)(18,Pv,7,2),l()()()()}if(i&2){let e,t,o=n.$implicit,r=c(2);a(4),x((e=o)===r.APP_STORE_OS.WIN?4:e===r.APP_STORE_OS.MAC?5:e===r.APP_STORE_OS.LINUX?6:e===r.APP_STORE_OS.NODE?7:-1),a(4),x((t=o)===r.APP_STORE_OS.WIN?8:t===r.APP_STORE_OS.MAC?9:t===r.APP_STORE_OS.LINUX?10:t===r.APP_STORE_OS.NODE?11:-1),a(5),m("icon",r.icons.faDownload),a(4),x(o===r.APP_STORE_OS.NODE?17:18)}}function Rv(i,n){if(i&1&&(s(0,"div",2)(1,"div",9)(2,"div",10),D(3,Iv,19,4,"div",11,He),l()()()),i&2){let e=c();m("resizeOffset",80),a(3),M(e.APP_STORE_PLATFORM_LIST)}}var hm=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faWindows:Zc,faApple:Jc,faLinux:ep,faDownload:gn,faTerminal:wl},this.APP_STORE_OS=Co,this.APP_STORE_PLATFORM_LIST=Object.values(Co),this.layout=S(I),this.userService=S(oe),this.userService.checkAppStoreAvailability(),this.layout.setBreadcrumbIcon(Wt.APPS),this.layout.setBreadcrumbNav({url:`/${Ee.BASE}/${Ee.APPS}/${ji.APPS}`,splicing:2,translating:!0,sameLink:!0})}download(t,o=!1){let r=this.store.appStoreManifest().platform[t].find(p=>t===Co.NODE?p.ext==="tar.gz"===o:p.arch==="arm64"===o);or(r.url)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-applications"]],decls:3,vars:2,consts:[[1,"app-top-menu","px-4","user-applications-topbar"],[1,"d-flex","flex-fill","align-items-center","flex-wrap","gap-2"],["appAutoResize","",1,"profile-page","user-applications-page","d-flex","flex-column","fs-sm",2,"height","100%",3,"resizeOffset"],[1,"d-none","d-sm-block","badge","bg-default","text-nowrap"],["l10nTranslate",""],["l10nTranslate","",1,"text-bold"],[1,"badge","bg-default","mx-auto","text-nowrap"],[1,"text-bold"],[1,"badge","bg-default","text-nowrap"],[1,"container-fluid","p-2"],[1,"row","g-4"],[1,"col-12","col-md-6","col-xl-4","d-flex"],[1,"card","dialog-tab-card","dialog-check-card--interactive","app-download-card","text-center","w-100","h-100"],[1,"card-body","d-flex","flex-column","align-items-center","justify-content-center","p-3","p-xl-4"],[1,"app-download-card-icon","dialog-check-card"],[3,"icon"],[1,"app-download-card-title"],[1,"btn","btn-primary","app-download-card-btn",3,"click"],[1,"me-2",3,"icon"],[1,"app-download-card-details"],[1,"app-download-card-meta","text-muted"],["role","button","l10nTranslate","",1,"app-download-card-link",3,"click"]],template:function(o,r){o&1&&(s(0,"div",0),C(1,yv,16,6,"div",1),l(),C(2,Rv,5,1,"div",2)),o&2&&(a(),x(r.store.appStoreManifest()?1:-1),a(),x(r.store.appStoreManifest()?2:-1))},dependencies:[F,P,de,Pe],styles:[".user-applications-page[_ngcontent-%COMP%]{overflow:auto}.user-applications-page[_ngcontent-%COMP%] .app-download-card[_ngcontent-%COMP%]{position:relative;overflow:hidden;border-radius:.9rem}.user-applications-page[_ngcontent-%COMP%] .app-download-card.dialog-check-card--interactive[_ngcontent-%COMP%]{cursor:default}.user-applications-page[_ngcontent-%COMP%] .app-download-card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{min-height:235px}.user-applications-page[_ngcontent-%COMP%] .app-download-card-icon[_ngcontent-%COMP%]{width:64px;height:64px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin-bottom:.2rem}.user-applications-page[_ngcontent-%COMP%] .app-download-card-icon[_ngcontent-%COMP%] fa-icon[_ngcontent-%COMP%]{font-size:calc(var(--font-size-3xl) * 1.5)}.user-applications-page[_ngcontent-%COMP%] .app-download-card-title[_ngcontent-%COMP%]{margin:.75rem 0 .35rem;font-weight:500;line-height:1.2}.user-applications-page[_ngcontent-%COMP%] .app-download-card-btn[_ngcontent-%COMP%]{margin:.35rem 0 .55rem}.user-applications-page[_ngcontent-%COMP%] .app-download-card-details[_ngcontent-%COMP%]{margin-top:.15rem}.user-applications-page[_ngcontent-%COMP%] .app-download-card-meta[_ngcontent-%COMP%]{font-size:var(--font-size-sm);line-height:1.35;margin-bottom:.25rem}.user-applications-page[_ngcontent-%COMP%] .app-download-card-link[_ngcontent-%COMP%]{display:inline-block;line-height:1.35;text-underline-offset:.18rem;font-size:var(--font-size-sm)}body.theme-light[_nghost-%COMP%] .user-applications-page[_ngcontent-%COMP%] .app-download-card.dialog-check-card--interactive[_ngcontent-%COMP%]:hover, body.theme-light [_nghost-%COMP%] .user-applications-page[_ngcontent-%COMP%] .app-download-card.dialog-check-card--interactive[_ngcontent-%COMP%]:hover{background:#ffffff85}@media (max-width: 767.98px){.user-applications-page[_ngcontent-%COMP%] .app-download-card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{min-height:205px}}"]});let i=n;return i})();var gm=(()=>{let n=class n{constructor(){this.currentMemberIds=[],this.hasChanges=new ae,this.layout=S(I),this.newMembers=[],this.submitted=!1,this.icons={faUserPlus:bl},this.userService=S(oe)}searchMembers(t){let o={search:t,onlyUsers:!0,usersRole:this.parentGroup.type===Ki.USER?Zn.USER:void 0,ignoreUserIds:[...this.currentMemberIds,...this.newMembers.map(r=>r.id)]};return this.userService.searchMembers(o)}onSubmit(){this.submitted=!0,this.userService.addUsersToGroup(this.parentGroup.id,this.newMembers.map(t=>t.id)).subscribe({next:()=>{this.hasChanges.emit(!0),this.layout.sendNotification("success","Add members",this.parentGroup.name),this.layout.closeDialog()},error:t=>{this.submitted=!1,this.layout.sendNotification("error","Add members",this.parentGroup.name,t)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-group-add-users-dialog"]],inputs:{parentGroup:"parentGroup",currentMemberIds:"currentMemberIds"},outputs:{hasChanges:"hasChanges"},decls:16,vars:7,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click","disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span"),d(4),l()(),s(5,"h4",3)(6,"span",4),d(7,"Add members"),l()(),s(8,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),s(9,"div",6)(10,"app-user-search",7),_e("membersChange",function(u){return ue(r.newMembers,u)||(r.newMembers=u),u}),l()(),s(11,"div",8)(12,"button",9),f("click",function(){return r.layout.closeDialog()}),d(13,"Cancel"),l(),s(14,"button",10),f("click",function(){return r.onSubmit()}),d(15," Confirm "),l()()),o&2&&(a(2),m("icon",r.icons.faUserPlus),a(2),w(r.parentGroup.name),a(6),me("members",r.newMembers),m("withPermissions",!1)("customPlaceholder","Type to search for users to add")("searchFunction",r.searchMembers.bind(r)),a(4),m("disabled",r.submitted||!r.newMembers.length))},dependencies:[F,P,En],encapsulation:2});let i=n;return i})();function Nv(i,n){if(i&1&&_(0,"img",9),i&2){let e=c();m("src",e.member.avatarUrl,X)}}function Vv(i,n){if(i&1&&_(0,"fa-icon",2),i&2){let e=c();V(e.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",e.icons.GROUPS)}}function Ov(i,n){if(i&1&&(s(0,"div",7)(1,"span",17),d(2,"from the group"),l(),s(3,"span",11),d(4),b(5,"capitalize"),l()()),i&2){let e=c();a(4),w($(5,1,e.parentGroup.name))}}function Lv(i,n){i&1&&(s(0,"div",13),d(1,"Only the group will be deleted, the members will no longer be part of it."),l())}var Cm=(()=>{let n=class n{constructor(){this.wasDeleted=new ae,this.submitted=!1,this.icons={GROUPS:Wt.GROUPS,faMinus:_n,faUserMinus:Ll},this.layout=S(I),this.userService=S(oe)}onSubmit(){this.submitted=!0;let t=this.member.isUser?"Remove from group":"Delete group";(this.member.isUser?this.userService.removeUserFromGroup(this.parentGroup.id,this.member.id):this.userService.deletePersonalGroup(this.member.id)).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success",t,this.member.name),this.onClose()},error:r=>{this.submitted=!1,this.layout.sendNotification("error",t,this.member.name,r)}})}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-group-delete-dialog"]],inputs:{parentGroup:"parentGroup",member:"member"},outputs:{wasDeleted:"wasDeleted"},decls:26,vars:10,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"text-bold","me-1"],["translate",""],["translate","",1,"small","mt-2"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-danger",3,"click","disabled"],["translate","",1,"mx-1"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span"),d(4),l()(),s(5,"h4",3)(6,"span",4),d(7),l()(),s(8,"button",5),f("click",function(){return r.onClose()}),l()(),s(9,"div",6)(10,"div",7)(11,"div",8),C(12,Nv,1,1,"img",9)(13,Vv,1,3,"fa-icon",10),l(),s(14,"span",11),d(15),b(16,"capitalize"),l(),s(17,"span",12),d(18,"will be removed"),l(),C(19,Ov,6,3,"div",7),l(),C(20,Lv,2,0,"div",13),l(),s(21,"div",14)(22,"button",15),f("click",function(){return r.onClose()}),d(23,"Cancel"),l(),s(24,"button",16),f("click",function(){return r.onSubmit()}),d(25," Remove "),l()()),o&2&&(a(2),m("icon",r.member.isUser?r.icons.faUserMinus:r.icons.faMinus),a(2),w(r.member.name),a(3),w(r.member.isUser?"Remove from group":"Delete group"),a(5),x(r.member.isUser?12:13),a(3),w($(16,8,r.member.name)),a(4),x(r.member.isUser?19:-1),a(),x(r.member.isGroup?20:-1),a(4),m("disabled",r.submitted))},dependencies:[F,P,ki],encapsulation:2});let i=n;return i})();var xm=(()=>{let n=class n{constructor(){this.layout=S(I),this.submitted=!1,this.isManager=!1,this.USER_GROUP_ROLE=Wi,this.icons={faUserPen:vl,faKey:Pt},this.userService=S(oe)}ngOnInit(){this.isManager=this.user.isGroupManager}onSubmit(){if(this.submitted=!0,this.user.isGroupManager===this.isManager){this.layout.closeDialog();return}let t=this.isManager?Wi.MANAGER:Wi.MEMBER;this.userService.updateUserFromPersonalGroup(this.parentGroup.id,this.user.id,{role:t}).subscribe({next:()=>{this.user.setGroupRole(t),this.layout.sendNotification("success","Edit user",this.user.name),this.layout.closeDialog()},error:o=>{this.submitted=!1,this.layout.sendNotification("error","Edit user",this.user.name,o)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-personal-group-edit-user-dialog"]],inputs:{parentGroup:"parentGroup",user:"user"},decls:25,vars:5,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],[1,"modal-title","ms-auto"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-2",3,"click"],[1,"modal-body"],[1,"d-flex","align-items-center"],[1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],[1,"form-check-label"],["type","checkbox",1,"form-check-input",3,"ngModelChange","ngModel"],[1,"ms-1",3,"icon"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click","disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span"),d(4),l()(),s(5,"h4",3)(6,"span",4),d(7,"Edit user"),l()(),s(8,"button",5),f("click",function(){return r.layout.closeDialog()}),l()(),s(9,"div",6)(10,"div",7)(11,"div",8)(12,"div",9)(13,"label",10)(14,"input",11),_e("ngModelChange",function(u){return ue(r.isManager,u)||(r.isManager=u),u}),l(),s(15,"span",4),d(16,"Set as group manager"),l(),_(17,"fa-icon",12),l()()()(),s(18,"small",4),d(19,"As a manager, the user will be able to manage the group and its members."),l()(),s(20,"div",13)(21,"button",14),f("click",function(){return r.layout.closeDialog()}),d(22,"Cancel"),l(),s(23,"button",15),f("click",function(){return r.onSubmit()}),d(24," Confirm "),l()()),o&2&&(a(2),m("icon",r.icons.faUserPen),a(2),w(r.user.name),a(10),me("ngModel",r.isManager),a(3),m("icon",r.icons.faKey),a(6),m("disabled",r.submitted))},dependencies:[F,P,Te,Ft,xe,we],encapsulation:2});let i=n;return i})();var Sm=(()=>{let n=class n{constructor(){this.wasLeft=new ae,this.submitted=!1,this.icons={GROUPS:Wt.GROUPS,faRightFromBracket:Wo},this.layout=S(I),this.userService=S(oe)}onClose(){this.wasLeft.emit(!1),this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.userService.leavePersonalGroup(this.member.id).subscribe({next:()=>{this.wasLeft.emit(!0),this.layout.sendNotification("success","The group was left",this.member.name),this.onClose()},error:t=>{this.submitted=!1,this.layout.sendNotification("error","The group was not left",this.member.name,t)}})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-personal-group-leave-dialog"]],inputs:{member:"member"},outputs:{wasLeft:"wasLeft"},decls:19,vars:6,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-auto",3,"click"],[1,"modal-body"],[1,"d-flex","align-items-center"],[1,"d-flex","align-items-center","avatar","me-2"],[1,"text-bold","me-1"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-primary",3,"click","disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"h4",1),_(2,"fa-icon",2),s(3,"span",3),d(4,"Leave group"),l()(),s(5,"button",4),f("click",function(){return r.onClose()}),l()(),s(6,"div",5)(7,"div",6)(8,"div",7),_(9,"fa-icon",2),l(),s(10,"span",8),d(11),l(),s(12,"span",3),d(13,"will be left, you will no longer be a member of this group"),l()()(),s(14,"div",9)(15,"button",10),f("click",function(){return r.onClose()}),d(16,"Cancel"),l(),s(17,"button",11),f("click",function(){return r.onSubmit()}),d(18," Confirm "),l()()),o&2&&(a(2),m("icon",r.icons.faRightFromBracket),a(7),V(r.member.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",r.icons.GROUPS),a(2),w(r.member.name),a(6),m("disabled",r.submitted))},dependencies:[F,P],encapsulation:2});let i=n;return i})();var Bv=["MainContextMenu"],Uv=["TargetContextMenu"],vm=(i,n)=>n.key,$v=(i,n)=>n.mid;function Hv(i,n){if(i&1){let e=y();s(0,"ul",19)(1,"li",20)(2,"a",21),f("click",function(){h(e);let o=c(2);return g(o.browse(o.selected))}),s(3,"span",22),_(4,"fa-icon",6),d(5,"See members"),l()()(),s(6,"li",20)(7,"a",21),f("click",function(){h(e);let o=c(2);return g(o.openLeaveGroupDialog())}),s(8,"span",22),_(9,"fa-icon",6),d(10,"Leave group"),l()()()()}if(i&2){let e=c(2);a(2),L("disabled",!e.selected),a(2),m("icon",e.icons.faUsersRectangle),a(3),L("disabled",!e.selected||!e.selected.isPersonalGroup),a(2),m("icon",e.icons.faRightFromBracket)}}function zv(i,n){if(i&1&&(s(0,"div",7)(1,"button",17),_(2,"fa-icon",6),l(),N(3,Hv,11,6,"ul",18),l()),i&2){let e=c();a(),L("disabled",!e.selected),a(),m("icon",e.icons.faEllipsis)}}function Gv(i,n){if(i&1&&_(0,"fa-icon",25),i&2){let e=c(3);m("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Wv(i,n){if(i&1){let e=y();s(0,"th",24),f("click",function(){h(e);let o=c().$implicit,r=c();return g(r.sortBy(o.key))}),d(1),C(2,Gv,1,2,"fa-icon",25),l()}if(i&2){let e=c().$implicit,t=c();V(e.value.class),B("width",e.value.width,"%"),L("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),a(),k(" ",e.value.label," "),a(),x(t.sortTable.sortParam.column===e.key?2:-1)}}function jv(i,n){if(i&1&&C(0,Wv,3,10,"th",23),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function Kv(i,n){if(i&1&&_(0,"img",30),i&2){let e=c(4).$implicit;m("src",e.avatarUrl,X)}}function qv(i,n){if(i&1&&_(0,"fa-icon",6),i&2){let e=c(4).$implicit,t=c();V(e.isPersonalGroup?"circle-purple-icon":"circle-primary-icon"),m("icon",t.icons.GROUPS)}}function Qv(i,n){if(i&1&&_(0,"fa-icon",34),i&2){let e=c(5);m("icon",e.icons.faKey)}}function Yv(i,n){if(i&1&&(s(0,"div",28),C(1,Kv,1,1,"img",30)(2,qv,1,3,"fa-icon",31),s(3,"div",32)(4,"span",33),d(5),C(6,Qv,1,1,"fa-icon",34),l(),s(7,"span",35),d(8),l()()()),i&2){let e=c(3).$implicit;a(),x(e.isUser?1:2),a(4),k(" ",e.name," "),a(),x(e.isUser&&e.isGroupManager?6:-1),a(2),w(e.description)}}function Xv(i,n){if(i&1&&(s(0,"span",22),d(1),l()),i&2){let e=c(4).$implicit;a(),w(e.type)}}function Zv(i,n){if(i&1&&(s(0,"span",22),d(1),l()),i&2){let e=c(4).$implicit;a(),w(e.isGroupManager?"Manager":"Member")}}function Jv(i,n){if(i&1&&C(0,Xv,2,1,"span",22)(1,Zv,2,1,"span",22),i&2){let e=c(3).$implicit;x(e.isGroup?0:1)}}function e2(i,n){i&1&&(s(0,"span",36),d(1,"Manager"),l())}function t2(i,n){i&1&&(s(0,"span",22),d(1,"Member"),l())}function i2(i,n){if(i&1&&C(0,e2,2,0,"span",36)(1,t2,2,0,"span",22),i&2){let e=c(3).$implicit;x(e.isGroupManager?0:1)}}function n2(i,n){if(i&1&&_(0,"app-badge-members",37),i&2){let e=c(4).$implicit;m("members",e.counts)}}function o2(i,n){if(i&1&&C(0,n2,1,1,"app-badge-members",37),i&2){let e=c(3).$implicit;x(e.isGroup?0:-1)}}function r2(i,n){if(i&1&&(d(0),b(1,"amTimeAgo")),i&2){let e=c(3).$implicit;k(" ",E(1,1,e.createdAt,!0)," ")}}function a2(i,n){if(i&1&&(d(0),b(1,"amTimeAgo")),i&2){let e=c(3).$implicit;k(" ",E(1,1,e.createdAt,!0)," ")}}function s2(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"amTimeAgo"),l()),i&2){let e=c(2).$implicit,t=c().$implicit;V(e.value.newly&&t[e.value.newly]?"badge prop-newly-"+t[e.value.newly]:""),a(),k(" ",E(2,3,t.modifiedAt,!0)," ")}}function l2(i,n){if(i&1&&(s(0,"td"),C(1,Yv,9,4,"div",28)(2,Jv,2,1)(3,i2,2,1)(4,o2,1,1)(5,r2,2,4)(6,a2,2,4)(7,s2,3,6,"span",29),l()),i&2){let e,t=c().$implicit;V(t.value.class),B("width",t.value.width,"%"),L("text-align-center",t.value.textCenter),a(),x((e=t.key)==="name"?1:e==="type"?2:e==="role"?3:e==="members"?4:e==="memberSince"?5:e==="createdAt"?6:e==="modifiedAt"?7:-1)}}function c2(i,n){if(i&1&&C(0,l2,8,7,"td",27),i&2){let e=n.$implicit;x(e.value.show?0:-1)}}function p2(i,n){if(i&1){let e=y();s(0,"tr",26),f("click",function(){let o=h(e).$implicit,r=c();return g(r.onSelect(o))})("contextmenu",function(o){let r=h(e).$implicit,p=c();return g(p.onTargetContextMenu(o,r))})("appTap",function(){let o=h(e).$implicit,r=c();return g(r.browse(o))}),D(1,c2,1,1,null,null,vm),b(3,"keyvalue"),l()}if(i&2){let e=n.$implicit,t=c();L("selected",e.mid===(t.selected==null?null:t.selected.mid)),a(),M(E(3,2,t.tableHeaders,t.originalOrderKeyValue))}}function d2(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);a(),m("icon",e.icons.faPlus),a(),k(" ",e.allowedAction.addGroup?"Personal group":"Add members")}}function m2(i,n){if(i&1){let e=y();N(0,d2,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog(!0))})}}function u2(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",6),d(2,"Refresh"),l()),i&2){let e=c();a(),m("icon",e.icons.faArrowRotateRight)}}function _2(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",6),d(2,"See members"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faUsersRectangle)}}function f2(i,n){if(i&1){let e=y();N(0,_2,3,1,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.browse(o.selected))})}}function h2(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);a(),m("icon",e.icons.faPen),a(),k(" ",e.allowedAction.editGroup?"Edit group":"Edit user")}}function g2(i,n){if(i&1){let e=y();N(0,h2,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog())})}}function C2(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",6),d(2),l()),i&2){let e=c(2);a(),m("icon",e.icons.faMinus),a(),k(" ",e.allowedAction.removeGroup?"Delete group":"Remove from group")}}function x2(i,n){if(i&1){let e=y();N(0,C2,3,2,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openDialog(!1,!0))})}}function S2(i,n){if(i&1&&(s(0,"span",22),_(1,"fa-icon",6),d(2,"Leave group"),l()),i&2){let e=c(2);a(),m("icon",e.icons.faRightFromBracket)}}function v2(i,n){if(i&1){let e=y();N(0,S2,3,1,"ng-template",16),f("execute",function(){h(e);let o=c();return g(o.openLeaveGroupDialog())})}}var ym=(()=>{let n=class n{constructor(){this.locale=S(z),this.originalOrderKeyValue=Fe,this.icons={GROUPS:Wt.GROUPS,faRotate:bi,faPlus:et,faMinus:_n,faPen:dt,faArrowDown:ut,faArrowUp:pt,faKey:Pt,faArrowRotateRight:mt,faRightFromBracket:Wo,faUsersRectangle:ll,faEllipsis:Ro},this.tableHeaders={name:{label:"Name",width:30,textCenter:!1,class:"",show:!0,sortable:!0},type:{label:"Type",width:10,textCenter:!0,class:"d-none d-md-table-cell",show:!0,sortable:!0},role:{label:"Role",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!1,sortable:!0},members:{label:"Members",width:10,class:"d-none d-md-table-cell",textCenter:!0,show:!0},memberSince:{label:"Member since",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!1,sortable:!0},createdAt:{label:"Created",width:12,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},modifiedAt:{label:"Modified",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.isCurrentGroupManager=!1,this.allowedAction={addGroup:!1,addUsers:!1,removeUser:!1,removeGroup:!1,editUser:!1,editGroup:!1,leaveGroup:!1},this.loading=!1,this.selected=null,this.members=[],this.router=S(Ce),this.activatedRoute=S(Mt),this.layout=S(I),this.userService=S(oe),this.canCreatePersonalGroup=this.userService.userHavePermission(_t.PERSONAL_GROUPS_ADMIN),this.sortSettings={default:[{prop:"name",type:"string"}],name:[{prop:"name",type:"string"}],type:[{prop:"type",type:"string"}],role:[{prop:"isGroupManager",type:"number"}],createdAt:[{prop:"createdAt",type:"date"}],modifiedAt:[{prop:"modifiedAt",type:"date"}]},this.sortTable=new Bt(this.constructor.name,this.sortSettings),this.activatedRoute.data.subscribe(t=>this.setEnv(t.routes)),this.activatedRoute.queryParams.subscribe(t=>this.focusOnSelect=t.select),this.layout.setBreadcrumbIcon(Wt.GROUPS)}setEnv(t){let o;t.length?(o=t[t.length-1].path,this.layout.setBreadcrumbNav({url:`/${Ee.BASE}/${Ee.GROUPS}/${ji.GROUPS}${nr(t)}`,splicing:2,translating:!0,sameLink:!0,mutateLevel:{1:{setUrl:!0}}})):this.layout.setBreadcrumbNav({url:`/${Ee.BASE}/${Ee.GROUPS}/${ji.GROUPS}`,splicing:2,translating:!0,sameLink:!0}),this.loadGroups(o)}refresh(){this.loadGroups(this.currentGroup?.name)}loadGroups(t){this.loading=!0,this.onSelect(),this.userService.browseGroup(t).subscribe({next:o=>{this.tableHeaders.members.show=!t,this.tableHeaders.role.show=!t,this.tableHeaders.modifiedAt.show=!t,this.tableHeaders.createdAt.show=!t,this.tableHeaders.memberSince.show=!!t,this.currentGroup=o.parentGroup,this.isCurrentGroupManager=this.currentGroup?.role===Wi.MANAGER,this.sortBy(this.sortTable.sortParam.column,!1,o.members),this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1),this.loading=!1},error:o=>{this.members=[],this.layout.sendNotification("error","Groups",o.error.message),this.onSelect(),this.loading=!1}})}browse(t){t.isGroup&&this.router.navigate([t.name],{relativeTo:this.activatedRoute}).catch(console.error)}onSelect(t=null){this.selected=t,this.selected?this.allowedAction={addGroup:!this.currentGroup&&this.canCreatePersonalGroup,addUsers:!!this.currentGroup&&this.isCurrentGroupManager,removeUser:!!this.currentGroup&&this.selected.isUser&&this.isCurrentGroupManager,removeGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isGroupManager&&this.selected.isPersonalGroup,editUser:!!this.currentGroup&&this.selected.isUser&&this.isCurrentGroupManager&&this.currentGroup.type===Ki.PERSONAL,editGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isGroupManager&&this.selected.isPersonalGroup,leaveGroup:!this.currentGroup&&this.selected.isGroup&&this.selected.isPersonalGroup}:this.allowedAction={addGroup:!this.currentGroup&&this.canCreatePersonalGroup,addUsers:!!this.currentGroup&&this.isCurrentGroupManager,removeUser:!1,removeGroup:!1,editUser:!1,editGroup:!1,leaveGroup:!1}}onContextMenu(t){t.preventDefault(),t.stopPropagation(),this.layout.openContextMenu(t,this.mainContextMenu)}onTargetContextMenu(t,o){t.preventDefault(),t.type==="contextmenu"&&t.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(t,this.targetContextMenu)}sortBy(t,o=!0,r){this.members=this.sortTable.sortBy(t,o,r||this.members)}openDialog(t=!1,o=!1){t?this.currentGroup?this.layout.openDialog(gm,"md",{initialState:{parentGroup:this.currentGroup,currentMemberIds:this.members.filter(p=>p.isUser).map(p=>p.id)}}).content.hasChanges.pipe(At(p=>p),ce(1)).subscribe(()=>this.refresh()):this.layout.openDialog(Sa,"sm").content.groupChange.pipe(ce(1)).subscribe(p=>{let[u,v]=p;u==="add"&&(v.setGroupRole(Wi.MANAGER),v.counts={users:1},this.sortBy(this.sortTable.sortParam.column,!1,this.members.concat(v)),this.onSelect(v))}):o?this.layout.openDialog(Cm,"md",{initialState:{parentGroup:this.currentGroup,member:this.selected}}).content.wasDeleted.pipe(At(p=>p),ce(1)).subscribe(()=>{this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(p=>this.selected.mid!==p.mid)),this.onSelect()}):this.selected.isGroup?this.layout.openDialog(Sa,"sm",{initialState:{originalGroup:this.selected}}).content.groupChange.pipe(ce(1)).subscribe(p=>{let[u,v]=p;u==="update"&&(this.selected=Object.assign(this.selected,{name:v.name,description:v.description,modifiedAt:v.modifiedAt}))}):this.layout.openDialog(xm,"md",{initialState:{parentGroup:this.currentGroup,user:this.selected}})}openLeaveGroupDialog(){this.layout.openDialog(Sm,"md",{initialState:{member:this.selected}}).content.wasLeft.pipe(ce(1)).subscribe(o=>{o&&(this.sortBy(this.sortTable.sortParam.column,!1,this.members.filter(r=>r.id!==this.selected.id)),this.onSelect())})}focusOn(t){let o=this.members.find(r=>r.name===t);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-groups"]],viewQuery:function(o,r){if(o&1&&(Z(Ke,5),Z(Re,7),Z(Bv,7),Z(Uv,7)),o&2){let p;j(p=K())&&(r.scrollView=p.first),j(p=K())&&(r.inputFilter=p.first),j(p=K())&&(r.mainContextMenu=p.first),j(p=K())&&(r.targetContextMenu=p.first)}},decls:41,vars:43,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-default","me-1",3,"click","disabled","tooltip"],[3,"icon"],["dropdown","",1,"btn-group","me-1"],[1,"d-none","d-sm-block","ms-auto"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem",""],["contextMenuItem","",3,"execute"],["dropdownToggle","","type","button",1,"btn","btn-default","dropdown-toggle"],["class","dropdown-menu","role","menu",4,"dropdownMenu"],["role","menu",1,"dropdown-menu"],["role","menuitem"],[1,"dropdown-item",3,"click"],["l10nTranslate",""],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","appTap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[3,"class"],["alt","",1,"avatar-img",3,"src"],[3,"icon","class"],[1,"d-flex","flex-column"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xs"],["l10nTranslate","",1,"badge","bg-primary"],[3,"members"]],template:function(o,r){if(o&1){let p=y();s(0,"div",2)(1,"button",3),b(2,"translate"),f("click",function(){return h(p),g(r.refresh())}),_(3,"fa-icon",4),l(),s(4,"button",5),b(5,"translate"),f("click",function(){return h(p),g(r.openDialog(!0))}),_(6,"fa-icon",6),l(),s(7,"button",5),b(8,"translate"),f("click",function(){return h(p),g(r.openDialog(!1,!0))}),_(9,"fa-icon",6),l(),s(10,"button",5),b(11,"translate"),f("click",function(){return h(p),g(r.openDialog())}),_(12,"fa-icon",6),l(),C(13,zv,4,3,"div",7),_(14,"app-input-filter",8),l(),s(15,"table",9)(16,"thead")(17,"tr"),D(18,jv,1,1,null,null,vm),b(20,"keyvalue"),l()()(),s(21,"app-virtual-scroll",10),b(22,"searchFilter"),f("contextmenu",function(v){return h(p),g(r.onContextMenu(v))}),s(23,"table",9)(24,"tbody",11),D(25,p2,4,5,"tr",12,$v),l()()(),s(27,"div",13)(28,"span",14),d(29),b(30,"translate"),l()(),s(31,"context-menu",null,0),C(33,m2,1,0,null,15),N(34,u2,3,1,"ng-template",16),f("execute",function(){return h(p),g(r.refresh())}),l(),s(35,"context-menu",null,1),C(37,f2,1,0,null,15),C(38,g2,1,0,null,15),C(39,x2,1,0,null,15),C(40,v2,1,0,null,15),l()}o&2&&(a(),m("tooltip",E(2,22,"Refresh",r.locale.language)),a(2),m("icon",r.icons.faRotate)("animation",r.loading?"spin":null),a(),m("disabled",!r.allowedAction.addGroup&&!r.allowedAction.addUsers)("tooltip",E(5,25,r.allowedAction.addGroup?"New personal group":"Add members",r.locale.language)),a(2),m("icon",r.icons.faPlus),a(),m("disabled",!r.allowedAction.removeGroup&&!r.allowedAction.removeUser)("tooltip",E(8,28,r.allowedAction.removeGroup?"Delete group":"Remove from group",r.locale.language)),a(2),m("icon",r.icons.faMinus),a(),m("disabled",!r.allowedAction.editGroup&&!r.allowedAction.editUser)("tooltip",E(11,31,r.allowedAction.editGroup?"Edit group":"Edit user",r.locale.language)),a(2),m("icon",r.icons.faPen),a(),x(r.currentGroup?-1:13),a(5),M(E(20,34,r.tableHeaders,r.originalOrderKeyValue)),a(3),m("bufferAmount",5)("items",E(22,37,r.members,r.inputFilter.search())),a(4),M(r.scrollView==null?null:r.scrollView.viewPortItems),a(4),ke("",r.members.length," ",E(30,40,"groups",r.locale.language)),a(4),x(r.allowedAction.addGroup||r.allowedAction.addUsers?33:-1),a(4),x(r.selected!=null&&r.selected.isGroup?37:-1),a(),x(r.allowedAction.editGroup||r.allowedAction.editUser?38:-1),a(),x(r.allowedAction.removeGroup||r.allowedAction.removeUser?39:-1),a(),x(r.allowedAction.leaveGroup?40:-1))},dependencies:[Ot,Vt,Nt,F,P,Re,Ke,Me,Di,Fi,Mi,tt,ni,De,J,ht,Qe],encapsulation:2});let i=n;return i})();var bm=()=>!S(oe).user.isLink,wm=()=>S(oe).user.isUser;var Tm=[{path:Ee.BASE,pathMatch:"prefix",canActivate:[bm],children:[{path:Ee.ACCOUNT,component:fm},{path:Ee.CLIENTS,canActivate:[sm],loadComponent:()=>import("./chunk-UC66HJV4.js").then(i=>i.SyncClientsComponent)},{path:Ee.GROUPS,children:[{path:"**",resolve:{routes:_o},component:ym}]},{path:Ee.GUESTS,canActivate:[wm],loadComponent:()=>import("./chunk-4RYZNAIZ.js").then(i=>i.UserGuestsComponent)},{path:Ee.APPS,component:hm},{path:"**",redirectTo:Ee.ACCOUNT}]}];var Em=(i,n)=>{let e=i.queryParams?.oidc?i.queryParams:void 0;return S(Tt).checkUserAuthAndLoad(n.url,e)},Am=()=>S(Tt).isLogged()?(S(Ce).navigate([]).catch(console.error),!1):!0;var km=()=>S(Tt).getAuthSettings();function y2(i,n){if(i&1&&(s(0,"span",16),_(1,"fa-icon",17),l(),_(2,"input",18),b(3,"translate")),i&2){let e=c(2);a(),m("icon",e.icons.faKey),a(),m("placeholder",E(3,2,"Recovery code",e.locale.language))}}function b2(i,n){if(i&1&&(s(0,"span",16),_(1,"fa-icon",17),l(),_(2,"input",19),b(3,"translate")),i&2){let e=c(2);a(),m("icon",e.icons.faQrcode),a(),m("placeholder",E(3,3,"Authentication code",e.locale.language))("maxlength",e.twoFaCodelength)}}function w2(i,n){if(i&1){let e=y();s(0,"p",6),d(1),l(),s(2,"form",7),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit2Fa())}),s(3,"div",8),C(4,y2,4,5)(5,b2,4,6),l(),s(6,"div",9)(7,"div",10)(8,"label",11),_(9,"input",12),s(10,"span",6),d(11,"Use a recovery code"),l()()()(),s(12,"div",13)(13,"button",14),f("click",function(){h(e);let o=c();return g(o.onCancel2Fa())}),d(14,"Cancel"),l(),s(15,"button",15),d(16," Confirm "),l()()()}if(i&2){let e=c();V(q("mb-3 ",e.hasError?"text-danger":"text-white-50")),a(),w(e.hasError||"Two-Factor Authentication"),a(),m("formGroup",e.twoFaForm),a(2),x(e.isRecoveryCode?4:5),a(11),m("disabled",e.isRecoveryCode?e.twoFaForm.controls.recoveryCode.invalid:e.twoFaForm.controls.totpCode.invalid||e.submitted)}}function T2(i,n){if(i&1){let e=y();s(0,"div",26)(1,"div",27)(2,"button",28),f("click",function(){h(e);let o=c(2);return g(o.loginWithOIDC())}),s(3,"span",6),d(4),l()()()()}if(i&2){let e=c(2);a(2),m("disabled",e.OIDCSubmitted),a(2),w(e.oidcSettings.buttonText)}}function E2(i,n){if(i&1){let e=y();s(0,"form",7),f("ngSubmit",function(){h(e);let o=c();return g(o.onSubmit())}),s(1,"p",6),d(2),l(),s(3,"div",20)(4,"span",16),_(5,"fa-icon",17),l(),_(6,"input",21),b(7,"translate"),l(),s(8,"div",22)(9,"span",16),_(10,"fa-icon",17),l(),_(11,"input",23),b(12,"translate"),l(),s(13,"div",24)(14,"button",25),d(15,"Sign in"),l()()(),C(16,T2,5,2,"div",26)}if(i&2){let e=c();m("formGroup",e.loginForm),a(),V(q("mb-3 ",e.hasError?"text-danger":"text-white-50")),a(),w(e.hasError||"Sign-in to your account"),a(3),m("icon",e.icons.faUserAlt),a(),m("placeholder",E(7,11,"Login or Email",e.locale.language)),a(4),m("icon",e.icons.faLock),a(),m("placeholder",E(12,14,"Password",e.locale.language)),a(3),m("disabled",e.loginForm.invalid||e.submitted),a(2),x(e.oidcSettings?16:-1)}}var Dm=(()=>{let n=class n{get isRecoveryCode(){return!!this.twoFaForm.get("isRecoveryCode")?.value}constructor(){this.locale=S(z),this.icons={faLock:ti,faUserAlt:Ko,faKey:Pt,faQrcode:Gl},this.twoFaCodelength=ln,this.logoUrl=gr,this.hasError=null,this.submitted=!1,this.OIDCSubmitted=!1,this.twoFaVerify=!1,this.route=S(Mt),this.oidcSettings=this.route.snapshot.data.authSettings,this.router=S(Ce),this.auth=S(Tt),this.fb=S(un),this.loginForm=this.fb.group({username:this.fb.control("",[wt.required]),password:this.fb.control("",[wt.required])}),this.twoFaForm=this.fb.group({totpCode:this.fb.control("",[wt.required,wt.pattern(new RegExp(`^\\d{${ln}}$`))]),recoveryCode:this.fb.control("",[wt.required,wt.minLength(8)]),isRecoveryCode:this.fb.control(!1)}),this.oidcSettings&&this.oidcSettings.autoRedirect&&this.loginWithOIDC()}onSubmit(){this.submitted=!0,this.auth.login(this.loginForm.value.username,this.loginForm.value.password).pipe(bo(()=>setTimeout(()=>this.submitted=!1,1500))).subscribe({next:t=>this.isLogged(t),error:t=>this.isLogged({success:!1,message:t.error?t.error.message:t})})}onSubmit2Fa(){return yt(this,null,function*(){this.submitted=!0;let t=this.isRecoveryCode?this.twoFaForm.value.recoveryCode:this.twoFaForm.value.totpCode;this.auth.electron.enabled?this.auth.electron.register(this.loginForm.value.username,this.loginForm.value.password,t).subscribe({next:o=>this.is2FaVerified(o),error:o=>this.is2FaVerified({success:!1,message:o.error?o.error.message:o})}):this.auth.loginWith2Fa({code:t,isRecoveryCode:this.isRecoveryCode}).subscribe({next:o=>this.is2FaVerified(o),error:o=>this.is2FaVerified({success:!1,message:o.error?o.error.message:o})})})}onCancel2Fa(){this.auth.logout(),this.twoFaForm.patchValue({totpCode:"",recoveryCode:""}),this.twoFaVerify=!1,this.submitted=!1,this.hasError=null}loginWithOIDC(){return yt(this,null,function*(){if(this.oidcSettings){if(!this.auth.electron.enabled){window.location.assign(this.oidcSettings.loginUrl);return}this.OIDCSubmitted=!0;try{let t=yield this.auth.electron.startOIDCDesktopAuth();if(!t){this.OIDCSubmitted=!1,console.error("OIDC desktop auth failed");return}this.auth.electron.waitOIDCDesktopCallbackParams().then(o=>{let r=new URLSearchParams(o);r.set(hc,String(t)),window.location.assign(`${Xs}?${r.toString()}`),this.auth.electron.setActiveAndShow()}).catch(o=>{this.OIDCSubmitted=!1,console.error("Unavailable OIDC desktop callback params:",o)}),window.location.assign(`${this.oidcSettings.loginUrl}?${this.auth.electron.genParamOIDCDesktopPort(t)}`)}catch(t){this.OIDCSubmitted=!1,console.error(t)}}})}is2FaVerified(t){t.success?(this.auth.electron.enabled||this.auth.initUserFromResponse(t),this.isLogged({success:!0,message:t.message})):(this.hasError=t.message||"Unable to verify code",this.submitted=!1),this.twoFaForm.patchValue({totpCode:"",recoveryCode:""})}isLogged(t){if(t.success)if(this.hasError=null,t.twoFaEnabled){if(this.twoFaVerify=!0,this.auth.electron.enabled)return}else this.auth.returnUrl?this.router.navigateByUrl(this.auth.returnUrl).then(()=>{this.auth.returnUrl=null,this.loginForm.reset()}):this.router.navigate([di.BASE]).then(()=>this.loginForm.reset());else this.hasError=t.message||"Server connection error",this.submitted=!1;this.loginForm.patchValue({password:""})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-auth"]],decls:8,vars:2,consts:[[1,"app-auth"],[1,"auth-card"],[1,"content"],[1,"header"],["alt","",1,"auth-logo","img-fluid",3,"src"],[1,"body"],["l10nTranslate",""],[3,"ngSubmit","formGroup"],[1,"input-group","input-group-lg","mt-2","mb-4"],[1,"d-flex","text-white-50","fs-sm"],[1,"form-check","form-switch","form-check-inline"],["for","useRecovery",1,"form-check-label"],["formControlName","isRecoveryCode","id","useRecovery","type","checkbox",1,"form-check-input"],[1,"auth-actions","d-flex","flex-column","flex-sm-row","gap-2","mt-4"],["type","button","l10nTranslate","",1,"btn","btn-secondary","auth-action-btn",3,"click"],["type","submit","l10nTranslate","",1,"btn","btn-primary","auth-action-btn",3,"disabled"],[1,"input-group-text"],[3,"icon"],["appAutofocus","","type","password","formControlName","recoveryCode",1,"form-control","form-control-lg",3,"placeholder"],["appAutofocus","","type","text","formControlName","totpCode","inputmode","numeric","autocomplete","one-time-code",1,"form-control","form-control-lg",3,"placeholder","maxlength"],[1,"input-group","input-group-lg","my-2"],["appAutofocus","","formControlName","username","type","text",1,"form-control","form-control-lg",3,"placeholder"],[1,"input-group","input-group-lg","mb-3"],["formControlName","password","type","password",1,"form-control","form-control-lg",3,"placeholder"],[1,"d-flex"],["type","submit","l10nTranslate","",1,"btn","btn-lg","btn-primary","w-100",3,"disabled"],[1,"d-flex","flex-column"],[1,"d-flex","mt-3"],["type","button",1,"btn","btn-lg","btn-primary","w-100",3,"click","disabled"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),_(4,"img",4),l(),s(5,"div",5),C(6,w2,17,7)(7,E2,17,17),l()()()()),o&2&&(a(4),m("src",r.logoUrl,X),a(2),x(r.twoFaVerify?6:7))},dependencies:[je,yi,pn,ze,Ft,xe,cn,Fo,dn,mn,F,P,J],encapsulation:2});let i=n;return i})();var Mm=[{path:xa.BASE,canActivate:[Am],resolve:{authSettings:km},children:[{path:xa.LOGIN,component:Dm}]}];var A2=()=>({matrixParams:"ignored",queryParams:"ignored",paths:"exact",fragment:"ignored"});function k2(i,n){if(i&1&&_(0,"fa-icon",2),i&2){let e=c(2);m("icon",e.icons.faChevronRight)("fixedWidth",!1)}}function D2(i,n){if(i&1&&_(0,"fa-icon",5),i&2){let e=c(2);m("icon",e.breadcrumbIcon)}}function M2(i,n){if(i&1&&(C(0,k2,1,2,"fa-icon",2),s(1,"li",3)(2,"a",4),C(3,D2,1,1,"fa-icon",5),s(4,"span"),d(5),l()()()),i&2){let e=n.$implicit,t=n.$index,o=c();x(t!==0?0:-1),a(),m("routerLinkActiveOptions",qn(5,A2)),a(),m("routerLink",e.link),a(),x(t===0&&o.breadcrumbIcon?3:-1),a(2),w(e.title)}}var Fm=(()=>{let n=class n{constructor(){this.icons={faChevronRight:xl},this.breadcrumbIcon=Ml,this.levels=[],this.layout=S(I),this.subscriptions=[],this.subscriptions.push(this.layout.breadcrumbNav.subscribe(t=>this.updateNav(t))),this.subscriptions.push(this.layout.breadcrumbIcon.subscribe(t=>this.breadcrumbIcon=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}updateNav(t){let o=t.splicing||1,r=t.translating||!1,p=t.sameLink||!1,u=t.firstLink||null,v=t.mutateLevel||null,T=t.url.split("/").slice(1);if(this.levels=[],T.length>=1&&T[0]){let R=`/${T.splice(0,o).join("/")}`;this.levels.push({link:u||R,title:""});for(let{index:O,item:le}of T.filter(Y=>Y!=="").map((Y,W)=>({index:W,item:Y}))){let Y=le.split("?")[0];if((!p||v&&v[O]&&v[O].setUrl)&&(R+="/"+Y),v&&v[O]){if(v[O].hide)continue;v[O].setTitle&&(Y=v[O].translateTitle?this.layout.translateString(v[O].setTitle):v[O].setTitle)}else r&&(Y=this.layout.translateString(Y));this.levels.push({link:R,title:Y})}}else this.levels.push({link:["/"],title:""})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-breadcrumb"]],decls:4,vars:0,consts:[[1,"breadcrumb"],[1,"breadcrumb-content"],[3,"icon","fixedWidth"],["routerLinkActive","active",3,"routerLinkActiveOptions"],[3,"routerLink"],[3,"icon"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"div",1),D(2,M2,6,6,null,null,He),l()()),o&2&&(a(2),M(r.levels))},dependencies:[sn,Ws,F],encapsulation:2});let i=n;return i})();function F2(i,n){if(i&1){let e=y();s(0,"a",11),f("click",function(){h(e);let o=c();return g(o.toggleLeftSideBar())}),s(1,"span",12),_(2,"img",13),l()()}if(i&2){let e=c();a(2),m("src",e.logoIconUrl,X)}}function P2(i,n){if(i&1){let e=y();s(0,"a",14),f("click",function(){h(e);let o=c();return g(o.navigateTo("back"))}),_(1,"fa-icon",4),l(),s(2,"a",15),f("click",function(){h(e);let o=c();return g(o.navigateTo("next"))}),_(3,"fa-icon",4),l()}if(i&2){let e=c();a(),m("icon",e.icons.faAngleLeft),a(2),m("icon",e.icons.faAngleRight)}}function I2(i,n){if(i&1&&_(0,"img",10),i&2){let e=c();m("src",e.userAvatar,X)}}var Pm=(()=>{let n=class n{constructor(){this.allOnlineStatus=Ei,this.icons={faAngleLeft:_l,faAngleRight:yl},this.logoIconUrl=hr,this.leftSideBarIsOpen=!0,this.userAvatar=null,this.location=S(Ms),this.layout=S(I),this.store=S(te),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t)),this.subscriptions.push(this.layout.leftSideBarIsOpen.subscribe(t=>this.leftSideBarIsOpen=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}openSidebarUser(){this.layout.showRSideBarTab(fe.PROFILE)}toggleLeftSideBar(){this.layout.toggleLSideBar()}navigateTo(t){t==="back"?this.location.back():this.location.forward()}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-navbar"]],decls:15,vars:8,consts:[[1,"main-header"],[1,"navbar","navbar-content"],["role","button",1,"navbar-button","navbar-logo-button","navbar-logo-button--delayed"],["role","button",1,"d-sm-none","navbar-button","navbar-history-button","navbar-history-button-left",3,"click"],[3,"icon"],["role","button",1,"d-sm-none","navbar-button","navbar-history-button","navbar-history-button-right",3,"click"],[1,"navbar-breadcrumb"],[1,"navbar-right-side"],[1,"menu",3,"click"],[1,"d-flex","align-items-center","avatar"],["alt","",1,"avatar-img","bg-gray-light-important",3,"src"],["role","button",1,"navbar-button","navbar-logo-button","navbar-logo-button--delayed",3,"click"],[1,"logo-container"],["alt","",1,"logo-spin-in",3,"src"],["role","button",1,"d-none","d-sm-flex","navbar-button","navbar-history-button","navbar-history-button-left",3,"click"],["role","button",1,"d-none","d-sm-flex","navbar-button","navbar-history-button","navbar-history-button-right",3,"click"]],template:function(o,r){o&1&&(s(0,"header",0)(1,"nav",1),C(2,F2,3,1,"a",2),C(3,P2,4,2),s(4,"a",3),f("click",function(){return r.navigateTo("back")}),_(5,"fa-icon",4),l(),s(6,"a",5),f("click",function(){return r.navigateTo("next")}),_(7,"fa-icon",4),l(),s(8,"div",6),_(9,"app-breadcrumb"),l(),s(10,"div",7)(11,"div",8),f("click",function(){return r.openSidebarUser()}),s(12,"div",9),C(13,I2,1,1,"img",10),_(14,"span"),l()()()()()),o&2&&(a(2),x(r.leftSideBarIsOpen?-1:2),a(),x(r.leftSideBarIsOpen?3:-1),a(2),m("icon",r.icons.faAngleLeft),a(2),m("icon",r.icons.faAngleRight),a(6),x(r.userAvatar?13:-1),a(),V(q("avatar-",r.allOnlineStatus[r.user==null?null:r.user.onlineStatus])))},dependencies:[Fm,F],encapsulation:2});let i=n;return i})();var os=i=>({menu:i}),ns=(i,n)=>n.title;function R2(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(3).$implicit;V(q("badge bg-",e.count.level)),a(),w(n)}}function N2(i,n){if(i&1&&(s(0,"span",17),C(1,R2,2,4,"span",18),b(2,"async"),l()),i&2){let e,t=c(2).$implicit;a(),x((e=$(2,1,t.count.value))?1:-1,e)}}function V2(i,n){if(i&1){let e=y();s(0,"button",15),f("click",function(){h(e);let o=c().$implicit,r=c();return g(r.navigateToMenu(o))})("mouseenter",function(){h(e);let o=c().$implicit,r=c();return g(r.previewMenuTitle(o.title))})("mouseleave",function(){h(e);let o=c(2);return g(o.restoreMenuTitle())}),_(1,"fa-icon",16),C(2,N2,3,3,"span",17),l()}if(i&2){let e=c().$implicit;L("active",e.isActive),a(),m("animation",e.iconAnimated?"spin":null)("icon",e.icon),a(),x(e.count?2:-1)}}function O2(i,n){if(i&1&&C(0,V2,3,5,"button",14),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function L2(i,n){if(i&1){let e=y();s(0,"button",15),f("click",function(){h(e);let o=c();return g(o.logOut())})("mouseenter",function(){h(e);let o=c();return g(o.previewMenuTitle("logout"))})("mouseleave",function(){h(e);let o=c();return g(o.restoreMenuTitle())}),_(1,"fa-icon",19),l()}if(i&2){let e=c();a(),m("icon",e.icons.faUserSecret)}}function B2(i,n){if(i&1&&ct(0,20),i&2){let e=c().$implicit;c();let t=at(22);m("ngTemplateOutlet",t)("ngTemplateOutletContext",Je(2,os,e))}}function U2(i,n){if(i&1&&C(0,B2,1,4,"ng-container",20),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function $2(i,n){if(i&1&&(s(0,"span",23),_(1,"fa-icon",25),l()),i&2){let e=c(2);a(),m("icon",e.icons.faChevronDown)}}function H2(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c(2).menu;V(q("badge bg-",e.count.level)),a(),w(n)}}function z2(i,n){if(i&1&&(s(0,"span",24),C(1,H2,2,4,"span",18),b(2,"async"),l()),i&2){let e,t=c().menu;a(),x((e=$(2,1,t.count.value))?1:-1,e)}}function G2(i,n){if(i&1&&(_(0,"fa-icon",21),s(1,"span",22),d(2),l(),C(3,$2,2,1,"span",23),C(4,z2,3,3,"span",24)),i&2){let e=n.menu;m("icon",e.icon)("animation",e.iconAnimated?"spin":null),a(2),w(e.title),a(),x(!(e==null||e.submenus==null)&&e.submenus.length?3:-1),a(),x(e.count?4:-1)}}function W2(i,n){if(i&1&&(s(0,"div",29)(1,"a",27),ct(2,20),l()()),i&2){let e=c().$implicit;c(3);let t=at(20);L("active",e.isActive),a(),m("routerLink",e.link),a(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Je(5,os,e))}}function j2(i,n){if(i&1&&C(0,W2,3,7,"div",28),i&2){let e=n.$implicit;x(e.hide?-1:0)}}function K2(i,n){if(i&1&&D(0,j2,1,1,null,null,ns),i&2){let e=c().menu;M(e.submenus)}}function q2(i,n){if(i&1&&(s(0,"div",26)(1,"a",27),ct(2,20),l()(),C(3,K2,2,0)),i&2){let e=n.menu;c();let t=at(20);L("active",e.isActive),a(),m("routerLink",e.link),a(),m("ngTemplateOutlet",t)("ngTemplateOutletContext",Je(6,os,e)),a(),x(e.submenus!=null&&e.submenus.length?3:-1)}}var Im=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faUserSecret:Xo,faChevronDown:Vl},this.logoIconUrl=hr,this.appsMenu=ec,this.router=S(Ce),this.authService=S(Tt),this.layout=S(I),this.userService=S(oe),this.subscriptions=[],this.appVersion=Jl,this.appsMenu.submenus=[yc,ld,gc,Kl,tc],this.subscriptions.push(this.store.user.pipe(At(t=>!!t)).subscribe(()=>this.loadMenus())),this.subscriptions.push(this.router.events.pipe(At(t=>t instanceof Gs)).subscribe(t=>this.updateUrl(t.urlAfterRedirects)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}loadMenus(){this.userService.setMenusVisibility(this.appsMenu.submenus),this.updateUrl(this.router.url)}logOut(){this.authService.logout(!0)}toggleSideBar(){this.layout.toggleLSideBar()}navigateToMenu(t){this.navigateToUrl([t.link])}previewMenuTitle(t){window.matchMedia("(hover: hover) and (pointer: fine)").matches&&this.updateDynamicTitle(t)}restoreMenuTitle(){window.matchMedia("(hover: hover) and (pointer: fine)").matches&&this.updateDynamicTitle()}navigateToUrl(t){this.router.navigate(t).catch(console.error)}updateUrl(t){this.currentUrl=t.substring(1);for(let o of this.appsMenu.submenus)if(o.isActive=!!(!o.hide&&(o.link===this.currentUrl||o.matchLink&&o.matchLink.test(this.currentUrl))),o.isActive&&(this.currentMenu=o),o.submenus?.length){for(let r of o.submenus)if(r.isActive=o.isActive&&(r.link===this.currentUrl||!!r.matchLink&&r.matchLink.test(this.currentUrl)),r.submenus?.length)for(let p of r.submenus)p.isActive=this.currentUrl.startsWith(p.link)}this.currentMenu??=this.appsMenu.submenus[0],this.updateDynamicTitle()}updateDynamicTitle(t){this.dynamicTitle=this.layout.translateString(t!==void 0?t:this.currentMenu?this.currentMenu.title:this.appsMenu.title)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-sidebar-left"]],decls:23,vars:4,consts:[["MenuTemplate",""],["MenuApps",""],[1,"left-sidebar"],[1,"sidebar-apps-menus"],[1,"menu-title"],[1,"menu-title-content"],["type","button",1,"logo-toggle",3,"click"],["alt","",1,"logo-toggle-spin-in",3,"src"],[1,"sidebar-title"],[1,"apps-shortcuts"],["type","button",1,"app-shortcut"],[1,"menus-content"],[1,"menus-group"],[1,"sidebar-apps-footer"],["type","button",1,"app-shortcut",3,"active"],["type","button",1,"app-shortcut",3,"click","mouseenter","mouseleave"],[3,"animation","icon"],[1,"menu-badge-icon"],[3,"class"],[3,"icon"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"icon","animation"],["l10nTranslate",""],[1,"ms-auto","opacity-75"],[1,"menu-badge"],["size","sm",3,"icon"],[1,"menu"],[3,"routerLink"],[1,"menu","submenu",3,"active"],[1,"menu","submenu"]],template:function(o,r){if(o&1){let p=y();s(0,"aside",2)(1,"div",3)(2,"div",4)(3,"div",5)(4,"button",6),f("click",function(){return h(p),g(r.toggleSideBar())}),_(5,"img",7),l(),s(6,"span",8),d(7),l()()(),s(8,"div",9),D(9,O2,1,1,null,null,ns),C(11,L2,2,1,"button",10),l(),s(12,"div",11)(13,"div",12),D(14,U2,1,1,null,null,ns),l(),s(16,"div",13)(17,"span"),d(18),l()()()()(),N(19,G2,5,5,"ng-template",null,0,Zt)(21,q2,4,8,"ng-template",null,1,Zt)}o&2&&(a(5),m("src",r.logoIconUrl,X),a(2),w(r.dynamicTitle),a(2),M(r.appsMenu.submenus),a(2),x(r.store.userImpersonate()?11:-1),a(3),M(r.currentMenu.submenus),a(4),w(r.appVersion))},dependencies:[sn,F,P,zt,rn],encapsulation:2});let i=n;return i})();var Q2=i=>({nb:i}),Y2=(i,n)=>({nba:i,nb:n}),X2=(i,n)=>n.id;function Z2(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();a(),w($t(2,1,e.nbTotalTasks===0?"no_task":e.nbTotalTasks>1?"nb_tasks":"one_task",e.locale.language,Je(5,Q2,e.nbTotalTasks)))}}function J2(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c();a(),k("",$t(2,1,e.nbActiveTasks>1?"nb_active_tasks":"one_active_task",e.locale.language,Ts(5,Y2,e.nbActiveTasks,e.nbTotalTasks))," ")}}function ey(i,n){if(i&1){let e=y();s(0,"button",5),f("click",function(){h(e);let o=c();return g(o.removeTasks())}),_(1,"fa-icon",6),l()}if(i&2){let e=c();a(),m("icon",e.icons.faTrashAlt)}}function ty(i,n){i&1&&_(0,"div",1)}function iy(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"translate"),l()),i&2){let e=c().$implicit,t=c();a(),k("\xA0:\xA0",E(2,1,e.result,t.locale.language))}}function ny(i,n){if(i&1&&(s(0,"span"),d(1),b(2,"toBytes"),l()),i&2){let e=c().$implicit;a(),k("",E(2,1,e.props.size,2),"\xA0\u2022\xA0")}}function oy(i,n){if(i&1&&(_(0,"fa-icon",6),s(1,"span"),d(2),l()),i&2){let e=c().$implicit,t=c();m("icon",t.icons.faFolderClosed),a(2),k("\xA0",e.props.directories,"\xA0\u2022\xA0")}}function ry(i,n){if(i&1&&(_(0,"fa-icon",6),s(1,"span"),d(2),l()),i&2){let e=c().$implicit,t=c();m("icon",t.icons.faFile),a(2),k("\xA0",e.props.files,"\xA0\u2022\xA0")}}function ay(i,n){if(i&1){let e=y();s(0,"div",4)(1,"div",7),b(2,"translate"),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goToFile(o))}),s(3,"span"),_(4,"fa-icon",8),s(5,"b"),_(6,"fa-icon",9),l(),s(7,"span"),d(8),l(),C(9,iy,3,4,"span"),l(),s(10,"div",10)(11,"progressbar",11)(12,"span",12),C(13,ny,3,4,"span"),C(14,oy,3,2),C(15,ry,3,2),_(16,"fa-icon",6),s(17,"span"),d(18),b(19,"amTimeAgo"),l()()()()()()}if(i&2){let e=n.$implicit,t=c();a(),m("tooltip",E(2,16,e.result,t.locale.language)),a(2),L("text-danger",e.status>=2),a(),m("icon",t.iconsStatus[e.status])("animation",e.status===0?"spin-pulse":null),a(2),m("icon",t.iconsOperation[e.type]),a(2),w(e.name),a(),x(e.status===2?9:-1),a(2),m("max",100)("value",e.status>0?100:e.props.progress||100)("type",e.status<1?"warning":e.status===2?"danger":null),a(2),x(e.props.size?13:-1),a(),x(e.props.directories?14:-1),a(),x(e.props.files?15:-1),a(),m("icon",t.icons.faClock),a(2),k("\xA0",E(19,19,e.startedAt,!0))}}var Rm=(()=>{let n=class n{constructor(){this.locale=S(z),this.icons={faTrashAlt:Ti,faFlag:Ol,faClock:Hc,faFile:kn,faFolderClosed:Sr},this.iconsStatus=[Oe,jo,cl],this.iconsOperation={[Ne.DELETE]:zc,[Ne.MOVE]:ei,[Ne.COPY]:fn,[Ne.DOWNLOAD]:Cn,[Ne.UPLOAD]:sl,[Ne.COMPRESS]:va,[Ne.DECOMPRESS]:va},this.nbActiveTasks=0,this.nbEndedTasks=0,this.nbTotalTasks=0,this.tasks=[],this.router=S(Ce),this.store=S(te),this.filesService=S(Le),this.filesTasksService=S(Bc),this.subscriptions=[],this.subscriptions.push(this.store.filesActiveTasks.subscribe(t=>this.updateTasks(t,!0))),this.subscriptions.push(this.store.filesEndedTasks.subscribe(t=>this.updateTasks(t,!1)))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}updateTasks(t,o=!1){o?(this.tasks=[...t,...this.store.filesEndedTasks.getValue()],this.nbActiveTasks=t.length,this.nbEndedTasks=this.store.filesEndedTasks.getValue().length):(this.tasks=[...this.store.filesActiveTasks.getValue(),...t],this.nbEndedTasks=t.length,this.nbActiveTasks=this.store.filesActiveTasks.getValue().length),this.nbTotalTasks=this.nbActiveTasks+this.nbEndedTasks}removeTasks(){this.filesTasksService.removeAll()}goToFile(t){if(t.status===1){if(t.type===Ne.COMPRESS&&t.props.compressInDirectory===!1){this.filesService.downloadTaskArchive(t.id);return}else if(t.type===Ne.DELETE){if(t.path.startsWith(G.FILES))t.path=t.path.replace(G.FILES,G.TRASH);else if(t.path.startsWith(G.SHARES))return}this.router.navigate([`${G.SPACES}/${t.path}`],{queryParams:{select:t.name}}).catch(console.error)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-files-tasks"]],decls:10,vars:2,consts:[[1,"sidebar-component-title","justify-content-between"],[2,"width","35px"],[1,"btn","btn-default"],["appAutoResize",""],[1,"task-list"],[1,"btn","btn-default",3,"click"],[3,"icon"],["placement","bottom",1,"text-truncate",3,"click","tooltip"],[3,"icon","animation"],[1,"me-1",3,"icon"],[1,"mt-1","fs-sm"],[1,"custom-progress-bar","position-relative",3,"max","value","type"],[1,"d-flex","align-items-center","justify-content-center","position-absolute","mx-1","w-100"]],template:function(o,r){if(o&1&&(s(0,"div",0),_(1,"div",1),s(2,"div"),C(3,Z2,3,7,"span")(4,J2,3,8,"span"),l(),C(5,ey,2,1,"button",2)(6,ty,1,0,"div",1),l(),s(7,"div",3),D(8,ay,20,22,"div",4,X2),l()),o&2){let p;a(3),x((p=r.nbActiveTasks)===0?3:4),a(2),x(r.nbTotalTasks?5:6),a(3),M(r.tasks)}},dependencies:[F,de,Ge,Me,kc,J,Qe,cr],encapsulation:2});let i=n;return i})();var sy=["notificationsHtml"],ly=(i,n)=>n.id;function cy(i,n){if(i&1&&(s(0,"div",3),d(1),l()),i&2){let e=c();a(),w(e.store.notifications().length)}}function py(i,n){if(i&1){let e=y();s(0,"button",9),f("click",function(){h(e);let o=c();return g(o.removeAll())}),_(1,"fa-icon",10),l()}if(i&2){let e=c();a(),m("icon",e.icons.faTrashAlt)}}function dy(i,n){if(i&1&&(s(0,"b",15),d(1),l()),i&2){let e=c().$implicit;a(),w(e.fromUser.fullName)}}function my(i,n){if(i&1&&(s(0,"b"),d(1),l()),i&2){let e=c().$implicit;a(),w(e.fromUser.fullName)}}function uy(i,n){if(i&1&&_(0,"fa-icon",10),i&2){let e=c().$implicit;m("icon",e.appIcon)}}function _y(i,n){if(i&1&&(s(0,"span"),d(1),l()),i&2){let e=c().$implicit;a(),k("\xA0",e.mainElement)}}function fy(i,n){if(i&1){let e=y();s(0,"div",11,0)(2,"div",12),_(3,"app-user-avatar",13),s(4,"div",14),C(5,dy,2,1,"b",15)(6,my,2,1,"b"),l(),s(7,"div",16)(8,"i",17),f("click",function(){let o=h(e).$implicit,r=c();return g(r.remove(o))}),_(9,"fa-icon",10),l()()(),s(10,"div",18)(11,"div")(12,"span",15),d(13),l(),d(14,":\xA0"),s(15,"b",19),f("click",function(){let o=h(e).$implicit,r=c();return g(r.goto(o))}),d(16),l()(),s(17,"div",20)(18,"div"),d(19),b(20,"amTimeAgo"),l(),s(21,"div",21),C(22,uy,1,1,"fa-icon",10),C(23,_y,2,1,"span"),l()()()()}if(i&2){let e=n.$implicit,t=c();L("bg-soft-warning",e.soonRead),a(3),m("user",e.fromUser)("width",24)("height",24)("unknownUserAsInfo",e.fromUser.id===-1),a(2),x(e.fromUser.id===-1?5:6),a(4),m("icon",t.icons.faTimes),a(4),w(e.content.event),a(3),w(e.content.element),a(),L("text-muted",!e.soonRead),a(2),w($(20,15,e.createdAt)),a(3),x(e.appIcon?22:-1),a(),x(e.mainElement?23:-1)}}var Nm=(()=>{let n=class n{constructor(){this.store=S(te),this.icons={faCheck:jo,faTimes:It,faMagnifyingGlass:Oo,faTrashAlt:Ti,faCircleInfo:Rt},this.router=S(Ce),this.layout=S(I),this.notificationsService=S(bc),Ht(()=>{this.store.unreadNotifications(),setTimeout(()=>this.observeUnreadNotifications(),0)})}ngAfterViewInit(){this.observer=new IntersectionObserver(t=>{t.forEach(o=>{if(o.isIntersecting){let r=o.target,p=this.notificationsHtml.toArray().findIndex(u=>u.nativeElement===r);if(p!==-1){let u=this.store.notifications()[p];u&&!u.wasRead&&(u.wasRead=!0,u.soonRead=!0,this.observer.unobserve(r),setTimeout(()=>this.wasRead(u),2e3))}}})},{threshold:.5})}removeAll(){this.notificationsService.deleteNotification().subscribe({next:()=>this.store.notifications.set([]),error:t=>this.layout.sendNotification("error","Notifications","Unable to delete",t)})}remove(t){this.notificationsService.deleteNotification(t.id).subscribe({next:()=>this.store.notifications.update(o=>o.filter(r=>t.id!==r.id)),error:o=>this.layout.sendNotification("error","Notifications","Unable to delete",o)})}goto(t){if(t.content.externalUrl)window.open(t.content.externalUrl,"_blank","noopener");else{let o=t.content.app===Cc.SYNC?t.content.element.split("/").at(-1):t.content.element;this.router.navigate([G.SPACES,...t.content.url.split("/")],{queryParams:{select:o}}).catch(console.error)}}observeUnreadNotifications(){this.notificationsHtml&&this.notificationsHtml.forEach((t,o)=>{let r=this.store.notifications()[o];r&&!r.wasRead&&this.observer.observe(t.nativeElement)})}wasRead(t){this.notificationsService.wasReadNotification(t.id).subscribe({next:()=>{this.store.notifications.update(o=>{let r=[...o],p=r.find(u=>u.id===t.id);return p&&(p.soonRead=!1,p.wasRead=!0),r})},error:o=>this.layout.sendNotification("error","Notifications","Mark as read",o)})}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-notifications"]],viewQuery:function(o,r){if(o&1&&Z(sy,5),o&2){let p;j(p=K())&&(r.notificationsHtml=p)}},decls:10,vars:2,consts:[["notificationsHtml",""],[1,"sidebar-component-title","justify-content-between","position-relative"],[1,"d-flex","align-items-center","justify-content-start",2,"min-width","35px"],[1,"badge","bg-warning"],["l10nTranslate","",1,"position-absolute","start-50","translate-middle-x"],[1,"d-flex","align-items-center","justify-content-end",2,"min-width","35px"],[1,"btn","btn-sm","btn-default"],["appAutoResize","",1,"fs-sm","p-2"],[1,"mb-1","app-small-card","rounded","no-select",3,"bg-soft-warning"],[1,"btn","btn-sm","btn-default",3,"click"],[3,"icon"],[1,"mb-1","app-small-card","rounded","no-select"],[1,"d-flex","px-2","pt-2","pb-1"],[1,"me-1",3,"user","width","height","unknownUserAsInfo"],[1,"align-self-center"],["l10nTranslate",""],[1,"ms-auto","align-self-center"],["role","button",1,"fs-sm",3,"click"],[1,"pb-2","px-2"],[1,"cursor-pointer","btn-link",3,"click"],[1,"d-flex","fs-xs","pt-1"],[1,"ms-auto"]],template:function(o,r){o&1&&(s(0,"div",1)(1,"div",2),C(2,cy,2,1,"div",3),l(),s(3,"div",4),d(4,"Notifications"),l(),s(5,"div",5),C(6,py,2,1,"button",6),l()(),s(7,"div",7),D(8,fy,24,17,"div",8,ly),l()),o&2&&(a(2),x(r.store.notifications().length?2:-1),a(4),x(r.store.notifications().length?6:-1),a(2),M(r.store.notifications()))},dependencies:[P,de,F,qe,Qe],encapsulation:2});let i=n;return i})();var hy=(i,n)=>n.id;function gy(i,n){if(i&1&&(s(0,"div",3)(1,"div",4),_(2,"img",5)(3,"span"),s(4,"div",6)(5,"span",7),d(6),l(),s(7,"span",8),d(8),l()()()()),i&2){let e=n.$implicit,t=c();a(2),m("src",e.avatarUrl,X),a(),V(q("avatar-",t.allOnlineStatus[e==null?null:e.onlineStatus])),a(3),w(e.fullName),a(2),w(e.email)}}var Vm=(()=>{let n=class n{constructor(){this.allOnlineStatus=Ei,this.store=S(te),this.onlineUsers=ve(()=>this.store.onlineUsers().filter(t=>t.onlineStatus!==Jo.OFFLINE))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-onlines"]],decls:6,vars:0,consts:[[1,"sidebar-component-title"],["l10nTranslate",""],["appAutoResize",""],[1,"app-onlines-content"],[1,"d-flex","align-items-center","align-self-center","avatar"],["alt","",1,"avatar-img",3,"src"],[1,"d-flex","flex-column","ms-2"],["draggable","false",1,"no-pointer-events","fs-sm"],["draggable","false",1,"no-pointer-events","text-muted","fs-xs"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"span",1),d(2,"Online users"),l()(),s(3,"div",2),D(4,gy,9,6,"div",3,hy),l()),o&2&&(a(4),M(r.onlineUsers()))},dependencies:[de,P],encapsulation:2});let i=n;return i})();function Cy(i,n){if(i&1){let e=y();s(0,"button",26),f("click",function(){h(e);let o=c();return g(o.collapseRSideBar())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();m("routerLink",e.USER_PATH.BASE),a(),m("icon",e.icons.faUserAlt)}}function xy(i,n){if(i&1){let e=y();s(0,"button",27),f("click",function(){h(e);let o=c();return g(o.collapseRSideBar())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();a(),m("icon",e.icons.faCog)}}function Sy(i,n){if(i&1){let e=y();s(0,"button",4),f("click",function(){h(e);let o=c();return g(o.logOut())}),_(1,"fa-icon",5),l()}if(i&2){let e=c();a(),m("icon",e.store.userImpersonate()?e.icons.faUserSecret:e.icons.faPowerOff)}}function vy(i,n){i&1&&(s(0,"div",14),d(1,"Guest Link"),l())}function yy(i,n){if(i&1&&(s(0,"div"),d(1),l(),s(2,"div",28),d(3),l()),i&2){let e=c();a(),w(e.user==null?null:e.user.fullName),a(2),w(e.user==null?null:e.user.email)}}function by(i,n){if(i&1&&(s(0,"option",16),d(1),b(2,"translate"),b(3,"capitalize"),l()),i&2){let e=n.$implicit,t=c();m("ngValue",t.allOnlineStatus.indexOf(e)),a(),w($(3,5,E(2,2,e,t.locale.language)))}}var Om=(()=>{let n=class n{constructor(){this.logoDarkUrl=gr,this.logoUrl=Vc,this.store=S(te),this.locale=S(z),this.USER_PATH=Ee,this.allOnlineStatus=Ei,this.appBaseUrl=`${eo.WEBSITE}`,this.icons={faUserAlt:Ko,faCircleHalfStroke:hl,faCog:hn,faPowerOff:pl,faUserSecret:Xo,faThumbTack:Tl,faThumbTackSlash:kl},this.userAvatar=null,this.themeLight=yn,this.layout=S(I),this.authService=S(Tt),this.userService=S(oe),this.subscriptions=[],this.subscriptions.push(this.store.user.subscribe(t=>this.user=t)),this.subscriptions.push(this.store.userAvatarUrl.subscribe(t=>this.userAvatar=t)),this.appBaseUrl=this.layout.getCurrentLanguage()==="fr"?`${eo.WEBSITE}/fr/`:`${eo.WEBSITE}/`}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}collapseRSideBar(){this.layout.toggleRSideBar(!1)}setOnlineStatus(t){this.userService.changeOnlineStatus(t)}toggleTheme(){this.layout.toggleTheme()}logOut(){this.authService.logout(),this.layout.toggleRSideBar(!1)}openLink(t){switch(t){case"website":this.layout.openUrl(this.appBaseUrl);break;case"versions":this.layout.openUrl(eo.RELEASES);break;default:this.layout.openUrl(`${this.appBaseUrl}${t}`)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-user-profile"]],decls:39,vars:17,consts:[[1,"d-flex","flex-column"],[1,"sidebar-component-title"],[1,"d-flex","flex-fill","justify-content-between"],["type","button",1,"btn","btn-default",3,"routerLink"],["type","button",1,"btn","btn-default",3,"click"],[3,"icon"],["type","button","routerLink","/admin",1,"btn","btn-default"],["type","button",1,"btn","btn-default"],["appAutoResize","",1,"d-flex","flex-column",3,"useMaxHeight"],[1,"user-header","py-3","px-3"],[1,"d-flex","flex-column","justify-content-center","me-2"],[1,"avatar-lg"],["alt","",1,"avatar-img",3,"src"],[1,"user-details"],["l10nTranslate",""],[1,"form-select","form-select-sm","mt-2",3,"ngModelChange","ngModel"],[3,"ngValue"],[1,"my-0","w-100"],[1,"mt-auto"],[1,"profile-sync-in-footer"],[1,"mb-1"],["alt","","height","30",3,"src"],[1,"d-flex"],["l10nTranslate","",1,"link-primary","cursor-pointer",3,"click"],[1,"link-primary","cursor-pointer",3,"click"],[1,"ms-auto","fs-xs","cursor-pointer",3,"click","title","icon"],["type","button",1,"btn","btn-default",3,"click","routerLink"],["type","button","routerLink","/admin",1,"btn","btn-default",3,"click"],[1,"fs-xs","mt-1"]],template:function(o,r){o&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),C(3,Cy,2,2,"button",3),s(4,"button",4),f("click",function(){return r.toggleTheme()}),_(5,"fa-icon",5),l(),C(6,xy,2,1,"button",6),C(7,Sy,2,1,"button",7),l()(),s(8,"div",8)(9,"div",9)(10,"div",10)(11,"div",11),_(12,"img",12)(13,"span"),l()(),s(14,"div",13),C(15,vy,2,0,"div",14)(16,yy,4,2),s(17,"select",15),f("ngModelChange",function(u){return r.setOnlineStatus(u)}),D(18,by,4,7,"option",16,He),l()()(),_(20,"hr",17),s(21,"div",18),_(22,"hr",17),s(23,"div",19)(24,"div",20),_(25,"img",21),l(),s(26,"div",22)(27,"a",23),f("click",function(){return r.openLink("website")}),d(28,"Website"),l(),s(29,"span"),d(30,"\xA0|\xA0"),l(),s(31,"a",23),f("click",function(){return r.openLink("versions")}),d(32,"Versions"),l(),s(33,"span"),d(34,"\xA0|\xA0"),l(),s(35,"a",24),f("click",function(){return r.openLink("support")}),d(36," \u{1F49B}"),l(),s(37,"fa-icon",25),b(38,"translate"),f("click",function(){return r.layout.setAutoCollapseRSideBarPreference(!r.layout.collapseRSideBarPreference())}),l()()()()()()),o&2&&(a(3),x(r.user!=null&&r.user.isLink?-1:3),a(2),m("icon",r.icons.faCircleHalfStroke),a(),x(r.user!=null&&r.user.isAdmin?6:-1),a(),x(!r.store.isElectronApp()||r.store.isElectronApp()&&r.store.userImpersonate()?7:-1),a(),m("useMaxHeight",!1),a(4),m("src",r.userAvatar,X),a(),V(q("avatar-",r.allOnlineStatus[r.user==null?null:r.user.onlineStatus])),a(2),x(r.user!=null&&r.user.isLink?15:16),a(2),m("ngModel",r.user==null?null:r.user.onlineStatus),a(),M(r.allOnlineStatus),a(7),m("src",r.layout.switchTheme.getValue()===r.themeLight?r.logoUrl:r.logoDarkUrl,X),a(12),m("title",E(38,14,r.layout.collapseRSideBarPreference()?"Sidebar auto-hide enabled":"Sidebar pinned",r.locale.language))("icon",r.layout.collapseRSideBarPreference()?r.icons.faThumbTackSlash:r.icons.faThumbTack))},dependencies:[Te,Si,vi,xi,xe,we,sn,F,P,de,ki,J],encapsulation:2});let i=n;return i})();var wy=(i,n)=>n.id;function Ty(i,n){if(i&1){let e=y();s(0,"button",5),f("click",function(){h(e);let o=c();return g(o.onCloseAll())}),_(1,"fa-icon",6),l()}if(i&2){let e=c();a(),m("icon",e.icons.faXmark)}}function Ey(i,n){if(i&1){let e=y();s(0,"div",7),f("click",function(){let o=h(e).$implicit,r=c();return g(r.onMaximize(o))}),s(1,"div",8),_(2,"img",9),s(3,"div",10),d(4),l(),s(5,"button",11),f("click",function(o){let r=h(e).$implicit,p=c();return g(p.onClose(o,r))}),_(6,"fa-icon",6),l()()()}if(i&2){let e=n.$implicit,t=c();a(2),m("ngSrc",e.element.mimeUrl),a(2),w(e.element.name),a(2),m("icon",t.icons.faTimes)}}var Lm=(()=>{let n=class n{constructor(){this.icons={faXmark:Rl,faTimes:It},this.windows=[],this.layout=S(I),this.subscription=null,this.subscription=this.layout.windows.subscribe(t=>this.setWindows(t))}ngOnDestroy(){this.subscription.unsubscribe()}onMaximize(t){this.layout.restoreDialog(t.id)}onClose(t,o){t.preventDefault(),t.stopPropagation();let r=this.layout.modalRefs.get(o.id);r&&r.content.onClose(),this.hideIfNoWindows(this.layout.windows.getValue())}onCloseAll(){for(let t of this.layout.windows.getValue()){let o=this.layout.modalRefs.get(t.id);o&&o.content.onClose()}this.hideIfNoWindows(this.layout.windows.getValue())}setWindows(t){this.hideIfNoWindows(t),this.windows=t}hideIfNoWindows(t){t.length||this.layout.hideRSideBarTab(fe.WINDOWS,1e3)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-windows"]],decls:7,vars:1,consts:[[1,"sidebar-component-title"],[1,"btn","btn-default"],["l10nTranslate",""],["appAutoResize","",1,"sidebar-item"],[1,"sidebar-item-container"],[1,"btn","btn-default",3,"click"],[3,"icon"],[1,"sidebar-item-container",3,"click"],[1,"sidebar-item-content"],["alt","","width","28","height","28",3,"ngSrc"],[1,"text-truncate","fs-sm","mx-1"],[1,"btn","btn-xs","btn-danger","ms-auto",3,"click"]],template:function(o,r){o&1&&(s(0,"div",0),C(1,Ty,2,1,"button",1),s(2,"span",2),d(3,"Windows Manager"),l()(),s(4,"div",3),D(5,Ey,7,3,"div",4,wy),l()),o&2&&(a(),x(r.windows.length?1:-1),a(4),M(r.windows))},dependencies:[de,F,P,Ns],encapsulation:2});let i=n;return i})();var Bm=(i,n)=>n.label,Ay=(i,n)=>n.name;function ky(i,n){if(i&1&&(s(0,"div",5)(1,"div",6),d(2),l()()),i&2){let e=c().$implicit;a(2),w(e.title)}}function Dy(i,n){i&1&&ct(0)}function My(i,n){if(i&1&&(s(0,"div",7),N(1,Dy,1,0,"ng-container",8),l()),i&2){let e=c().$implicit;a(),m("ngComponentOutlet",e)}}function Fy(i,n){if(i&1&&C(0,My,2,1,"div",7),i&2){let e=c(2).$implicit;x(e.active||e.loadComponent?0:-1)}}function Py(i,n){if(i&1&&D(0,Fy,1,1,null,null,Ay),i&2){let e=c().$implicit;M(e.components)}}function Iy(i,n){if(i&1&&(s(0,"div"),C(1,ky,3,1,"div",5),C(2,Py,2,0),l()),i&2){let e=n.$implicit,t=c();V(e.active?"d-block":"d-none"),a(),x(e.title?1:-1),a(),x(t.showComponents||e.loadComponent?2:-1)}}function Ry(i,n){if(i&1&&(s(0,"a",4),_(1,"fa-icon",9),l()),i&2){let e=c();a(),m("icon",e.icons.faWifi)}}function Ny(i,n){if(i&1&&(s(0,"span",13)(1,"span"),d(2),l()()),i&2){let e=c(2).$implicit;a(),V(q("badge bg-",e.count.level)),a(),w(n)}}function Vy(i,n){if(i&1){let e=y();s(0,"a",11),f("click",function(){h(e);let o=c().$implicit,r=c();return g(r.setTabVisible(o.label))}),_(1,"fa-icon",12),C(2,Ny,3,4,"span",13),b(3,"async"),l()}if(i&2){let e,t=c().$implicit,o=c();L("mt-auto",t.firstOfLasts)("active",o.visible&&t.active),a(),m("icon",t.icon),a(),x((e=$(3,6,t.count&&t.count.value))?2:-1,e)}}function Oy(i,n){if(i&1&&(C(0,Vy,4,8,"a",10),b(1,"async")),i&2){let e=n.$implicit;x(e.icon&&(!e.showOnCount||e.showOnCount&&e.count&&$(1,1,e.count.value))?0:-1)}}var Um=(()=>{let n=class n{constructor(){this.visible=!1,this.showComponents=!1,this.tabs=[],this.theme=yn,this.networkIsOnline=!0,this.icons={faWifi:$l},this.layout=S(I),this.store=S(te),this.subscriptions=[],this.showDelay=null,this.currentMenu=null,this.firstsTabs=[{label:fe.PROFILE,components:[Om],icon:null,title:null,active:!1},{label:fe.ONLINES,components:[Vm],icon:Gc,title:null,count:{value:pi(ve(()=>this.store.onlineUsers().filter(t=>t.onlineStatus!==Jo.OFFLINE).length)),level:"success"},showOnCount:!0,active:!1},{label:fe.NOTIFICATIONS,components:[Nm],icon:$c,title:null,count:{value:pi(ve(()=>this.store.unreadNotifications().length)),level:"warning"},active:!1},{label:fe.TASKS,components:[Rm],icon:jc,title:null,count:{value:ds([this.store.filesActiveTasks.pipe(bt(t=>t.length)),this.store.clientSyncTasksCount]).pipe(bt(([t,o])=>t+o)),level:"maroon"},active:!1}],this.lastsTabs=[{label:fe.WINDOWS,components:[Lm],icon:Kc,title:null,count:{value:this.layout.windows.pipe(bt(t=>t.length)),level:"maroon"},showOnCount:!0,firstOfLasts:!0,active:!1}],this.tabs=[...this.firstsTabs,...this.lastsTabs],this.subscriptions.push(this.layout.rightSideBarIsOpen.subscribe(t=>this.setVisible(t))),this.subscriptions.push(this.layout.rightSideBarSetTabs.subscribe(t=>this.setTabs(t))),this.subscriptions.push(this.layout.rightSideBarOpenAndShowTab.subscribe(t=>this.setTabVisible(t))),this.subscriptions.push(this.layout.rightSideBarSelectTab.subscribe(t=>this.selectTab(t))),this.subscriptions.push(this.layout.switchTheme.subscribe(t=>this.theme=t)),this.subscriptions.push(this.layout.networkIsOnline.subscribe(t=>this.networkIsOnline=t))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}setTabVisible(t){this.visible?t&&t!==this.layout.currentRightSideBarTab?this.selectTab(t):this.layout.toggleRSideBar(!1):(this.selectTab(t),this.layout.toggleRSideBar(!0))}setVisible(t){t?(clearTimeout(this.showDelay),this.showComponents=t):this.showDelay=setTimeout(()=>this.showComponents=t,500),this.visible=t}setTabs(t){t.name!==this.currentMenu&&(this.tabs=[...this.firstsTabs,...t.tabs?t.tabs:[],...this.lastsTabs],this.currentMenu=t.name,t.name===null&&!this.tabs.find(o=>o.active)&&this.layout.toggleRSideBar(!1))}selectTab(t){if(t){let o=!1;for(let r of this.tabs)r.active=r.label==t,r.active&&(o=!0,this.layout.currentRightSideBarTab=t);o||(this.tabs[0].active=!0)}}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-sidebar-right"]],decls:9,vars:6,consts:[[3,"class"],[1,"control-sidebar-menu"],[1,"sidebar-apps-icons"],[1,"menu"],[1,"bg-warning"],[1,"sidebar-title"],["l10nTranslate",""],[1,"sidebar-component-content"],[4,"ngComponentOutlet"],[1,"text-white",3,"icon"],[3,"mt-auto","active"],[3,"click"],[3,"icon"],[1,"menu-badge"]],template:function(o,r){o&1&&(s(0,"aside"),D(1,Iy,3,4,"div",0,Bm),l(),s(3,"div",1)(4,"div",2)(5,"div",3),C(6,Ry,2,1,"a",4),D(7,Oy,2,3,null,null,Bm),l()()()),o&2&&(V(q("control-sidebar control-sidebar-",r.theme)),L("control-sidebar-open",r.visible),a(),M(r.tabs),a(5),x(r.networkIsOnline?-1:6),a(),M(r.tabs))},dependencies:[F,P,Ps,rn],encapsulation:2});let i=n;return i})();var $m=(()=>{let n=class n{constructor(){this.themeMode=yn,this.document=S(To),this.layout=S(I),this.renderer=S(Dt),this.rightSideBarClass="control-sidebar-open",this.leftSideBarCollapsedClass="sidebar-collapse",this.leftSideBarOpenedClass="sidebar-open",this.isSmallerThanMediumScreen=!1,this.subscriptions=[],this.subscriptions.push(this.layout.switchTheme.subscribe(t=>this.setTheme(t))),this.subscriptions.push(this.layout.toggleRightSideBar.subscribe(t=>this.toggleRightSideBar(t))),this.subscriptions.push(this.layout.toggleLeftSideBar.subscribe(t=>this.toggleLeftSideBar(t)))}ngOnInit(){this.isSmallerThanMediumScreen=this.layout.isSmallerMediumScreen(),this.checkLeftSideBarCollapse()}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}onResize(){this.layout.resizeEvent.next();let t=this.layout.isSmallerMediumScreen();this.isSmallerThanMediumScreen!==t&&(this.isSmallerThanMediumScreen=t,this.checkLeftSideBarCollapse())}onDragOver(t){t.preventDefault()}onDrop(t){t.preventDefault()}toggleLeftSideBar(t){t===1?(this.openLeftSideBar(),this.layout.leftSideBarIsOpen.next(!0)):t===2?(this.collapseLeftSideBar(),this.layout.leftSideBarIsOpen.next(!1)):this.document.body.classList.contains(this.leftSideBarOpenedClass)?(this.collapseLeftSideBar(),this.layout.saveLeftSideBarIsOpen.next(!1),this.layout.leftSideBarIsOpen.next(!1)):(this.openLeftSideBar(),this.layout.saveLeftSideBarIsOpen.next(!0),this.layout.leftSideBarIsOpen.next(!0))}toggleRightSideBar(t){t?this.renderer.addClass(this.document.body,this.rightSideBarClass):this.renderer.removeClass(this.document.body,this.rightSideBarClass)}openLeftSideBar(){this.renderer.removeClass(this.document.body,this.leftSideBarCollapsedClass),this.renderer.addClass(this.document.body,this.leftSideBarOpenedClass)}collapseLeftSideBar(){this.renderer.removeClass(this.document.body,this.leftSideBarOpenedClass),this.renderer.addClass(this.document.body,this.leftSideBarCollapsedClass)}checkLeftSideBarCollapse(){this.isSmallerThanMediumScreen?this.toggleLeftSideBar(2):(this.layout.saveLeftSideBarIsOpen.next(!0),this.toggleLeftSideBar(1))}setTheme(t){this.renderer.removeClass(this.document.body,this.themeMode),this.themeMode=t,this.renderer.addClass(this.document.body,this.themeMode)}};n.\u0275fac=function(o){return new(o||n)},n.\u0275cmp=A({type:n,selectors:[["app-layout"]],hostBindings:function(o,r){o&1&&f("resize",function(){return r.onResize()},Eo)("dragover",function(u){return r.onDragOver(u)})("drop",function(u){return r.onDrop(u)})},decls:8,vars:0,consts:[[1,"app-main"],[1,"wrapper"],[1,"content-wrapper"],[1,"content-container"]],template:function(o,r){o&1&&(s(0,"body",0)(1,"div",1),_(2,"app-navbar")(3,"app-sidebar-left"),s(4,"div",2)(5,"div",3),_(6,"router-outlet"),l()(),_(7,"app-sidebar-right"),l()())},dependencies:[an,Pm,Im,Um],encapsulation:2});let i=n;return i})();var Hm=[{path:er.BASE,component:$m,canActivate:[Em],children:[...sd,...pd,...am,...Tm,...mm,...ed]},...Mm,...id,{path:"**",redirectTo:di.BASE}];var zm=(()=>{let n=class n{constructor(){this.injector=S(Hn),this.auth=null,this.isRefreshingToken=!1,this.waitForRefreshToken=new ps(!1),this.retryCount=3,this.retryWaitMilliSeconds=2e3}intercept(t,o){let r=dc(t.url);return r&&(t=t.clone({url:r})),o.handle(t).pipe(yo(p=>p.status===401?this.handleAuthorizationError(t,o,p):p.status===0?this.handleRetries(t,o,p):vo(()=>p)))}handleAuthorizationError(t,o,r){return this.auth||(this.auth=this.injector.get(Tt)),console.debug("AuthInterceptor:",t.url,r.status),[Ys,qs,Qs].indexOf(t.url)===-1?this.isRefreshingToken?(console.debug("AuthInterceptor: wait for refresh token"),this.waitForRefreshToken.pipe(At(p=>!p),ce(1),$n(()=>o.handle(this.auth.checkCSRF(t))))):(console.debug("AuthInterceptor: refreshing token"),this.isRefreshingToken=!0,this.waitForRefreshToken.next(!0),this.auth.refreshToken().pipe($n(()=>(this.waitForRefreshToken.next(!1),o.handle(this.auth.checkCSRF(t)))),bo(()=>this.isRefreshingToken=!1))):vo(()=>r)}handleRetries(t,o,r){return o.handle(t).pipe(_s(p=>p.pipe(ms((u,v)=>v<this.retryCount?fi(u):(u.status===0&&(u.message=tr),vo(()=>u))),us(this.retryWaitMilliSeconds))))}};n.\u0275fac=function(o){return new(o||n)},n.\u0275prov=kt({token:n,factory:n.\u0275fac,providedIn:"root"});let i=n;return i})();function Gm(){return Object.assign(new Po,{adaptivePosition:!1,triggers:"hover",delay:600})}var Wm={url:"",options:{autoConnect:!1,reconnection:!0,forceNew:!1,transports:["websocket"]}};var jm={providers:[As({eventCoalescing:!0}),{provide:Ds,useClass:Fs},{provide:Us,useClass:zm,multi:!0},js(Hm),$s(Hs(),zs({cookieName:fa,headerName:fa})),el(Ql,re({storage:Yl,translationLoader:Xl},ks()?{missingTranslationHandler:Zl}:{})),tl(),Zp(),ol({positionClass:"toast-top-center",preventDuplicates:!1,maxOpened:6,autoDismiss:!0,timeOut:6e3}),{provide:Po,useFactory:Gm},il,hs(nl.forRoot(Wm))]};Os(tp,jm).catch(console.error);