@gloww/gloww 0.9.0-beta.10

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 (308) hide show
  1. package/README.md +24 -0
  2. package/compute-version.js +117 -0
  3. package/esm2020/gloww-gloww.mjs +5 -0
  4. package/esm2020/lib/Components/code-editor/code-editor.component.mjs +59 -0
  5. package/esm2020/lib/Components/confirmation/confirmation.component.mjs +43 -0
  6. package/esm2020/lib/Components/display-objects/display-objects.component.mjs +499 -0
  7. package/esm2020/lib/Components/display-objects-configuration.mjs +2 -0
  8. package/esm2020/lib/Components/download-progress/download-progress.component.mjs +119 -0
  9. package/esm2020/lib/Components/folders/file-edit/file-edit.component.mjs +71 -0
  10. package/esm2020/lib/Components/folders/folders/folders.component.mjs +180 -0
  11. package/esm2020/lib/Components/header/header.component.mjs +14 -0
  12. package/esm2020/lib/Components/html-editor/html-editor.component.mjs +175 -0
  13. package/esm2020/lib/Components/menu-list-item/menu-list-item.component.mjs +101 -0
  14. package/esm2020/lib/Components/prompt/prompt.component.mjs +52 -0
  15. package/esm2020/lib/Components/result-table/result-table.component.mjs +21 -0
  16. package/esm2020/lib/Components/search-form/search-form.component.mjs +14 -0
  17. package/esm2020/lib/Components/secure-a/secure-a.component.mjs +31 -0
  18. package/esm2020/lib/Components/secure-img/secure-img.component.mjs +45 -0
  19. package/esm2020/lib/Components/upload-doc/upload-doc.component.mjs +95 -0
  20. package/esm2020/lib/Components/upload-file/upload-file.component.mjs +138 -0
  21. package/esm2020/lib/Directives/file-sink.directive.mjs +52 -0
  22. package/esm2020/lib/Models/nav-item.mjs +2 -0
  23. package/esm2020/lib/Pipes/html-format.pipe.mjs +23 -0
  24. package/esm2020/lib/Pipes/retry-with-delay.mjs +12 -0
  25. package/esm2020/lib/Pipes/safe-html.pipe.mjs +22 -0
  26. package/esm2020/lib/Pipes/secure.pipe.mjs +34 -0
  27. package/esm2020/lib/Services/dialog.service.mjs +29 -0
  28. package/esm2020/lib/Services/folder-service-config.mjs +21 -0
  29. package/esm2020/lib/Services/folder.service.mjs +50 -0
  30. package/esm2020/lib/Services/gloww.service.mjs +66 -0
  31. package/esm2020/lib/Services/nav.service.mjs +28 -0
  32. package/esm2020/lib/Services/version-check.service.mjs +81 -0
  33. package/esm2020/lib/Services/voice-recognition.service.mjs +55 -0
  34. package/esm2020/lib/gloww-security/Components/change-password-dlg/change-password-dlg.component.mjs +67 -0
  35. package/esm2020/lib/gloww-security/Components/login/login.component.mjs +173 -0
  36. package/esm2020/lib/gloww-security/Components/social-network/social-network.component.mjs +46 -0
  37. package/esm2020/lib/gloww-security/Components/social-network-dlg/social-network-dlg.component.mjs +52 -0
  38. package/esm2020/lib/gloww-security/Components/user-menu/user-menu.component.mjs +73 -0
  39. package/esm2020/lib/gloww-security/Helpers/administrator.guard.mjs +27 -0
  40. package/esm2020/lib/gloww-security/Helpers/auth.guard.mjs +57 -0
  41. package/esm2020/lib/gloww-security/Helpers/error.interceptor.mjs +29 -0
  42. package/esm2020/lib/gloww-security/Helpers/index.mjs +5 -0
  43. package/esm2020/lib/gloww-security/Helpers/jwt.interceptor.mjs +31 -0
  44. package/esm2020/lib/gloww-security/Helpers/staging.interceptor.mjs +24 -0
  45. package/esm2020/lib/gloww-security/Models/oauthassociation.mjs +6 -0
  46. package/esm2020/lib/gloww-security/Models/user.mjs +3 -0
  47. package/esm2020/lib/gloww-security/Services/authentication-service-config.mjs +25 -0
  48. package/esm2020/lib/gloww-security/Services/authentication.service.mjs +205 -0
  49. package/esm2020/lib/gloww-security/Services/gloww-security.service.mjs +14 -0
  50. package/esm2020/lib/gloww-security/gloww-security.module.mjs +171 -0
  51. package/esm2020/lib/gloww.module.mjs +220 -0
  52. package/esm2020/lib/injection-token.mjs +3 -0
  53. package/esm2020/public-api.mjs +32 -0
  54. package/fesm2015/gloww-gloww.mjs +3104 -0
  55. package/fesm2015/gloww-gloww.mjs.map +1 -0
  56. package/fesm2020/gloww-gloww.mjs +3065 -0
  57. package/fesm2020/gloww-gloww.mjs.map +1 -0
  58. package/gloww-assets/.gitkeep +0 -0
  59. package/gloww-assets/7SS_logo.svg +1 -0
  60. package/gloww-assets/7SS_wobl.svg +1 -0
  61. package/gloww-assets/7stars.png +0 -0
  62. package/gloww-assets/gloww.svg +316 -0
  63. package/gloww-assets/images/google_signin_buttons/Google_signin_button.sketch +0 -0
  64. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_dark_disabled_hdpi.9.png +0 -0
  65. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_dark_focus_hdpi.9.png +0 -0
  66. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_dark_normal_hdpi.9.png +0 -0
  67. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_dark_pressed_hdpi.9.png +0 -0
  68. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_light_disabled_hdpi.9.png +0 -0
  69. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_light_focus_hdpi.9.png +0 -0
  70. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_light_normal_hdpi.9.png +0 -0
  71. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_light_pressed_hdpi.9.png +0 -0
  72. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_dark_disabled_hdpi.9.png +0 -0
  73. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_dark_focus_hdpi.9.png +0 -0
  74. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_dark_normal_hdpi.9.png +0 -0
  75. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_dark_pressed_hdpi.9.png +0 -0
  76. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_light_disabled_hdpi.9.png +0 -0
  77. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_light_focus_hdpi.9.png +0 -0
  78. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_light_normal_hdpi.9.png +0 -0
  79. package/gloww-assets/images/google_signin_buttons/android/hdpi/btn_google_signin_light_pressed_hdpi.9.png +0 -0
  80. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_dark_disabled_ldpi.9.png +0 -0
  81. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_dark_focus_ldpi.9.png +0 -0
  82. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_dark_normal_ldpi.9.png +0 -0
  83. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_dark_pressed_ldpi.9.png +0 -0
  84. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_light_disabled_ldpi.9.png +0 -0
  85. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_light_focus_ldpi.9.png +0 -0
  86. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_light_normal_ldpi.9.png +0 -0
  87. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_light_pressed_ldpi.9.png +0 -0
  88. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_dark_disabled_ldpi.9.png +0 -0
  89. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_dark_focus_ldpi.9.png +0 -0
  90. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_dark_normal_ldpi.9.png +0 -0
  91. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_dark_pressed_ldpi.9.png +0 -0
  92. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_light_disabled_ldpi.9.png +0 -0
  93. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_light_focus_ldpi.9.png +0 -0
  94. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_light_normal_ldpi.9.png +0 -0
  95. package/gloww-assets/images/google_signin_buttons/android/ldpi/btn_google_signin_light_pressed_ldpi.9.png +0 -0
  96. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_dark_disabled_mdpi.9.png +0 -0
  97. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_dark_focus_mdpi.9.png +0 -0
  98. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_dark_normal_mdpi.9.png +0 -0
  99. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_dark_pressed_mdpi.9.png +0 -0
  100. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_light_disabled_mdpi.9.png +0 -0
  101. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_light_focus_mdpi.9.png +0 -0
  102. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_light_normal_mdpi.9.png +0 -0
  103. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_light_pressed_mdpi.9.png +0 -0
  104. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_dark_disabled_mdpi.9.png +0 -0
  105. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_dark_focus_mdpi.9.png +0 -0
  106. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_dark_normal_mdpi.9.png +0 -0
  107. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_dark_pressed_mdpi.9.png +0 -0
  108. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_light_disabled_mdpi.9.png +0 -0
  109. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_light_focus_mdpi.9.png +0 -0
  110. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_light_normal_mdpi.9.png +0 -0
  111. package/gloww-assets/images/google_signin_buttons/android/mdpi/btn_google_signin_light_pressed_mdpi.9.png +0 -0
  112. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_dark_disabled_tvdpi.9.png +0 -0
  113. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_dark_focus_tvdpi.9.png +0 -0
  114. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_dark_normal_tvdpi.9.png +0 -0
  115. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_dark_pressed_tvdpi.9.png +0 -0
  116. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_light_disabled_tvdpi.9.png +0 -0
  117. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_light_focus_tvdpi.9.png +0 -0
  118. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_light_normal_tvdpi.9.png +0 -0
  119. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_light_pressed_tvdpi.9.png +0 -0
  120. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_dark_disabled_tvdpi.9.png +0 -0
  121. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_dark_focus_tvdpi.9.png +0 -0
  122. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_dark_normal_tvdpi.9.png +0 -0
  123. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_dark_pressed_tvdpi.9.png +0 -0
  124. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_light_disabled_tvdpi.9.png +0 -0
  125. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_light_focus_tvdpi.9.png +0 -0
  126. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_light_normal_tvdpi.9.png +0 -0
  127. package/gloww-assets/images/google_signin_buttons/android/tvdpi/btn_google_signin_light_pressed_tvdpi.9.png +0 -0
  128. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_dark_disabled_xhdpi.9.png +0 -0
  129. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_dark_focus_xhdpi.9.png +0 -0
  130. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_dark_normal_xhdpi.9.png +0 -0
  131. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_dark_pressed_xhdpi.9.png +0 -0
  132. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_light_disabled_xhdpi.9.png +0 -0
  133. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_light_focus_xhdpi.9.png +0 -0
  134. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_light_normal_xhdpi.9.png +0 -0
  135. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_light_pressed_xhdpi.9.png +0 -0
  136. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_dark_disabled_xhdpi.9.png +0 -0
  137. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_dark_focus_xhdpi.9.png +0 -0
  138. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_dark_normal_xhdpi.9.png +0 -0
  139. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_dark_pressed_xhdpi.9.png +0 -0
  140. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_light_disabled_xhdpi.9.png +0 -0
  141. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_light_focus_xhdpi.9.png +0 -0
  142. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_light_normal_xhdpi.9.png +0 -0
  143. package/gloww-assets/images/google_signin_buttons/android/xhdpi/btn_google_signin_light_pressed_xhdpi.9.png +0 -0
  144. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_dark_disabled_xxhdpi.9.png +0 -0
  145. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_dark_focus_xxhdpi.9.png +0 -0
  146. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_dark_normal_xxhdpi.9.png +0 -0
  147. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_dark_pressed_xxhdpi.9.png +0 -0
  148. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_light_disabled_xxhdpi.9.png +0 -0
  149. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_light_focus_xxhdpi.9.png +0 -0
  150. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_light_normal_xxhdpi.9.png +0 -0
  151. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_light_pressed_xxhdpi.9.png +0 -0
  152. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_dark_disabled_xxhdpi.9.png +0 -0
  153. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_dark_focus_xxhdpi.9.png +0 -0
  154. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_dark_normal_xxhdpi.9.png +0 -0
  155. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_dark_pressed_xxhdpi.9.png +0 -0
  156. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_light_disabled_xxhdpi.9.png +0 -0
  157. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_light_focus_xxhdpi.9.png +0 -0
  158. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_light_normal_xxhdpi.9.png +0 -0
  159. package/gloww-assets/images/google_signin_buttons/android/xxhdpi/btn_google_signin_light_pressed_xxhdpi.9.png +0 -0
  160. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_dark_disabled_xxxhdpi.9.png +0 -0
  161. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_dark_focus_xxxhdpi.9.png +0 -0
  162. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_dark_normal_xxxhdpi.9.png +0 -0
  163. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_dark_pressed_xxxhdpi.9.png +0 -0
  164. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_light_disabled_xxxhdpi.9.png +0 -0
  165. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_light_focus_xxxhdpi.9.png +0 -0
  166. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_light_normal_xxxhdpi.9.png +0 -0
  167. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_light_pressed_xxxhdpi.9.png +0 -0
  168. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_dark_disabled_xxxhdpi.9.png +0 -0
  169. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_dark_focus_xxxhdpi.9.png +0 -0
  170. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_dark_normal_xxxhdpi.9.png +0 -0
  171. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_dark_pressed_xxxhdpi.9.png +0 -0
  172. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_light_disabled_xxxhdpi.9.png +0 -0
  173. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_light_focus_xxxhdpi.9.png +0 -0
  174. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_light_normal_xxxhdpi.9.png +0 -0
  175. package/gloww-assets/images/google_signin_buttons/android/xxxhdpi/btn_google_signin_light_pressed_xxxhdpi.9.png +0 -0
  176. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_dark_disabled_ios.png +0 -0
  177. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_dark_focus_ios.png +0 -0
  178. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_dark_normal_ios.png +0 -0
  179. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_dark_pressed_ios.png +0 -0
  180. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_light_disabled_ios.png +0 -0
  181. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_light_focus_ios.png +0 -0
  182. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_light_normal_ios.png +0 -0
  183. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_light_pressed_ios.png +0 -0
  184. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_dark_disabled_ios.png +0 -0
  185. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_dark_focus_ios.png +0 -0
  186. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_dark_normal_ios.png +0 -0
  187. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_dark_pressed_ios.png +0 -0
  188. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_light_disabled_ios.png +0 -0
  189. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_light_focus_ios.png +0 -0
  190. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_light_normal_ios.png +0 -0
  191. package/gloww-assets/images/google_signin_buttons/ios/1x/btn_google_signin_light_pressed_ios.png +0 -0
  192. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_dark_disabled_ios@2x.png +0 -0
  193. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_dark_focus_ios@2x.png +0 -0
  194. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_dark_normal_ios@2x.png +0 -0
  195. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_dark_pressed_ios@2x.png +0 -0
  196. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_light_disabled_ios@2x.png +0 -0
  197. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_light_focus_ios@2x.png +0 -0
  198. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_light_normal_ios@2x.png +0 -0
  199. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_light_pressed_ios@2x.png +0 -0
  200. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_dark_disabled_ios@2x.png +0 -0
  201. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_dark_focus_ios@2x.png +0 -0
  202. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_dark_normal_ios@2x.png +0 -0
  203. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_dark_pressed_ios@2x.png +0 -0
  204. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_light_disabled_ios@2x.png +0 -0
  205. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_light_focus_ios@2x.png +0 -0
  206. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_light_normal_ios@2x.png +0 -0
  207. package/gloww-assets/images/google_signin_buttons/ios/2x/btn_google_signin_light_pressed_ios@2x.png +0 -0
  208. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_dark_disabled_ios@3x.png +0 -0
  209. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_dark_focus_ios@3x.png +0 -0
  210. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_dark_normal_ios@3x.png +0 -0
  211. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_dark_pressed_ios@3x.png +0 -0
  212. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_light_disabled_ios@3x.png +0 -0
  213. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_light_focus_ios@3x.png +0 -0
  214. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_light_normal_ios@3x.png +0 -0
  215. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_light_pressed_ios@3x.png +0 -0
  216. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_dark_disabled_ios@3x.png +0 -0
  217. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_dark_focus_ios@3x.png +0 -0
  218. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_dark_normal_ios@3x.png +0 -0
  219. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_dark_pressed_ios@3x.png +0 -0
  220. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_light_disabled_ios@3x.png +0 -0
  221. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_light_focus_ios@3x.png +0 -0
  222. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_light_normal_ios@3x.png +0 -0
  223. package/gloww-assets/images/google_signin_buttons/ios/3x/btn_google_signin_light_pressed_ios@3x.png +0 -0
  224. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_dark_disabled_web.png +0 -0
  225. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_dark_focus_web.png +0 -0
  226. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_dark_normal_web.png +0 -0
  227. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_dark_pressed_web.png +0 -0
  228. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_light_disabled_web.png +0 -0
  229. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_light_focus_web.png +0 -0
  230. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_light_normal_web.png +0 -0
  231. package/gloww-assets/images/google_signin_buttons/web/1x/btn_google_signin_light_pressed_web.png +0 -0
  232. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_dark_disabled_web@2x.png +0 -0
  233. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_dark_focus_web@2x.png +0 -0
  234. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_dark_normal_web@2x.png +0 -0
  235. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_dark_pressed_web@2x.png +0 -0
  236. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_light_disabled_web@2x.png +0 -0
  237. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_light_focus_web@2x.png +0 -0
  238. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_light_normal_web@2x.png +0 -0
  239. package/gloww-assets/images/google_signin_buttons/web/2x/btn_google_signin_light_pressed_web@2x.png +0 -0
  240. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_disabled_ios.eps +814 -0
  241. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_disabled_ios.svg +24 -0
  242. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_focus_ios.eps +1866 -0
  243. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_focus_ios.svg +51 -0
  244. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_normal_ios.eps +1031 -0
  245. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_normal_ios.svg +50 -0
  246. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_pressed_ios.eps +1031 -0
  247. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_dark_pressed_ios.svg +50 -0
  248. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_disabled_ios.eps +814 -0
  249. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_disabled_ios.svg +24 -0
  250. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_focus_ios.eps +1837 -0
  251. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_focus_ios.svg +44 -0
  252. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_normal_ios.eps +1002 -0
  253. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_normal_ios.svg +43 -0
  254. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_pressed_ios.eps +1002 -0
  255. package/gloww-assets/images/google_signin_buttons/web/vector/btn_google_light_pressed_ios.svg +43 -0
  256. package/gloww-assets/swagger.svg +1 -0
  257. package/gloww-gloww.d.ts +5 -0
  258. package/lib/Components/code-editor/code-editor.component.d.ts +16 -0
  259. package/lib/Components/confirmation/confirmation.component.d.ts +20 -0
  260. package/lib/Components/display-objects/display-objects.component.d.ts +93 -0
  261. package/lib/Components/display-objects-configuration.d.ts +5 -0
  262. package/lib/Components/download-progress/download-progress.component.d.ts +30 -0
  263. package/lib/Components/folders/file-edit/file-edit.component.d.ts +31 -0
  264. package/lib/Components/folders/folders/folders.component.d.ts +33 -0
  265. package/lib/Components/header/header.component.d.ts +8 -0
  266. package/lib/Components/html-editor/html-editor.component.d.ts +36 -0
  267. package/lib/Components/menu-list-item/menu-list-item.component.d.ts +22 -0
  268. package/lib/Components/prompt/prompt.component.d.ts +25 -0
  269. package/lib/Components/result-table/result-table.component.d.ts +11 -0
  270. package/lib/Components/search-form/search-form.component.d.ts +8 -0
  271. package/lib/Components/secure-a/secure-a.component.d.ts +13 -0
  272. package/lib/Components/secure-img/secure-img.component.d.ts +17 -0
  273. package/lib/Components/upload-doc/upload-doc.component.d.ts +19 -0
  274. package/lib/Components/upload-file/upload-file.component.d.ts +34 -0
  275. package/lib/Directives/file-sink.directive.d.ts +11 -0
  276. package/lib/Models/nav-item.d.ts +8 -0
  277. package/lib/Pipes/html-format.pipe.d.ts +10 -0
  278. package/lib/Pipes/retry-with-delay.d.ts +2 -0
  279. package/lib/Pipes/safe-html.pipe.d.ts +10 -0
  280. package/lib/Pipes/secure.pipe.d.ts +13 -0
  281. package/lib/Services/dialog.service.d.ts +11 -0
  282. package/lib/Services/folder-service-config.d.ts +7 -0
  283. package/lib/Services/folder.service.d.ts +19 -0
  284. package/lib/Services/gloww.service.d.ts +23 -0
  285. package/lib/Services/nav.service.d.ts +13 -0
  286. package/lib/Services/version-check.service.d.ts +30 -0
  287. package/lib/Services/voice-recognition.service.d.ts +14 -0
  288. package/lib/gloww-security/Components/change-password-dlg/change-password-dlg.component.d.ts +19 -0
  289. package/lib/gloww-security/Components/login/login.component.d.ts +43 -0
  290. package/lib/gloww-security/Components/social-network/social-network.component.d.ts +25 -0
  291. package/lib/gloww-security/Components/social-network-dlg/social-network-dlg.component.d.ts +21 -0
  292. package/lib/gloww-security/Components/user-menu/user-menu.component.d.ts +24 -0
  293. package/lib/gloww-security/Helpers/administrator.guard.d.ts +14 -0
  294. package/lib/gloww-security/Helpers/auth.guard.d.ts +14 -0
  295. package/lib/gloww-security/Helpers/error.interceptor.d.ts +11 -0
  296. package/lib/gloww-security/Helpers/index.d.ts +4 -0
  297. package/lib/gloww-security/Helpers/jwt.interceptor.d.ts +11 -0
  298. package/lib/gloww-security/Helpers/staging.interceptor.d.ts +9 -0
  299. package/lib/gloww-security/Models/oauthassociation.d.ts +7 -0
  300. package/lib/gloww-security/Models/user.d.ts +9 -0
  301. package/lib/gloww-security/Services/authentication-service-config.d.ts +17 -0
  302. package/lib/gloww-security/Services/authentication.service.d.ts +40 -0
  303. package/lib/gloww-security/Services/gloww-security.service.d.ts +6 -0
  304. package/lib/gloww-security/gloww-security.module.d.ts +35 -0
  305. package/lib/gloww.module.d.ts +59 -0
  306. package/lib/injection-token.d.ts +2 -0
  307. package/package.json +40 -0
  308. package/public-api.d.ts +28 -0
@@ -0,0 +1,3104 @@
1
+ import * as i0 from '@angular/core';
2
+ import { InjectionToken, Injectable, Pipe, Component, Inject, Input, EventEmitter, Directive, HostBinding, Output, HostListener, ViewChild, ContentChildren, PLATFORM_ID, Optional, ContentChild, NgModule, SecurityContext } from '@angular/core';
3
+ import { Subject, BehaviorSubject, of, combineLatest, forkJoin, throwError } from 'rxjs';
4
+ import * as i1 from '@angular/common/http';
5
+ import { HttpClient, HttpParams, HttpEventType, HTTP_INTERCEPTORS, HttpClientModule, HttpResponse } from '@angular/common/http';
6
+ import * as i3 from '@angular/common';
7
+ import { Location, PlatformLocation, isPlatformBrowser, CommonModule } from '@angular/common';
8
+ import * as i1$2 from '@angular/material/dialog';
9
+ import { MAT_DIALOG_DATA, MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
10
+ import * as i5 from '@angular/material/button';
11
+ import { MatButtonModule } from '@angular/material/button';
12
+ import * as i1$1 from '@angular/platform-browser';
13
+ import { BrowserModule } from '@angular/platform-browser';
14
+ import * as i2 from '@angular/router';
15
+ import { NavigationEnd, RouterModule } from '@angular/router';
16
+ import * as i5$3 from '@gloww/angular-editor';
17
+ import { AngularEditorModule } from '@gloww/angular-editor';
18
+ import { switchMap, map, tap, filter, catchError, take, mergeMap, retryWhen, scan, delay, first } from 'rxjs/operators';
19
+ import * as i15 from '@angular/material/sort';
20
+ import { MatSort, MatSortModule } from '@angular/material/sort';
21
+ import * as i13 from '@angular/material/paginator';
22
+ import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
23
+ import * as i12 from '@angular/material/table';
24
+ import { MatColumnDef, MatTableDataSource, MatTable, MatTableModule } from '@angular/material/table';
25
+ import * as i14 from '@angular/material/progress-spinner';
26
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
27
+ import * as i5$1 from '@angular/material/card';
28
+ import { MatCardModule } from '@angular/material/card';
29
+ import * as i11 from '@angular/material/icon';
30
+ import { MatIconModule } from '@angular/material/icon';
31
+ import * as i5$2 from '@angular/material/input';
32
+ import { MatInputModule } from '@angular/material/input';
33
+ import * as i1$4 from '@ctrl/ngx-codemirror';
34
+ import { CodemirrorModule } from '@ctrl/ngx-codemirror';
35
+ import * as i1$3 from '@angular/forms';
36
+ import { NG_VALUE_ACCESSOR, FormControl, Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
37
+ import * as i2$1 from '@angular/material/progress-bar';
38
+ import { MatProgressBarModule } from '@angular/material/progress-bar';
39
+ import * as i7 from '@angular/material/form-field';
40
+ import { MatFormFieldModule } from '@angular/material/form-field';
41
+ import * as i8 from '@angular/material/select';
42
+ import { MatSelectModule } from '@angular/material/select';
43
+ import * as i9 from '@angular/material/core';
44
+ import { trigger, state, style, transition, animate } from '@angular/animations';
45
+ import * as i9$1 from '@angular/flex-layout/flex';
46
+ import * as i4 from '@angular/flex-layout/extended';
47
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
48
+ import { FlexLayoutModule } from '@angular/flex-layout';
49
+ import { MatToolbarModule } from '@angular/material/toolbar';
50
+ import { MatSidenavModule } from '@angular/material/sidenav';
51
+ import jwt_decode from 'jwt-decode';
52
+ import { __awaiter } from 'tslib';
53
+ import * as FileSaver from 'file-saver';
54
+ import * as JSZip from 'jszip';
55
+
56
+ const API_SERVER_URL = new InjectionToken('ApiServerUrl.config');
57
+ const GLOWW_APPLI = new InjectionToken('GlowwAppli.config');
58
+ // @Injectable({
59
+ // providedIn: 'root'
60
+ // })
61
+ class GlowwService {
62
+ constructor(_injector) {
63
+ var _a;
64
+ this._injector = _injector;
65
+ this.InternalBasePath = '???';
66
+ this.basePathChange = new Subject();
67
+ this.baseUrl = '/';
68
+ this.location = _injector.get(Location);
69
+ this.http = _injector.get(HttpClient);
70
+ this.platformLocation = _injector.get(PlatformLocation);
71
+ try {
72
+ this.ApiServerUrl = _injector.get(API_SERVER_URL);
73
+ }
74
+ catch (_b) { }
75
+ try {
76
+ this.BasePath = _injector.get(GLOWW_APPLI);
77
+ }
78
+ catch (_c) { }
79
+ this.BasePath = (_a = this.BasePath) !== null && _a !== void 0 ? _a : 'GlowwApi';
80
+ //@Optional() @Inject(API_SERVER_URL) apiServerUrl: string, @Optional() @Inject(GLOWW_APPLI) glowwAppli: string
81
+ this.baseHref = this.platformLocation.getBaseHrefFromDOM();
82
+ this.InternalBasePath = this.BasePath;
83
+ if (this.ApiServerUrl) {
84
+ this.baseUrl = this.ApiServerUrl;
85
+ if (!this.baseUrl.endsWith('/')) {
86
+ this.baseUrl += '/';
87
+ }
88
+ }
89
+ }
90
+ get basePath() {
91
+ return this.InternalBasePath;
92
+ }
93
+ set basePath(value) {
94
+ //alert(`setBasePath ${value}`)
95
+ var oldUrl = this.location.path();
96
+ var newUrl = oldUrl.replace(`/${this.InternalBasePath}/`, `/${value}/`);
97
+ //alert(`GlowwService setBasePath (${this.InternalBasePath},${value}) ${oldUrl} -> ${newUrl}`);
98
+ if (oldUrl !== newUrl) {
99
+ this.location.go(newUrl);
100
+ this.basePathChange.next(newUrl);
101
+ }
102
+ this.InternalBasePath = value;
103
+ }
104
+ getParams(obj) {
105
+ let params = new HttpParams();
106
+ if (!obj) {
107
+ return params;
108
+ }
109
+ Object.keys(obj).forEach(p => {
110
+ if (obj[p]) {
111
+ params = params.append(p.toString(), obj[p].toString());
112
+ }
113
+ });
114
+ return params;
115
+ }
116
+ }
117
+
118
+ class VersionCheckService {
119
+ constructor(http) {
120
+ this.http = http;
121
+ // this will be replaced by actual hash post-build.js
122
+ this.currentHash = '{{POST_BUILD_ENTERS_HASH_HERE}}';
123
+ }
124
+ /**
125
+ * Checks in every set frequency the version of frontend application
126
+ * @param url the url to test (default : /version.json)
127
+ * @param frequency - in milliseconds, defaults to 1 minutes
128
+ * @param callback - function to call when the version is different, default askReloadApplication
129
+ */
130
+ initVersionCheck(url = '/version.json', frequency = 1000 * 60, callback = this.askReloadApplication) {
131
+ this.callback = callback;
132
+ this.url = url;
133
+ this.checkVersion();
134
+ setInterval(() => {
135
+ this.checkVersion();
136
+ }, frequency);
137
+ }
138
+ askReloadApplication() {
139
+ console.log('askReload');
140
+ // ENTER YOUR CODE TO DO SOMETHING UPON VERSION CHANGE
141
+ if (confirm('Une nouvelle version est disponible sur le serveur. Il est nécessaire de recharger l\'application. Veuillez confirmer le rechargement de l\'application')) {
142
+ this.reloadApplication();
143
+ }
144
+ }
145
+ reloadApplication() {
146
+ console.log('reload');
147
+ let search = location.search;
148
+ if (search) {
149
+ search += '&';
150
+ }
151
+ search += '___t=' + new Date().getTime();
152
+ console.log(`Search ${search}`);
153
+ location.search = search;
154
+ }
155
+ checkVersion() {
156
+ // timestamp these requests to invalidate caches
157
+ this.http.get(this.url + '?t=' + new Date().getTime())
158
+ // .first()
159
+ .subscribe((response) => {
160
+ console.log('get version ok');
161
+ const hash = response.hash;
162
+ const hashChanged = this.hasHashChanged(this.currentHash, hash);
163
+ console.log(`HASH : Current : ${this.currentHash}, New : ${hash}, Changed ${hashChanged}`);
164
+ // If new version, do something
165
+ if (hashChanged) {
166
+ this.callback();
167
+ }
168
+ // store the new hash so we wouldn't trigger versionChange again
169
+ // only necessary in case you did not force refresh
170
+ this.currentHash = hash;
171
+ }, (err) => {
172
+ console.error(err, 'Could not get version');
173
+ });
174
+ }
175
+ /**
176
+ * Checks if hash has changed.
177
+ * This file has the JS hash, if it is a different one than in the version.json
178
+ * we are dealing with version change
179
+ * @param currentHash currenthash
180
+ * @param newHash newhash
181
+ * @returns the currenthash and newhash are different
182
+ */
183
+ hasHashChanged(currentHash, newHash) {
184
+ return currentHash !== newHash;
185
+ }
186
+ }
187
+ VersionCheckService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VersionCheckService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
188
+ VersionCheckService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VersionCheckService, providedIn: 'root' });
189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VersionCheckService, decorators: [{
190
+ type: Injectable,
191
+ args: [{
192
+ providedIn: 'root'
193
+ }]
194
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }]; } });
195
+
196
+ class SafeHtmlPipe {
197
+ constructor(sanitizer) {
198
+ this.sanitizer = sanitizer;
199
+ }
200
+ transform(style) {
201
+ return this.sanitizer.bypassSecurityTrustHtml(style);
202
+ // return this.sanitizer.bypassSecurityTrustStyle(style);
203
+ // return this.sanitizer.bypassSecurityTrustXxx(style); - see docs
204
+ }
205
+ }
206
+ SafeHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SafeHtmlPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
207
+ SafeHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SafeHtmlPipe, name: "safeHtml" });
208
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SafeHtmlPipe, decorators: [{
209
+ type: Pipe,
210
+ args: [{
211
+ name: 'safeHtml'
212
+ }]
213
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
214
+
215
+ class ConfirmationComponent {
216
+ constructor(dialogRef, data) {
217
+ var _a;
218
+ this.dialogRef = dialogRef;
219
+ this.data = data;
220
+ // Update view with given values
221
+ this.title = data.title;
222
+ this.message = data.message;
223
+ this.mode = (_a = data.mode) !== null && _a !== void 0 ? _a : 'confirmation';
224
+ }
225
+ onConfirm() {
226
+ // Close the dialog, return true
227
+ this.dialogRef.close(true);
228
+ }
229
+ onDismiss() {
230
+ // Close the dialog, return false
231
+ this.dialogRef.close(false);
232
+ }
233
+ }
234
+ ConfirmationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ConfirmationComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
235
+ ConfirmationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: ConfirmationComponent, selector: "glw-confirmation", ngImport: i0, template: "<h1 mat-dialog-title>\r\n {{title}}\r\n</h1>\r\n\r\n<div mat-dialog-content>\r\n <p [innerHTML]=\"message | safeHtml\"></p>\r\n</div>\r\n\r\n<mat-dialog-actions *ngIf=\"mode==='confirmation'\">\r\n <button mat-button (click)=\"onDismiss()\">No</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"onConfirm()\">Yes</button>\r\n</mat-dialog-actions>\r\n<mat-dialog-actions *ngIf=\"mode==='alert'\">\r\n <button mat-raised-button color=\"primary\" (click)=\"onConfirm()\">OK</button>\r\n</mat-dialog-actions>\r\n", styles: [""], components: [{ type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], pipes: { "safeHtml": SafeHtmlPipe } });
236
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ConfirmationComponent, decorators: [{
237
+ type: Component,
238
+ args: [{ selector: 'glw-confirmation', template: "<h1 mat-dialog-title>\r\n {{title}}\r\n</h1>\r\n\r\n<div mat-dialog-content>\r\n <p [innerHTML]=\"message | safeHtml\"></p>\r\n</div>\r\n\r\n<mat-dialog-actions *ngIf=\"mode==='confirmation'\">\r\n <button mat-button (click)=\"onDismiss()\">No</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"onConfirm()\">Yes</button>\r\n</mat-dialog-actions>\r\n<mat-dialog-actions *ngIf=\"mode==='alert'\">\r\n <button mat-raised-button color=\"primary\" (click)=\"onConfirm()\">OK</button>\r\n</mat-dialog-actions>\r\n", styles: [""] }]
239
+ }], ctorParameters: function () {
240
+ return [{ type: i1$2.MatDialogRef }, { type: ConfirmationModel, decorators: [{
241
+ type: Inject,
242
+ args: [MAT_DIALOG_DATA]
243
+ }] }];
244
+ } });
245
+ // tslint:disable-next-line: max-classes-per-file
246
+ class ConfirmationModel {
247
+ constructor(title, message, mode) {
248
+ this.title = title;
249
+ this.message = message;
250
+ this.mode = mode;
251
+ }
252
+ }
253
+
254
+ class DialogService {
255
+ constructor(dialog) {
256
+ this.dialog = dialog;
257
+ }
258
+ createConfirmationDialog(title, message, mode) {
259
+ const dialogData = new ConfirmationModel(title, message, mode);
260
+ return this.dialog.open(ConfirmationComponent, {
261
+ maxWidth: '80%',
262
+ data: dialogData,
263
+ disableClose: true
264
+ });
265
+ }
266
+ openConfirmationDialog(title, message, mode) {
267
+ return this.createConfirmationDialog(title, message, mode).afterClosed();
268
+ }
269
+ }
270
+ DialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DialogService, deps: [{ token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable });
271
+ DialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DialogService, providedIn: 'root' });
272
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DialogService, decorators: [{
273
+ type: Injectable,
274
+ args: [{
275
+ providedIn: 'root'
276
+ }]
277
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialog }]; } });
278
+
279
+ class NavService {
280
+ constructor(router) {
281
+ this.router = router;
282
+ this.currentUrl = new BehaviorSubject(undefined);
283
+ this.router.events.subscribe((event) => {
284
+ if (event instanceof NavigationEnd) {
285
+ this.currentUrl.next(event.urlAfterRedirects);
286
+ }
287
+ });
288
+ }
289
+ closeNav() {
290
+ this.appDrawer.close();
291
+ }
292
+ openNav() {
293
+ this.appDrawer.open();
294
+ }
295
+ }
296
+ NavService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NavService, deps: [{ token: i2.Router }], target: i0.ɵɵFactoryTarget.Injectable });
297
+ NavService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NavService });
298
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NavService, decorators: [{
299
+ type: Injectable
300
+ }], ctorParameters: function () { return [{ type: i2.Router }]; } });
301
+
302
+ class VoiceRecognitionService {
303
+ constructor() {
304
+ this.recognition = new webkitSpeechRecognition();
305
+ this.isStoppedSpeechRecog = false;
306
+ this.text = '';
307
+ }
308
+ init() {
309
+ this.recognition.interimResults = true;
310
+ this.recognition.lang = 'fr-be';
311
+ this.recognition.addEventListener('result', (e) => {
312
+ const transcript = Array.from(e.results)
313
+ .map((result) => result[0])
314
+ .map((result) => result.transcript)
315
+ .join('');
316
+ this.tempWords = transcript;
317
+ console.log(transcript);
318
+ });
319
+ }
320
+ start() {
321
+ this.isStoppedSpeechRecog = false;
322
+ this.recognition.start();
323
+ console.log("Speech recognition started");
324
+ this.recognition.addEventListener('end', (condition) => {
325
+ if (this.isStoppedSpeechRecog) {
326
+ this.recognition.stop();
327
+ console.log("End speech recognition");
328
+ }
329
+ else {
330
+ this.wordConcat();
331
+ this.recognition.start();
332
+ }
333
+ });
334
+ }
335
+ stop() {
336
+ this.isStoppedSpeechRecog = true;
337
+ this.wordConcat();
338
+ this.recognition.stop();
339
+ console.log("End speech recognition");
340
+ }
341
+ wordConcat() {
342
+ this.text = this.text + ' ' + this.tempWords + '.';
343
+ this.tempWords = '';
344
+ }
345
+ }
346
+ VoiceRecognitionService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VoiceRecognitionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
347
+ VoiceRecognitionService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VoiceRecognitionService, providedIn: 'root' });
348
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: VoiceRecognitionService, decorators: [{
349
+ type: Injectable,
350
+ args: [{
351
+ providedIn: 'root'
352
+ }]
353
+ }], ctorParameters: function () { return []; } });
354
+
355
+ class SecureImgComponent {
356
+ // we need HttpClient to load the image
357
+ constructor(httpClient, domSanitizer) {
358
+ this.httpClient = httpClient;
359
+ this.domSanitizer = domSanitizer;
360
+ this.src$ = new BehaviorSubject(this.src);
361
+ // this stream will contain the actual url that our img tag will load
362
+ // everytime the src changes, the previous call would be canceled and the
363
+ // new resource would be loaded
364
+ this.dataUrl$ = this.src$.pipe(switchMap(url => this.loadImage(url)));
365
+ }
366
+ ngOnChanges() {
367
+ this.src$.next(this.src);
368
+ }
369
+ loadImage(url) {
370
+ return this.httpClient
371
+ // load the image as a blob
372
+ .get(url, { responseType: 'blob' })
373
+ // create an object url of that blob that we can use in the src attribute
374
+ .pipe(map(e => this.domSanitizer.bypassSecurityTrustUrl(URL.createObjectURL(e))));
375
+ }
376
+ }
377
+ SecureImgComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecureImgComponent, deps: [{ token: i1.HttpClient }, { token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
378
+ SecureImgComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SecureImgComponent, selector: "secure-img", inputs: { src: "src" }, usesOnChanges: true, ngImport: i0, template: `
379
+ <img [src]="dataUrl$ | async" style="object-fit: contain;"/>
380
+ `, isInline: true, pipes: { "async": i3.AsyncPipe } });
381
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecureImgComponent, decorators: [{
382
+ type: Component,
383
+ args: [{
384
+ selector: 'secure-img',
385
+ template: `
386
+ <img [src]="dataUrl$ | async" style="object-fit: contain;"/>
387
+ `
388
+ }]
389
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i1$1.DomSanitizer }]; }, propDecorators: { src: [{
390
+ type: Input
391
+ }] } });
392
+
393
+ class FileSinkDirective {
394
+ constructor() {
395
+ this.fileDropped = new EventEmitter();
396
+ }
397
+ // Dragover listener
398
+ onDragOver(evt) {
399
+ evt.preventDefault();
400
+ evt.stopPropagation();
401
+ this.fileOver = true;
402
+ }
403
+ // Dragleave listener
404
+ onDragLeave(evt) {
405
+ evt.preventDefault();
406
+ evt.stopPropagation();
407
+ this.fileOver = false;
408
+ }
409
+ // Drop listener
410
+ ondrop(evt) {
411
+ evt.preventDefault();
412
+ evt.stopPropagation();
413
+ this.fileOver = false;
414
+ let files = evt.dataTransfer.files;
415
+ if (files.length > 0) {
416
+ this.fileDropped.emit(files);
417
+ }
418
+ }
419
+ }
420
+ FileSinkDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileSinkDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
421
+ FileSinkDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.3", type: FileSinkDirective, selector: "[glowwFileSink]", outputs: { fileDropped: "fileDropped" }, host: { listeners: { "dragover": "onDragOver($event)", "dragleave": "onDragLeave($event)", "drop": "ondrop($event)" }, properties: { "class.fileover": "this.fileOver" } }, ngImport: i0 });
422
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileSinkDirective, decorators: [{
423
+ type: Directive,
424
+ args: [{
425
+ selector: '[glowwFileSink]'
426
+ }]
427
+ }], propDecorators: { fileOver: [{
428
+ type: HostBinding,
429
+ args: ['class.fileover']
430
+ }], fileDropped: [{
431
+ type: Output
432
+ }], onDragOver: [{
433
+ type: HostListener,
434
+ args: ['dragover', ['$event']]
435
+ }], onDragLeave: [{
436
+ type: HostListener,
437
+ args: ['dragleave', ['$event']]
438
+ }], ondrop: [{
439
+ type: HostListener,
440
+ args: ['drop', ['$event']]
441
+ }] } });
442
+
443
+ class UploadFileComponent {
444
+ constructor() {
445
+ this.multiple = false;
446
+ this.allowAltFileName = false;
447
+ this.acceptMime = '*/*';
448
+ this.onChange = () => { };
449
+ this.onTouched = () => { };
450
+ this.files = [];
451
+ }
452
+ ngAfterViewInit() {
453
+ const fileUpload = this.fileUpload.nativeElement;
454
+ fileUpload.onchange = () => {
455
+ if (!this.multiple) {
456
+ this.files = [];
457
+ //if (this.allowAltFileName) { this.fileNames.clear(); }
458
+ }
459
+ for (const file of fileUpload.files) {
460
+ this.files.push({ data: file, inProgress: false, progress: 0, fileName: file.name, size: file.size, altFileName: '', status: '' });
461
+ //if (this.allowAltFileName) { this.fileNames.push(this.FileName(file.name)); }
462
+ }
463
+ this.onChange(this.files);
464
+ this.onTouched();
465
+ };
466
+ }
467
+ get value() {
468
+ return this.files;
469
+ //return this._value;
470
+ }
471
+ set value(val) {
472
+ this.files = val;
473
+ this.onChange(val);
474
+ this.onTouched();
475
+ }
476
+ writeValue(obj) {
477
+ this.value = obj;
478
+ }
479
+ registerOnChange(fn) {
480
+ this.onChange = fn;
481
+ }
482
+ registerOnTouched(fn) {
483
+ this.onTouched = fn;
484
+ }
485
+ setDisabledState(isDisabled) {
486
+ //throw new Error('Method not implemented.');
487
+ }
488
+ SelectFiles() {
489
+ this.fileUpload.nativeElement.click();
490
+ }
491
+ ChangeAltName(i, $event) {
492
+ this.files[i].altFileName = $event.target.value;
493
+ this.onChange(this.files);
494
+ this.onTouched();
495
+ }
496
+ onFileDropped($event) {
497
+ this.prepareFilesList($event);
498
+ }
499
+ prepareFilesList(files) {
500
+ if (files.length > 1 && !this.multiple) {
501
+ alert("You can only drop an only file at once");
502
+ return;
503
+ }
504
+ if (this.files && this.files.length > 0 && !this.multiple) {
505
+ if (confirm("Do you want to replace current file ?")) {
506
+ this.files = [];
507
+ }
508
+ else {
509
+ return;
510
+ }
511
+ }
512
+ if (!this.files)
513
+ this.files = [];
514
+ for (const file of files) {
515
+ this.files.push({ data: file, inProgress: false, progress: 0, fileName: file.name, size: file.size, altFileName: '', status: '' });
516
+ }
517
+ this.onChange(this.files);
518
+ this.onTouched();
519
+ }
520
+ /**
521
+ * format bytes
522
+ * @param bytes (File size in bytes)
523
+ * @param decimals (Decimals point)
524
+ */
525
+ formatBytes(bytes, decimals = 2) {
526
+ if (bytes === 0) {
527
+ return "0 Bytes";
528
+ }
529
+ const k = 1024;
530
+ const dm = decimals <= 0 ? 0 : decimals;
531
+ const sizes = ["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
532
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
533
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];
534
+ }
535
+ deleteFile(index) {
536
+ if (this.files[index].progress && this.files[index].progress < 100) {
537
+ console.log("Upload in progress.");
538
+ return;
539
+ }
540
+ this.files.splice(index, 1);
541
+ this.onChange(this.files);
542
+ this.onTouched();
543
+ }
544
+ }
545
+ UploadFileComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UploadFileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
546
+ UploadFileComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: UploadFileComponent, selector: "gloww-upload-file", inputs: { multiple: "multiple", allowAltFileName: "allowAltFileName", acceptMime: "acceptMime" }, providers: [
547
+ {
548
+ provide: NG_VALUE_ACCESSOR,
549
+ multi: true,
550
+ useExisting: UploadFileComponent
551
+ }
552
+ ], viewQueries: [{ propertyName: "fileUpload", first: true, predicate: ["fileUpload"], descendants: true }], ngImport: i0, template: "<mat-card glowwFileSink (fileDropped)=\"onFileDropped($event)\" style=\"height:calc(100% - 40px)\">\r\n <mat-card-content style=\"min-height:100px;height:calc(100% - 60px)\">\r\n <div class=\"files-list\" *ngIf=\"files && files.length\" style=\"height:calc(100% - 60px)\">\r\n <div class=\"single-file\" *ngFor=\"let file of files; let i = index\" [ngClass]=\"file.status\">\r\n <i class=\"fa-thin fa-file fa-lg\"></i>\r\n <div class=\"info\">\r\n <h4 class=\"name\">\r\n {{ file?.fileName }}\r\n </h4>\r\n <p class=\"size\">\r\n {{ formatBytes(file?.size) }}\r\n </p>\r\n <mat-progress-bar [value]=\"file.progress\"></mat-progress-bar>\r\n </div>\r\n <i class=\"fa-thin fa-trash fa-lg\" (click)=\"deleteFile(i)\"></i>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!files || !files.length\" style=\"height:calc(100% - 60px)\">No file(s) selected</div>\r\n <input type=\"file\" #fileUpload id=\"fileUpload\" name=\"fileUpload\" [accept]=\"acceptMime\" style=\"display:none;\" [multiple]=\"multiple\" />\r\n </mat-card-content>\r\n <mat-card-actions style=\"text-align:center\">\r\n <button mat-raised-button color=\"accent\" (click)=\"SelectFiles()\">\r\n <i class=\"fal fa-file-upload\"></i> <span *ngIf=\"!multiple\">Select file or Drop a file</span>\r\n <span *ngIf=\"multiple\">Select file(s) or drop file(s)</span>\r\n </button>\r\n </mat-card-actions>\r\n</mat-card>", styles: ["ul{list-style:none;padding-left:0}ul li{padding-bottom:10px}.fileover{-webkit-animation:shake 1s;animation:shake 1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.files-list{margin-top:1.5rem}.files-list .single-file{padding:.5rem;justify-content:space-between;align-items:center;border:dashed 1px #979797;margin-bottom:1rem;display:flex;flex-grow:1}.files-list .single-file img.delete{margin-left:.5rem;cursor:pointer;align-self:flex-end}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0;margin-bottom:.25rem}.files-list .single-file .info{width:100%}.Done{background-color:green}.Error{background-color:red}@-webkit-keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}\n"], components: [{ type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i2$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: FileSinkDirective, selector: "[glowwFileSink]", outputs: ["fileDropped"] }, { type: i5$1.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i5$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }] });
553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UploadFileComponent, decorators: [{
554
+ type: Component,
555
+ args: [{ selector: 'gloww-upload-file', providers: [
556
+ {
557
+ provide: NG_VALUE_ACCESSOR,
558
+ multi: true,
559
+ useExisting: UploadFileComponent
560
+ }
561
+ ], template: "<mat-card glowwFileSink (fileDropped)=\"onFileDropped($event)\" style=\"height:calc(100% - 40px)\">\r\n <mat-card-content style=\"min-height:100px;height:calc(100% - 60px)\">\r\n <div class=\"files-list\" *ngIf=\"files && files.length\" style=\"height:calc(100% - 60px)\">\r\n <div class=\"single-file\" *ngFor=\"let file of files; let i = index\" [ngClass]=\"file.status\">\r\n <i class=\"fa-thin fa-file fa-lg\"></i>\r\n <div class=\"info\">\r\n <h4 class=\"name\">\r\n {{ file?.fileName }}\r\n </h4>\r\n <p class=\"size\">\r\n {{ formatBytes(file?.size) }}\r\n </p>\r\n <mat-progress-bar [value]=\"file.progress\"></mat-progress-bar>\r\n </div>\r\n <i class=\"fa-thin fa-trash fa-lg\" (click)=\"deleteFile(i)\"></i>\r\n </div>\r\n </div>\r\n <div *ngIf=\"!files || !files.length\" style=\"height:calc(100% - 60px)\">No file(s) selected</div>\r\n <input type=\"file\" #fileUpload id=\"fileUpload\" name=\"fileUpload\" [accept]=\"acceptMime\" style=\"display:none;\" [multiple]=\"multiple\" />\r\n </mat-card-content>\r\n <mat-card-actions style=\"text-align:center\">\r\n <button mat-raised-button color=\"accent\" (click)=\"SelectFiles()\">\r\n <i class=\"fal fa-file-upload\"></i> <span *ngIf=\"!multiple\">Select file or Drop a file</span>\r\n <span *ngIf=\"multiple\">Select file(s) or drop file(s)</span>\r\n </button>\r\n </mat-card-actions>\r\n</mat-card>", styles: ["ul{list-style:none;padding-left:0}ul li{padding-bottom:10px}.fileover{-webkit-animation:shake 1s;animation:shake 1s;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.files-list{margin-top:1.5rem}.files-list .single-file{padding:.5rem;justify-content:space-between;align-items:center;border:dashed 1px #979797;margin-bottom:1rem;display:flex;flex-grow:1}.files-list .single-file img.delete{margin-left:.5rem;cursor:pointer;align-self:flex-end}.files-list .single-file .name{font-size:14px;font-weight:500;color:#353f4a;margin:0}.files-list .single-file .size{font-size:12px;font-weight:500;color:#a4a4a4;margin:0;margin-bottom:.25rem}.files-list .single-file .info{width:100%}.Done{background-color:green}.Error{background-color:red}@-webkit-keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}@keyframes shake{0%{transform:translate(1px,1px) rotate(0)}10%{transform:translate(-1px,-2px) rotate(-1deg)}20%{transform:translate(-3px) rotate(1deg)}30%{transform:translate(3px,2px) rotate(0)}40%{transform:translate(1px,-1px) rotate(1deg)}50%{transform:translate(-1px,2px) rotate(-1deg)}60%{transform:translate(-3px,1px) rotate(0)}70%{transform:translate(3px,1px) rotate(-1deg)}80%{transform:translate(-1px,-1px) rotate(1deg)}90%{transform:translate(1px,2px) rotate(0)}to{transform:translate(1px,-2px) rotate(-1deg)}}\n"] }]
562
+ }], ctorParameters: function () { return []; }, propDecorators: { fileUpload: [{
563
+ type: ViewChild,
564
+ args: ['fileUpload']
565
+ }], multiple: [{
566
+ type: Input
567
+ }], allowAltFileName: [{
568
+ type: Input
569
+ }], acceptMime: [{
570
+ type: Input
571
+ }] } });
572
+
573
+ class UploadDocComponent {
574
+ constructor(dialogRef, data, formBuilder) {
575
+ this.dialogRef = dialogRef;
576
+ this.data = data;
577
+ this.formBuilder = formBuilder;
578
+ this.multiple = false;
579
+ this.allowAltFileName = false;
580
+ this.acceptMime = '*/*';
581
+ this.files = [];
582
+ if (data && data.acceptMime) {
583
+ this.acceptMime = data.acceptMime;
584
+ }
585
+ if (data && data.multiple) {
586
+ this.multiple = data.multiple;
587
+ }
588
+ if (data && data.allowAltFileName) {
589
+ this.allowAltFileName = data.allowAltFileName;
590
+ }
591
+ if (data && data.callback) {
592
+ this.callback = data.callback;
593
+ }
594
+ }
595
+ /*
596
+ get fileNames(): FormArray {
597
+ return this.form.get("fileNames") as FormArray
598
+ }
599
+
600
+ FileName(fn: string): FormGroup {
601
+ return this.formBuilder.group({
602
+ fileName: fn
603
+ })
604
+ }
605
+
606
+ ngOnInit() {
607
+ }
608
+
609
+ onClick() {
610
+ const fileUpload = this.fileUpload.nativeElement; fileUpload.onchange = () => {
611
+ if (this.multiple) {
612
+ this.files = [];
613
+ if (this.allowAltFileName) { this.fileNames.clear(); }
614
+ }
615
+ for (const file of fileUpload.files) {
616
+ this.files.push({ data: file, inProgress: false, progress: 0, fileName: file.name });
617
+ if (this.allowAltFileName) { this.fileNames.push(this.FileName(file.name)); }
618
+ }
619
+ };
620
+ fileUpload.click();
621
+ }
622
+
623
+ private uploadFiles() {
624
+ this.fileUpload.nativeElement.value = '';
625
+ this.files.forEach(file => {
626
+ alert('upload file');
627
+ // this.uploadFile(file);
628
+ });
629
+ }
630
+ */
631
+ cancel() {
632
+ this.dialogRef.close();
633
+ }
634
+ save() {
635
+ console.log("save UploadDoc");
636
+ console.log(`this.files.length ${this.files.length}`);
637
+ /*if (this.allowAltFileName) {
638
+ for (let i = 0; i < this.files.length; i++) {
639
+ // Comment to be sure new version
640
+ this.files[i].name = this.fileNames.value[i].fileName;
641
+ }
642
+ }*/
643
+ if (this.callback) {
644
+ this.callback(this.files).subscribe(res => this.dialogRef.close(this.files));
645
+ }
646
+ else {
647
+ this.dialogRef.close(this.files);
648
+ }
649
+ }
650
+ }
651
+ UploadDocComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UploadDocComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i1$3.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
652
+ UploadDocComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: UploadDocComponent, selector: "gloww-upload-doc", ngImport: i0, template: "<h2 mat-dialog-title>\r\n Association d'un nouveau document</h2>\r\n\r\n<mat-dialog-content>\r\n\r\n <gloww-upload-file [(ngModel)]=\"files\" [acceptMime]=\"acceptMime\" [multiple]=\"multiple\" [allowAltFileName]=\"allowAltFileName\"></gloww-upload-file>\r\n\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"cancel()\">Close</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"save()\">Save</button>\r\n</mat-dialog-actions>\r\n", styles: ["ul{list-style:none;padding-left:0}ul li{padding-bottom:10px}\n"], components: [{ type: UploadFileComponent, selector: "gloww-upload-file", inputs: ["multiple", "allowAltFileName", "acceptMime"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
653
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UploadDocComponent, decorators: [{
654
+ type: Component,
655
+ args: [{ selector: 'gloww-upload-doc', template: "<h2 mat-dialog-title>\r\n Association d'un nouveau document</h2>\r\n\r\n<mat-dialog-content>\r\n\r\n <gloww-upload-file [(ngModel)]=\"files\" [acceptMime]=\"acceptMime\" [multiple]=\"multiple\" [allowAltFileName]=\"allowAltFileName\"></gloww-upload-file>\r\n\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"cancel()\">Close</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"save()\">Save</button>\r\n</mat-dialog-actions>\r\n", styles: ["ul{list-style:none;padding-left:0}ul li{padding-bottom:10px}\n"] }]
656
+ }], ctorParameters: function () {
657
+ return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
658
+ type: Inject,
659
+ args: [MAT_DIALOG_DATA]
660
+ }] }, { type: i1$3.FormBuilder }];
661
+ } });
662
+
663
+ class SearchFormComponent {
664
+ constructor() { }
665
+ ngOnInit() {
666
+ }
667
+ }
668
+ SearchFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SearchFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
669
+ SearchFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SearchFormComponent, selector: "glw-search-form", ngImport: i0, template: "<ng-content></ng-content>", styles: [""] });
670
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SearchFormComponent, decorators: [{
671
+ type: Component,
672
+ args: [{ selector: 'glw-search-form', template: "<ng-content></ng-content>", styles: [""] }]
673
+ }], ctorParameters: function () { return []; } });
674
+
675
+ class HeaderComponent {
676
+ constructor() { }
677
+ ngOnInit() {
678
+ }
679
+ }
680
+ HeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
681
+ HeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: HeaderComponent, selector: "glw-header", ngImport: i0, template: "<ng-content></ng-content>", styles: [""] });
682
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HeaderComponent, decorators: [{
683
+ type: Component,
684
+ args: [{ selector: 'glw-header', template: "<ng-content></ng-content>", styles: [""] }]
685
+ }], ctorParameters: function () { return []; } });
686
+
687
+ class ResultTableComponent {
688
+ constructor() { }
689
+ ngAfterContentInit() {
690
+ console.log(this.columnDefs.length);
691
+ }
692
+ ngOnInit() {
693
+ }
694
+ }
695
+ ResultTableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ResultTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
696
+ ResultTableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: ResultTableComponent, selector: "glw-result-table", queries: [{ propertyName: "columnDefs", predicate: MatColumnDef }], ngImport: i0, template: "<ng-content></ng-content>", styles: [""] });
697
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ResultTableComponent, decorators: [{
698
+ type: Component,
699
+ args: [{ selector: 'glw-result-table', template: "<ng-content></ng-content>", styles: [""] }]
700
+ }], ctorParameters: function () { return []; }, propDecorators: { columnDefs: [{
701
+ type: ContentChildren,
702
+ args: [MatColumnDef]
703
+ }] } });
704
+
705
+ class Oauthassociation {
706
+ toString() {
707
+ return this.provider;
708
+ }
709
+ }
710
+
711
+ class AuthenticationServiceConfig {
712
+ constructor() {
713
+ this.currentUserVariableName = 'currentuser';
714
+ this.authenticationUrl = `/admin/authusers/authenticate`;
715
+ this.changePasswordUrl = `/admin/authusers/changePassword`;
716
+ this.askResetPasswordCodeUrl = `/admin/authusers/askResetPasswordCode`;
717
+ this.resetPassworUrl = `/admin/authusers/resetPassword`;
718
+ this.environment = '__GlowwSecurity__';
719
+ this.showDomain = false;
720
+ this.askGSM = false;
721
+ this.googleClientId = '';
722
+ this.facebookClientId = '';
723
+ this.amazonClientId = '';
724
+ this.microsoftClientId = '';
725
+ }
726
+ }
727
+ AuthenticationServiceConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationServiceConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
728
+ AuthenticationServiceConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationServiceConfig, providedIn: 'root' });
729
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationServiceConfig, decorators: [{
730
+ type: Injectable,
731
+ args: [{ providedIn: 'root' }]
732
+ }] });
733
+
734
+ class AuthenticationService {
735
+ constructor(http, platformId, config) {
736
+ this.http = http;
737
+ this.platformId = platformId;
738
+ this.hasLocalStorage = false;
739
+ this.hasLocalStorage = isPlatformBrowser(this.platformId);
740
+ if (config && config.currentUserVariableName) {
741
+ this.currentUserVariableName = config.currentUserVariableName;
742
+ }
743
+ else {
744
+ this.currentUserVariableName = 'currentUser';
745
+ }
746
+ if (config && config.authenticationUrl) {
747
+ this.authenticationUrl = config.authenticationUrl;
748
+ }
749
+ else {
750
+ this.authenticationUrl = `/admin/authusers/authenticate`;
751
+ }
752
+ if (config && config.changePasswordUrl) {
753
+ this.changePasswordUrl = config.changePasswordUrl;
754
+ }
755
+ else {
756
+ this.changePasswordUrl = this.authenticationUrl.replace('authenticate', 'changePassword');
757
+ }
758
+ if (config && config.askResetPasswordCodeUrl) {
759
+ this.askResetPasswordCodeUrl = config.askResetPasswordCodeUrl;
760
+ }
761
+ else {
762
+ this.askResetPasswordCodeUrl = this.authenticationUrl.replace('authenticate', 'askResetPasswordCode');
763
+ }
764
+ if (config && config.resetPassworUrl) {
765
+ this.resetPasswordUrl = config.resetPassworUrl;
766
+ }
767
+ else {
768
+ this.resetPasswordUrl = this.authenticationUrl.replace('authenticate', 'resetPassword');
769
+ }
770
+ this.OAuthGetProvidersUrl = this.authenticationUrl.replace('authenticate', 'OAuthGetProviders');
771
+ this.OAuthAskCodeUrl = this.authenticationUrl.replace('authenticate', 'OAuthAskCode');
772
+ this.OAuthAssociationUrl = this.authenticationUrl.replace('authenticate', 'OAuthAssociation');
773
+ this.OAuthGetAssociationsUrl = this.authenticationUrl.replace('authenticate', 'OAuthGetAssociations');
774
+ this.OAuthDeleteAssociationUrl = this.authenticationUrl.replace('authenticate', 'OAuthDeleteAssociation');
775
+ if (config && config.environment) {
776
+ this.environment = config.environment;
777
+ }
778
+ if (config && config.showDomain) {
779
+ this.showdomain = config.showDomain;
780
+ }
781
+ if (this.hasLocalStorage) { // Angular Universal
782
+ this.currentUserSubject = new BehaviorSubject(JSON.parse(localStorage.getItem(this.currentUserVariableName)));
783
+ this.currentUser = this.currentUserSubject.asObservable();
784
+ }
785
+ }
786
+ get currentUserValue() {
787
+ if (!this.currentUserSubject) {
788
+ return null;
789
+ } // Angular Universsal
790
+ return this.currentUserSubject.value;
791
+ }
792
+ get isConnected() {
793
+ if (!this.currentUserSubject) {
794
+ return null;
795
+ } // Angular Universsal
796
+ return this.currentUserSubject.value !== null;
797
+ }
798
+ login(domain, username, password) {
799
+ const formData = new FormData();
800
+ if (this.showdomain) {
801
+ formData.set('domain', domain);
802
+ }
803
+ formData.set('environment', this.environment);
804
+ formData.set('username', username);
805
+ formData.set('password', password);
806
+ return this.http.post(this.authenticationUrl, formData, { observe: 'response' })
807
+ .pipe(map(resp => {
808
+ // store user details and jwt token in local storage to keep user logged in between page refreshes
809
+ const user = resp.body;
810
+ if (this.hasLocalStorage) {
811
+ localStorage.setItem(this.currentUserVariableName, JSON.stringify(user));
812
+ }
813
+ this.currentUserSubject.next(user);
814
+ return user;
815
+ }));
816
+ }
817
+ changePassword(domain, username, oldpassword, newpassword) {
818
+ var _a;
819
+ const params = new HttpParams({
820
+ fromObject: {
821
+ domain: (_a = this.currentUserValue.domain) !== null && _a !== void 0 ? _a : '',
822
+ username: this.currentUserValue.username,
823
+ newpassword,
824
+ oldpassword,
825
+ environment: this.environment
826
+ }
827
+ });
828
+ return this.http.get(this.changePasswordUrl, { params });
829
+ }
830
+ logout() {
831
+ // remove user from local storage to log user out
832
+ if (this.hasLocalStorage) {
833
+ localStorage.removeItem(this.currentUserVariableName);
834
+ }
835
+ this.currentUserSubject.next(null);
836
+ }
837
+ askResetPasswordCode(domain, firstname, lastname, email, gsm) {
838
+ const params = new HttpParams({
839
+ fromObject: {
840
+ domain: '',
841
+ firstname,
842
+ lastname,
843
+ email,
844
+ gsm,
845
+ environment: this.environment
846
+ }
847
+ });
848
+ return this.http.get(this.askResetPasswordCodeUrl, { params });
849
+ }
850
+ resetPassword(email, code, password) {
851
+ const params = new HttpParams({
852
+ fromObject: {
853
+ email,
854
+ code,
855
+ password,
856
+ environment: this.environment
857
+ }
858
+ });
859
+ return this.http.get(this.resetPasswordUrl, { params });
860
+ }
861
+ getOAuthProviders() {
862
+ return this.http.get(this.OAuthGetProvidersUrl);
863
+ }
864
+ OAuthAskCode(environment, login, idOauth, provider, name, value) {
865
+ const params = new HttpParams({
866
+ fromObject: {
867
+ environment,
868
+ login,
869
+ idOauth,
870
+ provider,
871
+ name,
872
+ value
873
+ }
874
+ });
875
+ return this.http.get(this.OAuthAskCodeUrl, { params });
876
+ }
877
+ OAuthAssociation(environment, code, idOauth, provider, name, value) {
878
+ const params = new HttpParams({
879
+ fromObject: {
880
+ environment,
881
+ code,
882
+ idOauth,
883
+ provider,
884
+ name,
885
+ value
886
+ }
887
+ });
888
+ return this.http.get(this.OAuthAssociationUrl, { params }).pipe(map(resp => {
889
+ // store user details and jwt token in local storage to keep user logged in between page refreshes
890
+ console.log("OAuthAuthentication");
891
+ console.log(resp);
892
+ const user = resp;
893
+ if (this.hasLocalStorage) {
894
+ localStorage.setItem(this.currentUserVariableName, JSON.stringify(user));
895
+ }
896
+ this.currentUserSubject.next(user);
897
+ return user;
898
+ }));
899
+ }
900
+ getOAuthAssociations() {
901
+ const params = new HttpParams({
902
+ fromObject: {
903
+ environment: this.environment
904
+ }
905
+ });
906
+ return this.http.get(this.OAuthGetAssociationsUrl, { params }).pipe(tap((value) => console.log(value)), map((value) => value.map(item => Object.assign(new Oauthassociation(), item))), tap((value) => console.log(value)));
907
+ }
908
+ OAuthDeleteAssociation(provider, idOAuth) {
909
+ const params = new HttpParams({
910
+ fromObject: {
911
+ environment: this.environment,
912
+ provider,
913
+ idOAuth
914
+ }
915
+ });
916
+ return this.http.get(this.OAuthDeleteAssociationUrl, { params });
917
+ }
918
+ }
919
+ AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationService, deps: [{ token: i1.HttpClient }, { token: PLATFORM_ID }, { token: AuthenticationServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
920
+ AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationService, providedIn: 'root' });
921
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthenticationService, decorators: [{
922
+ type: Injectable,
923
+ args: [{ providedIn: 'root' }]
924
+ }], ctorParameters: function () {
925
+ return [{ type: i1.HttpClient }, { type: undefined, decorators: [{
926
+ type: Inject,
927
+ args: [PLATFORM_ID]
928
+ }] }, { type: AuthenticationServiceConfig, decorators: [{
929
+ type: Optional
930
+ }] }];
931
+ } });
932
+
933
+ ;
934
+ class DisplayObjectsComponent {
935
+ constructor(changeDetectorRef, dialog, router, location, authenticationService, formBuilder, route) {
936
+ this.changeDetectorRef = changeDetectorRef;
937
+ this.dialog = dialog;
938
+ this.router = router;
939
+ this.location = location;
940
+ this.authenticationService = authenticationService;
941
+ this.formBuilder = formBuilder;
942
+ this.route = route;
943
+ this.canDisplayObj = false;
944
+ this.canEdit = true;
945
+ this.canDelete = true;
946
+ this.canAdd = true;
947
+ this.mandatoryParams = {};
948
+ this.actions = [];
949
+ this.dialogConfig = {};
950
+ this.columnsToDisplay = [];
951
+ this.displayform = true;
952
+ this.displayresult = false;
953
+ this.queryParams = {};
954
+ const component = this;
955
+ this.currentUser = this.authenticationService.currentUserValue.UserInfo;
956
+ this.form2 = this.formBuilder.group({
957
+ _MaxRow_: [null]
958
+ });
959
+ }
960
+ ngOnChanges(changes) {
961
+ }
962
+ ngAfterViewInit() {
963
+ var _a;
964
+ if (!this.searchRequest) {
965
+ this.searchRequest = this.glowwService[`search${this.objectName}`];
966
+ }
967
+ if (!this.postRequest) {
968
+ this.postRequest = this.glowwService[`post${this.objectName}`];
969
+ }
970
+ if (!this.deleteRequest) {
971
+ this.deleteRequest = this.glowwService[`delete${this.objectName}`];
972
+ }
973
+ if (!this.putRequest) {
974
+ this.putRequest = this.glowwService[`put${this.objectName}`];
975
+ }
976
+ if (((_a = this.maxrows) === null || _a === void 0 ? void 0 : _a.length) > 0) {
977
+ this.form.addControl("_MaxRow_", new FormControl(null));
978
+ }
979
+ }
980
+ ngAfterContentInit() {
981
+ console.log(`INIT : fromLayout:${this.formLayout}-displayform:${this.displayform}`);
982
+ if (!this.formLayout && this.resultLayout) {
983
+ this.displayform = false;
984
+ this.displayresult = true;
985
+ }
986
+ this.glowwService.basePathChange.subscribe(newUrl => {
987
+ console.log(`basePathChange : fromLayout:${this.formLayout}-displayform:${this.displayform}`);
988
+ if (!this.formLayout && this.resultLayout) {
989
+ this.displayform = false;
990
+ this.displayresult = true;
991
+ }
992
+ if (!this.displayform) {
993
+ this.Search();
994
+ }
995
+ });
996
+ }
997
+ ngOnInit() {
998
+ }
999
+ Init(data) {
1000
+ if ((data && Object.keys(data).length > 0) || this.displayresult) {
1001
+ this.Search(data);
1002
+ }
1003
+ }
1004
+ Search(data) {
1005
+ this.data = data;
1006
+ this.displayresult = true;
1007
+ this.displayform = false;
1008
+ this.resultException = null;
1009
+ if (data) {
1010
+ Object.keys(data).forEach(name => {
1011
+ this.queryParams[name] = data[name];
1012
+ });
1013
+ }
1014
+ Object.keys(this.route.snapshot.params).forEach(name => {
1015
+ this.queryParams[name] = this.route.snapshot.params[name];
1016
+ });
1017
+ if (this.mandatoryParams) {
1018
+ Object.keys(this.mandatoryParams).forEach(name => {
1019
+ this.queryParams[name] = this.queryParams[name];
1020
+ });
1021
+ }
1022
+ this.searchRequest.call(this.glowwService, this.queryParams).subscribe(r => {
1023
+ this.dataSource = new MatTableDataSource(r);
1024
+ this.changeDetectorRef.detectChanges();
1025
+ this.UpdateTable();
1026
+ }, error => {
1027
+ this.displayresult = false;
1028
+ this.displayform = true;
1029
+ this.resultException = error;
1030
+ });
1031
+ }
1032
+ clean(obj) {
1033
+ for (const propName in obj) {
1034
+ if (obj[propName] === null || obj[propName] === undefined) {
1035
+ delete obj[propName];
1036
+ }
1037
+ }
1038
+ }
1039
+ onSearch() {
1040
+ this.queryParams = {};
1041
+ Object.keys(this.form.value).forEach(name => {
1042
+ const val = this.form.value[name];
1043
+ if (val) {
1044
+ if (val.constructor.name === 'Moment') {
1045
+ this.queryParams[name] = val.toISOString();
1046
+ }
1047
+ else {
1048
+ this.queryParams[name] = val;
1049
+ }
1050
+ }
1051
+ });
1052
+ if (this.form2.value._MaxRow_) {
1053
+ this.queryParams._MaxRow_ = this.form2.value._MaxRow_;
1054
+ }
1055
+ this.clean(this.queryParams);
1056
+ const params = new HttpParams({ fromObject: this.queryParams });
1057
+ const currentstate = this.location.getState();
1058
+ this.location.replaceState(this.router.url, params.toString());
1059
+ this.Search();
1060
+ }
1061
+ UpdateDataSource(r) {
1062
+ this.dataSource = new MatTableDataSource(r);
1063
+ this.changeDetectorRef.detectChanges();
1064
+ this.UpdateTable();
1065
+ }
1066
+ UpdateTable() {
1067
+ if (this.dataSource) {
1068
+ if (!this.table) {
1069
+ console.log('!this.table');
1070
+ return;
1071
+ }
1072
+ this.resultLayout.columnDefs.forEach(columnDef => this.table.addColumnDef(columnDef));
1073
+ this.dataSource.paginator = this.paginator;
1074
+ this.dataSource.sort = this.sort;
1075
+ this.columnsToDisplay = this.columns();
1076
+ }
1077
+ }
1078
+ canDisplayObjThis(obj, action) {
1079
+ try {
1080
+ if (!this.displayObjLink) {
1081
+ return false;
1082
+ }
1083
+ if (typeof this.canDisplayObj === 'boolean') {
1084
+ return this.canDisplayObj;
1085
+ }
1086
+ return this.canDisplayObj(this.currentUser, obj, action);
1087
+ }
1088
+ catch (ex) {
1089
+ console.log(ex);
1090
+ return true;
1091
+ }
1092
+ }
1093
+ canAddThis() {
1094
+ try {
1095
+ if (!this.canAdd) {
1096
+ return false;
1097
+ }
1098
+ if (typeof this.canAdd === 'boolean') {
1099
+ return this.canAdd;
1100
+ }
1101
+ return this.canAdd(this.currentUser);
1102
+ }
1103
+ catch (ex) {
1104
+ console.log(ex);
1105
+ return true;
1106
+ }
1107
+ }
1108
+ canEditThis(obj) {
1109
+ try {
1110
+ if (!this.canEdit) {
1111
+ return false;
1112
+ }
1113
+ if (typeof this.canEdit === 'boolean') {
1114
+ return this.canEdit;
1115
+ }
1116
+ return this.canEdit(this.currentUser, obj);
1117
+ }
1118
+ catch (ex) {
1119
+ console.log(ex);
1120
+ return true;
1121
+ }
1122
+ }
1123
+ canDeleteThis(obj) {
1124
+ try {
1125
+ if (!this.canDelete) {
1126
+ return false;
1127
+ }
1128
+ if (typeof this.canDelete === 'boolean') {
1129
+ return this.canDelete;
1130
+ }
1131
+ return this.canDelete(this.currentUser, obj);
1132
+ }
1133
+ catch (ex) {
1134
+ console.log(ex);
1135
+ return false;
1136
+ }
1137
+ }
1138
+ displayObjLinkThis(obj, action) {
1139
+ if (!this.displayObjLink) {
1140
+ return null;
1141
+ }
1142
+ return this.displayObjLink(obj, action);
1143
+ }
1144
+ isString(value) {
1145
+ return typeof value === 'string' || value instanceof String;
1146
+ }
1147
+ getPrimaryKey(obj) {
1148
+ let res = [];
1149
+ if (this.isString(this.primaryKey)) {
1150
+ console.log("string");
1151
+ res.push(obj[this.primaryKey]);
1152
+ }
1153
+ else {
1154
+ console.log("string[]");
1155
+ this.primaryKey.forEach(key => res.push(obj[key]));
1156
+ }
1157
+ return res;
1158
+ }
1159
+ _saveObj(obj) {
1160
+ var subject = new Subject();
1161
+ this.postRequest.call(this.glowwService, obj).subscribe(data => {
1162
+ const tmp = this.dataSource.data;
1163
+ tmp.push(data);
1164
+ this.dataSource.data = tmp;
1165
+ subject.next(data);
1166
+ }, error => {
1167
+ alert(`Unable to add Object ${error.status} ${error.statusText}\n${error.Message}\n${error.error}`);
1168
+ subject.error(error);
1169
+ });
1170
+ return subject;
1171
+ }
1172
+ _saveFile(fileField, obj, file) {
1173
+ const formData = new FormData();
1174
+ formData.append('file', file.data);
1175
+ return this.glowwService[`post${this.objectName}${fileField}`].call(this.glowwService, this.getPrimaryKey(obj), formData).pipe(tap((event) => {
1176
+ var _a;
1177
+ switch (event.type) {
1178
+ case HttpEventType.UploadProgress:
1179
+ file.progress = Math.round(event.loaded * 100 / ((_a = event.total) !== null && _a !== void 0 ? _a : 1));
1180
+ file.inProgress = file.progress !== 100;
1181
+ break;
1182
+ case HttpEventType.Response:
1183
+ file.progress = 100;
1184
+ file.status = "Done";
1185
+ file.inProgress = false;
1186
+ break;
1187
+ }
1188
+ }), filter((event) => {
1189
+ console.log(`filter ${event.type}`);
1190
+ return event.type === HttpEventType.Response;
1191
+ }), map((event) => {
1192
+ console.log(`map ${event.type}`);
1193
+ return event.body;
1194
+ }), catchError((error) => {
1195
+ file.inProgress = false;
1196
+ file.status = "Error";
1197
+ console.log(`${file.data.name} upload failed.`);
1198
+ //subject.error(error);
1199
+ return of(`${file.data.name} upload failed.`);
1200
+ }));
1201
+ }
1202
+ AddObj() {
1203
+ var _a;
1204
+ const dialogConfig = new MatDialogConfig();
1205
+ dialogConfig.disableClose = true;
1206
+ dialogConfig.autoFocus = true;
1207
+ dialogConfig.closeOnNavigation = false;
1208
+ if (this.dialogConfig) {
1209
+ Object.keys(this.dialogConfig).forEach(name => {
1210
+ dialogConfig[name] = this.dialogConfig[name];
1211
+ });
1212
+ }
1213
+ let args = {};
1214
+ Object.keys((_a = this.route.snapshot) === null || _a === void 0 ? void 0 : _a.params).forEach(key => {
1215
+ var _a;
1216
+ args[key] = (_a = this.route.snapshot) === null || _a === void 0 ? void 0 : _a.params[key];
1217
+ dialogConfig.data = args;
1218
+ });
1219
+ const dlg = this.dialog.open(this.Editor, dialogConfig);
1220
+ dlg.componentInstance.callback = (data => {
1221
+ let datacopy = Object.assign({}, data);
1222
+ const fileFields = this.Editor.fileFields;
1223
+ if ((fileFields === null || fileFields === void 0 ? void 0 : fileFields.length) == 1) {
1224
+ // Un seul champ, il peut être multiple
1225
+ const fileField = fileFields[0];
1226
+ const files = datacopy[fileField];
1227
+ delete datacopy[fileField];
1228
+ const allobs = {};
1229
+ files.forEach(file => {
1230
+ if (file.statut !== 'Done' && file.statut !== 'Error') {
1231
+ const obs = this._saveObj(datacopy).pipe(switchMap(newdata => this._saveFile(fileField, newdata, file)));
1232
+ allobs[file.name] = obs;
1233
+ }
1234
+ });
1235
+ return combineLatest(allobs).pipe(take(1));
1236
+ }
1237
+ else if ((fileFields === null || fileFields === void 0 ? void 0 : fileFields.length) > 1) {
1238
+ // Plusieurs champs file, il ne peut y avoir qu'une seul fichier par champ.
1239
+ const fields = {};
1240
+ fileFields.forEach(ff => {
1241
+ fields[ff] = datacopy[ff];
1242
+ delete datacopy[ff];
1243
+ return this._saveObj(datacopy).pipe(mergeMap(newdata => {
1244
+ var allobs = [];
1245
+ Object.entries(fields).forEach(([fileField, files]) => {
1246
+ if (files.length > 0) {
1247
+ allobs.push(this._saveFile(fileField, newdata, files[0]));
1248
+ }
1249
+ });
1250
+ return forkJoin(allobs); // TODO : PAS TERMINE... JAMAIS UTILISE...
1251
+ }));
1252
+ });
1253
+ }
1254
+ else {
1255
+ // Form sans fichier
1256
+ return this._saveObj(data);
1257
+ }
1258
+ });
1259
+ }
1260
+ DeleteObj(obj) {
1261
+ if (confirm('Are you sure you want to delete this objet ? ')) {
1262
+ this.deleteRequest.apply(this.glowwService, this.getPrimaryKey(obj)).subscribe(p => {
1263
+ const i = this.dataSource.data.indexOf(obj);
1264
+ const tmp = this.dataSource.data;
1265
+ tmp.splice(i, 1);
1266
+ this.dataSource.data = tmp;
1267
+ }, error => {
1268
+ alert(`Unable to delete Object ${error.status} ${error.statusText}\n${error.Message}\n${error.error}`);
1269
+ });
1270
+ }
1271
+ }
1272
+ _updateObj(current, newData) {
1273
+ let args = this.getPrimaryKey(current);
1274
+ args.push(newData);
1275
+ var subject = new Subject();
1276
+ this.putRequest.apply(this.glowwService, args).subscribe(data => {
1277
+ const i = this.dataSource.data.indexOf(current);
1278
+ const tmp = this.dataSource.data;
1279
+ tmp[i] = data;
1280
+ this.dataSource.data = tmp;
1281
+ subject.next(data);
1282
+ }, error => {
1283
+ alert(`Unable to update Object ${error.status} ${error.statusText}\n${error.Message}\n${error.error}`);
1284
+ subject.error(error);
1285
+ });
1286
+ return subject;
1287
+ }
1288
+ EditObj(obj) {
1289
+ const dialogConfig = new MatDialogConfig();
1290
+ dialogConfig.disableClose = true;
1291
+ dialogConfig.autoFocus = true;
1292
+ dialogConfig.closeOnNavigation = false;
1293
+ if (this.dialogConfig) {
1294
+ Object.keys(this.dialogConfig).forEach(name => {
1295
+ dialogConfig[name] = this.dialogConfig[name];
1296
+ });
1297
+ }
1298
+ dialogConfig.data = obj;
1299
+ const dlg = this.dialog.open(this.Editor, dialogConfig);
1300
+ dlg.componentInstance.callback = (data => {
1301
+ let datacopy = Object.assign({}, data);
1302
+ const fileFields = this.Editor.fileFields;
1303
+ if ((fileFields === null || fileFields === void 0 ? void 0 : fileFields.length) == 1) {
1304
+ // Un seul champ, il peut être multiple
1305
+ const fileField = fileFields[0];
1306
+ const files = datacopy[fileField];
1307
+ delete datacopy[fileField];
1308
+ const allobs = {};
1309
+ files.forEach(file => {
1310
+ if (file.statut !== 'Done' && file.statut !== 'Error') {
1311
+ const obs = this._updateObj(obj, datacopy).pipe(switchMap(newdata => this._saveFile(fileField, newdata, file)));
1312
+ allobs[file.name] = obs;
1313
+ }
1314
+ });
1315
+ return combineLatest(allobs).pipe(take(1));
1316
+ }
1317
+ else if ((fileFields === null || fileFields === void 0 ? void 0 : fileFields.length) > 1) {
1318
+ // Plusieurs champs file, il ne peut y avoir qu'une seul fichier par champ.
1319
+ const fields = {};
1320
+ fileFields.forEach(ff => {
1321
+ fields[ff] = datacopy[ff];
1322
+ delete datacopy[ff];
1323
+ return this._updateObj(obj, datacopy).pipe(mergeMap(newdata => {
1324
+ var allobs = [];
1325
+ Object.entries(fields).forEach(([fileField, files]) => {
1326
+ if (files.length > 0) {
1327
+ allobs.push(this._saveFile(fileField, newdata, files[0]));
1328
+ }
1329
+ });
1330
+ return forkJoin(allobs); // TODO : PAS TERMINE... JAMAIS UTILISE...
1331
+ }));
1332
+ });
1333
+ }
1334
+ else {
1335
+ // Form sans fichier
1336
+ return this._updateObj(obj, data);
1337
+ }
1338
+ });
1339
+ }
1340
+ }
1341
+ DisplayObjectsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DisplayObjectsComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$2.MatDialog }, { token: i2.Router }, { token: i3.Location }, { token: AuthenticationService }, { token: i1$3.FormBuilder }, { token: i2.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Component });
1342
+ DisplayObjectsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DisplayObjectsComponent, selector: "glw-display-objects", inputs: { configuration: "configuration", displayObjLink: "displayObjLink", canDisplayObj: "canDisplayObj", canEdit: "canEdit", canDelete: "canDelete", canAdd: "canAdd", form: "form", Editor: "Editor", searchRequest: "searchRequest", postRequest: "postRequest", deleteRequest: "deleteRequest", putRequest: "putRequest", columns: "columns", glowwService: "glowwService", objectName: "objectName", primaryKey: "primaryKey", maxrows: "maxrows", mandatoryParams: "mandatoryParams", actions: "actions", dialogConfig: "dialogConfig", fileFields: "fileFields" }, queries: [{ propertyName: "header", first: true, predicate: HeaderComponent, descendants: true }, { propertyName: "formLayout", first: true, predicate: SearchFormComponent, descendants: true }, { propertyName: "resultLayout", first: true, predicate: ResultTableComponent, descendants: true }], viewQueries: [{ propertyName: "table", first: true, predicate: MatTable, descendants: true }, { propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div>\r\n <ng-content select=\"glw-header\"></ng-content>\r\n</div>\r\n\r\n<div *ngIf=\"displayform\">\r\n <mat-card>\r\n <mat-card-content>\r\n <mat-error *ngIf=\"resultException\">\r\n Unable to query : {{resultException}}\r\n </mat-error>\r\n <ng-content select=\"glw-search-form\"></ng-content>\r\n <div *ngIf=\"maxrows\" [formGroup]=\"form2\">\r\n <br />\r\n <mat-form-field>\r\n <mat-select placeholder=\"MaxRow\" formControlName=\"_MaxRow_\">\r\n <mat-option *ngFor=\"let maxrow of maxrows\" [value]=\"maxrow\">\r\n <span *ngIf=\"maxrow\">{{maxrow}} objects</span>\r\n <span *ngIf=\"!maxrow\"> Default</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-stroked-button color=\"accent\" (click)=\"onSearch()\">\r\n <mat-icon>search</mat-icon>\r\n Search\r\n </button>\r\n </mat-card-actions>\r\n </mat-card>\r\n</div>\r\n\r\n<div *ngIf=\"displayresult\">\r\n <div class=\"mat-elevation-z8\" *ngIf=\"dataSource; else Spinner\">\r\n <table mat-table [dataSource]=\"dataSource\" matSort>\r\n <ng-container matColumnDef=\"action\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <i class=\"fal fa-plus\" (click)=\"AddObj()\" *ngIf=\"canAddThis()\">\r\n </i>\r\n </th>\r\n <td mat-cell *matCellDef=\"let obj\">\r\n <i class=\"fal fa-eye\" [routerLink]=\"displayObjLinkThis(obj)\" *ngIf=\"canDisplayObjThis(obj)\">\r\n </i>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <i [ngClass]=\"action.icon\" [routerLink]=\"action.routerLinkFct(obj)\" *ngIf=\"action.icon.icon && (!action.display || action.display(obj, action.name))\">\r\n </i>\r\n <i [ngClass]=\"action.icon\" [routerLink]=\"action.routerLinkFct(obj)\" *ngIf=\"!action.icon.icon && (!action.display || action.display(obj, action.name))\"></i>\r\n </ng-container>\r\n <i class=\"fal fa-trash-alt\" (click)=\"DeleteObj(obj)\" *ngIf=\"canDeleteThis(obj)\">\r\n </i>\r\n <i class=\"fal fa-pencil\" (click)=\"EditObj(obj)\" *ngIf=\"canEditThis(obj)\">\r\n </i>\r\n </td>\r\n </ng-container>\r\n <ng-content select=\"glw-result-table\"></ng-content>\r\n <tr mat-header-row *matHeaderRowDef=\"columnsToDisplay\"></tr>\r\n <tr mat-row *matRowDef=\"let myRowData; columns: columnsToDisplay\"></tr>\r\n </table>\r\n <mat-paginator pageSize=\"10\"></mat-paginator>\r\n </div>\r\n <ng-template #Spinner>\r\n <mat-spinner></mat-spinner>\r\n </ng-template>\r\n</div>\r\n", styles: ["table{width:100%}i{cursor:pointer;padding:5px}\n"], components: [{ type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i8.MatSelect, selector: "mat-select", inputs: ["disabled", "disableRipple", "tabIndex"], exportAs: ["matSelect"] }, { type: i9.MatOption, selector: "mat-option", exportAs: ["matOption"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i11.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i12.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { type: i12.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { type: i12.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { type: i13.MatPaginator, selector: "mat-paginator", inputs: ["disabled"], exportAs: ["matPaginator"] }, { type: i14.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i5$1.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i7.MatError, selector: "mat-error", inputs: ["id"] }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5$1.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }, { type: i15.MatSort, selector: "[matSort]", inputs: ["matSortDisabled", "matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { type: i12.MatColumnDef, selector: "[matColumnDef]", inputs: ["sticky", "matColumnDef"] }, { type: i12.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { type: i12.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { type: i12.MatCellDef, selector: "[matCellDef]" }, { type: i12.MatCell, selector: "mat-cell, td[mat-cell]" }, { type: i2.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i12.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { type: i12.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }] });
1343
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DisplayObjectsComponent, decorators: [{
1344
+ type: Component,
1345
+ args: [{ selector: 'glw-display-objects', template: "<div>\r\n <ng-content select=\"glw-header\"></ng-content>\r\n</div>\r\n\r\n<div *ngIf=\"displayform\">\r\n <mat-card>\r\n <mat-card-content>\r\n <mat-error *ngIf=\"resultException\">\r\n Unable to query : {{resultException}}\r\n </mat-error>\r\n <ng-content select=\"glw-search-form\"></ng-content>\r\n <div *ngIf=\"maxrows\" [formGroup]=\"form2\">\r\n <br />\r\n <mat-form-field>\r\n <mat-select placeholder=\"MaxRow\" formControlName=\"_MaxRow_\">\r\n <mat-option *ngFor=\"let maxrow of maxrows\" [value]=\"maxrow\">\r\n <span *ngIf=\"maxrow\">{{maxrow}} objects</span>\r\n <span *ngIf=\"!maxrow\"> Default</span>\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <mat-card-actions>\r\n <button mat-stroked-button color=\"accent\" (click)=\"onSearch()\">\r\n <mat-icon>search</mat-icon>\r\n Search\r\n </button>\r\n </mat-card-actions>\r\n </mat-card>\r\n</div>\r\n\r\n<div *ngIf=\"displayresult\">\r\n <div class=\"mat-elevation-z8\" *ngIf=\"dataSource; else Spinner\">\r\n <table mat-table [dataSource]=\"dataSource\" matSort>\r\n <ng-container matColumnDef=\"action\">\r\n <th mat-header-cell *matHeaderCellDef>\r\n <i class=\"fal fa-plus\" (click)=\"AddObj()\" *ngIf=\"canAddThis()\">\r\n </i>\r\n </th>\r\n <td mat-cell *matCellDef=\"let obj\">\r\n <i class=\"fal fa-eye\" [routerLink]=\"displayObjLinkThis(obj)\" *ngIf=\"canDisplayObjThis(obj)\">\r\n </i>\r\n <ng-container *ngFor=\"let action of actions\">\r\n <i [ngClass]=\"action.icon\" [routerLink]=\"action.routerLinkFct(obj)\" *ngIf=\"action.icon.icon && (!action.display || action.display(obj, action.name))\">\r\n </i>\r\n <i [ngClass]=\"action.icon\" [routerLink]=\"action.routerLinkFct(obj)\" *ngIf=\"!action.icon.icon && (!action.display || action.display(obj, action.name))\"></i>\r\n </ng-container>\r\n <i class=\"fal fa-trash-alt\" (click)=\"DeleteObj(obj)\" *ngIf=\"canDeleteThis(obj)\">\r\n </i>\r\n <i class=\"fal fa-pencil\" (click)=\"EditObj(obj)\" *ngIf=\"canEditThis(obj)\">\r\n </i>\r\n </td>\r\n </ng-container>\r\n <ng-content select=\"glw-result-table\"></ng-content>\r\n <tr mat-header-row *matHeaderRowDef=\"columnsToDisplay\"></tr>\r\n <tr mat-row *matRowDef=\"let myRowData; columns: columnsToDisplay\"></tr>\r\n </table>\r\n <mat-paginator pageSize=\"10\"></mat-paginator>\r\n </div>\r\n <ng-template #Spinner>\r\n <mat-spinner></mat-spinner>\r\n </ng-template>\r\n</div>\r\n", styles: ["table{width:100%}i{cursor:pointer;padding:5px}\n"] }]
1346
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$2.MatDialog }, { type: i2.Router }, { type: i3.Location }, { type: AuthenticationService }, { type: i1$3.FormBuilder }, { type: i2.ActivatedRoute }]; }, propDecorators: { header: [{
1347
+ type: ContentChild,
1348
+ args: [HeaderComponent]
1349
+ }], formLayout: [{
1350
+ type: ContentChild,
1351
+ args: [SearchFormComponent]
1352
+ }], resultLayout: [{
1353
+ type: ContentChild,
1354
+ args: [ResultTableComponent]
1355
+ }], table: [{
1356
+ type: ViewChild,
1357
+ args: [MatTable, { static: false }]
1358
+ }], paginator: [{
1359
+ type: ViewChild,
1360
+ args: [MatPaginator, { static: false }]
1361
+ }], sort: [{
1362
+ type: ViewChild,
1363
+ args: [MatSort, { static: false }]
1364
+ }], configuration: [{
1365
+ type: Input
1366
+ }], displayObjLink: [{
1367
+ type: Input
1368
+ }], canDisplayObj: [{
1369
+ type: Input
1370
+ }], canEdit: [{
1371
+ type: Input
1372
+ }], canDelete: [{
1373
+ type: Input
1374
+ }], canAdd: [{
1375
+ type: Input
1376
+ }], form: [{
1377
+ type: Input
1378
+ }], Editor: [{
1379
+ type: Input
1380
+ }], searchRequest: [{
1381
+ type: Input
1382
+ }], postRequest: [{
1383
+ type: Input
1384
+ }], deleteRequest: [{
1385
+ type: Input
1386
+ }], putRequest: [{
1387
+ type: Input
1388
+ }], columns: [{
1389
+ type: Input
1390
+ }], glowwService: [{
1391
+ type: Input
1392
+ }], objectName: [{
1393
+ type: Input
1394
+ }], primaryKey: [{
1395
+ type: Input
1396
+ }], maxrows: [{
1397
+ type: Input
1398
+ }], mandatoryParams: [{
1399
+ type: Input
1400
+ }], actions: [{
1401
+ type: Input
1402
+ }], dialogConfig: [{
1403
+ type: Input
1404
+ }], fileFields: [{
1405
+ type: Input
1406
+ }] } });
1407
+
1408
+ class PromptComponent {
1409
+ constructor(dialogRef, data, formBuilder) {
1410
+ this.dialogRef = dialogRef;
1411
+ this.data = data;
1412
+ this.formBuilder = formBuilder;
1413
+ // Update view with given values
1414
+ this.title = data.title;
1415
+ this.message = data.message;
1416
+ this.form = this.formBuilder.group({
1417
+ prompt: [data.initialValue, data.required ? Validators.required : null],
1418
+ });
1419
+ }
1420
+ ngOnInit() {
1421
+ }
1422
+ onCancel() {
1423
+ // Close the dialog, return true
1424
+ this.dialogRef.close(false);
1425
+ }
1426
+ onOK() {
1427
+ // Close the dialog, return false
1428
+ this.dialogRef.close(this.form.value.prompt);
1429
+ }
1430
+ }
1431
+ PromptComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PromptComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i1$3.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
1432
+ PromptComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: PromptComponent, selector: "gloww-prompt", ngImport: i0, template: "<h1 mat-dialog-title>\r\n {{title}}\r\n</h1>\r\n\r\n<div mat-dialog-content [formGroup]=\"form\">\r\n <p [innerHTML]=\"message | safeHtml\"></p>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Prompt\" formControlName=\"prompt\" style=\"width: calc(100% - 32px);\">\r\n </mat-form-field>\r\n</div>\r\n\r\n<mat-dialog-actions>\r\n <button mat-button (click)=\"onCancel()\">Cancel</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"onOK()\">Yes</button>\r\n</mat-dialog-actions>\r\n", styles: [""], components: [{ type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], pipes: { "safeHtml": SafeHtmlPipe } });
1433
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: PromptComponent, decorators: [{
1434
+ type: Component,
1435
+ args: [{ selector: 'gloww-prompt', template: "<h1 mat-dialog-title>\r\n {{title}}\r\n</h1>\r\n\r\n<div mat-dialog-content [formGroup]=\"form\">\r\n <p [innerHTML]=\"message | safeHtml\"></p>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Prompt\" formControlName=\"prompt\" style=\"width: calc(100% - 32px);\">\r\n </mat-form-field>\r\n</div>\r\n\r\n<mat-dialog-actions>\r\n <button mat-button (click)=\"onCancel()\">Cancel</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"onOK()\">Yes</button>\r\n</mat-dialog-actions>\r\n", styles: [""] }]
1436
+ }], ctorParameters: function () {
1437
+ return [{ type: i1$2.MatDialogRef }, { type: PromptModel, decorators: [{
1438
+ type: Inject,
1439
+ args: [MAT_DIALOG_DATA]
1440
+ }] }, { type: i1$3.FormBuilder }];
1441
+ } });
1442
+ // tslint:disable-next-line: max-classes-per-file
1443
+ class PromptModel {
1444
+ constructor(title, message, initialValue, required) {
1445
+ this.title = title;
1446
+ this.message = message;
1447
+ this.initialValue = initialValue;
1448
+ this.required = required;
1449
+ }
1450
+ }
1451
+
1452
+ function retryWithDelay(delay$1, count = 1) {
1453
+ return (input) => input.pipe(retryWhen((errors) => errors.pipe(scan((acc, error) => ({ count: acc.count + 1, error }), {
1454
+ count: 0,
1455
+ error: undefined,
1456
+ }), tap((current) => {
1457
+ if (current.count > count) {
1458
+ throw current.error;
1459
+ }
1460
+ }), delay(delay$1))));
1461
+ }
1462
+
1463
+ class SecurePipe {
1464
+ constructor(http, domSanitizer) {
1465
+ this.http = http;
1466
+ this.domSanitizer = domSanitizer;
1467
+ }
1468
+ transform(url, delayVal, retryVal) {
1469
+ if (!delayVal) {
1470
+ delayVal = 5000;
1471
+ }
1472
+ if (!retryVal) {
1473
+ retryVal = 0;
1474
+ }
1475
+ return this.http
1476
+ // load the image as a blob
1477
+ .get(url, { responseType: 'blob' })
1478
+ // create an object url of that blob that we can use in the src attribute
1479
+ .pipe(map(e => this.domSanitizer.bypassSecurityTrustUrl(URL.createObjectURL(e))), retryWithDelay(delayVal, retryVal));
1480
+ }
1481
+ }
1482
+ SecurePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecurePipe, deps: [{ token: i1.HttpClient }, { token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1483
+ SecurePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecurePipe, name: "secure" });
1484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecurePipe, decorators: [{
1485
+ type: Pipe,
1486
+ args: [{
1487
+ name: 'secure'
1488
+ }]
1489
+ }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: i1$1.DomSanitizer }]; } });
1490
+
1491
+ class MenuListItemComponent {
1492
+ constructor(navService, router) {
1493
+ this.navService = navService;
1494
+ this.router = router;
1495
+ this._expanded = false;
1496
+ this.ariaExpanded = this.expanded;
1497
+ if (this.depth === undefined) {
1498
+ this.depth = 0;
1499
+ }
1500
+ }
1501
+ get expanded() {
1502
+ return this._expanded;
1503
+ }
1504
+ set expanded(value) {
1505
+ console.log("change expanded");
1506
+ this._expanded = value;
1507
+ }
1508
+ ngOnInit() {
1509
+ /*
1510
+ this.navService.currentUrl.subscribe((url: string) => {
1511
+ let route = this.item.route as string;
1512
+ if (typeof this.item.route === 'function') {
1513
+ const routefct: () => (string | string[]) = this.item.route;
1514
+ route = routefct.call(this);
1515
+ }
1516
+
1517
+
1518
+ if (this.item.route && url) {
1519
+ // console.log(`Checking '/${this.item.route}' against '${url}'`);
1520
+ //this.expanded = url.indexOf(`/${route}`) === 0;
1521
+ //this.ariaExpanded = this.expanded;
1522
+ // console.log(`${this.item.route} is expanded: ${this.expanded}`);
1523
+ }
1524
+ });
1525
+ */
1526
+ }
1527
+ onItemSelected(item) {
1528
+ /*if (!item.children || !item.children.length) {
1529
+ if (typeof item.route === 'function') {
1530
+ const routefct: () => string = item.route;
1531
+ this.router.navigate([routefct.call(this)]);
1532
+ } else {
1533
+ const route: string = item.route;
1534
+ this.router.navigate([route]);
1535
+ }
1536
+ this.navService.closeNav();
1537
+ }*/
1538
+ if (item.children && item.children.length) {
1539
+ this.expanded = !this.expanded;
1540
+ }
1541
+ }
1542
+ isActive(item) {
1543
+ let route = this.item.route;
1544
+ if (typeof this.item.route === 'function') {
1545
+ const routefct = this.item.route;
1546
+ route = routefct.call(this);
1547
+ return route ? this.router.isActive(route, true) : false;
1548
+ }
1549
+ }
1550
+ routerLink(item) {
1551
+ let route = this.item.route;
1552
+ if (typeof this.item.route === 'function') {
1553
+ const routefct = this.item.route;
1554
+ route = routefct.call(this);
1555
+ }
1556
+ return route;
1557
+ }
1558
+ }
1559
+ MenuListItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MenuListItemComponent, deps: [{ token: NavService }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
1560
+ MenuListItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: MenuListItemComponent, selector: "gloww-menu-list-item", inputs: { item: "item", depth: "depth" }, host: { properties: { "attr.aria-expanded": "this.ariaExpanded" } }, ngImport: i0, template: "<div class=\"thisMenu\" (click)=\"onItemSelected(item)\">\r\n <a mat-list-item [ngStyle]=\"{'padding-left': (depth * 12) + 'px'}\" [routerLink]=\"routerLink(item)\" [ngClass]=\"{'active': isActive(item), 'expanded': expanded}\" class=\"menu-list-item\">\r\n <mat-icon class=\"routeIcon\"><i [ngClass]=\"item.icon\" [ngStyle]=\"item.iconStyle\"></i></mat-icon> {{item.displayName}}\r\n </a>\r\n <span fxFlex *ngIf=\"item.children && item.children.length\">\r\n <span fxFlex></span>\r\n <mat-icon [@indicatorRotate]=\"expanded ? 'expanded': 'collapsed'\" class=\"expandIcon\">\r\n expand_more\r\n </mat-icon>\r\n </span>\r\n</div>\r\n<div *ngIf=\"expanded\">\r\n <gloww-menu-list-item *ngFor=\"let child of item.children\" [item]=\"child\" [depth]=\"depth+1\">\r\n </gloww-menu-list-item>\r\n</div>\r\n", styles: [".thisMenu{display:flex;flex-direction:row;justify-content:space-between;align-items:center;outline:none;width:calc(100% - 20px);margin:10px}.thisMenu .mat-list-item.active{background-color:#e8eaf6}.thisMenu:hover>.mat-list-item:not(.expanded),.thisMenu:focus>.mat-list-item:not(.expanded){background-color:#c5cae9!important}.mat-list-item{padding:8px 0;display:flex;width:auto}.mat-list-item .routeIcon{margin-right:40px}.routeIcon{margin-right:20px}.expandIcon{cursor:pointer}\n"], components: [{ type: i11.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: MenuListItemComponent, selector: "gloww-menu-list-item", inputs: ["item", "depth"] }], directives: [{ type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], animations: [
1561
+ trigger('indicatorRotate', [
1562
+ state('collapsed', style({ transform: 'rotate(0deg)' })),
1563
+ state('expanded', style({ transform: 'rotate(180deg)' })),
1564
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
1565
+ ])
1566
+ ] });
1567
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: MenuListItemComponent, decorators: [{
1568
+ type: Component,
1569
+ args: [{ selector: 'gloww-menu-list-item', animations: [
1570
+ trigger('indicatorRotate', [
1571
+ state('collapsed', style({ transform: 'rotate(0deg)' })),
1572
+ state('expanded', style({ transform: 'rotate(180deg)' })),
1573
+ transition('expanded <=> collapsed', animate('225ms cubic-bezier(0.4,0.0,0.2,1)')),
1574
+ ])
1575
+ ], template: "<div class=\"thisMenu\" (click)=\"onItemSelected(item)\">\r\n <a mat-list-item [ngStyle]=\"{'padding-left': (depth * 12) + 'px'}\" [routerLink]=\"routerLink(item)\" [ngClass]=\"{'active': isActive(item), 'expanded': expanded}\" class=\"menu-list-item\">\r\n <mat-icon class=\"routeIcon\"><i [ngClass]=\"item.icon\" [ngStyle]=\"item.iconStyle\"></i></mat-icon> {{item.displayName}}\r\n </a>\r\n <span fxFlex *ngIf=\"item.children && item.children.length\">\r\n <span fxFlex></span>\r\n <mat-icon [@indicatorRotate]=\"expanded ? 'expanded': 'collapsed'\" class=\"expandIcon\">\r\n expand_more\r\n </mat-icon>\r\n </span>\r\n</div>\r\n<div *ngIf=\"expanded\">\r\n <gloww-menu-list-item *ngFor=\"let child of item.children\" [item]=\"child\" [depth]=\"depth+1\">\r\n </gloww-menu-list-item>\r\n</div>\r\n", styles: [".thisMenu{display:flex;flex-direction:row;justify-content:space-between;align-items:center;outline:none;width:calc(100% - 20px);margin:10px}.thisMenu .mat-list-item.active{background-color:#e8eaf6}.thisMenu:hover>.mat-list-item:not(.expanded),.thisMenu:focus>.mat-list-item:not(.expanded){background-color:#c5cae9!important}.mat-list-item{padding:8px 0;display:flex;width:auto}.mat-list-item .routeIcon{margin-right:40px}.routeIcon{margin-right:20px}.expandIcon{cursor:pointer}\n"] }]
1576
+ }], ctorParameters: function () { return [{ type: NavService }, { type: i2.Router }]; }, propDecorators: { ariaExpanded: [{
1577
+ type: HostBinding,
1578
+ args: ['attr.aria-expanded']
1579
+ }], item: [{
1580
+ type: Input
1581
+ }], depth: [{
1582
+ type: Input
1583
+ }] } });
1584
+
1585
+ class CodeEditorComponent {
1586
+ constructor() {
1587
+ this._value = null;
1588
+ this.onChange = () => { };
1589
+ this.onTouched = () => { };
1590
+ }
1591
+ get value() {
1592
+ return this._value;
1593
+ }
1594
+ set value(val) {
1595
+ this._value = val;
1596
+ this.onChange(val);
1597
+ this.onTouched();
1598
+ }
1599
+ writeValue(obj) {
1600
+ if (typeof (obj) === 'object') {
1601
+ this.value = JSON.stringify(obj);
1602
+ }
1603
+ else {
1604
+ this.value = obj;
1605
+ }
1606
+ }
1607
+ registerOnChange(fn) {
1608
+ this.onChange = fn;
1609
+ }
1610
+ registerOnTouched(fn) {
1611
+ this.onTouched = fn;
1612
+ }
1613
+ setDisabledState(isDisabled) {
1614
+ //throw new Error('Method not implemented.');
1615
+ }
1616
+ }
1617
+ CodeEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CodeEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1618
+ CodeEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: CodeEditorComponent, selector: "gloww-code-editor", inputs: { _value: ["value", "_value"] }, providers: [
1619
+ {
1620
+ provide: NG_VALUE_ACCESSOR,
1621
+ multi: true,
1622
+ useExisting: CodeEditorComponent
1623
+ }
1624
+ ], ngImport: i0, template: "<ngx-codemirror [(ngModel)]=\"value\" [options]=\"{lineNumbers: true,theme: 'eclipse', indentWithTabs:true,indentUnit: 4,matchBrackets: true, mode: 'text/typescript', fixedGutter:false}\">\r\n</ngx-codemirror>\r\n", styles: [".cm-tab{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);background-position:right;background-repeat:no-repeat}\n"], components: [{ type: i1$4.CodemirrorComponent, selector: "ngx-codemirror", inputs: ["className", "name", "autoFocus", "options", "preserveScrollPosition"], outputs: ["cursorActivity", "focusChange", "scroll", "drop"] }], directives: [{ type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
1625
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: CodeEditorComponent, decorators: [{
1626
+ type: Component,
1627
+ args: [{ selector: 'gloww-code-editor', providers: [
1628
+ {
1629
+ provide: NG_VALUE_ACCESSOR,
1630
+ multi: true,
1631
+ useExisting: CodeEditorComponent
1632
+ }
1633
+ ], template: "<ngx-codemirror [(ngModel)]=\"value\" [options]=\"{lineNumbers: true,theme: 'eclipse', indentWithTabs:true,indentUnit: 4,matchBrackets: true, mode: 'text/typescript', fixedGutter:false}\">\r\n</ngx-codemirror>\r\n", styles: [".cm-tab{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);background-position:right;background-repeat:no-repeat}\n"] }]
1634
+ }], ctorParameters: function () { return []; }, propDecorators: { _value: [{
1635
+ type: Input,
1636
+ args: ['value']
1637
+ }] } });
1638
+
1639
+ class HtmlFormatPipe {
1640
+ constructor(_sanitizer) {
1641
+ this._sanitizer = _sanitizer;
1642
+ }
1643
+ transform(value, ...args) {
1644
+ const newval = value.replace(/(^\s*\w|\.\s\w)/g, m => m.toUpperCase()).replace(/\s\./ig, '').replace(/\s*Nouvelle ligne\s*.\s*/ig, '<br/>').trim();
1645
+ if (!this._sanitizer)
1646
+ return newval;
1647
+ return this._sanitizer.bypassSecurityTrustHtml(newval);
1648
+ }
1649
+ }
1650
+ HtmlFormatPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlFormatPipe, deps: [{ token: i1$1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
1651
+ HtmlFormatPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlFormatPipe, name: "htmlFormat" });
1652
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlFormatPipe, decorators: [{
1653
+ type: Pipe,
1654
+ args: [{
1655
+ name: 'htmlFormat'
1656
+ }]
1657
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }]; } });
1658
+
1659
+ class SocialNetworkComponent {
1660
+ // oAuthAssociations: string[];
1661
+ // oAuthProviders: string[];
1662
+ constructor(authenticationService) {
1663
+ this.authenticationService = authenticationService;
1664
+ this.callback = new EventEmitter();
1665
+ this.icons = {
1666
+ Google: "fa-brands fa-google",
1667
+ LinkedIN: "fa-brands fa-linkedin",
1668
+ Facebook: "fa-brands fa-facebook",
1669
+ Github: "fa-brands fa-github",
1670
+ Amazon: "fa-brands fa-amazon",
1671
+ Apple: "fa-brands fa-apple",
1672
+ Microsoft: "fa-brands fa-microsoft",
1673
+ Twitter: "fa-brands fa-twitter",
1674
+ VK: "fa-brands fa-vk",
1675
+ };
1676
+ // this.authenticationService.getOAuthProviders().subscribe(oap => this.oAuthProviders = oap);
1677
+ // this.authenticationService.getOAuthAssociations().subscribe(oap => this.oAuthAssociations = oap);
1678
+ }
1679
+ ngOnInit() {
1680
+ }
1681
+ execute(provider) {
1682
+ this.callback.emit(provider);
1683
+ }
1684
+ writeobj(provider) {
1685
+ console.log(provider);
1686
+ }
1687
+ }
1688
+ SocialNetworkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SocialNetworkComponent, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
1689
+ SocialNetworkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SocialNetworkComponent, selector: "gloww-social-network", inputs: { oAuthProviders: "oAuthProviders" }, outputs: { callback: "callback" }, ngImport: i0, template: "<div class=\"SocialNetwork\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" *ngIf=\"oAuthProviders\">\r\n <ng-container *ngFor=\"let provider of oAuthProviders\">\r\n <a (click)=\"execute(provider)\">\r\n <i [ngClass]=\"icons[provider.toString()]\"></i>\r\n </a>\r\n </ng-container>\r\n</div>\r\n", styles: [""], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i9$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }] });
1690
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SocialNetworkComponent, decorators: [{
1691
+ type: Component,
1692
+ args: [{ selector: 'gloww-social-network', template: "<div class=\"SocialNetwork\" fxLayout=\"row\" fxLayoutAlign=\"space-between center\" *ngIf=\"oAuthProviders\">\r\n <ng-container *ngFor=\"let provider of oAuthProviders\">\r\n <a (click)=\"execute(provider)\">\r\n <i [ngClass]=\"icons[provider.toString()]\"></i>\r\n </a>\r\n </ng-container>\r\n</div>\r\n", styles: [""] }]
1693
+ }], ctorParameters: function () { return [{ type: AuthenticationService }]; }, propDecorators: { oAuthProviders: [{
1694
+ type: Input
1695
+ }], callback: [{
1696
+ type: Output
1697
+ }] } });
1698
+
1699
+ class LoginComponent {
1700
+ constructor(formBuilder, route, router, authenticationService, config) {
1701
+ this.formBuilder = formBuilder;
1702
+ this.route = route;
1703
+ this.router = router;
1704
+ this.authenticationService = authenticationService;
1705
+ this.loading = false;
1706
+ this.submitted = false;
1707
+ this.error = '';
1708
+ this.showDomain = false;
1709
+ this.state = 1;
1710
+ // redirect to home if already logged in
1711
+ if (this.authenticationService.currentUserValue) {
1712
+ this.router.navigate(['/']);
1713
+ }
1714
+ this.config = config;
1715
+ if (config && config.showDomain) {
1716
+ this.showDomain = config.showDomain;
1717
+ }
1718
+ this.authenticationService.getOAuthProviders().subscribe(oap => this.oAuthProviders = oap);
1719
+ }
1720
+ MatchPassword(fg) {
1721
+ var _a, _b;
1722
+ if (!fg) {
1723
+ return;
1724
+ }
1725
+ return ((_a = fg.get('newpassword')) === null || _a === void 0 ? void 0 : _a.value) === ((_b = fg.get('confirmationPassword')) === null || _b === void 0 ? void 0 : _b.value);
1726
+ }
1727
+ ngOnInit() {
1728
+ const grp = {
1729
+ username: ['', Validators.required],
1730
+ password: ['', Validators.required]
1731
+ };
1732
+ const lostPwd = {
1733
+ email: ['', Validators.required],
1734
+ gsm: [''],
1735
+ firstname: ['', Validators.required],
1736
+ lastname: ['', Validators.required]
1737
+ };
1738
+ const resetPwd = {
1739
+ email: ['', Validators.required],
1740
+ code: ['', Validators.required],
1741
+ newPassword: ['', Validators.required],
1742
+ confirmationPassword: ['', Validators.required]
1743
+ };
1744
+ if (this.showDomain) {
1745
+ grp.domain = [''];
1746
+ }
1747
+ this.loginForm = this.formBuilder.group(grp);
1748
+ this.lostPasswordForm = this.formBuilder.group(lostPwd);
1749
+ this.resetPasswordForm = this.formBuilder.group(resetPwd, { validator: this.MatchPassword });
1750
+ // get return url from route parameters or default to '/'
1751
+ this.returnUrl = this.route.snapshot.queryParams.returnUrl; //|| window.location.search;
1752
+ this.application = this.route.snapshot.queryParams.application; //|| window.location.pathname;
1753
+ console.log(`returnUrl : ${this.returnUrl}`);
1754
+ console.log(`application : ${this.application}`);
1755
+ this.idOauth = this.route.snapshot.queryParams.idOauth;
1756
+ this.provider = this.route.snapshot.queryParams.provider;
1757
+ this.name = this.route.snapshot.queryParams.name;
1758
+ this.value = this.route.snapshot.queryParams.value;
1759
+ if (this.idOauth) {
1760
+ this.state = 4;
1761
+ }
1762
+ }
1763
+ // convenience getter for easy access to form fields
1764
+ get f() { return this.loginForm.controls; }
1765
+ resetError() {
1766
+ this.error = "";
1767
+ }
1768
+ onConnect() {
1769
+ this.submitted = true;
1770
+ this.error = "";
1771
+ // stop here if form is invalid
1772
+ if (this.loginForm.invalid) {
1773
+ return;
1774
+ }
1775
+ this.loading = true;
1776
+ let domain = '';
1777
+ if (this.showDomain) {
1778
+ domain = this.f.domain.value;
1779
+ }
1780
+ this.authenticationService.login(domain, this.f.username.value, this.f.password.value)
1781
+ .pipe(first())
1782
+ .subscribe(data => {
1783
+ console.log(`navigate to ${this.returnUrl}`);
1784
+ this.router.navigate([this.returnUrl]);
1785
+ }, error => {
1786
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1787
+ if ((_a = error.error) === null || _a === void 0 ? void 0 : _a.Code) {
1788
+ switch ((_b = error.error) === null || _b === void 0 ? void 0 : _b.Code) {
1789
+ case 'BADAUTH':
1790
+ this.error = 'Utilisateur inconnu ou mauvais mot de passe. Veuillez vérifier vos identifiants.';
1791
+ break;
1792
+ case 'WEAKPASSWORD':
1793
+ this.error = 'Le mot de passe que vous avez utilisez est trop faible. S\'il s\'agit effectivement de votre mot de passe, veuillez le réinitialiser au moyen de la fonctionnalité "Mot de passe oublié". ';
1794
+ break;
1795
+ case 'BLACKLISTEDIP':
1796
+ this.error = `Trop de tentatives de connexion à partir de cette adresse IP(${(_d = (_c = error.error) === null || _c === void 0 ? void 0 : _c.Params) === null || _d === void 0 ? void 0 : _d.IP}).Vous ne pouvez plus vous connecter à partir de ce poste.`;
1797
+ break;
1798
+ case 'TOOMANYFROMIP':
1799
+ this.error = `Trop de tentatives de connexion, à partir de cette adresse IP(${(_f = (_e = error.error) === null || _e === void 0 ? void 0 : _e.Params) === null || _f === void 0 ? void 0 : _f.IP}).Vous ne pouvez pas réessayer pendant ${(_h = (_g = error.error) === null || _g === void 0 ? void 0 : _g.Params) === null || _h === void 0 ? void 0 : _h.nbrMinutes} minutes.`;
1800
+ break;
1801
+ case 'TOOMANYFORUSERNAME':
1802
+ this.error = `Trop de tentatives de connexion pour cet utilisateur(${(_k = (_j = error.error) === null || _j === void 0 ? void 0 : _j.Params) === null || _k === void 0 ? void 0 : _k.Username}).Vous ne pouvez pas réessayer pendant ${(_m = (_l = error.error) === null || _l === void 0 ? void 0 : _l.Params) === null || _m === void 0 ? void 0 : _m.nbrMinutes} minutes.`;
1803
+ break;
1804
+ }
1805
+ if (!this.error)
1806
+ this.error = error.error.Message;
1807
+ }
1808
+ else {
1809
+ this.error = 'Impossible de se connecter. ';
1810
+ }
1811
+ this.loading = false;
1812
+ });
1813
+ }
1814
+ onAskResetPasswordCode() {
1815
+ var _a;
1816
+ let gsm = this.lostPasswordForm.value.gsm;
1817
+ if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.askGSM)) {
1818
+ gsm = '--noGSM--';
1819
+ }
1820
+ this.authenticationService
1821
+ .askResetPasswordCode('', this.lostPasswordForm.value.firstname, this.lostPasswordForm.value.lastname, this.lostPasswordForm.value.email, gsm)
1822
+ .subscribe(d => { }, error => { });
1823
+ this.state = 3;
1824
+ }
1825
+ onResetPassword() {
1826
+ this.authenticationService
1827
+ .resetPassword(this.resetPasswordForm.value.email, this.resetPasswordForm.value.code, this.resetPasswordForm.value.newPassword)
1828
+ .subscribe(d => { }, error => { });
1829
+ this.state = 1;
1830
+ }
1831
+ OAuthSignIn(provider) {
1832
+ const url = `${window.location.origin}/admin/AuthUsers/OAuth/${provider}/${this.config.environment}?returnUrl=${encodeURI(this.returnUrl)}&application=${encodeURI(this.application)}&loginUrl=${encodeURI(window.location.pathname)}&currentUserVariableName=${this.authenticationService.currentUserVariableName}`;
1833
+ window.location.href = url;
1834
+ }
1835
+ onOAuthAskCode() {
1836
+ this.authenticationService
1837
+ .OAuthAskCode(this.authenticationService.environment, this.resetPasswordForm.value.email, this.idOauth, this.provider, this.name, this.value)
1838
+ .subscribe(d => {
1839
+ this.state = 5;
1840
+ }, error => { });
1841
+ }
1842
+ onOAuthAssociation() {
1843
+ this.authenticationService
1844
+ .OAuthAssociation(this.authenticationService.environment, this.resetPasswordForm.value.code, this.idOauth, this.provider, this.name, this.value)
1845
+ .subscribe(user => {
1846
+ console.log(user);
1847
+ window.location.href = this.returnUrl;
1848
+ }, error => { });
1849
+ }
1850
+ }
1851
+ LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LoginComponent, deps: [{ token: i1$3.FormBuilder }, { token: i2.ActivatedRoute }, { token: i2.Router }, { token: AuthenticationService }, { token: AuthenticationServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1852
+ LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: LoginComponent, selector: "gloww-login", ngImport: i0, template: "<div class=\"login-wrapper\" fxLayout=\"row\" fxLayoutAlign=\"center center\" style=\"height:100%\">\r\n\r\n <mat-card>\r\n <mat-card-header>\r\n <mat-card-title>Connexion</mat-card-title>\r\n </mat-card-header>\r\n\r\n <form class=\"example-form\" [formGroup]=\"loginForm\" (ngSubmit)=\"onConnect()\" *ngIf=\"state==1\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" *ngIf=\"showDomain\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Domain\" formControlName=\"domain\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Username\" formControlName=\"username\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Password\" formControlName=\"password\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\" fxLayoutGap=\"20px\">\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Me Connecter</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=2; resetError();\">Mot de passe\r\n oubli\u00E9</button>\r\n </div>\r\n <br />\r\n <gloww-social-network (callback)=\"OAuthSignIn($event)\" [oAuthProviders]=\"oAuthProviders\"></gloww-social-network>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"lostPasswordForm\" (ngSubmit)=\"onAskResetPasswordCode()\" *ngIf=\"state==2\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" *ngIf=\"showDomain\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Domain\" formControlName=\"domain\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Pr\u00E9nom\" formControlName=\"firstname\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Nom\" formControlName=\"lastname\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\" *ngIf=\"config?.askGSM\">\r\n <input matInput placeholder=\"Mobile\" formControlName=\"gsm\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Demande de\r\n r\u00E9initialisation</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=3\">J'ai un\r\n code</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onResetPassword()\" *ngIf=\"state==3\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Code\" formControlName=\"code\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Password\" formControlName=\"newPassword\" type=\"password\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Confirmation\" formControlName=\"confirmationPassword\" type=\"password\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">R\u00E9initialiser</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=1\">J'ai retrouv\u00E9 mon mot de\r\n passe</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onOAuthAskCode()\" *ngIf=\"state==4\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span fxFlex=\"100%\">Entrez l'adresse associ\u00E9e \u00E0 votre compte. Vous recevrez un code par email.</span>\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Obtenir code</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onOAuthAssociation()\" *ngIf=\"state==5\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span fxFlex=\"100%\">Faites un copier/coller du code re\u00E7u par mail</span>\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Code\" formControlName=\"code\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Associer</button>\r\n </form>\r\n </mat-card>\r\n</div>", styles: ["html,body{height:100%;margin:0;padding:0}body{background-image:url(https://lh4.googleusercontent.com/-XplyTa1Za-I/VMSgIyAYkHI/AAAAAAAADxM/oL-rD6VP4ts/w1184-h666/Android-Lollipop-wallpapers-Google-Now-Wallpaper-2.png);background-position:center;background-size:cover;background-repeat:no-repeat;min-height:100vh;font-family:Roboto,sans-serif}.app-header{justify-content:space-between;position:fixed;top:0;left:0;right:0;z-index:2;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.positronx{text-decoration:none;color:#fff}.box{position:relative;top:0;opacity:1;float:left;padding:60px 50px 40px;width:100%;background:#fff;border-radius:10px;transform:scale(1);-webkit-transform:scale(1);-ms-transform:scale(1);z-index:5;max-width:330px}.box.back{transform:scale(.95);-webkit-transform:scale(.95);-ms-transform:scale(.95);top:-20px;opacity:.8;z-index:-1}.box:before{content:\"\";width:100%;height:30px;border-radius:10px;position:absolute;top:-10px;background:rgba(255,255,255,.6);left:0;transform:scale(.95);-webkit-transform:scale(.95);-ms-transform:scale(.95);z-index:-1}.login-wrapper{height:100%}.login-wrapper mat-card-header{text-align:center;width:100%;display:block;font-weight:700}.login-wrapper mat-card-header mat-card-title{font-size:30px;margin:0}.login-wrapper .mat-card{padding:40px 70px 50px}.login-wrapper .mat-stroked-button{border:1px solid currentColor;background:#FFF7FA}.login-wrapper .mat-form-field-appearance-legacy .mat-form-field-infix{padding:.8375em 0}.SocialNetwork a{margin:10px}.SocialNetwork a i{border:1;padding:10px}\n"], components: [{ type: i5$1.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i5$1.MatCardHeader, selector: "mat-card-header" }, { type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: SocialNetworkComponent, selector: "gloww-social-network", inputs: ["oAuthProviders"], outputs: ["callback"] }], directives: [{ type: i9$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i9$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i5$1.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$1.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i9$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i9$1.DefaultLayoutGapDirective, selector: " [fxLayoutGap], [fxLayoutGap.xs], [fxLayoutGap.sm], [fxLayoutGap.md], [fxLayoutGap.lg], [fxLayoutGap.xl], [fxLayoutGap.lt-sm], [fxLayoutGap.lt-md], [fxLayoutGap.lt-lg], [fxLayoutGap.lt-xl], [fxLayoutGap.gt-xs], [fxLayoutGap.gt-sm], [fxLayoutGap.gt-md], [fxLayoutGap.gt-lg]", inputs: ["fxLayoutGap", "fxLayoutGap.xs", "fxLayoutGap.sm", "fxLayoutGap.md", "fxLayoutGap.lg", "fxLayoutGap.xl", "fxLayoutGap.lt-sm", "fxLayoutGap.lt-md", "fxLayoutGap.lt-lg", "fxLayoutGap.lt-xl", "fxLayoutGap.gt-xs", "fxLayoutGap.gt-sm", "fxLayoutGap.gt-md", "fxLayoutGap.gt-lg"] }] });
1853
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: LoginComponent, decorators: [{
1854
+ type: Component,
1855
+ args: [{ selector: 'gloww-login', template: "<div class=\"login-wrapper\" fxLayout=\"row\" fxLayoutAlign=\"center center\" style=\"height:100%\">\r\n\r\n <mat-card>\r\n <mat-card-header>\r\n <mat-card-title>Connexion</mat-card-title>\r\n </mat-card-header>\r\n\r\n <form class=\"example-form\" [formGroup]=\"loginForm\" (ngSubmit)=\"onConnect()\" *ngIf=\"state==1\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" *ngIf=\"showDomain\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Domain\" formControlName=\"domain\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Username\" formControlName=\"username\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Password\" formControlName=\"password\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <div fxLayout=\"row\" fxLayoutAlign=\"end center\" fxLayoutGap=\"20px\">\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Me Connecter</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=2; resetError();\">Mot de passe\r\n oubli\u00E9</button>\r\n </div>\r\n <br />\r\n <gloww-social-network (callback)=\"OAuthSignIn($event)\" [oAuthProviders]=\"oAuthProviders\"></gloww-social-network>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"lostPasswordForm\" (ngSubmit)=\"onAskResetPasswordCode()\" *ngIf=\"state==2\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" *ngIf=\"showDomain\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Domain\" formControlName=\"domain\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Pr\u00E9nom\" formControlName=\"firstname\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Nom\" formControlName=\"lastname\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\" *ngIf=\"config?.askGSM\">\r\n <input matInput placeholder=\"Mobile\" formControlName=\"gsm\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Demande de\r\n r\u00E9initialisation</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=3\">J'ai un\r\n code</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onResetPassword()\" *ngIf=\"state==3\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Code\" formControlName=\"code\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Password\" formControlName=\"newPassword\" type=\"password\">\r\n </mat-form-field>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Confirmation\" formControlName=\"confirmationPassword\" type=\"password\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">R\u00E9initialiser</button>\r\n <button mat-stroked-button color=\"primary\" class=\"btn-block\" (click)=\"state=1\">J'ai retrouv\u00E9 mon mot de\r\n passe</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onOAuthAskCode()\" *ngIf=\"state==4\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span fxFlex=\"100%\">Entrez l'adresse associ\u00E9e \u00E0 votre compte. Vous recevrez un code par email.</span>\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Email\" formControlName=\"email\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Obtenir code</button>\r\n </form>\r\n <form class=\"example-form\" [formGroup]=\"resetPasswordForm\" (ngSubmit)=\"onOAuthAssociation()\" *ngIf=\"state==5\">\r\n <mat-card-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <span fxFlex=\"100%\">Faites un copier/coller du code re\u00E7u par mail</span>\r\n <span style=\"color:red; font-weight:bold;\" *ngIf=\"error\" fxFlex=\"100%\">{{error}}</span>\r\n <mat-form-field class=\"example-full-width\" fxFlex=\"100%\">\r\n <input matInput placeholder=\"Code\" formControlName=\"code\">\r\n </mat-form-field>\r\n </div>\r\n </mat-card-content>\r\n <button mat-raised-button color=\"primary\" class=\"btn-block\" type=\"submit\">Associer</button>\r\n </form>\r\n </mat-card>\r\n</div>", styles: ["html,body{height:100%;margin:0;padding:0}body{background-image:url(https://lh4.googleusercontent.com/-XplyTa1Za-I/VMSgIyAYkHI/AAAAAAAADxM/oL-rD6VP4ts/w1184-h666/Android-Lollipop-wallpapers-Google-Now-Wallpaper-2.png);background-position:center;background-size:cover;background-repeat:no-repeat;min-height:100vh;font-family:Roboto,sans-serif}.app-header{justify-content:space-between;position:fixed;top:0;left:0;right:0;z-index:2;box-shadow:0 3px 5px -1px #0003,0 6px 10px #00000024,0 1px 18px #0000001f}.positronx{text-decoration:none;color:#fff}.box{position:relative;top:0;opacity:1;float:left;padding:60px 50px 40px;width:100%;background:#fff;border-radius:10px;transform:scale(1);-webkit-transform:scale(1);-ms-transform:scale(1);z-index:5;max-width:330px}.box.back{transform:scale(.95);-webkit-transform:scale(.95);-ms-transform:scale(.95);top:-20px;opacity:.8;z-index:-1}.box:before{content:\"\";width:100%;height:30px;border-radius:10px;position:absolute;top:-10px;background:rgba(255,255,255,.6);left:0;transform:scale(.95);-webkit-transform:scale(.95);-ms-transform:scale(.95);z-index:-1}.login-wrapper{height:100%}.login-wrapper mat-card-header{text-align:center;width:100%;display:block;font-weight:700}.login-wrapper mat-card-header mat-card-title{font-size:30px;margin:0}.login-wrapper .mat-card{padding:40px 70px 50px}.login-wrapper .mat-stroked-button{border:1px solid currentColor;background:#FFF7FA}.login-wrapper .mat-form-field-appearance-legacy .mat-form-field-infix{padding:.8375em 0}.SocialNetwork a{margin:10px}.SocialNetwork a i{border:1;padding:10px}\n"] }]
1856
+ }], ctorParameters: function () {
1857
+ return [{ type: i1$3.FormBuilder }, { type: i2.ActivatedRoute }, { type: i2.Router }, { type: AuthenticationService }, { type: AuthenticationServiceConfig, decorators: [{
1858
+ type: Optional
1859
+ }] }];
1860
+ } });
1861
+
1862
+ class JwtInterceptor {
1863
+ constructor(authenticationService) {
1864
+ this.authenticationService = authenticationService;
1865
+ }
1866
+ intercept(request, next) {
1867
+ // add authorization header with jwt token if available
1868
+ try {
1869
+ const currentUser = this.authenticationService.currentUserValue;
1870
+ if (currentUser && currentUser.Token) {
1871
+ request = request.clone({
1872
+ setHeaders: {
1873
+ Authorization: `Bearer ${currentUser.Token}`
1874
+ }
1875
+ });
1876
+ }
1877
+ }
1878
+ catch (e) {
1879
+ console.log(`jwt interceptor ${e}`);
1880
+ }
1881
+ return next.handle(request);
1882
+ }
1883
+ }
1884
+ JwtInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: JwtInterceptor, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
1885
+ JwtInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: JwtInterceptor });
1886
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: JwtInterceptor, decorators: [{
1887
+ type: Injectable
1888
+ }], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
1889
+
1890
+ class ErrorInterceptor {
1891
+ constructor(authenticationService) {
1892
+ this.authenticationService = authenticationService;
1893
+ }
1894
+ intercept(request, next) {
1895
+ return next.handle(request).pipe(catchError(err => {
1896
+ if (err.status === 401) {
1897
+ // auto logout if 401 response returned from api
1898
+ this.authenticationService.logout();
1899
+ location.reload();
1900
+ }
1901
+ const error = err.error ? (err.error.message || err.StatusText) : err.statusText;
1902
+ if (console)
1903
+ console.log(err);
1904
+ return throwError(err);
1905
+ }));
1906
+ }
1907
+ }
1908
+ ErrorInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ErrorInterceptor, deps: [{ token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Injectable });
1909
+ ErrorInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ErrorInterceptor });
1910
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ErrorInterceptor, decorators: [{
1911
+ type: Injectable
1912
+ }], ctorParameters: function () { return [{ type: AuthenticationService }]; } });
1913
+
1914
+ class ChangePasswordDlgComponent {
1915
+ constructor(formBuilder, dialogRef, authenticationService) {
1916
+ this.formBuilder = formBuilder;
1917
+ this.dialogRef = dialogRef;
1918
+ this.authenticationService = authenticationService;
1919
+ this.form = this.formBuilder.group({
1920
+ oldpassword: ['', Validators.required],
1921
+ newpassword: ['', Validators.required],
1922
+ confirmationpassword: ['', Validators.required]
1923
+ }, { validator: c => c.get('newpassword').value === c.get('confirmationpassword').value });
1924
+ }
1925
+ ngOnInit() {
1926
+ }
1927
+ resetError() {
1928
+ this.error = '';
1929
+ }
1930
+ onSubmit() {
1931
+ this.resetError();
1932
+ if (this.form.invalid) {
1933
+ return;
1934
+ }
1935
+ const user = this.authenticationService.currentUserValue;
1936
+ this.authenticationService.changePassword('', user.username, this.form.value.oldpassword, this.form.value.newpassword).subscribe(r => this.dialogRef.close(true), error => {
1937
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1938
+ switch ((_a = error.error) === null || _a === void 0 ? void 0 : _a.Code) {
1939
+ case 'COMPLEXITY':
1940
+ this.error = 'Le mot de passe souhaitez n\'est pas suffisamment complexe. Veuillez utiliser un mot de passe long (8 caractères minimum) combinant des majuscules, minuscules, chiffres et caractères spéciaux.';
1941
+ break;
1942
+ case 'BADAUTH':
1943
+ this.error = 'Utilisateur inconnu ou mauvais mot de passe. Veuillez vérifier vos identifiants.';
1944
+ break;
1945
+ case 'WEAKPASSWORD':
1946
+ this.error = 'Le mot de passe que vous avez utilisez est trop faible. S\'il s\'agit effectivement de votre mot de passe, veuillez le réinitialiser au moyen de la fonctionnalité "Mot de passe oublié". ';
1947
+ break;
1948
+ case 'BLACKLISTEDIP':
1949
+ this.error = `Trop de tentatives de connexion à partir de cette adresse IP (${(_c = (_b = error.error) === null || _b === void 0 ? void 0 : _b.Params) === null || _c === void 0 ? void 0 : _c.IP}). Vous ne pouvez plus vous connecter à partir de ce poste.`;
1950
+ break;
1951
+ case 'TOOMANYFROMIP':
1952
+ this.error = `Trop de tentatives de connexion, à partir de cette adresse IP (${(_e = (_d = error.error) === null || _d === void 0 ? void 0 : _d.Params) === null || _e === void 0 ? void 0 : _e.IP}). Vous ne pouvez pas réessayer pendant ${(_g = (_f = error.error) === null || _f === void 0 ? void 0 : _f.Params) === null || _g === void 0 ? void 0 : _g.nbrMinutes} minutes.`;
1953
+ break;
1954
+ case 'TOOMANYFORUSERNAME':
1955
+ this.error = `Trop de tentatives de connexion pour cet utilisateur (${(_j = (_h = error.error) === null || _h === void 0 ? void 0 : _h.Params) === null || _j === void 0 ? void 0 : _j.Username}). Vous ne pouvez pas réessayer pendant ${(_l = (_k = error.error) === null || _k === void 0 ? void 0 : _k.Params) === null || _l === void 0 ? void 0 : _l.nbrMinutes} minutes.`;
1956
+ break;
1957
+ }
1958
+ this.error = error.error.Message;
1959
+ });
1960
+ }
1961
+ cancel() {
1962
+ this.dialogRef.close();
1963
+ }
1964
+ }
1965
+ ChangePasswordDlgComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ChangePasswordDlgComponent, deps: [{ token: i1$3.FormBuilder }, { token: i1$2.MatDialogRef }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
1966
+ ChangePasswordDlgComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: ChangePasswordDlgComponent, selector: "gloww-change-password-dlg", ngImport: i0, template: "<h2 mat-dialog-title>Change Password</h2>\r\n<form class=\"example-form\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <mat-dialog-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <div style=\"color:red; font-weight:bold;\" fxFlex=\"100%\">{{error}}</div>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"Old Password\" formControlName=\"oldpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"New Password\" formControlName=\"newpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"Confirmation\" formControlName=\"confirmationpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" type=\"submit\" [disabled]=\"form.invalid\">Change\r\n Password</button>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" (click)=\"cancel()\">Cancel</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [""], components: [{ type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$3.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i9$1.DefaultLayoutDirective, selector: " [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md], [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md], [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm], [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { type: i9$1.DefaultLayoutAlignDirective, selector: " [fxLayoutAlign], [fxLayoutAlign.xs], [fxLayoutAlign.sm], [fxLayoutAlign.md], [fxLayoutAlign.lg], [fxLayoutAlign.xl], [fxLayoutAlign.lt-sm], [fxLayoutAlign.lt-md], [fxLayoutAlign.lt-lg], [fxLayoutAlign.lt-xl], [fxLayoutAlign.gt-xs], [fxLayoutAlign.gt-sm], [fxLayoutAlign.gt-md], [fxLayoutAlign.gt-lg]", inputs: ["fxLayoutAlign", "fxLayoutAlign.xs", "fxLayoutAlign.sm", "fxLayoutAlign.md", "fxLayoutAlign.lg", "fxLayoutAlign.xl", "fxLayoutAlign.lt-sm", "fxLayoutAlign.lt-md", "fxLayoutAlign.lt-lg", "fxLayoutAlign.lt-xl", "fxLayoutAlign.gt-xs", "fxLayoutAlign.gt-sm", "fxLayoutAlign.gt-md", "fxLayoutAlign.gt-lg"] }, { type: i9$1.DefaultFlexDirective, selector: " [fxFlex], [fxFlex.xs], [fxFlex.sm], [fxFlex.md], [fxFlex.lg], [fxFlex.xl], [fxFlex.lt-sm], [fxFlex.lt-md], [fxFlex.lt-lg], [fxFlex.lt-xl], [fxFlex.gt-xs], [fxFlex.gt-sm], [fxFlex.gt-md], [fxFlex.gt-lg]", inputs: ["fxFlex", "fxFlex.xs", "fxFlex.sm", "fxFlex.md", "fxFlex.lg", "fxFlex.xl", "fxFlex.lt-sm", "fxFlex.lt-md", "fxFlex.lt-lg", "fxFlex.lt-xl", "fxFlex.gt-xs", "fxFlex.gt-sm", "fxFlex.gt-md", "fxFlex.gt-lg"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
1967
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: ChangePasswordDlgComponent, decorators: [{
1968
+ type: Component,
1969
+ args: [{ selector: 'gloww-change-password-dlg', template: "<h2 mat-dialog-title>Change Password</h2>\r\n<form class=\"example-form\" [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\r\n <mat-dialog-content>\r\n <div fxLayout=\"row wrap\" fxLayoutAlign=\"space-between center\">\r\n <div style=\"color:red; font-weight:bold;\" fxFlex=\"100%\">{{error}}</div>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"Old Password\" formControlName=\"oldpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"New Password\" formControlName=\"newpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n <mat-form-field fxFlex=\"100%\">\r\n <input matInput placeholder=\"Confirmation\" formControlName=\"confirmationpassword\" type=\"password\" (change)=\"resetError()\">\r\n </mat-form-field>\r\n </div>\r\n </mat-dialog-content>\r\n <mat-dialog-actions>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" type=\"submit\" [disabled]=\"form.invalid\">Change\r\n Password</button>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" (click)=\"cancel()\">Cancel</button>\r\n </mat-dialog-actions>\r\n</form>", styles: [""] }]
1970
+ }], ctorParameters: function () { return [{ type: i1$3.FormBuilder }, { type: i1$2.MatDialogRef }, { type: AuthenticationService }]; } });
1971
+
1972
+ class SocialNetworkDlgComponent {
1973
+ constructor(dialogRef, authenticationService, dialog, config) {
1974
+ this.dialogRef = dialogRef;
1975
+ this.authenticationService = authenticationService;
1976
+ this.dialog = dialog;
1977
+ this.config = config;
1978
+ this.authenticationService.getOAuthProviders().subscribe(oap => this.oAuthProviders = oap);
1979
+ this.authenticationService.getOAuthAssociations().subscribe(oap => {
1980
+ this.oAuthAssociations = oap; //oap.map(item => Object.assign(new Oauthassociation(), item));
1981
+ });
1982
+ }
1983
+ ngOnInit() {
1984
+ }
1985
+ OK() {
1986
+ this.dialogRef.close();
1987
+ }
1988
+ OAuthAddAssociation(provider) {
1989
+ const url = `${window.location.origin}/admin/AuthUsers/OAuth/${provider}/${this.config.environment}`;
1990
+ window.location.href = url;
1991
+ }
1992
+ OAuthDeleteAssociation(association) {
1993
+ this.authenticationService.OAuthDeleteAssociation(association.provider, association.idOAuth).subscribe(result => {
1994
+ alert("Association supprimée");
1995
+ const index = this.oAuthAssociations.indexOf(association, 0);
1996
+ if (index >= 0) {
1997
+ this.oAuthAssociations.splice(index, 1);
1998
+ }
1999
+ else {
2000
+ alert("unable to delete item");
2001
+ }
2002
+ //this.oAuthAssociations.find(a => a === association
2003
+ }, error => {
2004
+ alert('Impossible d\'effacer l\'association');
2005
+ });
2006
+ }
2007
+ }
2008
+ SocialNetworkDlgComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SocialNetworkDlgComponent, deps: [{ token: i1$2.MatDialogRef }, { token: AuthenticationService }, { token: i1$2.MatDialog }, { token: AuthenticationServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Component });
2009
+ SocialNetworkDlgComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SocialNetworkDlgComponent, selector: "gloww-social-network-dlg", ngImport: i0, template: "<h2 mat-dialog-title>Gestion des identifications par r\u00E9seaux sociaux</h2>\r\n<mat-dialog-content>\r\n <h3>Associations \u00E9tablies</h3>\r\n <p>Choisissez l'association que vous souhaitez supprimer</p>\r\n <gloww-social-network (callback)=\"OAuthDeleteAssociation($event)\" [oAuthProviders]=\"oAuthAssociations\"></gloww-social-network>\r\n <h3>Nouvelle association</h3>\r\n <p>Choisissez le provider</p>\r\n <gloww-social-network (callback)=\"OAuthAddAssociation($event)\" [oAuthProviders]=\"oAuthProviders\"></gloww-social-network>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" (click)=\"OK() \">OK</button>\r\n</mat-dialog-actions>", styles: [""], components: [{ type: SocialNetworkComponent, selector: "gloww-social-network", inputs: ["oAuthProviders"], outputs: ["callback"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
2010
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SocialNetworkDlgComponent, decorators: [{
2011
+ type: Component,
2012
+ args: [{ selector: 'gloww-social-network-dlg', template: "<h2 mat-dialog-title>Gestion des identifications par r\u00E9seaux sociaux</h2>\r\n<mat-dialog-content>\r\n <h3>Associations \u00E9tablies</h3>\r\n <p>Choisissez l'association que vous souhaitez supprimer</p>\r\n <gloww-social-network (callback)=\"OAuthDeleteAssociation($event)\" [oAuthProviders]=\"oAuthAssociations\"></gloww-social-network>\r\n <h3>Nouvelle association</h3>\r\n <p>Choisissez le provider</p>\r\n <gloww-social-network (callback)=\"OAuthAddAssociation($event)\" [oAuthProviders]=\"oAuthProviders\"></gloww-social-network>\r\n</mat-dialog-content>\r\n<mat-dialog-actions>\r\n <button mat-stroked-button color=\"accent\" class=\"btn-block\" (click)=\"OK() \">OK</button>\r\n</mat-dialog-actions>", styles: [""] }]
2013
+ }], ctorParameters: function () {
2014
+ return [{ type: i1$2.MatDialogRef }, { type: AuthenticationService }, { type: i1$2.MatDialog }, { type: AuthenticationServiceConfig, decorators: [{
2015
+ type: Optional
2016
+ }] }];
2017
+ } });
2018
+
2019
+ class UserMenuComponent {
2020
+ constructor(authenticationService, dialog, router) {
2021
+ this.authenticationService = authenticationService;
2022
+ this.dialog = dialog;
2023
+ this.router = router;
2024
+ this.size = '1x';
2025
+ this.imageUser = null;
2026
+ this.loginpage = '';
2027
+ this.showMenuUser = false;
2028
+ this.connected = false;
2029
+ const person = this.authenticationService.currentUserValue;
2030
+ if (person && person.UserInfo) {
2031
+ this.connected = true;
2032
+ if (person.UserInfo.Picture) {
2033
+ this.imageUser = '/' + authenticationService.environment + '/' + person.UserInfo.Picture;
2034
+ }
2035
+ }
2036
+ this.authenticationService.getOAuthProviders().subscribe(oap => this.oAuthProviders = oap);
2037
+ }
2038
+ ngOnInit() {
2039
+ }
2040
+ Logout() {
2041
+ this.showMenuUser = false;
2042
+ this.authenticationService.logout();
2043
+ this.router.navigate(['/']);
2044
+ }
2045
+ ChangePassword() {
2046
+ this.showMenuUser = true;
2047
+ const dialogConfig = new MatDialogConfig();
2048
+ dialogConfig.disableClose = true;
2049
+ dialogConfig.autoFocus = true;
2050
+ dialogConfig.closeOnNavigation = false;
2051
+ this.dialog.open(ChangePasswordDlgComponent, dialogConfig).afterClosed().subscribe(result => {
2052
+ if (result) {
2053
+ alert('Password Changed');
2054
+ }
2055
+ });
2056
+ }
2057
+ toggleMenuUser() {
2058
+ this.showMenuUser = !this.showMenuUser;
2059
+ }
2060
+ Configuration() {
2061
+ const dialogConfig = new MatDialogConfig();
2062
+ dialogConfig.disableClose = true;
2063
+ dialogConfig.autoFocus = true;
2064
+ dialogConfig.closeOnNavigation = false;
2065
+ this.dialog.open(SocialNetworkDlgComponent, dialogConfig).afterClosed().subscribe(result => {
2066
+ });
2067
+ }
2068
+ }
2069
+ UserMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UserMenuComponent, deps: [{ token: AuthenticationService }, { token: i1$2.MatDialog }, { token: i2.Router }], target: i0.ɵɵFactoryTarget.Component });
2070
+ UserMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: UserMenuComponent, selector: "gloww-user-menu", inputs: { size: "size", imageUser: "imageUser", loginpage: "loginpage" }, ngImport: i0, template: "<div *ngIf=\"connected\">\r\n <span (click)=\"toggleMenuUser()\">\r\n <img [src]=\"imageUser\" style=\"height:40px;float:left; padding-left:20px\" *ngIf=\"imageUser\" />\r\n <i [ngClass]=\"'fal fa-user '+size\" *ngIf=\"!imageUser\" style=\"float:left; padding-left:10px\">\r\n <!--[size]=\"size\"-->\r\n </i>\r\n </span>\r\n <div class=\"menuUser\" *ngIf=\"showMenuUser\">\r\n <ul class=\"menuSec\" style=\"border: solid lightgrey;\">\r\n <li (click)=\"ChangePassword()\">\r\n <i class=\"fal fa-key-skeleton\"></i>Change Password\r\n </li>\r\n <li (click)=\"Configuration()\" *ngIf=\"oAuthProviders && oAuthProviders.length\">\r\n <i class=\"fal fa-tools\"></i>Configuration\r\n </li>\r\n <li (click)=\"Logout()\">\r\n <i class=\"fal fa-sign-out\"></i>D\u00E9connexion\r\n </li>\r\n </ul>\r\n </div>\r\n</div>\r\n<div *ngIf=\"!connected && loginpage\">\r\n <span style=\"height:40px;float:left; padding-left:20px\" [routerLink]=\"loginpage\">Connexion</span>\r\n</div>\r\n", styles: [".menuUser{position:relative}.menuUser ul{text-align:left;position:absolute;top:30px;left:-115px;width:150px;padding:10px;z-index:20;background-color:#fff;font-size:13px;color:#000}.menuUser ul li{height:30px;list-style-type:none}.menuUser ul li i{padding-right:10px;height:30px}ul.menuSec li{cursor:pointer}\n"], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i4.DefaultClassDirective, selector: " [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl], [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl], [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { type: i2.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
2071
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: UserMenuComponent, decorators: [{
2072
+ type: Component,
2073
+ args: [{ selector: 'gloww-user-menu', template: "<div *ngIf=\"connected\">\r\n <span (click)=\"toggleMenuUser()\">\r\n <img [src]=\"imageUser\" style=\"height:40px;float:left; padding-left:20px\" *ngIf=\"imageUser\" />\r\n <i [ngClass]=\"'fal fa-user '+size\" *ngIf=\"!imageUser\" style=\"float:left; padding-left:10px\">\r\n <!--[size]=\"size\"-->\r\n </i>\r\n </span>\r\n <div class=\"menuUser\" *ngIf=\"showMenuUser\">\r\n <ul class=\"menuSec\" style=\"border: solid lightgrey;\">\r\n <li (click)=\"ChangePassword()\">\r\n <i class=\"fal fa-key-skeleton\"></i>Change Password\r\n </li>\r\n <li (click)=\"Configuration()\" *ngIf=\"oAuthProviders && oAuthProviders.length\">\r\n <i class=\"fal fa-tools\"></i>Configuration\r\n </li>\r\n <li (click)=\"Logout()\">\r\n <i class=\"fal fa-sign-out\"></i>D\u00E9connexion\r\n </li>\r\n </ul>\r\n </div>\r\n</div>\r\n<div *ngIf=\"!connected && loginpage\">\r\n <span style=\"height:40px;float:left; padding-left:20px\" [routerLink]=\"loginpage\">Connexion</span>\r\n</div>\r\n", styles: [".menuUser{position:relative}.menuUser ul{text-align:left;position:absolute;top:30px;left:-115px;width:150px;padding:10px;z-index:20;background-color:#fff;font-size:13px;color:#000}.menuUser ul li{height:30px;list-style-type:none}.menuUser ul li i{padding-right:10px;height:30px}ul.menuSec li{cursor:pointer}\n"] }]
2074
+ }], ctorParameters: function () { return [{ type: AuthenticationService }, { type: i1$2.MatDialog }, { type: i2.Router }]; }, propDecorators: { size: [{
2075
+ type: Input
2076
+ }], imageUser: [{
2077
+ type: Input
2078
+ }], loginpage: [{
2079
+ type: Input
2080
+ }] } });
2081
+
2082
+ class StagingInterceptor {
2083
+ constructor() { }
2084
+ intercept(request, next) {
2085
+ // add authorization header with jwt token if available
2086
+ try {
2087
+ if (!request.url.match(/version\.json(\?|$)/ig)) {
2088
+ console.log(`Replace ${request.url}`);
2089
+ return next.handle(request.clone({ url: request.url.replace("__Staging", "") }));
2090
+ }
2091
+ }
2092
+ catch (e) {
2093
+ console.log(`staging interceptor ${e}`);
2094
+ }
2095
+ return next.handle(request);
2096
+ }
2097
+ }
2098
+ StagingInterceptor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StagingInterceptor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2099
+ StagingInterceptor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StagingInterceptor });
2100
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: StagingInterceptor, decorators: [{
2101
+ type: Injectable
2102
+ }], ctorParameters: function () { return []; } });
2103
+
2104
+ class AuthGuard {
2105
+ constructor(router, authenticationService, platformLocation
2106
+ //@Inject(APP_BASE_HREF) baseHref: string
2107
+ ) {
2108
+ this.router = router;
2109
+ this.authenticationService = authenticationService;
2110
+ this.platformLocation = platformLocation;
2111
+ this.baseHref = null;
2112
+ this.baseHref = platformLocation.getBaseHrefFromDOM();
2113
+ }
2114
+ canActivate(route, state) {
2115
+ const currentUser = this.authenticationService.currentUserValue;
2116
+ if (currentUser) {
2117
+ // logged in so return true
2118
+ const jwtToken = jwt_decode(currentUser.Token);
2119
+ if (Date.now() < jwtToken.exp * 1000) {
2120
+ return true;
2121
+ }
2122
+ else {
2123
+ this.authenticationService.logout();
2124
+ }
2125
+ }
2126
+ const vd = window.location.pathname;
2127
+ if (vd.endsWith("/login")) {
2128
+ return true;
2129
+ }
2130
+ console.log(window.location);
2131
+ console.log(route);
2132
+ console.log(state);
2133
+ console.log(state.url);
2134
+ console.log(window.location.search);
2135
+ console.log(window.location.pathname);
2136
+ const returnUrl = window.location.pathname.substr(this.baseHref.length);
2137
+ //let application = window.location.pathname.substr(0, window.location.pathname.length - state.url.length);
2138
+ /*if (state.url === '/') {
2139
+ application = window.location.pathname.endsWith("/") ? application.substr(0, window.location.pathname.length - 1) : window.location.pathname;
2140
+ }
2141
+ if (!application) { application = '/'; }
2142
+ console.log(application);*/
2143
+ // not logged in so redirect to login page with the return url
2144
+ this.router.navigate(['/login'], { queryParams: { returnUrl: `${returnUrl}${window.location.search}`, application: `${this.baseHref}` } });
2145
+ return false;
2146
+ }
2147
+ }
2148
+ AuthGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthGuard, deps: [{ token: i2.Router }, { token: AuthenticationService }, { token: i3.PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable });
2149
+ AuthGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthGuard, providedIn: 'root' });
2150
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AuthGuard, decorators: [{
2151
+ type: Injectable,
2152
+ args: [{ providedIn: 'root' }]
2153
+ }], ctorParameters: function () { return [{ type: i2.Router }, { type: AuthenticationService }, { type: i3.PlatformLocation }]; } });
2154
+
2155
+ class AdministratorGuard {
2156
+ constructor(router, authenticationService, platformLocation
2157
+ //@Inject(APP_BASE_HREF) baseHref: string
2158
+ ) {
2159
+ this.router = router;
2160
+ this.authenticationService = authenticationService;
2161
+ this.platformLocation = platformLocation;
2162
+ }
2163
+ canActivate(route, state) {
2164
+ const currentUser = this.authenticationService.currentUserValue.UserInfo;
2165
+ return currentUser.IsAdministrator || currentUser.isAdministrator;
2166
+ }
2167
+ }
2168
+ AdministratorGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AdministratorGuard, deps: [{ token: i2.Router }, { token: AuthenticationService }, { token: i3.PlatformLocation }], target: i0.ɵɵFactoryTarget.Injectable });
2169
+ AdministratorGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AdministratorGuard, providedIn: 'root' });
2170
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: AdministratorGuard, decorators: [{
2171
+ type: Injectable,
2172
+ args: [{
2173
+ providedIn: 'root'
2174
+ }]
2175
+ }], ctorParameters: function () { return [{ type: i2.Router }, { type: AuthenticationService }, { type: i3.PlatformLocation }]; } });
2176
+
2177
+ class GlowwSecurityModule {
2178
+ static forRoot(authenticationServiceConfig) {
2179
+ /*
2180
+ var socialLoginProviders = {
2181
+ provide: 'SocialAuthServiceConfig',
2182
+ useValue: {
2183
+ autoLogin: false,
2184
+ providers: [
2185
+ ],
2186
+ onError: (err) => {
2187
+ console.error(err);
2188
+ }
2189
+ } as SocialAuthServiceConfig,
2190
+ };
2191
+
2192
+ if (authenticationServiceConfig.googleClientId) {
2193
+ socialLoginProviders.useValue.providers.push(
2194
+ {
2195
+ id: GoogleLoginProvider.PROVIDER_ID,
2196
+ provider: new GoogleLoginProvider(
2197
+ authenticationServiceConfig.googleClientId
2198
+ )
2199
+ }
2200
+ )
2201
+ }
2202
+ if (authenticationServiceConfig.facebookClientId) {
2203
+ socialLoginProviders.useValue.providers.push(
2204
+ {
2205
+ id: FacebookLoginProvider.PROVIDER_ID,
2206
+ provider: new FacebookLoginProvider(
2207
+ authenticationServiceConfig.facebookClientId
2208
+ )
2209
+ }
2210
+ )
2211
+ }
2212
+ if (authenticationServiceConfig.amazonClientId) {
2213
+ socialLoginProviders.useValue.providers.push(
2214
+ {
2215
+ id: AmazonLoginProvider.PROVIDER_ID,
2216
+ provider: new AmazonLoginProvider(
2217
+ authenticationServiceConfig.amazonClientId
2218
+ )
2219
+ }
2220
+ )
2221
+ }
2222
+ if (authenticationServiceConfig.microsoftClientId) {
2223
+ socialLoginProviders.useValue.providers.push(
2224
+ {
2225
+ id: MicrosoftLoginProvider.PROVIDER_ID,
2226
+ provider: new MicrosoftLoginProvider(
2227
+ authenticationServiceConfig.microsoftClientId
2228
+ )
2229
+ }
2230
+ )
2231
+ }
2232
+ */
2233
+ return {
2234
+ ngModule: GlowwSecurityModule,
2235
+ providers: [
2236
+ AuthenticationService,
2237
+ AuthenticationServiceConfig,
2238
+ { provide: AuthenticationServiceConfig, useValue: authenticationServiceConfig },
2239
+ { provide: HTTP_INTERCEPTORS, useClass: JwtInterceptor, multi: true },
2240
+ { provide: HTTP_INTERCEPTORS, useClass: ErrorInterceptor, multi: true },
2241
+ //{ provide: HTTP_INTERCEPTORS, useClass: StagingInterceptor, multi: true },
2242
+ //socialLoginProviders
2243
+ ]
2244
+ };
2245
+ }
2246
+ }
2247
+ GlowwSecurityModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2248
+ GlowwSecurityModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityModule, declarations: [LoginComponent,
2249
+ ChangePasswordDlgComponent,
2250
+ UserMenuComponent,
2251
+ SocialNetworkDlgComponent,
2252
+ SocialNetworkComponent], imports: [CommonModule,
2253
+ FormsModule,
2254
+ ReactiveFormsModule,
2255
+ BrowserModule,
2256
+ BrowserAnimationsModule,
2257
+ FlexLayoutModule,
2258
+ MatToolbarModule,
2259
+ MatButtonModule,
2260
+ MatSidenavModule,
2261
+ MatInputModule,
2262
+ MatFormFieldModule,
2263
+ MatCardModule,
2264
+ MatDialogModule,
2265
+ HttpClientModule,
2266
+ RouterModule], exports: [LoginComponent, RouterModule, UserMenuComponent] });
2267
+ GlowwSecurityModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityModule, providers: [], imports: [[
2268
+ CommonModule,
2269
+ FormsModule,
2270
+ ReactiveFormsModule,
2271
+ BrowserModule,
2272
+ BrowserAnimationsModule,
2273
+ FlexLayoutModule,
2274
+ MatToolbarModule,
2275
+ MatButtonModule,
2276
+ MatSidenavModule,
2277
+ MatInputModule,
2278
+ MatFormFieldModule,
2279
+ MatCardModule,
2280
+ MatDialogModule,
2281
+ HttpClientModule,
2282
+ RouterModule,
2283
+ ], RouterModule] });
2284
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityModule, decorators: [{
2285
+ type: NgModule,
2286
+ args: [{
2287
+ declarations: [
2288
+ LoginComponent,
2289
+ ChangePasswordDlgComponent,
2290
+ UserMenuComponent,
2291
+ SocialNetworkDlgComponent,
2292
+ SocialNetworkComponent,
2293
+ ],
2294
+ imports: [
2295
+ CommonModule,
2296
+ FormsModule,
2297
+ ReactiveFormsModule,
2298
+ BrowserModule,
2299
+ BrowserAnimationsModule,
2300
+ FlexLayoutModule,
2301
+ MatToolbarModule,
2302
+ MatButtonModule,
2303
+ MatSidenavModule,
2304
+ MatInputModule,
2305
+ MatFormFieldModule,
2306
+ MatCardModule,
2307
+ MatDialogModule,
2308
+ HttpClientModule,
2309
+ RouterModule,
2310
+ ],
2311
+ providers: [],
2312
+ exports: [LoginComponent, RouterModule, UserMenuComponent]
2313
+ }]
2314
+ }] });
2315
+
2316
+ class HtmlEditorComponent {
2317
+ constructor(sanitizer, authenticationService, voiceRecognitionService, dialog) {
2318
+ this.sanitizer = sanitizer;
2319
+ this.authenticationService = authenticationService;
2320
+ this.voiceRecognitionService = voiceRecognitionService;
2321
+ this.dialog = dialog;
2322
+ //@Input() formControlName: string = "";
2323
+ this.placeHolder = "";
2324
+ this._value = null;
2325
+ this.onChange = () => { };
2326
+ this.onTouched = () => { };
2327
+ this.allowedStyles = ['text-align'];
2328
+ this.allowedTags = ['p', 'span', 'div', 'hr', 'br', 'b', 'i', 'u', 'sup', 'sub', 'strike', 'ol', 'ul', 'li'];
2329
+ this.editorConfig = {
2330
+ editable: true,
2331
+ spellcheck: true,
2332
+ height: 'auto',
2333
+ minHeight: '75px',
2334
+ maxHeight: 'auto',
2335
+ width: 'auto',
2336
+ minWidth: '0',
2337
+ translate: 'yes',
2338
+ enableToolbar: true,
2339
+ showToolbar: true,
2340
+ placeholder: 'Enter text here...',
2341
+ defaultParagraphSeparator: 'p',
2342
+ defaultFontName: '',
2343
+ defaultFontSize: '3',
2344
+ fonts: [
2345
+ { class: 'arial', name: 'Arial' }
2346
+ ],
2347
+ customClasses: [
2348
+ {
2349
+ name: 'quote',
2350
+ class: 'quote',
2351
+ }
2352
+ ],
2353
+ uploadUrl: 'v1/image',
2354
+ uploadWithCredentials: false,
2355
+ sanitize: (html) => this.sanitize(html),
2356
+ toolbarPosition: 'top',
2357
+ toolbarHiddenButtons: [
2358
+ ['insertImage', 'insertVideo', 'customClasses', 'heading', 'heading',
2359
+ 'fontName',
2360
+ 'fontSize',
2361
+ 'textColor',
2362
+ 'backgroundColor', !this.isAdministrator() ? 'toggleEditorMode' : '']
2363
+ ],
2364
+ additionalButtons: [
2365
+ {
2366
+ title: 'Speech Recognition',
2367
+ click: (tb, event) => {
2368
+ this.tb = tb;
2369
+ tb.focus();
2370
+ this.voiceRecognitionService.start();
2371
+ this.voiceRecognitionService.text = "";
2372
+ this.dialogRef = this.dialog.open(this.voiceRecognitionTemplate, {
2373
+ width: '550px'
2374
+ });
2375
+ },
2376
+ icon: 'fas fa-comment-plus'
2377
+ }
2378
+ ]
2379
+ };
2380
+ this.voiceRecognitionService.init();
2381
+ }
2382
+ cancel() {
2383
+ var _a;
2384
+ this.voiceRecognitionService.stop();
2385
+ this.tb = undefined;
2386
+ (_a = this.dialogRef) === null || _a === void 0 ? void 0 : _a.close();
2387
+ }
2388
+ paste() {
2389
+ var _a, _b;
2390
+ (_a = this.tb) === null || _a === void 0 ? void 0 : _a.insertHtml(new HtmlFormatPipe().transform(this.voiceRecognitionService.text));
2391
+ this.voiceRecognitionService.stop();
2392
+ this.tb = undefined;
2393
+ (_b = this.dialogRef) === null || _b === void 0 ? void 0 : _b.close();
2394
+ }
2395
+ get value() {
2396
+ return this._value;
2397
+ }
2398
+ set value(val) {
2399
+ this._value = val;
2400
+ this.onChange(val);
2401
+ this.onTouched();
2402
+ }
2403
+ writeValue(obj) {
2404
+ if (obj) {
2405
+ this.value = obj;
2406
+ }
2407
+ }
2408
+ registerOnChange(fn) {
2409
+ this.onChange = fn;
2410
+ }
2411
+ registerOnTouched(fn) {
2412
+ this.onTouched = fn;
2413
+ }
2414
+ sanitize(html) {
2415
+ var _a, _b, _c;
2416
+ let itres = (_a = this.sanitizer.sanitize(SecurityContext.STYLE, html)) === null || _a === void 0 ? void 0 : _a.replace(new RegExp('\\</?[a-z]+:[a-z]+\\>', 'gi'), '').replace(/class="Mso[a-z]+"/ig, '');
2417
+ const matchTags = itres === null || itres === void 0 ? void 0 : itres.match(/<\s*\/?(?<tag>[a-z0-9]+)\s*[^>]*>/ig);
2418
+ matchTags === null || matchTags === void 0 ? void 0 : matchTags.forEach(m => {
2419
+ const matchTag = m.match(/<\s*\/?(?<tag>[a-z0-9]+)\s*[^>]*>/i);
2420
+ if ((matchTag === null || matchTag === void 0 ? void 0 : matchTag.groups) && this.allowedTags.indexOf(matchTag === null || matchTag === void 0 ? void 0 : matchTag.groups['tag']) < 0) {
2421
+ itres = itres === null || itres === void 0 ? void 0 : itres.replace(m, '');
2422
+ }
2423
+ });
2424
+ while (true) {
2425
+ const matchStyle = itres === null || itres === void 0 ? void 0 : itres.match(/style\s*=\s*"(?<style>[^"]+)"/i);
2426
+ if (!matchStyle || !(matchStyle === null || matchStyle === void 0 ? void 0 : matchStyle.groups)) {
2427
+ break;
2428
+ }
2429
+ const styles = (_b = matchStyle === null || matchStyle === void 0 ? void 0 : matchStyle.groups['style']) === null || _b === void 0 ? void 0 : _b.replace(/&quot;/ig, '"');
2430
+ const smatches = styles.match(/(?<name>[^;:]+)\s*:\s*(?<value>[^;]+);*/ig);
2431
+ const newStyles = [];
2432
+ smatches === null || smatches === void 0 ? void 0 : smatches.forEach((v, i, a) => {
2433
+ const ssmatches = v.match(/(?<name>[^;:]+)\s*:\s*(?<value>[^;]+);*/i);
2434
+ if (ssmatches === null || ssmatches === void 0 ? void 0 : ssmatches.groups) {
2435
+ const name = ssmatches === null || ssmatches === void 0 ? void 0 : ssmatches.groups['name'];
2436
+ if (this.allowedStyles.indexOf(name) >= 0) {
2437
+ newStyles.push(v);
2438
+ }
2439
+ const value = ssmatches.groups['value'];
2440
+ console.log(`${name}=${value}`);
2441
+ }
2442
+ });
2443
+ let attr = '';
2444
+ if (newStyles.length) {
2445
+ attr = `stylenew="${newStyles.join(';')}"`;
2446
+ }
2447
+ itres = itres === null || itres === void 0 ? void 0 : itres.replace(matchStyle[0], attr);
2448
+ }
2449
+ return (_c = itres === null || itres === void 0 ? void 0 : itres.replace(/stylenew=/ig, 'style=')) !== null && _c !== void 0 ? _c : "";
2450
+ }
2451
+ isAdministrator() {
2452
+ const currentUser = this.authenticationService.currentUserValue.UserInfo;
2453
+ return currentUser.IsAdministrator === 1 || currentUser.isAdministrator === 1;
2454
+ }
2455
+ }
2456
+ HtmlEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlEditorComponent, deps: [{ token: i1$1.DomSanitizer }, { token: AuthenticationService }, { token: VoiceRecognitionService }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2457
+ HtmlEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: HtmlEditorComponent, selector: "gloww-html-editor", inputs: { placeHolder: "placeHolder", _value: ["value", "_value"] }, providers: [
2458
+ {
2459
+ provide: NG_VALUE_ACCESSOR,
2460
+ multi: true,
2461
+ useExisting: HtmlEditorComponent
2462
+ }
2463
+ ], viewQueries: [{ propertyName: "voiceRecognitionTemplate", first: true, predicate: ["voiceRecognitionDlg"], descendants: true }], ngImport: i0, template: "<div>\r\n <angular-editor [(ngModel)]=\"value\" [config]=\"editorConfig\" [placeholder]=\"placeHolder\"></angular-editor>\r\n</div>\r\n<ng-template #voiceRecognitionDlg>\r\n <mat-dialog-content>\r\n <div>La reconnaissance vocale est activ\u00E9e. Veuillez dicter le texte \u00E0 ins\u00E9rer.</div>\r\n <div [innerHTML]=\"voiceRecognitionService.text | htmlFormat\" style=\"width:500px;height:300px;border:1px solid; border-color: blue;\"></div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions>\r\n <button class=\"mat-raised-button\" (click)=\"cancel()\">Close</button>\r\n <button class=\"mat-raised-button mat-primary\" (click)=\"paste()\">Paste</button>\r\n </mat-dialog-actions>\r\n</ng-template>\r\n", styles: [""], components: [{ type: i5$3.AngularEditorComponent, selector: "angular-editor", inputs: ["id", "config", "placeholder", "tabIndex"], outputs: ["html", "viewMode", "blur", "focus"] }], directives: [{ type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }], pipes: { "htmlFormat": HtmlFormatPipe } });
2464
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: HtmlEditorComponent, decorators: [{
2465
+ type: Component,
2466
+ args: [{ selector: 'gloww-html-editor', providers: [
2467
+ {
2468
+ provide: NG_VALUE_ACCESSOR,
2469
+ multi: true,
2470
+ useExisting: HtmlEditorComponent
2471
+ }
2472
+ ], template: "<div>\r\n <angular-editor [(ngModel)]=\"value\" [config]=\"editorConfig\" [placeholder]=\"placeHolder\"></angular-editor>\r\n</div>\r\n<ng-template #voiceRecognitionDlg>\r\n <mat-dialog-content>\r\n <div>La reconnaissance vocale est activ\u00E9e. Veuillez dicter le texte \u00E0 ins\u00E9rer.</div>\r\n <div [innerHTML]=\"voiceRecognitionService.text | htmlFormat\" style=\"width:500px;height:300px;border:1px solid; border-color: blue;\"></div>\r\n </mat-dialog-content>\r\n\r\n <mat-dialog-actions>\r\n <button class=\"mat-raised-button\" (click)=\"cancel()\">Close</button>\r\n <button class=\"mat-raised-button mat-primary\" (click)=\"paste()\">Paste</button>\r\n </mat-dialog-actions>\r\n</ng-template>\r\n", styles: [""] }]
2473
+ }], ctorParameters: function () { return [{ type: i1$1.DomSanitizer }, { type: AuthenticationService }, { type: VoiceRecognitionService }, { type: i1$2.MatDialog }]; }, propDecorators: { voiceRecognitionTemplate: [{
2474
+ type: ViewChild,
2475
+ args: ['voiceRecognitionDlg']
2476
+ }], placeHolder: [{
2477
+ type: Input
2478
+ }], _value: [{
2479
+ type: Input,
2480
+ args: ['value']
2481
+ }] } });
2482
+
2483
+ class FileEditComponent {
2484
+ constructor(formBuilder, dialogRef, definition) {
2485
+ this.formBuilder = formBuilder;
2486
+ this.dialogRef = dialogRef;
2487
+ this.modes = {
2488
+ ".txt": "null",
2489
+ ".cs": "clike",
2490
+ ".js": "javascript",
2491
+ ".json": { name: "javascript", json: true },
2492
+ ".css": "css",
2493
+ ".scss": "scss",
2494
+ ".htm": "html",
2495
+ ".html": "html",
2496
+ ".xml": "xml"
2497
+ };
2498
+ this.form = this.formBuilder.group({
2499
+ path: [null, Validators.required],
2500
+ content: [null]
2501
+ });
2502
+ if (definition) {
2503
+ this.form.patchValue(definition);
2504
+ try {
2505
+ this.ext = definition.path.match(/\.(txt|js|json|ts|cs|css|scss|xml|html|htm)$/ig)[0];
2506
+ }
2507
+ catch (_a) {
2508
+ this.ext = null;
2509
+ }
2510
+ }
2511
+ }
2512
+ getMode() {
2513
+ try {
2514
+ if (this.ext && this.modes[this.ext]) {
2515
+ return this.modes[this.ext];
2516
+ }
2517
+ else {
2518
+ return "null";
2519
+ }
2520
+ }
2521
+ catch (_a) {
2522
+ return "null";
2523
+ }
2524
+ }
2525
+ ngOnInit() {
2526
+ }
2527
+ cancel() {
2528
+ this.dialogRef.close();
2529
+ }
2530
+ save() {
2531
+ this.dialogRef.close(this.form.value);
2532
+ }
2533
+ }
2534
+ FileEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileEditComponent, deps: [{ token: i1$3.FormBuilder }, { token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
2535
+ FileEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FileEditComponent, selector: "gloww-file-edit", ngImport: i0, template: "<h2 mat-dialog-title>Ajout/Edition d'un fichier</h2>\r\n\r\n<mat-dialog-content [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput [readonly]=\"true\" placeholder=\"Path\" formControlName=\"path\" style=\"width: calc(100% - 32px);\">\r\n </mat-form-field>\r\n <br />\r\n <ngx-codemirror formControlName=\"content\" [options]=\"{\r\n lineNumbers: true,\r\n theme: 'eclipse',\r\n\t\t\t\tindentWithTabs:true,\r\n\t\t\t\tindentUnit: 4,\r\n mode: getMode()\r\n }\"></ngx-codemirror>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"cancel()\">Close</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"save()\">Save</button>\r\n</mat-dialog-actions>\r\n", styles: [".cm-tab{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);background-position:right;background-repeat:no-repeat}\n"], components: [{ type: i7.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i1$4.CodemirrorComponent, selector: "ngx-codemirror", inputs: ["className", "name", "autoFocus", "options", "preserveScrollPosition"], outputs: ["cursorActivity", "focusChange", "scroll", "drop"] }, { type: i5.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i1$3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i1$3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i5$2.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i1$3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i1$3.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
2536
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FileEditComponent, decorators: [{
2537
+ type: Component,
2538
+ args: [{ selector: 'gloww-file-edit', template: "<h2 mat-dialog-title>Ajout/Edition d'un fichier</h2>\r\n\r\n<mat-dialog-content [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput [readonly]=\"true\" placeholder=\"Path\" formControlName=\"path\" style=\"width: calc(100% - 32px);\">\r\n </mat-form-field>\r\n <br />\r\n <ngx-codemirror formControlName=\"content\" [options]=\"{\r\n lineNumbers: true,\r\n theme: 'eclipse',\r\n\t\t\t\tindentWithTabs:true,\r\n\t\t\t\tindentUnit: 4,\r\n mode: getMode()\r\n }\"></ngx-codemirror>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"cancel()\">Close</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"save()\">Save</button>\r\n</mat-dialog-actions>\r\n", styles: [".cm-tab{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAYAAAAkuj5RAAAAAXNSR0IArs4c6QAAAGFJREFUSMft1LsRQFAQheHPowAKoACx3IgEKtaEHujDjORSgWTH/ZOdnZOcM/sgk/kFFWY0qV8foQwS4MKBCS3qR6ixBJvElOobYAtivseIE120FaowJPN75GMu8j/LfMwNjh4HUpwg4LUAAAAASUVORK5CYII=);background-position:right;background-repeat:no-repeat}\n"] }]
2539
+ }], ctorParameters: function () {
2540
+ return [{ type: i1$3.FormBuilder }, { type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
2541
+ type: Inject,
2542
+ args: [MAT_DIALOG_DATA]
2543
+ }] }];
2544
+ } });
2545
+
2546
+ class FolderServiceConfig {
2547
+ constructor() {
2548
+ this.apiPath = '/';
2549
+ }
2550
+ static Create(t) {
2551
+ const res = new FolderServiceConfig();
2552
+ if (t) {
2553
+ Object.assign(res, t);
2554
+ }
2555
+ return res;
2556
+ }
2557
+ }
2558
+ FolderServiceConfig.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderServiceConfig, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2559
+ FolderServiceConfig.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderServiceConfig, providedIn: 'root' });
2560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderServiceConfig, decorators: [{
2561
+ type: Injectable,
2562
+ args: [{ providedIn: 'root' }]
2563
+ }] });
2564
+
2565
+ class FolderService {
2566
+ constructor(http, folderServiceConfig, apiServerUrl) {
2567
+ this.http = http;
2568
+ this.folderServiceConfig = folderServiceConfig;
2569
+ console.log(`folderServiceConfig ${folderServiceConfig.apiPath}`);
2570
+ console.log(`apiServierUrl ${apiServerUrl}`);
2571
+ }
2572
+ getDirectoryContent(path) {
2573
+ return this.http.get(`${this.folderServiceConfig.apiPath}Directories/${path !== null && path !== void 0 ? path : ""}`);
2574
+ }
2575
+ postDirectoryContent(path) {
2576
+ const formData = new FormData();
2577
+ return this.http.post(`${this.folderServiceConfig.apiPath}Directories/${path}`, formData, {});
2578
+ }
2579
+ getFileContent(path) {
2580
+ return this.http.get(`${this.folderServiceConfig.apiPath}Files/${(path !== null && path !== void 0 ? path : "").replace(/[\/\\]/g, '%2F')}`, {
2581
+ responseType: 'text'
2582
+ });
2583
+ }
2584
+ getFileContentBlob(path) {
2585
+ return this.http.get(`${this.folderServiceConfig.apiPath}Files/${(path !== null && path !== void 0 ? path : "").replace(/[\/\\]/g, '%2F')}`, {
2586
+ responseType: 'blob'
2587
+ });
2588
+ }
2589
+ postFileContent(path, formData) {
2590
+ return this.http.post(`${this.folderServiceConfig.apiPath}Files/${(path !== null && path !== void 0 ? path : "").replace(/[\/\\]/g, '%2F')}`, formData, {
2591
+ reportProgress: true,
2592
+ observe: 'events'
2593
+ });
2594
+ }
2595
+ }
2596
+ FolderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderService, deps: [{ token: i1.HttpClient }, { token: FolderServiceConfig }, { token: API_SERVER_URL, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
2597
+ FolderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderService, providedIn: 'root' });
2598
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FolderService, decorators: [{
2599
+ type: Injectable,
2600
+ args: [{
2601
+ providedIn: 'root'
2602
+ }]
2603
+ }], ctorParameters: function () {
2604
+ return [{ type: i1.HttpClient }, { type: FolderServiceConfig }, { type: undefined, decorators: [{
2605
+ type: Optional
2606
+ }, {
2607
+ type: Inject,
2608
+ args: [API_SERVER_URL]
2609
+ }] }];
2610
+ } });
2611
+
2612
+ class FoldersComponent {
2613
+ constructor(folderService, router, route, dialog) {
2614
+ //flowService.getDirectoryContent(route.snapshot.params.id).subscribe(r => this.directoryContent = r);
2615
+ this.folderService = folderService;
2616
+ this.router = router;
2617
+ this.route = route;
2618
+ this.dialog = dialog;
2619
+ this.router.events.subscribe((event) => {
2620
+ if (event instanceof NavigationEnd) {
2621
+ const urlParts = event.url.split('/');
2622
+ this.currentDir = urlParts.slice(2).join("/");
2623
+ this.directoryContent = null;
2624
+ folderService.getDirectoryContent(this.currentDir).subscribe(r => this.directoryContent = r);
2625
+ }
2626
+ });
2627
+ }
2628
+ ngOnInit() {
2629
+ }
2630
+ addFolder() {
2631
+ const dialogConfig = new MatDialogConfig();
2632
+ dialogConfig.disableClose = true;
2633
+ dialogConfig.autoFocus = true;
2634
+ dialogConfig.closeOnNavigation = false;
2635
+ dialogConfig.data = new PromptModel("New Folder", "Please give the name of the folder to create", "", true);
2636
+ this.dialog.open(PromptComponent, dialogConfig).afterClosed().subscribe(folder => {
2637
+ if (folder) {
2638
+ this.folderService.postDirectoryContent(this.currentDir + '/' + folder).subscribe(c => {
2639
+ this.router.navigate(this.getRouterLink(folder)),
2640
+ error => alert(error);
2641
+ });
2642
+ }
2643
+ });
2644
+ }
2645
+ addFile() {
2646
+ const dialogConfig = new MatDialogConfig();
2647
+ dialogConfig.disableClose = true;
2648
+ dialogConfig.autoFocus = true;
2649
+ dialogConfig.closeOnNavigation = false;
2650
+ dialogConfig.data = new PromptModel("New File", "Please give the name of the text file to create", "", true);
2651
+ this.dialog.open(PromptComponent, dialogConfig).afterClosed().subscribe(fileName => {
2652
+ if (fileName) {
2653
+ this.Edit(fileName);
2654
+ this.directoryContent = null;
2655
+ this.folderService.getDirectoryContent(this.currentDir).subscribe(r => this.directoryContent = r);
2656
+ }
2657
+ });
2658
+ }
2659
+ addFileUpload() {
2660
+ const dialogConfig = new MatDialogConfig();
2661
+ dialogConfig.disableClose = true;
2662
+ dialogConfig.autoFocus = true;
2663
+ dialogConfig.closeOnNavigation = false;
2664
+ dialogConfig.data = { acceptMime: 'image/*', multiple: true, allowAltFileName: true };
2665
+ this.dialog.open(UploadDocComponent, dialogConfig).afterClosed().subscribe(files => {
2666
+ if (files) {
2667
+ files.forEach(file => {
2668
+ const formData = new FormData();
2669
+ formData.append('file', file.data);
2670
+ this.UploadFile(this.currentDir + "/" + file.fileName, formData);
2671
+ this.directoryContent = null;
2672
+ this.folderService.getDirectoryContent(this.currentDir).subscribe(r => this.directoryContent = r);
2673
+ });
2674
+ }
2675
+ });
2676
+ }
2677
+ getRouterLink(directory) {
2678
+ if (!this.currentDir) {
2679
+ return ['/folders', directory];
2680
+ }
2681
+ if (!directory) {
2682
+ let res = ['/folders', ...this.currentDir.split("/")];
2683
+ res.pop();
2684
+ return res;
2685
+ }
2686
+ return ['/folders', ...this.currentDir.split("/"), directory];
2687
+ }
2688
+ getHref(f) {
2689
+ if (!this.currentDir) {
2690
+ return ['/FlowMgmt', 'folders', f].join('/');
2691
+ }
2692
+ return ['/FlowMgmt', 'folders', ...this.currentDir.split("/"), f].join('/');
2693
+ }
2694
+ dataURItoBlob(content) {
2695
+ const byteString = content;
2696
+ const arrayBuffer = new ArrayBuffer(byteString.length);
2697
+ const int8Array = new Uint8Array(arrayBuffer);
2698
+ for (let i = 0; i < byteString.length; i++) {
2699
+ int8Array[i] = byteString.charCodeAt(i);
2700
+ }
2701
+ const blob = new Blob([int8Array], { type: 'text/plain' });
2702
+ return blob;
2703
+ }
2704
+ isEditable(filename) {
2705
+ return filename.match(/\.(txt|js|json|ts|cs|css|scss|xml|html|htm|exp|sh|pwsh)$/ig) != null;
2706
+ }
2707
+ UploadFile(fileName, formData) {
2708
+ this.folderService.postFileContent(fileName, formData).pipe(map(event => {
2709
+ switch (event.type) {
2710
+ case HttpEventType.UploadProgress:
2711
+ //file.progress = Math.round(event.loaded * 100 / event.total);
2712
+ break;
2713
+ case HttpEventType.Response:
2714
+ return event.body;
2715
+ }
2716
+ }), catchError((error) => {
2717
+ //file.inProgress = false;
2718
+ return of(`${fileName} upload failed.`);
2719
+ })).subscribe((event) => {
2720
+ if (typeof (event) === 'object') {
2721
+ //obj.Logo = event.Logo;
2722
+ }
2723
+ });
2724
+ }
2725
+ Edit(fileName) {
2726
+ const dialogConfig = new MatDialogConfig();
2727
+ dialogConfig.disableClose = true;
2728
+ dialogConfig.autoFocus = true;
2729
+ dialogConfig.closeOnNavigation = false;
2730
+ let content;
2731
+ this.folderService.getFileContent(this.currentDir + '/' + fileName).subscribe(c => {
2732
+ dialogConfig.data = { path: this.currentDir + '/' + fileName, content: c };
2733
+ this.dialog.open(FileEditComponent, dialogConfig).afterClosed().subscribe(data => {
2734
+ if (data) {
2735
+ const formData = new FormData();
2736
+ const imageName = fileName;
2737
+ const imageBlob = this.dataURItoBlob(data.content);
2738
+ const file = new File([imageBlob], imageName, { type: 'text/plain' });
2739
+ formData.append('file', file);
2740
+ this.UploadFile(this.currentDir + '/' + fileName, formData);
2741
+ //file.inProgress = true;
2742
+ }
2743
+ });
2744
+ });
2745
+ }
2746
+ /*
2747
+ this.http.get(`${environment.apiUrl}`, {
2748
+ responseType: 'arraybuffer', headers: headers
2749
+ }
2750
+ ).subscribe(response => this.downLoadFile(response, "application/ms-excel"));*/
2751
+ downloadFile(fileName) {
2752
+ this.folderService.getFileContentBlob(this.currentDir + '/' + fileName).subscribe(blob => {
2753
+ this.downLoadFile2(blob, blob.type);
2754
+ });
2755
+ }
2756
+ /**
2757
+ * Method is use to download file.
2758
+ * @param data - Array Buffer data
2759
+ * @param type - type of the document.
2760
+ */
2761
+ downLoadFile2(data, type) {
2762
+ let blob = new Blob([data], { type: type });
2763
+ let url = window.URL.createObjectURL(blob);
2764
+ let pwa = window.open(url);
2765
+ if (!pwa || pwa.closed || typeof pwa.closed == 'undefined') {
2766
+ alert('Please disable your Pop-up blocker and try again.');
2767
+ }
2768
+ }
2769
+ }
2770
+ FoldersComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FoldersComponent, deps: [{ token: FolderService }, { token: i2.Router }, { token: i2.ActivatedRoute }, { token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2771
+ FoldersComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: FoldersComponent, selector: "gloww-folders", ngImport: i0, template: "<h1>\r\n <i class=\"fal fa-folder\" size=\"40px\"></i> /{{currentDir}}\r\n <i class=\"fal fa-level-up\" [routerLink]=\"getRouterLink()\" *ngIf=\"currentDir\"></i>\r\n</h1>\r\n<div *ngIf=\"directoryContent else Spinner\">\r\n <i class=\"fal fa-folder-plus\" (click)=\"addFolder()\" size=\"30px\"></i>\r\n <ul>\r\n <li *ngFor=\"let d of directoryContent.directories\">\r\n <i class=\"fal fa-folder\"></i><a [routerLink]=\"getRouterLink(d)\">{{d}}</a>\r\n </li>\r\n </ul>\r\n <i class=\"fal fa-file-plus\" (click)=\"addFile()\" size=\"30px\"></i>\r\n <i class=\"fal fa-file-upload\" (click)=\"addFileUpload()\" size=\"30px\"></i>\r\n <ul>\r\n <li *ngFor=\"let f of directoryContent.files\">\r\n <a (click)=\"Edit(f)\" href=\"javascript:void(0);\" *ngIf=\"isEditable(f); else notEditable\">\r\n <i class=\"fal fa-file\"></i> {{f}}\r\n </a>\r\n <ng-template #notEditable>\r\n <i class=\"fal fa-file fa-disabled\"></i> <a (click)=\"downloadFile(f)\" target=\"_blank\" href=\"javascript:void(0);\">{{f}}</a>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n</div>\r\n<ng-template #Spinner>\r\n <mat-spinner></mat-spinner>\r\n</ng-template>", styles: ["ul{list-style:none}.fa-disabled{opacity:.6;cursor:not-allowed}i{margin:5px;height:20px}\n"], components: [{ type: i14.MatSpinner, selector: "mat-spinner", inputs: ["color"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.RouterLink, selector: ":not(a):not(area)[routerLink]", inputs: ["queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }] });
2772
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: FoldersComponent, decorators: [{
2773
+ type: Component,
2774
+ args: [{ selector: 'gloww-folders', template: "<h1>\r\n <i class=\"fal fa-folder\" size=\"40px\"></i> /{{currentDir}}\r\n <i class=\"fal fa-level-up\" [routerLink]=\"getRouterLink()\" *ngIf=\"currentDir\"></i>\r\n</h1>\r\n<div *ngIf=\"directoryContent else Spinner\">\r\n <i class=\"fal fa-folder-plus\" (click)=\"addFolder()\" size=\"30px\"></i>\r\n <ul>\r\n <li *ngFor=\"let d of directoryContent.directories\">\r\n <i class=\"fal fa-folder\"></i><a [routerLink]=\"getRouterLink(d)\">{{d}}</a>\r\n </li>\r\n </ul>\r\n <i class=\"fal fa-file-plus\" (click)=\"addFile()\" size=\"30px\"></i>\r\n <i class=\"fal fa-file-upload\" (click)=\"addFileUpload()\" size=\"30px\"></i>\r\n <ul>\r\n <li *ngFor=\"let f of directoryContent.files\">\r\n <a (click)=\"Edit(f)\" href=\"javascript:void(0);\" *ngIf=\"isEditable(f); else notEditable\">\r\n <i class=\"fal fa-file\"></i> {{f}}\r\n </a>\r\n <ng-template #notEditable>\r\n <i class=\"fal fa-file fa-disabled\"></i> <a (click)=\"downloadFile(f)\" target=\"_blank\" href=\"javascript:void(0);\">{{f}}</a>\r\n </ng-template>\r\n </li>\r\n </ul>\r\n</div>\r\n<ng-template #Spinner>\r\n <mat-spinner></mat-spinner>\r\n</ng-template>", styles: ["ul{list-style:none}.fa-disabled{opacity:.6;cursor:not-allowed}i{margin:5px;height:20px}\n"] }]
2775
+ }], ctorParameters: function () { return [{ type: FolderService }, { type: i2.Router }, { type: i2.ActivatedRoute }, { type: i1$2.MatDialog }]; } });
2776
+
2777
+ class DownloadProgressComponent {
2778
+ constructor(dialogRef, arg, httpClient) {
2779
+ this.dialogRef = dialogRef;
2780
+ this.httpClient = httpClient;
2781
+ this.done = -1;
2782
+ this.name = arg.name;
2783
+ this.files = arg.files;
2784
+ this.current = [];
2785
+ this.message = "Donwload des fichiers";
2786
+ this.percent = -1;
2787
+ }
2788
+ ngOnInit() {
2789
+ if (this.name) {
2790
+ this.downloadZip();
2791
+ }
2792
+ else {
2793
+ this.download();
2794
+ }
2795
+ }
2796
+ getFile(url, callback) {
2797
+ return __awaiter(this, void 0, void 0, function* () {
2798
+ const httpOptions = {
2799
+ observe: "events",
2800
+ reportProgress: true,
2801
+ responseType: "blob" //as 'json'
2802
+ };
2803
+ const res = yield this.httpClient.get(url, httpOptions).pipe(map((event) => {
2804
+ console.log(event);
2805
+ /*if (event.type === HttpEventType.DownloadProgress) {
2806
+ console.log(`download progress ${(event as HttpEventType.DownloadProgress).valueOf}`);
2807
+ }
2808
+ if (event.type === HttpEventType.Response) {
2809
+ console.log("donwload completed");
2810
+ }*/
2811
+ if (event.type === 3) {
2812
+ callback(url, event.loaded, event.total);
2813
+ }
2814
+ if (event instanceof HttpResponse) {
2815
+ callback(url, -1, -1);
2816
+ }
2817
+ return event;
2818
+ }), filter((event) => event instanceof HttpResponse)).toPromise().catch((err) => {
2819
+ const error = err.error;
2820
+ return error;
2821
+ });
2822
+ return res.body;
2823
+ });
2824
+ }
2825
+ callback(url, loaded, total) {
2826
+ const index = this.current.findIndex(c => c.url === url);
2827
+ if (total === -1) {
2828
+ this.done += 1;
2829
+ this.current.splice(index, 1);
2830
+ }
2831
+ else {
2832
+ if (index === -1) {
2833
+ this.current.push({ url, loaded, total });
2834
+ }
2835
+ else {
2836
+ this.current[index].loaded = loaded;
2837
+ }
2838
+ }
2839
+ }
2840
+ callback_zip(metadata) {
2841
+ this.percent = metadata.percent;
2842
+ }
2843
+ downloadZip() {
2844
+ return __awaiter(this, void 0, void 0, function* () {
2845
+ const zip = new JSZip();
2846
+ // tslint:disable-next-line:prefer-for-of
2847
+ this.done = 0;
2848
+ yield Promise.all(this.files.map((file) => __awaiter(this, void 0, void 0, function* () {
2849
+ let fileData;
2850
+ fileData = yield this.getFile(file.url, this.callback.bind(this));
2851
+ const b = new Blob([fileData], { type: '' + fileData.type + '' });
2852
+ zip.file(file.name, b);
2853
+ })));
2854
+ this.message = "Génération du fichier Zip";
2855
+ this.done = -1;
2856
+ yield zip.generateAsync({ type: 'blob' }, this.callback_zip.bind(this)).then((content) => {
2857
+ if (content) {
2858
+ FileSaver.saveAs(content, this.name);
2859
+ }
2860
+ });
2861
+ this.dialogRef.close();
2862
+ });
2863
+ }
2864
+ download() {
2865
+ return __awaiter(this, void 0, void 0, function* () {
2866
+ const zip = new JSZip();
2867
+ // tslint:disable-next-line:prefer-for-of
2868
+ this.done = 0;
2869
+ yield Promise.all(this.files.map((file) => __awaiter(this, void 0, void 0, function* () {
2870
+ let fileData;
2871
+ fileData = yield this.getFile(file.url, this.callback.bind(this));
2872
+ const b = new Blob([fileData], { type: '' + fileData.type + '' });
2873
+ FileSaver.saveAs(b, file.name);
2874
+ })));
2875
+ this.message = "Génération du fichier Zip";
2876
+ this.done = -1;
2877
+ this.dialogRef.close();
2878
+ });
2879
+ }
2880
+ }
2881
+ DownloadProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DownloadProgressComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Component });
2882
+ DownloadProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: DownloadProgressComponent, selector: "gloww-download-progress", ngImport: i0, template: "<h2 mat-dialog-title>Progression Donwload</h2>\r\n\r\n<mat-dialog-content>\r\n <H3>{{message}}</H3>\r\n <mat-progress-bar [value]=\"percent\" *ngIf=\"percent>0\"></mat-progress-bar>\r\n <div *ngIf=\"done>=0\">\r\n <mat-progress-bar [value]=\"done*100/files.length\"></mat-progress-bar> {{done}}/{{files.length}}\r\n <br />\r\n <ul>\r\n <li *ngFor=\" let file of current; index as i\">\r\n <span id=\"file-label\">{{file.url}}</span>\r\n <mat-progress-bar [value]=\"file.loaded*100/file.total\"></mat-progress-bar>\r\n </li>\r\n </ul>\r\n </div>\r\n</mat-dialog-content>\r\n\r\n\r\n<mat-dialog-actions>\r\n <!--<button class=\"mat-raised-button\" (click)=\"cancel()\">Close</button>\r\n\t<button class=\"mat-raised-button mat-primary\" (click)=\"save()\">Save</button>-->\r\n</mat-dialog-actions>", styles: [""], components: [{ type: i2$1.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], directives: [{ type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]" }] });
2883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: DownloadProgressComponent, decorators: [{
2884
+ type: Component,
2885
+ args: [{ selector: 'gloww-download-progress', template: "<h2 mat-dialog-title>Progression Donwload</h2>\r\n\r\n<mat-dialog-content>\r\n <H3>{{message}}</H3>\r\n <mat-progress-bar [value]=\"percent\" *ngIf=\"percent>0\"></mat-progress-bar>\r\n <div *ngIf=\"done>=0\">\r\n <mat-progress-bar [value]=\"done*100/files.length\"></mat-progress-bar> {{done}}/{{files.length}}\r\n <br />\r\n <ul>\r\n <li *ngFor=\" let file of current; index as i\">\r\n <span id=\"file-label\">{{file.url}}</span>\r\n <mat-progress-bar [value]=\"file.loaded*100/file.total\"></mat-progress-bar>\r\n </li>\r\n </ul>\r\n </div>\r\n</mat-dialog-content>\r\n\r\n\r\n<mat-dialog-actions>\r\n <!--<button class=\"mat-raised-button\" (click)=\"cancel()\">Close</button>\r\n\t<button class=\"mat-raised-button mat-primary\" (click)=\"save()\">Save</button>-->\r\n</mat-dialog-actions>", styles: [""] }]
2886
+ }], ctorParameters: function () {
2887
+ return [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
2888
+ type: Inject,
2889
+ args: [MAT_DIALOG_DATA]
2890
+ }] }, { type: i1.HttpClient }];
2891
+ } });
2892
+
2893
+ class SecureAComponent {
2894
+ constructor(dialog) {
2895
+ this.dialog = dialog;
2896
+ }
2897
+ ngOnInit() {
2898
+ }
2899
+ click() {
2900
+ const dialogConfig = new MatDialogConfig();
2901
+ dialogConfig.disableClose = true;
2902
+ dialogConfig.autoFocus = true;
2903
+ dialogConfig.closeOnNavigation = false;
2904
+ dialogConfig.data = { files: [{ url: this.href, name: this.name }] };
2905
+ this.dialog.open(DownloadProgressComponent, dialogConfig).afterClosed().subscribe();
2906
+ }
2907
+ }
2908
+ SecureAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecureAComponent, deps: [{ token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component });
2909
+ SecureAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.3", type: SecureAComponent, selector: "gloww-secure-a", inputs: { href: "href", name: "name" }, ngImport: i0, template: "<a (click)=\"click()\" href=\"javascript:void(0);\">\r\n <ng-content></ng-content>\r\n</a>", styles: [""] });
2910
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: SecureAComponent, decorators: [{
2911
+ type: Component,
2912
+ args: [{ selector: 'gloww-secure-a', template: "<a (click)=\"click()\" href=\"javascript:void(0);\">\r\n <ng-content></ng-content>\r\n</a>", styles: [""] }]
2913
+ }], ctorParameters: function () { return [{ type: i1$2.MatDialog }]; }, propDecorators: { href: [{
2914
+ type: Input
2915
+ }], name: [{
2916
+ type: Input
2917
+ }] } });
2918
+
2919
+ class GlowwModule {
2920
+ static forRoot(folderServiceConfig) {
2921
+ console.log(`forRoot ${folderServiceConfig}`);
2922
+ return {
2923
+ ngModule: GlowwModule,
2924
+ providers: [
2925
+ VersionCheckService,
2926
+ NavService,
2927
+ VoiceRecognitionService,
2928
+ {
2929
+ provide: FolderServiceConfig,
2930
+ useValue: folderServiceConfig
2931
+ }
2932
+ ]
2933
+ };
2934
+ }
2935
+ }
2936
+ GlowwModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2937
+ GlowwModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwModule, declarations: [UploadDocComponent,
2938
+ SafeHtmlPipe,
2939
+ DisplayObjectsComponent,
2940
+ HeaderComponent,
2941
+ ResultTableComponent,
2942
+ SearchFormComponent,
2943
+ ConfirmationComponent,
2944
+ PromptComponent,
2945
+ SecurePipe,
2946
+ SecureImgComponent,
2947
+ MenuListItemComponent,
2948
+ CodeEditorComponent,
2949
+ HtmlEditorComponent,
2950
+ HtmlFormatPipe,
2951
+ UploadFileComponent,
2952
+ FileSinkDirective,
2953
+ FileEditComponent,
2954
+ FoldersComponent,
2955
+ DownloadProgressComponent,
2956
+ SecureAComponent], imports: [CommonModule,
2957
+ BrowserModule,
2958
+ RouterModule,
2959
+ FormsModule,
2960
+ ReactiveFormsModule,
2961
+ MatDialogModule,
2962
+ MatInputModule,
2963
+ MatIconModule,
2964
+ MatButtonModule,
2965
+ MatCardModule,
2966
+ MatProgressSpinnerModule,
2967
+ MatProgressBarModule,
2968
+ MatTableModule,
2969
+ MatSelectModule,
2970
+ MatPaginatorModule,
2971
+ MatSortModule,
2972
+ MatProgressSpinnerModule,
2973
+ CodemirrorModule,
2974
+ AngularEditorModule], exports: [SafeHtmlPipe,
2975
+ UploadDocComponent,
2976
+ UploadFileComponent,
2977
+ DisplayObjectsComponent,
2978
+ HeaderComponent,
2979
+ ResultTableComponent,
2980
+ SearchFormComponent,
2981
+ ConfirmationComponent,
2982
+ PromptComponent,
2983
+ SecurePipe,
2984
+ SecureImgComponent,
2985
+ MenuListItemComponent,
2986
+ CodeEditorComponent,
2987
+ HtmlEditorComponent,
2988
+ HtmlFormatPipe,
2989
+ FoldersComponent,
2990
+ DownloadProgressComponent,
2991
+ SecureAComponent] });
2992
+ GlowwModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwModule, providers: [], imports: [[
2993
+ CommonModule,
2994
+ BrowserModule,
2995
+ RouterModule,
2996
+ FormsModule,
2997
+ ReactiveFormsModule,
2998
+ MatDialogModule,
2999
+ MatInputModule,
3000
+ MatIconModule,
3001
+ MatButtonModule,
3002
+ MatCardModule,
3003
+ MatProgressSpinnerModule,
3004
+ MatProgressBarModule,
3005
+ MatTableModule,
3006
+ MatSelectModule,
3007
+ MatPaginatorModule,
3008
+ MatSortModule,
3009
+ MatProgressSpinnerModule,
3010
+ CodemirrorModule,
3011
+ AngularEditorModule
3012
+ ]] });
3013
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwModule, decorators: [{
3014
+ type: NgModule,
3015
+ args: [{
3016
+ declarations: [
3017
+ UploadDocComponent,
3018
+ SafeHtmlPipe,
3019
+ DisplayObjectsComponent,
3020
+ HeaderComponent,
3021
+ ResultTableComponent,
3022
+ SearchFormComponent,
3023
+ ConfirmationComponent,
3024
+ PromptComponent,
3025
+ SecurePipe,
3026
+ SecureImgComponent,
3027
+ MenuListItemComponent,
3028
+ CodeEditorComponent,
3029
+ HtmlEditorComponent,
3030
+ HtmlFormatPipe,
3031
+ UploadFileComponent,
3032
+ FileSinkDirective,
3033
+ FileEditComponent,
3034
+ FoldersComponent,
3035
+ DownloadProgressComponent,
3036
+ SecureAComponent,
3037
+ ],
3038
+ imports: [
3039
+ CommonModule,
3040
+ BrowserModule,
3041
+ RouterModule,
3042
+ FormsModule,
3043
+ ReactiveFormsModule,
3044
+ MatDialogModule,
3045
+ MatInputModule,
3046
+ MatIconModule,
3047
+ MatButtonModule,
3048
+ MatCardModule,
3049
+ MatProgressSpinnerModule,
3050
+ MatProgressBarModule,
3051
+ MatTableModule,
3052
+ MatSelectModule,
3053
+ MatPaginatorModule,
3054
+ MatSortModule,
3055
+ MatProgressSpinnerModule,
3056
+ CodemirrorModule,
3057
+ AngularEditorModule
3058
+ ],
3059
+ providers: [],
3060
+ exports: [
3061
+ SafeHtmlPipe,
3062
+ UploadDocComponent,
3063
+ UploadFileComponent,
3064
+ DisplayObjectsComponent,
3065
+ HeaderComponent,
3066
+ ResultTableComponent,
3067
+ SearchFormComponent,
3068
+ ConfirmationComponent,
3069
+ PromptComponent,
3070
+ SecurePipe,
3071
+ SecureImgComponent,
3072
+ MenuListItemComponent,
3073
+ CodeEditorComponent,
3074
+ HtmlEditorComponent,
3075
+ HtmlFormatPipe,
3076
+ FoldersComponent,
3077
+ DownloadProgressComponent,
3078
+ SecureAComponent
3079
+ ]
3080
+ }]
3081
+ }] });
3082
+
3083
+ class GlowwSecurityService {
3084
+ constructor() { }
3085
+ }
3086
+ GlowwSecurityService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
3087
+ GlowwSecurityService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityService, providedIn: 'root' });
3088
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: GlowwSecurityService, decorators: [{
3089
+ type: Injectable,
3090
+ args: [{
3091
+ providedIn: 'root'
3092
+ }]
3093
+ }], ctorParameters: function () { return []; } });
3094
+
3095
+ /*
3096
+ * Public API Surface of gloww
3097
+ */
3098
+
3099
+ /**
3100
+ * Generated bundle index. Do not edit.
3101
+ */
3102
+
3103
+ export { API_SERVER_URL, AdministratorGuard, AuthGuard, AuthenticationService, AuthenticationServiceConfig, ChangePasswordDlgComponent, CodeEditorComponent, ConfirmationComponent, ConfirmationModel, DialogService, DisplayObjectsComponent, DownloadProgressComponent, ErrorInterceptor, FolderServiceConfig, FoldersComponent, GLOWW_APPLI, GlowwModule, GlowwSecurityModule, GlowwSecurityService, GlowwService, HeaderComponent, HtmlEditorComponent, HtmlFormatPipe, JwtInterceptor, LoginComponent, MenuListItemComponent, NavService, PromptComponent, PromptModel, ResultTableComponent, SafeHtmlPipe, SearchFormComponent, SecureAComponent, SecureImgComponent, SecurePipe, StagingInterceptor, UploadDocComponent, UploadFileComponent, UserMenuComponent, VersionCheckService, VoiceRecognitionService };
3104
+ //# sourceMappingURL=gloww-gloww.mjs.map