@firestitch/common 13.0.5 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/app/directives/auto-focus.directive.d.ts +15 -15
  2. package/app/directives/auto-select.directive.d.ts +11 -11
  3. package/app/directives/index.d.ts +5 -6
  4. package/app/directives/model-change.directive.d.ts +16 -16
  5. package/app/directives/prevent-default.directive.d.ts +6 -6
  6. package/app/directives/stop-propagation.directive.d.ts +6 -6
  7. package/app/fs-common.module.d.ts +20 -21
  8. package/app/pipes/bytes.pipe.d.ts +7 -7
  9. package/app/pipes/currency.pipe.d.ts +9 -9
  10. package/app/pipes/index.d.ts +2 -2
  11. package/app/pipes/number.pipe.d.ts +7 -7
  12. package/app/pipes/ordinal-number.pipe.d.ts +7 -7
  13. package/app/pipes/truncate.pipe.d.ts +8 -8
  14. package/app/pipes/util.pipe.d.ts +24 -24
  15. package/app/services/array.service.d.ts +61 -61
  16. package/app/services/math.service.d.ts +9 -9
  17. package/app/services/util.service.d.ts +89 -89
  18. package/app/services/vaildate.service.d.ts +16 -16
  19. package/esm2020/app/directives/auto-focus.directive.mjs +59 -59
  20. package/esm2020/app/directives/auto-select.directive.mjs +31 -31
  21. package/esm2020/app/directives/index.mjs +6 -7
  22. package/esm2020/app/directives/model-change.directive.mjs +37 -37
  23. package/esm2020/app/directives/prevent-default.directive.mjs +19 -19
  24. package/esm2020/app/directives/stop-propagation.directive.mjs +19 -19
  25. package/esm2020/app/fs-common.module.mjs +99 -105
  26. package/esm2020/app/pipes/bytes.pipe.mjs +17 -17
  27. package/esm2020/app/pipes/currency.pipe.mjs +23 -23
  28. package/esm2020/app/pipes/index.mjs +2 -2
  29. package/esm2020/app/pipes/number.pipe.mjs +17 -17
  30. package/esm2020/app/pipes/ordinal-number.pipe.mjs +17 -17
  31. package/esm2020/app/pipes/truncate.pipe.mjs +18 -18
  32. package/esm2020/app/pipes/util.pipe.mjs +60 -60
  33. package/esm2020/app/services/array.service.mjs +225 -225
  34. package/esm2020/app/services/math.service.mjs +21 -21
  35. package/esm2020/app/services/util.service.mjs +251 -251
  36. package/esm2020/app/services/vaildate.service.mjs +28 -28
  37. package/esm2020/firestitch-common.mjs +4 -4
  38. package/esm2020/libs/array/compare/compare.mjs +7 -7
  39. package/esm2020/libs/array/compare/index.mjs +1 -1
  40. package/esm2020/libs/array/filter/filter.mjs +26 -26
  41. package/esm2020/libs/array/filter/index.mjs +1 -1
  42. package/esm2020/libs/array/find/find.mjs +5 -5
  43. package/esm2020/libs/array/find/index.mjs +1 -1
  44. package/esm2020/libs/array/inArray/inArray.mjs +11 -11
  45. package/esm2020/libs/array/inArray/index.mjs +1 -1
  46. package/esm2020/libs/array/index/index.mjs +7 -7
  47. package/esm2020/libs/array/index.mjs +13 -13
  48. package/esm2020/libs/array/indexOf/index.mjs +1 -1
  49. package/esm2020/libs/array/indexOf/indexOf.mjs +15 -15
  50. package/esm2020/libs/array/keyExists/index.mjs +1 -1
  51. package/esm2020/libs/array/keyExists/keyExists.mjs +3 -3
  52. package/esm2020/libs/array/ksort/index.mjs +1 -1
  53. package/esm2020/libs/array/ksort/ksort.mjs +7 -7
  54. package/esm2020/libs/array/list/index.mjs +1 -1
  55. package/esm2020/libs/array/list/list.mjs +12 -12
  56. package/esm2020/libs/array/nameValue/index.mjs +1 -1
  57. package/esm2020/libs/array/nameValue/nameValue.mjs +20 -20
  58. package/esm2020/libs/array/remove/index.mjs +1 -1
  59. package/esm2020/libs/array/remove/remove.mjs +8 -8
  60. package/esm2020/libs/array/rsort/index.mjs +1 -1
  61. package/esm2020/libs/array/rsort/rsort.mjs +4 -4
  62. package/esm2020/libs/array/sort/index.mjs +1 -1
  63. package/esm2020/libs/array/sort/sort.mjs +26 -26
  64. package/esm2020/libs/format/acronym/acronym.mjs +21 -21
  65. package/esm2020/libs/format/acronym/index.mjs +1 -1
  66. package/esm2020/libs/format/bytes/bytes.mjs +17 -17
  67. package/esm2020/libs/format/bytes/index.mjs +1 -1
  68. package/esm2020/libs/format/currency/currency.mjs +8 -8
  69. package/esm2020/libs/format/currency/index.mjs +1 -1
  70. package/esm2020/libs/format/index.mjs +5 -5
  71. package/esm2020/libs/format/number/index.mjs +1 -1
  72. package/esm2020/libs/format/number/number.mjs +7 -7
  73. package/esm2020/libs/format/truncate/index.mjs +1 -1
  74. package/esm2020/libs/format/truncate/truncate.mjs +11 -11
  75. package/esm2020/libs/index.mjs +5 -5
  76. package/esm2020/libs/rxjs/delayedRetry.mjs +19 -19
  77. package/esm2020/libs/rxjs/keyboard-shortcut.mjs +17 -17
  78. package/esm2020/libs/util/boolean/boolean.mjs +3 -3
  79. package/esm2020/libs/util/boolean/index.mjs +1 -1
  80. package/esm2020/libs/util/clone/clone.mjs +20 -20
  81. package/esm2020/libs/util/clone/index.mjs +1 -1
  82. package/esm2020/libs/util/debounce/debounce.mjs +16 -16
  83. package/esm2020/libs/util/debounce/index.mjs +1 -1
  84. package/esm2020/libs/util/get-normalized-path/get-normalized-path.mjs +5 -5
  85. package/esm2020/libs/util/get-normalized-path/index.mjs +1 -1
  86. package/esm2020/libs/util/guid/guid.mjs +18 -18
  87. package/esm2020/libs/util/guid/index.mjs +1 -1
  88. package/esm2020/libs/util/index.mjs +24 -24
  89. package/esm2020/libs/util/is-array-equal/index.mjs +2 -2
  90. package/esm2020/libs/util/is-array-equal/is-array-equal.mjs +21 -21
  91. package/esm2020/libs/util/is-class/index.mjs +1 -1
  92. package/esm2020/libs/util/is-class/is-class.mjs +17 -17
  93. package/esm2020/libs/util/is-empty/index.mjs +1 -1
  94. package/esm2020/libs/util/is-empty/is-empty.mjs +11 -11
  95. package/esm2020/libs/util/is-numeric/index.mjs +1 -1
  96. package/esm2020/libs/util/is-numeric/is-numeric.mjs +4 -4
  97. package/esm2020/libs/util/is-object/index.mjs +1 -1
  98. package/esm2020/libs/util/is-object/is-object.mjs +3 -3
  99. package/esm2020/libs/util/keys/index.mjs +1 -1
  100. package/esm2020/libs/util/keys/keys.mjs +37 -37
  101. package/esm2020/libs/util/length/index.mjs +1 -1
  102. package/esm2020/libs/util/length/length.mjs +9 -9
  103. package/esm2020/libs/util/ordinal-number/index.mjs +2 -2
  104. package/esm2020/libs/util/ordinal-number/ordinal-number.mjs +7 -7
  105. package/esm2020/libs/util/queue/index.mjs +3 -3
  106. package/esm2020/libs/util/queue/operation.mjs +14 -14
  107. package/esm2020/libs/util/queue/queue-stats.mjs +1 -1
  108. package/esm2020/libs/util/queue/queue.enum.mjs +5 -5
  109. package/esm2020/libs/util/queue/queue.mjs +164 -164
  110. package/esm2020/libs/util/remove-query-params/index.mjs +1 -1
  111. package/esm2020/libs/util/remove-query-params/remove-query-params.mjs +3 -3
  112. package/esm2020/libs/util/resolve/index.mjs +1 -1
  113. package/esm2020/libs/util/resolve/resolve.mjs +9 -9
  114. package/esm2020/libs/util/round/index.mjs +1 -1
  115. package/esm2020/libs/util/round/round.mjs +5 -5
  116. package/esm2020/libs/util/source-loader/index.mjs +2 -2
  117. package/esm2020/libs/util/source-loader/source-loader.mjs +154 -154
  118. package/esm2020/libs/util/stringify/index.mjs +1 -1
  119. package/esm2020/libs/util/stringify/stringify.mjs +3 -3
  120. package/esm2020/libs/util/throttle/index.mjs +1 -1
  121. package/esm2020/libs/util/throttle/throttle.mjs +12 -12
  122. package/esm2020/libs/util/to-string/index.mjs +1 -1
  123. package/esm2020/libs/util/to-string/to-string.mjs +6 -6
  124. package/esm2020/libs/util/uuid/index.mjs +1 -1
  125. package/esm2020/libs/util/uuid/uuid.mjs +4 -4
  126. package/esm2020/libs/util/value/index.mjs +1 -1
  127. package/esm2020/libs/util/value/value.mjs +8 -8
  128. package/esm2020/libs/validate/email/email.mjs +3 -3
  129. package/esm2020/libs/validate/email/index.mjs +1 -1
  130. package/esm2020/libs/validate/index.mjs +3 -3
  131. package/esm2020/libs/validate/phone/index.mjs +1 -1
  132. package/esm2020/libs/validate/phone/phone.mjs +4 -4
  133. package/esm2020/libs/validate/url/index.mjs +1 -1
  134. package/esm2020/libs/validate/url/url.mjs +11 -11
  135. package/esm2020/public_api.mjs +17 -17
  136. package/fesm2015/firestitch-common.mjs +1699 -1716
  137. package/fesm2015/firestitch-common.mjs.map +1 -1
  138. package/fesm2020/firestitch-common.mjs +1692 -1709
  139. package/fesm2020/firestitch-common.mjs.map +1 -1
  140. package/{firestitch-common.d.ts → index.d.ts} +5 -5
  141. package/libs/array/compare/compare.d.ts +1 -1
  142. package/libs/array/compare/index.d.ts +1 -1
  143. package/libs/array/filter/filter.d.ts +1 -1
  144. package/libs/array/filter/index.d.ts +1 -1
  145. package/libs/array/find/find.d.ts +1 -1
  146. package/libs/array/find/index.d.ts +1 -1
  147. package/libs/array/inArray/inArray.d.ts +1 -1
  148. package/libs/array/inArray/index.d.ts +1 -1
  149. package/libs/array/index/index.d.ts +1 -1
  150. package/libs/array/index.d.ts +13 -13
  151. package/libs/array/indexOf/index.d.ts +1 -1
  152. package/libs/array/indexOf/indexOf.d.ts +1 -1
  153. package/libs/array/keyExists/index.d.ts +1 -1
  154. package/libs/array/keyExists/keyExists.d.ts +1 -1
  155. package/libs/array/ksort/index.d.ts +1 -1
  156. package/libs/array/ksort/ksort.d.ts +1 -1
  157. package/libs/array/list/index.d.ts +1 -1
  158. package/libs/array/list/list.d.ts +1 -1
  159. package/libs/array/nameValue/index.d.ts +1 -1
  160. package/libs/array/nameValue/nameValue.d.ts +1 -1
  161. package/libs/array/remove/index.d.ts +1 -1
  162. package/libs/array/remove/remove.d.ts +1 -1
  163. package/libs/array/rsort/index.d.ts +1 -1
  164. package/libs/array/rsort/rsort.d.ts +1 -1
  165. package/libs/array/sort/index.d.ts +1 -1
  166. package/libs/array/sort/sort.d.ts +1 -1
  167. package/libs/format/acronym/acronym.d.ts +1 -1
  168. package/libs/format/acronym/index.d.ts +1 -1
  169. package/libs/format/bytes/bytes.d.ts +1 -1
  170. package/libs/format/bytes/index.d.ts +1 -1
  171. package/libs/format/currency/currency.d.ts +1 -1
  172. package/libs/format/currency/index.d.ts +1 -1
  173. package/libs/format/index.d.ts +5 -5
  174. package/libs/format/number/index.d.ts +1 -1
  175. package/libs/format/number/number.d.ts +1 -1
  176. package/libs/format/truncate/index.d.ts +1 -1
  177. package/libs/format/truncate/truncate.d.ts +1 -1
  178. package/libs/index.d.ts +5 -5
  179. package/libs/rxjs/delayedRetry.d.ts +2 -2
  180. package/libs/rxjs/keyboard-shortcut.d.ts +2 -2
  181. package/libs/util/boolean/boolean.d.ts +1 -1
  182. package/libs/util/boolean/index.d.ts +1 -1
  183. package/libs/util/clone/clone.d.ts +1 -1
  184. package/libs/util/clone/index.d.ts +1 -1
  185. package/libs/util/debounce/debounce.d.ts +1 -1
  186. package/libs/util/debounce/index.d.ts +1 -1
  187. package/libs/util/get-normalized-path/get-normalized-path.d.ts +2 -2
  188. package/libs/util/get-normalized-path/index.d.ts +1 -1
  189. package/libs/util/guid/guid.d.ts +1 -1
  190. package/libs/util/guid/index.d.ts +1 -1
  191. package/libs/util/index.d.ts +23 -23
  192. package/libs/util/is-array-equal/index.d.ts +1 -1
  193. package/libs/util/is-array-equal/is-array-equal.d.ts +1 -1
  194. package/libs/util/is-class/index.d.ts +1 -1
  195. package/libs/util/is-class/is-class.d.ts +1 -1
  196. package/libs/util/is-empty/index.d.ts +1 -1
  197. package/libs/util/is-empty/is-empty.d.ts +1 -1
  198. package/libs/util/is-numeric/index.d.ts +1 -1
  199. package/libs/util/is-numeric/is-numeric.d.ts +1 -1
  200. package/libs/util/is-object/index.d.ts +1 -1
  201. package/libs/util/is-object/is-object.d.ts +1 -1
  202. package/libs/util/keys/index.d.ts +1 -1
  203. package/libs/util/keys/keys.d.ts +37 -37
  204. package/libs/util/length/index.d.ts +1 -1
  205. package/libs/util/length/length.d.ts +1 -1
  206. package/libs/util/ordinal-number/index.d.ts +1 -1
  207. package/libs/util/ordinal-number/ordinal-number.d.ts +1 -1
  208. package/libs/util/queue/index.d.ts +3 -3
  209. package/libs/util/queue/operation.d.ts +7 -7
  210. package/libs/util/queue/queue-stats.d.ts +5 -5
  211. package/libs/util/queue/queue.d.ts +39 -39
  212. package/libs/util/queue/queue.enum.d.ts +4 -4
  213. package/libs/util/remove-query-params/index.d.ts +1 -1
  214. package/libs/util/remove-query-params/remove-query-params.d.ts +1 -1
  215. package/libs/util/resolve/index.d.ts +1 -1
  216. package/libs/util/resolve/resolve.d.ts +1 -1
  217. package/libs/util/round/index.d.ts +1 -1
  218. package/libs/util/round/round.d.ts +1 -1
  219. package/libs/util/source-loader/index.d.ts +1 -1
  220. package/libs/util/source-loader/source-loader.d.ts +11 -11
  221. package/libs/util/stringify/index.d.ts +1 -1
  222. package/libs/util/stringify/stringify.d.ts +1 -1
  223. package/libs/util/throttle/index.d.ts +1 -1
  224. package/libs/util/throttle/throttle.d.ts +1 -1
  225. package/libs/util/to-string/index.d.ts +1 -1
  226. package/libs/util/to-string/to-string.d.ts +1 -1
  227. package/libs/util/uuid/index.d.ts +1 -1
  228. package/libs/util/uuid/uuid.d.ts +1 -1
  229. package/libs/util/value/index.d.ts +1 -1
  230. package/libs/util/value/value.d.ts +1 -1
  231. package/libs/validate/email/email.d.ts +1 -1
  232. package/libs/validate/email/index.d.ts +1 -1
  233. package/libs/validate/index.d.ts +3 -3
  234. package/libs/validate/phone/index.d.ts +1 -1
  235. package/libs/validate/phone/phone.d.ts +1 -1
  236. package/libs/validate/url/index.d.ts +1 -1
  237. package/libs/validate/url/url.d.ts +7 -7
  238. package/package.json +3 -3
  239. package/public_api.d.ts +15 -15
  240. package/app/directives/autofocus.directive.d.ts +0 -6
  241. package/esm2020/app/directives/autofocus.directive.mjs +0 -14
@@ -6,1766 +6,1749 @@ import { Subject, Observable, of, combineLatest, iif, throwError, timer, fromEve
6
6
  import { debounceTime, takeUntil, take, map, delay, finalize, shareReplay, retryWhen, tap, concatMap, distinctUntilChanged, share, filter as filter$1 } from 'rxjs/operators';
7
7
  import * as i1$1 from '@angular/forms';
8
8
 
9
- class FsAutoFocusDirective {
10
- constructor(_matInput, _el) {
11
- this._matInput = _matInput;
12
- this._el = _el;
13
- this.fsAutofocus = true;
14
- this.fsAutoFocus = true;
15
- this.autofocus = true;
16
- }
17
- ngAfterViewInit() {
18
- var _a, _b, _c;
19
- if (((_a = this.fsAutofocus) !== null && _a !== void 0 ? _a : true) === true &&
20
- ((_b = this.fsAutofocus) !== null && _b !== void 0 ? _b : true) === true &&
21
- ((_c = this.autofocus) !== null && _c !== void 0 ? _c : true) === true) {
22
- this.focus();
23
- }
24
- }
25
- focus() {
26
- setTimeout(() => {
27
- const tmpEl = document.createElement('input');
28
- tmpEl.style.width = '0';
29
- tmpEl.style.height = '0';
30
- tmpEl.style.margin = '0';
31
- tmpEl.style.padding = '0';
32
- tmpEl.style.border = '0';
33
- tmpEl.style.opacity = '0';
34
- document.body.appendChild(tmpEl);
35
- tmpEl.focus();
36
- if (this._matInput) {
37
- this._matInput.focus();
38
- }
39
- else if (this._el.nativeElement.focus) {
40
- this._el.nativeElement.focus();
41
- }
42
- document.body.removeChild(tmpEl);
43
- }, 50);
44
- }
45
- }
46
- FsAutoFocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutoFocusDirective, deps: [{ token: i1.MatInput, host: true, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
47
- FsAutoFocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsAutoFocusDirective, selector: "[fsAutofocus],[fsAutoFocus],[autofocus]", inputs: { fsAutofocus: "fsAutofocus", fsAutoFocus: "fsAutoFocus", autofocus: "autofocus" }, ngImport: i0 });
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutoFocusDirective, decorators: [{
49
- type: Directive,
50
- args: [{
51
- selector: '[fsAutofocus],[fsAutoFocus],[autofocus]',
52
- }]
53
- }], ctorParameters: function () {
54
- return [{ type: i1.MatInput, decorators: [{
55
- type: Optional
56
- }, {
57
- type: Host
58
- }] }, { type: i0.ElementRef }];
59
- }, propDecorators: { fsAutofocus: [{
60
- type: Input
61
- }], fsAutoFocus: [{
62
- type: Input
63
- }], autofocus: [{
64
- type: Input
9
+ class FsAutoFocusDirective {
10
+ constructor(_matInput, _el) {
11
+ this._matInput = _matInput;
12
+ this._el = _el;
13
+ this.fsAutofocus = true;
14
+ this.fsAutoFocus = true;
15
+ this.autofocus = true;
16
+ }
17
+ ngAfterViewInit() {
18
+ var _a, _b, _c;
19
+ if (((_a = this.fsAutofocus) !== null && _a !== void 0 ? _a : true) === true &&
20
+ ((_b = this.fsAutofocus) !== null && _b !== void 0 ? _b : true) === true &&
21
+ ((_c = this.autofocus) !== null && _c !== void 0 ? _c : true) === true) {
22
+ this.focus();
23
+ }
24
+ }
25
+ focus() {
26
+ setTimeout(() => {
27
+ const tmpEl = document.createElement('input');
28
+ tmpEl.style.width = '0';
29
+ tmpEl.style.height = '0';
30
+ tmpEl.style.margin = '0';
31
+ tmpEl.style.padding = '0';
32
+ tmpEl.style.border = '0';
33
+ tmpEl.style.opacity = '0';
34
+ document.body.appendChild(tmpEl);
35
+ tmpEl.focus();
36
+ if (this._matInput) {
37
+ this._matInput.focus();
38
+ }
39
+ else if (this._el.nativeElement.focus) {
40
+ this._el.nativeElement.focus();
41
+ }
42
+ document.body.removeChild(tmpEl);
43
+ }, 50);
44
+ }
45
+ }
46
+ FsAutoFocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAutoFocusDirective, deps: [{ token: i1.MatInput, host: true, optional: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
47
+ FsAutoFocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FsAutoFocusDirective, selector: "[fsAutofocus],[fsAutoFocus],[autofocus]", inputs: { fsAutofocus: "fsAutofocus", fsAutoFocus: "fsAutoFocus", autofocus: "autofocus" }, ngImport: i0 });
48
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAutoFocusDirective, decorators: [{
49
+ type: Directive,
50
+ args: [{
51
+ selector: '[fsAutofocus],[fsAutoFocus],[autofocus]',
52
+ }]
53
+ }], ctorParameters: function () {
54
+ return [{ type: i1.MatInput, decorators: [{
55
+ type: Optional
56
+ }, {
57
+ type: Host
58
+ }] }, { type: i0.ElementRef }];
59
+ }, propDecorators: { fsAutofocus: [{
60
+ type: Input
61
+ }], fsAutoFocus: [{
62
+ type: Input
63
+ }], autofocus: [{
64
+ type: Input
65
65
  }] } });
66
66
 
67
- class FsAutoSelectDirective {
68
- constructor(_el) {
69
- this._el = _el;
70
- this.fsAutoSelect = true;
71
- }
72
- ngAfterViewInit() {
73
- var _a;
74
- if (((_a = this.fsAutoSelect) !== null && _a !== void 0 ? _a : true) === true) {
75
- this.select();
76
- }
77
- }
78
- select() {
79
- setTimeout(() => {
80
- if (this._el.nativeElement.focus) {
81
- this._el.nativeElement.select();
82
- }
83
- }, 50);
84
- }
85
- }
86
- FsAutoSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutoSelectDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
87
- FsAutoSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsAutoSelectDirective, selector: "[fsAutoSelect]", inputs: { fsAutoSelect: "fsAutoSelect" }, ngImport: i0 });
88
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutoSelectDirective, decorators: [{
89
- type: Directive,
90
- args: [{
91
- selector: '[fsAutoSelect]',
92
- }]
93
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { fsAutoSelect: [{
94
- type: Input
67
+ class FsAutoSelectDirective {
68
+ constructor(_el) {
69
+ this._el = _el;
70
+ this.fsAutoSelect = true;
71
+ }
72
+ ngAfterViewInit() {
73
+ var _a;
74
+ if (((_a = this.fsAutoSelect) !== null && _a !== void 0 ? _a : true) === true) {
75
+ this.select();
76
+ }
77
+ }
78
+ select() {
79
+ setTimeout(() => {
80
+ if (this._el.nativeElement.focus) {
81
+ this._el.nativeElement.select();
82
+ }
83
+ }, 50);
84
+ }
85
+ }
86
+ FsAutoSelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAutoSelectDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
87
+ FsAutoSelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FsAutoSelectDirective, selector: "[fsAutoSelect]", inputs: { fsAutoSelect: "fsAutoSelect" }, ngImport: i0 });
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsAutoSelectDirective, decorators: [{
89
+ type: Directive,
90
+ args: [{
91
+ selector: '[fsAutoSelect]',
92
+ }]
93
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { fsAutoSelect: [{
94
+ type: Input
95
95
  }] } });
96
96
 
97
- class FsAutofocusDirective extends FsAutoFocusDirective {
98
- }
99
- FsAutofocusDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutofocusDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
100
- FsAutofocusDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsAutofocusDirective, selector: "[fsAutofocusLegacy]", usesInheritance: true, ngImport: i0 });
101
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsAutofocusDirective, decorators: [{
102
- type: Directive,
103
- args: [{
104
- selector: '[fsAutofocusLegacy]',
105
- }]
106
- }] });
107
-
108
- class FsModelChangeDirective {
109
- constructor(_ngModel) {
110
- this._ngModel = _ngModel;
111
- this.fsModelChange = new EventEmitter();
112
- this._destroy$ = new Subject();
113
- }
114
- ngOnInit() {
115
- var _a;
116
- this._ngModel.update
117
- .pipe(debounceTime(((_a = this.fsModelChangeOptions) === null || _a === void 0 ? void 0 : _a.debounce) || 500), takeUntil(this._destroy$))
118
- .subscribe((value) => {
119
- this.fsModelChange.emit(value);
120
- });
121
- }
122
- ngOnDestroy() {
123
- this._destroy$.next();
124
- this._destroy$.complete();
125
- }
126
- }
127
- FsModelChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsModelChangeDirective, deps: [{ token: i1$1.NgModel }], target: i0.ɵɵFactoryTarget.Directive });
128
- FsModelChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsModelChangeDirective, selector: "[fsModelChange]", inputs: { fsModelChangeOptions: "fsModelChangeOptions" }, outputs: { fsModelChange: "fsModelChange" }, ngImport: i0 });
129
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsModelChangeDirective, decorators: [{
130
- type: Directive,
131
- args: [{
132
- selector: '[fsModelChange]',
133
- }]
134
- }], ctorParameters: function () { return [{ type: i1$1.NgModel }]; }, propDecorators: { fsModelChangeOptions: [{
135
- type: Input
136
- }], fsModelChange: [{
137
- type: Output
97
+ class FsModelChangeDirective {
98
+ constructor(_ngModel) {
99
+ this._ngModel = _ngModel;
100
+ this.fsModelChange = new EventEmitter();
101
+ this._destroy$ = new Subject();
102
+ }
103
+ ngOnInit() {
104
+ var _a;
105
+ this._ngModel.update
106
+ .pipe(debounceTime(((_a = this.fsModelChangeOptions) === null || _a === void 0 ? void 0 : _a.debounce) || 500), takeUntil(this._destroy$))
107
+ .subscribe((value) => {
108
+ this.fsModelChange.emit(value);
109
+ });
110
+ }
111
+ ngOnDestroy() {
112
+ this._destroy$.next();
113
+ this._destroy$.complete();
114
+ }
115
+ }
116
+ FsModelChangeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsModelChangeDirective, deps: [{ token: i1$1.NgModel }], target: i0.ɵɵFactoryTarget.Directive });
117
+ FsModelChangeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FsModelChangeDirective, selector: "[fsModelChange]", inputs: { fsModelChangeOptions: "fsModelChangeOptions" }, outputs: { fsModelChange: "fsModelChange" }, ngImport: i0 });
118
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsModelChangeDirective, decorators: [{
119
+ type: Directive,
120
+ args: [{
121
+ selector: '[fsModelChange]',
122
+ }]
123
+ }], ctorParameters: function () { return [{ type: i1$1.NgModel }]; }, propDecorators: { fsModelChangeOptions: [{
124
+ type: Input
125
+ }], fsModelChange: [{
126
+ type: Output
138
127
  }] } });
139
128
 
140
- class FsPreventDefaultDirective {
141
- preventClick(event) {
142
- event.preventDefault();
143
- }
144
- }
145
- FsPreventDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsPreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
146
- FsPreventDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
147
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsPreventDefaultDirective, decorators: [{
148
- type: Directive,
149
- args: [{
150
- selector: '[fsPreventDefault]',
151
- }]
152
- }], propDecorators: { preventClick: [{
153
- type: HostListener,
154
- args: ['click', ['$event']]
129
+ class FsPreventDefaultDirective {
130
+ preventClick(event) {
131
+ event.preventDefault();
132
+ }
133
+ }
134
+ FsPreventDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsPreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
135
+ FsPreventDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FsPreventDefaultDirective, selector: "[fsPreventDefault]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsPreventDefaultDirective, decorators: [{
137
+ type: Directive,
138
+ args: [{
139
+ selector: '[fsPreventDefault]',
140
+ }]
141
+ }], propDecorators: { preventClick: [{
142
+ type: HostListener,
143
+ args: ['click', ['$event']]
155
144
  }] } });
156
145
 
157
- class FsStopPropagationDirective {
158
- preventClick(event) {
159
- event.stopPropagation();
160
- }
161
- }
162
- FsStopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsStopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
163
- FsStopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.4.0", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
164
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsStopPropagationDirective, decorators: [{
165
- type: Directive,
166
- args: [{
167
- selector: '[fsStopPropagation]',
168
- }]
169
- }], propDecorators: { preventClick: [{
170
- type: HostListener,
171
- args: ['click', ['$event']]
146
+ class FsStopPropagationDirective {
147
+ preventClick(event) {
148
+ event.stopPropagation();
149
+ }
150
+ }
151
+ FsStopPropagationDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsStopPropagationDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
152
+ FsStopPropagationDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.10", type: FsStopPropagationDirective, selector: "[fsStopPropagation]", host: { listeners: { "click": "preventClick($event)" } }, ngImport: i0 });
153
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsStopPropagationDirective, decorators: [{
154
+ type: Directive,
155
+ args: [{
156
+ selector: '[fsStopPropagation]',
157
+ }]
158
+ }], propDecorators: { preventClick: [{
159
+ type: HostListener,
160
+ args: ['click', ['$event']]
172
161
  }] } });
173
162
 
174
- function guid(pattern, options = { case: 'lower', numbers: true }) {
175
- pattern = pattern || 'xxxxxx';
176
- let s = '';
177
- if (options.numbers !== false) {
178
- s = '0123456789';
179
- }
180
- if (!options.case || options.case === 'lower' || options.case === 'mixed') {
181
- s = s.concat('abcdefghijklmnopqrstuvwxyz');
182
- }
183
- if (options.case === 'upper' || options.case === 'mixed') {
184
- s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
185
- }
186
- const chars = s.match(/(.{1,1})/g);
187
- return pattern.replace(/[x]/g, function (c) {
188
- const i = (Math.random() * chars.length) | 0;
189
- return chars[i];
190
- });
191
- }
192
-
193
- function isEmpty(value, options) {
194
- options = options || {};
195
- return value === undefined ||
196
- value === null ||
197
- value === false ||
198
- value === '' ||
199
- String(value).length === 0 ||
200
- (Array.isArray(value) && value.length === 0) ||
201
- (value instanceof Object && (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
202
- (!options.zero && (value === 0 || value === '0'));
203
- }
204
-
205
- function stringify(value) {
206
- return JSON.stringify(value);
207
- }
208
-
209
- class FsUtilStringifyPipe {
210
- constructor() { }
211
- transform(value) {
212
- return stringify(value);
213
- }
214
- }
215
- FsUtilStringifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
216
- FsUtilStringifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
217
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilStringifyPipe, decorators: [{
218
- type: Pipe,
219
- args: [{
220
- name: 'fsUtilStringify',
221
- }]
222
- }], ctorParameters: function () { return []; } });
223
- class FsUtilGuidPipe {
224
- constructor() { }
225
- transform() {
226
- return guid();
227
- }
228
- }
229
- FsUtilGuidPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
230
- FsUtilGuidPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, name: "fsUtilGuid" });
231
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilGuidPipe, decorators: [{
232
- type: Pipe,
233
- args: [{
234
- name: 'fsUtilGuid',
235
- }]
236
- }], ctorParameters: function () { return []; } });
237
- class FsUtilIsEmptyPipe {
238
- transform(value) {
239
- return isEmpty(value);
240
- }
241
- }
242
- FsUtilIsEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
243
- FsUtilIsEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsEmptyPipe, decorators: [{
245
- type: Pipe,
246
- args: [{
247
- name: 'fsUtilIsEmpty',
248
- }]
249
- }] });
250
- class FsUtilIsNotEmptyPipe {
251
- transform(value) {
252
- return !isEmpty(value);
253
- }
254
- }
255
- FsUtilIsNotEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
256
- FsUtilIsNotEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
257
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtilIsNotEmptyPipe, decorators: [{
258
- type: Pipe,
259
- args: [{
260
- name: 'fsUtilIsNotEmpty',
261
- }]
163
+ function guid(pattern, options = { case: 'lower', numbers: true }) {
164
+ pattern = pattern || 'xxxxxx';
165
+ let s = '';
166
+ if (options.numbers !== false) {
167
+ s = '0123456789';
168
+ }
169
+ if (!options.case || options.case === 'lower' || options.case === 'mixed') {
170
+ s = s.concat('abcdefghijklmnopqrstuvwxyz');
171
+ }
172
+ if (options.case === 'upper' || options.case === 'mixed') {
173
+ s = s.concat('ABCDEFGHIJKLMNOPQRSTUVWXYZ');
174
+ }
175
+ const chars = s.match(/(.{1,1})/g);
176
+ return pattern.replace(/[x]/g, function (c) {
177
+ const i = (Math.random() * chars.length) | 0;
178
+ return chars[i];
179
+ });
180
+ }
181
+
182
+ function isEmpty(value, options) {
183
+ options = options || {};
184
+ return value === undefined ||
185
+ value === null ||
186
+ value === false ||
187
+ value === '' ||
188
+ String(value).length === 0 ||
189
+ (Array.isArray(value) && value.length === 0) ||
190
+ (value instanceof Object && (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
191
+ (!options.zero && (value === 0 || value === '0'));
192
+ }
193
+
194
+ function stringify(value) {
195
+ return JSON.stringify(value);
196
+ }
197
+
198
+ class FsUtilStringifyPipe {
199
+ constructor() { }
200
+ transform(value) {
201
+ return stringify(value);
202
+ }
203
+ }
204
+ FsUtilStringifyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtilStringifyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
205
+ FsUtilStringifyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsUtilStringifyPipe, name: "fsUtilStringify" });
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtilStringifyPipe, decorators: [{
207
+ type: Pipe,
208
+ args: [{
209
+ name: 'fsUtilStringify',
210
+ }]
211
+ }], ctorParameters: function () { return []; } });
212
+ class FsUtilGuidPipe {
213
+ constructor() { }
214
+ transform() {
215
+ return guid();
216
+ }
217
+ }
218
+ FsUtilGuidPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtilGuidPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
219
+ FsUtilGuidPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsUtilGuidPipe, name: "fsUtilGuid" });
220
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtilGuidPipe, decorators: [{
221
+ type: Pipe,
222
+ args: [{
223
+ name: 'fsUtilGuid',
224
+ }]
225
+ }], ctorParameters: function () { return []; } });
226
+ class FsUtilIsEmptyPipe {
227
+ transform(value) {
228
+ return isEmpty(value);
229
+ }
230
+ }
231
+ FsUtilIsEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtilIsEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
232
+ FsUtilIsEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsUtilIsEmptyPipe, name: "fsUtilIsEmpty" });
233
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtilIsEmptyPipe, decorators: [{
234
+ type: Pipe,
235
+ args: [{
236
+ name: 'fsUtilIsEmpty',
237
+ }]
262
238
  }] });
239
+ class FsUtilIsNotEmptyPipe {
240
+ transform(value) {
241
+ return !isEmpty(value);
242
+ }
243
+ }
244
+ FsUtilIsNotEmptyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtilIsNotEmptyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
245
+ FsUtilIsNotEmptyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsUtilIsNotEmptyPipe, name: "fsUtilIsNotEmpty" });
246
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtilIsNotEmptyPipe, decorators: [{
247
+ type: Pipe,
248
+ args: [{
249
+ name: 'fsUtilIsNotEmpty',
250
+ }]
251
+ }] });
252
+
253
+ function compare(query, item) {
254
+ let value = true;
255
+ for (const key in query) {
256
+ value = value && item[key] == query[key];
257
+ }
258
+ return value;
259
+ }
260
+
261
+ function filter(array, query) {
262
+ if (typeof query !== 'function') {
263
+ const queryObj = query;
264
+ query = (item) => {
265
+ return compare(queryObj, item);
266
+ };
267
+ }
268
+ const isarray = Array.isArray(array);
269
+ const list = isarray ? [] : {};
270
+ if (isarray) {
271
+ array.forEach(function (item, idx) {
272
+ if (query(item)) {
273
+ list.push(item);
274
+ }
275
+ });
276
+ }
277
+ else {
278
+ Object.keys(array).forEach(key => {
279
+ if (query(array[key])) {
280
+ list[key] = array[key];
281
+ }
282
+ });
283
+ }
284
+ return list;
285
+ }
286
+
287
+ function inArray(values, array) {
288
+ if (!Array.isArray(values)) {
289
+ values = [values];
290
+ }
291
+ for (let i = 0, len = values.length; i < len; i++) {
292
+ if (array.indexOf(values[i]) >= 0) {
293
+ return true;
294
+ }
295
+ }
296
+ return false;
297
+ }
298
+
299
+ function index(array, name, value = null) {
300
+ const list = {};
301
+ array.forEach(function (item) {
302
+ list[item[name]] = value ? item[value] : item;
303
+ });
304
+ return list;
305
+ }
306
+
307
+ function indexOf(array, query) {
308
+ if (typeof query !== 'function') {
309
+ const queryObj = query;
310
+ query = (item) => {
311
+ return compare(queryObj, item);
312
+ };
313
+ }
314
+ for (let i = 0, len = array.length; i < len; i++) {
315
+ if (query(array[i])) {
316
+ return i;
317
+ }
318
+ }
319
+ return -1;
320
+ }
321
+
322
+ function keyExists(array, key) {
323
+ return array.hasOwnProperty(key);
324
+ }
325
+
326
+ function ksort(unordered) {
327
+ Object.keys(unordered).sort().forEach(function (key) {
328
+ const value = unordered[key];
329
+ delete unordered[key];
330
+ unordered[key] = value;
331
+ });
332
+ }
333
+
334
+ function list(array, property, index = null) {
335
+ const resultList = index ? {} : [];
336
+ array.forEach(function (item, idx) {
337
+ if (index) {
338
+ resultList[item[index]] = item[property];
339
+ }
340
+ else {
341
+ resultList.push(item[property]);
342
+ }
343
+ });
344
+ return resultList;
345
+ }
346
+
347
+ function nameValue(array, name, value) {
348
+ const list = [];
349
+ if (name || value) {
350
+ const nameFn = typeof name === 'function' ? name : function (item) {
351
+ return item[name];
352
+ };
353
+ const valueFn = typeof value === 'function' ? value : function (item) {
354
+ return item[value];
355
+ };
356
+ array.forEach(function (item) {
357
+ list.push({ name: nameFn(item), value: valueFn(item) });
358
+ });
359
+ }
360
+ else {
361
+ array.forEach(function (n, v) {
362
+ list.push({ name: n, value: v });
363
+ });
364
+ }
365
+ return list;
366
+ }
367
+
368
+ function remove(array, query) {
369
+ const idx = indexOf(array, query);
370
+ if (idx >= 0) {
371
+ return array.splice(idx, 1);
372
+ }
373
+ return idx;
374
+ }
375
+
376
+ function sort(array, query, reverse = false) {
377
+ if (typeof query !== 'function') {
378
+ const queryStr = query;
379
+ query = function (a, b) {
380
+ if (reverse) {
381
+ if (a[queryStr] < b[queryStr]) {
382
+ return 1;
383
+ }
384
+ else if (a[queryStr] > b[queryStr]) {
385
+ return -1;
386
+ }
387
+ }
388
+ else {
389
+ if (a[queryStr] > b[queryStr]) {
390
+ return 1;
391
+ }
392
+ else if (a[queryStr] < b[queryStr]) {
393
+ return -1;
394
+ }
395
+ }
396
+ return 0;
397
+ };
398
+ }
399
+ array.sort(query);
400
+ return array;
401
+ }
402
+
403
+ function rsort(array, query) {
404
+ return sort(array, query, true);
405
+ }
406
+
407
+ function find(array, query) {
408
+ const data = filter(array, query);
409
+ return data.length ? data[0] : null;
410
+ }
411
+
412
+ function boolean(value) {
413
+ return String(value).toLowerCase() !== 'false' && !!value;
414
+ }
415
+
416
+ function clone(obj) {
417
+ if (obj instanceof Date) {
418
+ return new Date(obj);
419
+ }
420
+ else if (Array.isArray(obj)) {
421
+ const arr = [];
422
+ for (let i = 0; i < obj.length; i++) {
423
+ arr[i] = clone(obj[i]);
424
+ }
425
+ return arr;
426
+ }
427
+ else if (typeof (obj) === 'object') {
428
+ const cloned = {};
429
+ for (let key in obj) {
430
+ cloned[key] = clone(obj[key]);
431
+ }
432
+ return cloned;
433
+ }
434
+ return obj;
435
+ }
436
+
437
+ function debounce(func, wait, immediate) {
438
+ let timeout;
439
+ return function () {
440
+ const context = this, args = arguments;
441
+ const later = function () {
442
+ timeout = null;
443
+ if (!immediate)
444
+ func.apply(context, args);
445
+ };
446
+ const callNow = immediate && !timeout;
447
+ clearTimeout(timeout);
448
+ timeout = setTimeout(later, wait);
449
+ if (callNow)
450
+ func.apply(context, args);
451
+ };
452
+ }
453
+
454
+ function removeQueryParams(path) {
455
+ return path.split('?')[0];
456
+ }
457
+
458
+ function getNormalizedPath(locationSrv) {
459
+ const path = locationSrv.prepareExternalUrl(locationSrv.path());
460
+ return removeQueryParams(path);
461
+ }
462
+
463
+ function isArrayEqual(arr1, arr2) {
464
+ if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
465
+ return false;
466
+ }
467
+ const sortFn = (a, b) => {
468
+ if (a < b) {
469
+ return -1;
470
+ }
471
+ else if (a > b) {
472
+ return 1;
473
+ }
474
+ else {
475
+ return 0;
476
+ }
477
+ };
478
+ arr1 = [...arr1].sort(sortFn);
479
+ arr2 = [...arr2].sort(sortFn);
480
+ return arr1.every((value, index) => {
481
+ return value === arr2[index];
482
+ });
483
+ }
263
484
 
264
- function compare(query, item) {
265
- let value = true;
266
- for (const key in query) {
267
- value = value && item[key] == query[key];
268
- }
269
- return value;
270
- }
271
-
272
- function filter(array, query) {
273
- if (typeof query !== 'function') {
274
- const queryObj = query;
275
- query = (item) => {
276
- return compare(queryObj, item);
277
- };
278
- }
279
- const isarray = Array.isArray(array);
280
- const list = isarray ? [] : {};
281
- if (isarray) {
282
- array.forEach(function (item, idx) {
283
- if (query(item)) {
284
- list.push(item);
285
- }
286
- });
287
- }
288
- else {
289
- Object.keys(array).forEach(key => {
290
- if (query(array[key])) {
291
- list[key] = array[key];
292
- }
293
- });
294
- }
295
- return list;
296
- }
297
-
298
- function inArray(values, array) {
299
- if (!Array.isArray(values)) {
300
- values = [values];
301
- }
302
- for (let i = 0, len = values.length; i < len; i++) {
303
- if (array.indexOf(values[i]) >= 0) {
304
- return true;
305
- }
306
- }
307
- return false;
308
- }
309
-
310
- function index(array, name, value = null) {
311
- const list = {};
312
- array.forEach(function (item) {
313
- list[item[name]] = value ? item[value] : item;
314
- });
315
- return list;
316
- }
317
-
318
- function indexOf(array, query) {
319
- if (typeof query !== 'function') {
320
- const queryObj = query;
321
- query = (item) => {
322
- return compare(queryObj, item);
323
- };
324
- }
325
- for (let i = 0, len = array.length; i < len; i++) {
326
- if (query(array[i])) {
327
- return i;
328
- }
329
- }
330
- return -1;
331
- }
332
-
333
- function keyExists(array, key) {
334
- return array.hasOwnProperty(key);
335
- }
336
-
337
- function ksort(unordered) {
338
- Object.keys(unordered).sort().forEach(function (key) {
339
- const value = unordered[key];
340
- delete unordered[key];
341
- unordered[key] = value;
342
- });
343
- }
344
-
345
- function list(array, property, index = null) {
346
- const resultList = index ? {} : [];
347
- array.forEach(function (item, idx) {
348
- if (index) {
349
- resultList[item[index]] = item[property];
350
- }
351
- else {
352
- resultList.push(item[property]);
353
- }
354
- });
355
- return resultList;
356
- }
357
-
358
- function nameValue(array, name, value) {
359
- const list = [];
360
- if (name || value) {
361
- const nameFn = typeof name === 'function' ? name : function (item) {
362
- return item[name];
363
- };
364
- const valueFn = typeof value === 'function' ? value : function (item) {
365
- return item[value];
366
- };
367
- array.forEach(function (item) {
368
- list.push({ name: nameFn(item), value: valueFn(item) });
369
- });
370
- }
371
- else {
372
- array.forEach(function (n, v) {
373
- list.push({ name: n, value: v });
374
- });
375
- }
376
- return list;
377
- }
378
-
379
- function remove(array, query) {
380
- const idx = indexOf(array, query);
381
- if (idx >= 0) {
382
- return array.splice(idx, 1);
383
- }
384
- return idx;
385
- }
386
-
387
- function sort(array, query, reverse = false) {
388
- if (typeof query !== 'function') {
389
- const queryStr = query;
390
- query = function (a, b) {
391
- if (reverse) {
392
- if (a[queryStr] < b[queryStr]) {
393
- return 1;
394
- }
395
- else if (a[queryStr] > b[queryStr]) {
396
- return -1;
397
- }
398
- }
399
- else {
400
- if (a[queryStr] > b[queryStr]) {
401
- return 1;
402
- }
403
- else if (a[queryStr] < b[queryStr]) {
404
- return -1;
405
- }
406
- }
407
- return 0;
408
- };
409
- }
410
- array.sort(query);
411
- return array;
412
- }
413
-
414
- function rsort(array, query) {
415
- return sort(array, query, true);
416
- }
417
-
418
- function find(array, query) {
419
- const data = filter(array, query);
420
- return data.length ? data[0] : null;
421
- }
422
-
423
- function boolean(value) {
424
- return String(value).toLowerCase() !== 'false' && !!value;
425
- }
426
-
427
- function clone(obj) {
428
- if (obj instanceof Date) {
429
- return new Date(obj);
430
- }
431
- else if (Array.isArray(obj)) {
432
- const arr = [];
433
- for (let i = 0; i < obj.length; i++) {
434
- arr[i] = clone(obj[i]);
435
- }
436
- return arr;
437
- }
438
- else if (typeof (obj) === 'object') {
439
- const cloned = {};
440
- for (let key in obj) {
441
- cloned[key] = clone(obj[key]);
442
- }
443
- return cloned;
444
- }
445
- return obj;
446
- }
447
-
448
- function debounce(func, wait, immediate) {
449
- let timeout;
450
- return function () {
451
- const context = this, args = arguments;
452
- const later = function () {
453
- timeout = null;
454
- if (!immediate)
455
- func.apply(context, args);
456
- };
457
- const callNow = immediate && !timeout;
458
- clearTimeout(timeout);
459
- timeout = setTimeout(later, wait);
460
- if (callNow)
461
- func.apply(context, args);
462
- };
463
- }
464
-
465
- function removeQueryParams(path) {
466
- return path.split('?')[0];
467
- }
468
-
469
- function getNormalizedPath(locationSrv) {
470
- const path = locationSrv.prepareExternalUrl(locationSrv.path());
471
- return removeQueryParams(path);
472
- }
473
-
474
- function isArrayEqual(arr1, arr2) {
475
- if (!Array.isArray(arr1) || !Array.isArray(arr2) || arr1.length !== arr2.length) {
476
- return false;
477
- }
478
- const sortFn = (a, b) => {
479
- if (a < b) {
480
- return -1;
481
- }
482
- else if (a > b) {
483
- return 1;
484
- }
485
- else {
486
- return 0;
487
- }
488
- };
489
- arr1 = [...arr1].sort(sortFn);
490
- arr2 = [...arr2].sort(sortFn);
491
- return arr1.every((value, index) => {
492
- return value === arr2[index];
493
- });
494
- }
495
-
496
- function isClass(value, cls) {
497
- if (typeof value === 'object') {
498
- if (typeof cls === 'string') {
499
- if (value.constructor) {
500
- if (value.constructor.name === cls) {
501
- return true;
502
- }
503
- }
504
- }
505
- else {
506
- if (value instanceof cls) {
507
- return true;
508
- }
509
- }
510
- }
511
- return false;
512
- }
513
-
514
- function isNumeric(value) {
515
- const str = String(value);
516
- return str.length && !!str.match(/^-?\d*\.?\d*$/);
517
- }
518
-
519
- function isObject(value) {
520
- return !!value && typeof value === 'object' && !Array.isArray(value);
521
- }
522
-
523
- const KEY_CANCEL$1 = 3;
524
- const KEY_HELP$1 = 6;
525
- const KEY_BACKSPACE$1 = 8;
526
- const KEY_TAB$1 = 9;
527
- const KEY_CLEAR$1 = 12;
528
- const KEY_RETURN$1 = 13;
529
- const KEY_ENTER$1 = 14;
530
- const KEY_SHIFT$1 = 16;
531
- const KEY_CONTROL$1 = 17;
532
- const KEY_ALT$1 = 18;
533
- const KEY_PAUSE$1 = 19;
534
- const KEY_CAPS_LOCK$1 = 20;
535
- const KEY_ESCAPE$1 = 27;
536
- const KEY_SPACE$1 = 32;
537
- const KEY_PAGE_UP$1 = 33;
538
- const KEY_PAGE_DOWN$1 = 34;
539
- const KEY_END$1 = 35;
540
- const KEY_HOME$1 = 36;
541
- const KEY_LEFT$1 = 37;
542
- const KEY_UP$1 = 38;
543
- const KEY_RIGHT$1 = 39;
544
- const KEY_DOWN$1 = 40;
545
- const KEY_PRINTSCREEN$1 = 44;
546
- const KEY_INSERT$1 = 45;
547
- const KEY_DELETE$1 = 46;
548
- const KEY_0$1 = 48;
549
- const KEY_1$1 = 49;
550
- const KEY_2$1 = 50;
551
- const KEY_3$1 = 51;
552
- const KEY_4$1 = 52;
553
- const KEY_5$1 = 53;
554
- const KEY_6$1 = 54;
555
- const KEY_7$1 = 55;
556
- const KEY_8$1 = 56;
557
- const KEY_9$1 = 57;
558
- const KEY_SEMICOLON$1 = 59;
485
+ function isClass(value, cls) {
486
+ if (typeof value === 'object') {
487
+ if (typeof cls === 'string') {
488
+ if (value.constructor) {
489
+ if (value.constructor.name === cls) {
490
+ return true;
491
+ }
492
+ }
493
+ }
494
+ else {
495
+ if (value instanceof cls) {
496
+ return true;
497
+ }
498
+ }
499
+ }
500
+ return false;
501
+ }
502
+
503
+ function isNumeric(value) {
504
+ const str = String(value);
505
+ return str.length && !!str.match(/^-?\d*\.?\d*$/);
506
+ }
507
+
508
+ function isObject(value) {
509
+ return !!value && typeof value === 'object' && !Array.isArray(value);
510
+ }
511
+
512
+ const KEY_CANCEL$1 = 3;
513
+ const KEY_HELP$1 = 6;
514
+ const KEY_BACKSPACE$1 = 8;
515
+ const KEY_TAB$1 = 9;
516
+ const KEY_CLEAR$1 = 12;
517
+ const KEY_RETURN$1 = 13;
518
+ const KEY_ENTER$1 = 14;
519
+ const KEY_SHIFT$1 = 16;
520
+ const KEY_CONTROL$1 = 17;
521
+ const KEY_ALT$1 = 18;
522
+ const KEY_PAUSE$1 = 19;
523
+ const KEY_CAPS_LOCK$1 = 20;
524
+ const KEY_ESCAPE$1 = 27;
525
+ const KEY_SPACE$1 = 32;
526
+ const KEY_PAGE_UP$1 = 33;
527
+ const KEY_PAGE_DOWN$1 = 34;
528
+ const KEY_END$1 = 35;
529
+ const KEY_HOME$1 = 36;
530
+ const KEY_LEFT$1 = 37;
531
+ const KEY_UP$1 = 38;
532
+ const KEY_RIGHT$1 = 39;
533
+ const KEY_DOWN$1 = 40;
534
+ const KEY_PRINTSCREEN$1 = 44;
535
+ const KEY_INSERT$1 = 45;
536
+ const KEY_DELETE$1 = 46;
537
+ const KEY_0$1 = 48;
538
+ const KEY_1$1 = 49;
539
+ const KEY_2$1 = 50;
540
+ const KEY_3$1 = 51;
541
+ const KEY_4$1 = 52;
542
+ const KEY_5$1 = 53;
543
+ const KEY_6$1 = 54;
544
+ const KEY_7$1 = 55;
545
+ const KEY_8$1 = 56;
546
+ const KEY_9$1 = 57;
547
+ const KEY_SEMICOLON$1 = 59;
559
548
  const KEY_EQUALS$1 = 61;
560
549
 
561
- function length(object) {
562
- if (Array.isArray(object)) {
563
- return object.length;
564
- }
565
- if (object instanceof Object) {
566
- return Object.keys(object).length;
567
- }
568
- return 0;
569
- }
570
-
571
- function ordinalNumber(value) {
572
- value = String(value);
573
- const index = value.match `1?.$`;
574
- const endings = [, 'st', 'nd', 'rd'];
575
- const ending = endings[index] || 'th';
576
- return value + ending;
577
- }
578
-
579
- class Operation {
580
- constructor(target, name) {
581
- this.ready$ = new Subject();
582
- this.name = name ? name : guid();
583
- if (target instanceof Observable) {
584
- this.target = target;
585
- }
586
- else {
587
- this.target = of(target);
588
- }
589
- }
590
- }
591
-
592
- var QueueState;
593
- (function (QueueState) {
594
- QueueState["Idle"] = "idle";
595
- QueueState["Processing"] = "processing";
550
+ function length(object) {
551
+ if (Array.isArray(object)) {
552
+ return object.length;
553
+ }
554
+ if (object instanceof Object) {
555
+ return Object.keys(object).length;
556
+ }
557
+ return 0;
558
+ }
559
+
560
+ function ordinalNumber(value) {
561
+ value = String(value);
562
+ const index = value.match `1?.$`;
563
+ const endings = [, 'st', 'nd', 'rd'];
564
+ const ending = endings[index] || 'th';
565
+ return value + ending;
566
+ }
567
+
568
+ class Operation {
569
+ constructor(target, name) {
570
+ this.ready$ = new Subject();
571
+ this.name = name ? name : guid();
572
+ if (target instanceof Observable) {
573
+ this.target = target;
574
+ }
575
+ else {
576
+ this.target = of(target);
577
+ }
578
+ }
579
+ }
580
+
581
+ var QueueState;
582
+ (function (QueueState) {
583
+ QueueState["Idle"] = "idle";
584
+ QueueState["Processing"] = "processing";
596
585
  })(QueueState || (QueueState = {}));
597
586
 
598
- class Queue {
599
- constructor(_limit = Infinity) {
600
- this._limit = _limit;
601
- this._queueStats = {
602
- completed: 0,
603
- total: 0,
604
- errors: [],
605
- };
606
- this._doneQueueStats = {
607
- completed: 0,
608
- total: 0,
609
- errors: [],
610
- };
611
- this._completeQueueStats = {
612
- completed: 0,
613
- total: 0,
614
- errors: [],
615
- };
616
- this._done = new Subject();
617
- this._queue = [];
618
- this._inProgress = [];
619
- this._state = QueueState.Idle;
620
- this._destroy$ = new Subject();
621
- // if(_targets) {
622
- // _targets.forEach((target) => {
623
- // this.push(target);
624
- // });
625
- // }
626
- }
627
- get total() {
628
- return this._queueStats.total;
629
- }
630
- get completed() {
631
- return this._queueStats.completed;
632
- }
633
- get pending() {
634
- return this._queue.length;
635
- }
636
- get inProgress() {
637
- return this._inProgress.length;
638
- }
639
- get errors() {
640
- return this._queueStats.errors;
641
- }
642
- get state() {
643
- return this._state;
644
- }
645
- get empty() {
646
- return !this._queue.length && !this._inProgress.length;
647
- }
648
- get pendingOperations() {
649
- return this._queue
650
- .map((operation) => operation.name);
651
- }
652
- get inProgressOperations() {
653
- return this._inProgress
654
- .map((operation) => operation.name);
655
- }
656
- isProcessing() {
657
- return this._state === QueueState.Processing;
658
- }
659
- isIdle() {
660
- return this._state === QueueState.Idle;
661
- }
662
- setLimit(value) {
663
- this._limit = value;
664
- }
665
- /**
666
- * @depreated
667
- */
668
- subscribe(fun, err, complete) {
669
- this.observe$
670
- .subscribe(fun, err, complete);
671
- }
672
- get observe$() {
673
- return this._done
674
- .pipe(takeUntil(this._destroy$));
675
- }
676
- get complete$() {
677
- if (!this.isProcessing()) {
678
- return of({ total: 0, completed: 0, errors: [] });
679
- }
680
- return this.observe$
681
- .pipe(take(1), map(() => (this._completeQueueStats)));
682
- }
683
- complete(fun, err, complete) {
684
- this.complete$.subscribe(fun, err, complete);
685
- }
686
- push(target, name) {
687
- const operation = new Operation(target, name);
688
- this._queueStats.total++;
689
- this._doneQueueStats.total++;
690
- this._completeQueueStats.total++;
691
- this._state = QueueState.Processing;
692
- if (this._inProgress.length < this._limit) {
693
- this._processOperation(operation);
694
- }
695
- else {
696
- this._queue.push(operation);
697
- }
698
- return operation.ready$;
699
- }
700
- clear() {
701
- this._queue = [];
702
- this._state = QueueState.Idle;
703
- this._queueStats = {
704
- total: 0,
705
- errors: [],
706
- completed: 0,
707
- };
708
- this._clearDoneQueueStats();
709
- }
710
- destroy() {
711
- this._done.complete();
712
- this.clear();
713
- }
714
- _processOperation(operation) {
715
- this._inProgress.push(operation);
716
- operation.target
717
- .pipe(delay(200), // Hack to prevent extra quick proccess execution
718
- finalize(() => {
719
- const opIndex = this._inProgress.indexOf(operation);
720
- this._inProgress.splice(opIndex, 1);
721
- if (this.empty) {
722
- this._state = QueueState.Idle;
723
- this._done.next(this._doneQueueStats);
724
- this._clearDoneQueueStats();
725
- }
726
- else {
727
- if (this._queue.length) {
728
- const queueItem = this._queue.shift();
729
- this._processOperation(queueItem);
730
- }
731
- }
732
- }), takeUntil(this._destroy$)).subscribe({
733
- next: (data) => {
734
- operation.ready$.next(data);
735
- },
736
- error: (error) => {
737
- this._queueStats.errors.push(error);
738
- this._doneQueueStats.errors.push(error);
739
- this._completeQueueStats.errors.push(error);
740
- operation.ready$.error(error);
741
- },
742
- complete: () => {
743
- this._queueStats.completed++;
744
- this._doneQueueStats.completed++;
745
- this._completeQueueStats.completed++;
746
- operation.ready$.complete();
747
- }
748
- });
749
- }
750
- _clearDoneQueueStats() {
751
- this._doneQueueStats = {
752
- total: 0,
753
- errors: [],
754
- completed: 0,
755
- };
756
- }
757
- }
758
-
759
- function resolve(promise, defaults = []) {
760
- const result = defaults;
761
- return new Promise(resolve => {
762
- promise.then(function (data) {
763
- Object.keys(data).forEach(key => result[key] = data[key]);
764
- resolve(result);
765
- });
766
- });
767
- }
768
-
769
- function round(num, decimalPlaces = 0) {
770
- num = parseFloat(parseFloat(num).toPrecision(Number.MAX_SAFE_INTEGER.toString().length - 1));
771
- const p = Math.pow(10, decimalPlaces);
772
- return Math.round(num * p) / p;
773
- }
774
-
775
- const fsSourceLoader = (function () {
776
- let _document;
777
- let _headElement;
778
- const _sources = new Map();
779
- const _loadedResources = new Map();
780
- // bad way but don't want to bother developer
781
- setDocument(document);
782
- // but developer can set document at any time
783
- function setDocument(document) {
784
- _document = document;
785
- _headElement = _document === null || _document === void 0 ? void 0 : _document.head;
786
- }
787
- /**
788
- * register a list of the resources for future loading
789
- *
790
- * example:
791
- * sourceLoader.registerResources({
792
- * froala: [
793
- * '/assets/js/froala/froala_editor.min.js',
794
- * '/assets/css/froala_editor.pkgd.min.css',
795
- * ],
796
- * froala_align: '/assets/js/froala/plugins/align.min.js',
797
- * froala_colors: '/assets/js/froala/plugins/colors.min.js',
798
- * froala_image: '/assets/js/froala/plugins/image.min.js',
799
- * });
800
- *
801
- */
802
- function registerResources(resources) {
803
- Object.entries(resources)
804
- .forEach(([name, path]) => {
805
- if (typeof path === 'string') {
806
- path = [path];
807
- }
808
- if (!_sources.has(name)) {
809
- _sources.set(name, new Set());
810
- }
811
- const resourcesList = _sources.get(name);
812
- path.forEach((p) => {
813
- resourcesList.add(p);
814
- });
815
- });
816
- }
817
- /**
818
- * load any resource previously registered
819
- *
820
- * sourceLoader.loadResource('froala')
821
- *
822
- * or load any js/css file
823
- *
824
- * sourceLoader.loadResource('/assets/my-source.js')
825
- *
826
- */
827
- function loadResource(name) {
828
- if (_loadedResources.has(name)) {
829
- return _loadedResources.get(name);
830
- }
831
- if (_sources.has(name)) {
832
- const sourcesForLoading = [..._sources.get(name)]
833
- .map((path) => {
834
- return _loadResource(path);
835
- })
836
- .filter((v) => !!v);
837
- return combineLatest(sourcesForLoading);
838
- }
839
- return _loadResource(name);
840
- }
841
- /**
842
- * the same as `loadResource` but you can pass list of the resources for loading
843
- */
844
- function loadResources(listOfResources) {
845
- const resourcesToLoad = listOfResources
846
- .reduce((acc, name) => {
847
- const loading$ = loadResource(name);
848
- if (loading$) {
849
- acc.push(loading$);
850
- }
851
- return acc;
852
- }, []);
853
- return combineLatest(resourcesToLoad);
854
- }
855
- ///
856
- function _loadResource(path) {
857
- if (_isStylesUrl(path)) {
858
- return _loadStyles(path);
859
- }
860
- if (_isJavascriptUrl(path)) {
861
- return _loadJs(path);
862
- }
863
- console.warn(`Resource ${path} can not be identified and loaded`);
864
- return null;
865
- }
866
- function _loadJs(scriptPath) {
867
- if (!_loadedResources.has(scriptPath)) {
868
- const obs$ = new Observable((obs) => {
869
- const script = document.createElement('script');
870
- script.src = scriptPath;
871
- _headElement.appendChild(script);
872
- script.onload = () => {
873
- obs.next();
874
- obs.complete();
875
- };
876
- script.onerror = (err) => {
877
- obs.error(err);
878
- };
879
- }).pipe(shareReplay(1));
880
- _loadedResources.set(scriptPath, obs$);
881
- }
882
- return _loadedResources.get(scriptPath);
883
- }
884
- function _loadStyles(stylePath) {
885
- if (!_loadedResources.has(stylePath)) {
886
- const obs$ = new Observable((obs) => {
887
- const style = document.createElement('link');
888
- style.id = stylePath;
889
- style.rel = 'stylesheet';
890
- style.href = `${stylePath}`;
891
- _headElement.appendChild(style);
892
- style.onload = () => {
893
- obs.next();
894
- obs.complete();
895
- };
896
- style.onerror = (err) => {
897
- obs.error(err);
898
- };
899
- });
900
- _loadedResources.set(stylePath, obs$);
901
- }
902
- return _loadedResources.get(stylePath);
903
- }
904
- function _isJavascriptUrl(url) {
905
- return url.endsWith('.js');
906
- }
907
- function _isStylesUrl(url) {
908
- return url.endsWith('.css');
909
- }
910
- return {
911
- setDocument,
912
- registerResources,
913
- loadResource,
914
- loadResources,
915
- loadJs: _loadJs,
916
- loadStyles: _loadStyles,
917
- };
918
- })();
919
- function loadStyles(path) {
920
- return fsSourceLoader.loadStyles(path);
921
- }
922
- ;
923
- function loadJs(path) {
924
- return fsSourceLoader.loadJs(path);
925
- }
587
+ class Queue {
588
+ constructor(_limit = Infinity) {
589
+ this._limit = _limit;
590
+ this._queueStats = {
591
+ completed: 0,
592
+ total: 0,
593
+ errors: [],
594
+ };
595
+ this._doneQueueStats = {
596
+ completed: 0,
597
+ total: 0,
598
+ errors: [],
599
+ };
600
+ this._completeQueueStats = {
601
+ completed: 0,
602
+ total: 0,
603
+ errors: [],
604
+ };
605
+ this._done = new Subject();
606
+ this._queue = [];
607
+ this._inProgress = [];
608
+ this._state = QueueState.Idle;
609
+ this._destroy$ = new Subject();
610
+ // if(_targets) {
611
+ // _targets.forEach((target) => {
612
+ // this.push(target);
613
+ // });
614
+ // }
615
+ }
616
+ get total() {
617
+ return this._queueStats.total;
618
+ }
619
+ get completed() {
620
+ return this._queueStats.completed;
621
+ }
622
+ get pending() {
623
+ return this._queue.length;
624
+ }
625
+ get inProgress() {
626
+ return this._inProgress.length;
627
+ }
628
+ get errors() {
629
+ return this._queueStats.errors;
630
+ }
631
+ get state() {
632
+ return this._state;
633
+ }
634
+ get empty() {
635
+ return !this._queue.length && !this._inProgress.length;
636
+ }
637
+ get pendingOperations() {
638
+ return this._queue
639
+ .map((operation) => operation.name);
640
+ }
641
+ get inProgressOperations() {
642
+ return this._inProgress
643
+ .map((operation) => operation.name);
644
+ }
645
+ isProcessing() {
646
+ return this._state === QueueState.Processing;
647
+ }
648
+ isIdle() {
649
+ return this._state === QueueState.Idle;
650
+ }
651
+ setLimit(value) {
652
+ this._limit = value;
653
+ }
654
+ /**
655
+ * @depreated
656
+ */
657
+ subscribe(fun, err, complete) {
658
+ this.observe$
659
+ .subscribe(fun, err, complete);
660
+ }
661
+ get observe$() {
662
+ return this._done
663
+ .pipe(takeUntil(this._destroy$));
664
+ }
665
+ get complete$() {
666
+ if (!this.isProcessing()) {
667
+ return of({ total: 0, completed: 0, errors: [] });
668
+ }
669
+ return this.observe$
670
+ .pipe(take(1), map(() => (this._completeQueueStats)));
671
+ }
672
+ complete(fun, err, complete) {
673
+ this.complete$.subscribe(fun, err, complete);
674
+ }
675
+ push(target, name) {
676
+ const operation = new Operation(target, name);
677
+ this._queueStats.total++;
678
+ this._doneQueueStats.total++;
679
+ this._completeQueueStats.total++;
680
+ this._state = QueueState.Processing;
681
+ if (this._inProgress.length < this._limit) {
682
+ this._processOperation(operation);
683
+ }
684
+ else {
685
+ this._queue.push(operation);
686
+ }
687
+ return operation.ready$;
688
+ }
689
+ clear() {
690
+ this._queue = [];
691
+ this._state = QueueState.Idle;
692
+ this._queueStats = {
693
+ total: 0,
694
+ errors: [],
695
+ completed: 0,
696
+ };
697
+ this._clearDoneQueueStats();
698
+ }
699
+ destroy() {
700
+ this._done.complete();
701
+ this.clear();
702
+ }
703
+ _processOperation(operation) {
704
+ this._inProgress.push(operation);
705
+ operation.target
706
+ .pipe(delay(200), // Hack to prevent extra quick proccess execution
707
+ finalize(() => {
708
+ const opIndex = this._inProgress.indexOf(operation);
709
+ this._inProgress.splice(opIndex, 1);
710
+ if (this.empty) {
711
+ this._state = QueueState.Idle;
712
+ this._done.next(this._doneQueueStats);
713
+ this._clearDoneQueueStats();
714
+ }
715
+ else {
716
+ if (this._queue.length) {
717
+ const queueItem = this._queue.shift();
718
+ this._processOperation(queueItem);
719
+ }
720
+ }
721
+ }), takeUntil(this._destroy$)).subscribe({
722
+ next: (data) => {
723
+ operation.ready$.next(data);
724
+ },
725
+ error: (error) => {
726
+ this._queueStats.errors.push(error);
727
+ this._doneQueueStats.errors.push(error);
728
+ this._completeQueueStats.errors.push(error);
729
+ operation.ready$.error(error);
730
+ },
731
+ complete: () => {
732
+ this._queueStats.completed++;
733
+ this._doneQueueStats.completed++;
734
+ this._completeQueueStats.completed++;
735
+ operation.ready$.complete();
736
+ }
737
+ });
738
+ }
739
+ _clearDoneQueueStats() {
740
+ this._doneQueueStats = {
741
+ total: 0,
742
+ errors: [],
743
+ completed: 0,
744
+ };
745
+ }
746
+ }
747
+
748
+ function resolve(promise, defaults = []) {
749
+ const result = defaults;
750
+ return new Promise(resolve => {
751
+ promise.then(function (data) {
752
+ Object.keys(data).forEach(key => result[key] = data[key]);
753
+ resolve(result);
754
+ });
755
+ });
756
+ }
757
+
758
+ function round(num, decimalPlaces = 0) {
759
+ num = parseFloat(parseFloat(num).toPrecision(Number.MAX_SAFE_INTEGER.toString().length - 1));
760
+ const p = Math.pow(10, decimalPlaces);
761
+ return Math.round(num * p) / p;
762
+ }
763
+
764
+ const fsSourceLoader = (function () {
765
+ let _document;
766
+ let _headElement;
767
+ const _sources = new Map();
768
+ const _loadedResources = new Map();
769
+ // bad way but don't want to bother developer
770
+ setDocument(document);
771
+ // but developer can set document at any time
772
+ function setDocument(document) {
773
+ _document = document;
774
+ _headElement = _document === null || _document === void 0 ? void 0 : _document.head;
775
+ }
776
+ /**
777
+ * register a list of the resources for future loading
778
+ *
779
+ * example:
780
+ * sourceLoader.registerResources({
781
+ * froala: [
782
+ * '/assets/js/froala/froala_editor.min.js',
783
+ * '/assets/css/froala_editor.pkgd.min.css',
784
+ * ],
785
+ * froala_align: '/assets/js/froala/plugins/align.min.js',
786
+ * froala_colors: '/assets/js/froala/plugins/colors.min.js',
787
+ * froala_image: '/assets/js/froala/plugins/image.min.js',
788
+ * });
789
+ *
790
+ */
791
+ function registerResources(resources) {
792
+ Object.entries(resources)
793
+ .forEach(([name, path]) => {
794
+ if (typeof path === 'string') {
795
+ path = [path];
796
+ }
797
+ if (!_sources.has(name)) {
798
+ _sources.set(name, new Set());
799
+ }
800
+ const resourcesList = _sources.get(name);
801
+ path.forEach((p) => {
802
+ resourcesList.add(p);
803
+ });
804
+ });
805
+ }
806
+ /**
807
+ * load any resource previously registered
808
+ *
809
+ * sourceLoader.loadResource('froala')
810
+ *
811
+ * or load any js/css file
812
+ *
813
+ * sourceLoader.loadResource('/assets/my-source.js')
814
+ *
815
+ */
816
+ function loadResource(name) {
817
+ if (_loadedResources.has(name)) {
818
+ return _loadedResources.get(name);
819
+ }
820
+ if (_sources.has(name)) {
821
+ const sourcesForLoading = [..._sources.get(name)]
822
+ .map((path) => {
823
+ return _loadResource(path);
824
+ })
825
+ .filter((v) => !!v);
826
+ return combineLatest(sourcesForLoading);
827
+ }
828
+ return _loadResource(name);
829
+ }
830
+ /**
831
+ * the same as `loadResource` but you can pass list of the resources for loading
832
+ */
833
+ function loadResources(listOfResources) {
834
+ const resourcesToLoad = listOfResources
835
+ .reduce((acc, name) => {
836
+ const loading$ = loadResource(name);
837
+ if (loading$) {
838
+ acc.push(loading$);
839
+ }
840
+ return acc;
841
+ }, []);
842
+ return combineLatest(resourcesToLoad);
843
+ }
844
+ ///
845
+ function _loadResource(path) {
846
+ if (_isStylesUrl(path)) {
847
+ return _loadStyles(path);
848
+ }
849
+ if (_isJavascriptUrl(path)) {
850
+ return _loadJs(path);
851
+ }
852
+ console.warn(`Resource ${path} can not be identified and loaded`);
853
+ return null;
854
+ }
855
+ function _loadJs(scriptPath) {
856
+ if (!_loadedResources.has(scriptPath)) {
857
+ const obs$ = new Observable((obs) => {
858
+ const script = document.createElement('script');
859
+ script.src = scriptPath;
860
+ _headElement.appendChild(script);
861
+ script.onload = () => {
862
+ obs.next();
863
+ obs.complete();
864
+ };
865
+ script.onerror = (err) => {
866
+ obs.error(err);
867
+ };
868
+ }).pipe(shareReplay(1));
869
+ _loadedResources.set(scriptPath, obs$);
870
+ }
871
+ return _loadedResources.get(scriptPath);
872
+ }
873
+ function _loadStyles(stylePath) {
874
+ if (!_loadedResources.has(stylePath)) {
875
+ const obs$ = new Observable((obs) => {
876
+ const style = document.createElement('link');
877
+ style.id = stylePath;
878
+ style.rel = 'stylesheet';
879
+ style.href = `${stylePath}`;
880
+ _headElement.appendChild(style);
881
+ style.onload = () => {
882
+ obs.next();
883
+ obs.complete();
884
+ };
885
+ style.onerror = (err) => {
886
+ obs.error(err);
887
+ };
888
+ });
889
+ _loadedResources.set(stylePath, obs$);
890
+ }
891
+ return _loadedResources.get(stylePath);
892
+ }
893
+ function _isJavascriptUrl(url) {
894
+ return url.endsWith('.js');
895
+ }
896
+ function _isStylesUrl(url) {
897
+ return url.endsWith('.css');
898
+ }
899
+ return {
900
+ setDocument,
901
+ registerResources,
902
+ loadResource,
903
+ loadResources,
904
+ loadJs: _loadJs,
905
+ loadStyles: _loadStyles,
906
+ };
907
+ })();
908
+ function loadStyles(path) {
909
+ return fsSourceLoader.loadStyles(path);
910
+ }
926
911
  ;
912
+ function loadJs(path) {
913
+ return fsSourceLoader.loadJs(path);
914
+ }
915
+ ;
916
+
917
+ function throttle(func, wait) {
918
+ let waiting = false; // Initially, we're not waiting
919
+ return function () {
920
+ if (!waiting) { // If we're not waiting
921
+ func.apply(null, arguments); // Execute users function
922
+ waiting = true; // Prevent future invocations
923
+ setTimeout(function () {
924
+ waiting = false; // And allow future invocations
925
+ }, wait);
926
+ }
927
+ };
928
+ }
929
+
930
+ function toString(value) {
931
+ if (value === null || value === undefined) {
932
+ return '';
933
+ }
934
+ return `${value}`;
935
+ }
936
+
937
+ function uuid() {
938
+ return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
939
+ }
940
+
941
+ function value(object, key, def) {
942
+ if (typeof object === 'object' || Array.isArray(object)) {
943
+ if (object.hasOwnProperty(key)) {
944
+ return object[key];
945
+ }
946
+ }
947
+ return def;
948
+ }
927
949
 
928
- function throttle(func, wait) {
929
- let waiting = false; // Initially, we're not waiting
930
- return function () {
931
- if (!waiting) { // If we're not waiting
932
- func.apply(null, arguments); // Execute users function
933
- waiting = true; // Prevent future invocations
934
- setTimeout(function () {
935
- waiting = false; // And allow future invocations
936
- }, wait);
937
- }
938
- };
939
- }
940
-
941
- function toString(value) {
942
- if (value === null || value === undefined) {
943
- return '';
944
- }
945
- return `${value}`;
946
- }
947
-
948
- function uuid() {
949
- return guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
950
- }
951
-
952
- function value(object, key, def) {
953
- if (typeof object === 'object' || Array.isArray(object)) {
954
- if (object.hasOwnProperty(key)) {
955
- return object[key];
956
- }
957
- }
958
- return def;
959
- }
960
-
961
- function number(value, decimals) {
962
- if (isNumeric(decimals)) {
963
- value = round(value, decimals);
964
- }
965
- return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
966
- }
967
-
968
- function acronym(str, length = 2) {
969
- const splittedString = str
970
- .replace(/[^a-zA-Z0-9]+/g, ' ')
971
- .split(' ');
972
- let result = '';
973
- for (let i = 0; i < length; i++) {
974
- if (!splittedString[i]) {
975
- if (splittedString.length === 1) {
976
- for (let j = 1; j < length; j++) {
977
- if (!splittedString[i - 1][j]) {
978
- break;
979
- }
980
- result += splittedString[i - 1][j].toUpperCase();
981
- }
982
- }
983
- break;
984
- }
985
- result += splittedString[i][0].toUpperCase();
986
- }
987
- return result;
988
- }
989
-
990
- function currency(amount, precision = [2, 10], currencyCode = 'USD', locale = 'en-US') {
991
- const digitsInfo = Array.isArray(precision) ? precision : [precision, precision];
992
- amount = round(amount, digitsInfo[1]);
993
- return new CurrencyPipe(locale)
994
- .transform(amount, currencyCode, 'symbol', `1.${digitsInfo[0]}-${digitsInfo[1]}`);
995
- }
996
-
997
- function truncate(value, limit = 100, completeWords = false, ellipsis = '...') {
998
- value = value || '';
999
- if (completeWords) {
1000
- limit = value.substr(0, limit).lastIndexOf(' ');
1001
- }
1002
- let result = `${value.substr(0, limit)}`;
1003
- if (result !== value) {
1004
- result += ellipsis;
1005
- }
1006
- return result;
1007
- }
1008
-
1009
- function email(value) {
1010
- return !!String(value).match(/^(([^<>()\[\]\\.,;:\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,}))$/);
1011
- }
1012
-
1013
- function phone(value) {
1014
- const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
1015
- return valid || !String(value).length;
1016
- }
1017
-
1018
- /**
1019
- * Check validity of the url.
1020
- * Protocol (http/https) isn't required.
1021
- * @param value
1022
- * @returns {boolean}
1023
- */
1024
- function url(value) {
1025
- const expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
1026
- const regexp = new RegExp(expression);
1027
- return !!String(value).match(regexp);
1028
- }
1029
-
1030
- function delayedRetry(delayMs, maxRetry = 5, message) {
1031
- let retries = 0;
1032
- return (src) => src.pipe(retryWhen((errors) => errors.pipe(tap(() => {
1033
- retries++;
1034
- if (retries <= maxRetry) {
1035
- console.info(`Failed to load Resource. Retry in ${delayMs / 1000} sec. ${retries}/${maxRetry} times...`);
1036
- }
1037
- }), concatMap((error) => iif(() => retries > maxRetry, throwError(getErrorMessage(maxRetry, message)), timer(delayMs))))));
1038
- }
1039
- const getErrorMessage = (maxRetry, defaultMessage) => {
1040
- if (!defaultMessage) {
1041
- return `Failed to load Resource for ${maxRetry} times. Giving up.`;
1042
- }
1043
- else {
1044
- return defaultMessage;
1045
- }
950
+ function number(value, decimals) {
951
+ if (isNumeric(decimals)) {
952
+ value = round(value, decimals);
953
+ }
954
+ return Number(value || 0).toLocaleString(undefined, { maximumFractionDigits: decimals });
955
+ }
956
+
957
+ function acronym(str, length = 2) {
958
+ const splittedString = str
959
+ .replace(/[^a-zA-Z0-9]+/g, ' ')
960
+ .split(' ');
961
+ let result = '';
962
+ for (let i = 0; i < length; i++) {
963
+ if (!splittedString[i]) {
964
+ if (splittedString.length === 1) {
965
+ for (let j = 1; j < length; j++) {
966
+ if (!splittedString[i - 1][j]) {
967
+ break;
968
+ }
969
+ result += splittedString[i - 1][j].toUpperCase();
970
+ }
971
+ }
972
+ break;
973
+ }
974
+ result += splittedString[i][0].toUpperCase();
975
+ }
976
+ return result;
977
+ }
978
+
979
+ function currency(amount, precision = [2, 10], currencyCode = 'USD', locale = 'en-US') {
980
+ const digitsInfo = Array.isArray(precision) ? precision : [precision, precision];
981
+ amount = round(amount, digitsInfo[1]);
982
+ return new CurrencyPipe(locale)
983
+ .transform(amount, currencyCode, 'symbol', `1.${digitsInfo[0]}-${digitsInfo[1]}`);
984
+ }
985
+
986
+ function truncate(value, limit = 100, completeWords = false, ellipsis = '...') {
987
+ value = value || '';
988
+ if (completeWords) {
989
+ limit = value.substr(0, limit).lastIndexOf(' ');
990
+ }
991
+ let result = `${value.substr(0, limit)}`;
992
+ if (result !== value) {
993
+ result += ellipsis;
994
+ }
995
+ return result;
996
+ }
997
+
998
+ function email(value) {
999
+ return !!String(value).match(/^(([^<>()\[\]\\.,;:\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,}))$/);
1000
+ }
1001
+
1002
+ function phone(value) {
1003
+ const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4}/.test(value);
1004
+ return valid || !String(value).length;
1005
+ }
1006
+
1007
+ /**
1008
+ * Check validity of the url.
1009
+ * Protocol (http/https) isn't required.
1010
+ * @param value
1011
+ * @returns {boolean}
1012
+ */
1013
+ function url(value) {
1014
+ const expression = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#%[\]@!\$&'\(\)\*\+,;=.]+$/gm;
1015
+ const regexp = new RegExp(expression);
1016
+ return !!String(value).match(regexp);
1017
+ }
1018
+
1019
+ function delayedRetry(delayMs, maxRetry = 5, message) {
1020
+ let retries = 0;
1021
+ return (src) => src.pipe(retryWhen((errors) => errors.pipe(tap(() => {
1022
+ retries++;
1023
+ if (retries <= maxRetry) {
1024
+ console.info(`Failed to load Resource. Retry in ${delayMs / 1000} sec. ${retries}/${maxRetry} times...`);
1025
+ }
1026
+ }), concatMap((error) => iif(() => retries > maxRetry, throwError(getErrorMessage(maxRetry, message)), timer(delayMs))))));
1027
+ }
1028
+ const getErrorMessage = (maxRetry, defaultMessage) => {
1029
+ if (!defaultMessage) {
1030
+ return `Failed to load Resource for ${maxRetry} times. Giving up.`;
1031
+ }
1032
+ else {
1033
+ return defaultMessage;
1034
+ }
1046
1035
  };
1047
1036
 
1048
- function bytes(bytes, decimals, unit) {
1049
- if (!bytes) {
1050
- return '0 MB';
1051
- }
1052
- const e = typeof unit === 'string' ?
1053
- 'KMGTP'.indexOf(unit.replace('B', '')) + 1 :
1054
- Math.floor(Math.log(bytes) / Math.log(1024));
1055
- if (!isNumeric(decimals)) {
1056
- decimals = (bytes / 1024) > 1000 ? 2 : 0;
1057
- }
1058
- return `${(bytes / Math.pow(1024, e))
1059
- .toFixed(decimals)}`
1060
- .replace(/\.00/, '')
1061
- + ' '
1062
- + (e ? ' KMGTP'.charAt(e) : '') + 'B';
1063
- }
1064
-
1065
- class FsFormatBytesPipe {
1066
- transform(value, decimals, unit) {
1067
- return bytes(value, decimals, unit);
1068
- }
1069
- }
1070
- FsFormatBytesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1071
- FsFormatBytesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, name: "fsFormatBytes" });
1072
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatBytesPipe, decorators: [{
1073
- type: Pipe,
1074
- args: [{
1075
- name: 'fsFormatBytes',
1076
- }]
1037
+ function bytes(bytes, decimals, unit) {
1038
+ if (!bytes) {
1039
+ return '0 MB';
1040
+ }
1041
+ const e = typeof unit === 'string' ?
1042
+ 'KMGTP'.indexOf(unit.replace('B', '')) + 1 :
1043
+ Math.floor(Math.log(bytes) / Math.log(1024));
1044
+ if (!isNumeric(decimals)) {
1045
+ decimals = (bytes / 1024) > 1000 ? 2 : 0;
1046
+ }
1047
+ return `${(bytes / Math.pow(1024, e))
1048
+ .toFixed(decimals)}`
1049
+ .replace(/\.00/, '')
1050
+ + ' '
1051
+ + (e ? ' KMGTP'.charAt(e) : '') + 'B';
1052
+ }
1053
+
1054
+ class FsFormatBytesPipe {
1055
+ transform(value, decimals, unit) {
1056
+ return bytes(value, decimals, unit);
1057
+ }
1058
+ }
1059
+ FsFormatBytesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatBytesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1060
+ FsFormatBytesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsFormatBytesPipe, name: "fsFormatBytes" });
1061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatBytesPipe, decorators: [{
1062
+ type: Pipe,
1063
+ args: [{
1064
+ name: 'fsFormatBytes',
1065
+ }]
1077
1066
  }] });
1078
1067
 
1079
- class FsFormatCurrencyPipe {
1080
- constructor(locale) {
1081
- this.locale = locale;
1082
- }
1083
- transform(amount, precision = 2, currencyCode) {
1084
- return currency(amount, precision, currencyCode);
1085
- }
1086
- }
1087
- FsFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
1088
- FsFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
1089
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatCurrencyPipe, decorators: [{
1090
- type: Pipe,
1091
- args: [{
1092
- name: 'fsFormatCurrency',
1093
- }]
1094
- }], ctorParameters: function () {
1095
- return [{ type: undefined, decorators: [{
1096
- type: Inject,
1097
- args: [LOCALE_ID]
1098
- }] }];
1068
+ class FsFormatCurrencyPipe {
1069
+ constructor(locale) {
1070
+ this.locale = locale;
1071
+ }
1072
+ transform(amount, precision = 2, currencyCode) {
1073
+ return currency(amount, precision, currencyCode);
1074
+ }
1075
+ }
1076
+ FsFormatCurrencyPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatCurrencyPipe, deps: [{ token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Pipe });
1077
+ FsFormatCurrencyPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsFormatCurrencyPipe, name: "fsFormatCurrency" });
1078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatCurrencyPipe, decorators: [{
1079
+ type: Pipe,
1080
+ args: [{
1081
+ name: 'fsFormatCurrency',
1082
+ }]
1083
+ }], ctorParameters: function () {
1084
+ return [{ type: undefined, decorators: [{
1085
+ type: Inject,
1086
+ args: [LOCALE_ID]
1087
+ }] }];
1099
1088
  } });
1100
1089
 
1101
- class FsFormatNumberPipe {
1102
- transform(value, decimals) {
1103
- return number(value, decimals);
1104
- }
1105
- }
1106
- FsFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1107
- FsFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, name: "fsFormatNumber" });
1108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatNumberPipe, decorators: [{
1109
- type: Pipe,
1110
- args: [{
1111
- name: 'fsFormatNumber'
1112
- }]
1090
+ class FsFormatNumberPipe {
1091
+ transform(value, decimals) {
1092
+ return number(value, decimals);
1093
+ }
1094
+ }
1095
+ FsFormatNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1096
+ FsFormatNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsFormatNumberPipe, name: "fsFormatNumber" });
1097
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatNumberPipe, decorators: [{
1098
+ type: Pipe,
1099
+ args: [{
1100
+ name: 'fsFormatNumber'
1101
+ }]
1113
1102
  }] });
1114
1103
 
1115
- class FsFormatOrdinalNumberPipe {
1116
- transform(value) {
1117
- return ordinalNumber(value);
1118
- }
1119
- }
1120
- FsFormatOrdinalNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1121
- FsFormatOrdinalNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
1122
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatOrdinalNumberPipe, decorators: [{
1123
- type: Pipe,
1124
- args: [{
1125
- name: 'fsFormatOrdinalNumber',
1126
- }]
1104
+ class FsFormatOrdinalNumberPipe {
1105
+ transform(value) {
1106
+ return ordinalNumber(value);
1107
+ }
1108
+ }
1109
+ FsFormatOrdinalNumberPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatOrdinalNumberPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1110
+ FsFormatOrdinalNumberPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsFormatOrdinalNumberPipe, name: "fsFormatOrdinalNumber" });
1111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatOrdinalNumberPipe, decorators: [{
1112
+ type: Pipe,
1113
+ args: [{
1114
+ name: 'fsFormatOrdinalNumber',
1115
+ }]
1127
1116
  }] });
1128
1117
 
1129
- class FsFormatTruncatePipe {
1130
- constructor() { }
1131
- transform(value, limit, completeWords, ellipsis) {
1132
- return truncate(value, limit, completeWords, ellipsis);
1133
- }
1134
- }
1135
- FsFormatTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1136
- FsFormatTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
1137
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsFormatTruncatePipe, decorators: [{
1138
- type: Pipe,
1139
- args: [{
1140
- name: 'fsFormatTruncate'
1141
- }]
1118
+ class FsFormatTruncatePipe {
1119
+ constructor() { }
1120
+ transform(value, limit, completeWords, ellipsis) {
1121
+ return truncate(value, limit, completeWords, ellipsis);
1122
+ }
1123
+ }
1124
+ FsFormatTruncatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatTruncatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
1125
+ FsFormatTruncatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsFormatTruncatePipe, name: "fsFormatTruncate" });
1126
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsFormatTruncatePipe, decorators: [{
1127
+ type: Pipe,
1128
+ args: [{
1129
+ name: 'fsFormatTruncate'
1130
+ }]
1142
1131
  }], ctorParameters: function () { return []; } });
1143
1132
 
1144
- class FsArray {
1145
- /**
1146
- * @deprecated use import { nameValue } from @firestitch/common/array; instead
1147
- */
1148
- nameValue(array, name, value) {
1149
- console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
1150
- let list = [];
1151
- if (name || value) {
1152
- let nameFn = typeof name === 'function' ? name : function (item) { return item[name]; };
1153
- let valueFn = typeof value === 'function' ? value : function (item) { return item[value]; };
1154
- array.forEach(function (item) {
1155
- list.push({ name: nameFn(item), value: valueFn(item) });
1156
- });
1157
- }
1158
- else {
1159
- array.forEach(function (name, value) {
1160
- list.push({ name: name, value: value });
1161
- });
1162
- }
1163
- return list;
1164
- }
1165
- /**
1166
- * @deprecated use import { remove } from @firestitch/common/array; instead
1167
- */
1168
- remove(array, query) {
1169
- console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
1170
- let idx = this.indexOf(array, query);
1171
- if (idx >= 0) {
1172
- return array.splice(idx, 1);
1173
- }
1174
- return idx;
1175
- }
1176
- /**
1177
- * @deprecated use import { indexOf } from @firestitch/common/array; instead
1178
- */
1179
- indexOf(array, query) {
1180
- console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
1181
- if (typeof query !== 'function') {
1182
- let queryObj = query;
1183
- query = (item) => {
1184
- return this.compare(queryObj, item);
1185
- };
1186
- }
1187
- for (let i = 0, len = array.length; i < len; i++) {
1188
- if (query(array[i])) {
1189
- return i;
1190
- }
1191
- }
1192
- return -1;
1193
- }
1194
- /**
1195
- * @deprecated use import { compare } from @firestitch/common/array; instead
1196
- */
1197
- compare(query, item) {
1198
- console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
1199
- let value = true;
1200
- for (let key in query) {
1201
- value = value && item[key] == query[key];
1202
- }
1203
- return value;
1204
- }
1205
- /**
1206
- * @deprecated use import { filter } from @firestitch/common/array; instead
1207
- */
1208
- filter(array, query) {
1209
- console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
1210
- if (typeof query !== 'function') {
1211
- let queryObj = query;
1212
- query = (item) => {
1213
- return this.compare(queryObj, item);
1214
- };
1215
- }
1216
- let isarray = Array.isArray(array);
1217
- let list = isarray ? [] : {};
1218
- if (isarray)
1219
- array.forEach(function (item, idx) {
1220
- if (query(item)) {
1221
- list.push(item);
1222
- }
1223
- });
1224
- else
1225
- Object.keys(array).forEach(key => {
1226
- if (query(array[key])) {
1227
- list[key] = array[key];
1228
- }
1229
- });
1230
- return list;
1231
- }
1232
- /**
1233
- * @deprecated use import { index } from @firestitch/common/array; instead
1234
- */
1235
- index(array, property) {
1236
- console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
1237
- let list = {};
1238
- array.forEach(function (item, idx) {
1239
- list[item[property]] = item;
1240
- });
1241
- return list;
1242
- }
1243
- /**
1244
- * @deprecated use import { sort } from @firestitch/common/array; instead
1245
- */
1246
- sort(array, query, reverse = false) {
1247
- console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
1248
- if (typeof query !== 'function') {
1249
- let queryStr = query;
1250
- query = function (a, b) {
1251
- if (reverse) {
1252
- if (a[queryStr] < b[queryStr]) {
1253
- return 1;
1254
- }
1255
- else if (a[queryStr] > b[queryStr]) {
1256
- return -1;
1257
- }
1258
- }
1259
- else {
1260
- if (a[queryStr] > b[queryStr]) {
1261
- return 1;
1262
- }
1263
- else if (a[queryStr] < b[queryStr]) {
1264
- return -1;
1265
- }
1266
- }
1267
- return 0;
1268
- };
1269
- }
1270
- array.sort(query);
1271
- return array;
1272
- }
1273
- /**
1274
- * @deprecated use import { rsort } from @firestitch/common/array; instead
1275
- */
1276
- rsort(array, query) {
1277
- console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
1278
- return this.sort(array, query, true);
1279
- }
1280
- /**
1281
- * @deprecated use import { list } from @firestitch/common/array; instead
1282
- */
1283
- list(array, property, index = null) {
1284
- console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
1285
- let list = index ? {} : [];
1286
- array.forEach(function (item, idx) {
1287
- if (index) {
1288
- list[item[index]] = item[property];
1289
- }
1290
- else {
1291
- list.push(item[property]);
1292
- }
1293
- });
1294
- return list;
1295
- }
1296
- /**
1297
- * @deprecated use import { applyDepth } from @firestitch/common/array; instead
1298
- */
1299
- applyDepth(objects, parent_property, id_property = 'id', depth_property = 'depth') {
1300
- console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
1301
- let keyed = {};
1302
- objects.forEach(function (object) {
1303
- if (!object[parent_property]) {
1304
- object[depth_property] = 0;
1305
- }
1306
- keyed[object[id_property]] = object;
1307
- });
1308
- Object.keys(keyed).forEach(key => {
1309
- Object.keys(keyed).forEach(key => {
1310
- let object = keyed[key];
1311
- if (!keyed[key][depth_property]) {
1312
- if (keyed[key][parent_property]) {
1313
- keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
1314
- }
1315
- }
1316
- });
1317
- });
1318
- return keyed;
1319
- }
1320
- /**
1321
- * @deprecated use import { inArray } from @firestitch/common/array; instead
1322
- */
1323
- inArray(values, array) {
1324
- console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
1325
- if (!Array.isArray(values)) {
1326
- values = [values];
1327
- }
1328
- for (let i = 0, len = values.length; i < len; i++) {
1329
- if (array.indexOf(values[i]) >= 0) {
1330
- return true;
1331
- }
1332
- }
1333
- return false;
1334
- }
1335
- /**
1336
- * @deprecated use import { keyExists } from @firestitch/common/array; instead
1337
- */
1338
- keyExists(array, key) {
1339
- console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
1340
- return array.hasOwnProperty(key);
1341
- }
1342
- /**
1343
- * @deprecated use import { length } from @firestitch/common/array; instead
1344
- */
1345
- length(array) {
1346
- console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
1347
- return array.length;
1348
- }
1349
- /**
1350
- * @deprecated use import { ksort } from @firestitch/common/array; instead
1351
- */
1352
- ksort(unordered) {
1353
- console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
1354
- Object.keys(unordered).sort().forEach(function (key) {
1355
- let value = unordered[key];
1356
- delete unordered[key];
1357
- unordered[key] = value;
1358
- });
1359
- }
1360
- }
1361
- FsArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1362
- FsArray.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray });
1363
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsArray, decorators: [{
1364
- type: Injectable
1133
+ class FsArray {
1134
+ /**
1135
+ * @deprecated use import { nameValue } from @firestitch/common/array; instead
1136
+ */
1137
+ nameValue(array, name, value) {
1138
+ console.warn('@deprecated use import { nameValue } from @firestitch/common/array; instead');
1139
+ let list = [];
1140
+ if (name || value) {
1141
+ let nameFn = typeof name === 'function' ? name : function (item) { return item[name]; };
1142
+ let valueFn = typeof value === 'function' ? value : function (item) { return item[value]; };
1143
+ array.forEach(function (item) {
1144
+ list.push({ name: nameFn(item), value: valueFn(item) });
1145
+ });
1146
+ }
1147
+ else {
1148
+ array.forEach(function (name, value) {
1149
+ list.push({ name: name, value: value });
1150
+ });
1151
+ }
1152
+ return list;
1153
+ }
1154
+ /**
1155
+ * @deprecated use import { remove } from @firestitch/common/array; instead
1156
+ */
1157
+ remove(array, query) {
1158
+ console.warn('@deprecated use import { remove } from @firestitch/common/array; instead');
1159
+ let idx = this.indexOf(array, query);
1160
+ if (idx >= 0) {
1161
+ return array.splice(idx, 1);
1162
+ }
1163
+ return idx;
1164
+ }
1165
+ /**
1166
+ * @deprecated use import { indexOf } from @firestitch/common/array; instead
1167
+ */
1168
+ indexOf(array, query) {
1169
+ console.warn('@deprecated use import { indexOf } from @firestitch/common/array; instead');
1170
+ if (typeof query !== 'function') {
1171
+ let queryObj = query;
1172
+ query = (item) => {
1173
+ return this.compare(queryObj, item);
1174
+ };
1175
+ }
1176
+ for (let i = 0, len = array.length; i < len; i++) {
1177
+ if (query(array[i])) {
1178
+ return i;
1179
+ }
1180
+ }
1181
+ return -1;
1182
+ }
1183
+ /**
1184
+ * @deprecated use import { compare } from @firestitch/common/array; instead
1185
+ */
1186
+ compare(query, item) {
1187
+ console.warn('@deprecated use import { compare } from @firestitch/common/array; instead');
1188
+ let value = true;
1189
+ for (let key in query) {
1190
+ value = value && item[key] == query[key];
1191
+ }
1192
+ return value;
1193
+ }
1194
+ /**
1195
+ * @deprecated use import { filter } from @firestitch/common/array; instead
1196
+ */
1197
+ filter(array, query) {
1198
+ console.warn('@deprecated use import { filter } from @firestitch/common/array; instead');
1199
+ if (typeof query !== 'function') {
1200
+ let queryObj = query;
1201
+ query = (item) => {
1202
+ return this.compare(queryObj, item);
1203
+ };
1204
+ }
1205
+ let isarray = Array.isArray(array);
1206
+ let list = isarray ? [] : {};
1207
+ if (isarray)
1208
+ array.forEach(function (item, idx) {
1209
+ if (query(item)) {
1210
+ list.push(item);
1211
+ }
1212
+ });
1213
+ else
1214
+ Object.keys(array).forEach(key => {
1215
+ if (query(array[key])) {
1216
+ list[key] = array[key];
1217
+ }
1218
+ });
1219
+ return list;
1220
+ }
1221
+ /**
1222
+ * @deprecated use import { index } from @firestitch/common/array; instead
1223
+ */
1224
+ index(array, property) {
1225
+ console.warn('@deprecated use import { index } from @firestitch/common/array; instead');
1226
+ let list = {};
1227
+ array.forEach(function (item, idx) {
1228
+ list[item[property]] = item;
1229
+ });
1230
+ return list;
1231
+ }
1232
+ /**
1233
+ * @deprecated use import { sort } from @firestitch/common/array; instead
1234
+ */
1235
+ sort(array, query, reverse = false) {
1236
+ console.warn('@deprecated use import { sort } from @firestitch/common/array; instead');
1237
+ if (typeof query !== 'function') {
1238
+ let queryStr = query;
1239
+ query = function (a, b) {
1240
+ if (reverse) {
1241
+ if (a[queryStr] < b[queryStr]) {
1242
+ return 1;
1243
+ }
1244
+ else if (a[queryStr] > b[queryStr]) {
1245
+ return -1;
1246
+ }
1247
+ }
1248
+ else {
1249
+ if (a[queryStr] > b[queryStr]) {
1250
+ return 1;
1251
+ }
1252
+ else if (a[queryStr] < b[queryStr]) {
1253
+ return -1;
1254
+ }
1255
+ }
1256
+ return 0;
1257
+ };
1258
+ }
1259
+ array.sort(query);
1260
+ return array;
1261
+ }
1262
+ /**
1263
+ * @deprecated use import { rsort } from @firestitch/common/array; instead
1264
+ */
1265
+ rsort(array, query) {
1266
+ console.warn('@deprecated use import { rsort } from @firestitch/common/array; instead');
1267
+ return this.sort(array, query, true);
1268
+ }
1269
+ /**
1270
+ * @deprecated use import { list } from @firestitch/common/array; instead
1271
+ */
1272
+ list(array, property, index = null) {
1273
+ console.warn('@deprecated use import { list } from @firestitch/common/array; instead');
1274
+ let list = index ? {} : [];
1275
+ array.forEach(function (item, idx) {
1276
+ if (index) {
1277
+ list[item[index]] = item[property];
1278
+ }
1279
+ else {
1280
+ list.push(item[property]);
1281
+ }
1282
+ });
1283
+ return list;
1284
+ }
1285
+ /**
1286
+ * @deprecated use import { applyDepth } from @firestitch/common/array; instead
1287
+ */
1288
+ applyDepth(objects, parent_property, id_property = 'id', depth_property = 'depth') {
1289
+ console.warn('@deprecated use import { applyDepth } from @firestitch/common/array; instead');
1290
+ let keyed = {};
1291
+ objects.forEach(function (object) {
1292
+ if (!object[parent_property]) {
1293
+ object[depth_property] = 0;
1294
+ }
1295
+ keyed[object[id_property]] = object;
1296
+ });
1297
+ Object.keys(keyed).forEach(key => {
1298
+ Object.keys(keyed).forEach(key => {
1299
+ let object = keyed[key];
1300
+ if (!keyed[key][depth_property]) {
1301
+ if (keyed[key][parent_property]) {
1302
+ keyed[key][depth_property] = keyed[keyed[key][parent_property]][depth_property] + 1;
1303
+ }
1304
+ }
1305
+ });
1306
+ });
1307
+ return keyed;
1308
+ }
1309
+ /**
1310
+ * @deprecated use import { inArray } from @firestitch/common/array; instead
1311
+ */
1312
+ inArray(values, array) {
1313
+ console.warn('@deprecated use import { inArray } from @firestitch/common/array; instead');
1314
+ if (!Array.isArray(values)) {
1315
+ values = [values];
1316
+ }
1317
+ for (let i = 0, len = values.length; i < len; i++) {
1318
+ if (array.indexOf(values[i]) >= 0) {
1319
+ return true;
1320
+ }
1321
+ }
1322
+ return false;
1323
+ }
1324
+ /**
1325
+ * @deprecated use import { keyExists } from @firestitch/common/array; instead
1326
+ */
1327
+ keyExists(array, key) {
1328
+ console.warn('@deprecated use import { keyExists } from @firestitch/common/array; instead');
1329
+ return array.hasOwnProperty(key);
1330
+ }
1331
+ /**
1332
+ * @deprecated use import { length } from @firestitch/common/array; instead
1333
+ */
1334
+ length(array) {
1335
+ console.warn('@deprecated use import { length } from @firestitch/common/array; instead');
1336
+ return array.length;
1337
+ }
1338
+ /**
1339
+ * @deprecated use import { ksort } from @firestitch/common/array; instead
1340
+ */
1341
+ ksort(unordered) {
1342
+ console.warn('@deprecated use import { ksort } from @firestitch/common/array; instead');
1343
+ Object.keys(unordered).sort().forEach(function (key) {
1344
+ let value = unordered[key];
1345
+ delete unordered[key];
1346
+ unordered[key] = value;
1347
+ });
1348
+ }
1349
+ }
1350
+ FsArray.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsArray, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1351
+ FsArray.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsArray });
1352
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsArray, decorators: [{
1353
+ type: Injectable
1365
1354
  }] });
1366
1355
 
1367
- class FsMath {
1368
- /**
1369
- * @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
1370
- */
1371
- round(number, precision) {
1372
- console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
1373
- precision = precision || 0;
1374
- let factor = Math.pow(10, precision);
1375
- let tempNumber = number * factor;
1376
- let roundedTempNumber = Math.round(tempNumber);
1377
- return roundedTempNumber / factor;
1378
- }
1379
- }
1380
- FsMath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1381
- FsMath.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath });
1382
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsMath, decorators: [{
1383
- type: Injectable
1356
+ class FsMath {
1357
+ /**
1358
+ * @deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}
1359
+ */
1360
+ round(number, precision) {
1361
+ console.warn('@deprecated use _.round() instead {@link https://lodash.com/docs/4.17.5#round}');
1362
+ precision = precision || 0;
1363
+ let factor = Math.pow(10, precision);
1364
+ let tempNumber = number * factor;
1365
+ let roundedTempNumber = Math.round(tempNumber);
1366
+ return roundedTempNumber / factor;
1367
+ }
1368
+ }
1369
+ FsMath.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsMath, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1370
+ FsMath.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsMath });
1371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsMath, decorators: [{
1372
+ type: Injectable
1384
1373
  }] });
1385
1374
 
1386
- const KEY_CANCEL = 3, KEY_HELP = 6, KEY_BACKSPACE = 8, KEY_TAB = 9, KEY_CLEAR = 12, KEY_RETURN = 13, KEY_ENTER = 14, KEY_SHIFT = 16, KEY_CONTROL = 17, KEY_ALT = 18, KEY_PAUSE = 19, KEY_CAPS_LOCK = 20, KEY_ESCAPE = 27, KEY_SPACE = 32, KEY_PAGE_UP = 33, KEY_PAGE_DOWN = 34, KEY_END = 35, KEY_HOME = 36, KEY_LEFT = 37, KEY_UP = 38, KEY_RIGHT = 39, KEY_DOWN = 40, KEY_PRINTSCREEN = 44, KEY_INSERT = 45, KEY_DELETE = 46, KEY_0 = 48, KEY_1 = 49, KEY_2 = 50, KEY_3 = 51, KEY_4 = 52, KEY_5 = 53, KEY_6 = 54, KEY_7 = 55, KEY_8 = 56, KEY_9 = 57, KEY_SEMICOLON = 59, KEY_EQUALS = 61;
1387
- /*
1388
- Basically, just copy-pasted functionality from fs-boilerplate v1.x, with some small changes (like we dont have angular.bind anymore, had to go with a workaround)
1389
- There might be a better way to organise constatns but I need to know use-cases
1390
- */
1391
- class FsUtil {
1392
- constructor() {
1393
- this.intervals = {};
1394
- }
1395
- /**
1396
- * @deprecated use @firestitch/common/util/guid instead
1397
- */
1398
- guid(pattern) {
1399
- console.warn('@deprecated use @firestitch/common/util/guid instead');
1400
- pattern = pattern || 'xxxxxx';
1401
- return pattern.replace(/[xy]/g, function (c) {
1402
- var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
1403
- return v.toString(16);
1404
- });
1405
- }
1406
- /**
1407
- * @deprecated use import { uuid } from @firestitch/common/util; instead
1408
- */
1409
- uuid() {
1410
- console.warn('@deprecated use @firestitch/common/util/uuid instead');
1411
- return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
1412
- }
1413
- /**
1414
- * @deprecated use import { resolve } from @firestitch/common/util; instead
1415
- */
1416
- resolve(promise, defaults = []) {
1417
- console.warn('@deprecated use @firestitch/common/util/resolve instead');
1418
- const result = defaults;
1419
- return new Promise(resolve => {
1420
- promise.then(function (data) {
1421
- Object.keys(data).forEach(key => result[key] = data[key]);
1422
- resolve(result);
1423
- });
1424
- });
1425
- }
1426
- /**
1427
- * @deprecated use _.toInteger() instead
1428
- */
1429
- int(value) {
1430
- console.warn('@deprecated use _.toInteger() instead');
1431
- value = parseInt(value);
1432
- if (isNaN(value)) {
1433
- value = 0;
1434
- }
1435
- return value;
1436
- }
1437
- /**
1438
- * @deprecated use _.toFinite() instead
1439
- */
1440
- float(value) {
1441
- console.warn('@deprecated use _.toFinite() instead');
1442
- value = parseFloat(value);
1443
- if (isNaN(value)) {
1444
- value = 0;
1445
- }
1446
- return value;
1447
- }
1448
- /**
1449
- * @deprecated use _.toString() instead
1450
- */
1451
- string(string) {
1452
- console.warn('@deprecated use _.toString() instead');
1453
- if (string === null || string === undefined) {
1454
- string = '';
1455
- }
1456
- return (string).toString();
1457
- }
1458
- /**
1459
- * @deprecated use import { isEmpty } from @firestitch/common/util; instead
1460
- */
1461
- isEmpty(value, options) {
1462
- console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
1463
- options = options || {};
1464
- return value === undefined ||
1465
- value === null ||
1466
- value === false ||
1467
- value === '' ||
1468
- !this.string(value).length ||
1469
- (this.isObject(value) &&
1470
- (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
1471
- (!options.zero && (value === 0 || value === '0'));
1472
- }
1473
- /**
1474
- * @deprecated use _.isInteger() instead
1475
- */
1476
- isInt(value, type) {
1477
- console.warn('@deprecated use _.isInteger() instead');
1478
- const int = !!this.string(value).match(/^\d+$/);
1479
- if (!int) {
1480
- return false;
1481
- }
1482
- if (type) {
1483
- return Number.isInteger(value);
1484
- }
1485
- return true;
1486
- }
1487
- /**
1488
- * @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
1489
- */
1490
- each(object, func) {
1491
- console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
1492
- if (!this.isArray(object) && !this.isObject(object)) {
1493
- return;
1494
- }
1495
- Object.keys(object).forEach(function (key) {
1496
- func(object[key], key);
1497
- });
1498
- }
1499
- /**
1500
- * @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
1501
- * or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
1502
- */
1503
- isObject(value) {
1504
- console.warn('@deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject} or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead');
1505
- return value !== null && typeof value === 'object' && !this.isArray(value);
1506
- }
1507
- /**
1508
- * @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
1509
- */
1510
- isString(value) {
1511
- console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
1512
- return typeof value === 'string' || value instanceof String;
1513
- }
1514
- /**
1515
- * @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
1516
- */
1517
- isArray(value) {
1518
- console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
1519
- return value instanceof Array;
1520
- }
1521
- /**
1522
- * @deprecated use import { isNumeric } from @firestitch/common/util; instead
1523
- */
1524
- isNumeric(value) {
1525
- console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
1526
- return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
1527
- }
1528
- /**
1529
- * @deprecated use import { isClass } from @firestitch/common/util; instead
1530
- */
1531
- isClass(value, cls) {
1532
- console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
1533
- if (this.isObject(value)) {
1534
- if (this.isString(cls)) {
1535
- if (value.constructor) {
1536
- if (value.constructor.name === cls) {
1537
- return true;
1538
- }
1539
- }
1540
- }
1541
- else {
1542
- if (value instanceof cls) {
1543
- return true;
1544
- }
1545
- }
1546
- }
1547
- return false;
1548
- }
1549
- /**
1550
- * @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
1551
- */
1552
- isBoolean(value) {
1553
- console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
1554
- return value === true || value === false;
1555
- }
1556
- /**
1557
- * @deprecated use import { value } from @firestitch/common/util; instead
1558
- */
1559
- value(object, key, def) {
1560
- console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
1561
- if (this.isObject(object) || this.isArray(object)) {
1562
- if (object.hasOwnProperty(key)) {
1563
- return object[key];
1564
- }
1565
- }
1566
- return def;
1567
- }
1568
- throttle(func, wait) {
1569
- console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
1570
- let waiting = false; // Initially, we're not waiting
1571
- return function () {
1572
- if (!waiting) { // If we're not waiting
1573
- func.apply(null, arguments); // Execute users function
1574
- waiting = true; // Prevent future invocations
1575
- setTimeout(function () {
1576
- waiting = false; // And allow future invocations
1577
- }, wait);
1578
- }
1579
- };
1580
- }
1581
- /**
1582
- * @deprecated use import { debounce } from @firestitch/common/util; instead
1583
- */
1584
- debounce(func, wait, immediate) {
1585
- console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
1586
- var timeout;
1587
- return function () {
1588
- var context = this, args = arguments;
1589
- var later = function () {
1590
- timeout = null;
1591
- if (!immediate)
1592
- func.apply(context, args);
1593
- };
1594
- var callNow = immediate && !timeout;
1595
- clearTimeout(timeout);
1596
- timeout = setTimeout(later, wait);
1597
- if (callNow)
1598
- func.apply(context, args);
1599
- };
1600
- }
1601
- /**
1602
- * @deprecated use import { length } from @firestitch/common/util; instead
1603
- */
1604
- length(object) {
1605
- console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
1606
- if (this.isObject(object)) {
1607
- return Object.keys(object).length;
1608
- }
1609
- if (this.isArray(object)) {
1610
- return object.length;
1611
- }
1612
- return 0;
1613
- }
1614
- /**
1615
- * @deprecated use import { boolean } from @firestitch/common/util; instead
1616
- */
1617
- boolean(value) {
1618
- console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
1619
- return this.string(value).toLowerCase() !== 'false' && !!value;
1620
- }
1621
- /**
1622
- * @deprecated use import { stringify } from @firestitch/common/util; instead
1623
- */
1624
- stringify(value) {
1625
- console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
1626
- return JSON.stringify(value);
1627
- }
1628
- }
1629
- FsUtil.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1630
- FsUtil.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil });
1631
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsUtil, decorators: [{
1632
- type: Injectable
1375
+ const KEY_CANCEL = 3, KEY_HELP = 6, KEY_BACKSPACE = 8, KEY_TAB = 9, KEY_CLEAR = 12, KEY_RETURN = 13, KEY_ENTER = 14, KEY_SHIFT = 16, KEY_CONTROL = 17, KEY_ALT = 18, KEY_PAUSE = 19, KEY_CAPS_LOCK = 20, KEY_ESCAPE = 27, KEY_SPACE = 32, KEY_PAGE_UP = 33, KEY_PAGE_DOWN = 34, KEY_END = 35, KEY_HOME = 36, KEY_LEFT = 37, KEY_UP = 38, KEY_RIGHT = 39, KEY_DOWN = 40, KEY_PRINTSCREEN = 44, KEY_INSERT = 45, KEY_DELETE = 46, KEY_0 = 48, KEY_1 = 49, KEY_2 = 50, KEY_3 = 51, KEY_4 = 52, KEY_5 = 53, KEY_6 = 54, KEY_7 = 55, KEY_8 = 56, KEY_9 = 57, KEY_SEMICOLON = 59, KEY_EQUALS = 61;
1376
+ /*
1377
+ Basically, just copy-pasted functionality from fs-boilerplate v1.x, with some small changes (like we dont have angular.bind anymore, had to go with a workaround)
1378
+ There might be a better way to organise constatns but I need to know use-cases
1379
+ */
1380
+ class FsUtil {
1381
+ constructor() {
1382
+ this.intervals = {};
1383
+ }
1384
+ /**
1385
+ * @deprecated use @firestitch/common/util/guid instead
1386
+ */
1387
+ guid(pattern) {
1388
+ console.warn('@deprecated use @firestitch/common/util/guid instead');
1389
+ pattern = pattern || 'xxxxxx';
1390
+ return pattern.replace(/[xy]/g, function (c) {
1391
+ var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
1392
+ return v.toString(16);
1393
+ });
1394
+ }
1395
+ /**
1396
+ * @deprecated use import { uuid } from @firestitch/common/util; instead
1397
+ */
1398
+ uuid() {
1399
+ console.warn('@deprecated use @firestitch/common/util/uuid instead');
1400
+ return this.guid('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
1401
+ }
1402
+ /**
1403
+ * @deprecated use import { resolve } from @firestitch/common/util; instead
1404
+ */
1405
+ resolve(promise, defaults = []) {
1406
+ console.warn('@deprecated use @firestitch/common/util/resolve instead');
1407
+ const result = defaults;
1408
+ return new Promise(resolve => {
1409
+ promise.then(function (data) {
1410
+ Object.keys(data).forEach(key => result[key] = data[key]);
1411
+ resolve(result);
1412
+ });
1413
+ });
1414
+ }
1415
+ /**
1416
+ * @deprecated use _.toInteger() instead
1417
+ */
1418
+ int(value) {
1419
+ console.warn('@deprecated use _.toInteger() instead');
1420
+ value = parseInt(value);
1421
+ if (isNaN(value)) {
1422
+ value = 0;
1423
+ }
1424
+ return value;
1425
+ }
1426
+ /**
1427
+ * @deprecated use _.toFinite() instead
1428
+ */
1429
+ float(value) {
1430
+ console.warn('@deprecated use _.toFinite() instead');
1431
+ value = parseFloat(value);
1432
+ if (isNaN(value)) {
1433
+ value = 0;
1434
+ }
1435
+ return value;
1436
+ }
1437
+ /**
1438
+ * @deprecated use _.toString() instead
1439
+ */
1440
+ string(string) {
1441
+ console.warn('@deprecated use _.toString() instead');
1442
+ if (string === null || string === undefined) {
1443
+ string = '';
1444
+ }
1445
+ return (string).toString();
1446
+ }
1447
+ /**
1448
+ * @deprecated use import { isEmpty } from @firestitch/common/util; instead
1449
+ */
1450
+ isEmpty(value, options) {
1451
+ console.warn('@deprecated use import { isEmpty } from @firestitch/common/util; instead');
1452
+ options = options || {};
1453
+ return value === undefined ||
1454
+ value === null ||
1455
+ value === false ||
1456
+ value === '' ||
1457
+ !this.string(value).length ||
1458
+ (this.isObject(value) &&
1459
+ (value.constructor.name === 'Object' && !Object.keys(value).length)) ||
1460
+ (!options.zero && (value === 0 || value === '0'));
1461
+ }
1462
+ /**
1463
+ * @deprecated use _.isInteger() instead
1464
+ */
1465
+ isInt(value, type) {
1466
+ console.warn('@deprecated use _.isInteger() instead');
1467
+ const int = !!this.string(value).match(/^\d+$/);
1468
+ if (!int) {
1469
+ return false;
1470
+ }
1471
+ if (type) {
1472
+ return Number.isInteger(value);
1473
+ }
1474
+ return true;
1475
+ }
1476
+ /**
1477
+ * @deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}
1478
+ */
1479
+ each(object, func) {
1480
+ console.warn('@deprecated use _.each() instead {@link https://lodash.com/docs/4.17.5#forEach}');
1481
+ if (!this.isArray(object) && !this.isObject(object)) {
1482
+ return;
1483
+ }
1484
+ Object.keys(object).forEach(function (key) {
1485
+ func(object[key], key);
1486
+ });
1487
+ }
1488
+ /**
1489
+ * @deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject}
1490
+ * or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead
1491
+ */
1492
+ isObject(value) {
1493
+ console.warn('@deprecated use _.isArrayLikeObject() {@link https://lodash.com/docs/4.17.5#isArrayLikeObject} or _.isObject() {@link https://lodash.com/docs/4.17.5#isObject} instead');
1494
+ return value !== null && typeof value === 'object' && !this.isArray(value);
1495
+ }
1496
+ /**
1497
+ * @deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}
1498
+ */
1499
+ isString(value) {
1500
+ console.warn('@deprecated use _.isString() instead {@link https://lodash.com/docs/4.17.5#isString}');
1501
+ return typeof value === 'string' || value instanceof String;
1502
+ }
1503
+ /**
1504
+ * @deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}
1505
+ */
1506
+ isArray(value) {
1507
+ console.warn('@deprecated use _.isArray() instead {@link https://lodash.com/docs/4.17.5#isArray}');
1508
+ return value instanceof Array;
1509
+ }
1510
+ /**
1511
+ * @deprecated use import { isNumeric } from @firestitch/common/util; instead
1512
+ */
1513
+ isNumeric(value) {
1514
+ console.warn('@deprecated use import { isNumeric } from @firestitch/common/util; instead');
1515
+ return this.string(value).length && !!this.string(value).match(/^-?\d*\.?\d*$/);
1516
+ }
1517
+ /**
1518
+ * @deprecated use import { isClass } from @firestitch/common/util; instead
1519
+ */
1520
+ isClass(value, cls) {
1521
+ console.warn('@deprecated use import { isClass } from @firestitch/common/util; instead');
1522
+ if (this.isObject(value)) {
1523
+ if (this.isString(cls)) {
1524
+ if (value.constructor) {
1525
+ if (value.constructor.name === cls) {
1526
+ return true;
1527
+ }
1528
+ }
1529
+ }
1530
+ else {
1531
+ if (value instanceof cls) {
1532
+ return true;
1533
+ }
1534
+ }
1535
+ }
1536
+ return false;
1537
+ }
1538
+ /**
1539
+ * @deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}
1540
+ */
1541
+ isBoolean(value) {
1542
+ console.warn('@deprecated use _.isBoolean() instead {@link https://lodash.com/docs/4.17.5#isBoolean}');
1543
+ return value === true || value === false;
1544
+ }
1545
+ /**
1546
+ * @deprecated use import { value } from @firestitch/common/util; instead
1547
+ */
1548
+ value(object, key, def) {
1549
+ console.warn('@deprecated use import { value } from @firestitch/common/util; instead');
1550
+ if (this.isObject(object) || this.isArray(object)) {
1551
+ if (object.hasOwnProperty(key)) {
1552
+ return object[key];
1553
+ }
1554
+ }
1555
+ return def;
1556
+ }
1557
+ throttle(func, wait) {
1558
+ console.warn('@deprecated use import { throttle } from @firestitch/common/util; instead');
1559
+ let waiting = false; // Initially, we're not waiting
1560
+ return function () {
1561
+ if (!waiting) { // If we're not waiting
1562
+ func.apply(null, arguments); // Execute users function
1563
+ waiting = true; // Prevent future invocations
1564
+ setTimeout(function () {
1565
+ waiting = false; // And allow future invocations
1566
+ }, wait);
1567
+ }
1568
+ };
1569
+ }
1570
+ /**
1571
+ * @deprecated use import { debounce } from @firestitch/common/util; instead
1572
+ */
1573
+ debounce(func, wait, immediate) {
1574
+ console.warn('@deprecated use import { debounce } from @firestitch/common/util; instead');
1575
+ var timeout;
1576
+ return function () {
1577
+ var context = this, args = arguments;
1578
+ var later = function () {
1579
+ timeout = null;
1580
+ if (!immediate)
1581
+ func.apply(context, args);
1582
+ };
1583
+ var callNow = immediate && !timeout;
1584
+ clearTimeout(timeout);
1585
+ timeout = setTimeout(later, wait);
1586
+ if (callNow)
1587
+ func.apply(context, args);
1588
+ };
1589
+ }
1590
+ /**
1591
+ * @deprecated use import { length } from @firestitch/common/util; instead
1592
+ */
1593
+ length(object) {
1594
+ console.warn('@deprecated use import { length } from @firestitch/common/util; instead');
1595
+ if (this.isObject(object)) {
1596
+ return Object.keys(object).length;
1597
+ }
1598
+ if (this.isArray(object)) {
1599
+ return object.length;
1600
+ }
1601
+ return 0;
1602
+ }
1603
+ /**
1604
+ * @deprecated use import { boolean } from @firestitch/common/util; instead
1605
+ */
1606
+ boolean(value) {
1607
+ console.warn('@deprecated use import { boolean } from @firestitch/common/util; instead');
1608
+ return this.string(value).toLowerCase() !== 'false' && !!value;
1609
+ }
1610
+ /**
1611
+ * @deprecated use import { stringify } from @firestitch/common/util; instead
1612
+ */
1613
+ stringify(value) {
1614
+ console.warn('@deprecated use import { stringify } from @firestitch/common/util; instead');
1615
+ return JSON.stringify(value);
1616
+ }
1617
+ }
1618
+ FsUtil.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtil, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1619
+ FsUtil.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtil });
1620
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsUtil, decorators: [{
1621
+ type: Injectable
1633
1622
  }] });
1634
1623
 
1635
- class FsValidate {
1636
- constructor(fsUtil) {
1637
- this.fsUtil = fsUtil;
1638
- }
1639
- /**
1640
- * @deprecated use import { email } from @firestitch/common/validate; instead
1641
- */
1642
- phone(value) {
1643
- const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
1644
- return valid || !String(value).length;
1645
- }
1646
- /**
1647
- * @deprecated use import { email } from @firestitch/common/validate; instead
1648
- */
1649
- email(value) {
1650
- return !!this.fsUtil.string(value).match(/^(([^<>()\[\]\\.,;:\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,}))$/);
1651
- }
1652
- }
1653
- FsValidate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate, deps: [{ token: FsUtil }], target: i0.ɵɵFactoryTarget.Injectable });
1654
- FsValidate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate });
1655
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsValidate, decorators: [{
1656
- type: Injectable
1624
+ class FsValidate {
1625
+ constructor(fsUtil) {
1626
+ this.fsUtil = fsUtil;
1627
+ }
1628
+ /**
1629
+ * @deprecated use import { email } from @firestitch/common/validate; instead
1630
+ */
1631
+ phone(value) {
1632
+ const valid = /^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/.test(value);
1633
+ return valid || !String(value).length;
1634
+ }
1635
+ /**
1636
+ * @deprecated use import { email } from @firestitch/common/validate; instead
1637
+ */
1638
+ email(value) {
1639
+ return !!this.fsUtil.string(value).match(/^(([^<>()\[\]\\.,;:\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,}))$/);
1640
+ }
1641
+ }
1642
+ FsValidate.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsValidate, deps: [{ token: FsUtil }], target: i0.ɵɵFactoryTarget.Injectable });
1643
+ FsValidate.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsValidate });
1644
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsValidate, decorators: [{
1645
+ type: Injectable
1657
1646
  }], ctorParameters: function () { return [{ type: FsUtil }]; } });
1658
1647
 
1659
- class FsCommonModule {
1660
- static forRoot() {
1661
- return {
1662
- ngModule: FsCommonModule,
1663
- providers: [
1664
- FsArray,
1665
- FsMath,
1666
- FsUtil,
1667
- FsValidate,
1668
- ],
1669
- };
1670
- }
1671
- }
1672
- FsCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1673
- FsCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, declarations: [FsStopPropagationDirective,
1674
- FsPreventDefaultDirective,
1675
- FsAutoFocusDirective,
1676
- FsAutofocusDirective,
1677
- FsAutoSelectDirective,
1678
- FsUtilGuidPipe,
1679
- FsUtilIsEmptyPipe,
1680
- FsUtilIsNotEmptyPipe,
1681
- FsUtilStringifyPipe,
1682
- FsFormatNumberPipe,
1683
- FsFormatCurrencyPipe,
1684
- FsFormatTruncatePipe,
1685
- FsFormatBytesPipe,
1686
- FsFormatOrdinalNumberPipe,
1687
- FsModelChangeDirective], imports: [CommonModule], exports: [FsStopPropagationDirective,
1688
- FsPreventDefaultDirective,
1689
- FsAutoFocusDirective,
1690
- FsAutofocusDirective,
1691
- FsAutoSelectDirective,
1692
- FsUtilGuidPipe,
1693
- FsUtilStringifyPipe,
1694
- FsFormatNumberPipe,
1695
- FsFormatCurrencyPipe,
1696
- FsFormatTruncatePipe,
1697
- FsUtilIsEmptyPipe,
1698
- FsUtilIsNotEmptyPipe,
1699
- FsFormatBytesPipe,
1700
- FsModelChangeDirective,
1701
- FsFormatOrdinalNumberPipe] });
1702
- FsCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, imports: [[
1703
- CommonModule,
1704
- ]] });
1705
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: FsCommonModule, decorators: [{
1706
- type: NgModule,
1707
- args: [{
1708
- imports: [
1709
- CommonModule,
1710
- ],
1711
- declarations: [
1712
- FsStopPropagationDirective,
1713
- FsPreventDefaultDirective,
1714
- FsAutoFocusDirective,
1715
- FsAutofocusDirective,
1716
- FsAutoSelectDirective,
1717
- FsUtilGuidPipe,
1718
- FsUtilIsEmptyPipe,
1719
- FsUtilIsNotEmptyPipe,
1720
- FsUtilStringifyPipe,
1721
- FsFormatNumberPipe,
1722
- FsFormatCurrencyPipe,
1723
- FsFormatTruncatePipe,
1724
- FsFormatBytesPipe,
1725
- FsFormatOrdinalNumberPipe,
1726
- FsModelChangeDirective,
1727
- ],
1728
- exports: [
1729
- FsStopPropagationDirective,
1730
- FsPreventDefaultDirective,
1731
- FsAutoFocusDirective,
1732
- FsAutofocusDirective,
1733
- FsAutoSelectDirective,
1734
- FsUtilGuidPipe,
1735
- FsUtilStringifyPipe,
1736
- FsFormatNumberPipe,
1737
- FsFormatCurrencyPipe,
1738
- FsFormatTruncatePipe,
1739
- FsUtilIsEmptyPipe,
1740
- FsUtilIsNotEmptyPipe,
1741
- FsFormatBytesPipe,
1742
- FsModelChangeDirective,
1743
- FsFormatOrdinalNumberPipe,
1744
- ],
1745
- }]
1648
+ class FsCommonModule {
1649
+ static forRoot() {
1650
+ return {
1651
+ ngModule: FsCommonModule,
1652
+ providers: [
1653
+ FsArray,
1654
+ FsMath,
1655
+ FsUtil,
1656
+ FsValidate,
1657
+ ],
1658
+ };
1659
+ }
1660
+ }
1661
+ FsCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1662
+ FsCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: FsCommonModule, declarations: [FsStopPropagationDirective,
1663
+ FsPreventDefaultDirective,
1664
+ FsAutoFocusDirective,
1665
+ FsAutoSelectDirective,
1666
+ FsUtilGuidPipe,
1667
+ FsUtilIsEmptyPipe,
1668
+ FsUtilIsNotEmptyPipe,
1669
+ FsUtilStringifyPipe,
1670
+ FsFormatNumberPipe,
1671
+ FsFormatCurrencyPipe,
1672
+ FsFormatTruncatePipe,
1673
+ FsFormatBytesPipe,
1674
+ FsFormatOrdinalNumberPipe,
1675
+ FsModelChangeDirective], imports: [CommonModule], exports: [FsStopPropagationDirective,
1676
+ FsPreventDefaultDirective,
1677
+ FsAutoFocusDirective,
1678
+ FsAutoSelectDirective,
1679
+ FsUtilGuidPipe,
1680
+ FsUtilStringifyPipe,
1681
+ FsFormatNumberPipe,
1682
+ FsFormatCurrencyPipe,
1683
+ FsFormatTruncatePipe,
1684
+ FsUtilIsEmptyPipe,
1685
+ FsUtilIsNotEmptyPipe,
1686
+ FsFormatBytesPipe,
1687
+ FsModelChangeDirective,
1688
+ FsFormatOrdinalNumberPipe] });
1689
+ FsCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsCommonModule, imports: [CommonModule] });
1690
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: FsCommonModule, decorators: [{
1691
+ type: NgModule,
1692
+ args: [{
1693
+ imports: [
1694
+ CommonModule,
1695
+ ],
1696
+ declarations: [
1697
+ FsStopPropagationDirective,
1698
+ FsPreventDefaultDirective,
1699
+ FsAutoFocusDirective,
1700
+ FsAutoSelectDirective,
1701
+ FsUtilGuidPipe,
1702
+ FsUtilIsEmptyPipe,
1703
+ FsUtilIsNotEmptyPipe,
1704
+ FsUtilStringifyPipe,
1705
+ FsFormatNumberPipe,
1706
+ FsFormatCurrencyPipe,
1707
+ FsFormatTruncatePipe,
1708
+ FsFormatBytesPipe,
1709
+ FsFormatOrdinalNumberPipe,
1710
+ FsModelChangeDirective,
1711
+ ],
1712
+ exports: [
1713
+ FsStopPropagationDirective,
1714
+ FsPreventDefaultDirective,
1715
+ FsAutoFocusDirective,
1716
+ FsAutoSelectDirective,
1717
+ FsUtilGuidPipe,
1718
+ FsUtilStringifyPipe,
1719
+ FsFormatNumberPipe,
1720
+ FsFormatCurrencyPipe,
1721
+ FsFormatTruncatePipe,
1722
+ FsUtilIsEmptyPipe,
1723
+ FsUtilIsNotEmptyPipe,
1724
+ FsFormatBytesPipe,
1725
+ FsModelChangeDirective,
1726
+ FsFormatOrdinalNumberPipe,
1727
+ ],
1728
+ }]
1746
1729
  }] });
1747
1730
 
1748
- const keyboardShortcut = (shortcut) => {
1749
- // Observables for all keydown and keyup events
1750
- const keyDown$ = fromEvent(document, 'keydown');
1751
- const keyUp$ = fromEvent(document, 'keyup');
1752
- // All KeyboardEvents - emitted only when KeyboardEvent changes (key or type)
1753
- const keyEvents$ = merge(keyDown$, keyUp$).pipe(distinctUntilChanged((a, b) => a.code === b.code && a.type === b.type), share());
1754
- // Create KeyboardEvent Observable for specified KeyCode
1755
- const createKeyPressStream = (charCode) => keyEvents$.pipe(filter$1((event) => event.keyCode === charCode));
1756
- // Create Event Stream for every KeyCode in shortcut
1757
- const keyCodeEvents$ = shortcut.map((s) => createKeyPressStream(s));
1758
- // Emit when specified keys are pressed (keydown).
1759
- // Emit only when all specified keys are pressed at the same time.
1760
- // More on combineLatest below
1761
- return combineLatest(keyCodeEvents$).pipe(filter$1((arr) => arr.every((a) => a.type === 'keydown')));
1731
+ const keyboardShortcut = (shortcut) => {
1732
+ // Observables for all keydown and keyup events
1733
+ const keyDown$ = fromEvent(document, 'keydown');
1734
+ const keyUp$ = fromEvent(document, 'keyup');
1735
+ // All KeyboardEvents - emitted only when KeyboardEvent changes (key or type)
1736
+ const keyEvents$ = merge(keyDown$, keyUp$).pipe(distinctUntilChanged((a, b) => a.code === b.code && a.type === b.type), share());
1737
+ // Create KeyboardEvent Observable for specified KeyCode
1738
+ const createKeyPressStream = (charCode) => keyEvents$.pipe(filter$1((event) => event.keyCode === charCode));
1739
+ // Create Event Stream for every KeyCode in shortcut
1740
+ const keyCodeEvents$ = shortcut.map((s) => createKeyPressStream(s));
1741
+ // Emit when specified keys are pressed (keydown).
1742
+ // Emit only when all specified keys are pressed at the same time.
1743
+ // More on combineLatest below
1744
+ return combineLatest(keyCodeEvents$).pipe(filter$1((arr) => arr.every((a) => a.type === 'keydown')));
1762
1745
  };
1763
1746
 
1764
1747
  // Modules
1765
1748
 
1766
- /**
1767
- * Generated bundle index. Do not edit.
1749
+ /**
1750
+ * Generated bundle index. Do not edit.
1768
1751
  */
1769
1752
 
1770
- export { FsArray, FsAutoFocusDirective, FsAutoSelectDirective, FsAutofocusDirective, FsCommonModule, FsFormatBytesPipe, FsFormatCurrencyPipe, FsFormatNumberPipe, FsFormatOrdinalNumberPipe, FsFormatTruncatePipe, FsMath, FsModelChangeDirective, FsPreventDefaultDirective, FsStopPropagationDirective, FsUtil, FsUtilGuidPipe, FsUtilIsEmptyPipe, FsUtilIsNotEmptyPipe, FsUtilStringifyPipe, FsValidate, KEY_0$1 as KEY_0, KEY_1$1 as KEY_1, KEY_2$1 as KEY_2, KEY_3$1 as KEY_3, KEY_4$1 as KEY_4, KEY_5$1 as KEY_5, KEY_6$1 as KEY_6, KEY_7$1 as KEY_7, KEY_8$1 as KEY_8, KEY_9$1 as KEY_9, KEY_ALT$1 as KEY_ALT, KEY_BACKSPACE$1 as KEY_BACKSPACE, KEY_CANCEL$1 as KEY_CANCEL, KEY_CAPS_LOCK$1 as KEY_CAPS_LOCK, KEY_CLEAR$1 as KEY_CLEAR, KEY_CONTROL$1 as KEY_CONTROL, KEY_DELETE$1 as KEY_DELETE, KEY_DOWN$1 as KEY_DOWN, KEY_END$1 as KEY_END, KEY_ENTER$1 as KEY_ENTER, KEY_EQUALS$1 as KEY_EQUALS, KEY_ESCAPE$1 as KEY_ESCAPE, KEY_HELP$1 as KEY_HELP, KEY_HOME$1 as KEY_HOME, KEY_INSERT$1 as KEY_INSERT, KEY_LEFT$1 as KEY_LEFT, KEY_PAGE_DOWN$1 as KEY_PAGE_DOWN, KEY_PAGE_UP$1 as KEY_PAGE_UP, KEY_PAUSE$1 as KEY_PAUSE, KEY_PRINTSCREEN$1 as KEY_PRINTSCREEN, KEY_RETURN$1 as KEY_RETURN, KEY_RIGHT$1 as KEY_RIGHT, KEY_SEMICOLON$1 as KEY_SEMICOLON, KEY_SHIFT$1 as KEY_SHIFT, KEY_SPACE$1 as KEY_SPACE, KEY_TAB$1 as KEY_TAB, KEY_UP$1 as KEY_UP, Queue, QueueState, acronym, boolean, bytes, clone, compare, currency, debounce, delayedRetry, email, filter, find, fsSourceLoader, getNormalizedPath, guid, inArray, index, indexOf, isArrayEqual, isClass, isEmpty, isNumeric, isObject, keyExists, keyboardShortcut, ksort, length, list, loadJs, loadStyles, nameValue, number, ordinalNumber, phone, remove, removeQueryParams, resolve, round, rsort, sort, stringify, throttle, toString, truncate, url, uuid, value };
1753
+ export { FsArray, FsAutoFocusDirective, FsAutoSelectDirective, FsCommonModule, FsFormatBytesPipe, FsFormatCurrencyPipe, FsFormatNumberPipe, FsFormatOrdinalNumberPipe, FsFormatTruncatePipe, FsMath, FsModelChangeDirective, FsPreventDefaultDirective, FsStopPropagationDirective, FsUtil, FsUtilGuidPipe, FsUtilIsEmptyPipe, FsUtilIsNotEmptyPipe, FsUtilStringifyPipe, FsValidate, KEY_0$1 as KEY_0, KEY_1$1 as KEY_1, KEY_2$1 as KEY_2, KEY_3$1 as KEY_3, KEY_4$1 as KEY_4, KEY_5$1 as KEY_5, KEY_6$1 as KEY_6, KEY_7$1 as KEY_7, KEY_8$1 as KEY_8, KEY_9$1 as KEY_9, KEY_ALT$1 as KEY_ALT, KEY_BACKSPACE$1 as KEY_BACKSPACE, KEY_CANCEL$1 as KEY_CANCEL, KEY_CAPS_LOCK$1 as KEY_CAPS_LOCK, KEY_CLEAR$1 as KEY_CLEAR, KEY_CONTROL$1 as KEY_CONTROL, KEY_DELETE$1 as KEY_DELETE, KEY_DOWN$1 as KEY_DOWN, KEY_END$1 as KEY_END, KEY_ENTER$1 as KEY_ENTER, KEY_EQUALS$1 as KEY_EQUALS, KEY_ESCAPE$1 as KEY_ESCAPE, KEY_HELP$1 as KEY_HELP, KEY_HOME$1 as KEY_HOME, KEY_INSERT$1 as KEY_INSERT, KEY_LEFT$1 as KEY_LEFT, KEY_PAGE_DOWN$1 as KEY_PAGE_DOWN, KEY_PAGE_UP$1 as KEY_PAGE_UP, KEY_PAUSE$1 as KEY_PAUSE, KEY_PRINTSCREEN$1 as KEY_PRINTSCREEN, KEY_RETURN$1 as KEY_RETURN, KEY_RIGHT$1 as KEY_RIGHT, KEY_SEMICOLON$1 as KEY_SEMICOLON, KEY_SHIFT$1 as KEY_SHIFT, KEY_SPACE$1 as KEY_SPACE, KEY_TAB$1 as KEY_TAB, KEY_UP$1 as KEY_UP, Queue, QueueState, acronym, boolean, bytes, clone, compare, currency, debounce, delayedRetry, email, filter, find, fsSourceLoader, getNormalizedPath, guid, inArray, index, indexOf, isArrayEqual, isClass, isEmpty, isNumeric, isObject, keyExists, keyboardShortcut, ksort, length, list, loadJs, loadStyles, nameValue, number, ordinalNumber, phone, remove, removeQueryParams, resolve, round, rsort, sort, stringify, throttle, toString, truncate, url, uuid, value };
1771
1754
  //# sourceMappingURL=firestitch-common.mjs.map