@sync-in/server 1.5.2 → 1.6.1

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 (355) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +2 -1
  3. package/environment/environment.dist.min.yaml +1 -0
  4. package/environment/environment.dist.yaml +88 -30
  5. package/migrations/0002_sleepy_korath.sql +1 -0
  6. package/migrations/meta/0002_snapshot.json +2424 -0
  7. package/migrations/meta/_journal.json +7 -0
  8. package/package.json +14 -12
  9. package/server/app.bootstrap.js +1 -1
  10. package/server/app.bootstrap.js.map +1 -1
  11. package/server/applications/files/services/files-manager.service.js +1 -2
  12. package/server/applications/files/services/files-manager.service.js.map +1 -1
  13. package/server/applications/files/services/files-only-office-manager.service.js +5 -6
  14. package/server/applications/files/services/files-only-office-manager.service.js.map +1 -1
  15. package/server/applications/files/utils/files.js +6 -4
  16. package/server/applications/files/utils/files.js.map +1 -1
  17. package/server/applications/links/links.controller.js +2 -2
  18. package/server/applications/links/links.controller.js.map +1 -1
  19. package/server/applications/links/services/links-manager.service.js +2 -1
  20. package/server/applications/links/services/links-manager.service.js.map +1 -1
  21. package/server/applications/links/services/links-manager.service.spec.js +6 -3
  22. package/server/applications/links/services/links-manager.service.spec.js.map +1 -1
  23. package/server/applications/notifications/constants/notifications.js +9 -0
  24. package/server/applications/notifications/constants/notifications.js.map +1 -1
  25. package/server/applications/notifications/i18n/fr.js +10 -1
  26. package/server/applications/notifications/i18n/fr.js.map +1 -1
  27. package/server/applications/notifications/interfaces/notification-properties.interface.js.map +1 -1
  28. package/server/applications/notifications/mails/models.js +41 -3
  29. package/server/applications/notifications/mails/models.js.map +1 -1
  30. package/server/applications/notifications/mails/templates.js +1 -1
  31. package/server/applications/notifications/mails/templates.js.map +1 -1
  32. package/server/applications/notifications/schemas/notifications.schema.js +2 -1
  33. package/server/applications/notifications/schemas/notifications.schema.js.map +1 -1
  34. package/server/applications/notifications/services/notifications-manager.service.js +16 -13
  35. package/server/applications/notifications/services/notifications-manager.service.js.map +1 -1
  36. package/server/applications/notifications/services/notifications-manager.service.spec.js +9 -8
  37. package/server/applications/notifications/services/notifications-manager.service.spec.js.map +1 -1
  38. package/server/applications/notifications/services/notifications-queries.service.js +1 -1
  39. package/server/applications/notifications/services/notifications-queries.service.js.map +1 -1
  40. package/server/applications/shares/services/shares-manager.service.js +3 -2
  41. package/server/applications/shares/services/shares-manager.service.js.map +1 -1
  42. package/server/applications/sync/constants/auth.js +2 -2
  43. package/server/applications/sync/constants/auth.js.map +1 -1
  44. package/server/applications/sync/dtos/sync-client-registration.dto.js +5 -0
  45. package/server/applications/sync/dtos/sync-client-registration.dto.js.map +1 -1
  46. package/server/applications/sync/dtos/sync-operations.dto.js +1 -2
  47. package/server/applications/sync/dtos/sync-operations.dto.js.map +1 -1
  48. package/server/applications/sync/schemas/sync-clients.schema.js +2 -1
  49. package/server/applications/sync/schemas/sync-clients.schema.js.map +1 -1
  50. package/server/applications/sync/schemas/sync-paths.schema.js +2 -1
  51. package/server/applications/sync/schemas/sync-paths.schema.js.map +1 -1
  52. package/server/applications/sync/services/sync-clients-manager.service.js +28 -20
  53. package/server/applications/sync/services/sync-clients-manager.service.js.map +1 -1
  54. package/server/applications/sync/services/sync-clients-manager.service.spec.js +24 -18
  55. package/server/applications/sync/services/sync-clients-manager.service.spec.js.map +1 -1
  56. package/server/applications/sync/services/sync-queries.service.js +5 -5
  57. package/server/applications/sync/services/sync-queries.service.js.map +1 -1
  58. package/server/applications/users/admin-users.controller.js +48 -37
  59. package/server/applications/users/admin-users.controller.js.map +1 -1
  60. package/server/applications/users/admin-users.controller.spec.js +15 -0
  61. package/server/applications/users/admin-users.controller.spec.js.map +1 -1
  62. package/server/applications/users/constants/routes.js +5 -0
  63. package/server/applications/users/constants/routes.js.map +1 -1
  64. package/server/applications/users/constants/user.js +8 -0
  65. package/server/applications/users/constants/user.js.map +1 -1
  66. package/server/applications/users/dto/delete-user.dto.js +5 -23
  67. package/server/applications/users/dto/delete-user.dto.js.map +1 -1
  68. package/server/applications/users/dto/user-properties.dto.js +38 -3
  69. package/server/applications/users/dto/user-properties.dto.js.map +1 -1
  70. package/server/applications/users/interfaces/admin-user.interface.js.map +1 -1
  71. package/server/applications/users/interfaces/user-secrets.interface.js +10 -0
  72. package/server/applications/users/interfaces/user-secrets.interface.js.map +1 -0
  73. package/server/applications/users/models/user.model.js +84 -50
  74. package/server/applications/users/models/user.model.js.map +1 -1
  75. package/server/applications/users/schemas/user.interface.js.map +1 -1
  76. package/server/applications/users/schemas/users.schema.js +2 -0
  77. package/server/applications/users/schemas/users.schema.js.map +1 -1
  78. package/server/applications/users/services/admin-users-manager.service.js +7 -19
  79. package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
  80. package/server/applications/users/services/admin-users-manager.service.spec.js +7 -26
  81. package/server/applications/users/services/admin-users-manager.service.spec.js.map +1 -1
  82. package/server/applications/users/services/admin-users-queries.service.js +1 -0
  83. package/server/applications/users/services/admin-users-queries.service.js.map +1 -1
  84. package/server/applications/users/services/users-manager.service.js +138 -28
  85. package/server/applications/users/services/users-manager.service.js.map +1 -1
  86. package/server/applications/users/services/users-manager.service.spec.js +11 -9
  87. package/server/applications/users/services/users-manager.service.spec.js.map +1 -1
  88. package/server/applications/users/services/users-queries.service.js +63 -57
  89. package/server/applications/users/services/users-queries.service.js.map +1 -1
  90. package/server/applications/users/users.controller.js +48 -1
  91. package/server/applications/users/users.controller.js.map +1 -1
  92. package/server/applications/users/users.controller.spec.js +8 -1
  93. package/server/applications/users/users.controller.spec.js.map +1 -1
  94. package/server/applications/users/users.e2e-spec.js +2 -1
  95. package/server/applications/users/users.e2e-spec.js.map +1 -1
  96. package/server/applications/users/utils/avatar.js +48 -0
  97. package/server/applications/users/utils/avatar.js.map +1 -0
  98. package/server/authentication/auth.config.js +89 -26
  99. package/server/authentication/auth.config.js.map +1 -1
  100. package/server/authentication/auth.controller.js +117 -9
  101. package/server/authentication/auth.controller.js.map +1 -1
  102. package/server/authentication/auth.controller.spec.js +16 -1
  103. package/server/authentication/auth.controller.spec.js.map +1 -1
  104. package/server/authentication/auth.e2e-spec.js +4 -3
  105. package/server/authentication/auth.e2e-spec.js.map +1 -1
  106. package/server/authentication/auth.module.js +4 -1
  107. package/server/authentication/auth.module.js.map +1 -1
  108. package/server/authentication/constants/auth-ldap.js +44 -0
  109. package/server/authentication/constants/auth-ldap.js.map +1 -0
  110. package/server/authentication/constants/auth.js +37 -4
  111. package/server/authentication/constants/auth.js.map +1 -1
  112. package/server/authentication/constants/routes.js +21 -0
  113. package/server/authentication/constants/routes.js.map +1 -1
  114. package/server/authentication/constants/scope.js +20 -0
  115. package/server/authentication/constants/scope.js.map +1 -0
  116. package/server/authentication/dto/login-response.dto.js +27 -4
  117. package/server/authentication/dto/login-response.dto.js.map +1 -1
  118. package/server/authentication/dto/token-response.dto.js +5 -0
  119. package/server/authentication/dto/token-response.dto.js.map +1 -1
  120. package/server/{applications/users/dto/user-password.dto.js → authentication/dto/two-fa-verify.dto.js} +27 -9
  121. package/server/authentication/dto/two-fa-verify.dto.js.map +1 -0
  122. package/server/authentication/guards/auth-basic.strategy.js +6 -5
  123. package/server/authentication/guards/auth-basic.strategy.js.map +1 -1
  124. package/server/authentication/guards/auth-token-access.strategy.js +3 -2
  125. package/server/authentication/guards/auth-token-access.strategy.js.map +1 -1
  126. package/server/authentication/guards/auth-token-refresh.strategy.js +3 -2
  127. package/server/authentication/guards/auth-token-refresh.strategy.js.map +1 -1
  128. package/server/authentication/guards/auth-two-fa-guard.js +81 -0
  129. package/server/authentication/guards/auth-two-fa-guard.js.map +1 -0
  130. package/server/authentication/interfaces/jwt-payload.interface.js +5 -0
  131. package/server/authentication/interfaces/jwt-payload.interface.js.map +1 -1
  132. package/server/authentication/interfaces/token.interface.js +2 -0
  133. package/server/authentication/interfaces/token.interface.js.map +1 -1
  134. package/server/authentication/interfaces/two-fa-setup.interface.js +10 -0
  135. package/server/authentication/interfaces/two-fa-setup.interface.js.map +1 -0
  136. package/server/authentication/models/auth-method.js.map +1 -1
  137. package/server/authentication/services/auth-manager.service.js +72 -49
  138. package/server/authentication/services/auth-manager.service.js.map +1 -1
  139. package/server/authentication/services/auth-methods/auth-method-database.service.js +3 -3
  140. package/server/authentication/services/auth-methods/auth-method-database.service.js.map +1 -1
  141. package/server/authentication/services/auth-methods/auth-method-database.service.spec.js +5 -0
  142. package/server/authentication/services/auth-methods/auth-method-database.service.spec.js.map +1 -1
  143. package/server/authentication/services/auth-methods/auth-method-ldap.service.js +151 -66
  144. package/server/authentication/services/auth-methods/auth-method-ldap.service.js.map +1 -1
  145. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js +52 -50
  146. package/server/authentication/services/auth-methods/auth-method-ldap.service.spec.js.map +1 -1
  147. package/server/authentication/services/auth-methods/auth-method-two-fa.service.js +251 -0
  148. package/server/authentication/services/auth-methods/auth-method-two-fa.service.js.map +1 -0
  149. package/server/authentication/services/auth-methods/auth-method-two-fa.service.spec.js +41 -0
  150. package/server/authentication/services/auth-methods/auth-method-two-fa.service.spec.js.map +1 -0
  151. package/server/authentication/utils/crypt-secret.js +68 -0
  152. package/server/authentication/utils/crypt-secret.js.map +1 -0
  153. package/server/common/functions.js +18 -2
  154. package/server/common/functions.js.map +1 -1
  155. package/server/common/qrcode.js +34 -0
  156. package/server/common/qrcode.js.map +1 -0
  157. package/server/common/shared.js +18 -0
  158. package/server/common/shared.js.map +1 -1
  159. package/server/configuration/config.environment.js +23 -6
  160. package/server/configuration/config.environment.js.map +1 -1
  161. package/server/configuration/config.interfaces.js +10 -0
  162. package/server/configuration/config.interfaces.js.map +1 -0
  163. package/server/configuration/config.loader.js.map +1 -1
  164. package/server/configuration/config.validation.js +13 -13
  165. package/server/configuration/config.validation.js.map +1 -1
  166. package/server/infrastructure/cache/adapters/mysql-cache.adapter.js +6 -6
  167. package/server/infrastructure/cache/adapters/mysql-cache.adapter.js.map +1 -1
  168. package/server/infrastructure/cache/schemas/mysql-cache.schema.js +2 -1
  169. package/server/infrastructure/cache/schemas/mysql-cache.schema.js.map +1 -1
  170. package/server/infrastructure/cache/services/cache.service.js.map +1 -1
  171. package/server/infrastructure/database/columns.js +39 -0
  172. package/server/infrastructure/database/columns.js.map +1 -0
  173. package/server/infrastructure/database/database.config.js +0 -1
  174. package/server/infrastructure/database/database.config.js.map +1 -1
  175. package/server/infrastructure/mailer/interfaces/mail.interface.js.map +1 -1
  176. package/server/infrastructure/mailer/mailer.config.js +12 -0
  177. package/server/infrastructure/mailer/mailer.config.js.map +1 -1
  178. package/server/infrastructure/mailer/mailer.service.js +2 -1
  179. package/server/infrastructure/mailer/mailer.service.js.map +1 -1
  180. package/static/assets/mimes/text-x-c.svg +1 -0
  181. package/static/assets/pdfjs/build/pdf.mjs +2522 -914
  182. package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
  183. package/static/assets/pdfjs/build/pdf.sandbox.mjs +2 -2
  184. package/static/assets/pdfjs/build/pdf.worker.mjs +1024 -566
  185. package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
  186. package/static/assets/pdfjs/version +1 -1
  187. package/static/assets/pdfjs/web/debugger.mjs +116 -37
  188. package/static/assets/pdfjs/web/images/comment-popup-editButton.svg +5 -0
  189. package/static/assets/pdfjs/web/locale/ach/viewer.ftl +0 -12
  190. package/static/assets/pdfjs/web/locale/af/viewer.ftl +0 -12
  191. package/static/assets/pdfjs/web/locale/an/viewer.ftl +0 -16
  192. package/static/assets/pdfjs/web/locale/ar/viewer.ftl +0 -32
  193. package/static/assets/pdfjs/web/locale/ast/viewer.ftl +0 -19
  194. package/static/assets/pdfjs/web/locale/az/viewer.ftl +0 -16
  195. package/static/assets/pdfjs/web/locale/be/viewer.ftl +0 -32
  196. package/static/assets/pdfjs/web/locale/bg/viewer.ftl +0 -32
  197. package/static/assets/pdfjs/web/locale/bn/viewer.ftl +0 -16
  198. package/static/assets/pdfjs/web/locale/bo/viewer.ftl +0 -12
  199. package/static/assets/pdfjs/web/locale/br/viewer.ftl +0 -22
  200. package/static/assets/pdfjs/web/locale/brx/viewer.ftl +0 -16
  201. package/static/assets/pdfjs/web/locale/bs/viewer.ftl +0 -32
  202. package/static/assets/pdfjs/web/locale/ca/viewer.ftl +12 -23
  203. package/static/assets/pdfjs/web/locale/cak/viewer.ftl +0 -23
  204. package/static/assets/pdfjs/web/locale/ckb/viewer.ftl +0 -16
  205. package/static/assets/pdfjs/web/locale/cs/viewer.ftl +0 -32
  206. package/static/assets/pdfjs/web/locale/cy/viewer.ftl +0 -32
  207. package/static/assets/pdfjs/web/locale/da/viewer.ftl +3 -35
  208. package/static/assets/pdfjs/web/locale/de/viewer.ftl +0 -32
  209. package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +0 -32
  210. package/static/assets/pdfjs/web/locale/el/viewer.ftl +0 -32
  211. package/static/assets/pdfjs/web/locale/en-CA/viewer.ftl +0 -32
  212. package/static/assets/pdfjs/web/locale/en-GB/viewer.ftl +0 -32
  213. package/static/assets/pdfjs/web/locale/en-US/viewer.ftl +25 -13
  214. package/static/assets/pdfjs/web/locale/eo/viewer.ftl +0 -32
  215. package/static/assets/pdfjs/web/locale/es-AR/viewer.ftl +0 -32
  216. package/static/assets/pdfjs/web/locale/es-CL/viewer.ftl +0 -32
  217. package/static/assets/pdfjs/web/locale/es-ES/viewer.ftl +5 -32
  218. package/static/assets/pdfjs/web/locale/es-MX/viewer.ftl +0 -32
  219. package/static/assets/pdfjs/web/locale/et/viewer.ftl +0 -16
  220. package/static/assets/pdfjs/web/locale/eu/viewer.ftl +38 -32
  221. package/static/assets/pdfjs/web/locale/fa/viewer.ftl +0 -19
  222. package/static/assets/pdfjs/web/locale/ff/viewer.ftl +0 -12
  223. package/static/assets/pdfjs/web/locale/fi/viewer.ftl +0 -32
  224. package/static/assets/pdfjs/web/locale/fr/viewer.ftl +0 -32
  225. package/static/assets/pdfjs/web/locale/fur/viewer.ftl +0 -32
  226. package/static/assets/pdfjs/web/locale/fy-NL/viewer.ftl +0 -32
  227. package/static/assets/pdfjs/web/locale/ga-IE/viewer.ftl +0 -12
  228. package/static/assets/pdfjs/web/locale/gd/viewer.ftl +0 -23
  229. package/static/assets/pdfjs/web/locale/gl/viewer.ftl +0 -32
  230. package/static/assets/pdfjs/web/locale/gn/viewer.ftl +0 -32
  231. package/static/assets/pdfjs/web/locale/gu-IN/viewer.ftl +0 -12
  232. package/static/assets/pdfjs/web/locale/he/viewer.ftl +0 -32
  233. package/static/assets/pdfjs/web/locale/hi-IN/viewer.ftl +0 -16
  234. package/static/assets/pdfjs/web/locale/hr/viewer.ftl +0 -32
  235. package/static/assets/pdfjs/web/locale/hsb/viewer.ftl +0 -32
  236. package/static/assets/pdfjs/web/locale/hu/viewer.ftl +0 -32
  237. package/static/assets/pdfjs/web/locale/hy-AM/viewer.ftl +372 -16
  238. package/static/assets/pdfjs/web/locale/hye/viewer.ftl +0 -16
  239. package/static/assets/pdfjs/web/locale/ia/viewer.ftl +0 -32
  240. package/static/assets/pdfjs/web/locale/id/viewer.ftl +38 -32
  241. package/static/assets/pdfjs/web/locale/is/viewer.ftl +27 -32
  242. package/static/assets/pdfjs/web/locale/it/viewer.ftl +0 -33
  243. package/static/assets/pdfjs/web/locale/ja/viewer.ftl +31 -33
  244. package/static/assets/pdfjs/web/locale/ka/viewer.ftl +0 -32
  245. package/static/assets/pdfjs/web/locale/kab/viewer.ftl +0 -32
  246. package/static/assets/pdfjs/web/locale/kk/viewer.ftl +31 -32
  247. package/static/assets/pdfjs/web/locale/km/viewer.ftl +0 -12
  248. package/static/assets/pdfjs/web/locale/kn/viewer.ftl +0 -12
  249. package/static/assets/pdfjs/web/locale/ko/viewer.ftl +0 -32
  250. package/static/assets/pdfjs/web/locale/lij/viewer.ftl +0 -12
  251. package/static/assets/pdfjs/web/locale/lo/viewer.ftl +0 -23
  252. package/static/assets/pdfjs/web/locale/lt/viewer.ftl +0 -16
  253. package/static/assets/pdfjs/web/locale/ltg/viewer.ftl +0 -12
  254. package/static/assets/pdfjs/web/locale/lv/viewer.ftl +0 -12
  255. package/static/assets/pdfjs/web/locale/meh/viewer.ftl +0 -14
  256. package/static/assets/pdfjs/web/locale/mk/viewer.ftl +0 -19
  257. package/static/assets/pdfjs/web/locale/ml/viewer.ftl +0 -31
  258. package/static/assets/pdfjs/web/locale/mr/viewer.ftl +0 -16
  259. package/static/assets/pdfjs/web/locale/ms/viewer.ftl +0 -12
  260. package/static/assets/pdfjs/web/locale/my/viewer.ftl +0 -12
  261. package/static/assets/pdfjs/web/locale/nb-NO/viewer.ftl +0 -32
  262. package/static/assets/pdfjs/web/locale/ne-NP/viewer.ftl +0 -12
  263. package/static/assets/pdfjs/web/locale/nl/viewer.ftl +0 -32
  264. package/static/assets/pdfjs/web/locale/nn-NO/viewer.ftl +0 -32
  265. package/static/assets/pdfjs/web/locale/oc/viewer.ftl +0 -24
  266. package/static/assets/pdfjs/web/locale/pa-IN/viewer.ftl +0 -32
  267. package/static/assets/pdfjs/web/locale/pl/viewer.ftl +0 -32
  268. package/static/assets/pdfjs/web/locale/pt-BR/viewer.ftl +0 -32
  269. package/static/assets/pdfjs/web/locale/pt-PT/viewer.ftl +0 -32
  270. package/static/assets/pdfjs/web/locale/rm/viewer.ftl +0 -32
  271. package/static/assets/pdfjs/web/locale/ro/viewer.ftl +5 -37
  272. package/static/assets/pdfjs/web/locale/ru/viewer.ftl +0 -32
  273. package/static/assets/pdfjs/web/locale/sat/viewer.ftl +0 -23
  274. package/static/assets/pdfjs/web/locale/sc/viewer.ftl +8 -27
  275. package/static/assets/pdfjs/web/locale/sco/viewer.ftl +0 -16
  276. package/static/assets/pdfjs/web/locale/si/viewer.ftl +0 -22
  277. package/static/assets/pdfjs/web/locale/sk/viewer.ftl +0 -32
  278. package/static/assets/pdfjs/web/locale/skr/viewer.ftl +0 -32
  279. package/static/assets/pdfjs/web/locale/sl/viewer.ftl +30 -32
  280. package/static/assets/pdfjs/web/locale/son/viewer.ftl +0 -12
  281. package/static/assets/pdfjs/web/locale/sq/viewer.ftl +0 -32
  282. package/static/assets/pdfjs/web/locale/sr/viewer.ftl +0 -32
  283. package/static/assets/pdfjs/web/locale/sv-SE/viewer.ftl +0 -32
  284. package/static/assets/pdfjs/web/locale/szl/viewer.ftl +0 -16
  285. package/static/assets/pdfjs/web/locale/ta/viewer.ftl +0 -12
  286. package/static/assets/pdfjs/web/locale/te/viewer.ftl +0 -16
  287. package/static/assets/pdfjs/web/locale/tg/viewer.ftl +0 -32
  288. package/static/assets/pdfjs/web/locale/th/viewer.ftl +38 -32
  289. package/static/assets/pdfjs/web/locale/tl/viewer.ftl +0 -16
  290. package/static/assets/pdfjs/web/locale/tr/viewer.ftl +0 -32
  291. package/static/assets/pdfjs/web/locale/trs/viewer.ftl +0 -12
  292. package/static/assets/pdfjs/web/locale/uk/viewer.ftl +0 -32
  293. package/static/assets/pdfjs/web/locale/ur/viewer.ftl +0 -16
  294. package/static/assets/pdfjs/web/locale/uz/viewer.ftl +0 -12
  295. package/static/assets/pdfjs/web/locale/vi/viewer.ftl +0 -32
  296. package/static/assets/pdfjs/web/locale/xh/viewer.ftl +0 -12
  297. package/static/assets/pdfjs/web/locale/zh-CN/viewer.ftl +0 -32
  298. package/static/assets/pdfjs/web/locale/zh-TW/viewer.ftl +0 -32
  299. package/static/assets/pdfjs/web/viewer.css +586 -437
  300. package/static/assets/pdfjs/web/viewer.html +12 -23
  301. package/static/assets/pdfjs/web/viewer.mjs +955 -514
  302. package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
  303. package/static/assets/pdfjs/web/wasm/openjpeg.wasm +0 -0
  304. package/static/assets/pdfjs/web/wasm/openjpeg_nowasm_fallback.js +10 -22
  305. package/static/{chunk-SPTF6FSM.js → chunk-27YQB3TE.js} +1 -1
  306. package/static/chunk-2I4CUFUA.js +1 -0
  307. package/static/chunk-2MTM6SWN.js +4 -0
  308. package/static/{chunk-7VRUZRJG.js → chunk-34MKICK5.js} +2 -2
  309. package/static/chunk-5O3DIUU3.js +1 -0
  310. package/static/{chunk-VJRTMDEJ.js → chunk-6NMVZIIT.js} +1 -1
  311. package/static/{chunk-L6MU6S2V.js → chunk-7DN7ZAPU.js} +1 -1
  312. package/static/{chunk-MVO4WZLK.js → chunk-7FUM3JGM.js} +1 -1
  313. package/static/{chunk-RSS6GYNE.js → chunk-7ITZXYYJ.js} +1 -1
  314. package/static/chunk-7P27WBGC.js +4 -0
  315. package/static/chunk-ATP3BFHV.js +562 -0
  316. package/static/chunk-AWQ2YTVC.js +1 -0
  317. package/static/chunk-DSOE3FEP.js +1 -0
  318. package/static/{chunk-2R6HHGUR.js → chunk-EFKMBLRE.js} +1 -1
  319. package/static/chunk-FUFKVHPU.js +1 -0
  320. package/static/{chunk-MRSWNAVB.js → chunk-HCDLWTMW.js} +1 -1
  321. package/static/chunk-IPAC4VAF.js +1 -0
  322. package/static/{chunk-ZC5NIT55.js → chunk-IQOALFYU.js} +1 -1
  323. package/static/chunk-JASU3CIH.js +1 -0
  324. package/static/{chunk-6OJZWYRZ.js → chunk-JQ5FTO2M.js} +1 -1
  325. package/static/chunk-JUNZFADM.js +1 -0
  326. package/static/{chunk-LLWSLOSX.js → chunk-LJUKI4SQ.js} +1 -1
  327. package/static/{chunk-WI7FOANP.js → chunk-LUWQFIWR.js} +1 -1
  328. package/static/{chunk-BIUNUYZ5.js → chunk-ORMRCEGT.js} +1 -1
  329. package/static/{chunk-IZL7JPTS.js → chunk-Q7D6RN4N.js} +1 -1
  330. package/static/{chunk-JYXLQRHG.js → chunk-QJX6ITLW.js} +1 -1
  331. package/static/{chunk-YJMN3B4N.js → chunk-QQ6UQQBR.js} +1 -1
  332. package/static/chunk-S2HDY3OL.js +1 -0
  333. package/static/{chunk-NE4NDO45.js → chunk-S75P2FFI.js} +1 -1
  334. package/static/{chunk-CRQNEHTX.js → chunk-T3EYFSVZ.js} +1 -1
  335. package/static/{chunk-MCLQFZ3S.js → chunk-U34OZUZ7.js} +1 -1
  336. package/static/chunk-Y7EH7G5K.js +1 -0
  337. package/static/{chunk-MGGT6MIJ.js → chunk-ZQQPUYLU.js} +1 -1
  338. package/static/index.html +2 -2
  339. package/static/main-7SQDDVMD.js +9 -0
  340. package/static/{styles-FYUSO6OJ.css → styles-A5VYX3CE.css} +1 -1
  341. package/server/applications/users/dto/user-password.dto.js.map +0 -1
  342. package/static/chunk-4U5A2DEP.js +0 -4
  343. package/static/chunk-54EAZ2UD.js +0 -1
  344. package/static/chunk-7ZRXJONB.js +0 -1
  345. package/static/chunk-F2J2IIJE.js +0 -1
  346. package/static/chunk-FNFGUIQH.js +0 -4
  347. package/static/chunk-GGLK52CG.js +0 -1
  348. package/static/chunk-HW2H3ISM.js +0 -559
  349. package/static/chunk-HX6BBYVD.js +0 -1
  350. package/static/chunk-JF7S3UYQ.js +0 -1
  351. package/static/chunk-KSHPKI4G.js +0 -1
  352. package/static/chunk-VPJ2V27B.js +0 -1
  353. package/static/chunk-VUI3KV7V.js +0 -1
  354. package/static/chunk-ZXS4V7J2.js +0 -1
  355. package/static/main-FFIWFD2F.js +0 -7
@@ -1 +0,0 @@
1
- import{a as Se}from"./chunk-MGGT6MIJ.js";import{a as Q}from"./chunk-WI7FOANP.js";import"./chunk-NE4NDO45.js";import{a as N,b as O,c as ye,d as be}from"./chunk-54EAZ2UD.js";import{b as we,c as ve,d as Te,e as Le}from"./chunk-F2J2IIJE.js";import"./chunk-MVO4WZLK.js";import"./chunk-7ZRXJONB.js";import"./chunk-JF7S3UYQ.js";import"./chunk-VPJ2V27B.js";import{Gb as ge,Ib as ke,Ja as Ce,Xa as fe,kb as xe,pa as de,qa as me,ra as ue,v as X,w as Z,wb as he}from"./chunk-4U5A2DEP.js";import"./chunk-22EANI6R.js";import{b as K}from"./chunk-BIUNUYZ5.js";import{Cb as C,Eb as l,Ed as Y,Fd as J,Ga as D,Gc as q,Ib as L,If as se,Jb as S,Kb as V,L as U,Ma as r,Mb as F,Nb as P,Ob as M,Oe as oe,Pb as u,Qb as v,Rb as I,Sb as B,Ue as re,Uf as ce,Vf as pe,Wd as ee,Xa as W,Xb as R,Yb as H,Zc as j,Zf as _e,ab as T,ce as te,dc as k,fc as y,ha as w,ib as z,ie,jb as x,kb as h,ma as d,na as m,nb as A,ob as $,of as ae,pb as _,qb as s,rb as c,sb as f,te as ne,tf as le,yd as G,zb as b}from"./chunk-HW2H3ISM.js";import"./chunk-RTRJ3KFH.js";var Me=["MainContextMenu"],Ee=["TargetContextMenu"],Ve=(t,a)=>a.id,Fe=(t,a)=>a.key;function Ae(t,a){if(t&1&&(s(0,"span",30),u(1),c()),t&2){let e=l().$implicit,i=l(2);F("font-size",i.galleryMode.textSize,"px"),r(),I(" ",e.hTimeAccessAgo," ")}}function $e(t,a){if(t&1){let e=b();s(0,"div",21),C("click",function(){let o=d(e).$implicit,n=l(2);return m(n.onSelect(o))})("contextmenu",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("pressup",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("tap",function(){d(e);let o=l(2);return m(o.openLinkDialog())}),s(1,"div",22)(2,"img",23),C("error",function(){let o=d(e).$implicit;return m(o.fallBackMimeUrl())}),c(),s(3,"span",24),x(4,Ae,2,3,"span",25),c(),s(5,"span",26),f(6,"app-share-repository",27),c()(),s(7,"div",28)(8,"span",29),u(9),c()()()}if(t&2){let e=a.$implicit,i=a.$index,o=l(2);F("height",o.galleryMode.dimensions,"px")("width",o.galleryMode.dimensions,"px"),P("selected",e.id===(o.selected==null?null:o.selected.id))("disabled",!e.link.isActive),r(),z("rowIndex",i),r(),_("src",e.mimeUrl,D)("height",o.galleryMode.image)("width",o.galleryMode.image),r(2),h(e.newly?4:-1),r(2),_("share",e)("galleryMode",o.galleryMode),r(2),F("font-size",o.galleryMode.textSize,"px"),r(),v(e.name)}}function Pe(t,a){if(t&1){let e=b();s(0,"div",13)(1,"app-virtual-scroll",18),k(2,"searchFilter"),C("contextmenu",function(o){d(e);let n=l();return m(n.onContextMenu(o))}),s(3,"div",19),A(4,$e,10,18,"div",20,Ve),c()()()}if(t&2){let e=l();r(),_("childHeight",e.galleryMode.dimensions)("childWidth",e.galleryMode.dimensions)("items",y(2,5,e.shares,e.inputFilter.search()))("galleryMode",!0)("resizeOffset",110),r(3),$(e.scrollView==null?null:e.scrollView.viewPortItems)}}function Ie(t,a){if(t&1&&f(0,"fa-icon",37),t&2){let e=l(4);_("icon",e.sortTable.sortParam.asc?e.icons.faArrowDown:e.icons.faArrowUp)("fixedWidth",!1)}}function Be(t,a){if(t&1){let e=b();s(0,"th",36),C("click",function(){d(e);let o=l().$implicit,n=l(2);return m(n.sortBy(o.key))}),u(1),x(2,Ie,1,2,"fa-icon",37),c()}if(t&2){let e=l().$implicit,i=l(2);M(e.value.class),F("width",e.value.width,"%"),P("text-align-center",e.value.textCenter)("cursor-pointer",e.value.sortable),r(),I(" ",e.value.label," "),r(),h(i.sortTable.sortParam.column===e.key?2:-1)}}function Re(t,a){if(t&1&&x(0,Be,3,10,"th",35),t&2){let e=a.$implicit;h(e.value.show?0:-1)}}function De(t,a){if(t&1){let e=b();s(0,"div",40)(1,"img",43),C("error",function(){d(e);let o=l(3).$implicit;return m(o.fallBackMimeUrl())}),c(),s(2,"div",44)(3,"span",29),u(4),c(),s(5,"span",45),u(6),c()()()}if(t&2){let e=l(3).$implicit;r(),_("src",e.mimeUrl,D),r(3),v(e.name),r(2),v(e.description)}}function Ne(t,a){if(t&1&&(s(0,"span"),u(1),c()),t&2){let e=l(4).$implicit;r(),v(e.link.email||"")}}function Oe(t,a){if(t&1&&(s(0,"span",41)(1,"span"),u(2),c(),x(3,Ne,2,1,"span"),c()),t&2){let e=l(3).$implicit;r(2),v(e.link.name),r(),h(e.link.email?3:-1)}}function Qe(t,a){if(t&1&&f(0,"app-share-repository",42),t&2){let e=l(3).$implicit;_("share",e)}}function Ue(t,a){if(t&1&&(s(0,"span"),u(1),c()),t&2){let e=l(4).$implicit;M(R("badge rounded-pill ",e.link.nbAccess>=e.link.limitAccess?"bg-danger":"bg-success")),r(),B(" ",e.link.nbAccess,"/",e.link.limitAccess," ")}}function We(t,a){if(t&1&&(s(0,"span",47),u(1),c()),t&2){let e=l(4).$implicit;r(),v(e.link.nbAccess)}}function ze(t,a){if(t&1&&(s(0,"span",49),u(1),k(2,"translate"),c()),t&2){let e=l(5).$implicit,i=l(2);r(),B("",e.hTimeExpirationAgo,"\xA0",y(2,2,e.hTimeExpirationAgo===1?"day":"days",i.locale.language))}}function He(t,a){if(t&1&&(s(0,"span"),f(1,"fa-icon",37),x(2,ze,3,5,"span",49),c()),t&2){let e=l(4).$implicit,i=l(2);M(R("badge rounded-pill bg-",e.hTimeExpirationAgo>=1?"warning":"danger"," ms-1")),r(),_("icon",i.icons.faClock)("fixedWidth",!1),r(),h(e.hTimeExpirationAgo>=1?2:-1)}}function qe(t,a){if(t&1&&(s(0,"span",48),f(1,"fa-icon",6),c()),t&2){let e=l(6);r(),_("icon",e.icons.faLock)}}function Ke(t,a){if(t&1&&(x(0,Ue,2,5,"span",46)(1,We,2,1,"span",47),x(2,He,3,6,"span",46),x(3,qe,2,1,"span",48)),t&2){let e=l(3).$implicit;h(e.link.limitAccess?0:1),r(2),h(e.link.expiresAt?2:-1),r(),h(e.link.requireAuth?3:-1)}}function je(t,a){if(t&1&&f(0,"app-file-permissions",50),t&2){let e=l(4).$implicit;_("permissions",e.hPerms)}}function Ge(t,a){if(t&1&&x(0,je,1,1,"app-file-permissions",50),t&2){let e=l(3).$implicit;h(e.link.permissions?0:-1)}}function Ye(t,a){if(t&1&&u(0),t&2){let e=l(4).$implicit;I(" ",e.hTimeAccessAgo," ")}}function Je(t,a){t&1&&(s(0,"span",51),u(1,"never"),c())}function Xe(t,a){if(t&1&&x(0,Ye,1,1)(1,Je,2,0,"span",51),t&2){let e=l(3).$implicit;h(e.link.currentAccess?0:1)}}function Ze(t,a){if(t&1&&(s(0,"td"),x(1,De,7,3,"div",40)(2,Oe,4,2,"span",41)(3,Qe,1,1,"app-share-repository",42)(4,Ke,4,3)(5,Ge,1,1)(6,Xe,2,1),c()),t&2){let e,i=l().$implicit,o=l().$implicit;M(H("",i.value.class," ",i.value.newly!==void 0?"props-newly-"+o[i.value.newly]:"")),F("width",i.value.width,"%"),P("text-align-center",i.value.textCenter),r(),h((e=i.key)==="name"?1:e==="link"?2:e==="from"?3:e==="infos"?4:e==="permissions"?5:e==="accessed"?6:-1)}}function et(t,a){if(t&1&&x(0,Ze,7,9,"td",39),t&2){let e=a.$implicit;h(e.value.show?0:-1)}}function tt(t,a){if(t&1){let e=b();s(0,"tr",38),C("click",function(){let o=d(e).$implicit,n=l(2);return m(n.onSelect(o))})("contextmenu",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("pressup",function(o){let n=d(e).$implicit,p=l(2);return m(p.onTargetContextMenu(o,n))})("tap",function(){d(e);let o=l(2);return m(o.openLinkDialog())}),A(1,et,1,1,null,null,Fe),k(3,"keyvalue"),c()}if(t&2){let e=a.$implicit,i=l(2);P("selected",e.id===(i.selected==null?null:i.selected.id))("disabled",!e.link.isActive),r(),$(y(3,4,i.tableHeaders,i.originalOrderKeyValue))}}function it(t,a){if(t&1){let e=b();s(0,"table",31)(1,"thead")(2,"tr"),A(3,Re,1,1,null,null,Fe),k(5,"keyvalue"),c()()(),s(6,"app-virtual-scroll",32),k(7,"searchFilter"),C("contextmenu",function(o){d(e);let n=l();return m(n.onContextMenu(o))}),s(8,"table",31)(9,"tbody",33),A(10,tt,4,7,"tr",34,Ve),c()()()}if(t&2){let e=l();r(3),$(y(5,2,e.tableHeaders,e.originalOrderKeyValue)),r(3),_("bufferAmount",5)("items",y(7,5,e.shares,e.inputFilter.search())),r(4),$(e.scrollView==null?null:e.scrollView.viewPortItems)}}function nt(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Refresh"),c()),t&2){let e=l();r(),_("icon",e.icons.faArrowRotateRight)}}function ot(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Go to"),c()),t&2){let e=l();r(),_("icon",e.icons.faMapMarkerAlt)}}function rt(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Edit link"),c()),t&2){let e=l();r(),_("icon",e.icons.faPen)}}function at(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Copy link"),c()),t&2){let e=l();r(),_("icon",e.icons.faClipboard)}}function lt(t,a){}function st(t,a){if(t&1&&(s(0,"span",51),f(1,"fa-icon",6),u(2,"Informations"),c()),t&2){let e=l();r(),_("icon",e.icons.faCircleInfo)}}var Dt=(()=>{let a=class a{constructor(){this.locale=w(G),this.layout=w(he),this.icons={faLink:oe,faArrowRotateRight:se,faArrowDown:ce,faArrowUp:re,faMapMarkerAlt:pe,faPen:ae,faEllipsisH:ee,faClock:ie,faLock:le,faClipboard:ne,faClipboardCheck:te,faCircleInfo:_e},this.originalOrderKeyValue=fe,this.TAB_MENU=Ce,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},infos:{label:"Infos",width:15,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},permissions:{label:"Permissions",width:10,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=w(K),this.store=w(xe),this.linksService=w(Le),this.sharesService=w(ve),this.sortSettings={default:[{prop:"name",type:"string"}],link:[{prop:"link.name",type:"string"}],name:[{prop:"name",type:"string"}],infos:[{prop:"link.nbAccess",type:"number"}],permissions:[{prop:"link.permissions",type:"length"}],accessed:[{prop:"link.currentAccess",type:"date"}]},this.sortTable=new be(this.constructor.name,this.sortSettings),this.loadShareLinks(),this.activatedRoute.queryParams.subscribe(i=>this.focusOnSelect=i.select),this.layout.setBreadcrumbIcon(this.icons.faLink),this.layout.setBreadcrumbNav({url:`/${ke.LINKS}/${ge.SHARED_BY_LINKS}`,translating:!0,sameLink:!0})}ngOnInit(){this.galleryMode=this.btnNavigationView.currentView()}loadShareLinks(){this.loading=!0,this.onSelect(),this.linksService.shareLinksList().subscribe({next:i=>{this.sortBy(this.sortTable.sortParam.column,!1,i),this.loading=!1,this.focusOnSelect?this.focusOn(this.focusOnSelect):this.scrollView.scrollInto(-1)},error:i=>{this.shares=[],this.loading=!1,this.layout.sendNotification("error","Links",i.error.message)}})}sortBy(i,o=!0,n){this.shares=this.sortTable.sortBy(i,o,n||this.shares)}onSelect(i=null){this.selected=i,this.store.linkSelection.set(this.selected)}openLinkDialog(){this.linksService.shareLink(this.selected.id).subscribe(i=>{this.layout.openDialog(Te,"md",{initialState:{share:i}}).content.shareChange.pipe(U(1)).subscribe(n=>{let[p,g]=n;p==="update"?this.selected=Object.assign(this.selected,g):p==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.shares.filter(E=>E.id!==g.id)))})})}onContextMenu(i){i.preventDefault(),i.stopPropagation(),this.layout.openContextMenu(i,this.mainContextMenu)}onTargetContextMenu(i,o){i.preventDefault(),i.type==="contextmenu"&&i.stopPropagation(),this.onSelect(o),this.layout.openContextMenu(i,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(i){i=i||this.selected,this.sharesService.goTo(i).catch(console.error)}focusOn(i){let o=this.shares.find(n=>n.name===i);o&&(setTimeout(()=>this.scrollView.scrollInto(o),100),this.onSelect(o))}};a.\u0275fac=function(o){return new(o||a)},a.\u0275cmp=W({type:a,selectors:[["app-shared-links"]],viewQuery:function(o,n){if(o&1&&(L(O,5),L(N,7),L(Q,7),L(Me,7),L(Ee,7)),o&2){let p;S(p=V())&&(n.scrollView=p.first),S(p=V())&&(n.inputFilter=p.first),S(p=V())&&(n.btnNavigationView=p.first),S(p=V())&&(n.mainContextMenu=p.first),S(p=V())&&(n.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-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[3,"icon"],["container","body","type","button",3,"click","disabled","tooltip"],["container","body","type","button",1,"btn","btn-sm","btn-secondary",3,"click","disabled","tooltip"],[1,"ms-auto"],[1,"btn-group","btn-group-sm","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","pressup","tap"],[1,"card-body"],["alt","","draggable","true",3,"error","src","height","width"],[1,"label-top-right"],[1,"badge","rounded-pill","bg-warning",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"],[1,"badge","rounded-pill","bg-warning"],[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,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[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-xxxs"],[3,"class"],[1,"badge","rounded-pill","bg-success"],[1,"badge","rounded-pill","bg-gray-dark","ms-1"],[1,"ms-2"],["tooltipPlacement","auto",3,"permissions"],["l10nTranslate",""]],template:function(o,n){if(o&1){let p=b();s(0,"div",2)(1,"button",3),k(2,"translate"),C("click",function(){return d(p),m(n.loadShareLinks())}),f(3,"fa-icon",4),c(),s(4,"button",5),k(5,"translate"),C("click",function(){return d(p),m(n.openLinkDialog())}),f(6,"fa-icon",6),c(),s(7,"button",7),k(8,"translate"),C("click",function(){return d(p),m(n.copyToClipboard())}),f(9,"fa-icon",6),c(),s(10,"button",8),k(11,"translate"),C("click",function(){return d(p),m(n.goTo())}),f(12,"fa-icon",6),c(),s(13,"div",9)(14,"div",10),f(15,"app-input-filter",11),c(),s(16,"app-navigation-view",12),C("sortBy",function(E){return d(p),m(n.sortBy(E))})("switchView",function(E){return d(p),m(n.galleryMode=E)}),c()()(),x(17,Pe,6,8,"div",13)(18,it,12,8),s(19,"div",14)(20,"span",15),u(21),k(22,"translate"),c()(),s(23,"context-menu",null,0),T(25,nt,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.loadShareLinks())}),c(),s(26,"context-menu",null,1),T(28,ot,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.goTo())}),T(29,rt,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.openLinkDialog())}),T(30,at,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.copyToClipboard())}),T(31,lt,0,0,"ng-template",17)(32,st,3,1,"ng-template",16),C("execute",function(){return d(p),m(n.layout.showRSideBarTab(n.TAB_MENU.SELECTION))}),c()}o&2&&(r(),_("tooltip",y(2,21,"Refresh",n.locale.language)),r(2),_("icon",n.icons.faArrowRotateRight)("animation",n.loading?"spin":null),r(),_("disabled",!n.selected)("tooltip",y(5,24,"Edit link",n.locale.language)),r(2),_("icon",n.icons.faPen),r(),M(R("btn btn-sm me-1 ",n.linkWasCopied?"btn-info":"btn-secondary")),_("disabled",!n.selected)("tooltip",y(8,27,"Copy link",n.locale.language)),r(2),_("icon",n.linkWasCopied?n.icons.faClipboardCheck:n.icons.faClipboard),r(),_("disabled",!n.selected)("tooltip",y(11,30,"Go to",n.locale.language)),r(2),_("icon",n.icons.faMapMarkerAlt),r(4),_("sortParams",n.sortTable.sortParam)("sortFields",n.btnSortFields),r(),h(n.galleryMode!=null&&n.galleryMode.enabled?17:18),r(4),B("",n.shares.length," ",y(22,33,"shares",n.locale.language)),r(10),_("divider",!0))},dependencies:[ue,me,de,j,J,Q,Z,X,N,O,we,Se,q,Y,ye],encapsulation:2});let t=a;return t})();export{Dt as LinksComponent};
@@ -1 +0,0 @@
1
- import{f as P}from"./chunk-VPJ2V27B.js";import{Ba as d,U as g,Va as C,X as N,cb as E,kb as H,oa as O,sa as f,vb as k,wb as F}from"./chunk-4U5A2DEP.js";import{d as T}from"./chunk-BIUNUYZ5.js";import{$ as I,G as h,O as m,Oc as R,Z as x,ca as A,ha as n,p as c,q as _,v as p}from"./chunk-HW2H3ISM.js";var a=(function(r){return r.ACCESS="access",r.REFRESH="refresh",r.WS="ws",r.CSRF="csrf",r})(a||{});var s=(function(r){return r.BASE="/api/auth",r.LOGIN="login",r.LOGOUT="logout",r.REFRESH="refresh",r.TOKEN="token",r.TOKEN_REFRESH="token/refresh",r.WS="socket.io",r})(s||{}),U=`${s.BASE}/${s.LOGIN}`,K=`${s.BASE}/${s.LOGOUT}`,l=`${s.BASE}/${s.REFRESH}`,M=`${s.BASE}/${s.TOKEN}`,W=`${s.BASE}/${s.TOKEN_REFRESH}`,b=`/${s.WS}`;var u="sync-in-csrf";var y=[a.REFRESH,a.ACCESS,a.WS,a.CSRF];var L="Client token is expired";var S={BASE:"auth",LOGIN:"login"};var fe=(()=>{let o=class o{constructor(){this.http=n(R),this.router=n(T),this.store=n(H),this.userService=n(P),this.layout=n(F),this.electron=n(k),this._refreshExpiration=parseInt(localStorage.getItem("refresh_expiration")||"0",10)||0,this._accessExpiration=parseInt(localStorage.getItem("access_expiration")||"0",10)||0}get refreshExpiration(){return this._refreshExpiration}set refreshExpiration(e){this._refreshExpiration=e!==0?e+60:e,localStorage.setItem("refresh_expiration",e.toString())}get accessExpiration(){return this._accessExpiration}set accessExpiration(e){this._accessExpiration=e!==0?e+60:e,localStorage.setItem("access_expiration",e.toString())}login(e,t){return this.http.post(U,{login:e,password:t}).pipe(p(i=>(this.accessExpiration=i.token.access_expiration,this.refreshExpiration=i.token.refresh_expiration,this.userService.initUser(i.user),{success:!0,message:null})),h(i=>(console.warn(i),c({success:!1,message:i.error.message||i.message}))))}loginElectron(){return this.electron.authenticate().pipe(x(e=>this.http.post(g,e).pipe(p(t=>(this.accessExpiration=t.token.access_expiration,this.refreshExpiration=t.token.refresh_expiration,this.userService.initUser(t.user),t?.client_token_update&&this.electron.send(E.SERVER.AUTHENTICATION_TOKEN_UPDATE,t.client_token_update),!0)),h(t=>(console.warn(t),t.error.message===L?this.electron.send(E.SERVER.AUTHENTICATION_TOKEN_EXPIRED):this.electron.send(E.SERVER.AUTHENTICATION_FAILED),c(!1))))))}logout(e=!0,t=!1){if((e||t)&&this.store.userImpersonate()){this.logoutImpersonateUser();return}this.userService.disconnectWebSocket(),this.clearCookies().pipe(m(()=>{this.accessExpiration=0,this.refreshExpiration=0,this.layout.clean(),this.store.clean(),e&&this.router.navigate([S.BASE,S.LOGIN]).catch(console.error),t&&this.layout.sendNotification("warning","Session has expired","Please sign in")})).subscribe()}logoutImpersonateUser(){this.http.post(O,null).subscribe({next:e=>{this.userService.disconnectWebSocket(),this.initUserFromResponse(e),this.router.navigate([f.BASE,f.ACCOUNT]).catch(console.error)},error:e=>{console.error(e),this.layout.sendNotification("error","Impersonate identity","logout",e)}})}initUserFromResponse(e,t=!1){e!==null&&(this.accessExpiration=e.token.access_expiration,this.refreshExpiration=e.token.refresh_expiration,this.userService.initUser(e.user,t))}isLogged(){return!this.refreshTokenHasExpired()}refreshToken(){return this.http.post(l,null).pipe(p(e=>(this.accessExpiration=e.access_expiration,this.refreshExpiration=e.refresh_expiration,console.debug("refresh token done"),!0)),h(e=>(console.debug("token has expired"),this.electron.enabled?(console.debug("login with app"),this.loginElectron()):(this.logout(!0,!0),_(()=>e)))))}checkUserAuthAndLoad(e){return this.refreshTokenHasExpired()?this.electron.enabled?this.loginElectron():(this.returnUrl=e.length>1?e:null,this.logout(),c(!1)):this.store.user.getValue()?c(!0):this.http.get(N).pipe(I(t=>this.userService.initUser(t.user)),p(()=>!0),h(t=>(t.status===401?this.logout():console.warn(t),c(!1))))}checkCSRF(e){return e.headers.has(u)?e.clone({headers:e.headers.set(u,C(u))}):e}refreshTokenHasExpired(){return this.refreshExpiration===0||d()>=this.refreshExpiration}clearCookies(){return this.http.post(K,null)}};o.\u0275fac=function(t){return new(t||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();export{U as a,K as b,l as c,u as d,S as e,fe as f};
@@ -1 +0,0 @@
1
- import{x as xe,z as Se}from"./chunk-7VRUZRJG.js";import{a as be}from"./chunk-MCLQFZ3S.js";import{h as ge}from"./chunk-FNFGUIQH.js";import{g as Ce}from"./chunk-MVO4WZLK.js";import{g as fe,h as _e}from"./chunk-VPJ2V27B.js";import{Da as ce,Hb as de,Jb as ue,Pb as he,Xa as pe,bb as y,v as te,w as ie,wb as me,ya as le}from"./chunk-4U5A2DEP.js";import{Cb as h,Eb as l,Ed as Z,Fd as ee,Ga as V,Gc as Q,Gf as re,Ib as $,Jb as L,Kb as W,L as j,Ma as s,Nb as I,Ob as M,Pb as d,Qa as N,Qb as g,Tb as K,Ub as H,Vb as X,Xa as R,Xb as k,Za as U,Zc as F,bb as P,bf as ne,dc as C,ec as q,ed as z,f as A,fc as x,ha as f,jb as _,jd as Y,kb as b,kf as oe,ma as S,na as v,nb as T,ob as w,of as ae,pb as p,qb as r,rb as c,sb as m,vf as se,wd as G,ya as B,yd as J,zb as E}from"./chunk-HW2H3ISM.js";import{a as O,b as D}from"./chunk-RTRJ3KFH.js";var ye=(()=>{let a=class a{constructor(){this.inputField="name",this.fullWidth=!1,this.textCenter=!1,this.disableOnBlur=!0,this.disableFocus=!1,this.disableKeyboard=!1,this.updateObject=new P(!0),this.renamingInProgress=new P(!0),this.elementRef=f(B),this.renderer=f(N),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.disableOnBlur&&this.disableEdit()}onEnter(){this.disableKeyboard||(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())}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.renderer.addClass(this.elementRef.nativeElement,"form-control-sm"),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)}disableEdit(){this.setParentDraggable("true"),this.renamingInProgress.emit(!1),setTimeout(()=>this.inputObject.isRenamed=!1,100)}setParentDraggable(e){this.renderer.setAttribute(this.elementRef.nativeElement.parentElement,"draggable",e)}};a.\u0275fac=function(t){return new(t||a)},a.\u0275dir=U({type:a,selectors:[["","appInputEdit",""]],hostBindings:function(t,o){t&1&&h("blur",function(){return o.onBlur()})("keyup.enter",function(){return o.onEnter()})("keyup.esc",function(){return o.onEscape()})},inputs:{inputObject:"inputObject",inputField:"inputField",fullWidth:"fullWidth",textCenter:"textCenter",disableOnBlur:"disableOnBlur",disableFocus:"disableFocus",disableKeyboard:"disableKeyboard"},outputs:{updateObject:"updateObject",renamingInProgress:"renamingInProgress"}});let i=a;return i})();var Ee=["InputRename"],Fe=(i,a)=>a.alias,Pe=(i,a)=>a.key;function Te(i,a){if(i&1&&m(0,"app-user-avatar",15)(1,"div",10),i&2){let n=l().$implicit;p("user",n.owner)}}function we(i,a){if(i&1){let n=E();r(0,"input",16,0),h("updateObject",function(t){S(n);let o=l(2);return v(o.onRenameRoot(t))}),c()}if(i&2){let n=l().$implicit;p("inputObject",n)("fullWidth",!0)}}function Ie(i,a){if(i&1&&(r(0,"span"),d(1),c()),i&2){let n=l(2).$implicit;s(),g(n.externalPath)}}function Me(i,a){if(i&1&&(r(0,"span"),d(1),C(2,"pathSlice"),c()),i&2){let n=l(2).$implicit;s(),g(x(2,1,n.file.path,-2))}}function ke(i,a){if(i&1&&(r(0,"div",17)(1,"span"),d(2),c()(),r(3,"div",18),_(4,Ie,2,1,"span")(5,Me,3,4,"span"),c()),i&2){let n=l().$implicit,e=l();s(2),g(n.name),s(2),b(e.user.isAdmin&&n.externalPath?4:5)}}function Oe(i,a){if(i&1){let n=E();r(0,"button",21),C(1,"translate"),X("ngModelChange",function(t){S(n);let o=l().$implicit,u=l().$implicit;return H(u.hPerms[o.key],t)||(u.hPerms[o.key]=t),v(t)}),h("ngModelChange",function(){S(n);let t=l(2).$implicit,o=l();return v(o.onPermissionChange(t))}),m(2,"fa-icon",22),c()}if(i&2){let n=l().$implicit,e=l().$implicit,t=l();M(k("btn btn-sm btn-custom ",!e.isDir&&(n.key==="a"||n.key==="d")?"disabled":"")),K("ngModel",e.hPerms[n.key]),p("tooltip",x(1,6,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function De(i,a){if(i&1&&(r(0,"button",23),C(1,"translate"),m(2,"fa-icon",22),c()),i&2){let n=l().$implicit,e=l().$implicit,t=l();I("active",e.hPerms[n.key]),p("tooltip",x(1,4,t.SPACES_PERMISSIONS_TEXT[n.key].text,t.locale.language)),s(2),p("icon",t.SPACES_PERMISSIONS_TEXT[n.key].icon)}}function Ae(i,a){if(i&1&&_(0,Oe,3,9,"button",19)(1,De,3,7,"button",20),i&2){let n=l().$implicit,e=l();b(!(n.owner!=null&&n.owner.id)&&e.user.isAdmin||(n.owner==null?null:n.owner.id)===e.user.id?0:1)}}function je(i,a){if(i&1){let n=E();r(0,"div",1)(1,"div",2)(2,"div",3),_(3,Te,2,1),m(4,"img",4),r(5,"div",5),_(6,we,2,2,"input",6)(7,ke,6,2),c()(),r(8,"div",7)(9,"div",8),d(10),c(),r(11,"div",8),d(12),C(13,"amTimeAgo"),c()(),r(14,"div",9),m(15,"div",10),T(16,Ae,2,1,null,null,Pe),C(18,"keyvalue"),m(19,"div",11),r(20,"button",12),C(21,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.setRenamed(t))}),m(22,"fa-icon",13),c(),r(23,"button",14),C(24,"translate"),h("click",function(){let t=S(n).$implicit,o=l();return v(o.removeRoot(t))}),m(25,"fa-icon",13),c()()()()}if(i&2){let n=a.$implicit,e=l();s(3),b(e.showUsers?3:-1),s(),I("cursor-pointer",!!n.file.path),p("src",n.file.mimeUrl,V)("tooltip",n.file.path),s(2),b(n.isRenamed?6:7),s(4),g(n.alias),s(2),g(q(13,15,n.createdAt)),s(4),w(x(18,17,n.hPerms,e.originalOrderKeyValue)),s(4),M(k("btn btn-sm ",n.isRenamed?"btn-success":"btn-custom"," me-2")),p("tooltip",x(21,20,"Rename",e.locale.language)),s(2),p("icon",e.icons.faPen),s(),p("tooltip",x(24,23,"Remove",e.locale.language)),s(2),p("icon",e.icons.faTimes)}}var Re=(()=>{let a=class a{constructor(){this.showUsers=!0,this.addRootFile=null,this.locale=f(J),this.icons={faTimes:oe,faPen:ae},this.SPACES_PERMISSIONS_TEXT=ue,this.originalOrderKeyValue=pe,this.subscription=null}ngOnInit(){this.addRootFile&&(this.subscription=this.addRootFile.subscribe(e=>this.addRoot(e)))}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}addRoot(e){let t={id:0,alias:y(e.name,"alias",this.space.roots).toLowerCase(),name:y(e.name,"name",this.space.roots),permissions:"",createdAt:new Date};e.externalPath?(t.externalPath=e.externalPath,t.owner={id:null,login:null,email:null,fullName:null},t.file={id:0,path:null,mime:null}):(t.externalPath=null,t.owner={id:this.user.id,login:this.user.login,email:this.user.email,fullName:this.user.fullName},t.file={id:e.id,path:e.path,mime:e.mime}),this.space.addRoot(t,!0)}removeRoot(e){this.space.roots=this.space.roots.filter(t=>e.alias!==t.alias)}onRenameRoot(e){let t=e.object;t.alias=y(ce(e.name,!0),"alias",this.space.roots.filter(o=>o.id!==t.id)).toLowerCase(),t.name=y(e.name.replace(le,""),"name",this.space.roots.filter(o=>o.id!==t.id))}onPermissionChange(e){e.permissions=he(e.hPerms)}setRenamed(e){e.isRenamed?(this.onRenameRoot({object:e,name:this.inputRename.nativeElement.value}),e.isRenamed=!1):e.isRenamed=!0}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,selectors:[["app-space-manage-roots"]],viewQuery:function(t,o){if(t&1&&$(Ee,5),t&2){let u;L(u=W())&&(o.inputRename=u.first)}},inputs:{space:"space",user:"user",showUsers:"showUsers",addRootFile:"addRootFile"},decls:2,vars:0,consts:[["InputRename",""],[1,"bg-theme","mb-1","p-2",2,"border-radius","4px"],[1,"d-flex","align-items-center","text-truncate","no-select","fs-xs",2,"height","32px"],[1,"d-flex","align-items-center","text-truncate","me-auto"],["draggable","false","height","30","width","30","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-xxxs","text-muted","d-none","d-lg-block","ms-3"],[1,"d-flex","justify-content-end"],[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-xxxs","text-truncate"],["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(t,o){t&1&&T(0,je,26,26,"div",1,Fe),t&2&&w(o.space.roots)},dependencies:[_e,fe,F,be,ie,te,G,z,Y,ye,Q,Z,ge,xe],encapsulation:2});let i=a;return i})();function Be(i,a){if(i&1&&m(0,"fa-icon",3),i&2){let n=l();p("icon",n.icons.faSpinner)}}function Ve(i,a){i&1&&(r(0,"span",5),d(1,"You have no files anchored on this space"),c())}var Pt=(()=>{let a=class a{constructor(){this.layout=f(me),this.addRootFileEvent=new A,this.icons={faAnchor:se,faPlus:re,faSpinner:ne,SPACES:de.SPACES},this.submitted=!1,this.loading=!1,this.spacesService=f(Ce)}ngOnInit(){this.space?.roots.length&&(this.space.roots=[]),this.spacesService.getUserSpaceRoots(this.space.id).subscribe({next:e=>this.setSpaceRoots(e),error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message)}})}openSelectRootDialog(){this.layout.openDialog(Se,"xl",{initialState:{currentRoots:this.space.roots.filter(t=>t.owner.id===this.user.id)}}).content.submitEvent.pipe(j(1)).subscribe(t=>this.addRootFileEvent.next(t))}onSubmit(){this.loading=!0,this.submitted=!0,this.spacesService.updateUserSpaceRoots(this.space.id,this.space.roots.map(e=>({id:e.id,alias:e.alias,name:e.name,permissions:e.permissions,file:{id:e.file.id,path:e.file.path,mime:e.file.mime}}))).subscribe({next:e=>{this.setSpaceRoots(e),this.layout.closeDialog()},error:e=>{this.layout.sendNotification("error","Manage my anchored files",e.error.message),this.submitted=!1,this.loading=!1}})}setSpaceRoots(e){this.space.roots=[];for(let t of e)this.space.addRoot(D(O({},t),{owner:this.user}),!0);this.space.counts.roots=this.space.roots.length}};a.\u0275fac=function(t){return new(t||a)},a.\u0275cmp=R({type:a,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"],[1,"me-2",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-sm","btn-success",3,"click"],[3,"icon"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(t,o){t&1&&(r(0,"div",0)(1,"h4",1),m(2,"fa-icon",2),r(3,"span"),d(4),c()(),_(5,Be,1,1,"fa-icon",3),r(6,"h4",4)(7,"span",5),d(8,"Manage my anchored files"),c()(),r(9,"button",6),h("click",function(){return o.layout.closeDialog()}),c()(),r(10,"div",7),m(11,"app-space-manage-roots",8),_(12,Ve,2,0,"span",5),c(),r(13,"div",9)(14,"button",10),h("click",function(){return o.openSelectRootDialog()}),m(15,"fa-icon",11)(16,"fa-icon",11),d(17," File "),c(),r(18,"button",12),h("click",function(){return o.layout.closeDialog()}),d(19,"Cancel"),c(),r(20,"button",13),h("click",function(){return o.onSubmit()}),d(21," Confirm "),c()()),t&2&&(s(2),p("icon",o.icons.SPACES),s(2),g(o.space.name),s(),b(o.loading?5:-1),s(6),p("space",o.space)("user",o.user)("showUsers",!1)("addRootFile",o.addRootFileEvent),s(),b(o.space.roots.length?-1:12),s(3),p("icon",o.icons.faPlus),s(),p("icon",o.icons.faAnchor),s(4),p("disabled",o.submitted))},dependencies:[F,ee,Re],encapsulation:2});let i=a;return i})();export{ye as a,Re as b,Pt as c};
@@ -1 +0,0 @@
1
- import{$ as Ct,B as he,Ea as _e,Gb as ke,Hb as Y,Ja as be,Q as le,Qa as Ee,Qb as T,S as fe,T as Rt,W as $,Y as pe,Z as de,_ as me,aa as O,ba as ge,ca as ye,da as P,fb as Se,ib as D,jb as ve,kb as ft,wb as pt}from"./chunk-4U5A2DEP.js";import{Cb as ct,G as zt,Hb as oe,Jb as ae,Kb as ce,L as Zt,Nb as Tt,Oc as ut,Qa as re,Ra as L,W as te,Ya as nt,Za as ot,Zb as ht,_c as lt,ba as H,c as Xt,ca as st,da as rt,fa as ee,ha as b,hb as ne,ib as at,nf as ue,qc as Ot,v as d,va as ie,ya as se}from"./chunk-HW2H3ISM.js";import{a as it,b as jt,c as Qt,e as Jt}from"./chunk-RTRJ3KFH.js";var we={NAME_SPACE:"/",EVENTS:{NOTIFICATION:"notification"}};var W={NAME_SPACE:"/",EVENTS:{ONLINE_STATUS:"onlineStatus",ONLINE_USERS:"onlineUsers",ONLINE_USER:"onlineUser"}};var Wt={};Jt(Wt,{Fetch:()=>X,Manager:()=>N,NodeWebSocket:()=>w,NodeXHR:()=>k,Socket:()=>C,WebSocket:()=>w,WebTransport:()=>R,XHR:()=>k,connect:()=>B,default:()=>B,io:()=>B,protocol:()=>$t});var _=Object.create(null);_.open="0";_.close="1";_.ping="2";_.pong="3";_.message="4";_.upgrade="5";_.noop="6";var G=Object.create(null);Object.keys(_).forEach(s=>{G[_[s]]=s});var K={type:"error",data:"parser error"};var Oe=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Re=typeof ArrayBuffer=="function",Ce=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,j=({type:s,data:t},i,e)=>Oe&&t instanceof Blob?i?e(t):Ae(t,e):Re&&(t instanceof ArrayBuffer||Ce(t))?i?e(t):Ae(new Blob([t]),e):e(_[s]+(t||"")),Ae=(s,t)=>{let i=new FileReader;return i.onload=function(){let e=i.result.split(",")[1];t("b"+(e||""))},i.readAsDataURL(s)};function Te(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}var xt;function xe(s,t){if(Oe&&s.data instanceof Blob)return s.data.arrayBuffer().then(Te).then(t);if(Re&&(s.data instanceof ArrayBuffer||Ce(s.data)))return t(Te(s.data));j(s,!1,i=>{xt||(xt=new TextEncoder),t(xt.encode(i))})}var Ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Q=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<Ne.length;s++)Q[Ne.charCodeAt(s)]=s;var Be=s=>{let t=s.length*.75,i=s.length,e,r=0,n,o,a,c;s[s.length-1]==="="&&(t--,s[s.length-2]==="="&&t--);let p=new ArrayBuffer(t),g=new Uint8Array(p);for(e=0;e<i;e+=4)n=Q[s.charCodeAt(e)],o=Q[s.charCodeAt(e+1)],a=Q[s.charCodeAt(e+2)],c=Q[s.charCodeAt(e+3)],g[r++]=n<<2|o>>4,g[r++]=(o&15)<<4|a>>2,g[r++]=(a&3)<<6|c&63;return p};var ni=typeof ArrayBuffer=="function",J=(s,t)=>{if(typeof s!="string")return{type:"message",data:Ie(s,t)};let i=s.charAt(0);return i==="b"?{type:"message",data:oi(s.substring(1),t)}:G[i]?s.length>1?{type:G[i],data:s.substring(1)}:{type:G[i]}:K},oi=(s,t)=>{if(ni){let i=Be(s);return Ie(i,t)}else return{base64:!0,data:s}},Ie=(s,t)=>{switch(t){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}};var Le="",Pe=(s,t)=>{let i=s.length,e=new Array(i),r=0;s.forEach((n,o)=>{j(n,!1,a=>{e[o]=a,++r===i&&t(e.join(Le))})})},De=(s,t)=>{let i=s.split(Le),e=[];for(let r=0;r<i.length;r++){let n=J(i[r],t);if(e.push(n),n.type==="error")break}return e};function Ue(){return new TransformStream({transform(s,t){xe(s,i=>{let e=i.length,r;if(e<126)r=new Uint8Array(1),new DataView(r.buffer).setUint8(0,e);else if(e<65536){r=new Uint8Array(3);let n=new DataView(r.buffer);n.setUint8(0,126),n.setUint16(1,e)}else{r=new Uint8Array(9);let n=new DataView(r.buffer);n.setUint8(0,127),n.setBigUint64(1,BigInt(e))}s.data&&typeof s.data!="string"&&(r[0]|=128),t.enqueue(r),t.enqueue(i)})}})}var Nt;function dt(s){return s.reduce((t,i)=>t+i.length,0)}function mt(s,t){if(s[0].length===t)return s.shift();let i=new Uint8Array(t),e=0;for(let r=0;r<t;r++)i[r]=s[0][e++],e===s[0].length&&(s.shift(),e=0);return s.length&&e<s[0].length&&(s[0]=s[0].slice(e)),i}function Fe(s,t){Nt||(Nt=new TextDecoder);let i=[],e=0,r=-1,n=!1;return new TransformStream({transform(o,a){for(i.push(o);;){if(e===0){if(dt(i)<1)break;let c=mt(i,1);n=(c[0]&128)===128,r=c[0]&127,r<126?e=3:r===126?e=1:e=2}else if(e===1){if(dt(i)<2)break;let c=mt(i,2);r=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),e=3}else if(e===2){if(dt(i)<8)break;let c=mt(i,8),p=new DataView(c.buffer,c.byteOffset,c.length),g=p.getUint32(0);if(g>Math.pow(2,21)-1){a.enqueue(K);break}r=g*Math.pow(2,32)+p.getUint32(4),e=3}else{if(dt(i)<r)break;let c=mt(i,r);a.enqueue(J(n?c:Nt.decode(c),t)),e=0}if(r===0||r>s){a.enqueue(K);break}}}})}var Bt=4;function u(s){if(s)return ai(s)}function ai(s){for(var t in u.prototype)s[t]=u.prototype[t];return s}u.prototype.on=u.prototype.addEventListener=function(s,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(t),this};u.prototype.once=function(s,t){function i(){this.off(s,i),t.apply(this,arguments)}return i.fn=t,this.on(s,i),this};u.prototype.off=u.prototype.removeListener=u.prototype.removeAllListeners=u.prototype.removeEventListener=function(s,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var e,r=0;r<i.length;r++)if(e=i[r],e===t||e.fn===t){i.splice(r,1);break}return i.length===0&&delete this._callbacks["$"+s],this};u.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),i=this._callbacks["$"+s],e=1;e<arguments.length;e++)t[e-1]=arguments[e];if(i){i=i.slice(0);for(var e=0,r=i.length;e<r;++e)i[e].apply(this,t)}return this};u.prototype.emitReserved=u.prototype.emit;u.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};u.prototype.hasListeners=function(s){return!!this.listeners(s).length};var E=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,i)=>i(t,0),l=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),Me="arraybuffer";function gt(s,...t){return t.reduce((i,e)=>(s.hasOwnProperty(e)&&(i[e]=s[e]),i),{})}var ci=l.setTimeout,hi=l.clearTimeout;function S(s,t){t.useNativeTimers?(s.setTimeoutFn=ci.bind(l),s.clearTimeoutFn=hi.bind(l)):(s.setTimeoutFn=l.setTimeout.bind(l),s.clearTimeoutFn=l.clearTimeout.bind(l))}var ui=1.33;function Ve(s){return typeof s=="string"?li(s):Math.ceil((s.byteLength||s.size)*ui)}function li(s){let t=0,i=0;for(let e=0,r=s.length;e<r;e++)t=s.charCodeAt(e),t<128?i+=1:t<2048?i+=2:t<55296||t>=57344?i+=3:(e++,i+=4);return i}function yt(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function qe(s){let t="";for(let i in s)s.hasOwnProperty(i)&&(t.length&&(t+="&"),t+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return t}function He(s){let t={},i=s.split("&");for(let e=0,r=i.length;e<r;e++){let n=i[e].split("=");t[decodeURIComponent(n[0])]=decodeURIComponent(n[1])}return t}var _t=class extends Error{constructor(t,i,e){super(t),this.description=i,this.context=e,this.type="TransportError"}},v=class extends u{constructor(t){super(),this.writable=!1,S(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,i,e){return super.emitReserved("error",new _t(t,i,e)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){let i=J(t,this.socket.binaryType);this.onPacket(i)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,i={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){let t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){let i=qe(t);return i.length?"?"+i:""}};var U=class extends v{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";let i=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let e=0;this._polling&&(e++,this.once("pollComplete",function(){--e||i()})),this.writable||(e++,this.once("drain",function(){--e||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){let i=e=>{if(this.readyState==="opening"&&e.type==="open"&&this.onOpen(),e.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)};De(t,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){let t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,Pe(t,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let t=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=yt()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(t,i)}};var $e=!1;try{$e=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}var Ye=$e;function fi(){}var It=class extends U{constructor(t){if(super(t),typeof location<"u"){let i=location.protocol==="https:",e=location.port;e||(e=i?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||e!==t.port}}doWrite(t,i){let e=this.request({method:"POST",data:t});e.on("success",i),e.on("error",(r,n)=>{this.onError("xhr post error",r,n)})}doPoll(){let t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(i,e)=>{this.onError("xhr poll error",i,e)}),this.pollXhr=t}},bt=(()=>{class s extends u{constructor(i,e,r){super(),this.createRequest=i,S(this,r),this._opts=r,this._method=r.method||"GET",this._uri=e,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var i;let e=gt(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this._opts.xd;let r=this._xhr=this.createRequest(e);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let n in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(n)&&r.setRequestHeader(n,this._opts.extraHeaders[n])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(i=this._opts.cookieJar)===null||i===void 0||i.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var n;r.readyState===3&&((n=this._opts.cookieJar)===null||n===void 0||n.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(n){this.setTimeoutFn(()=>{this._onError(n)},0);return}typeof document<"u"&&(this._index=s.requestsCount++,s.requests[this._index]=this)}_onError(i){this.emitReserved("error",i,this._xhr),this._cleanup(!0)}_cleanup(i){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=fi,i)try{this._xhr.abort()}catch{}typeof document<"u"&&delete s.requests[this._index],this._xhr=null}}_onLoad(){let i=this._xhr.responseText;i!==null&&(this.emitReserved("data",i),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}return s.requestsCount=0,s.requests={},s})();if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",We);else if(typeof addEventListener=="function"){let s="onpagehide"in l?"pagehide":"unload";addEventListener(s,We,!1)}}function We(){for(let s in bt.requests)bt.requests.hasOwnProperty(s)&&bt.requests[s].abort()}var pi=(function(){let s=Ge({xdomain:!1});return s&&s.responseType!==null})(),k=class extends It{constructor(t){super(t);let i=t&&t.forceBase64;this.supportsBinary=pi&&!i}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new bt(Ge,this.uri(),t)}};function Ge(s){let t=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||Ye))return new XMLHttpRequest}catch{}if(!t)try{return new l[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}var Ke=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative",Pt=class extends v{get name(){return"websocket"}doOpen(){let t=this.uri(),i=this.opts.protocols,e=Ke?{}:gt(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(e.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,i,e)}catch(r){return this.emitReserved("error",r)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;j(e,this.supportsBinary,n=>{try{this.doWrite(e,n)}catch{}r&&E(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){let t=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=yt()),this.supportsBinary||(i.b64=1),this.createUri(t,i)}},Lt=l.WebSocket||l.MozWebSocket,w=class extends Pt{createSocket(t,i,e){return Ke?new Lt(t,i,e):i?new Lt(t,i):new Lt(t)}doWrite(t,i){this.ws.send(i)}};var R=class extends v{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{let i=Fe(Number.MAX_SAFE_INTEGER,this.socket.binaryType),e=t.readable.pipeThrough(i).getReader(),r=Ue();r.readable.pipeTo(t.writable),this._writer=r.writable.getWriter();let n=()=>{e.read().then(({done:a,value:c})=>{a||(this.onPacket(c),n())}).catch(a=>{})};n();let o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let i=0;i<t.length;i++){let e=t[i],r=i===t.length-1;this._writer.write(e).then(()=>{r&&E(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}};var Dt={websocket:w,webtransport:R,polling:k};var di=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,mi=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function F(s){if(s.length>8e3)throw"URI too long";let t=s,i=s.indexOf("["),e=s.indexOf("]");i!=-1&&e!=-1&&(s=s.substring(0,i)+s.substring(i,e).replace(/:/g,";")+s.substring(e,s.length));let r=di.exec(s||""),n={},o=14;for(;o--;)n[mi[o]]=r[o]||"";return i!=-1&&e!=-1&&(n.source=t,n.host=n.host.substring(1,n.host.length-1).replace(/;/g,":"),n.authority=n.authority.replace("[","").replace("]","").replace(/;/g,":"),n.ipv6uri=!0),n.pathNames=gi(n,n.path),n.queryKey=yi(n,n.query),n}function gi(s,t){let i=/\/{2,9}/g,e=t.replace(i,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&e.splice(0,1),t.slice(-1)=="/"&&e.splice(e.length-1,1),e}function yi(s,t){let i={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,r,n){r&&(i[r]=n)}),i}var Ut=typeof addEventListener=="function"&&typeof removeEventListener=="function",Et=[];Ut&&addEventListener("offline",()=>{Et.forEach(s=>s())},!1);var St=(()=>{class s extends u{constructor(i,e){if(super(),this.binaryType=Me,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,i&&typeof i=="object"&&(e=i,i=null),i){let r=F(i);e.hostname=r.host,e.secure=r.protocol==="https"||r.protocol==="wss",e.port=r.port,r.query&&(e.query=r.query)}else e.host&&(e.hostname=F(e.host).host);S(this,e),this.secure=e.secure!=null?e.secure:typeof location<"u"&&location.protocol==="https:",e.hostname&&!e.port&&(e.port=this.secure?"443":"80"),this.hostname=e.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=e.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},e.transports.forEach(r=>{let n=r.prototype.name;this.transports.push(n),this._transportsByName[n]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},e),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=He(this.opts.query)),Ut&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Et.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(i){let e=Object.assign({},this.opts.query);e.EIO=Bt,e.transport=i,this.id&&(e.sid=this.id);let r=Object.assign({},this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[i]);return new this._transportsByName[i](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}let i=this.opts.rememberUpgrade&&s.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";let e=this.createTransport(i);e.open(),this.setTransport(e)}setTransport(i){this.transport&&this.transport.removeAllListeners(),this.transport=i,i.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",e=>this._onClose("transport close",e))}onOpen(){this.readyState="open",s.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(i){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",i),this.emitReserved("heartbeat"),i.type){case"open":this.onHandshake(JSON.parse(i.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":let e=new Error("server error");e.code=i.data,this._onError(e);break;case"message":this.emitReserved("data",i.data),this.emitReserved("message",i.data);break}}onHandshake(i){this.emitReserved("handshake",i),this.id=i.sid,this.transport.query.sid=i.sid,this._pingInterval=i.pingInterval,this._pingTimeout=i.pingTimeout,this._maxPayload=i.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);let i=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+i,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},i),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){let i=this._getWritablePackets();this.transport.send(i),this._prevBufferLen=i.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let r=0;r<this.writeBuffer.length;r++){let n=this.writeBuffer[r].data;if(n&&(e+=Ve(n)),r>0&&e>this._maxPayload)return this.writeBuffer.slice(0,r);e+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;let i=Date.now()>this._pingTimeoutTime;return i&&(this._pingTimeoutTime=0,E(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),i}write(i,e,r){return this._sendPacket("message",i,e,r),this}send(i,e,r){return this._sendPacket("message",i,e,r),this}_sendPacket(i,e,r,n){if(typeof e=="function"&&(n=e,e=void 0),typeof r=="function"&&(n=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;let o={type:i,data:e,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}close(){let i=()=>{this._onClose("forced close"),this.transport.close()},e=()=>{this.off("upgrade",e),this.off("upgradeError",e),i()},r=()=>{this.once("upgrade",e),this.once("upgradeError",e)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():i()}):this.upgrading?r():i()),this}_onError(i){if(s.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",i),this._onClose("transport error",i)}_onClose(i,e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Ut&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){let r=Et.indexOf(this._offlineEventListener);r!==-1&&Et.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",i,e),this.writeBuffer=[],this._prevBufferLen=0}}}return s.protocol=Bt,s})(),vt=class extends St{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let i=this.createTransport(t),e=!1;St.priorWebsocketSuccess=!1;let r=()=>{e||(i.send([{type:"ping",data:"probe"}]),i.once("packet",A=>{if(!e)if(A.type==="pong"&&A.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;St.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{e||this.readyState!=="closed"&&(g(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{let q=new Error("probe error");q.transport=i.name,this.emitReserved("upgradeError",q)}}))};function n(){e||(e=!0,g(),i.close(),i=null)}let o=A=>{let q=new Error("probe error: "+A);q.transport=i.name,n(),this.emitReserved("upgradeError",q)};function a(){o("transport closed")}function c(){o("socket closed")}function p(A){i&&A.name!==i.name&&n()}let g=()=>{i.removeListener("open",r),i.removeListener("error",o),i.removeListener("close",a),this.off("close",c),this.off("upgrading",p)};i.once("open",r),i.once("error",o),i.once("close",a),this.once("close",c),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{e||i.open()},200):i.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){let i=[];for(let e=0;e<t.length;e++)~this.transports.indexOf(t[e])&&i.push(t[e]);return i}},M=class extends vt{constructor(t,i={}){let e=typeof t=="object"?t:i;(!e.transports||e.transports&&typeof e.transports[0]=="string")&&(e.transports=(e.transports||["polling","websocket","webtransport"]).map(r=>Dt[r]).filter(r=>!!r)),super(t,e)}};var X=class extends U{doPoll(){this._fetch().then(t=>{if(!t.ok)return this.onError("fetch read error",t.status,t);t.text().then(i=>this.onData(i))}).catch(t=>{this.onError("fetch read error",t)})}doWrite(t,i){this._fetch(t).then(e=>{if(!e.ok)return this.onError("fetch write error",e.status,e);i()}).catch(e=>{this.onError("fetch write error",e)})}_fetch(t){var i;let e=t!==void 0,r=new Headers(this.opts.extraHeaders);return e&&r.set("content-type","text/plain;charset=UTF-8"),(i=this.socket._cookieJar)===null||i===void 0||i.appendCookies(r),fetch(this.uri(),{method:e?"POST":"GET",body:e?t:null,headers:r,credentials:this.opts.withCredentials?"include":"omit"}).then(n=>{var o;return(o=this.socket._cookieJar)===null||o===void 0||o.parseCookies(n.headers.getSetCookie()),n})}};var Ps=M.protocol;function je(s,t="",i){let e=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),e=F(s)),e.port||(/^(http|ws)$/.test(e.protocol)?e.port="80":/^(http|ws)s$/.test(e.protocol)&&(e.port="443")),e.path=e.path||"/";let n=e.host.indexOf(":")!==-1?"["+e.host+"]":e.host;return e.id=e.protocol+"://"+n+":"+e.port+t,e.href=e.protocol+"://"+n+(i&&i.port===e.port?"":":"+e.port),e}var Yt={};Jt(Yt,{Decoder:()=>qt,Encoder:()=>Vt,PacketType:()=>h,protocol:()=>$t});var _i=typeof ArrayBuffer=="function",bi=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Qe=Object.prototype.toString,Ei=typeof Blob=="function"||typeof Blob<"u"&&Qe.call(Blob)==="[object BlobConstructor]",Si=typeof File=="function"||typeof File<"u"&&Qe.call(File)==="[object FileConstructor]";function Z(s){return _i&&(s instanceof ArrayBuffer||bi(s))||Ei&&s instanceof Blob||Si&&s instanceof File}function z(s,t){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,e=s.length;i<e;i++)if(z(s[i]))return!0;return!1}if(Z(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return z(s.toJSON(),!0);for(let i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&z(s[i]))return!0;return!1}function Je(s){let t=[],i=s.data,e=s;return e.data=Ft(i,t),e.attachments=t.length,{packet:e,buffers:t}}function Ft(s,t){if(!s)return s;if(Z(s)){let i={_placeholder:!0,num:t.length};return t.push(s),i}else if(Array.isArray(s)){let i=new Array(s.length);for(let e=0;e<s.length;e++)i[e]=Ft(s[e],t);return i}else if(typeof s=="object"&&!(s instanceof Date)){let i={};for(let e in s)Object.prototype.hasOwnProperty.call(s,e)&&(i[e]=Ft(s[e],t));return i}return s}function Xe(s,t){return s.data=Mt(s.data,t),delete s.attachments,s}function Mt(s,t){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<t.length)return t[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=Mt(s[i],t);else if(typeof s=="object")for(let i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=Mt(s[i],t));return s}var vi=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],$t=5,h=(function(s){return s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK",s})(h||{}),Vt=class{constructor(t){this.replacer=t}encode(t){return(t.type===h.EVENT||t.type===h.ACK)&&z(t)?this.encodeAsBinary({type:t.type===h.EVENT?h.BINARY_EVENT:h.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let i=""+t.type;return(t.type===h.BINARY_EVENT||t.type===h.BINARY_ACK)&&(i+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(i+=t.nsp+","),t.id!=null&&(i+=t.id),t.data!=null&&(i+=JSON.stringify(t.data,this.replacer)),i}encodeAsBinary(t){let i=Je(t),e=this.encodeAsString(i.packet),r=i.buffers;return r.unshift(e),r}};function ze(s){return Object.prototype.toString.call(s)==="[object Object]"}var qt=class s extends u{constructor(t){super(),this.reviver=t}add(t){let i;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(t);let e=i.type===h.BINARY_EVENT;e||i.type===h.BINARY_ACK?(i.type=e?h.EVENT:h.ACK,this.reconstructor=new Ht(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(Z(t)||t.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(t),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let i=0,e={type:Number(t.charAt(0))};if(h[e.type]===void 0)throw new Error("unknown packet type "+e.type);if(e.type===h.BINARY_EVENT||e.type===h.BINARY_ACK){let n=i+1;for(;t.charAt(++i)!=="-"&&i!=t.length;);let o=t.substring(n,i);if(o!=Number(o)||t.charAt(i)!=="-")throw new Error("Illegal attachments");e.attachments=Number(o)}if(t.charAt(i+1)==="/"){let n=i+1;for(;++i&&!(t.charAt(i)===","||i===t.length););e.nsp=t.substring(n,i)}else e.nsp="/";let r=t.charAt(i+1);if(r!==""&&Number(r)==r){let n=i+1;for(;++i;){let o=t.charAt(i);if(o==null||Number(o)!=o){--i;break}if(i===t.length)break}e.id=Number(t.substring(n,i+1))}if(t.charAt(++i)){let n=this.tryParse(t.substr(i));if(s.isPayloadValid(e.type,n))e.data=n;else throw new Error("invalid payload")}return e}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,i){switch(t){case h.CONNECT:return ze(i);case h.DISCONNECT:return i===void 0;case h.CONNECT_ERROR:return typeof i=="string"||ze(i);case h.EVENT:case h.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&vi.indexOf(i[0])===-1);case h.ACK:case h.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}},Ht=class{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){let i=Xe(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function m(s,t,i){return s.on(t,i),function(){s.off(t,i)}}var ki=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1}),C=class extends u{constructor(t,i,e){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=i,e&&e.auth&&(this.auth=e.auth),this._opts=Object.assign({},e),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;let t=this.io;this.subs=[m(t,"open",this.onopen.bind(this)),m(t,"packet",this.onpacket.bind(this)),m(t,"error",this.onerror.bind(this)),m(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...i){var e,r,n;if(ki.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(i.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;let o={type:h.EVENT,data:i};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){let g=this.ids++,A=i.pop();this._registerAckCallback(g,A),o.id=g}let a=(r=(e=this.io.engine)===null||e===void 0?void 0:e.transport)===null||r===void 0?void 0:r.writable,c=this.connected&&!(!((n=this.io.engine)===null||n===void 0)&&n._hasPingExpired());return this.flags.volatile&&!a||(c?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,i){var e;let r=(e=this.flags.timeout)!==null&&e!==void 0?e:this._opts.ackTimeout;if(r===void 0){this.acks[t]=i;return}let n=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);i.call(this,new Error("operation has timed out"))},r),o=(...a)=>{this.io.clearTimeoutFn(n),i.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...i){return new Promise((e,r)=>{let n=(o,a)=>o?r(o):e(a);n.withError=!0,i.push(n),this.emit(t,...i)})}_addToQueue(t){let i;typeof t[t.length-1]=="function"&&(i=t.pop());let e={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((r,...n)=>e!==this._queue[0]?void 0:(r!==null?e.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(r)):(this._queue.shift(),i&&i(null,...n)),e.pending=!1,this._drainQueue())),this._queue.push(e),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;let i=this._queue[0];i.pending&&!t||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:h.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(e=>String(e.id)===t)){let e=this.acks[t];delete this.acks[t],e.withError&&e.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case h.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case h.EVENT:case h.BINARY_EVENT:this.onevent(t);break;case h.ACK:case h.BINARY_ACK:this.onack(t);break;case h.DISCONNECT:this.ondisconnect();break;case h.CONNECT_ERROR:this.destroy();let e=new Error(t.data.message);e.data=t.data.data,this.emitReserved("connect_error",e);break}}onevent(t){let i=t.data||[];t.id!=null&&i.push(this.ack(t.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){let i=this._anyListeners.slice();for(let e of i)e.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){let i=this,e=!1;return function(...r){e||(e=!0,i.packet({type:h.ACK,id:t,data:r}))}}onack(t){let i=this.acks[t.id];typeof i=="function"&&(delete this.acks[t.id],i.withError&&t.data.unshift(null),i.apply(this,t.data))}onconnect(t,i){this.id=t,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:h.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){let i=this._anyListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){let i=this._anyOutgoingListeners;for(let e=0;e<i.length;e++)if(t===i[e])return i.splice(e,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){let i=this._anyOutgoingListeners.slice();for(let e of i)e.apply(this,t.data)}}};function x(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}x.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),i=Math.floor(t*this.jitter*s);s=(Math.floor(t*10)&1)==0?s-i:s+i}return Math.min(s,this.max)|0};x.prototype.reset=function(){this.attempts=0};x.prototype.setMin=function(s){this.ms=s};x.prototype.setMax=function(s){this.max=s};x.prototype.setJitter=function(s){this.jitter=s};var N=class extends u{constructor(t,i){var e;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(i=t,t=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,S(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((e=i.randomizationFactor)!==null&&e!==void 0?e:.5),this.backoff=new x({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=t;let r=i.parser||Yt;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var i;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(i=this.backoff)===null||i===void 0||i.setMin(t),this)}randomizationFactor(t){var i;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(i=this.backoff)===null||i===void 0||i.setJitter(t),this)}reconnectionDelayMax(t){var i;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(i=this.backoff)===null||i===void 0||i.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new M(this.uri,this.opts);let i=this.engine,e=this;this._readyState="opening",this.skipReconnect=!1;let r=m(i,"open",function(){e.onopen(),t&&t()}),n=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=m(i,"error",n);if(this._timeout!==!1){let a=this._timeout,c=this.setTimeoutFn(()=>{r(),n(new Error("timeout")),i.close()},a);this.opts.autoUnref&&c.unref(),this.subs.push(()=>{this.clearTimeoutFn(c)})}return this.subs.push(r),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");let t=this.engine;this.subs.push(m(t,"ping",this.onping.bind(this)),m(t,"data",this.ondata.bind(this)),m(t,"error",this.onerror.bind(this)),m(t,"close",this.onclose.bind(this)),m(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(i){this.onclose("parse error",i)}}ondecoded(t){E(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,i){let e=this.nsps[t];return e?this._autoConnect&&!e.active&&e.connect():(e=new C(this,t,i),this.nsps[t]=e),e}_destroy(t){let i=Object.keys(this.nsps);for(let e of i)if(this.nsps[e].active)return;this._close()}_packet(t){let i=this.encoder.encode(t);for(let e=0;e<i.length;e++)this.engine.write(i[e],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,i){var e;this.cleanup(),(e=this.engine)===null||e===void 0||e.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;let t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{let i=this.backoff.duration();this._reconnecting=!0;let e=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(r=>{r?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",r)):t.onreconnect()}))},i);this.opts.autoUnref&&e.unref(),this.subs.push(()=>{this.clearTimeoutFn(e)})}}onreconnect(){let t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}};var tt={};function B(s,t){typeof s=="object"&&(t=s,s=void 0),t=t||{};let i=je(s,t.path||"/socket.io"),e=i.source,r=i.id,n=i.path,o=tt[r]&&n in tt[r].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o,c;return a?c=new N(e,t):(tt[r]||(tt[r]=new N(e,t)),c=tt[r]),i.query&&!t.query&&(t.query=i.queryKey),c.socket(i.path,t)}Object.assign(B,{Manager:N,Socket:C,io:B,connect:B});var V=class s{config;appRef;subscribersCounter={};eventObservables$={};namespaces={};ioSocket;emptyConfig={url:"",options:{}};constructor(t,i){this.config=t,this.appRef=i,t===void 0&&(t=this.emptyConfig);let e=t.url,r=t.options,n=B?B:Wt;this.ioSocket=n(e,r)}get auth(){return this.ioSocket.auth}set auth(t){this.ioSocket.auth=t}get io(){return this.ioSocket.io}get open(){return this.connect}get close(){return this.disconnect}of(t){if(!t||t==="/")return this;let i=this.namespaces[t];if(i)return i;let a=this.config,{url:e}=a,r=Qt(a,["url"]),n=it({url:!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:`${e}${t}`},r),o=new s(n,this.appRef);return this.namespaces[t]=o,o}on(t,i){return this.ioSocket.on(t,i),this}once(t,i){return this.ioSocket.once(t,i),this}connect(){return this.ioSocket.connect(),this}disconnect(){return this.ioSocket.disconnect(),this}emit(t,...i){return this.ioSocket.emit(t,...i),this}send(...t){return this.ioSocket.send.apply(this.ioSocket,arguments),this}emitWithAck(t,...i){return this.ioSocket.emitWithAck(t,...i)}removeListener(t,i){return this.ioSocket.removeListener(t,i),this}removeAllListeners(t){return this.ioSocket.removeAllListeners(t),this}fromEvent(t){return this.subscribersCounter[t]||(this.subscribersCounter[t]=0),this.subscribersCounter[t]++,this.eventObservables$[t]||(this.eventObservables$[t]=new Xt(i=>{let e=r=>{i.next(r),this.appRef.tick()};return this.ioSocket.on(t,e),()=>{this.subscribersCounter[t]--,this.subscribersCounter[t]===0&&(this.ioSocket.removeListener(t,e),delete this.eventObservables$[t])}}).pipe(te())),this.eventObservables$[t]}fromOneTimeEvent(t){return new Promise(i=>this.once(t,i))}listeners(t){return this.ioSocket.listeners(t)}hasListeners(t){return this.ioSocket.hasListeners(t)}listenersAny(){return this.ioSocket.listenersAny()}listenersAnyOutgoing(){return this.ioSocket.listenersAnyOutgoing()}off(t,i){return this.ioSocket.off(t,i),this}offAny(t){return this.ioSocket.offAny(t),this}offAnyOutgoing(t){return this.ioSocket.offAnyOutgoing(t),this}onAny(t){return this.ioSocket.onAny(t),this}onAnyOutgoing(t){return this.ioSocket.onAnyOutgoing(t),this}prependAny(t){return this.ioSocket.prependAny(t),this}prependAnyOutgoing(t){return this.ioSocket.prependAnyOutgoing(t),this}timeout(t){return this.ioSocket.timeout(t),this}get volatile(){let t=this.ioSocket.volatile;return this}get active(){return this.ioSocket.active}get connected(){return this.ioSocket.connected}get disconnected(){return this.ioSocket.disconnected}get recovered(){return this.ioSocket.recovered}get id(){return this.ioSocket.id}compress(t){return this.ioSocket.compress(t),this}};function wi(s,t){return new V(s,t)}var Ze=new ee("__SOCKET_IO_CONFIG__"),Ar=(()=>{class s{static forRoot(i){return{ngModule:s,providers:[{provide:Ze,useValue:i},{provide:V,useFactory:wi,deps:[Ze,ne]}]}}static \u0275fac=function(e){return new(e||s)};static \u0275mod=nt({type:s});static \u0275inj=rt({})}return s})();var Kt={BASE:`${fe}/notifications`,UNREAD:"unread"},kt=Kt.BASE;var f=(function(s){return s.ADD="add",s.UPDATE="update",s.DELETE="delete",s.DELETE_PERMANENTLY="deletePermanently",s})(f||{});var y=(function(s){return s.COMMENTS="comments",s.SPACES="spaces",s.SPACE_ROOTS="spaces_roots",s.SHARES="shares",s.LINKS="links",s.SYNC="sync",s})(y||{}),Br={COMMENTS:"commented",SPACES:{[f.ADD]:"You now have access to the space",[f.DELETE]:"You no longer have access to the space",[f.DELETE_PERMANENTLY]:"This space has been permanently deleted"},SPACE_ROOTS:{[f.ADD]:"anchored",[f.DELETE]:"unanchored"},SHARES:{[f.ADD]:"shared with you",[f.DELETE]:"no longer share with you"},SHARES_WITHOUT_OWNER:{[f.ADD]:"You now have access to the share",[f.DELETE]:"You no longer have access to the share",[f.DELETE_PERMANENTLY]:"You are no longer a member of the parent share, your child share has been deleted"},LINKS:{[f.ADD]:"shared with you",[f.UPDATE]:"You now have access to the space"},SYNC:{[f.DELETE]:"You are no longer synchronizing"}};var ti=ue;var ei={[y.COMMENTS]:ti,[y.SPACES]:Y.SPACES,[y.SPACE_ROOTS]:Y.SPACES,[y.SHARES]:Y.SHARES,[y.LINKS]:Y.LINKS,[y.SYNC]:Se.SYNC};var wt=class{constructor(t){this.soonRead=!1,Object.assign(this,t),this.fromUser?this.fromUser.avatarUrl=D(this.fromUser.login):this.fromUser={id:-1,login:null,email:null,fullName:"Information",avatarUrl:null},this.appIcon=ei[this.content.app],this.setMainElement()}setMainElement(){if(this.content.app===y.COMMENTS||this.content.app===y.SHARES||this.content.app===y.SYNC)return;let t=this.content.url.split("/");t.length>1&&(this.mainElement=t[t.length-1])}};var ii=(()=>{let t=class t{constructor(){this.http=b(ut),this.store=b(ft),this.layout=b(pt)}getNotifications(e=!1){return this.http.get(`${kt}${e?`/${Kt.UNREAD}`:""}`).pipe(d(r=>r.map(n=>new wt(n))))}wasReadNotification(e){return this.http.patch(`${kt}/${e}`,null)}deleteNotification(e){return this.http.delete(`${kt}${e?`/${e}`:""}`)}checkUnreadNotifications(e=!1){this.getNotifications().subscribe(r=>{let n;if(e&&r.length){let o=r[0];n=this.layout.sendNotification("warning",o.fromUser.fullName,this.layout.translateString(`${this.layout.translateString(o.content.event)}: <b>${o.content.element}</b>`),null,{enableHtml:!0})}else{let o=r.filter(a=>!a.wasRead).length;o&&(n=this.layout.sendNotification("warning","Notifications",this.layout.translateString(o===1?"one_notification":"nb_notifications",{nb:o})))}n&&n.onTap.pipe(Zt(1)).subscribe(()=>this.layout.showRSideBarTab(be.NOTIFICATIONS,!0)),this.store.notifications.set(r)})}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var At=class{constructor(t){this.parentGroup=t.parentGroup,this.members=t.members.map(i=>new T(i))}};var I=class{constructor(t){this.newly=0,this.currentAccessHover=!1,this.setManagers(t),Object.assign(this,t),this.avatarUrl=D(t.login),this.userIsActiveText=this.isActive?"active":"suspended",this.hTimeAgo=(0,he.default)(this.currentAccess).fromNow(!0),this.newly=Ee(this.currentAccess)}setManagers(t){t?.managers&&(t.managers=t.managers.map(i=>new T(i)))}};var et=class{constructor(t){this.setOnlineStatus(_e("status",t)),this.avatarUrl=D(t.login),Object.assign(this,t)}setOnlineStatus(t){this.onlineStatus=t,this.onlineTextStatus=le[t]}};var Bn=(()=>{let t=class t{constructor(){this.http=b(ut),this.layout=b(pt),this.store=b(ft),this.webSocket=b(V),this.notifications=b(ii),this.webSocket.fromEvent("connect").subscribe(()=>this.notifications.checkUnreadNotifications()),this.webSocket.fromEvent("disconnect").subscribe(()=>this.store.onlineUsers.set([])),this.webSocket.fromEvent(we.EVENTS.NOTIFICATION).subscribe(()=>this.notifications.checkUnreadNotifications(!0)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USER).pipe(d(e=>new et(e))).subscribe(e=>this.newOnlineUser(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_USERS).pipe(d(e=>e.map(r=>new et(r)))).subscribe(e=>this.setOnlineUsers(e)),this.webSocket.fromEvent(W.EVENTS.ONLINE_STATUS).subscribe(e=>this.receiveOnlineStatus(e))}get user(){return this.store.user.getValue()}initUser(e,r=!1){this.refreshAvatar(),this.layout.setLanguage(e.language),this.store.userImpersonate.set(r||e.impersonated),this.store.user.next(e),this.checkQuota(this.store.user.getValue()),r&&this.disconnectWebSocket(),this.connectWebSocket()}connectWebSocket(){this.webSocket.ioSocket.io.opts.query={onlineStatus:this.user.onlineStatus},this.webSocket.connect()}disconnectWebSocket(){this.webSocket.disconnect()}setOnlineUsers(e){this.store.onlineUsers.set(e)}newOnlineUser(e){this.store.onlineUsers().find(r=>r.id===e.id)?this.receiveOnlineStatus({userId:e.id,status:e.onlineStatus}):this.store.onlineUsers.update(r=>[e,...r])}userHavePermission(e){return this.user.isAdmin?!0:this.user?this.user.applications.indexOf(e)!==-1:!1}browseGroup(e){return this.http.get(`${ge}${e?`/${e}`:""}`).pipe(d(r=>new At(r)))}createPersonalGroup(e){return this.http.post(O,e).pipe(d(r=>new T(r)))}updatePersonalGroup(e,r){return this.http.put(`${O}/${e}`,r).pipe(d(n=>new T(n)))}leavePersonalGroup(e){return this.http.delete(`${ye}/${e}`)}addUsersToGroup(e,r){return this.http.patch(`${O}/${e}/${$.USERS}`,r)}deletePersonalGroup(e){return this.http.delete(`${O}/${e}`)}updateUserFromPersonalGroup(e,r,n){return this.http.patch(`${O}/${e}/${$.USERS}/${r}`,n)}removeUserFromGroup(e,r){return this.http.delete(`${O}/${e}/${$.USERS}/${r}`)}listGuests(){return this.http.get(P).pipe(d(e=>e.map(r=>new I(r))))}getGuest(e){return this.http.get(`${P}/${e}`).pipe(d(r=>new I(r)))}createGuest(e){return this.http.post(P,e).pipe(d(r=>new I(r)))}updateGuest(e,r){return this.http.put(`${P}/${e}`,r).pipe(d(n=>n?new I(n):null))}deleteGuest(e){return this.http.delete(`${P}/${e}`)}genAvatar(){this.http.patch(Ct,null).subscribe({next:()=>this.refreshAvatar(),error:e=>this.layout.sendNotification("error","Configuration","Avatar",e)})}uploadAvatar(e){let r=new FormData;r.append("file",e),this.http.put(Ct,r).subscribe({next:()=>this.refreshAvatar(),error:n=>this.layout.sendNotification("error","Configuration","Avatar",n)})}changePassword(e){return this.http.put(de,e)}changeLanguage(e){return this.http.put(pe,e)}changeNotification(e){return this.http.put(me,e)}changeOnlineStatus(e,r=!0){this.webSocket.emit(W.EVENTS.ONLINE_STATUS,{status:e,store:r})}receiveOnlineStatus(e){this.user.id===e.userId?this.user.onlineStatus=e.status:this.store.onlineUsers().length&&this.store.onlineUsers.update(r=>r.map(n=>n.id===e.userId?jt(it({},n),{onlineStatus:e.status}):n))}searchMembers(e,r=[]){return this.http.request("search",$.BASE,{body:e}).pipe(d(n=>n.map(o=>new T(o,r))),zt(()=>[]))}setMenusVisibility(e){for(let r of e)if(!(r.id&&(r.hide=!this.userHavePermission(r.id),r.hide))&&(r.checks?.length&&(r.hide=!r.checks.map(n=>n.negate?!this[n.prop][n.value]:this[n.prop][n.value]).every(n=>!!n)),r.submenus?.length&&this.setMenusVisibility(r.submenus),r.title===ke.FILES)){for(let n of r.submenus)if(!n.hide){r.link=n.link;break}}}refreshAvatar(){this.store.userAvatarUrl.next(ve())}checkAppStoreAvailability(){this.http.get(`${Rt.BASE}/${Rt.APP_STORE}`).subscribe({next:e=>this.store.appStoreManifest.set(e),error:e=>console.error(e)})}checkQuota(e){if(!(e.isGuest||e.isLink)&&e.storageQuota){let r=Math.round(100/e.storageQuota*(e.storageQuota-e.storageUsage));r<=1?this.layout.sendNotification("error","Storage Quota","No more space available",null,{disableTimeOut:!0,closeButton:!0}):r<=5?this.layout.sendNotification("warning","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0}):r<=10&&this.layout.sendNotification("info","Storage Quota",this.layout.translateString("available_space_is_low",{nb:r}),null,{disableTimeOut:!0,closeButton:!0})}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275prov=st({token:t,factory:t.\u0275fac,providedIn:"root"});let s=t;return s})();var Ai={provide:lt,useExisting:H(()=>Ti),multi:!0},Ti=(()=>{let t=class t{constructor(){this.btnCheckboxTrue=!0,this.btnCheckboxFalse=!1,this.state=!1,this.isDisabled=!1,this.onChange=Function.prototype,this.onTouched=Function.prototype}onClick(){this.isDisabled||(this.toggle(!this.state),this.onChange(this.value))}ngOnInit(){this.toggle(this.trueValue===this.value)}get trueValue(){return typeof this.btnCheckboxTrue<"u"?this.btnCheckboxTrue:!0}get falseValue(){return typeof this.btnCheckboxFalse<"u"?this.btnCheckboxFalse:!1}toggle(e){this.state=e,this.value=this.state?this.trueValue:this.falseValue}writeValue(e){this.state=this.trueValue===e,this.value=e?this.trueValue:this.falseValue}setDisabledState(e){this.isDisabled=e}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}};t.\u0275fac=function(r){return new(r||t)},t.\u0275dir=ot({type:t,selectors:[["","btnCheckbox",""]],hostVars:3,hostBindings:function(r,n){r&1&&ct("click",function(){return n.onClick()}),r&2&&(at("aria-pressed",n.state),Tt("active",n.state))},inputs:{btnCheckboxTrue:"btnCheckboxTrue",btnCheckboxFalse:"btnCheckboxFalse"},features:[ht([Ai])]});let s=t;return s})(),Oi={provide:lt,useExisting:H(()=>si),multi:!0},si=(()=>{let t=class t{get value(){return this.group?this.group.value:this._value}set value(e){if(this.group){this.group.value=e;return}this._value=e,this._onChange(e)}get disabled(){return this._disabled}set disabled(e){this.setDisabledState(e)}get controlOrGroupDisabled(){return this.disabled||this.group&&this.group.disabled?!0:void 0}get hasDisabledClass(){return this.controlOrGroupDisabled&&!this.isActive}get isActive(){return this.btnRadio===this.value}get tabindex(){if(!this.controlOrGroupDisabled)return this.isActive||this.group==null?0:-1}get hasFocus(){return this._hasFocus}constructor(e,r,n,o){this.el=e,this.cdr=r,this.renderer=n,this.group=o,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.uncheckable=!1,this.role="radio",this._disabled=!1,this._hasFocus=!1}toggleIfAllowed(){this.canToggle()&&(this.uncheckable&&this.btnRadio===this.value?this.value=void 0:this.value=this.btnRadio)}onSpacePressed(e){this.toggleIfAllowed(),e.preventDefault()}focus(){this.el.nativeElement.focus()}onFocus(){this._hasFocus=!0}onBlur(){this._hasFocus=!1,this.onTouched()}canToggle(){return!this.controlOrGroupDisabled&&(this.uncheckable||this.btnRadio!==this.value)}ngOnChanges(e){"uncheckable"in e&&(this.uncheckable=this.uncheckable!==!1&&typeof this.uncheckable<"u")}_onChange(e){if(this.group){this.group.value=e;return}this.onTouched(),this.onChange(e)}writeValue(e){this.value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){if(this._disabled=e,e){this.renderer.setAttribute(this.el.nativeElement,"disabled","disabled");return}this.renderer.removeAttribute(this.el.nativeElement,"disabled")}};t.\u0275fac=function(r){return new(r||t)(L(se),L(Ot),L(re),L(H(()=>ri),8))},t.\u0275dir=ot({type:t,selectors:[["","btnRadio",""]],hostVars:8,hostBindings:function(r,n){r&1&&ct("click",function(){return n.toggleIfAllowed()})("keydown.space",function(a){return n.onSpacePressed(a)})("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()}),r&2&&(at("aria-disabled",n.controlOrGroupDisabled)("aria-checked",n.isActive)("role",n.role)("tabindex",n.tabindex),Tt("disabled",n.hasDisabledClass)("active",n.isActive))},inputs:{btnRadio:"btnRadio",uncheckable:"uncheckable",value:"value",disabled:"disabled"},features:[ht([Oi]),ie]});let s=t;return s})(),Ri={provide:lt,useExisting:H(()=>ri),multi:!0},ri=(()=>{let t=class t{constructor(e){this.cdr=e,this.onChange=Function.prototype,this.onTouched=Function.prototype,this.role="radiogroup",this._disabled=!1}get value(){return this._value}set value(e){this._value=e,this.onChange(e)}get disabled(){return this._disabled}get tabindex(){return this._disabled?null:0}writeValue(e){this._value=e,this.cdr.markForCheck()}registerOnChange(e){this.onChange=e}registerOnTouched(e){this.onTouched=e}setDisabledState(e){this.radioButtons&&(this._disabled=e,this.radioButtons.forEach(r=>{r.setDisabledState(e)}),this.cdr.markForCheck())}onFocus(){if(this._disabled)return;let e=this.getActiveOrFocusedRadio();if(e){e.focus();return}if(this.radioButtons){let r=this.radioButtons.find(n=>!n.disabled);r&&r.focus()}}onBlur(){this.onTouched&&this.onTouched()}selectNext(e){this.selectInDirection("next"),e.preventDefault()}selectPrevious(e){this.selectInDirection("previous"),e.preventDefault()}selectInDirection(e){if(this._disabled)return;function r(o,a){let p=(o+(e==="next"?1:-1))%a.length;return p<0&&(p=a.length-1),p}let n=this.getActiveOrFocusedRadio();if(n&&this.radioButtons){let o=this.radioButtons.toArray(),a=o.indexOf(n);for(let c=r(a,o);c!==a;c=r(c,o))if(o[c].canToggle()){o[c].toggleIfAllowed(),o[c].focus();break}}}getActiveOrFocusedRadio(){if(this.radioButtons)return this.radioButtons.find(e=>e.isActive)||this.radioButtons.find(e=>e.hasFocus)}};t.\u0275fac=function(r){return new(r||t)(L(Ot))},t.\u0275dir=ot({type:t,selectors:[["","btnRadioGroup",""]],contentQueries:function(r,n,o){if(r&1&&oe(o,si,4),r&2){let a;ae(a=ce())&&(n.radioButtons=a)}},hostVars:2,hostBindings:function(r,n){r&1&&ct("focus",function(){return n.onFocus()})("blur",function(){return n.onBlur()})("keydown.ArrowRight",function(a){return n.selectNext(a)})("keydown.ArrowDown",function(a){return n.selectNext(a)})("keydown.ArrowLeft",function(a){return n.selectPrevious(a)})("keydown.ArrowUp",function(a){return n.selectPrevious(a)}),r&2&&at("role",n.role)("tabindex",n.tabindex)},features:[ht([Ri])]});let s=t;return s})(),Wn=(()=>{let t=class t{static forRoot(){return{ngModule:t,providers:[]}}};t.\u0275fac=function(r){return new(r||t)},t.\u0275mod=nt({type:t}),t.\u0275inj=rt({});let s=t;return s})();export{Ar as a,y as b,ii as c,At as d,I as e,Bn as f,Ti as g,Wn as h};
@@ -1 +0,0 @@
1
- import{e as R}from"./chunk-F2J2IIJE.js";import"./chunk-MVO4WZLK.js";import"./chunk-7ZRXJONB.js";import"./chunk-JF7S3UYQ.js";import"./chunk-VPJ2V27B.js";import{Hb as T}from"./chunk-4U5A2DEP.js";import{c as w,d as D,h as A,k as I}from"./chunk-22EANI6R.js";import{b as L,e as b}from"./chunk-BIUNUYZ5.js";import{Cb as g,Eb as p,Ed as P,Fd as E,Ga as h,Ma as l,Pb as c,Qb as v,Sb as S,Xa as _,Zc as U,dc as x,fc as C,ha as u,jb as f,kb as k,pb as m,qb as n,rb as r,sb as s,yd as y}from"./chunk-HW2H3ISM.js";import"./chunk-RTRJ3KFH.js";function j(e,i){if(e&1&&s(0,"img",6),e&2){let o=p();m("src",o.mimeUrl,h)}}function z(e,i){if(e&1&&s(0,"fa-icon",7),e&2){let o=p();m("icon",o.icons.SPACES)("fixedWidth",!1)}}function M(e,i){if(e&1&&(s(0,"img",14),n(1,"span",15),c(2),r()),e&2){let o=p();m("src",o.link.owner.avatar,h),l(2),v(o.link.owner.fullName)}}function N(e,i){e&1&&(n(0,"span",13),c(1,"You have been invited to join this space"),r())}function B(e,i){if(e&1&&(n(0,"span"),c(1),x(2,"translate"),x(3,"translate"),r()),e&2){let o=p();l(),S("",C(2,2,"share with you this",o.locale.language)," ",C(3,5,o.link.share.isDir?"directory":"file",o.locale.language))}}function F(e,i){e&1&&(n(0,"span",13),c(1,"You have been invited to join this share"),r())}var X=(()=>{let i=class i{constructor(){this.locale=u(y),this.icons={SPACES:T.SPACES},this.logoUrl=I,this.mimeUrl=null,this.activatedRoute=u(L),this.linksService=u(R),this.activatedRoute.params.subscribe(t=>this.linkUUID=t.uuid),this.activatedRoute.data.subscribe(t=>this.setLink(t.link))}setLink(t){t.space||(this.mimeUrl=A(t.share.isDir?t.share.hasParent?D:w:t.share.mime)),this.link=t}followLink(){this.linksService.linkAccess(this.linkUUID,this.link)}};i.\u0275fac=function(d){return new(d||i)},i.\u0275cmp=_({type:i,selectors:[["app-public-link"]],decls:18,vars:5,consts:[[1,"link-page"],[1,"header"],["routerLink",""],["alt","","height","40",3,"src"],[1,"d-flex","flex-column","align-content-center"],[1,"resource","d-flex","flex-column","align-items-center","mt-3","mx-auto","cursor-pointer",3,"click"],["alt","","height","96",1,"no-select-pointer",3,"src"],[1,"circle-primary-icon",2,"min-width","128px","min-height","128px","font-size","64px",3,"icon","fixedWidth"],[1,"error-code"],[1,"error-text","no-select"],[1,"hr"],[1,"d-flex","justify-content-center","align-items-center"],[1,"solve"],["l10nTranslate",""],["alt","","width","42","height","42",1,"avatar-base-img","me-3",3,"src"],[1,"oops","me-2"]],template:function(d,a){d&1&&(n(0,"div",0)(1,"div",1)(2,"a",2),s(3,"img",3),r()(),n(4,"div",4)(5,"div",5),g("click",function(){return a.followLink()}),f(6,j,1,1,"img",6)(7,z,1,2,"fa-icon",7),n(8,"span",8),c(9),r()()(),n(10,"div",9),s(11,"span",10),n(12,"div",11),f(13,M,3,2),n(14,"span",12),f(15,N,2,0,"span",13)(16,B,4,8,"span")(17,F,2,0,"span",13),r()()()()),d&2&&(l(3),m("src",a.logoUrl,h),l(3),k(a.mimeUrl?6:7),l(3),v((a.link.share==null?null:a.link.share.name)||(a.link.space==null?null:a.link.space.name)),l(4),k(a.link.owner?13:-1),l(2),k(a.link.space?15:a.link.owner?16:17))},dependencies:[b,U,E,P],encapsulation:2});let e=i;return e})();export{X as PublicLinkComponent};
@@ -1 +0,0 @@
1
- import{a as Ct}from"./chunk-IZL7JPTS.js";import{a as gt,b as R,c as vt}from"./chunk-GGLK52CG.js";import{a as Q,b as Fe,c as ot,e as oe}from"./chunk-L6MU6S2V.js";import{a as ht}from"./chunk-LLWSLOSX.js";import{d as be}from"./chunk-6OJZWYRZ.js";import"./chunk-JXZCNFW7.js";import{a as _t}from"./chunk-MCLQFZ3S.js";import{a as ne,b as xe,c as Se,d as we,f as Te,i as Ae}from"./chunk-FNFGUIQH.js";import{a as ke,b as Ie,c as ut,d as ft}from"./chunk-54EAZ2UD.js";import{a as K,b as ye}from"./chunk-7ZRXJONB.js";import"./chunk-JF7S3UYQ.js";import{g as dt}from"./chunk-VPJ2V27B.js";import{K as it,L as X,N as nt,R as ve,Xa as pt,pa as at,qa as rt,ra as st,ua as lt,v as qe,va as mt,wa as ct,wb as z}from"./chunk-4U5A2DEP.js";import{b as Re,d as Le}from"./chunk-BIUNUYZ5.js";import{$a as Pe,$c as Z,Ad as $e,Bf as Ze,Cb as f,Eb as p,Ed as ie,Ee as Ke,Fc as pe,Fd as G,Ga as J,Gc as Ge,Gd as je,Ge as Ce,Ib as re,If as et,Jb as se,Kb as le,L as W,Ma as r,Mb as De,Nb as E,Ob as U,Pb as m,Pf as he,Qb as v,Qd as He,Rb as A,Sb as O,Ue as We,Uf as tt,Xa as N,Xb as P,Yb as Me,Zc as M,_a as me,ab as k,ad as de,ae as Qe,bb as ce,bf as Xe,cd as F,dc as h,ec as w,ed as B,fc as D,fd as $,gd as ee,ha as S,id as y,jb as g,jd as Oe,kb as C,lb as Y,ma as b,na as x,nb as I,nd as q,ob as V,od as te,pb as c,pd as ue,pe as ze,qb as n,qd as fe,rb as o,rd as _e,sb as u,wd as Be,wf as Je,xd as j,xe as ge,yd as H,zb as L,zf as Ye}from"./chunk-HW2H3ISM.js";import"./chunk-RTRJ3KFH.js";function Tt(e,a){if(e&1&&(u(0,"fa-icon",42),n(1,"span"),m(2),o()),e&2){let i=p();c("icon",i.icons.faPen),r(2),v(i.guest.fullName)}}function At(e,a){if(e&1&&(u(0,"fa-icon",42),n(1,"span",43),m(2,"New guest"),o()),e&2){let i=p();c("icon",i.icons.faPlus)}}function Et(e,a){if(e&1&&u(0,"fa-icon",2),e&2){let i=p();c("icon",i.icons.faSpinner)}}function Ut(e,a){e&1&&(n(0,"h4",3)(1,"span",43),m(2,"Edit guest"),o()())}function Dt(e,a){if(e&1&&(u(0,"fa-icon",44),n(1,"span",45),m(2,"Account"),o()),e&2){let i=p();c("icon",i.icons.faAddressCard)}}function Ft(e,a){if(e&1&&u(0,"app-password-strength-bar",22),e&2){let i=p();c("passwordToCheck",i.guestForm.value.password)}}function kt(e,a){if(e&1&&(n(0,"option",26),m(1),o()),e&2){let i=a.$implicit;c("ngValue",i),r(),v(i)}}function It(e,a){if(e&1&&(n(0,"option",34),m(1),o()),e&2){let i=a.$implicit,s=p();c("ngValue",s.allNotifications.indexOf(i)),r(),v(i)}}function Vt(e,a){if(e&1&&(n(0,"div"),m(1),h(2,"amDateFormat"),o(),n(3,"div"),m(4),h(5,"amDateFormat"),o()),e&2){let i=p(2);r(),O("",w(2,4,i.guest.currentAccess)," - ",i.guest.currentIp),r(3),O("",w(5,6,i.guest.lastAccess)," - ",i.guest.lastIp)}}function Nt(e,a){e&1&&(n(0,"span",37),m(1,"never"),o())}function Pt(e,a){if(e&1&&(n(0,"div",11)(1,"div",12)(2,"label",46),m(3,"Creation date"),o(),n(4,"div",47),m(5),h(6,"amDateFormat"),o()(),n(7,"div",48)(8,"label",49),m(9,"Last accesses"),o(),n(10,"div",50),g(11,Vt,6,8)(12,Nt,2,0,"span",37),o()()()),e&2){let i=p();r(5),v(w(6,2,i.guest.createdAt)),r(6),C(i.guest.lastAccess?11:12)}}function Mt(e,a){if(e&1&&(u(0,"fa-icon",44),n(1,"span",51),m(2,"Managers"),o(),n(3,"span"),m(4),o()),e&2){let i=p();c("icon",i.icons.faUsersGear),r(4),A("(",i.guestForm.value.managers.length||0,")")}}function Gt(e,a){e&1&&(n(0,"small",37),m(1,"At least one manager is required"),o())}function Rt(e,a){if(e&1){let i=L();n(0,"button",52),f("click",function(){b(i);let l=p();return x(l.confirmDeletion=!0)}),m(1," Remove "),o()}if(e&2){let i=p();c("disabled",i.confirmDeletion)}}var Ve=(()=>{let a=class a extends Ct{constructor(){super(),this.adminService=S(R)}searchMembers(s){let l={search:s,ignoreUserIds:this.guestForm.value.managers.map(t=>t.id),usersRole:X.USER,onlyUsers:!0};return this.adminService.searchMembers(l)}onSubmit(){if(this.submitted=!0,this.confirmDeletion)this.adminService.deleteUser(this.guest.id,null,!0).subscribe({next:()=>{this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest deleted",this.guest.login),this.layout.closeDialog()},error:s=>this.onError(s)});else if(!this.guest)this.adminService.createUser(this.makeDto(!0),!0).subscribe({next:s=>{this.guestChange.emit(["add",s]),this.layout.sendNotification("success","Guest created",this.guestForm.value.login),this.layout.closeDialog()},error:s=>this.onError(s)});else{let s=this.makeDto();if(!Object.keys(s).length){this.loading=!1,this.submitted=!1;return}this.adminService.updateUser(this.guest.id,s,!0).subscribe({next:l=>{l?this.guestChange.emit(["update",l]):this.guestChange.emit(["delete",this.guest]),this.layout.sendNotification("success","Guest updated",this.guestForm.value.login),this.layout.closeDialog()},error:l=>this.onError(l)})}}};a.\u0275fac=function(l){return new(l||a)},a.\u0275cmp=N({type:a,selectors:[["app-admin-guest-dialog"]],features:[Pe],decls:70,vars:40,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","login","l10nTranslate",""],["id","login","appAutofocus","","formControlName","login","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","email","l10nTranslate",""],["id","email","formControlName","email","autocomplete","off","type","email",1,"form-control","form-control-sm"],["for","firstName","l10nTranslate",""],["id","firstName","formControlName","firstName","autocomplete","off","type","text",1,"form-control","form-control-sm"],["for","lastName","l10nTranslate",""],["id","lastName","formControlName","lastName","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"position-absolute","pe-4",2,"right","50%","padding-top","6px",3,"passwordToCheck"],["id","password","placeholder","Set a password",3,"passwordChange","password","showGenerator","showLabel","isRequired"],["for","language","l10nTranslate",""],["id","language","formControlName","language",1,"form-control","form-select","form-select-sm"],[3,"ngValue"],[1,"d-flex","flex-column","col-6","pe-4"],["for","account","l10nTranslate",""],["id","account",1,"form-check","form-switch","form-check-inline"],["for","isActive",1,"form-check-label"],["formControlName","isActive","id","isActive","type","checkbox",1,"form-check-input"],["for","notification","l10nTranslate",""],["id","notification","formControlName","notification",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],["customClass","tab-dialog",3,"selectTab"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],["l10nTranslate","",1,"text-danger"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"me-2",3,"icon"],["l10nTranslate",""],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","access","l10nTranslate",""],["id","access",1,"text-align-end"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(l,t){l&1&&(n(0,"div",0)(1,"h4",1),g(2,Tt,3,2)(3,At,3,1),g(4,Et,1,1,"fa-icon",2),o(),g(5,Ut,3,0,"h4",3),n(6,"button",4),f("click",function(){return t.layout.closeDialog()}),o()(),n(7,"div",5)(8,"tabset",6),u(9,"hr",7),n(10,"tab",8),f("selectTab",function(){return t.tabView=null}),k(11,Dt,3,1,"ng-template",9),n(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),m(16,"Login"),o(),u(17,"input",14),o(),n(18,"div",15)(19,"label",16),m(20,"Email"),o(),u(21,"input",17),o()(),n(22,"div",11)(23,"div",12)(24,"label",18),m(25,"First name"),o(),u(26,"input",19),o(),n(27,"div",15)(28,"label",20),m(29,"Last name"),o(),u(30,"input",21),o()(),n(31,"div",11)(32,"div",12),g(33,Ft,1,1,"app-password-strength-bar",22),n(34,"app-input-password",23),f("passwordChange",function(_){return t.updatePassword(_)}),o()(),n(35,"div",15)(36,"label",24),m(37,"Language"),o(),n(38,"select",25),I(39,kt,2,2,"option",26,Y),o()()(),n(41,"div",11)(42,"div",27)(43,"label",28),m(44,"Account status"),o(),n(45,"div",29)(46,"label",30),u(47,"input",31),n(48,"span"),m(49),h(50,"translate"),h(51,"titlecase"),o()()()(),n(52,"div",15)(53,"label",32),m(54,"Notification"),o(),n(55,"select",33),I(56,It,2,2,"option",34,Y),o()()(),g(58,Pt,13,4,"div",11),o()(),n(59,"tab",35),f("selectTab",function(){return t.tabView="managers"}),k(60,Mt,5,2,"ng-template",9),n(61,"div",7)(62,"app-user-search",36),f("membersChange",function(_){return t.updateManagers(_)}),o(),g(63,Gt,2,0,"small",37),o()()()(),n(64,"div",38),g(65,Rt,2,1,"button",39),n(66,"button",40),f("click",function(){return t.onCancel()}),m(67,"Cancel"),o(),n(68,"button",41),f("click",function(){return t.onSubmit()}),m(69),o()()),l&2&&(r(2),C(t.guest?2:3),r(2),C(t.loading?4:-1),r(),C(t.guest?5:-1),r(),U(P("btn-close btn-close-white ",t.guest?"ms-2":"ms-auto"," ms-2")),r(),c("formGroup",t.guestForm),r(),c("justified",!0),r(9),E("is-invalid",t.guestForm.controls.login.invalid),c("autoSelect",!1),r(4),E("is-invalid",t.guestForm.controls.email.invalid),r(5),E("is-invalid",t.guestForm.controls.firstName.invalid),r(7),C(t.guestForm.value.password!==t.defaultPassword?33:-1),r(),c("password",t.guestForm.value.password)("showGenerator",!0)("showLabel",!0)("isRequired",!0),r(5),V(t.languages),r(9),E("text-danger",!t.guestForm.value.isActive),r(),A(" ",w(51,38,D(50,35,t.guestForm.value.isActive?"active":"suspended",t.locale.language))," "),r(7),V(t.allNotifications),r(2),C(t.guest?58:-1),r(4),c("members",t.guestForm.value.managers)("withPermissions",!1)("customPlaceholder","Type to search for managers to add")("searchFunction",t.searchMembers.bind(t)),r(),C(t.guestForm.value.managers.length?-1:63),r(2),C(t.guest!=null&&t.guest.id?65:-1),r(3),U(P("btn btn-sm ",t.confirmDeletion?"btn-danger":"btn-primary")),c("disabled",t.guestForm.invalid||t.submitted),r(),A(" ",t.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[M,G,j,fe,_e,de,Z,ue,B,$,q,te,K,ye,Te,Ae,xe,Se,we,ne,ie,pe],encapsulation:2});let e=a;return e})();function Ot(e,a){e&1&&(n(0,"h4",3)(1,"span",13),m(2,"Impersonate identity"),o()())}var bt=(()=>{let a=class a{constructor(){this.locale=S(H),this.layout=S(z),this.submitted=!1,this.icons={faUserSecret:he},this.passwordMinLength=8,this.impersonateUserForm=new ee({password:new y("",F.required)}),this.adminService=S(R)}onSubmit(){this.submitted=!0,this.adminService.impersonateUser(this.user.id,{password:this.impersonateUserForm.value.password}).subscribe({next:s=>{this.layout.closeDialog(),setTimeout(()=>this.adminService.initImpersonateUser(s),500)},error:s=>{this.submitted=!1,this.layout.sendNotification("error","Impersonate identity",this.user.login,s)}})}};a.\u0275fac=function(l){return new(l||a)},a.\u0275cmp=N({type:a,selectors:[["app-admin-impersonate-user-dialog"]],inputs:{user:"user"},decls:19,vars:16,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],[1,"d-flex","align-items-center","avatar","mb-3"],["alt","",1,"avatar-img",3,"src"],[1,"fw-bold","mx-2"],["id","password","placeholder","Enter your password to confirm",3,"passwordChange","password","passwordMinLength","isRequired","focus"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["l10nTranslate",""]],template:function(l,t){l&1&&(n(0,"div",0)(1,"h4",1),u(2,"fa-icon",2),n(3,"span"),m(4),o()(),g(5,Ot,3,0,"h4",3),n(6,"button",4),f("click",function(){return t.layout.closeDialog()}),o()(),n(7,"div",5)(8,"div",6),u(9,"img",7),n(10,"span",8),m(11),h(12,"capitalize"),o()(),n(13,"app-input-password",9),f("passwordChange",function(_){return t.impersonateUserForm.controls.password.setValue(_)}),o()(),n(14,"div",10)(15,"button",11),f("click",function(){return t.layout.closeDialog()}),m(16,"Cancel"),o(),n(17,"button",12),f("click",function(){return t.onSubmit()}),m(18," Confirm "),o()()),l&2&&(r(2),c("icon",t.icons.faUserSecret),r(2),v(t.user.fullName),r(),C(t.user?5:-1),r(),U(P("btn-close btn-close-white ",t.user?"ms-2":"ms-auto"," ms-2")),r(),c("formGroup",t.impersonateUserForm),r(2),c("src",t.user.avatarUrl,J),r(2),v(w(12,14,t.user.login)),r(2),c("password",t.impersonateUserForm.value.password)("passwordMinLength",t.passwordMinLength)("isRequired",!0)("focus",!0),r(4),c("disabled",t.impersonateUserForm.invalid||t.submitted))},dependencies:[M,G,j,$,q,K,oe],encapsulation:2});let e=a;return e})();var xt=(()=>{let a=class a{constructor(){this.translate=S($e)}transform(s,l=!1,t=null,d=", "){return s.length?(t?s.map(T=>T[t]):s.concat()).sort().map(T=>new oe().transform(l?this.translate.translate(T):T)).join(d):""}};a.\u0275fac=function(l){return new(l||a)},a.\u0275pipe=me({name:"join",type:a,pure:!0});let e=a;return e})();var St=(()=>{let a=class a{transform(s,l=","){return s?.length?s.split(l):[]}};a.\u0275fac=function(l){return new(l||a)},a.\u0275pipe=me({name:"split",type:a,pure:!0});let e=a;return e})();function Bt(e,a){e&1&&(n(0,"h4",3)(1,"span",9),m(2,"Delete user"),o()())}var wt=(()=>{let a=class a{constructor(){this.wasDeleted=new ce,this.locale=S(H),this.submitted=!1,this.icons={faUserMinus:Je},this.deleteUserForm=new ee({adminPassword:new y("",F.required),deleteSpace:new y(!1)}),this.layout=S(z),this.adminService=S(R)}onClose(){this.wasDeleted.emit(!1),this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.adminService.deleteUser(this.user.id,{adminPassword:this.deleteUserForm.value.adminPassword,deleteSpace:this.deleteUserForm.value.deleteSpace}).subscribe({next:()=>{this.wasDeleted.emit(!0),this.layout.sendNotification("success","Delete user",this.user.login),this.onClose()},error:s=>{this.submitted=!1,this.layout.sendNotification("error","Delete user",this.user.login,s)}})}};a.\u0275fac=function(l){return new(l||a)},a.\u0275cmp=N({type:a,selectors:[["app-admin-user-delete-dialog"]],inputs:{user:"user"},outputs:{wasDeleted:"wasDeleted"},decls:27,vars:15,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],[1,"me-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],[1,"d-flex","align-items-center","avatar","mb-3"],["alt","",1,"avatar-img",3,"src"],[1,"fw-bold","mx-2"],["l10nTranslate",""],["id","password","placeholder","Enter your password to confirm",3,"passwordChange","password","isRequired","focus"],[1,"form-check","form-check-inline","mt-3"],[1,"d-flex"],["for","deleteSpace",1,"form-check-label"],["formControlName","deleteSpace","id","deleteSpace","type","checkbox",1,"form-check-input"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"]],template:function(l,t){l&1&&(n(0,"div",0)(1,"h4",1),u(2,"fa-icon",2),n(3,"span"),m(4),o()(),g(5,Bt,3,0,"h4",3),n(6,"button",4),f("click",function(){return t.onClose()}),o()(),n(7,"div",5)(8,"div",6),u(9,"img",7),n(10,"span",8),m(11),h(12,"capitalize"),o(),n(13,"span",9),m(14,"will be permanently removed"),o()(),n(15,"app-input-password",10),f("passwordChange",function(_){return t.deleteUserForm.controls.adminPassword.setValue(_)}),o(),n(16,"div",11)(17,"div",12)(18,"label",13),u(19,"input",14),n(20,"span",9),m(21,"Delete all user files"),o()()()()(),n(22,"div",15)(23,"button",16),f("click",function(){return t.onClose()}),m(24,"Cancel"),o(),n(25,"button",17),f("click",function(){return t.onSubmit()}),m(26," Confirm "),o()()),l&2&&(r(2),c("icon",t.icons.faUserMinus),r(2),v(t.user.fullName),r(),C(t.user?5:-1),r(),U(P("btn-close btn-close-white ",t.user?"ms-2":"ms-auto"," ms-2")),r(),c("formGroup",t.deleteUserForm),r(2),c("src",t.user.avatarUrl,J),r(2),v(w(12,13,t.user.login)),r(4),c("password",t.deleteUserForm.value.adminPassword)("isRequired",!0)("focus",!0),r(10),c("disabled",t.deleteUserForm.invalid||t.submitted))},dependencies:[M,G,j,Z,B,$,q,te,K,oe],encapsulation:2});let e=a;return e})();var $t=(e,a)=>a.id;function qt(e,a){if(e&1&&(u(0,"fa-icon",47),n(1,"span"),m(2),o()),e&2){let i=p();c("icon",i.icons.faUserPen),r(2),v(i.user.fullName)}}function jt(e,a){if(e&1&&(u(0,"fa-icon",47),n(1,"span",40),m(2,"New user"),o()),e&2){let i=p();c("icon",i.icons.faUserPlus)}}function Ht(e,a){if(e&1&&u(0,"fa-icon",2),e&2){let i=p();c("icon",i.icons.faSpinner)}}function Qt(e,a){e&1&&(n(0,"h4",3)(1,"span",40),m(2,"Edit user"),o()())}function zt(e,a){if(e&1&&(u(0,"fa-icon",48),n(1,"span",49),m(2,"Account"),o()),e&2){let i=p();c("icon",i.icons.faAddressCard)}}function Kt(e,a){if(e&1&&u(0,"app-password-strength-bar",22),e&2){let i=p();c("passwordToCheck",i.userForm.value.password)}}function Wt(e,a){if(e&1&&(n(0,"option",26),m(1),o()),e&2){let i=a.$implicit;c("ngValue",i),r(),v(i)}}function Xt(e,a){if(e&1&&(n(0,"option",30),m(1),o()),e&2){let i=a.$implicit,s=p();c("ngValue",s.allNotifications.indexOf(i)),r(),v(i)}}function Jt(e,a){if(e&1&&(n(0,"div",11)(1,"div",12)(2,"label",50),m(3,"Storage Usage"),o(),u(4,"app-storage-usage",51),o(),u(5,"div",15),o()),e&2){let i=p();r(4),c("item",i.user)}}function Yt(e,a){if(e&1&&(n(0,"div"),m(1),h(2,"amDateFormat"),o(),n(3,"div"),m(4),h(5,"amDateFormat"),o()),e&2){let i=p(2);r(),O("",w(2,4,i.user.currentAccess)," - ",i.user.currentIp),r(3),O("",w(5,6,i.user.lastAccess)," - ",i.user.lastIp)}}function Zt(e,a){e&1&&(n(0,"span",57),m(1,"never"),o())}function ei(e,a){if(e&1&&(n(0,"div",11)(1,"div",12)(2,"label",52),m(3,"Creation date"),o(),n(4,"div",53),m(5),h(6,"amDateFormat"),o()(),n(7,"div",54)(8,"label",55),m(9,"Last accesses"),o(),n(10,"div",56),g(11,Yt,6,8)(12,Zt,2,0,"span",57),o()()()),e&2){let i=p();r(5),v(w(6,2,i.user.createdAt)),r(6),C(i.user.lastAccess?11:12)}}function ti(e,a){if(e&1&&(u(0,"fa-icon",48),n(1,"span",49),m(2,"Permissions"),o()),e&2){let i=p();c("icon",i.icons.faShieldHalved)}}function ii(e,a){if(e&1&&(n(0,"div",60)(1,"div",61),u(2,"fa-icon",62),n(3,"span"),m(4),o()(),n(5,"div",63),m(6),h(7,"split"),h(8,"join"),o()()),e&2){let i=p().$implicit,s=p(2);r(2),c("icon",s.icons.GROUPS),r(2),v(i.name),r(2),v(D(8,5,w(7,3,i.permissions),!0))}}function ni(e,a){if(e&1&&g(0,ii,9,8,"div",60),e&2){let i=a.$implicit;C(i.permissions?0:-1)}}function oi(e,a){if(e&1&&(n(0,"div",32)(1,"label",58),m(2,"Permissions inherited from groups"),o(),n(3,"div",59),I(4,ni,1,1,null,null,$t),o()()),e&2){let i=p();r(4),V(i.userForm.value.groups)}}function ai(e,a){if(e&1&&(u(0,"fa-icon",48),n(1,"span",64),m(2,"Groups"),o(),n(3,"span"),m(4),o()),e&2){let i=p();c("icon",i.icons.faUsers),r(4),A("(",i.userForm.value.groups.length||0,")")}}function ri(e,a){if(e&1){let i=L();n(0,"button",65),f("click",function(){b(i);let l=p();return x(l.confirmDeletion=!0)}),m(1," Remove "),o()}if(e&2){let i=p();c("disabled",i.confirmDeletion)}}var Ne=(()=>{let a=class a{constructor(){this.user=null,this.userChange=new ce,this.locale=S(H),this.layout=S(z),this.submitted=!1,this.loading=!1,this.confirmDeletion=!1,this.icons={GROUPS:lt.GROUPS,faUserPlus:Ce,faUserPen:ge,faSpinner:Xe,faAddressCard:Ke,faUsers:ze,faShieldHalved:Ze},this.allNotifications=Object.values(ve),this.defaultPassword=this.layout.translateString(mt),this.languages=this.layout.getLanguages(!0),this.adminService=S(R)}ngOnInit(){this.userForm=new ee({login:new y(this.user?.login||"",[F.required,F.pattern(it)]),email:new y(this.user?.email||"",[F.required,F.maxLength(255),F.email]),firstName:new y(this.user?.firstName||"",[F.required,F.maxLength(255)]),lastName:new y(this.user?.lastName||"",F.maxLength(255)),password:new y(this.user?this.defaultPassword:"",F.maxLength(255)),language:new y(this.user?.language||null),notification:new y(this.user?.notification||Object.values(ve).indexOf(ve.APPLICATION_EMAIL)),isActive:new y(this.user?this.user.isActive:!0),isAdmin:new y(this.user?this.user.isAdmin:!1),storageQuota:new y(this.user?.storageQuota||null),groups:new y(this.user?.groups||[]),applications:new y(this.user?.applications||[])})}searchMembers(s){let l={search:s,onlyGroups:!0,excludePersonalGroups:!0,withPermissions:!0,ignoreGroupIds:this.userForm.value.groups.map(t=>t.id)};return this.adminService.searchMembers(l)}updateApplications(s){this.userForm.controls.applications.setValue(s),this.userForm.controls.applications.markAsDirty()}updatePassword(s){this.userForm.controls.password.setValue(s),this.userForm.controls.password.markAsDirty()}updateMembers(s){this.userForm.controls.groups.setValue(s),this.userForm.controls.groups.markAsDirty()}updateQuota(s){this.userForm.controls.storageQuota.setValue(s),this.userForm.controls.storageQuota.markAsDirty()}onCancel(){this.confirmDeletion?this.confirmDeletion=!1:this.layout.closeDialog()}onSubmit(){this.submitted=!0,this.confirmDeletion?this.layout.openDialog(wt,"sm",{initialState:{user:this.user}}).content.wasDeleted.pipe(W(1)).subscribe(l=>{l?(this.userChange.emit(["delete",this.user]),this.layout.closeDialog()):(this.confirmDeletion=!1,this.submitted=!1)}):this.user?this.adminService.updateUser(this.user.id,this.makeDto()).subscribe({next:s=>{this.userChange.emit(["update",s]),this.layout.sendNotification("success","User updated",this.userForm.value.login),this.layout.closeDialog()},error:s=>this.onError(s)}):this.adminService.createUser(this.makeDto(!0)).subscribe({next:s=>{this.userChange.emit(["add",s]),this.layout.sendNotification("success","User created",this.userForm.value.login),this.layout.closeDialog()},error:s=>this.onError(s)})}makeDto(s=!1){let l={};if(s)l=this.userForm.value;else for(let t in this.userForm.controls)this.userForm.controls[t].dirty&&(l[t]=this.userForm.controls[t].value);for(let t in l)switch(t){case"language":l[t]=l[t]===ct?null:l[t];break;case"isAdmin":l.role=l[t]?X.ADMINISTRATOR:X.USER;break;case"applications":l.permissions=l[t].join(nt);break;case"groups":l[t]=l[t].map(d=>d.id);break}return l}onError(s){this.layout.sendNotification("error","Group error",this.userForm.value.login,s),this.submitted=!1}};a.\u0275fac=function(l){return new(l||a)},a.\u0275cmp=N({type:a,selectors:[["app-admin-user-dialog"]],inputs:{user:"user"},outputs:{userChange:"userChange"},decls:82,vars:44,consts:[[1,"modal-header","align-items-center"],[1,"modal-title"],["animation","spin","size","sm",1,"ms-2",3,"icon"],[1,"modal-title","ms-auto"],["aria-label","Close","type","button",3,"click"],[1,"modal-body",3,"formGroup"],["type","pills",3,"justified"],[1,"my-3"],["customClass","tab-dialog form-validation",3,"selectTab"],["tabHeading",""],[1,"d-flex","flex-column"],[1,"d-flex","col-12","pb-3"],[1,"flex-fill","col-6","pe-4"],["for","login","l10nTranslate",""],["id","login","appAutofocus","","formControlName","login","autocomplete","off","type","text",1,"form-control","form-control-sm",3,"autoSelect"],[1,"flex-fill","col-6","ps-4"],["for","email","l10nTranslate",""],["id","email","formControlName","email","autocomplete","off","type","email",1,"form-control","form-control-sm"],["for","firstName","l10nTranslate",""],["id","firstName","formControlName","firstName","autocomplete","off","type","text",1,"form-control","form-control-sm"],["for","lastName","l10nTranslate",""],["id","lastName","formControlName","lastName","autocomplete","off","type","text",1,"form-control","form-control-sm"],[1,"position-absolute","pe-4",2,"right","50%","padding-top","6px",3,"passwordToCheck"],["id","password","placeholder","Set a password",3,"passwordChange","password","showGenerator","showLabel","isRequired"],["for","language","l10nTranslate",""],["id","language","formControlName","language",1,"form-control","form-select","form-select-sm"],[3,"ngValue"],[3,"quotaChange","quota","fullWidth"],["for","notification","l10nTranslate",""],["id","notification","formControlName","notification",1,"form-control","form-select","form-select-sm"],["l10nTranslate","",3,"ngValue"],["customClass","tab-dialog",3,"selectTab"],[1,"d-flex","flex-column","col-12","pb-3"],["for","account","l10nTranslate",""],["id","account",1,"form-check","form-switch","form-check-inline"],[1,"d-flex"],["for","isActive",1,"form-check-label"],["formControlName","isActive","id","isActive","type","checkbox",1,"form-check-input"],["for","isAdmin",1,"form-check-label"],["formControlName","isAdmin","id","isAdmin","type","checkbox",1,"form-check-input"],["l10nTranslate",""],[3,"permissionsChange","permissions"],[3,"membersChange","members","withPermissions","customPlaceholder","searchFunction"],[1,"modal-footer"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"disabled"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary","ms-auto",3,"click"],["type","button","l10nTranslate","",3,"click","disabled"],[1,"me-2",3,"icon"],[3,"icon"],["l10nTranslate","",1,"ms-2"],["for","storage","l10nTranslate",""],["id","storage",3,"item"],["for","created","l10nTranslate",""],["id","created"],[1,"d-flex","flex-column","align-items-end","col-6","ps-4"],["for","access","l10nTranslate",""],["id","access",1,"text-align-end"],["l10nTranslate","",1,"text-danger"],["for","groups_permissions","l10nTranslate",""],["id","groups_permissions"],[1,"d-flex","align-items-center","mb-1"],[1,"d-flex","align-items-center","me-5"],[1,"circle-primary-icon","me-2",3,"icon"],[1,"d-flex","fs-xxs","ms-auto"],["l10nTranslate","",1,"ms-2","me-1"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"]],template:function(l,t){l&1&&(n(0,"div",0)(1,"h4",1),g(2,qt,3,2)(3,jt,3,1),g(4,Ht,1,1,"fa-icon",2),o(),g(5,Qt,3,0,"h4",3),n(6,"button",4),f("click",function(){return t.layout.closeDialog()}),o()(),n(7,"div",5)(8,"tabset",6),u(9,"hr",7),n(10,"tab",8),f("selectTab",function(){return t.tabView=null}),k(11,zt,3,1,"ng-template",9),n(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),m(16,"Login"),o(),u(17,"input",14),o(),n(18,"div",15)(19,"label",16),m(20,"Email"),o(),u(21,"input",17),o()(),n(22,"div",11)(23,"div",12)(24,"label",18),m(25,"First name"),o(),u(26,"input",19),o(),n(27,"div",15)(28,"label",20),m(29,"Last name"),o(),u(30,"input",21),o()(),n(31,"div",11)(32,"div",12),g(33,Kt,1,1,"app-password-strength-bar",22),n(34,"app-input-password",23),f("passwordChange",function(_){return t.updatePassword(_)}),o()(),n(35,"div",15)(36,"label",24),m(37,"Language"),o(),n(38,"select",25),I(39,Wt,2,2,"option",26,Y),o()()(),n(41,"div",11)(42,"div",12)(43,"app-storage-quota",27),f("quotaChange",function(_){return t.updateQuota(_)}),o()(),n(44,"div",15)(45,"label",28),m(46,"Notification"),o(),n(47,"select",29),I(48,Xt,2,2,"option",30,Y),o()()(),g(50,Jt,6,1,"div",11),o(),g(51,ei,13,4,"div",11),o(),n(52,"tab",31),f("selectTab",function(){return t.tabView="permissions"}),k(53,ti,3,1,"ng-template",9),n(54,"div",32)(55,"label",33),m(56,"Account status"),o(),n(57,"div",34)(58,"div",35)(59,"label",36),u(60,"input",37),n(61,"span"),m(62),h(63,"translate"),h(64,"titlecase"),o()()(),n(65,"div",35)(66,"label",38),u(67,"input",39),n(68,"span",40),m(69,"Administrator"),o()()()()(),n(70,"app-admin-permissions",41),f("permissionsChange",function(_){return t.updateApplications(_)}),o(),g(71,oi,6,0,"div",32),o(),n(72,"tab",31),f("selectTab",function(){return t.tabView="groups"}),k(73,ai,5,2,"ng-template",9),n(74,"div",7)(75,"app-user-search",42),f("membersChange",function(_){return t.updateMembers(_)}),o()()()()(),n(76,"div",43),g(77,ri,2,1,"button",44),n(78,"button",45),f("click",function(){return t.onCancel()}),m(79,"Cancel"),o(),n(80,"button",46),f("click",function(){return t.onSubmit()}),m(81),o()()),l&2&&(r(2),C(t.user?2:3),r(2),C(t.loading?4:-1),r(),C(t.user?5:-1),r(),U(P("btn-close btn-close-white ",t.user?"ms-2":"ms-auto"," ms-2")),r(),c("formGroup",t.userForm),r(),c("justified",!0),r(9),E("is-invalid",t.userForm.controls.login.invalid),c("autoSelect",!1),r(4),E("is-invalid",t.userForm.controls.email.invalid),r(5),E("is-invalid",t.userForm.controls.firstName.invalid),r(7),C(t.userForm.value.password!==t.defaultPassword?33:-1),r(),c("password",t.userForm.value.password)("showGenerator",!0)("showLabel",!0)("isRequired",!0),r(5),V(t.languages),r(4),c("quota",t.userForm.value.storageQuota)("fullWidth",!0),r(5),V(t.allNotifications),r(2),C(t.user&&t.user.storageUsage?50:-1),r(),C(t.user?51:-1),r(10),E("text-danger",!t.userForm.value.isActive),r(),A(" ",w(64,42,D(63,39,t.userForm.value.isActive?"active":"suspended",t.locale.language))," "),r(8),c("permissions",t.userForm.value.applications),r(),C(t.userForm.value.groups.length?71:-1),r(4),c("members",t.userForm.value.groups)("withPermissions",!1)("customPlaceholder","Type to search for groups to add")("searchFunction",t.searchMembers.bind(t)),r(2),C(t.user!=null&&t.user.id?77:-1),r(3),U(P("btn btn-sm ",t.confirmDeletion?"btn-danger":"btn-primary")),c("disabled",t.userForm.invalid||t.submitted),r(),A(" ",t.confirmDeletion?"Confirm deletion":"Confirm"," "))},dependencies:[M,G,Se,we,xe,j,fe,_e,de,Z,ue,B,$,q,te,K,ye,be,ht,Ae,Te,vt,pe,ie,St,xt,ne],encapsulation:2});let e=a;return e})();var si=["MainContextMenu"],li=["TargetContextMenu"],yt=(e,a)=>a.key,mi=(e,a)=>a.id,ci=(e,a)=>a.mid;function pi(e,a){if(e&1&&u(0,"fa-icon",24),e&2){let i=p(3);c("icon",i.sortTable.sortParam.asc?i.icons.faArrowDown:i.icons.faArrowUp)("fixedWidth",!1)}}function di(e,a){if(e&1){let i=L();n(0,"th",23),f("click",function(){b(i);let l=p().$implicit,t=p();return x(t.sortBy(l.key))}),m(1),g(2,pi,1,2,"fa-icon",24),o()}if(e&2){let i=p().$implicit,s=p();U(i.value.class),De("width",i.value.width,"%"),E("text-align-center",i.value.textCenter)("cursor-pointer",i.value.sortable),r(),A(" ",i.value.label," "),r(),C(s.sortTable.sortParam.column===i.key?2:-1)}}function ui(e,a){if(e&1&&g(0,di,3,10,"th",22),e&2){let i=a.$implicit;C(i.value.show?0:-1)}}function fi(e,a){if(e&1&&u(0,"fa-icon",32),e&2){let i=p(5);c("icon",i.icons.faKey)}}function _i(e,a){if(e&1&&(n(0,"div",27),u(1,"img",30),n(2,"div",28)(3,"span",31),m(4),g(5,fi,1,1,"fa-icon",32),o(),n(6,"span",33),m(7),o()()()),e&2){let i=p(3).$implicit;r(),c("src",i.avatarUrl,J),r(3),A(" ",i.login," "),r(),C(i.isAdmin?5:-1),r(2),v(i.email)}}function gi(e,a){if(e&1&&(n(0,"span",34),m(1),o()),e&2){let i=p(4).$implicit;r(),v(i.userRoleText)}}function Ci(e,a){if(e&1&&(n(0,"div",28)(1,"span",31),m(2),o(),g(3,gi,2,1,"span",34),o()),e&2){let i=p(3).$implicit;r(2),v(i.fullName),r(),C(i.isAdmin?3:-1)}}function hi(e,a){if(e&1&&u(0,"app-user-avatar",35),e&2){let i=a.$implicit;c("user",i)("isMember",!0)}}function vi(e,a){if(e&1&&I(0,hi,1,2,"app-user-avatar",35,ci),e&2){let i=p(3).$implicit;V(i.managers)}}function bi(e,a){if(e&1&&u(0,"app-storage-usage",36),e&2){let i=p(4).$implicit;c("item",i)}}function xi(e,a){if(e&1&&g(0,bi,1,1,"app-storage-usage",36),e&2){let i=p(3).$implicit;C(i.storageUsage?0:-1)}}function Si(e,a){if(e&1&&(n(0,"div",28)(1,"div"),m(2),o(),n(3,"div"),m(4),o()()),e&2){let i=p(3).$implicit;r(2),v(i.currentIp),r(2),v(i.lastIp)}}function wi(e,a){e&1&&m(0," too many login attempts ")}function yi(e,a){if(e&1&&m(0),e&2){let i=p(4).$implicit;A(" ",i.userIsActiveText," ")}}function Ti(e,a){if(e&1&&(n(0,"span",11),g(1,wi,1,0)(2,yi,1,1),o()),e&2){let i=p(3).$implicit;U(i.isActive?"text-success":"text-danger"),r(),C(!i.isActive&&i.passwordAttempts?1:2)}}function Ai(e,a){if(e&1&&(n(0,"div",28)(1,"div"),m(2),h(3,"amDateFormat"),o(),n(4,"div"),m(5),h(6,"amDateFormat"),o()()),e&2){let i=p(5).$implicit;r(2),v(w(3,2,i.currentAccess)),r(3),v(w(6,4,i.lastAccess))}}function Ei(e,a){if(e&1&&m(0),e&2){let i=p(5).$implicit;A(" ",i.hTimeAgo," ")}}function Ui(e,a){if(e&1){let i=L();n(0,"div",38),f("mouseover",function(){b(i);let l=p(4).$implicit;return x(l.currentAccessHover=!0)})("focus",function(){b(i);let l=p(4).$implicit;return x(l.currentAccessHover=!0)})("mouseleave",function(){b(i);let l=p(4).$implicit;return x(l.currentAccessHover=!1)}),g(1,Ai,7,6,"div",28)(2,Ei,1,1),o()}if(e&2){let i=p(4).$implicit;r(),C(i.currentAccessHover?1:2)}}function Di(e,a){e&1&&(n(0,"span",11),m(1,"never"),o())}function Fi(e,a){if(e&1&&g(0,Ui,3,1,"div",37)(1,Di,2,0,"span",11),e&2){let i=p(3).$implicit;C(i.currentAccess?0:1)}}function ki(e,a){if(e&1&&(n(0,"td"),g(1,_i,8,4,"div",27)(2,Ci,4,2,"div",28)(3,vi,2,0)(4,xi,1,1)(5,Si,5,2,"div",28)(6,Ti,3,3,"span",29)(7,Fi,2,1),o()),e&2){let i,s=p().$implicit,l=p().$implicit;U(Me("",s.value.class," ",s.value.newly?"prop-newly-"+l[s.value.newly]:"")),De("width",s.value.width,"%"),E("text-align-center",s.value.textCenter),r(),C((i=s.key)==="login"?1:i==="fullName"?2:i==="managers"?3:i==="storage"?4:i==="currentIp"?5:i==="isActive"?6:i==="currentAccess"?7:-1)}}function Ii(e,a){if(e&1&&g(0,ki,8,9,"td",26),e&2){let i=a.$implicit;C(i.value.show?0:-1)}}function Vi(e,a){if(e&1){let i=L();n(0,"tr",25),f("click",function(){let l=b(i).$implicit,t=p();return x(t.onSelect(l))})("contextmenu",function(l){let t=b(i).$implicit,d=p();return x(d.onTargetContextMenu(l,t))})("pressup",function(l){let t=b(i).$implicit,d=p();return x(d.onTargetContextMenu(l,t))})("tap",function(){b(i);let l=p();return x(l.openDialog())}),I(1,Ii,1,1,null,null,yt),h(3,"keyvalue"),o()}if(e&2){let i=a.$implicit,s=p();E("disabled",!i.isActive)("selected",i.id===(s.selected==null?null:s.selected.id)),r(),V(D(3,4,s.tableHeaders,s.originalOrderKeyValue))}}function Ni(e,a){if(e&1&&(n(0,"span",11),u(1,"fa-icon",5),m(2),o()),e&2){let i=p();r(),c("icon",i.icons.faUserPlus),r(),A("New ",i.guestsView?"guest":"user")}}function Pi(e,a){}function Mi(e,a){if(e&1&&(n(0,"span",11),u(1,"fa-icon",5),m(2,"Refresh"),o()),e&2){let i=p();r(),c("icon",i.icons.faArrowRotateRight)}}function Gi(e,a){if(e&1&&(n(0,"span",11),u(1,"fa-icon",5),m(2),o()),e&2){let i=p();r(),c("icon",i.icons.faUserPen),r(),A("Edit ",i.guestsView?"guest":"user")}}function Ri(e,a){}function Li(e,a){if(e&1&&(n(0,"span",11),u(1,"fa-icon",5),m(2,"Impersonate identity"),o()),e&2){let i=p();r(),c("icon",i.icons.faUserSecret)}}var Lo=(()=>{let a=class a{constructor(){this.locale=S(H),this.originalOrderKeyValue=pt,this.icons={faRotate:je,faUserPlus:Ce,faUserPen:ge,faArrowDown:tt,faArrowUp:We,faKey:Qe,faUserSecret:he,faArrowRotateRight:et,faToggleOn:Ye,faToggleOff:He},this.tableHeaders={login:{label:"Login",width:30,textCenter:!1,class:"",show:!0,sortable:!0},fullName:{label:"Full name",width:15,class:"",textCenter:!1,show:!0,sortable:!0},managers:{label:"Managers",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!1,sortable:!0},storage:{label:"Storage Space",width:15,class:"d-none d-md-table-cell",textCenter:!0,show:!0,sortable:!0},isActive:{label:"Status",width:10,textCenter:!0,class:"d-none d-lg-table-cell",show:!0,sortable:!0},currentIp:{label:"IP",width:10,textCenter:!1,class:"d-none d-lg-table-cell",show:!0},currentAccess:{label:"Seen",width:12,textCenter:!0,class:"d-none d-lg-table-cell",newly:"newly",show:!0,sortable:!0}},this.guestsView=!1,this.loading=!1,this.selected=null,this.users=[],this.router=S(Le),this.activatedRoute=S(Re),this.layout=S(z),this.adminService=S(R),this.sortSettings={default:[{prop:"login",type:"string"}],login:[{prop:"login",type:"string"}],fullName:[{prop:"fullName",type:"string"}],managers:[{prop:"managers",type:"length"}],storage:[{prop:"storageUsage",type:"number"}],currentAccess:[{prop:"currentAccess",type:"date"}],isActive:[{prop:"isActive",type:"number"}]},this.sortTable=new ft(this.constructor.name,this.sortSettings),this.layout.setBreadcrumbIcon(ot.USERS),this.activatedRoute.data.subscribe(s=>{this.guestsView=s.type===X.GUEST,this.setEnv()})}loadUsersOrGuests(){this.loading=!0,this.onSelect(),this.adminService.listUsers(this.guestsView).subscribe({next:s=>{this.sortBy(this.sortTable.sortParam.column,!1,s),this.scrollView.scrollInto(-1),this.loading=!1},error:s=>{this.users=[],this.layout.sendNotification("error",this.guestsView?"Guests":"Users","Unable to load",s),this.loading=!1}})}onSelect(s=null){this.selected=s}onGuestsView(s){this.guestsView=s,this.router.navigate([Q.BASE,s?Q.GUESTS:Q.USERS]).catch(console.error)}onContextMenu(s){s.preventDefault(),s.stopPropagation(),this.layout.openContextMenu(s,this.mainContextMenu)}onTargetContextMenu(s,l){s.preventDefault(),s.type==="contextmenu"&&s.stopPropagation(),this.onSelect(l),this.layout.openContextMenu(s,this.targetContextMenu)}sortBy(s,l=!0,t){this.users=this.sortTable.sortBy(s,l,t||this.users)}openDialog(s=!1){this.guestsView?this.openGuestDialog(s):this.openUserDialog(s)}openUserDialog(s=!1){s?this.layout.openDialog(Ne,"md").content.userChange.pipe(W(1)).subscribe(t=>{let[d,_]=t;d==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.users,_]),this.onSelect(_))}):this.adminService.getUser(this.selected.id).subscribe({next:l=>{this.layout.openDialog(Ne,"md",{initialState:{user:l}}).content.userChange.pipe(W(1)).subscribe(d=>{let[_,T]=d;_==="update"?this.selected=Object.assign(this.selected,T):_==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.users.filter(Ue=>Ue.id!==T.id)))})},error:l=>this.layout.sendNotification("error","Edit group",this.selected.login,l)})}openGuestDialog(s=!1){s?this.layout.openDialog(Ve,"md").content.guestChange.pipe(W(1)).subscribe(t=>{let[d,_]=t,T=new gt(_);d==="add"&&(this.sortBy(this.sortTable.sortParam.column,!1,[...this.users,T]),this.onSelect(T))}):this.adminService.getUser(this.selected.id,!0).subscribe({next:l=>{this.layout.openDialog(Ve,"md",{initialState:{guest:l}}).content.guestChange.pipe(W(1)).subscribe(d=>{let[_,T]=d;_==="update"?this.selected=Object.assign(this.selected,T):_==="delete"&&(this.onSelect(),this.sortBy(this.sortTable.sortParam.column,!1,this.users.filter(Ue=>Ue.id!==T.id)))})},error:l=>this.layout.sendNotification("error","Guest error",this.selected.fullName,l)})}impersonateIdentity(){this.layout.openDialog(bt,"sm",{initialState:{user:this.selected}})}setEnv(){this.tableHeaders.managers.show=this.guestsView,this.tableHeaders.storage.show=!this.guestsView,this.loadUsersOrGuests(),this.layout.setBreadcrumbNav({url:this.guestsView?`/${Q.BASE}/${Q.GUESTS}/${Fe.GUESTS}`:`/${Q.BASE}/${Q.USERS}/${Fe.USERS}`,splicing:2,translating:!0,sameLink:!0})}};a.\u0275fac=function(l){return new(l||a)},a.\u0275cmp=N({type:a,selectors:[["app-admin-users"]],viewQuery:function(l,t){if(l&1&&(re(Ie,5),re(ke,7),re(si,7),re(li,7)),l&2){let d;se(d=le())&&(t.scrollView=d.first),se(d=le())&&(t.inputFilter=d.first),se(d=le())&&(t.mainContextMenu=d.first),se(d=le())&&(t.targetContextMenu=d.first)}},decls:47,vars:40,consts:[["MainContextMenu",""],["TargetContextMenu",""],[1,"app-top-menu"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","tooltip"],[3,"icon","animation"],[3,"icon"],["container","body","type","button",1,"btn","btn-sm","btn-secondary","me-1",3,"click","disabled","tooltip"],[1,"ms-auto"],["btnCheckbox","","type","button",1,"btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center"],[1,"me-2",3,"icon"],["l10nTranslate",""],[1,"btn-group","btn-group-sm"],[1,"d-none","d-sm-block"],[1,"app-table"],[3,"contextmenu","bufferAmount","items"],["tabindex","-1"],[3,"disabled","selected"],[1,"app-foot-menu"],[1,"mx-auto"],["contextMenuItem","",3,"execute"],["contextMenuItem","",3,"divider"],["l10nTranslate","",3,"width","text-align-center","cursor-pointer","class"],["l10nTranslate","",3,"click"],[3,"icon","fixedWidth"],[3,"click","contextmenu","pressup","tap"],[3,"width","text-align-center","class"],[1,"d-flex","align-items-center","avatar"],[1,"d-flex","flex-column"],["l10nTranslate","",3,"class"],["alt","",1,"avatar-img",3,"src"],["draggable","false",1,"no-pointer-events"],[1,"m-0",3,"icon"],["draggable","false",1,"no-pointer-events","text-muted","fs-xxxs"],["draggable","false","l10nTranslate","",1,"no-pointer-events","text-muted","fs-xxxs"],[3,"user","isMember"],[3,"item"],[1,"d-flex","justify-content-center"],[1,"d-flex","justify-content-center",3,"mouseover","focus","mouseleave"]],template:function(l,t){if(l&1){let d=L();n(0,"div",2)(1,"button",3),h(2,"translate"),f("click",function(){return b(d),x(t.loadUsersOrGuests())}),u(3,"fa-icon",4),o(),n(4,"button",3),h(5,"translate"),f("click",function(){return b(d),x(t.openDialog(!0))}),u(6,"fa-icon",5),o(),n(7,"button",6),h(8,"translate"),f("click",function(){return b(d),x(t.openDialog())}),u(9,"fa-icon",5),o(),n(10,"button",6),h(11,"translate"),f("click",function(){return b(d),x(t.impersonateIdentity())}),u(12,"fa-icon",5),o(),n(13,"div",7)(14,"button",8),f("ngModelChange",function(T){return b(d),x(t.onGuestsView(T))}),n(15,"div",9),u(16,"fa-icon",10),n(17,"span",11),m(18,"Guests"),o()()(),n(19,"div",12),u(20,"app-input-filter",13),o()()(),n(21,"table",14)(22,"thead")(23,"tr"),I(24,ui,1,1,null,null,yt),h(26,"keyvalue"),o()()(),n(27,"app-virtual-scroll",15),h(28,"searchFilter"),f("contextmenu",function(T){return b(d),x(t.onContextMenu(T))}),n(29,"table",14)(30,"tbody",16),I(31,Vi,4,7,"tr",17,mi),o()()(),n(33,"div",18)(34,"span",19),m(35),h(36,"translate"),o()(),n(37,"context-menu",null,0),k(39,Ni,3,2,"ng-template",20),f("execute",function(){return b(d),x(t.openDialog(!0))}),k(40,Pi,0,0,"ng-template",21)(41,Mi,3,1,"ng-template",20),f("execute",function(){return b(d),x(t.loadUsersOrGuests())}),o(),n(42,"context-menu",null,1),k(44,Gi,3,2,"ng-template",20),f("execute",function(){return b(d),x(t.openDialog())}),k(45,Ri,0,0,"ng-template",21)(46,Li,3,1,"ng-template",20),f("execute",function(){return b(d),x(t.impersonateIdentity())}),o()}l&2&&(r(),c("tooltip",D(2,19,"Refresh",t.locale.language)),r(2),c("icon",t.icons.faRotate)("animation",t.loading?"spin":null),r(),c("tooltip",D(5,22,t.guestsView?"New guest":"New user",t.locale.language)),r(2),c("icon",t.icons.faUserPlus),r(),c("disabled",!t.selected)("tooltip",D(8,25,t.guestsView?"Edit guest":"Edit user",t.locale.language)),r(2),c("icon",t.icons.faUserPen),r(),c("disabled",!t.selected)("tooltip",D(11,28,"Impersonate identity",t.locale.language)),r(2),c("icon",t.icons.faUserSecret),r(2),c("ngModel",t.guestsView),r(2),c("icon",t.guestsView?t.icons.faToggleOn:t.icons.faToggleOff),r(8),V(D(26,31,t.tableHeaders,t.originalOrderKeyValue)),r(3),c("bufferAmount",5)("items",D(28,34,t.users,t.inputFilter.search())),r(4),V(t.scrollView==null?null:t.scrollView.viewPortItems),r(4),O("",t.users.length," ",D(36,37,t.guestsView?"guests":"users",t.locale.language)),r(5),c("divider",!0),r(5),c("divider",!0))},dependencies:[M,ke,qe,G,Ie,be,st,rt,at,dt,Be,B,Oe,_t,ie,Ge,ut,ne],encapsulation:2});let e=a;return e})();export{Lo as AdminUsersComponent};