@bravobit/bb-foundation 0.21.0 → 0.21.3

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 (462) hide show
  1. package/README.md +47 -47
  2. package/auth/index.d.ts +5 -5
  3. package/auth/lib/auth.interceptor.d.ts +21 -21
  4. package/auth/lib/auth.module.d.ts +15 -15
  5. package/auth/lib/auth.service.d.ts +59 -59
  6. package/auth/lib/auth.session.d.ts +34 -34
  7. package/auth/lib/directives/authenticated.directive.d.ts +14 -14
  8. package/auth/lib/directives/permission.directive.d.ts +24 -24
  9. package/auth/lib/directives/role.directive.d.ts +16 -16
  10. package/auth/lib/guards/anonymous.guard.d.ts +11 -11
  11. package/auth/lib/guards/authenticated.guard.d.ts +11 -11
  12. package/auth/lib/helpers/jwt.helper.d.ts +8 -8
  13. package/auth/lib/helpers/mapper.helper.d.ts +23 -23
  14. package/auth/lib/interfaces/config.interface.d.ts +12 -12
  15. package/auth/lib/interfaces/mapper.interface.d.ts +19 -19
  16. package/auth/lib/interfaces/provider.interface.d.ts +16 -16
  17. package/auth/lib/interfaces/token.interface.d.ts +11 -11
  18. package/auth/lib/permissions.service.d.ts +14 -14
  19. package/auth/lib/providers/email.provider.d.ts +15 -15
  20. package/auth/lib/providers/verify.provider.d.ts +13 -13
  21. package/auth/lib/tokens/use-authorization.token.d.ts +2 -2
  22. package/auth/public_api.d.ts +18 -18
  23. package/collections/index.d.ts +5 -5
  24. package/collections/lib/collection.d.ts +42 -43
  25. package/collections/lib/collections.module.d.ts +10 -10
  26. package/collections/lib/components/collections-pager/collections-pager.component.d.ts +34 -34
  27. package/collections/lib/components/collections-viewer/collections-viewer.component.d.ts +12 -12
  28. package/collections/lib/components/collections.directive.d.ts +17 -17
  29. package/collections/lib/interfaces/collection.interface.d.ts +27 -26
  30. package/collections/lib/providers/api-collection.provider.d.ts +18 -19
  31. package/collections/lib/providers/collection.provider.d.ts +6 -6
  32. package/collections/lib/providers/local-collection.provider.d.ts +8 -8
  33. package/collections/public_api.d.ts +9 -9
  34. package/controls/index.d.ts +5 -5
  35. package/controls/lib/checkbox/checkbox/checkbox.component.d.ts +47 -47
  36. package/controls/lib/checkbox/checkbox-group/checkbox-group.component.d.ts +22 -22
  37. package/controls/lib/checkbox/checkbox.module.d.ts +9 -9
  38. package/controls/lib/controls.module.d.ts +7 -7
  39. package/controls/public_api.d.ts +4 -4
  40. package/dashboard/index.d.ts +5 -5
  41. package/dashboard/lib/dashboard/dashboard.component.d.ts +19 -19
  42. package/dashboard/lib/dashboard-header/dashboard-header.component.d.ts +11 -11
  43. package/dashboard/lib/dashboard-menu/dashboard-menu.component.d.ts +9 -9
  44. package/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.d.ts +11 -11
  45. package/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.d.ts +21 -21
  46. package/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.d.ts +27 -27
  47. package/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.d.ts +16 -16
  48. package/dashboard/lib/dashboard.module.d.ts +16 -16
  49. package/dashboard/public_api.d.ts +8 -8
  50. package/dialog/index.d.ts +5 -5
  51. package/dialog/lib/dialog-actions/dialog-actions.component.d.ts +5 -5
  52. package/dialog/lib/dialog-confirm/dialog-confirm.component.d.ts +16 -16
  53. package/dialog/lib/dialog-container/dialog-container.component.d.ts +24 -24
  54. package/dialog/lib/dialog-header/dialog-header.component.d.ts +9 -9
  55. package/dialog/lib/dialog-link/dialog-link.component.d.ts +5 -5
  56. package/dialog/lib/dialog-modal/dialog-modal.component.d.ts +12 -12
  57. package/dialog/lib/dialog-overlay/dialog-overlay.component.d.ts +22 -22
  58. package/dialog/lib/dialog.injector.d.ts +8 -8
  59. package/dialog/lib/dialog.insertion.d.ts +8 -8
  60. package/dialog/lib/dialog.interfaces.d.ts +3 -3
  61. package/dialog/lib/dialog.module.d.ts +19 -19
  62. package/dialog/lib/dialog.ref.d.ts +8 -8
  63. package/dialog/lib/dialog.service.d.ts +19 -19
  64. package/dialog/public_api.d.ts +9 -9
  65. package/elements/index.d.ts +5 -5
  66. package/elements/lib/avatar/avatar.component.d.ts +25 -25
  67. package/elements/lib/button/button.component.d.ts +23 -23
  68. package/elements/lib/checkbox/checkbox.component.d.ts +27 -27
  69. package/elements/lib/date-picker/date-picker.component.d.ts +69 -69
  70. package/elements/lib/directives/addon.directive.d.ts +9 -9
  71. package/elements/lib/directives/autosize.directive.d.ts +18 -18
  72. package/elements/lib/directives/focus-trap.directive.d.ts +17 -17
  73. package/elements/lib/directives/focus.directive.d.ts +14 -14
  74. package/elements/lib/directives/form-submit.directive.d.ts +17 -17
  75. package/elements/lib/directives/input.directive.d.ts +38 -38
  76. package/elements/lib/directives/template.directive.d.ts +10 -10
  77. package/elements/lib/dropdown/dropdown.component.d.ts +21 -21
  78. package/elements/lib/elements.interfaces.d.ts +25 -25
  79. package/elements/lib/elements.module.d.ts +116 -116
  80. package/elements/lib/file-picker/file-picker.component.d.ts +49 -49
  81. package/elements/lib/form-control/form-control.component.d.ts +21 -21
  82. package/elements/lib/form-error/form-error.component.d.ts +29 -29
  83. package/elements/lib/form-group/form-group.component.d.ts +10 -10
  84. package/elements/lib/icon/icon.component.d.ts +22 -22
  85. package/elements/lib/image-picker/image-picker.component.d.ts +38 -38
  86. package/elements/lib/pipes/file-image.pipe.d.ts +13 -13
  87. package/elements/lib/pipes/file-size.pipe.d.ts +8 -8
  88. package/elements/lib/pipes/relative-time.pipe.d.ts +19 -19
  89. package/elements/lib/spinner/spinner.component.d.ts +12 -12
  90. package/elements/lib/tag/tag.component.d.ts +7 -7
  91. package/elements/public_api.d.ts +25 -25
  92. package/esm2020/auth/bravobit-bb-foundation-auth.mjs +4 -4
  93. package/esm2020/auth/lib/auth.interceptor.mjs +93 -93
  94. package/esm2020/auth/lib/auth.module.mjs +54 -54
  95. package/esm2020/auth/lib/auth.service.mjs +281 -281
  96. package/esm2020/auth/lib/auth.session.mjs +131 -131
  97. package/esm2020/auth/lib/directives/authenticated.directive.mjs +31 -31
  98. package/esm2020/auth/lib/directives/permission.directive.mjs +80 -80
  99. package/esm2020/auth/lib/directives/role.directive.mjs +37 -37
  100. package/esm2020/auth/lib/guards/anonymous.guard.mjs +34 -34
  101. package/esm2020/auth/lib/guards/authenticated.guard.mjs +35 -35
  102. package/esm2020/auth/lib/helpers/jwt.helper.mjs +69 -69
  103. package/esm2020/auth/lib/helpers/mapper.helper.mjs +35 -35
  104. package/esm2020/auth/lib/interfaces/config.interface.mjs +3 -3
  105. package/esm2020/auth/lib/interfaces/mapper.interface.mjs +2 -2
  106. package/esm2020/auth/lib/interfaces/provider.interface.mjs +2 -2
  107. package/esm2020/auth/lib/interfaces/token.interface.mjs +2 -2
  108. package/esm2020/auth/lib/permissions.service.mjs +56 -56
  109. package/esm2020/auth/lib/providers/email.provider.mjs +25 -25
  110. package/esm2020/auth/lib/providers/verify.provider.mjs +19 -19
  111. package/esm2020/auth/lib/tokens/use-authorization.token.mjs +3 -3
  112. package/esm2020/auth/public_api.mjs +19 -19
  113. package/esm2020/bravobit-bb-foundation.mjs +4 -4
  114. package/esm2020/collections/bravobit-bb-foundation-collections.mjs +4 -4
  115. package/esm2020/collections/lib/collection.mjs +100 -102
  116. package/esm2020/collections/lib/collections.module.mjs +54 -54
  117. package/esm2020/collections/lib/components/collections-pager/collections-pager.component.mjs +123 -123
  118. package/esm2020/collections/lib/components/collections-viewer/collections-viewer.component.mjs +31 -31
  119. package/esm2020/collections/lib/components/collections.directive.mjs +43 -43
  120. package/esm2020/collections/lib/interfaces/collection.interface.mjs +2 -2
  121. package/esm2020/collections/lib/providers/api-collection.provider.mjs +91 -71
  122. package/esm2020/collections/lib/providers/collection.provider.mjs +13 -13
  123. package/esm2020/collections/lib/providers/local-collection.provider.mjs +16 -16
  124. package/esm2020/collections/public_api.mjs +10 -10
  125. package/esm2020/controls/bravobit-bb-foundation-controls.mjs +4 -4
  126. package/esm2020/controls/lib/checkbox/checkbox/checkbox.component.mjs +153 -153
  127. package/esm2020/controls/lib/checkbox/checkbox-group/checkbox-group.component.mjs +61 -61
  128. package/esm2020/controls/lib/checkbox/checkbox.module.mjs +19 -19
  129. package/esm2020/controls/lib/controls.module.mjs +16 -16
  130. package/esm2020/controls/public_api.mjs +5 -5
  131. package/esm2020/dashboard/bravobit-bb-foundation-dashboard.mjs +4 -4
  132. package/esm2020/dashboard/lib/dashboard/dashboard.component.mjs +56 -56
  133. package/esm2020/dashboard/lib/dashboard-header/dashboard-header.component.mjs +30 -30
  134. package/esm2020/dashboard/lib/dashboard-menu/dashboard-menu.component.mjs +31 -31
  135. package/esm2020/dashboard/lib/dashboard-menu-item/dashboard-menu-item.component.mjs +29 -29
  136. package/esm2020/dashboard/lib/dashboard-sidebar/dashboard-sidebar.component.mjs +75 -75
  137. package/esm2020/dashboard/lib/dashboard-sidebar-group/dashboard-sidebar-group.component.mjs +99 -99
  138. package/esm2020/dashboard/lib/dashboard-sidebar-item/dashboard-sidebar-item.component.mjs +62 -62
  139. package/esm2020/dashboard/lib/dashboard.module.mjs +47 -47
  140. package/esm2020/dashboard/public_api.mjs +9 -9
  141. package/esm2020/dialog/bravobit-bb-foundation-dialog.mjs +4 -4
  142. package/esm2020/dialog/lib/dialog-actions/dialog-actions.component.mjs +12 -12
  143. package/esm2020/dialog/lib/dialog-confirm/dialog-confirm.component.mjs +37 -37
  144. package/esm2020/dialog/lib/dialog-container/dialog-container.component.mjs +153 -153
  145. package/esm2020/dialog/lib/dialog-header/dialog-header.component.mjs +25 -25
  146. package/esm2020/dialog/lib/dialog-link/dialog-link.component.mjs +11 -11
  147. package/esm2020/dialog/lib/dialog-modal/dialog-modal.component.mjs +46 -46
  148. package/esm2020/dialog/lib/dialog-overlay/dialog-overlay.component.mjs +134 -134
  149. package/esm2020/dialog/lib/dialog.injector.mjs +18 -18
  150. package/esm2020/dialog/lib/dialog.insertion.mjs +16 -16
  151. package/esm2020/dialog/lib/dialog.interfaces.mjs +3 -3
  152. package/esm2020/dialog/lib/dialog.module.mjs +68 -68
  153. package/esm2020/dialog/lib/dialog.ref.mjs +22 -22
  154. package/esm2020/dialog/lib/dialog.service.mjs +77 -77
  155. package/esm2020/dialog/public_api.mjs +10 -10
  156. package/esm2020/elements/bravobit-bb-foundation-elements.mjs +4 -4
  157. package/esm2020/elements/lib/avatar/avatar.component.mjs +145 -145
  158. package/esm2020/elements/lib/button/button.component.mjs +61 -61
  159. package/esm2020/elements/lib/checkbox/checkbox.component.mjs +73 -73
  160. package/esm2020/elements/lib/date-picker/date-picker.component.mjs +304 -304
  161. package/esm2020/elements/lib/directives/addon.directive.mjs +29 -29
  162. package/esm2020/elements/lib/directives/autosize.directive.mjs +72 -72
  163. package/esm2020/elements/lib/directives/focus-trap.directive.mjs +77 -77
  164. package/esm2020/elements/lib/directives/focus.directive.mjs +39 -39
  165. package/esm2020/elements/lib/directives/form-submit.directive.mjs +50 -50
  166. package/esm2020/elements/lib/directives/input.directive.mjs +136 -136
  167. package/esm2020/elements/lib/directives/template.directive.mjs +28 -28
  168. package/esm2020/elements/lib/dropdown/dropdown.component.mjs +100 -100
  169. package/esm2020/elements/lib/elements.interfaces.mjs +4 -4
  170. package/esm2020/elements/lib/elements.module.mjs +177 -177
  171. package/esm2020/elements/lib/file-picker/file-picker.component.mjs +236 -236
  172. package/esm2020/elements/lib/form-control/form-control.component.mjs +49 -49
  173. package/esm2020/elements/lib/form-error/form-error.component.mjs +108 -108
  174. package/esm2020/elements/lib/form-group/form-group.component.mjs +18 -18
  175. package/esm2020/elements/lib/icon/icon.component.mjs +102 -102
  176. package/esm2020/elements/lib/image-picker/image-picker.component.mjs +106 -106
  177. package/esm2020/elements/lib/pipes/file-image.pipe.mjs +42 -42
  178. package/esm2020/elements/lib/pipes/file-size.pipe.mjs +28 -28
  179. package/esm2020/elements/lib/pipes/relative-time.pipe.mjs +94 -94
  180. package/esm2020/elements/lib/spinner/spinner.component.mjs +25 -25
  181. package/esm2020/elements/lib/tag/tag.component.mjs +18 -18
  182. package/esm2020/elements/public_api.mjs +26 -26
  183. package/esm2020/http/bravobit-bb-foundation-http.mjs +4 -4
  184. package/esm2020/http/lib/classes/http.config.mjs +29 -29
  185. package/esm2020/http/lib/classes/http.error.mjs +20 -20
  186. package/esm2020/http/lib/http.interfaces.mjs +2 -2
  187. package/esm2020/http/lib/http.module.mjs +43 -43
  188. package/esm2020/http/lib/interceptors/base-url.interceptor.mjs +50 -50
  189. package/esm2020/http/lib/interceptors/error.interceptor.mjs +32 -32
  190. package/esm2020/http/public_api.mjs +7 -7
  191. package/esm2020/lib/core/miscellaneous/regex.mjs +5 -5
  192. package/esm2020/lib/core/miscellaneous/validator.mjs +85 -85
  193. package/esm2020/lib/core/mixins/can-disable.mjs +16 -16
  194. package/esm2020/lib/core/mixins/can-hide-errors.mjs +16 -16
  195. package/esm2020/lib/core/mixins/can-load.mjs +16 -16
  196. package/esm2020/lib/core/mixins/constructor.mjs +2 -2
  197. package/esm2020/lib/core/mixins/has-error.mjs +16 -16
  198. package/esm2020/lib/core/mixins/is-focused.mjs +16 -16
  199. package/esm2020/lib/core/mixins/is-grouped.mjs +16 -16
  200. package/esm2020/lib/core/mixins/is-readonly.mjs +16 -16
  201. package/esm2020/lib/core/mixins/is-required.mjs +16 -16
  202. package/esm2020/lib/core/services/clipboard.service.mjs +70 -70
  203. package/esm2020/lib/core/services/exif.service.mjs +163 -163
  204. package/esm2020/lib/core/services/file-loader.service.mjs +87 -87
  205. package/esm2020/lib/core/services/image-converter.service.mjs +123 -123
  206. package/esm2020/lib/core/services/languages.service.mjs +74 -74
  207. package/esm2020/lib/core/services/network.service.mjs +55 -55
  208. package/esm2020/lib/core/services/patch.service.mjs +63 -63
  209. package/esm2020/lib/core/services/platform.service.mjs +42 -42
  210. package/esm2020/lib/core/tokens/accept-language.token.mjs +3 -3
  211. package/esm2020/lib/core/tokens/base-url.token.mjs +3 -3
  212. package/esm2020/lib/core/tokens/cookie.token.mjs +3 -3
  213. package/esm2020/lib/core/tokens/location.token.mjs +6 -6
  214. package/esm2020/lib/core/tokens/navigator.token.mjs +6 -6
  215. package/esm2020/lib/core/tokens/window.token.mjs +12 -12
  216. package/esm2020/localize/bravobit-bb-foundation-localize.mjs +4 -4
  217. package/esm2020/localize/lib/functions/date.function.mjs +18 -18
  218. package/esm2020/localize/lib/functions/lowercase.function.mjs +13 -13
  219. package/esm2020/localize/lib/functions/uppercase.function.mjs +13 -13
  220. package/esm2020/localize/lib/handlers/missing.handler.mjs +15 -15
  221. package/esm2020/localize/lib/interfaces/config.interfaces.mjs +7 -7
  222. package/esm2020/localize/lib/interfaces/functions.interfaces.mjs +8 -8
  223. package/esm2020/localize/lib/interfaces/handlers.interfaces.mjs +2 -2
  224. package/esm2020/localize/lib/interfaces/options.interfaces.mjs +6 -6
  225. package/esm2020/localize/lib/localizations/dutch.localization.mjs +45 -45
  226. package/esm2020/localize/lib/localizations/english.localization.mjs +45 -45
  227. package/esm2020/localize/lib/localize.dictionary.mjs +26 -26
  228. package/esm2020/localize/lib/localize.module.mjs +71 -71
  229. package/esm2020/localize/lib/localize.pipe.mjs +49 -49
  230. package/esm2020/localize/lib/localize.service.mjs +207 -207
  231. package/esm2020/localize/lib/views/localize-string/localize-string.component.mjs +88 -88
  232. package/esm2020/localize/lib/views/localize-template-or-string.directive.mjs +28 -28
  233. package/esm2020/localize/lib/views/localize-template.directive.mjs +21 -21
  234. package/esm2020/localize/public_api.mjs +17 -17
  235. package/esm2020/masking/bravobit-bb-foundation-masking.mjs +4 -4
  236. package/esm2020/masking/lib/input-mask.directive.mjs +117 -110
  237. package/esm2020/masking/lib/input-mask.interface.mjs +2 -2
  238. package/esm2020/masking/lib/masking.module.mjs +16 -16
  239. package/esm2020/masking/lib/masking.service.mjs +103 -94
  240. package/esm2020/masking/public_api.mjs +5 -5
  241. package/esm2020/notifications/bravobit-bb-foundation-notifications.mjs +4 -4
  242. package/esm2020/notifications/lib/notifications-item/notifications-item.component.mjs +100 -100
  243. package/esm2020/notifications/lib/notifications-list/notifications-list.component.mjs +47 -47
  244. package/esm2020/notifications/lib/notifications.animations.mjs +28 -28
  245. package/esm2020/notifications/lib/notifications.injector.mjs +18 -18
  246. package/esm2020/notifications/lib/notifications.interfaces.mjs +20 -20
  247. package/esm2020/notifications/lib/notifications.module.mjs +30 -30
  248. package/esm2020/notifications/lib/notifications.service.mjs +145 -145
  249. package/esm2020/notifications/public_api.mjs +4 -4
  250. package/esm2020/public_api.mjs +29 -29
  251. package/esm2020/recaptcha/bravobit-bb-foundation-recaptcha.mjs +4 -4
  252. package/esm2020/recaptcha/lib/recaptcha/recaptcha.component.mjs +185 -185
  253. package/esm2020/recaptcha/lib/recaptcha-loader.service.mjs +90 -90
  254. package/esm2020/recaptcha/lib/recaptcha.interface.mjs +3 -3
  255. package/esm2020/recaptcha/lib/recaptcha.module.mjs +27 -27
  256. package/esm2020/recaptcha/public_api.mjs +5 -5
  257. package/esm2020/rxjs/bravobit-bb-foundation-rxjs.mjs +4 -4
  258. package/esm2020/rxjs/lib/observables/get-control-value.observable.mjs +6 -0
  259. package/esm2020/rxjs/lib/operators/combine-latest-map.operator.mjs +10 -10
  260. package/esm2020/rxjs/lib/operators/filter-nil.operator.mjs +5 -5
  261. package/esm2020/rxjs/public_api.mjs +4 -3
  262. package/esm2020/storage/bravobit-bb-foundation-storage.mjs +4 -4
  263. package/esm2020/storage/lib/interfaces/attributes.interface.mjs +2 -2
  264. package/esm2020/storage/lib/interfaces/memory.interface.mjs +2 -2
  265. package/esm2020/storage/lib/interfaces/strategy.interface.mjs +2 -2
  266. package/esm2020/storage/lib/storage.service.mjs +109 -109
  267. package/esm2020/storage/lib/strategies/cookie-storage.strategy.mjs +142 -142
  268. package/esm2020/storage/lib/strategies/memory-storage.strategy.mjs +56 -56
  269. package/esm2020/storage/lib/strategies/polyfill-storage.strategy.mjs +102 -102
  270. package/esm2020/storage/public_api.mjs +8 -8
  271. package/esm2020/table/bravobit-bb-foundation-table.mjs +4 -4
  272. package/esm2020/table/lib/components/table/table.component.mjs +191 -191
  273. package/esm2020/table/lib/components/table-cell/table-cell.component.mjs +11 -11
  274. package/esm2020/table/lib/components/table-header-cell/table-header-cell.component.mjs +131 -131
  275. package/esm2020/table/lib/components/table-pager/table-pager.component.mjs +136 -136
  276. package/esm2020/table/lib/data/datasource.data.mjs +32 -32
  277. package/esm2020/table/lib/data/generic.data.mjs +72 -72
  278. package/esm2020/table/lib/interfaces/datasource.interface.mjs +2 -2
  279. package/esm2020/table/lib/interfaces/table.interfaces.mjs +2 -2
  280. package/esm2020/table/lib/table.module.mjs +42 -42
  281. package/esm2020/table/public_api.mjs +10 -10
  282. package/esm2020/theming/bravobit-bb-foundation-theming.mjs +4 -4
  283. package/esm2020/theming/lib/themes/checkbox-group.theme.mjs +2 -2
  284. package/esm2020/theming/lib/themes/checkbox.theme.mjs +2 -2
  285. package/esm2020/theming/lib/themes/theme.mjs +34 -0
  286. package/esm2020/theming/lib/theming.interface.mjs +3 -3
  287. package/esm2020/theming/lib/theming.module.mjs +38 -38
  288. package/esm2020/theming/lib/theming.service.mjs +77 -100
  289. package/esm2020/theming/public_api.mjs +7 -4
  290. package/fesm2015/bravobit-bb-foundation-auth.mjs +930 -930
  291. package/fesm2015/bravobit-bb-foundation-auth.mjs.map +1 -1
  292. package/fesm2015/bravobit-bb-foundation-collections.mjs +443 -424
  293. package/fesm2015/bravobit-bb-foundation-collections.mjs.map +1 -1
  294. package/fesm2015/bravobit-bb-foundation-controls.mjs +229 -229
  295. package/fesm2015/bravobit-bb-foundation-controls.mjs.map +1 -1
  296. package/fesm2015/bravobit-bb-foundation-dashboard.mjs +382 -382
  297. package/fesm2015/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  298. package/fesm2015/bravobit-bb-foundation-dialog.mjs +540 -540
  299. package/fesm2015/bravobit-bb-foundation-dialog.mjs.map +1 -1
  300. package/fesm2015/bravobit-bb-foundation-elements.mjs +1970 -1970
  301. package/fesm2015/bravobit-bb-foundation-elements.mjs.map +1 -1
  302. package/fesm2015/bravobit-bb-foundation-http.mjs +156 -156
  303. package/fesm2015/bravobit-bb-foundation-http.mjs.map +1 -1
  304. package/fesm2015/bravobit-bb-foundation-localize.mjs +608 -608
  305. package/fesm2015/bravobit-bb-foundation-localize.mjs.map +1 -1
  306. package/fesm2015/bravobit-bb-foundation-masking.mjs +231 -214
  307. package/fesm2015/bravobit-bb-foundation-masking.mjs.map +1 -1
  308. package/fesm2015/bravobit-bb-foundation-notifications.mjs +348 -348
  309. package/fesm2015/bravobit-bb-foundation-notifications.mjs.map +1 -1
  310. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs +290 -290
  311. package/fesm2015/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  312. package/fesm2015/bravobit-bb-foundation-rxjs.mjs +14 -10
  313. package/fesm2015/bravobit-bb-foundation-rxjs.mjs.map +1 -1
  314. package/fesm2015/bravobit-bb-foundation-storage.mjs +401 -401
  315. package/fesm2015/bravobit-bb-foundation-storage.mjs.map +1 -1
  316. package/fesm2015/bravobit-bb-foundation-table.mjs +571 -571
  317. package/fesm2015/bravobit-bb-foundation-table.mjs.map +1 -1
  318. package/fesm2015/bravobit-bb-foundation-theming.mjs +151 -140
  319. package/fesm2015/bravobit-bb-foundation-theming.mjs.map +1 -1
  320. package/fesm2015/bravobit-bb-foundation.mjs +859 -859
  321. package/fesm2015/bravobit-bb-foundation.mjs.map +1 -1
  322. package/fesm2020/bravobit-bb-foundation-auth.mjs +882 -882
  323. package/fesm2020/bravobit-bb-foundation-auth.mjs.map +1 -1
  324. package/fesm2020/bravobit-bb-foundation-collections.mjs +432 -414
  325. package/fesm2020/bravobit-bb-foundation-collections.mjs.map +1 -1
  326. package/fesm2020/bravobit-bb-foundation-controls.mjs +227 -227
  327. package/fesm2020/bravobit-bb-foundation-controls.mjs.map +1 -1
  328. package/fesm2020/bravobit-bb-foundation-dashboard.mjs +370 -370
  329. package/fesm2020/bravobit-bb-foundation-dashboard.mjs.map +1 -1
  330. package/fesm2020/bravobit-bb-foundation-dialog.mjs +539 -539
  331. package/fesm2020/bravobit-bb-foundation-dialog.mjs.map +1 -1
  332. package/fesm2020/bravobit-bb-foundation-elements.mjs +1927 -1927
  333. package/fesm2020/bravobit-bb-foundation-elements.mjs.map +1 -1
  334. package/fesm2020/bravobit-bb-foundation-http.mjs +148 -148
  335. package/fesm2020/bravobit-bb-foundation-http.mjs.map +1 -1
  336. package/fesm2020/bravobit-bb-foundation-localize.mjs +587 -587
  337. package/fesm2020/bravobit-bb-foundation-localize.mjs.map +1 -1
  338. package/fesm2020/bravobit-bb-foundation-masking.mjs +219 -203
  339. package/fesm2020/bravobit-bb-foundation-masking.mjs.map +1 -1
  340. package/fesm2020/bravobit-bb-foundation-notifications.mjs +346 -346
  341. package/fesm2020/bravobit-bb-foundation-notifications.mjs.map +1 -1
  342. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs +280 -280
  343. package/fesm2020/bravobit-bb-foundation-recaptcha.mjs.map +1 -1
  344. package/fesm2020/bravobit-bb-foundation-rxjs.mjs +17 -13
  345. package/fesm2020/bravobit-bb-foundation-rxjs.mjs.map +1 -1
  346. package/fesm2020/bravobit-bb-foundation-storage.mjs +396 -396
  347. package/fesm2020/bravobit-bb-foundation-storage.mjs.map +1 -1
  348. package/fesm2020/bravobit-bb-foundation-table.mjs +560 -560
  349. package/fesm2020/bravobit-bb-foundation-table.mjs.map +1 -1
  350. package/fesm2020/bravobit-bb-foundation-theming.mjs +141 -130
  351. package/fesm2020/bravobit-bb-foundation-theming.mjs.map +1 -1
  352. package/fesm2020/bravobit-bb-foundation.mjs +831 -831
  353. package/fesm2020/bravobit-bb-foundation.mjs.map +1 -1
  354. package/http/index.d.ts +5 -5
  355. package/http/lib/classes/http.config.d.ts +9 -9
  356. package/http/lib/classes/http.error.d.ts +7 -7
  357. package/http/lib/http.interfaces.d.ts +12 -12
  358. package/http/lib/http.module.d.ts +15 -15
  359. package/http/lib/interceptors/base-url.interceptor.d.ts +15 -15
  360. package/http/lib/interceptors/error.interceptor.d.ts +11 -11
  361. package/http/public_api.d.ts +6 -6
  362. package/index.d.ts +5 -5
  363. package/lib/core/miscellaneous/regex.d.ts +4 -4
  364. package/lib/core/miscellaneous/validator.d.ts +13 -13
  365. package/lib/core/mixins/can-disable.d.ts +6 -6
  366. package/lib/core/mixins/can-hide-errors.d.ts +6 -6
  367. package/lib/core/mixins/can-load.d.ts +6 -6
  368. package/lib/core/mixins/constructor.d.ts +1 -1
  369. package/lib/core/mixins/has-error.d.ts +6 -6
  370. package/lib/core/mixins/is-focused.d.ts +6 -6
  371. package/lib/core/mixins/is-grouped.d.ts +6 -6
  372. package/lib/core/mixins/is-readonly.d.ts +6 -6
  373. package/lib/core/mixins/is-required.d.ts +6 -6
  374. package/lib/core/services/clipboard.service.d.ts +18 -18
  375. package/lib/core/services/exif.service.d.ts +15 -15
  376. package/lib/core/services/file-loader.service.d.ts +13 -13
  377. package/lib/core/services/image-converter.service.d.ts +21 -21
  378. package/lib/core/services/languages.service.d.ts +16 -16
  379. package/lib/core/services/network.service.d.ts +14 -14
  380. package/lib/core/services/patch.service.d.ts +16 -16
  381. package/lib/core/services/platform.service.d.ts +18 -18
  382. package/lib/core/tokens/accept-language.token.d.ts +2 -2
  383. package/lib/core/tokens/base-url.token.d.ts +2 -2
  384. package/lib/core/tokens/cookie.token.d.ts +2 -2
  385. package/lib/core/tokens/location.token.d.ts +2 -2
  386. package/lib/core/tokens/navigator.token.d.ts +2 -2
  387. package/lib/core/tokens/window.token.d.ts +2 -2
  388. package/localize/index.d.ts +5 -5
  389. package/localize/lib/functions/date.function.d.ts +5 -5
  390. package/localize/lib/functions/lowercase.function.d.ts +5 -5
  391. package/localize/lib/functions/uppercase.function.d.ts +5 -5
  392. package/localize/lib/handlers/missing.handler.d.ts +6 -6
  393. package/localize/lib/interfaces/config.interfaces.d.ts +18 -18
  394. package/localize/lib/interfaces/functions.interfaces.d.ts +9 -9
  395. package/localize/lib/interfaces/handlers.interfaces.d.ts +6 -6
  396. package/localize/lib/interfaces/options.interfaces.d.ts +10 -10
  397. package/localize/lib/localizations/dutch.localization.d.ts +44 -44
  398. package/localize/lib/localizations/english.localization.d.ts +44 -44
  399. package/localize/lib/localize.dictionary.d.ts +7 -7
  400. package/localize/lib/localize.module.d.ts +17 -17
  401. package/localize/lib/localize.pipe.d.ts +12 -12
  402. package/localize/lib/localize.service.d.ts +40 -40
  403. package/localize/lib/views/localize-string/localize-string.component.d.ts +23 -23
  404. package/localize/lib/views/localize-template-or-string.directive.d.ts +10 -10
  405. package/localize/lib/views/localize-template.directive.d.ts +9 -9
  406. package/localize/public_api.d.ts +16 -16
  407. package/masking/index.d.ts +5 -5
  408. package/masking/lib/input-mask.directive.d.ts +38 -36
  409. package/masking/lib/input-mask.interface.d.ts +24 -20
  410. package/masking/lib/masking.module.d.ts +7 -7
  411. package/masking/lib/masking.service.d.ts +12 -12
  412. package/masking/public_api.d.ts +4 -4
  413. package/notifications/index.d.ts +5 -5
  414. package/notifications/lib/notifications-item/notifications-item.component.d.ts +34 -34
  415. package/notifications/lib/notifications-list/notifications-list.component.d.ts +16 -16
  416. package/notifications/lib/notifications.animations.d.ts +1 -1
  417. package/notifications/lib/notifications.injector.d.ts +8 -8
  418. package/notifications/lib/notifications.interfaces.d.ts +49 -49
  419. package/notifications/lib/notifications.module.d.ts +13 -13
  420. package/notifications/lib/notifications.service.d.ts +34 -34
  421. package/notifications/public_api.d.ts +3 -3
  422. package/package.json +1 -1
  423. package/public_api.d.ts +25 -25
  424. package/recaptcha/index.d.ts +5 -5
  425. package/recaptcha/lib/recaptcha/recaptcha.component.d.ts +47 -47
  426. package/recaptcha/lib/recaptcha-loader.service.d.ts +22 -22
  427. package/recaptcha/lib/recaptcha.interface.d.ts +14 -14
  428. package/recaptcha/lib/recaptcha.module.d.ts +10 -10
  429. package/recaptcha/public_api.d.ts +4 -4
  430. package/rxjs/index.d.ts +5 -5
  431. package/rxjs/lib/observables/get-control-value.observable.d.ts +3 -0
  432. package/rxjs/lib/operators/combine-latest-map.operator.d.ts +8 -8
  433. package/rxjs/lib/operators/filter-nil.operator.d.ts +1 -1
  434. package/rxjs/public_api.d.ts +3 -2
  435. package/storage/index.d.ts +5 -5
  436. package/storage/lib/interfaces/attributes.interface.d.ts +13 -13
  437. package/storage/lib/interfaces/memory.interface.d.ts +7 -7
  438. package/storage/lib/interfaces/strategy.interface.d.ts +17 -17
  439. package/storage/lib/storage.service.d.ts +26 -26
  440. package/storage/lib/strategies/cookie-storage.strategy.d.ts +20 -20
  441. package/storage/lib/strategies/memory-storage.strategy.d.ts +11 -11
  442. package/storage/lib/strategies/polyfill-storage.strategy.d.ts +15 -15
  443. package/storage/public_api.d.ts +7 -7
  444. package/table/index.d.ts +5 -5
  445. package/table/lib/components/table/table.component.d.ts +56 -56
  446. package/table/lib/components/table-cell/table-cell.component.d.ts +5 -5
  447. package/table/lib/components/table-header-cell/table-header-cell.component.d.ts +29 -29
  448. package/table/lib/components/table-pager/table-pager.component.d.ts +41 -41
  449. package/table/lib/data/datasource.data.d.ts +14 -14
  450. package/table/lib/data/generic.data.d.ts +23 -23
  451. package/table/lib/interfaces/datasource.interface.d.ts +17 -17
  452. package/table/lib/interfaces/table.interfaces.d.ts +1 -1
  453. package/table/lib/table.module.d.ts +14 -14
  454. package/table/public_api.d.ts +9 -9
  455. package/theming/index.d.ts +5 -5
  456. package/theming/lib/themes/checkbox-group.theme.d.ts +5 -5
  457. package/theming/lib/themes/checkbox.theme.d.ts +19 -19
  458. package/theming/lib/themes/theme.d.ts +12 -0
  459. package/theming/lib/theming.interface.d.ts +15 -14
  460. package/theming/lib/theming.module.d.ts +13 -13
  461. package/theming/lib/theming.service.d.ts +22 -24
  462. package/theming/public_api.d.ts +6 -3
@@ -6,915 +6,915 @@ import { map, distinctUntilChanged, shareReplay, debounceTime, startWith } from
6
6
  import { of, fromEvent, Observable, merge, Subscription } from 'rxjs';
7
7
  import { coerceBooleanProperty } from '@angular/cdk/coercion';
8
8
 
9
- let hasV8BreakIterator;
10
- try {
11
- hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
12
- }
13
- catch (_a) {
14
- hasV8BreakIterator = false;
15
- }
16
- class Platform {
17
- constructor(_platformId) {
18
- this._platformId = _platformId;
19
- // Browser check.
20
- this.isBrowser = this._platformId
21
- ? isPlatformBrowser(this._platformId)
22
- : typeof document === 'object' && !!document;
23
- // Is checks.
24
- this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
25
- this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
26
- this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
27
- this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
28
- this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
29
- this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
30
- this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
31
- this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
32
- this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
33
- this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
34
- }
35
- }
36
- Platform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Platform, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
37
- Platform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Platform, providedIn: 'root' });
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Platform, decorators: [{
39
- type: Injectable,
40
- args: [{
41
- providedIn: 'root'
42
- }]
43
- }], ctorParameters: function () {
44
- return [{ type: Object, decorators: [{
45
- type: Inject,
46
- args: [PLATFORM_ID]
47
- }] }];
9
+ let hasV8BreakIterator;
10
+ try {
11
+ hasV8BreakIterator = (typeof Intl !== 'undefined' && Intl.v8BreakIterator);
12
+ }
13
+ catch (_a) {
14
+ hasV8BreakIterator = false;
15
+ }
16
+ class Platform {
17
+ constructor(_platformId) {
18
+ this._platformId = _platformId;
19
+ // Browser check.
20
+ this.isBrowser = this._platformId
21
+ ? isPlatformBrowser(this._platformId)
22
+ : typeof document === 'object' && !!document;
23
+ // Is checks.
24
+ this.isEdge = this.isBrowser && /(edge)/i.test(navigator.userAgent);
25
+ this.isTrident = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);
26
+ this.isBlink = this.isBrowser && (!!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.isEdge && !this.isTrident);
27
+ this.isWebkit = this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.isBlink && !this.isEdge && !this.isTrident;
28
+ this.isChrome = this.isBrowser && /Google Inc./.test(navigator.vendor);
29
+ this.isFirefox = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);
30
+ this.isSafari = this.isBrowser && /safari/i.test(navigator.userAgent) && this.isWebkit;
31
+ this.isAndroid = this.isBrowser && /android/i.test(navigator.userAgent) && !this.isTrident;
32
+ this.isIos = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window);
33
+ this.isDesktop = this.isBrowser && !(/(iPhone|iPod|iPad|Android|BlackBerry|IEMobile)/.test(navigator.userAgent));
34
+ }
35
+ }
36
+ Platform.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Platform, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable });
37
+ Platform.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Platform, providedIn: 'root' });
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Platform, decorators: [{
39
+ type: Injectable,
40
+ args: [{
41
+ providedIn: 'root'
42
+ }]
43
+ }], ctorParameters: function () {
44
+ return [{ type: Object, decorators: [{
45
+ type: Inject,
46
+ args: [PLATFORM_ID]
47
+ }] }];
48
48
  } });
49
49
 
50
- class FileLoader {
51
- constructor() {
52
- this.isFile = (input) => {
53
- return 'File' in window && input instanceof File;
54
- };
55
- this.isBlob = (input) => {
56
- return 'Blob' in window && input instanceof Blob;
57
- };
58
- this.blobToFile = (blob, fileName) => {
59
- const anyBlob = blob;
60
- anyBlob.lastModifiedDate = new Date();
61
- anyBlob.name = fileName;
62
- return anyBlob;
63
- };
64
- }
65
- fromDataUrl(value, name = 'file') {
66
- if (!value) {
67
- return null;
68
- }
69
- try {
70
- // Convert base64 to raw binary data held in a string.
71
- const byteString = window.atob(value.split(',')[1]);
72
- // Separate out the mime component.
73
- const mimeString = value
74
- .split(',')[0]
75
- .split(':')[1]
76
- .split(';')[0];
77
- // Write the bytes of the string to an ArrayBuffer.
78
- const arrayBuffer = new ArrayBuffer(byteString.length);
79
- const uint8Array = new Uint8Array(arrayBuffer);
80
- for (let index = 0; index < byteString.length; index++) {
81
- uint8Array[index] = byteString.charCodeAt(index);
82
- }
83
- const dataView = new DataView(arrayBuffer);
84
- const blob = new Blob([dataView.buffer], { type: mimeString });
85
- return this.createFile(blob, name);
86
- }
87
- catch (_a) {
88
- return null;
89
- }
90
- }
91
- asDataUrl(file) {
92
- return this.read(file, 'dataurl');
93
- }
94
- asArrayBuffer(file) {
95
- return this.read(file, 'arraybuffer');
96
- }
97
- read(file, type) {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- return new Promise((resolve, reject) => {
100
- const isFileLike = this.isFile(file) || this.isBlob(file);
101
- if (!file || !isFileLike) {
102
- return reject('Invalid file');
103
- }
104
- const reader = new FileReader();
105
- reader.onerror = () => reject('Error file read');
106
- reader.onabort = () => reject('Abort file read');
107
- reader.onload = () => {
108
- const result = reader.result;
109
- return resolve(result);
110
- };
111
- if (type === 'dataurl') {
112
- reader.readAsDataURL(file);
113
- }
114
- else if (type === 'arraybuffer') {
115
- reader.readAsArrayBuffer(file);
116
- }
117
- });
118
- });
119
- }
120
- createFile(blob, name) {
121
- if (!navigator['msSaveBlob']) {
122
- return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
123
- }
124
- const blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
125
- return this.blobToFile(blobFile, name);
126
- }
127
- }
128
- FileLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: FileLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
129
- FileLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: FileLoader, providedIn: 'root' });
130
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: FileLoader, decorators: [{
131
- type: Injectable,
132
- args: [{
133
- providedIn: 'root'
134
- }]
50
+ class FileLoader {
51
+ constructor() {
52
+ this.isFile = (input) => {
53
+ return 'File' in window && input instanceof File;
54
+ };
55
+ this.isBlob = (input) => {
56
+ return 'Blob' in window && input instanceof Blob;
57
+ };
58
+ this.blobToFile = (blob, fileName) => {
59
+ const anyBlob = blob;
60
+ anyBlob.lastModifiedDate = new Date();
61
+ anyBlob.name = fileName;
62
+ return anyBlob;
63
+ };
64
+ }
65
+ fromDataUrl(value, name = 'file') {
66
+ if (!value) {
67
+ return null;
68
+ }
69
+ try {
70
+ // Convert base64 to raw binary data held in a string.
71
+ const byteString = window.atob(value.split(',')[1]);
72
+ // Separate out the mime component.
73
+ const mimeString = value
74
+ .split(',')[0]
75
+ .split(':')[1]
76
+ .split(';')[0];
77
+ // Write the bytes of the string to an ArrayBuffer.
78
+ const arrayBuffer = new ArrayBuffer(byteString.length);
79
+ const uint8Array = new Uint8Array(arrayBuffer);
80
+ for (let index = 0; index < byteString.length; index++) {
81
+ uint8Array[index] = byteString.charCodeAt(index);
82
+ }
83
+ const dataView = new DataView(arrayBuffer);
84
+ const blob = new Blob([dataView.buffer], { type: mimeString });
85
+ return this.createFile(blob, name);
86
+ }
87
+ catch (_a) {
88
+ return null;
89
+ }
90
+ }
91
+ asDataUrl(file) {
92
+ return this.read(file, 'dataurl');
93
+ }
94
+ asArrayBuffer(file) {
95
+ return this.read(file, 'arraybuffer');
96
+ }
97
+ read(file, type) {
98
+ return __awaiter(this, void 0, void 0, function* () {
99
+ return new Promise((resolve, reject) => {
100
+ const isFileLike = this.isFile(file) || this.isBlob(file);
101
+ if (!file || !isFileLike) {
102
+ return reject('Invalid file');
103
+ }
104
+ const reader = new FileReader();
105
+ reader.onerror = () => reject('Error file read');
106
+ reader.onabort = () => reject('Abort file read');
107
+ reader.onload = () => {
108
+ const result = reader.result;
109
+ return resolve(result);
110
+ };
111
+ if (type === 'dataurl') {
112
+ reader.readAsDataURL(file);
113
+ }
114
+ else if (type === 'arraybuffer') {
115
+ reader.readAsArrayBuffer(file);
116
+ }
117
+ });
118
+ });
119
+ }
120
+ createFile(blob, name) {
121
+ if (!navigator['msSaveBlob']) {
122
+ return new File([blob], name, { lastModified: Date.now(), type: blob === null || blob === void 0 ? void 0 : blob.type });
123
+ }
124
+ const blobFile = new Blob([blob], { type: blob === null || blob === void 0 ? void 0 : blob.type });
125
+ return this.blobToFile(blobFile, name);
126
+ }
127
+ }
128
+ FileLoader.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FileLoader, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
129
+ FileLoader.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FileLoader, providedIn: 'root' });
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: FileLoader, decorators: [{
131
+ type: Injectable,
132
+ args: [{
133
+ providedIn: 'root'
134
+ }]
135
135
  }] });
136
136
 
137
- class Exif {
138
- constructor(_platform, _fileLoader) {
139
- this._platform = _platform;
140
- this._fileLoader = _fileLoader;
141
- this.transformImage = (image, type, orientation, quality = 100) => {
142
- // Create the canvas and context.
143
- const canvas = document.createElement('canvas');
144
- const context = canvas.getContext('2d');
145
- // Validate the context exists.
146
- if (!context) {
147
- return null;
148
- }
149
- // Set the canvas size based on the image.
150
- const { width, height } = image;
151
- canvas.width = width;
152
- canvas.height = height;
153
- // Validate the orientation is correct
154
- // else flip the canvas sizes.
155
- if (4 < orientation && orientation < 9) {
156
- canvas.width = height;
157
- canvas.height = width;
158
- }
159
- // Transform the context based on the orientation.
160
- switch (orientation) {
161
- case 2:
162
- context.transform(-1, 0, 0, 1, width, 0);
163
- break;
164
- case 3:
165
- context.transform(-1, 0, 0, -1, width, height);
166
- break;
167
- case 4:
168
- context.transform(1, 0, 0, -1, 0, height);
169
- break;
170
- case 5:
171
- context.transform(0, 1, 1, 0, 0, 0);
172
- break;
173
- case 6:
174
- context.transform(0, 1, -1, 0, height, 0);
175
- break;
176
- case 7:
177
- context.transform(0, -1, -1, 0, height, width);
178
- break;
179
- case 8:
180
- context.transform(0, -1, 1, 0, 0, width);
181
- break;
182
- default:
183
- break;
184
- }
185
- // Draw the image on the context and return the data URL.
186
- context.drawImage(image, 0, 0, width, height);
187
- return canvas.toDataURL(type, quality / 100);
188
- };
189
- this.getSupportedCanvasType = (fileType) => {
190
- switch (fileType) {
191
- case 'image/jpeg':
192
- case 'image/jpg':
193
- return 'image/jpeg';
194
- case 'image/x-windows-bmp':
195
- case 'image/bmp':
196
- return 'image/bmp';
197
- default:
198
- return 'image/png';
199
- }
200
- };
201
- this.getOrientation = (buffer) => {
202
- // Create a new data view.
203
- const view = new DataView(buffer);
204
- if (view.getUint16(0, false) !== 0xFFD8) {
205
- return -2;
206
- }
207
- const length = view.byteLength;
208
- let offset = 2;
209
- while (offset < length) {
210
- if (view.getUint16(offset + 2, false) <= 8) {
211
- return -1;
212
- }
213
- const marker = view.getUint16(offset, false);
214
- offset += 2;
215
- if (marker === 0xFFE1) {
216
- if (view.getUint32(offset += 2, false) !== 0x45786966) {
217
- return -1;
218
- }
219
- const little = view.getUint16(offset += 6, false) === 0x4949;
220
- offset += view.getUint32(offset + 4, little);
221
- const tags = view.getUint16(offset, little);
222
- offset += 2;
223
- for (let index = 0; index < tags; index++) {
224
- if (view.getUint16(offset + index * 12, little) === 0x0112) {
225
- return view.getUint16(offset + index * 12 + 8, little);
226
- }
227
- }
228
- }
229
- else if ((marker & 0xFF00) !== 0xFF00) {
230
- break;
231
- }
232
- else {
233
- offset += view.getUint16(offset, false);
234
- }
235
- }
236
- return -1;
237
- };
238
- }
239
- strip(file, quality = 100) {
240
- return __awaiter(this, void 0, void 0, function* () {
241
- // Validate we are on a browser.
242
- if (!this._platform.isBrowser) {
243
- return file;
244
- }
245
- // Validate the file exists and is
246
- // an instance of a File object.
247
- if (!file || !(file instanceof File)) {
248
- return file;
249
- }
250
- // Only jpeg images need correction.
251
- if (!['image/jpeg'].includes(file.type)) {
252
- return file;
253
- }
254
- try {
255
- // Read the file as an array buffer and data url.
256
- const arrayBuffer = yield this._fileLoader.asArrayBuffer(file);
257
- const dataUrl = yield this._fileLoader.asDataUrl(file);
258
- // Create an image element.
259
- const imageElement = yield this.createImageElement(dataUrl);
260
- // Get the orientation by using the buffer.
261
- const orientation = this.getOrientation(arrayBuffer);
262
- // Transform the image to remove the orientation.
263
- const canvasType = this.getSupportedCanvasType(file.type);
264
- const imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
265
- // Validate the image url exists.
266
- if (!imageUrl) {
267
- return file;
268
- }
269
- // Transform the image url to a file.
270
- return this._fileLoader.fromDataUrl(imageUrl, file.name);
271
- }
272
- catch (_a) {
273
- // When something goes wrong we
274
- // just return the default file.
275
- return file;
276
- }
277
- });
278
- }
279
- createImageElement(dataUrl) {
280
- return __awaiter(this, void 0, void 0, function* () {
281
- return new Promise((resolve, reject) => {
282
- const image = new Image();
283
- image.src = dataUrl;
284
- image.onerror = () => reject('Error image create');
285
- image.onabort = () => reject('Abort image create');
286
- image.onload = () => resolve(image);
287
- });
288
- });
289
- }
290
- }
291
- Exif.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Exif, deps: [{ token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
292
- Exif.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Exif, providedIn: 'root' });
293
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Exif, decorators: [{
294
- type: Injectable,
295
- args: [{
296
- providedIn: 'root'
297
- }]
137
+ class Exif {
138
+ constructor(_platform, _fileLoader) {
139
+ this._platform = _platform;
140
+ this._fileLoader = _fileLoader;
141
+ this.transformImage = (image, type, orientation, quality = 100) => {
142
+ // Create the canvas and context.
143
+ const canvas = document.createElement('canvas');
144
+ const context = canvas.getContext('2d');
145
+ // Validate the context exists.
146
+ if (!context) {
147
+ return null;
148
+ }
149
+ // Set the canvas size based on the image.
150
+ const { width, height } = image;
151
+ canvas.width = width;
152
+ canvas.height = height;
153
+ // Validate the orientation is correct
154
+ // else flip the canvas sizes.
155
+ if (4 < orientation && orientation < 9) {
156
+ canvas.width = height;
157
+ canvas.height = width;
158
+ }
159
+ // Transform the context based on the orientation.
160
+ switch (orientation) {
161
+ case 2:
162
+ context.transform(-1, 0, 0, 1, width, 0);
163
+ break;
164
+ case 3:
165
+ context.transform(-1, 0, 0, -1, width, height);
166
+ break;
167
+ case 4:
168
+ context.transform(1, 0, 0, -1, 0, height);
169
+ break;
170
+ case 5:
171
+ context.transform(0, 1, 1, 0, 0, 0);
172
+ break;
173
+ case 6:
174
+ context.transform(0, 1, -1, 0, height, 0);
175
+ break;
176
+ case 7:
177
+ context.transform(0, -1, -1, 0, height, width);
178
+ break;
179
+ case 8:
180
+ context.transform(0, -1, 1, 0, 0, width);
181
+ break;
182
+ default:
183
+ break;
184
+ }
185
+ // Draw the image on the context and return the data URL.
186
+ context.drawImage(image, 0, 0, width, height);
187
+ return canvas.toDataURL(type, quality / 100);
188
+ };
189
+ this.getSupportedCanvasType = (fileType) => {
190
+ switch (fileType) {
191
+ case 'image/jpeg':
192
+ case 'image/jpg':
193
+ return 'image/jpeg';
194
+ case 'image/x-windows-bmp':
195
+ case 'image/bmp':
196
+ return 'image/bmp';
197
+ default:
198
+ return 'image/png';
199
+ }
200
+ };
201
+ this.getOrientation = (buffer) => {
202
+ // Create a new data view.
203
+ const view = new DataView(buffer);
204
+ if (view.getUint16(0, false) !== 0xFFD8) {
205
+ return -2;
206
+ }
207
+ const length = view.byteLength;
208
+ let offset = 2;
209
+ while (offset < length) {
210
+ if (view.getUint16(offset + 2, false) <= 8) {
211
+ return -1;
212
+ }
213
+ const marker = view.getUint16(offset, false);
214
+ offset += 2;
215
+ if (marker === 0xFFE1) {
216
+ if (view.getUint32(offset += 2, false) !== 0x45786966) {
217
+ return -1;
218
+ }
219
+ const little = view.getUint16(offset += 6, false) === 0x4949;
220
+ offset += view.getUint32(offset + 4, little);
221
+ const tags = view.getUint16(offset, little);
222
+ offset += 2;
223
+ for (let index = 0; index < tags; index++) {
224
+ if (view.getUint16(offset + index * 12, little) === 0x0112) {
225
+ return view.getUint16(offset + index * 12 + 8, little);
226
+ }
227
+ }
228
+ }
229
+ else if ((marker & 0xFF00) !== 0xFF00) {
230
+ break;
231
+ }
232
+ else {
233
+ offset += view.getUint16(offset, false);
234
+ }
235
+ }
236
+ return -1;
237
+ };
238
+ }
239
+ strip(file, quality = 100) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ // Validate we are on a browser.
242
+ if (!this._platform.isBrowser) {
243
+ return file;
244
+ }
245
+ // Validate the file exists and is
246
+ // an instance of a File object.
247
+ if (!file || !(file instanceof File)) {
248
+ return file;
249
+ }
250
+ // Only jpeg images need correction.
251
+ if (!['image/jpeg'].includes(file.type)) {
252
+ return file;
253
+ }
254
+ try {
255
+ // Read the file as an array buffer and data url.
256
+ const arrayBuffer = yield this._fileLoader.asArrayBuffer(file);
257
+ const dataUrl = yield this._fileLoader.asDataUrl(file);
258
+ // Create an image element.
259
+ const imageElement = yield this.createImageElement(dataUrl);
260
+ // Get the orientation by using the buffer.
261
+ const orientation = this.getOrientation(arrayBuffer);
262
+ // Transform the image to remove the orientation.
263
+ const canvasType = this.getSupportedCanvasType(file.type);
264
+ const imageUrl = this.transformImage(imageElement, canvasType, orientation, quality);
265
+ // Validate the image url exists.
266
+ if (!imageUrl) {
267
+ return file;
268
+ }
269
+ // Transform the image url to a file.
270
+ return this._fileLoader.fromDataUrl(imageUrl, file.name);
271
+ }
272
+ catch (_a) {
273
+ // When something goes wrong we
274
+ // just return the default file.
275
+ return file;
276
+ }
277
+ });
278
+ }
279
+ createImageElement(dataUrl) {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ return new Promise((resolve, reject) => {
282
+ const image = new Image();
283
+ image.src = dataUrl;
284
+ image.onerror = () => reject('Error image create');
285
+ image.onabort = () => reject('Abort image create');
286
+ image.onload = () => resolve(image);
287
+ });
288
+ });
289
+ }
290
+ }
291
+ Exif.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Exif, deps: [{ token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
292
+ Exif.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Exif, providedIn: 'root' });
293
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Exif, decorators: [{
294
+ type: Injectable,
295
+ args: [{
296
+ providedIn: 'root'
297
+ }]
298
298
  }], ctorParameters: function () { return [{ type: Platform }, { type: FileLoader }]; } });
299
299
 
300
- class ImageConverter {
301
- constructor(_exif, _platform, _fileLoader) {
302
- this._exif = _exif;
303
- this._platform = _platform;
304
- this._fileLoader = _fileLoader;
305
- // Data.
306
- this._types = ['image/png', 'image/jpeg'];
307
- this.calculateOffsetAndDimensions = (image, canvasWidth, canvasHeight) => {
308
- const originalWidth = image.width;
309
- const originalHeight = image.height;
310
- const widthRatio = canvasWidth / originalWidth;
311
- const heightRatio = canvasHeight / originalHeight;
312
- let width;
313
- let height;
314
- if (originalWidth > originalHeight) {
315
- height = originalHeight * heightRatio;
316
- width = (originalWidth / originalHeight) * height;
317
- }
318
- else {
319
- width = originalWidth * widthRatio;
320
- height = (originalHeight / originalWidth) * width;
321
- }
322
- let xOffset = 0;
323
- let yOffset = 0;
324
- if (canvasHeight === height) {
325
- xOffset = -((width - canvasWidth) / 2);
326
- }
327
- else if (canvasWidth === width) {
328
- yOffset = -((height - canvasHeight) / 2);
329
- }
330
- return { xOffset, yOffset, width, height };
331
- };
332
- }
333
- toDataUri(contents, options = null) {
334
- return __awaiter(this, void 0, void 0, function* () {
335
- // Check if the current platform is a browser.
336
- if (!this._platform.isBrowser) {
337
- return null;
338
- }
339
- // Get the image.
340
- const image = yield this.getImage(contents);
341
- // Get the canvas width and height.
342
- const canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
343
- const canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
344
- // Get the canvas and context.
345
- const canvas = document.createElement('canvas');
346
- const context = canvas.getContext('2d');
347
- // Validate the context exists.
348
- if (!context) {
349
- return null;
350
- }
351
- // Set the width and height.
352
- canvas.width = canvasWidth;
353
- canvas.height = canvasHeight;
354
- // When the canvas sizes are 0 we have failed.
355
- if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
356
- return null;
357
- }
358
- // Check if dimensions where supplied, else create the image.
359
- if (!options) {
360
- // Draw the image.
361
- context.drawImage(image, 0, 0);
362
- // Convert the canvas to a data url.
363
- return canvas.toDataURL(this._types[0]);
364
- }
365
- // Get the dimensions and offsets.
366
- const { width, height, xOffset, yOffset } = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight);
367
- // Draw the image.
368
- context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
369
- // Convert the canvas to a data url.
370
- return canvas.toDataURL(this._types[0]);
371
- });
372
- }
373
- fileToImage(file, types = this._types) {
374
- return __awaiter(this, void 0, void 0, function* () {
375
- // Check if the file matches an image.
376
- if (!types.includes(file.type)) {
377
- throw new Error('The selected file does not meet the required format.');
378
- }
379
- let stripped = null;
380
- try {
381
- stripped = yield this._exif.strip(file, 90);
382
- }
383
- catch (_a) {
384
- // Do nothing.
385
- }
386
- // Ge the data uri.
387
- const dataUri = yield this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file);
388
- // Convert the data URI to a image element.
389
- return yield this.stringToImage(dataUri);
390
- });
391
- }
392
- stringToImage(src) {
393
- return new Promise((resolve, reject) => {
394
- const image = new Image();
395
- image.src = src;
396
- image.onload = () => resolve(image);
397
- image.onerror = error => reject(error);
398
- });
399
- }
400
- getImage(contents) {
401
- return __awaiter(this, void 0, void 0, function* () {
402
- // If the contents is already an HTML image element just return it.
403
- if (contents instanceof HTMLImageElement) {
404
- return contents;
405
- }
406
- // If the contents is a file convert it to an HTML image element.
407
- if (contents instanceof File) {
408
- return this.fileToImage(contents);
409
- }
410
- // If the contents is a string convert it to an HTML image element.
411
- return this.stringToImage(contents);
412
- });
413
- }
414
- }
415
- ImageConverter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ImageConverter, deps: [{ token: Exif }, { token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
416
- ImageConverter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ImageConverter, providedIn: 'root' });
417
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: ImageConverter, decorators: [{
418
- type: Injectable,
419
- args: [{
420
- providedIn: 'root'
421
- }]
300
+ class ImageConverter {
301
+ constructor(_exif, _platform, _fileLoader) {
302
+ this._exif = _exif;
303
+ this._platform = _platform;
304
+ this._fileLoader = _fileLoader;
305
+ // Data.
306
+ this._types = ['image/png', 'image/jpeg'];
307
+ this.calculateOffsetAndDimensions = (image, canvasWidth, canvasHeight) => {
308
+ const originalWidth = image.width;
309
+ const originalHeight = image.height;
310
+ const widthRatio = canvasWidth / originalWidth;
311
+ const heightRatio = canvasHeight / originalHeight;
312
+ let width;
313
+ let height;
314
+ if (originalWidth > originalHeight) {
315
+ height = originalHeight * heightRatio;
316
+ width = (originalWidth / originalHeight) * height;
317
+ }
318
+ else {
319
+ width = originalWidth * widthRatio;
320
+ height = (originalHeight / originalWidth) * width;
321
+ }
322
+ let xOffset = 0;
323
+ let yOffset = 0;
324
+ if (canvasHeight === height) {
325
+ xOffset = -((width - canvasWidth) / 2);
326
+ }
327
+ else if (canvasWidth === width) {
328
+ yOffset = -((height - canvasHeight) / 2);
329
+ }
330
+ return { xOffset, yOffset, width, height };
331
+ };
332
+ }
333
+ toDataUri(contents, options = null) {
334
+ return __awaiter(this, void 0, void 0, function* () {
335
+ // Check if the current platform is a browser.
336
+ if (!this._platform.isBrowser) {
337
+ return null;
338
+ }
339
+ // Get the image.
340
+ const image = yield this.getImage(contents);
341
+ // Get the canvas width and height.
342
+ const canvasWidth = (options === null || options === void 0 ? void 0 : options.width) || (image === null || image === void 0 ? void 0 : image.width);
343
+ const canvasHeight = (options === null || options === void 0 ? void 0 : options.height) || (image === null || image === void 0 ? void 0 : image.height);
344
+ // Get the canvas and context.
345
+ const canvas = document.createElement('canvas');
346
+ const context = canvas.getContext('2d');
347
+ // Validate the context exists.
348
+ if (!context) {
349
+ return null;
350
+ }
351
+ // Set the width and height.
352
+ canvas.width = canvasWidth;
353
+ canvas.height = canvasHeight;
354
+ // When the canvas sizes are 0 we have failed.
355
+ if ((canvas === null || canvas === void 0 ? void 0 : canvas.width) === 0 && (canvas === null || canvas === void 0 ? void 0 : canvas.height) === 0) {
356
+ return null;
357
+ }
358
+ // Check if dimensions where supplied, else create the image.
359
+ if (!options) {
360
+ // Draw the image.
361
+ context.drawImage(image, 0, 0);
362
+ // Convert the canvas to a data url.
363
+ return canvas.toDataURL(this._types[0]);
364
+ }
365
+ // Get the dimensions and offsets.
366
+ const { width, height, xOffset, yOffset } = this.calculateOffsetAndDimensions(image, canvasWidth, canvasHeight);
367
+ // Draw the image.
368
+ context.drawImage(image, 0, 0, image.width, image.height, xOffset, yOffset, width, height);
369
+ // Convert the canvas to a data url.
370
+ return canvas.toDataURL(this._types[0]);
371
+ });
372
+ }
373
+ fileToImage(file, types = this._types) {
374
+ return __awaiter(this, void 0, void 0, function* () {
375
+ // Check if the file matches an image.
376
+ if (!types.includes(file.type)) {
377
+ throw new Error('The selected file does not meet the required format.');
378
+ }
379
+ let stripped = null;
380
+ try {
381
+ stripped = yield this._exif.strip(file, 90);
382
+ }
383
+ catch (_a) {
384
+ // Do nothing.
385
+ }
386
+ // Ge the data uri.
387
+ const dataUri = yield this._fileLoader.asDataUrl(stripped !== null && stripped !== void 0 ? stripped : file);
388
+ // Convert the data URI to a image element.
389
+ return yield this.stringToImage(dataUri);
390
+ });
391
+ }
392
+ stringToImage(src) {
393
+ return new Promise((resolve, reject) => {
394
+ const image = new Image();
395
+ image.src = src;
396
+ image.onload = () => resolve(image);
397
+ image.onerror = error => reject(error);
398
+ });
399
+ }
400
+ getImage(contents) {
401
+ return __awaiter(this, void 0, void 0, function* () {
402
+ // If the contents is already an HTML image element just return it.
403
+ if (contents instanceof HTMLImageElement) {
404
+ return contents;
405
+ }
406
+ // If the contents is a file convert it to an HTML image element.
407
+ if (contents instanceof File) {
408
+ return this.fileToImage(contents);
409
+ }
410
+ // If the contents is a string convert it to an HTML image element.
411
+ return this.stringToImage(contents);
412
+ });
413
+ }
414
+ }
415
+ ImageConverter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ImageConverter, deps: [{ token: Exif }, { token: Platform }, { token: FileLoader }], target: i0.ɵɵFactoryTarget.Injectable });
416
+ ImageConverter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ImageConverter, providedIn: 'root' });
417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: ImageConverter, decorators: [{
418
+ type: Injectable,
419
+ args: [{
420
+ providedIn: 'root'
421
+ }]
422
422
  }], ctorParameters: function () { return [{ type: Exif }, { type: Platform }, { type: FileLoader }]; } });
423
423
 
424
424
  const ACCEPT_LANGUAGE = new InjectionToken('AcceptLanguage');
425
425
 
426
- class Languages {
427
- constructor(_acceptLanguage) {
428
- this._acceptLanguage = _acceptLanguage;
429
- // Data.
430
- this._data = [];
431
- this.getLanguages = () => {
432
- // If defined we must be in a server environment.
433
- if (this._acceptLanguage) {
434
- return this._acceptLanguage;
435
- }
436
- // Try to get the languages from the navigator.
437
- if (typeof navigator !== 'object') {
438
- return null;
439
- }
440
- let t = 'anguage';
441
- let n = navigator;
442
- let f = n['l' + t + 's'];
443
- const data = f && f.length ? f : (t = n['l' + t] ||
444
- n['browserL' + t] ||
445
- n['userL' + t]) ? [t] : t;
446
- return typeof data === 'string'
447
- ? data
448
- : data.join(';');
449
- };
450
- this._data = this.initialize();
451
- }
452
- get all() {
453
- return this._data;
454
- }
455
- initialize() {
456
- // Get the languages.
457
- const data = this.getLanguages();
458
- // Parse all languages by using a regex.
459
- const strings = (data || '')
460
- .match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
461
- // Get the content by parsing the strings.
462
- const content = strings.map(item => {
463
- if (!item) {
464
- return null;
465
- }
466
- const bits = item.split(';');
467
- const ietf = bits[0].split('-');
468
- const hasScript = ietf.length === 3;
469
- return {
470
- code: ietf[0],
471
- script: hasScript ? ietf[1] : null,
472
- region: hasScript ? ietf[2] : ietf[1],
473
- quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
474
- };
475
- });
476
- // Filter out all the empty items
477
- // and sort them by the quality.
478
- return content
479
- .filter(item => !!item)
480
- .sort((a, b) => b.quality - a.quality);
481
- }
482
- }
483
- Languages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Languages, deps: [{ token: ACCEPT_LANGUAGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
484
- Languages.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Languages, providedIn: 'root' });
485
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Languages, decorators: [{
486
- type: Injectable,
487
- args: [{
488
- providedIn: 'root'
489
- }]
490
- }], ctorParameters: function () {
491
- return [{ type: undefined, decorators: [{
492
- type: Optional
493
- }, {
494
- type: Inject,
495
- args: [ACCEPT_LANGUAGE]
496
- }] }];
426
+ class Languages {
427
+ constructor(_acceptLanguage) {
428
+ this._acceptLanguage = _acceptLanguage;
429
+ // Data.
430
+ this._data = [];
431
+ this.getLanguages = () => {
432
+ // If defined we must be in a server environment.
433
+ if (this._acceptLanguage) {
434
+ return this._acceptLanguage;
435
+ }
436
+ // Try to get the languages from the navigator.
437
+ if (typeof navigator !== 'object') {
438
+ return null;
439
+ }
440
+ let t = 'anguage';
441
+ let n = navigator;
442
+ let f = n['l' + t + 's'];
443
+ const data = f && f.length ? f : (t = n['l' + t] ||
444
+ n['browserL' + t] ||
445
+ n['userL' + t]) ? [t] : t;
446
+ return typeof data === 'string'
447
+ ? data
448
+ : data.join(';');
449
+ };
450
+ this._data = this.initialize();
451
+ }
452
+ get all() {
453
+ return this._data;
454
+ }
455
+ initialize() {
456
+ // Get the languages.
457
+ const data = this.getLanguages();
458
+ // Parse all languages by using a regex.
459
+ const strings = (data || '')
460
+ .match(/((([a-zA-Z]+(-[a-zA-Z0-9]+){0,2})|\*)(;q=[0-1](\.[0-9]+)?)?)*/g);
461
+ // Get the content by parsing the strings.
462
+ const content = strings.map(item => {
463
+ if (!item) {
464
+ return null;
465
+ }
466
+ const bits = item.split(';');
467
+ const ietf = bits[0].split('-');
468
+ const hasScript = ietf.length === 3;
469
+ return {
470
+ code: ietf[0],
471
+ script: hasScript ? ietf[1] : null,
472
+ region: hasScript ? ietf[2] : ietf[1],
473
+ quality: bits[1] ? parseFloat(bits[1].split('=')[1]) : 1.0
474
+ };
475
+ });
476
+ // Filter out all the empty items
477
+ // and sort them by the quality.
478
+ return content
479
+ .filter(item => !!item)
480
+ .sort((a, b) => b.quality - a.quality);
481
+ }
482
+ }
483
+ Languages.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Languages, deps: [{ token: ACCEPT_LANGUAGE, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
484
+ Languages.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Languages, providedIn: 'root' });
485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Languages, decorators: [{
486
+ type: Injectable,
487
+ args: [{
488
+ providedIn: 'root'
489
+ }]
490
+ }], ctorParameters: function () {
491
+ return [{ type: undefined, decorators: [{
492
+ type: Optional
493
+ }, {
494
+ type: Inject,
495
+ args: [ACCEPT_LANGUAGE]
496
+ }] }];
497
497
  } });
498
498
 
499
- const WINDOW = new InjectionToken('An abstraction over global window object', {
500
- factory: () => {
501
- const { defaultView } = inject(DOCUMENT);
502
- if (!defaultView) {
503
- throw new Error('Window is not available');
504
- }
505
- return defaultView;
506
- }
499
+ const WINDOW = new InjectionToken('An abstraction over global window object', {
500
+ factory: () => {
501
+ const { defaultView } = inject(DOCUMENT);
502
+ if (!defaultView) {
503
+ throw new Error('Window is not available');
504
+ }
505
+ return defaultView;
506
+ }
507
507
  });
508
508
 
509
- const NAVIGATOR = new InjectionToken('An abstraction over window.navigator object', {
510
- factory: () => inject(WINDOW).navigator
509
+ const NAVIGATOR = new InjectionToken('An abstraction over window.navigator object', {
510
+ factory: () => inject(WINDOW).navigator
511
511
  });
512
512
 
513
- class Network {
514
- constructor(_platform, _window, _navigator) {
515
- this._platform = _platform;
516
- this._window = _window;
517
- this._navigator = _navigator;
518
- // Data.
519
- this._online$ = of(true);
520
- this.getOnlineObservable();
521
- }
522
- online() {
523
- return this._online$;
524
- }
525
- getOnlineObservable() {
526
- // Validate we are on a browser.
527
- if (!this._platform.isBrowser) {
528
- return;
529
- }
530
- // Get all the events from the window.
531
- const online$ = fromEvent(this._window, 'online').pipe(map(() => true));
532
- const offline$ = fromEvent(this._window, 'offline').pipe(map(() => false));
533
- const now$ = new Observable(subscriber => {
534
- var _a;
535
- subscriber.next((_a = this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
536
- subscriber.complete();
537
- });
538
- // Merge all event so we get notified when
539
- // a user is online/offline.
540
- this._online$ = merge(now$, online$, offline$).pipe(map(value => value), distinctUntilChanged(), shareReplay(1));
541
- }
542
- }
543
- Network.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Network, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: NAVIGATOR, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
544
- Network.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Network, providedIn: 'root' });
545
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Network, decorators: [{
546
- type: Injectable,
547
- args: [{
548
- providedIn: 'root'
549
- }]
550
- }], ctorParameters: function () {
551
- return [{ type: Platform }, { type: undefined, decorators: [{
552
- type: Optional
553
- }, {
554
- type: Inject,
555
- args: [WINDOW]
556
- }] }, { type: undefined, decorators: [{
557
- type: Optional
558
- }, {
559
- type: Inject,
560
- args: [NAVIGATOR]
561
- }] }];
513
+ class Network {
514
+ constructor(_platform, _window, _navigator) {
515
+ this._platform = _platform;
516
+ this._window = _window;
517
+ this._navigator = _navigator;
518
+ // Data.
519
+ this._online$ = of(true);
520
+ this.getOnlineObservable();
521
+ }
522
+ online() {
523
+ return this._online$;
524
+ }
525
+ getOnlineObservable() {
526
+ // Validate we are on a browser.
527
+ if (!this._platform.isBrowser) {
528
+ return;
529
+ }
530
+ // Get all the events from the window.
531
+ const online$ = fromEvent(this._window, 'online').pipe(map(() => true));
532
+ const offline$ = fromEvent(this._window, 'offline').pipe(map(() => false));
533
+ const now$ = new Observable(subscriber => {
534
+ var _a;
535
+ subscriber.next((_a = this._navigator) === null || _a === void 0 ? void 0 : _a.onLine);
536
+ subscriber.complete();
537
+ });
538
+ // Merge all event so we get notified when
539
+ // a user is online/offline.
540
+ this._online$ = merge(now$, online$, offline$).pipe(map(value => value), distinctUntilChanged(), shareReplay(1));
541
+ }
542
+ }
543
+ Network.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Network, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: NAVIGATOR, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
544
+ Network.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Network, providedIn: 'root' });
545
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Network, decorators: [{
546
+ type: Injectable,
547
+ args: [{
548
+ providedIn: 'root'
549
+ }]
550
+ }], ctorParameters: function () {
551
+ return [{ type: Platform }, { type: undefined, decorators: [{
552
+ type: Optional
553
+ }, {
554
+ type: Inject,
555
+ args: [WINDOW]
556
+ }] }, { type: undefined, decorators: [{
557
+ type: Optional
558
+ }, {
559
+ type: Inject,
560
+ args: [NAVIGATOR]
561
+ }] }];
562
562
  } });
563
563
 
564
- class Patch {
565
- constructor(_platform, _window, _document) {
566
- this._platform = _platform;
567
- this._window = _window;
568
- this._document = _document;
569
- this._hasPatchedMobileVerticalHeight = false;
570
- // Subscriptions.
571
- this._subscription = new Subscription();
572
- }
573
- mobileVerticalHeight() {
574
- // Check if the user has already patched
575
- // the mobile vertical height.
576
- if (this._hasPatchedMobileVerticalHeight) {
577
- return;
578
- }
579
- this.periodicallySetDocumentVerticalProperty();
580
- this._hasPatchedMobileVerticalHeight = true;
581
- }
582
- ngOnDestroy() {
583
- var _a;
584
- (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
585
- }
586
- periodicallySetDocumentVerticalProperty() {
587
- // Validate we are using a browser.
588
- if (!this._platform.isBrowser) {
589
- return;
590
- }
591
- // Listen to a debounced window resize event.
592
- const resize$ = fromEvent(this._window, 'resize').pipe(debounceTime(25), startWith(0));
593
- // Subscribe to the resize observable.
594
- const subscription = resize$.subscribe(() => {
595
- var _a, _b, _c, _d;
596
- const verticalHeight = ((_a = this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
597
- (_d = (_c = (_b = this._document) === null || _b === void 0 ? void 0 : _b.documentElement) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.setProperty('--vh', `${verticalHeight}px`);
598
- });
599
- // Save the subscription so we can destroy it later.
600
- this._subscription.add(subscription);
601
- }
602
- }
603
- Patch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Patch, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
604
- Patch.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Patch, providedIn: 'root' });
605
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Patch, decorators: [{
606
- type: Injectable,
607
- args: [{
608
- providedIn: 'root'
609
- }]
610
- }], ctorParameters: function () {
611
- return [{ type: Platform }, { type: undefined, decorators: [{
612
- type: Optional
613
- }, {
614
- type: Inject,
615
- args: [WINDOW]
616
- }] }, { type: undefined, decorators: [{
617
- type: Optional
618
- }, {
619
- type: Inject,
620
- args: [DOCUMENT]
621
- }] }];
564
+ class Patch {
565
+ constructor(_platform, _window, _document) {
566
+ this._platform = _platform;
567
+ this._window = _window;
568
+ this._document = _document;
569
+ this._hasPatchedMobileVerticalHeight = false;
570
+ // Subscriptions.
571
+ this._subscription = new Subscription();
572
+ }
573
+ mobileVerticalHeight() {
574
+ // Check if the user has already patched
575
+ // the mobile vertical height.
576
+ if (this._hasPatchedMobileVerticalHeight) {
577
+ return;
578
+ }
579
+ this.periodicallySetDocumentVerticalProperty();
580
+ this._hasPatchedMobileVerticalHeight = true;
581
+ }
582
+ ngOnDestroy() {
583
+ var _a;
584
+ (_a = this._subscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
585
+ }
586
+ periodicallySetDocumentVerticalProperty() {
587
+ // Validate we are using a browser.
588
+ if (!this._platform.isBrowser) {
589
+ return;
590
+ }
591
+ // Listen to a debounced window resize event.
592
+ const resize$ = fromEvent(this._window, 'resize').pipe(debounceTime(25), startWith(0));
593
+ // Subscribe to the resize observable.
594
+ const subscription = resize$.subscribe(() => {
595
+ var _a, _b, _c, _d;
596
+ const verticalHeight = ((_a = this._window) === null || _a === void 0 ? void 0 : _a.innerHeight) * 0.01;
597
+ (_d = (_c = (_b = this._document) === null || _b === void 0 ? void 0 : _b.documentElement) === null || _c === void 0 ? void 0 : _c.style) === null || _d === void 0 ? void 0 : _d.setProperty('--vh', `${verticalHeight}px`);
598
+ });
599
+ // Save the subscription so we can destroy it later.
600
+ this._subscription.add(subscription);
601
+ }
602
+ }
603
+ Patch.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Patch, deps: [{ token: Platform }, { token: WINDOW, optional: true }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
604
+ Patch.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Patch, providedIn: 'root' });
605
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Patch, decorators: [{
606
+ type: Injectable,
607
+ args: [{
608
+ providedIn: 'root'
609
+ }]
610
+ }], ctorParameters: function () {
611
+ return [{ type: Platform }, { type: undefined, decorators: [{
612
+ type: Optional
613
+ }, {
614
+ type: Inject,
615
+ args: [WINDOW]
616
+ }] }, { type: undefined, decorators: [{
617
+ type: Optional
618
+ }, {
619
+ type: Inject,
620
+ args: [DOCUMENT]
621
+ }] }];
622
622
  } });
623
623
 
624
- class Clipboard {
625
- constructor(_document) {
626
- this._document = _document;
627
- }
628
- copy(text) {
629
- const pendingCopy = this.beginCopy(text);
630
- const successful = pendingCopy.copy();
631
- pendingCopy.destroy();
632
- return successful;
633
- }
634
- beginCopy(text) {
635
- return new ClipboardCopy(text, this._document);
636
- }
637
- }
638
- Clipboard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Clipboard, deps: [{ token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
639
- Clipboard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Clipboard, providedIn: 'root' });
640
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.3", ngImport: i0, type: Clipboard, decorators: [{
641
- type: Injectable,
642
- args: [{
643
- providedIn: 'root'
644
- }]
645
- }], ctorParameters: function () {
646
- return [{ type: undefined, decorators: [{
647
- type: Optional
648
- }, {
649
- type: Inject,
650
- args: [DOCUMENT]
651
- }] }];
652
- } });
653
- class ClipboardCopy {
654
- constructor(_text, _document) {
655
- this._text = _text;
656
- this._document = _document;
657
- this.initialize();
658
- }
659
- copy() {
660
- var _a, _b, _c, _d, _e, _f;
661
- const textarea = this._textarea;
662
- let successful = false;
663
- try {
664
- const currentFocus = this._document.activeElement;
665
- (_a = textarea === null || textarea === void 0 ? void 0 : textarea.select) === null || _a === void 0 ? void 0 : _a.call(textarea);
666
- (_b = textarea === null || textarea === void 0 ? void 0 : textarea.setSelectionRange) === null || _b === void 0 ? void 0 : _b.call(textarea, 0, (_c = textarea === null || textarea === void 0 ? void 0 : textarea.value) === null || _c === void 0 ? void 0 : _c.length);
667
- successful = (_e = (_d = this._document) === null || _d === void 0 ? void 0 : _d.execCommand) === null || _e === void 0 ? void 0 : _e.call(_d, 'copy');
668
- (_f = currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.focus) === null || _f === void 0 ? void 0 : _f.call(currentFocus);
669
- }
670
- catch (_g) {
671
- // Do nothing.
672
- }
673
- return successful;
674
- }
675
- destroy() {
676
- var _a, _b, _c;
677
- (_c = (_b = (_a = this._textarea) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild) === null || _c === void 0 ? void 0 : _c.call(_b, this._textarea);
678
- this._textarea = undefined;
679
- }
680
- initialize() {
681
- const textarea = this._textarea = this._document.createElement('textarea');
682
- const styles = textarea.style;
683
- // Hide the element for display and accessibility. Set a fixed position so the page layout
684
- // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
685
- // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
686
- styles.position = 'fixed';
687
- styles.top = styles.opacity = '0';
688
- styles.left = '-999em';
689
- textarea.setAttribute('aria-hidden', 'true');
690
- textarea.value = this._text;
691
- this._document.body.appendChild(textarea);
692
- }
624
+ class Clipboard {
625
+ constructor(_document) {
626
+ this._document = _document;
627
+ }
628
+ copy(text) {
629
+ const pendingCopy = this.beginCopy(text);
630
+ const successful = pendingCopy.copy();
631
+ pendingCopy.destroy();
632
+ return successful;
633
+ }
634
+ beginCopy(text) {
635
+ return new ClipboardCopy(text, this._document);
636
+ }
637
+ }
638
+ Clipboard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Clipboard, deps: [{ token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
639
+ Clipboard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Clipboard, providedIn: 'root' });
640
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.4", ngImport: i0, type: Clipboard, decorators: [{
641
+ type: Injectable,
642
+ args: [{
643
+ providedIn: 'root'
644
+ }]
645
+ }], ctorParameters: function () {
646
+ return [{ type: undefined, decorators: [{
647
+ type: Optional
648
+ }, {
649
+ type: Inject,
650
+ args: [DOCUMENT]
651
+ }] }];
652
+ } });
653
+ class ClipboardCopy {
654
+ constructor(_text, _document) {
655
+ this._text = _text;
656
+ this._document = _document;
657
+ this.initialize();
658
+ }
659
+ copy() {
660
+ var _a, _b, _c, _d, _e, _f;
661
+ const textarea = this._textarea;
662
+ let successful = false;
663
+ try {
664
+ const currentFocus = this._document.activeElement;
665
+ (_a = textarea === null || textarea === void 0 ? void 0 : textarea.select) === null || _a === void 0 ? void 0 : _a.call(textarea);
666
+ (_b = textarea === null || textarea === void 0 ? void 0 : textarea.setSelectionRange) === null || _b === void 0 ? void 0 : _b.call(textarea, 0, (_c = textarea === null || textarea === void 0 ? void 0 : textarea.value) === null || _c === void 0 ? void 0 : _c.length);
667
+ successful = (_e = (_d = this._document) === null || _d === void 0 ? void 0 : _d.execCommand) === null || _e === void 0 ? void 0 : _e.call(_d, 'copy');
668
+ (_f = currentFocus === null || currentFocus === void 0 ? void 0 : currentFocus.focus) === null || _f === void 0 ? void 0 : _f.call(currentFocus);
669
+ }
670
+ catch (_g) {
671
+ // Do nothing.
672
+ }
673
+ return successful;
674
+ }
675
+ destroy() {
676
+ var _a, _b, _c;
677
+ (_c = (_b = (_a = this._textarea) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild) === null || _c === void 0 ? void 0 : _c.call(_b, this._textarea);
678
+ this._textarea = undefined;
679
+ }
680
+ initialize() {
681
+ const textarea = this._textarea = this._document.createElement('textarea');
682
+ const styles = textarea.style;
683
+ // Hide the element for display and accessibility. Set a fixed position so the page layout
684
+ // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
685
+ // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
686
+ styles.position = 'fixed';
687
+ styles.top = styles.opacity = '0';
688
+ styles.left = '-999em';
689
+ textarea.setAttribute('aria-hidden', 'true');
690
+ textarea.value = this._text;
691
+ this._document.body.appendChild(textarea);
692
+ }
693
693
  }
694
694
 
695
- function mixinDisabled(base) {
696
- return class extends base {
697
- constructor(...args) {
698
- super(...args);
699
- this._disable = false;
700
- }
701
- get disabled() {
702
- return this._disable;
703
- }
704
- set disabled(value) {
705
- this._disable = coerceBooleanProperty(value);
706
- }
707
- };
695
+ function mixinDisabled(base) {
696
+ return class extends base {
697
+ constructor(...args) {
698
+ super(...args);
699
+ this._disable = false;
700
+ }
701
+ get disabled() {
702
+ return this._disable;
703
+ }
704
+ set disabled(value) {
705
+ this._disable = coerceBooleanProperty(value);
706
+ }
707
+ };
708
708
  }
709
709
 
710
- function mixinLoad(base) {
711
- return class extends base {
712
- constructor(...args) {
713
- super(...args);
714
- this._loading = false;
715
- }
716
- get loading() {
717
- return this._loading;
718
- }
719
- set loading(value) {
720
- this._loading = coerceBooleanProperty(value);
721
- }
722
- };
710
+ function mixinLoad(base) {
711
+ return class extends base {
712
+ constructor(...args) {
713
+ super(...args);
714
+ this._loading = false;
715
+ }
716
+ get loading() {
717
+ return this._loading;
718
+ }
719
+ set loading(value) {
720
+ this._loading = coerceBooleanProperty(value);
721
+ }
722
+ };
723
723
  }
724
724
 
725
- function mixinError(base) {
726
- return class extends base {
727
- constructor(...args) {
728
- super(...args);
729
- this._error = false;
730
- }
731
- get error() {
732
- return this._error;
733
- }
734
- set error(value) {
735
- this._error = coerceBooleanProperty(value);
736
- }
737
- };
725
+ function mixinError(base) {
726
+ return class extends base {
727
+ constructor(...args) {
728
+ super(...args);
729
+ this._error = false;
730
+ }
731
+ get error() {
732
+ return this._error;
733
+ }
734
+ set error(value) {
735
+ this._error = coerceBooleanProperty(value);
736
+ }
737
+ };
738
738
  }
739
739
 
740
- function mixinHideErrors(base) {
741
- return class extends base {
742
- constructor(...args) {
743
- super(...args);
744
- this._hideErrors = false;
745
- }
746
- get hideErrors() {
747
- return this._hideErrors;
748
- }
749
- set hideErrors(value) {
750
- this._hideErrors = coerceBooleanProperty(value);
751
- }
752
- };
740
+ function mixinHideErrors(base) {
741
+ return class extends base {
742
+ constructor(...args) {
743
+ super(...args);
744
+ this._hideErrors = false;
745
+ }
746
+ get hideErrors() {
747
+ return this._hideErrors;
748
+ }
749
+ set hideErrors(value) {
750
+ this._hideErrors = coerceBooleanProperty(value);
751
+ }
752
+ };
753
753
  }
754
754
 
755
- function mixinFocused(base) {
756
- return class extends base {
757
- constructor(...args) {
758
- super(...args);
759
- this._focused = false;
760
- }
761
- get focused() {
762
- return this._focused;
763
- }
764
- set focused(value) {
765
- this._focused = coerceBooleanProperty(value);
766
- }
767
- };
755
+ function mixinFocused(base) {
756
+ return class extends base {
757
+ constructor(...args) {
758
+ super(...args);
759
+ this._focused = false;
760
+ }
761
+ get focused() {
762
+ return this._focused;
763
+ }
764
+ set focused(value) {
765
+ this._focused = coerceBooleanProperty(value);
766
+ }
767
+ };
768
768
  }
769
769
 
770
- function mixinGrouped(base) {
771
- return class extends base {
772
- constructor(...args) {
773
- super(...args);
774
- this._grouped = false;
775
- }
776
- get grouped() {
777
- return this._grouped;
778
- }
779
- set grouped(value) {
780
- this._grouped = coerceBooleanProperty(value);
781
- }
782
- };
770
+ function mixinGrouped(base) {
771
+ return class extends base {
772
+ constructor(...args) {
773
+ super(...args);
774
+ this._grouped = false;
775
+ }
776
+ get grouped() {
777
+ return this._grouped;
778
+ }
779
+ set grouped(value) {
780
+ this._grouped = coerceBooleanProperty(value);
781
+ }
782
+ };
783
783
  }
784
784
 
785
- function mixinReadonly(base) {
786
- return class extends base {
787
- constructor(...args) {
788
- super(...args);
789
- this._readonly = false;
790
- }
791
- get readonly() {
792
- return this._readonly;
793
- }
794
- set readonly(value) {
795
- this._readonly = coerceBooleanProperty(value);
796
- }
797
- };
785
+ function mixinReadonly(base) {
786
+ return class extends base {
787
+ constructor(...args) {
788
+ super(...args);
789
+ this._readonly = false;
790
+ }
791
+ get readonly() {
792
+ return this._readonly;
793
+ }
794
+ set readonly(value) {
795
+ this._readonly = coerceBooleanProperty(value);
796
+ }
797
+ };
798
798
  }
799
799
 
800
- function mixinRequired(base) {
801
- return class extends base {
802
- constructor(...args) {
803
- super(...args);
804
- this._required = false;
805
- }
806
- get required() {
807
- return this._required;
808
- }
809
- set required(value) {
810
- this._required = coerceBooleanProperty(value);
811
- }
812
- };
800
+ function mixinRequired(base) {
801
+ return class extends base {
802
+ constructor(...args) {
803
+ super(...args);
804
+ this._required = false;
805
+ }
806
+ get required() {
807
+ return this._required;
808
+ }
809
+ set required(value) {
810
+ this._required = coerceBooleanProperty(value);
811
+ }
812
+ };
813
813
  }
814
814
 
815
815
  const BASE_URL = new InjectionToken('BaseUrl');
816
816
 
817
817
  const COOKIE = new InjectionToken('Cookie');
818
818
 
819
- const LOCATION = new InjectionToken('An abstraction over window.location object', {
820
- factory: () => inject(WINDOW).location
819
+ const LOCATION = new InjectionToken('An abstraction over window.location object', {
820
+ factory: () => inject(WINDOW).location
821
821
  });
822
822
 
823
- const BbRegex = {
824
- email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
825
- fullNumber: /^\d*[1-9]\d*$/
823
+ const BbRegex = {
824
+ email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
825
+ fullNumber: /^\d*[1-9]\d*$/
826
826
  };
827
827
 
828
- class BbValidator {
829
- static email(control) {
830
- if (isEmptyInputValue(control.value)) {
831
- return null;
832
- }
833
- return BbRegex.email.test(control.value) ? null : { email: true };
834
- }
835
- static fullNumber(control) {
836
- if (isEmptyInputValue(control.value)) {
837
- return null;
838
- }
839
- return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
840
- }
841
- static maxFileSize(bytes) {
842
- const validator = (control) => {
843
- const value = control.value;
844
- // Validate if the value is a file.
845
- if (!(value instanceof File)) {
846
- return null;
847
- }
848
- if (value.size <= bytes) {
849
- return null;
850
- }
851
- let maxSize = '0 Bytes';
852
- if (bytes !== 0) {
853
- const k = 1024;
854
- const dm = 2;
855
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
856
- const index = Math.floor(Math.log(bytes) / Math.log(k));
857
- maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
858
- }
859
- return { maxFileSize: { maxSize } };
860
- };
861
- return validator;
862
- }
863
- static confirm(fieldName, error = 'confirm') {
864
- const validator = (control) => {
865
- var _a;
866
- if (isEmptyInputValue(control.value)) {
867
- return null;
868
- }
869
- const field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
870
- return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
871
- ? null
872
- : { [error]: true };
873
- };
874
- return validator;
875
- }
876
- static maxDate(date, error = 'maxDate') {
877
- const formattedDate = date.toString() !== 'Invalid Date'
878
- ? formatDate(date, 'yyyy-MM-dd', 'en-US')
879
- : null;
880
- const validator = (control) => {
881
- if (isEmptyInputValue(control.value)) {
882
- return null;
883
- }
884
- const controlDate = new Date(control.value);
885
- return controlDate.getTime() > date.getTime()
886
- ? { [error]: { date: formattedDate } }
887
- : null;
888
- };
889
- return validator;
890
- }
891
- static minDate(date, error = 'minDate') {
892
- const formattedDate = date.toString() !== 'Invalid Date'
893
- ? formatDate(date, 'yyyy-MM-dd', 'en-US')
894
- : null;
895
- const validator = (control) => {
896
- if (isEmptyInputValue(control.value)) {
897
- return null;
898
- }
899
- const controlDate = new Date(control.value);
900
- return controlDate.getTime() < date.getTime()
901
- ? { [error]: { date: formattedDate } }
902
- : null;
903
- };
904
- return validator;
905
- }
906
- }
907
- function isEmptyInputValue(value) {
908
- // We don't check for string here so it also works with arrays.
909
- return value == null || value.length === 0;
828
+ class BbValidator {
829
+ static email(control) {
830
+ if (isEmptyInputValue(control.value)) {
831
+ return null;
832
+ }
833
+ return BbRegex.email.test(control.value) ? null : { email: true };
834
+ }
835
+ static fullNumber(control) {
836
+ if (isEmptyInputValue(control.value)) {
837
+ return null;
838
+ }
839
+ return BbRegex.fullNumber.test(control.value) ? null : { fullNumber: true };
840
+ }
841
+ static maxFileSize(bytes) {
842
+ const validator = (control) => {
843
+ const value = control.value;
844
+ // Validate if the value is a file.
845
+ if (!(value instanceof File)) {
846
+ return null;
847
+ }
848
+ if (value.size <= bytes) {
849
+ return null;
850
+ }
851
+ let maxSize = '0 Bytes';
852
+ if (bytes !== 0) {
853
+ const k = 1024;
854
+ const dm = 2;
855
+ const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
856
+ const index = Math.floor(Math.log(bytes) / Math.log(k));
857
+ maxSize = parseFloat((bytes / Math.pow(k, index)).toFixed(dm)) + ' ' + sizes[index];
858
+ }
859
+ return { maxFileSize: { maxSize } };
860
+ };
861
+ return validator;
862
+ }
863
+ static confirm(fieldName, error = 'confirm') {
864
+ const validator = (control) => {
865
+ var _a;
866
+ if (isEmptyInputValue(control.value)) {
867
+ return null;
868
+ }
869
+ const field = (_a = control === null || control === void 0 ? void 0 : control.parent) === null || _a === void 0 ? void 0 : _a.get(fieldName);
870
+ return (control === null || control === void 0 ? void 0 : control.value) === (field === null || field === void 0 ? void 0 : field.value)
871
+ ? null
872
+ : { [error]: true };
873
+ };
874
+ return validator;
875
+ }
876
+ static maxDate(date, error = 'maxDate') {
877
+ const formattedDate = date.toString() !== 'Invalid Date'
878
+ ? formatDate(date, 'yyyy-MM-dd', 'en-US')
879
+ : null;
880
+ const validator = (control) => {
881
+ if (isEmptyInputValue(control.value)) {
882
+ return null;
883
+ }
884
+ const controlDate = new Date(control.value);
885
+ return controlDate.getTime() > date.getTime()
886
+ ? { [error]: { date: formattedDate } }
887
+ : null;
888
+ };
889
+ return validator;
890
+ }
891
+ static minDate(date, error = 'minDate') {
892
+ const formattedDate = date.toString() !== 'Invalid Date'
893
+ ? formatDate(date, 'yyyy-MM-dd', 'en-US')
894
+ : null;
895
+ const validator = (control) => {
896
+ if (isEmptyInputValue(control.value)) {
897
+ return null;
898
+ }
899
+ const controlDate = new Date(control.value);
900
+ return controlDate.getTime() < date.getTime()
901
+ ? { [error]: { date: formattedDate } }
902
+ : null;
903
+ };
904
+ return validator;
905
+ }
906
+ }
907
+ function isEmptyInputValue(value) {
908
+ // We don't check for string here so it also works with arrays.
909
+ return value == null || value.length === 0;
910
910
  }
911
911
 
912
- /*
913
- * Public API Surface of bb-foundation
912
+ /*
913
+ * Public API Surface of bb-foundation
914
914
  */
915
915
 
916
- /**
917
- * Generated bundle index. Do not edit.
916
+ /**
917
+ * Generated bundle index. Do not edit.
918
918
  */
919
919
 
920
920
  export { ACCEPT_LANGUAGE, BASE_URL, BbRegex, BbValidator, COOKIE, Clipboard, ClipboardCopy, Exif, FileLoader, ImageConverter, LOCATION, Languages, NAVIGATOR, Network, Patch, Platform, WINDOW, mixinDisabled, mixinError, mixinFocused, mixinGrouped, mixinHideErrors, mixinLoad, mixinReadonly, mixinRequired };