@gloww/gloww 0.9.0-beta.2

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