carriera-intern-components 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1354 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Pipe, input, HostListener, Directive, signal, computed, ViewChild, Optional, Self, Component, output, Injectable, inject } from '@angular/core';
3
+ import { SvgIconComponent } from 'angular-svg-icon';
4
+ import * as i2 from '@ng-bootstrap/ng-bootstrap';
5
+ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
6
+ import * as i1 from '@angular/forms';
7
+ import * as pdfjsLib from 'pdfjs-dist';
8
+
9
+ class NumberFormatPipe {
10
+ transform(value) {
11
+ if (!value)
12
+ return '';
13
+ if (value.includes('.')) {
14
+ const [integerPart, decimalPart] = value.split('.');
15
+ // Cap decimal places to maximum 2
16
+ const cappedDecimalPart = decimalPart ? decimalPart.substring(0, 2) : '';
17
+ // Format the integer part with commas
18
+ const formattedInteger = integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
19
+ // If there's a decimal part, show it (capped at 2 places)
20
+ if (decimalPart !== undefined) {
21
+ return `${formattedInteger}.${cappedDecimalPart}`;
22
+ }
23
+ // If user just typed a decimal point, show it
24
+ return `${formattedInteger}.`;
25
+ }
26
+ return value.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
27
+ }
28
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NumberFormatPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
29
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: NumberFormatPipe, isStandalone: true, name: "numberFormat" });
30
+ }
31
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NumberFormatPipe, decorators: [{
32
+ type: Pipe,
33
+ args: [{
34
+ name: 'numberFormat',
35
+ }]
36
+ }] });
37
+
38
+ class ErrorMessagePipe {
39
+ numberFormatPipe = new NumberFormatPipe();
40
+ transform(errors) {
41
+ if (!errors)
42
+ return [];
43
+ const messages = {
44
+ required: () => 'Required',
45
+ minlength: (value) => `Minimum length is ${value.requiredLength}`,
46
+ maxlength: (value) => `Maximum length is ${value.requiredLength}`,
47
+ min: (value) => `Minimum value is ${this.numberFormatPipe.transform(String(value.min))}`,
48
+ max: (value) => `Maximum value is ${this.numberFormatPipe.transform(String(value.max))}`,
49
+ email: () => 'Invalid email format',
50
+ pattern: () => 'Invalid format',
51
+ };
52
+ return Object.entries(errors).map(([key, value]) => {
53
+ const getMessage = messages[key];
54
+ return getMessage ? getMessage(value) : 'Invalid field.';
55
+ });
56
+ }
57
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ErrorMessagePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
58
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: ErrorMessagePipe, isStandalone: true, name: "errorMessage" });
59
+ }
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ErrorMessagePipe, decorators: [{
61
+ type: Pipe,
62
+ args: [{
63
+ name: 'errorMessage'
64
+ }]
65
+ }] });
66
+
67
+ class PasswordDirective {
68
+ el;
69
+ /**
70
+ * Input property to enable or disable the password masking behavior.
71
+ */
72
+ appPassword = input(true);
73
+ /**
74
+ * Input property to hide or show the password
75
+ */
76
+ visible = input(false);
77
+ /**
78
+ * Input property to specify how many characters from the end of the
79
+ * password should be revealed. Defaults to 0 (fully masked).
80
+ */
81
+ reveal = input(0);
82
+ /**
83
+ * Stores the actual, unmasked password value,
84
+ * while the input element displays a masked version.
85
+ */
86
+ realValue = '';
87
+ constructor(el) {
88
+ this.el = el;
89
+ }
90
+ /**
91
+ * Lifecycle hook called after Angular initializes the directive's data-bound properties.
92
+ * If password masking is enabled, it sets up the initial masking.
93
+ */
94
+ ngOnInit() {
95
+ if (this.appPassword()) {
96
+ this.setupPasswordMasking();
97
+ }
98
+ }
99
+ /**
100
+ * Sets up the initial state for password masking.
101
+ * It reads the initial value from the input (if any) as the `realValue`
102
+ * and then updates the input's display to show the masked version.
103
+ */
104
+ setupPasswordMasking() {
105
+ const input = this.el.nativeElement;
106
+ this.realValue = input.value || ''; // Assume initial value is unmasked or is the real one
107
+ this.updateDisplayValue();
108
+ }
109
+ /**
110
+ * HostListener for the 'input' event on the host element.
111
+ * This is the core logic for synchronizing `realValue` with user input
112
+ * on the masked field. It infers changes to `realValue`
113
+ * based on `event.data`, cursor position, and the difference in length
114
+ * between the input's current display value and the previous `realValue`.
115
+ * @param event - The InputEvent object.
116
+ */
117
+ onInput(event) {
118
+ if (!this.appPassword())
119
+ return;
120
+ const input = this.el.nativeElement; // Using el.nativeElement as in original code
121
+ const cursorPosition = input.selectionStart || 0;
122
+ const displayValue = input.value; // Value after browser's immediate processing of input
123
+ // Calculate difference from the *previous* realValue length
124
+ const lengthDiff = displayValue.length - this.realValue.length;
125
+ if (event.data && lengthDiff <= 0) {
126
+ // Text replacement or complex change: e.g., typing over a selection.
127
+ // `event.data` contains the newly typed character(s).
128
+ // `lengthDiff` helps determine how many characters were replaced.
129
+ const deletedCount = Math.abs(lengthDiff) + event.data.length;
130
+ const replaceStart = cursorPosition - event.data.length;
131
+ this.realValue =
132
+ this.realValue.slice(0, Math.max(0, replaceStart)) + // Ensure replaceStart isn't negative
133
+ event.data +
134
+ this.realValue.slice(Math.max(0, replaceStart) + deletedCount);
135
+ }
136
+ else if (lengthDiff > 0) {
137
+ // Pure addition of characters (typing without prior selection, or pasting).
138
+ // `event.data` contains the added character(s), or we infer from displayValue.
139
+ const addedChars = event.data ||
140
+ displayValue.slice(cursorPosition - lengthDiff, cursorPosition);
141
+ const insertPosition = cursorPosition - addedChars.length;
142
+ this.realValue =
143
+ this.realValue.slice(0, Math.max(0, insertPosition)) +
144
+ addedChars +
145
+ this.realValue.slice(Math.max(0, insertPosition));
146
+ }
147
+ else if (lengthDiff < 0) {
148
+ // Pure deletion (e.g., Backspace, Delete key).
149
+ // `event.data` is null for these operations.
150
+ const deletedCount = Math.abs(lengthDiff);
151
+ // `cursorPosition` is where the cursor is *after* deletion.
152
+ // The deletion happened *before* this `cursorPosition`.
153
+ this.realValue =
154
+ this.realValue.slice(0, cursorPosition) +
155
+ this.realValue.slice(cursorPosition + deletedCount);
156
+ }
157
+ // If lengthDiff is 0 and no event.data (e.g. moving cursor with arrow keys inside text), realValue should not change.
158
+ // The current logic handles this as no branch is taken.
159
+ this.updateDisplayValue();
160
+ this.setCursorPosition(cursorPosition); // Restore cursor as displayValue changed
161
+ this.dispatchRealValueChange();
162
+ }
163
+ /**
164
+ * HostListener for the 'cut' event.
165
+ * Prevents default cut behavior to operate on `realValue`.
166
+ * It copies the corresponding part of `realValue` to the clipboard
167
+ * and updates `realValue` and the display.
168
+ * @param event - The ClipboardEvent object.
169
+ */
170
+ onCut(event) {
171
+ if (!this.appPassword())
172
+ return;
173
+ const input = this.el.nativeElement;
174
+ const start = input.selectionStart || 0;
175
+ const end = input.selectionEnd || 0;
176
+ if (start !== end) {
177
+ // If there's a selection
178
+ event.preventDefault(); // Prevent default cut action
179
+ const cutText = this.realValue.slice(start, end); // Cut from realValue
180
+ event.clipboardData?.setData('text/plain', cutText);
181
+ this.realValue =
182
+ this.realValue.slice(0, start) + this.realValue.slice(end);
183
+ this.updateDisplayValue();
184
+ this.setCursorPosition(start); // Set cursor to the start of the cut area
185
+ this.dispatchRealValueChange();
186
+ }
187
+ }
188
+ /**
189
+ * HostListener for the 'copy' event.
190
+ * Prevents default copy behavior to ensure the unmasked `realValue` segment is copied.
191
+ * @param event - The ClipboardEvent object.
192
+ */
193
+ onCopy(event) {
194
+ if (!this.appPassword())
195
+ return;
196
+ const input = this.el.nativeElement;
197
+ const start = input.selectionStart || 0;
198
+ const end = input.selectionEnd || 0;
199
+ if (start !== end) {
200
+ // If there's a selection
201
+ event.preventDefault(); // Prevent default copy action
202
+ const copiedText = this.realValue.slice(start, end); // Copy from realValue
203
+ event.clipboardData?.setData('text/plain', copiedText);
204
+ }
205
+ }
206
+ /**
207
+ * Updates the input element's display value with a masked version of `realValue`.
208
+ * Uses '•' for masked characters. Respects the `reveal` input to show
209
+ * a specified number of characters from the end of the password.
210
+ * This method is responsible for creating the visual masking.
211
+ */
212
+ updateDisplayValue() {
213
+ if (this.visible()) {
214
+ this.el.nativeElement.value = this.realValue;
215
+ return;
216
+ }
217
+ const revealCount = this.reveal();
218
+ const realLength = this.realValue.length;
219
+ let displayValue = '';
220
+ if (revealCount > 0 && realLength > revealCount) {
221
+ const actualRevealCount = Math.min(revealCount, realLength);
222
+ // Calculate how many characters to mask
223
+ const maskedCharsCount = realLength - actualRevealCount;
224
+ if (maskedCharsCount > 0) {
225
+ // Get the part of the real value that should be revealed
226
+ const revealedPart = this.realValue.slice(maskedCharsCount); // Corrected from slice(realLength - actualRevealCount)
227
+ displayValue = '•'.repeat(maskedCharsCount) + revealedPart;
228
+ }
229
+ else {
230
+ // If all characters are to be revealed (revealCount >= realLength)
231
+ displayValue = this.realValue;
232
+ }
233
+ }
234
+ else {
235
+ // Fully mask if revealCount is 0 or realValue is lesser than revealCount
236
+ displayValue = '•'.repeat(realLength);
237
+ }
238
+ this.el.nativeElement.value = displayValue;
239
+ }
240
+ /**
241
+ * Sets the cursor position within the input field.
242
+ * This is crucial after `updateDisplayValue` changes the entire input value,
243
+ * to maintain a natural cursor behavior for the user.
244
+ * Uses `setTimeout` to ensure the operation occurs after Angular's view update.
245
+ * @param position - The desired cursor position.
246
+ */
247
+ setCursorPosition(position) {
248
+ const input = this.el.nativeElement;
249
+ // setTimeout ensures this runs after the current browser rendering tick
250
+ setTimeout(() => {
251
+ // Clamp position to be within the bounds of the current display value's length
252
+ const currentLength = input.value.length;
253
+ const newPosition = Math.max(0, Math.min(position, currentLength));
254
+ input.setSelectionRange(newPosition, newPosition);
255
+ }, 0);
256
+ }
257
+ /**
258
+ * Dispatches a custom event named 'realValueChange' from the host element.
259
+ * The event's `detail` property contains the unmasked `realValue`.
260
+ * This allows parent components (like your `InputComponent`) to listen for
261
+ * changes to the actual password.
262
+ */
263
+ dispatchRealValueChange() {
264
+ const customEvent = new CustomEvent('realValueChange', {
265
+ bubbles: true, // Allows event to bubble up the DOM
266
+ composed: true, // Allows event to cross Shadow DOM boundaries
267
+ detail: this.realValue,
268
+ });
269
+ this.el.nativeElement.dispatchEvent(customEvent);
270
+ }
271
+ /**
272
+ * Public method to get the current unmasked "real" password value.
273
+ * @returns The real password value as a string.
274
+ */
275
+ getRealValue() {
276
+ return this.realValue;
277
+ }
278
+ /**
279
+ * Public method to set the "real" password value from outside the directive
280
+ * (e.g., when the parent form control's value is changed programmatically).
281
+ * It updates the internal `realValue` and then refreshes the masked display.
282
+ * @param value - The new real password value to set.
283
+ */
284
+ setRealValue(value) {
285
+ this.realValue = value || '';
286
+ this.updateDisplayValue();
287
+ }
288
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
289
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.14", type: PasswordDirective, isStandalone: true, selector: "[appPassword]", inputs: { appPassword: { classPropertyName: "appPassword", publicName: "appPassword", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null }, reveal: { classPropertyName: "reveal", publicName: "reveal", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput($event)", "cut": "onCut($event)", "copy": "onCopy($event)" } }, ngImport: i0 });
290
+ }
291
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: PasswordDirective, decorators: [{
292
+ type: Directive,
293
+ args: [{
294
+ selector: '[appPassword]',
295
+ }]
296
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { onInput: [{
297
+ type: HostListener,
298
+ args: ['input', ['$event']]
299
+ }], onCut: [{
300
+ type: HostListener,
301
+ args: ['cut', ['$event']]
302
+ }], onCopy: [{
303
+ type: HostListener,
304
+ args: ['copy', ['$event']]
305
+ }] } });
306
+
307
+ class NumberFormatDirective {
308
+ el;
309
+ /**
310
+ * Input property to enable or disable the number formatting.
311
+ * Defaults to true, meaning formatting is active by default.
312
+ */
313
+ appNumberFormat = input(true);
314
+ /**
315
+ * Stores the unformatted, "real" numeric value of the input.
316
+ * This is the value that should be used for calculations or form submissions,
317
+ * as opposed to the formatted display value.
318
+ */
319
+ realValue = '';
320
+ constructor(el) {
321
+ this.el = el;
322
+ }
323
+ /**
324
+ * Lifecycle hook that is called after Angular has initialized all data-bound
325
+ * properties of a directive.
326
+ * If number formatting is enabled, it sets up the initial formatting.
327
+ */
328
+ ngOnInit() {
329
+ if (this.appNumberFormat()) {
330
+ this.setupNumberFormatting();
331
+ }
332
+ }
333
+ /**
334
+ * Initializes the number formatting on the input element.
335
+ * It extracts the initial numeric value from the input's current value
336
+ * and then updates the display with the formatted version.
337
+ */
338
+ setupNumberFormatting() {
339
+ const input = this.el.nativeElement;
340
+ // Extract numeric value from whatever might be in the input initially
341
+ this.realValue = this.extractNumericValue(input.value || '');
342
+ this.updateDisplayValue(); // Format and display it
343
+ }
344
+ /**
345
+ * HostListener for the 'input' event on the host element.
346
+ * This triggers whenever the user types or pastes content into the input.
347
+ * It extracts the numeric value from the current input, updates the
348
+ * display with the formatted number, moves the cursor to the end,
349
+ * and dispatches a 'realValueChange' event with the unformatted numeric value.
350
+ * @param event - The InputEvent object.
351
+ */
352
+ onInput(event) {
353
+ if (!this.appNumberFormat())
354
+ return; // Do nothing if formatting is disabled
355
+ const input = this.el.nativeElement;
356
+ const displayValue = input.value;
357
+ this.realValue = this.extractNumericValue(displayValue);
358
+ this.updateDisplayValue();
359
+ this.setCursorToEnd(); // Important for UX after reformatting
360
+ this.dispatchRealValueChange(); // Notify parent components of the raw value change
361
+ }
362
+ /**
363
+ * HostListener for the 'cut' event.
364
+ * Prevents the default cut behavior to manually handle the value change.
365
+ * It reconstructs the value after the cut, extracts the numeric part,
366
+ * updates the display, sets the cursor, and dispatches the real value.
367
+ * @param event - The ClipboardEvent object.
368
+ */
369
+ onCut(event) {
370
+ if (!this.appNumberFormat())
371
+ return;
372
+ const input = this.el.nativeElement;
373
+ const start = input.selectionStart || 0;
374
+ const end = input.selectionEnd || 0;
375
+ if (start !== end) {
376
+ // If there's a selection
377
+ event.preventDefault(); // Prevent default cut
378
+ const cutText = input.value.slice(start, end);
379
+ event.clipboardData?.setData('text', this.extractNumericValue(cutText)); // Put numeric part on clipboard
380
+ // Reconstruct value without the cut part
381
+ const newValue = input.value.slice(0, start) + input.value.slice(end);
382
+ this.realValue = this.extractNumericValue(newValue);
383
+ this.updateDisplayValue();
384
+ this.setCursorToEnd();
385
+ this.dispatchRealValueChange();
386
+ }
387
+ }
388
+ /**
389
+ * HostListener for the 'copy' event.
390
+ * Prevents the default copy behavior if there's a selection to ensure
391
+ * that the copied text is the unformatted numeric value of the selection,
392
+ * rather than the potentially formatted display text.
393
+ * @param event - The ClipboardEvent object.
394
+ */
395
+ onCopy(event) {
396
+ if (!this.appNumberFormat())
397
+ return;
398
+ const input = this.el.nativeElement;
399
+ const start = input.selectionStart || 0;
400
+ const end = input.selectionEnd || 0;
401
+ if (start !== end) {
402
+ // If there's a selection
403
+ event.preventDefault(); // Prevent default copy
404
+ const selectedText = input.value.slice(start, end);
405
+ // Copy the underlying numeric value of the selection
406
+ event.clipboardData?.setData('text', this.extractNumericValue(selectedText));
407
+ }
408
+ }
409
+ /**
410
+ * HostListener for the 'keydown' event.
411
+ * Filters key presses to allow only digits, a single decimal point,
412
+ * and control keys (Backspace, Arrows, Tab, etc.).
413
+ * This helps maintain a valid numeric input format before the 'input' event fires.
414
+ * @param event - The KeyboardEvent object.
415
+ */
416
+ onKeydown(event) {
417
+ if (!this.appNumberFormat())
418
+ return;
419
+ const controlKeys = [
420
+ 'Backspace',
421
+ 'Delete',
422
+ 'ArrowLeft',
423
+ 'ArrowRight',
424
+ 'ArrowUp',
425
+ 'ArrowDown',
426
+ 'Tab',
427
+ 'Enter',
428
+ 'Escape',
429
+ 'Home',
430
+ 'End',
431
+ ];
432
+ // Allow control keys, and modifier key combinations (Ctrl+A, Ctrl+C, etc.)
433
+ if (controlKeys.includes(event.key) ||
434
+ event.ctrlKey ||
435
+ event.metaKey ||
436
+ event.altKey) {
437
+ return; // Don't prevent default for these
438
+ }
439
+ // Allow a single decimal point if not already present in the realValue
440
+ if (event.key === '.' && !this.realValue.includes('.')) {
441
+ return;
442
+ }
443
+ // Prevent non-digit keys
444
+ if (!/^\d$/.test(event.key)) {
445
+ event.preventDefault();
446
+ }
447
+ }
448
+ /**
449
+ * Extracts a clean numeric string from a given value.
450
+ * It removes any non-digit characters except for a single decimal point.
451
+ * It also ensures that there's only one decimal point and limits
452
+ * the decimal part to two digits.
453
+ * @param value - The string value to clean.
454
+ * @returns A string representing the extracted numeric value.
455
+ */
456
+ extractNumericValue(value) {
457
+ // Remove all non-digit characters except for the decimal point
458
+ let cleanValue = value.replace(/[^\d.]/g, '');
459
+ // Handle multiple decimal points: keep only the first one
460
+ const parts = cleanValue.split('.');
461
+ if (parts.length > 1) {
462
+ const integerPart = parts[0];
463
+ const decimalPart = parts.slice(1).join(''); // Join back any subsequent parts
464
+ cleanValue = `${integerPart}.${decimalPart}`;
465
+ }
466
+ // Limit decimal part to two digits
467
+ if (cleanValue.includes('.')) {
468
+ const [integerPart, decimalPart] = cleanValue.split('.');
469
+ const cappedDecimalPart = decimalPart ? decimalPart.substring(0, 2) : '';
470
+ cleanValue = `${integerPart}.${cappedDecimalPart}`;
471
+ }
472
+ return cleanValue;
473
+ }
474
+ /**
475
+ * Updates the input element's display value with the formatted version
476
+ * of the current `realValue`.
477
+ * It uses the `NumberFormatPipe` for formatting.
478
+ */
479
+ updateDisplayValue() {
480
+ const input = this.el.nativeElement;
481
+ const formattedValue = new NumberFormatPipe().transform(this.realValue);
482
+ this.el.nativeElement.value = formattedValue;
483
+ }
484
+ /**
485
+ * Sets the cursor position to the end of the input field.
486
+ * This is typically called after the input value is reformatted to prevent
487
+ * the cursor from jumping to an unexpected position.
488
+ * Uses `setTimeout` to ensure the operation occurs after Angular's view update.
489
+ */
490
+ setCursorToEnd() {
491
+ const input = this.el.nativeElement;
492
+ // setTimeout ensures this runs after the current browser rendering tick,
493
+ // allowing the value to be fully set in the input before moving the cursor.
494
+ setTimeout(() => {
495
+ const length = input.value.length;
496
+ input.setSelectionRange(length, length);
497
+ }, 0);
498
+ }
499
+ /**
500
+ * Dispatches a custom event named 'realValueChange' from the host element.
501
+ * The event's `detail` property contains the unformatted `realValue`.
502
+ * This allows parent components or other directives to listen for changes
503
+ * to the underlying numeric value.
504
+ */
505
+ dispatchRealValueChange() {
506
+ const customEvent = new CustomEvent('realValueChange', {
507
+ bubbles: true, // Allows event to bubble up the DOM
508
+ composed: true, // Allows event to cross Shadow DOM boundaries
509
+ detail: this.realValue,
510
+ });
511
+ this.el.nativeElement.dispatchEvent(customEvent);
512
+ }
513
+ /**
514
+ * Public method to get the current unformatted "real" numeric value.
515
+ * @returns The real numeric value as a string.
516
+ */
517
+ getRealValue() {
518
+ return this.realValue;
519
+ }
520
+ /**
521
+ * Public method to set the "real" numeric value from outside the directive.
522
+ * It extracts the numeric part from the provided value and updates the
523
+ * input's display with the formatted version.
524
+ * @param value - The new value to set (can be formatted or unformatted).
525
+ */
526
+ setRealValue(value) {
527
+ this.realValue = this.extractNumericValue(value || '');
528
+ this.updateDisplayValue();
529
+ }
530
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NumberFormatDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
531
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.2.14", type: NumberFormatDirective, isStandalone: true, selector: "[appNumberFormat]", inputs: { appNumberFormat: { classPropertyName: "appNumberFormat", publicName: "appNumberFormat", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "onInput($event)", "cut": "onCut($event)", "copy": "onCopy($event)", "keydown": "onKeydown($event)" } }, providers: [NumberFormatPipe], ngImport: i0 });
532
+ }
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NumberFormatDirective, decorators: [{
534
+ type: Directive,
535
+ args: [{
536
+ selector: '[appNumberFormat]',
537
+ providers: [NumberFormatPipe],
538
+ }]
539
+ }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { onInput: [{
540
+ type: HostListener,
541
+ args: ['input', ['$event']]
542
+ }], onCut: [{
543
+ type: HostListener,
544
+ args: ['cut', ['$event']]
545
+ }], onCopy: [{
546
+ type: HostListener,
547
+ args: ['copy', ['$event']]
548
+ }], onKeydown: [{
549
+ type: HostListener,
550
+ args: ['keydown', ['$event']]
551
+ }] } });
552
+
553
+ /**
554
+ * A reusable input component that integrates with Angular Forms and supports
555
+ * various input types, including text, password (with reveal functionality),
556
+ * and numbers (with formatting and step controls). It also provides error
557
+ * message display and icon support.
558
+ */
559
+ class InputComponent {
560
+ ngControl;
561
+ /**
562
+ * Defines the unique identifier for the input element.
563
+ * This ID is crucial for accessibility, linking the `<label>` to the
564
+ * native `<input>` via the `for` attribute.
565
+ * It is provided by the parent component as an Angular `input()` signal.
566
+ */
567
+ id = input('');
568
+ /**
569
+ * Configuration object for the input's behavior and appearance.
570
+ * This `input()` signal accepts an `InputConfig` object to customize
571
+ * properties like the input type (`text`, `password`, `number`),
572
+ * placeholder/label text (`name`), validation (`required`), and other
573
+ * special behaviors.
574
+ */
575
+ config = input({});
576
+ /**
577
+ * Internal signal to track the disabled state of the input.
578
+ * This state is managed by the `ControlValueAccessor`'s `setDisabledState`
579
+ * method, which is called by Angular's Forms API when the associated
580
+ * form control's status changes. Defaults to `false`.
581
+ */
582
+ disabled = signal(false);
583
+ /**
584
+ * Holds the internal, unmasked, and unformatted value of the input.
585
+ * This signal represents the component's "source of truth" for its value.
586
+ * It is updated by user input (via `onInput` or `onRealValueChange`) and
587
+ * programmatically by the `ControlValueAccessor`'s `writeValue` method.
588
+ * The value from this signal is what is propagated back to the parent `FormControl`.
589
+ */
590
+ value = signal('');
591
+ /**
592
+ * Tracks the visibility state for inputs of `type='password'`.
593
+ * When `true`, the password's characters are shown; when `false`, they are
594
+ * masked. This is toggled by the `toggleVisibility` method.
595
+ * Defaults to `false`.
596
+ */
597
+ visible = signal(false);
598
+ /**
599
+ * A computed signal that dynamically calculates the step value for number inputs.
600
+ * The step value changes based on the magnitude of the current `value()`.
601
+ * This allows for more intuitive incrementing and decrementing (e.g., smaller
602
+ * steps for smaller numbers, larger steps for larger numbers). It derives its
603
+ * value from the `getStepValue` method and automatically updates when the
604
+ * input's `value` signal changes.
605
+ */
606
+ step = computed(() => this.getStepValue());
607
+ inputRef;
608
+ PasswordDirective;
609
+ NumberFormatDirective;
610
+ dropdown;
611
+ /**
612
+ * Constructor for the InputComponent.
613
+ * It injects NgControl to integrate with Angular's forms API.
614
+ * If NgControl is present, it sets this component as the value accessor
615
+ * for the form control.
616
+ * @param ngControl - Optional NgControl instance for form integration.
617
+ */
618
+ constructor(ngControl) {
619
+ this.ngControl = ngControl;
620
+ if (this.ngControl) {
621
+ this.ngControl.valueAccessor = this;
622
+ }
623
+ }
624
+ /**
625
+ * Handles the native 'input' event from the HTMLInputElement.
626
+ * Updates the component's internal value and notifies Angular forms
627
+ * about the change.
628
+ * For 'password' type (when not visible) and 'number' type, it relies
629
+ * on associated directives (PasswordDirective, NumberFormatDirective)
630
+ * to get the real value, as the displayed value might be
631
+ * masked or formatted.
632
+ * @param event - The input event object.
633
+ */
634
+ onInput(event) {
635
+ const inputElement = event.target;
636
+ // Handle inputs normally for all inputs other than password and number
637
+ if (this.config().type === 'password' || this.config().type === 'number') {
638
+ return;
639
+ }
640
+ this.value.set(inputElement.value);
641
+ if (this.config().search) {
642
+ return;
643
+ }
644
+ this.onChange(this.value());
645
+ }
646
+ /**
647
+ * Listens for a custom 'realValueChange' event.
648
+ * This event is expected to be emitted by child directives (PasswordDirective, NumberFormatDirective)
649
+ * when their internal "real" value changes, allowing the parent input component
650
+ * to stay in sync.
651
+ * @param event - A CustomEvent containing the new real value in `event.detail`.
652
+ */
653
+ onRealValueChange(event) {
654
+ this.value.set(event.detail);
655
+ this.onChange(event.detail);
656
+ }
657
+ /**
658
+ * Increments the value of a number input by the current step.
659
+ * If the current value is not a valid number, it starts from the `min` input.
660
+ * After updating, it notifies forms, updates the view, and focuses the input.
661
+ * @param event - The MouseEvent that triggered the increment.
662
+ */
663
+ increment(event) {
664
+ this.value.update((v) => String((parseFloat(v) ? parseFloat(v) : 0) + this.step()));
665
+ this.onChange(this.value());
666
+ this.setValue(); // Ensure the view (e.g., formatted number) is updated
667
+ this.focus(event);
668
+ }
669
+ /**
670
+ * Decrements the value of a number input by the current step.
671
+ * If the current value is not a valid number, it starts from the `min` input.
672
+ * The value will not go below the minimum value.
673
+ * After updating, it notifies forms, updates the view, and focuses the input.
674
+ * @param event - The MouseEvent that triggered the decrement.
675
+ */
676
+ decrement(event) {
677
+ this.value.update((v) => {
678
+ const currentValue = parseFloat(v) ? parseFloat(v) : 0;
679
+ const nextValue = currentValue - this.step();
680
+ return String(nextValue <= 0 ? 0 : nextValue);
681
+ });
682
+ this.onChange(this.value());
683
+ this.setValue(); // Ensure the view (e.g., formatted number) is updated
684
+ this.focus(event);
685
+ }
686
+ /**
687
+ * Calculates the step value for number inputs based on the current value.
688
+ * The step dynamically adjusts:
689
+ * - 1000 if value < 20000
690
+ * - 5000 if value < 50000
691
+ * - 10000 if value < 100000
692
+ * - 20000 otherwise
693
+ * Uses `min()` as a fallback if the current value is not a valid number.
694
+ * @returns The calculated step value.
695
+ */
696
+ getStepValue() {
697
+ const numericValue = parseFloat(this.value() || '0');
698
+ const value = numericValue || 0;
699
+ if (value < 20000)
700
+ return 1000;
701
+ else if (value < 50000)
702
+ return 5000;
703
+ else if (value < 100000)
704
+ return 10000;
705
+ else
706
+ return 20000;
707
+ }
708
+ /**
709
+ * Toggles the visibility of the password input.
710
+ * Toggles the `visible` state and updates the input's displayed value.
711
+ * @param event - The MouseEvent that triggered the toggle.
712
+ */
713
+ toggleVisibility(event) {
714
+ if (this.config().type !== 'password') {
715
+ return;
716
+ }
717
+ this.focus(event); // Ensure input remains focused after toggle
718
+ this.visible.update((v) => !v);
719
+ setTimeout(() => this.setValue(), 0);
720
+ }
721
+ /**
722
+ * Sets the value in the actual HTML input element or updates the
723
+ * "real" value in the associated directive.
724
+ * - For 'password' type: If not visible, it updates the PasswordDirective's real value.
725
+ * If visible, it falls through to the default behavior.
726
+ * - For 'number' type: It updates the NumberFormatDirective's real value.
727
+ * - For other types (or visible password): It sets the `value` property of the native input element.
728
+ */
729
+ setValue() {
730
+ // Ensure inputRef is available
731
+ if (!this.inputRef || !this.inputRef.nativeElement) {
732
+ return;
733
+ }
734
+ switch (this.config().type) {
735
+ case 'password':
736
+ if (this.PasswordDirective) {
737
+ // When password is not visible, the directive handles the masking.
738
+ // We set the real value on the directive.
739
+ this.PasswordDirective.setRealValue(this.value());
740
+ }
741
+ else {
742
+ // When password is visible, or no directive, set directly.
743
+ this.inputRef.nativeElement.value = this.value();
744
+ }
745
+ break;
746
+ case 'number':
747
+ if (this.NumberFormatDirective) {
748
+ // NumberFormatDirective handles formatting, so we set the real value on it.
749
+ this.NumberFormatDirective.setRealValue(this.value());
750
+ }
751
+ else {
752
+ // If no directive, set directly.
753
+ this.inputRef.nativeElement.value = this.value();
754
+ }
755
+ break;
756
+ default:
757
+ // For text, email, etc., set the value directly on the input element.
758
+ this.inputRef.nativeElement.value = this.value();
759
+ break;
760
+ }
761
+ }
762
+ /**
763
+ * Focuses the input element.
764
+ * Prevents the default action of the mouse event to avoid unintended behaviors
765
+ * like double focus or focus loss.
766
+ * @param event - The MouseEvent that initiated the focus action.
767
+ */
768
+ focus(event) {
769
+ event.preventDefault();
770
+ if (this.inputRef && this.inputRef.nativeElement) {
771
+ this.inputRef.nativeElement.focus();
772
+ }
773
+ }
774
+ // ControlValueAccessor methods
775
+ onChange = (_) => { };
776
+ onTouched = () => { };
777
+ /**
778
+ * Writes a new value to the element. (ControlValueAccessor)
779
+ * This method is called by the Forms API to update the view when
780
+ * the form control's value changes programmatically.
781
+ * Uses `setTimeout` to ensure that `setValue` is called after the
782
+ * view (and potentially child directives) has been initialized,
783
+ * especially relevant if `writeValue` is called early in the component lifecycle.
784
+ * @param value - The new value to write.
785
+ */
786
+ writeValue(value) {
787
+ this.value.set(value || '');
788
+ // Use setTimeout to ensure directives like PasswordDirective or NumberFormatDirective
789
+ // are initialized and ready to receive the value, especially during component init.
790
+ setTimeout(() => {
791
+ this.setValue();
792
+ });
793
+ }
794
+ /**
795
+ * Registers a callback function that should be called when the
796
+ * control's value changes in the UI. (ControlValueAccessor)
797
+ * @param fn - The callback function to register.
798
+ */
799
+ registerOnChange(fn) {
800
+ this.onChange = fn;
801
+ }
802
+ /**
803
+ * Registers a callback function that should be called when the
804
+ * control receives a blur event. (ControlValueAccessor)
805
+ * @param fn - The callback function to register.
806
+ */
807
+ registerOnTouched(fn) {
808
+ this.onTouched = fn;
809
+ }
810
+ /**
811
+ * This function is called by the Forms API when the control's disabled
812
+ * state changes. (ControlValueAccessor)
813
+ * @param isDisabled - True if the control should be disabled, false otherwise.
814
+ */
815
+ setDisabledState(isDisabled) {
816
+ this.disabled.set(isDisabled);
817
+ }
818
+ /**
819
+ * Called when the input element loses focus (blur event).
820
+ * Triggers the `onTouched` callback to notify Angular Forms that the
821
+ * input has been interacted with.
822
+ */
823
+ onBlur() {
824
+ this.onTouched();
825
+ }
826
+ /**
827
+ * Resets the input field's value to an empty string.
828
+ * Notifies Angular Forms of the change and updates the view.
829
+ */
830
+ reset() {
831
+ this.value.set('');
832
+ this.onChange(''); // Notify form control of the change
833
+ this.setValue(); // Update the actual input element
834
+ }
835
+ /**
836
+ * Represents the base list of options available for the dropdown.
837
+ * This is an input signal, meaning its value can be set from a parent component.
838
+ * @type {Signal<string[]>}
839
+ */
840
+ dropdownOptions = input([]);
841
+ /**
842
+ * A computed signal that provides the current list of options to display in the dropdown.
843
+ *
844
+ * If `search` is `false`, it returns the full `dropdownOptions`.
845
+ * If `search` is `true`, it filters `dropdownOptions` based on the `value` signal,
846
+ * performing a case-insensitive partial text match.
847
+ *
848
+ * @type {Signal<string[]>}
849
+ */
850
+ options = computed(() => {
851
+ if (!this.config().search) {
852
+ return this.dropdownOptions();
853
+ }
854
+ const searchValue = this.value();
855
+ const filteredOptions = this.dropdownOptions().filter((option) => option.toLowerCase().includes(searchValue.toLowerCase()));
856
+ if (filteredOptions.length > 0) {
857
+ return filteredOptions;
858
+ }
859
+ return [];
860
+ });
861
+ /**
862
+ * Formats an option for the dropdown by highlighting the search value if it exists in the option.
863
+ * @param option - The option to format.
864
+ * @returns The formatted option.
865
+ */
866
+ formatOption(option) {
867
+ if (!this.config().search) {
868
+ return option;
869
+ }
870
+ const searchValue = this.value();
871
+ if (!searchValue || searchValue.trim() === '') {
872
+ return option;
873
+ }
874
+ const escapedSearchValue = searchValue.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
875
+ const regex = new RegExp(escapedSearchValue, 'gi');
876
+ if (option.toLowerCase().includes(searchValue.toLowerCase())) {
877
+ return option.replace(regex, '<span class="highlight" >$&</span>');
878
+ }
879
+ return option;
880
+ }
881
+ /**
882
+ * Handles when an option is selected from the dropdown.
883
+ * @param option - The selected option.
884
+ * @param event - The MouseEvent that initiated the selection action.
885
+ */
886
+ handleOption(option, event) {
887
+ this.focus(event);
888
+ this.value.set(option);
889
+ this.onChange(option);
890
+ this.setValue();
891
+ this.dropdown.close();
892
+ }
893
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InputComponent, deps: [{ token: i1.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component });
894
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: InputComponent, isStandalone: true, selector: "app-input", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, dropdownOptions: { classPropertyName: "dropdownOptions", publicName: "dropdownOptions", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "realValueChange": "onRealValueChange($event)" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true }, { propertyName: "PasswordDirective", first: true, predicate: PasswordDirective, descendants: true }, { propertyName: "NumberFormatDirective", first: true, predicate: NumberFormatDirective, descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }], ngImport: i0, template: "@let valid = ngControl?.valid && ngControl?.touched && ngControl?.dirty; @let\ninvalid = ngControl?.invalid && ngControl?.touched && ngControl?.dirty; @let\ntype = config().type; @let icon = config().icon; @let alignment =\nconfig().alignment; @let inverse = config().inverse; @let name = config().name;\n@let required = config().required; @let reveal = config().reveal; @let password\n= type === 'password'; @let number = type === 'number'; @let ariaLabel = type\n=== 'password' ? 'Password' : config().name; @let hasDropdown =\nconfig().dropdown;\n\n<div\n class=\"app-input-container\"\n [class]=\"{\n 'has-error': invalid,\n 'has-valid': valid,\n 'has-icon': icon,\n 'has-password': password,\n 'has-visible': password && visible(),\n 'has-number': number,\n 'has-right': alignment === 'right',\n inverse: inverse,\n 'has-dropdown': hasDropdown\n }\"\n ngbDropdown\n [autoClose]=\"'outside'\"\n #dropdown=\"ngbDropdown\"\n>\n @if (config().icon && !password && !number) {\n <div class=\"icon-container\" (mousedown)=\"focus($event)\">\n <svg-icon class=\"icon\" name=\"{{ icon }}\"></svg-icon>\n <div class=\"separator\"></div>\n </div>\n } @if (password){\n <div class=\"icon-container\" (mousedown)=\"toggleVisibility($event)\">\n <div class=\"password-icons\">\n <svg-icon class=\"icon password-key\" name=\"password-key\"></svg-icon>\n <svg-icon class=\"icon password-shown\" name=\"password-shown\"></svg-icon>\n <svg-icon class=\"icon password-hidden\" name=\"password-hidden\"></svg-icon>\n </div>\n <div class=\"separator\"></div>\n </div>\n }\n\n <input\n class=\"app-input\"\n [type]=\"'text'\"\n [name]=\"name\"\n [required]=\"required\"\n [disabled]=\"disabled()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel\"\n placeholder=\"\"\n autocomplete=\"off\"\n #inputRef\n [appPassword]=\"password\"\n [reveal]=\"reveal || 0\"\n [visible]=\"visible()\"\n [appNumberFormat]=\"number\"\n (focus)=\"hasDropdown && dropdown.open()\"\n (click)=\"hasDropdown && dropdown.open()\"\n ngbDropdownAnchor\n />\n <label class=\"app-input-label\">\n {{ name }}\n </label>\n @if(number){\n <div class=\"number-container\">\n <div class=\"number-buttons\">\n <div class=\"separator\"></div>\n <svg-icon\n name=\"plus\"\n class=\"bg-icon plus-icon\"\n (mousedown)=\"increment($event)\"\n ></svg-icon>\n <svg-icon\n name=\"minus\"\n class=\"bg-icon minus-icon\"\n (mousedown)=\"decrement($event)\"\n ></svg-icon>\n </div>\n </div>\n }\n <svg-icon name=\"checkmark\" class=\"app-input-icon positive-icon\"></svg-icon>\n <svg-icon name=\"warning\" class=\"app-input-icon warning-icon\"></svg-icon>\n <div class=\"app-input-error\">\n @if (invalid) { @for (error of ngControl?.errors | errorMessage ; track\n $index) {\n {{ error }}\n } }\n </div>\n <button\n type=\"button\"\n class=\"app-input-icon cancel-icon bg-icon\"\n (click)=\"reset()\"\n [tabIndex]=\"-1\"\n >\n <svg-icon name=\"cancel\"></svg-icon>\n </button>\n @if(hasDropdown) {\n <div class=\"dropdown-menu\" ngbDropdownMenu>\n @if (!options().length) {\n <p class=\"dropdown-item no-results\">No results</p>\n } @for(option of options(); track $index ){\n <button\n class=\"dropdown-item\"\n (click)=\"handleOption(option, $event)\"\n [class]=\"{\n 'selected': value() === option,\n }\"\n >\n <p [innerHTML]=\"formatOption(option)\"></p>\n <svg-icon name=\"checkmark\" class=\"dropdown-item-icon\"></svg-icon>\n </button>\n }\n </div>\n <div class=\"icon-container\">\n <svg-icon name=\"arrow-down\" class=\"dropdown-icon icon\"></svg-icon>\n </div>\n }\n</div>\n", styles: [".app-input-container{--color-text: #2f2f2f;--color-text-negative: #df3c3c;--color-text-heading: #424242;--color-text-subtle: #919191;--color-text-inverse: #ffffff;--color-icon-neutral: #919191;--color-icon-negative: #e66767;--color-icon-positive: #6692f1;--color-icon-inverse: rgba(255, 255, 255, .6980392157);--color-icon-disable: #cccccc;--color-surface-neutral: #eeeeee;--color-surface-neutral-hover: #dadada;--color-surface-neutral-focus: #1d1d1d;--color-surface-positive: #e9effd;--color-surface-positive-hover: #bed0f9;--color-surface-positive-focus: #0b49d1;--color-surface-negative: #fbe9e9;--color-surface-negative-hover: #f4bebe;--color-surface-negative-focus: #c20c0c;--color-surface-disable: #f7f7f7;position:relative;margin:18px 0;min-width:208px;border-radius:2px;background-color:var(--color-surface-neutral);color:var(--color-text);transition:background-color .2s ease-in-out;display:flex}.app-input-container.inverse{--color-text: #ffffff;--color-text-negative: #ed9292;--color-text-heading: #ffffff;--color-text-inverse: #ffffff;--color-icon-neutral: #aaaaaa;--color-icon-negative: #ed9292;--color-icon-positive: #92b1f5;--color-icon-disable: #6c6c6c;--color-surface-neutral: #424242;--color-surface-neutral-hover: #6c6c6c;--color-surface-neutral-focus: #dadada;--color-surface-positive: rgba(59, 115, 237, .2);--color-surface-positive-hover: #2f519a;--color-surface-positive-focus: #0b49d1;--color-surface-negative: rgba(223, 60, 60, .2);--color-surface-negative-hover: #923030;--color-surface-negative-focus: #c20c0c;--color-surface-disable: rgba(66, 66, 66, .4)}.app-input-container.inverse:not(.has-error):not(.has-valid) .app-input:focus-visible{color:#2f2f2f}.app-input-container.inverse:not(.has-error):not(.has-valid):has(.app-input:focus-visible) .icon{color:#919191!important}.app-input-container.inverse:not(.has-error):not(.has-valid):has(.app-input:focus-visible) .separator{background-color:#919191!important}.app-input-container.inverse:not(.has-error):not(.has-valid):has(.app-input:focus-visible) .bg-icon{background-color:#919191!important;color:#dadada}.app-input-container.inverse:has(.app-input:placeholder-shown):has(.app-input:focus-visible) .icon{color:#919191!important}.app-input-container.inverse:has(.app-input:placeholder-shown):has(.app-input:focus-visible) .bg-icon{background-color:#919191!important;color:#dadada}.app-input-container.inverse:has(.app-input:placeholder-shown):has(.app-input:focus-visible) .separator{background-color:#919191!important}.app-input-container.inverse:has(.app-input:disabled.app-input:not(:placeholder-shown)) .app-input-label{color:#424242!important}.app-input-container:hover{background-color:var(--color-surface-neutral-hover)}.app-input-container:has(.app-input:focus-visible){background-color:var(--color-surface-neutral-focus)}.app-input-container:has(.app-input:focus-visible) .app-input-label{transform:translateY(-20px);font-weight:600;font-size:11px;color:var(--color-text-heading)!important}.app-input-container:has(.app-input:focus-visible) .bg-icon{background-color:var(--color-icon-inverse);color:var(--color-surface-neutral-focus)}.app-input-container:has(.app-input:focus-visible) .separator{background-color:var(--color-icon-inverse)!important}.app-input-container:has(.app-input:not(:placeholder-shown)) .app-input-label{transform:translateY(-20px);font-weight:600;font-size:11px;color:var(--color-text-heading)!important}.app-input-container:has(.app-input:disabled){background-color:var(--color-surface-disable)}.app-input-container:has(.app-input:disabled):hover{background-color:var(--color-surface-disable)}.app-input-container:has(.app-input:disabled):focus{background-color:var(--color-surface-disable)}.app-input-container:has(.app-input:disabled) .app-input-label{color:var(--color-text-subtle)}.app-input-container:has(.app-input:disabled) .separator{background-color:var(--color-icon-disable)}.app-input-container:has(.app-input:required) .app-input-label:after{content:\"*\";color:var(--color-text-negative)}.app-input-label{position:absolute;left:0;font-size:14px;line-height:18px;font-weight:400;pointer-events:none;padding:.25rem 6px;color:var(--color-text);transition:transform .1s ease-in-out,font-weight .1s ease-in-out,color .1s ease-in-out,font-size .1s ease-in-out;transform:translateY(0)}.app-input{padding:.25rem 6px;width:100%;font-size:14px;line-height:18px;font-weight:400;border:0;outline:none;margin-top:auto;background-color:transparent;transition:color .2s ease-in-out;color:var(--color-text)}.app-input:focus-visible{color:var(--color-text-inverse)}.app-input-error{position:absolute;bottom:-16px;right:6px;font-size:11px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out,transform .2s ease-in-out;color:var(--color-text-negative);transform:translateY(-10px)}.app-input-container.has-error{background-color:var(--color-surface-negative)}.app-input-container.has-error:hover{background-color:var(--color-surface-negative-hover)}.app-input-container.has-error:hover:has(.app-input:not(:placeholder-shown)) .cancel-icon{opacity:1;pointer-events:auto}.app-input-container.has-error:hover .bg-icon{background-color:var(--color-icon-negative);color:var(--color-surface-negative-hover)}.app-input-container.has-error:has(.app-input:focus-visible){background-color:var(--color-surface-negative-focus);color:var(--color-text-inverse)}.app-input-container.has-error:has(.app-input:focus-visible):has(.app-input:placeholder-shown){background-color:var(--color-surface-neutral-focus)!important}.app-input-container.has-error:has(.app-input:focus-visible):has(.app-input:placeholder-shown) .app-input-error{opacity:0}.app-input-container.has-error:has(.app-input:focus-visible):has(.app-input:not(:placeholder-shown)) .cancel-icon{opacity:1}.app-input-container.has-error:has(.app-input:focus-visible) .bg-icon{background-color:var(--color-icon-inverse);color:var(--color-surface-negative-focus)}.app-input-container.has-error:has(.app-input:not(:focus-visible)).app-input-container:not(:hover) .warning-icon,.app-input-container.has-error:has(.app-input:placeholder-shown:not(:focus-visible)) .warning-icon{opacity:1!important}.app-input-container.has-error .app-input-error{opacity:1;transform:translateY(0);pointer-events:auto}.app-input-container.has-error .app-input::selection{background-color:var(--color-surface-neutral-focus);color:var(--color-text-inverse)}.app-input-container.has-error .icon-container .separator{background-color:var(--color-icon-negative)}.app-input-container.has-error .icon-container .icon{color:var(--color-icon-negative)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)){background-color:var(--color-surface-positive)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):hover{background-color:var(--color-surface-positive-hover)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):hover:has(.app-input:not(:placeholder-shown)) .cancel-icon{opacity:1;pointer-events:auto}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):hover .bg-icon{background-color:var(--color-icon-positive);color:var(--color-surface-positive-hover)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:focus-visible){background-color:var(--color-surface-positive-focus);color:var(--color-text-inverse)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:focus-visible):has(.app-input:not(:placeholder-shown)) .cancel-icon{opacity:1}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:focus-visible):has(.app-input:not(:placeholder-shown)) .bg-icon{background-color:var(--color-icon-inverse);color:var(--color-surface-positive-focus)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:focus-visible):has(.app-input:placeholder-shown){background-color:var(--color-surface-neutral-focus)!important}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:not(:focus-visible)).app-input-container:not(:hover) .positive-icon{opacity:1}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)) .app-input::selection{background-color:var(--color-surface-neutral-focus);color:var(--color-text-inverse)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)) .icon-container .separator{background-color:var(--color-icon-positive)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)) .icon-container .icon{color:var(--color-icon-positive)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)) .icon-container .password-key{opacity:0}.app-input-icon{position:absolute;right:4px;top:50%;transform:translateY(-50%);pointer-events:none;transition:color .2s ease-in-out,background-color .2s ease-in-out,opacity .2s ease-in-out}.cancel-icon{opacity:0;pointer-events:none}.cancel-icon:hover{cursor:pointer}.bg-icon{background-color:var(--color-icon-neutral);color:var(--color-surface-neutral);border-radius:1px;height:18px;width:18px;padding:0;display:grid;place-items:center;transition:background-color .2s ease-in-out,color .2s ease-in-out,opacity .2s ease-in-out}.positive-icon{color:var(--color-icon-positive);height:18px;width:18px;display:grid;place-items:center;opacity:0}.warning-icon{color:var(--color-icon-negative);height:18px;width:18px;display:grid;place-items:center;opacity:0}.app-input-container.has-icon:has(.app-input:focus-visible) .icon-container .icon,.app-input-container.has-password:has(.app-input:focus-visible) .icon-container .icon,.app-input-container.has-dropdown:has(.app-input:focus-visible) .icon-container .icon{color:var(--color-icon-inverse)}.app-input-container.has-icon:has(.app-input:disabled.app-input:placeholder-shown) .icon-container .icon,.app-input-container.has-password:has(.app-input:disabled.app-input:placeholder-shown) .icon-container .icon,.app-input-container.has-dropdown:has(.app-input:disabled.app-input:placeholder-shown) .icon-container .icon{color:var(--color-icon-disable)}.app-input-container.has-icon .positive-icon,.app-input-container.has-password .positive-icon,.app-input-container.has-dropdown .positive-icon,.app-input-container.has-icon .warning-icon,.app-input-container.has-password .warning-icon,.app-input-container.has-dropdown .warning-icon{opacity:0!important}.app-input-container.has-icon .icon,.app-input-container.has-password .icon,.app-input-container.has-dropdown .icon{height:18px;width:18px;display:grid;place-items:center;color:var(--color-icon-neutral);transition:color .2s ease-in-out,opacity .2s ease-in-out;opacity:1}.app-input-container.has-icon .icon-container,.app-input-container.has-password .icon-container{height:26px;display:flex;justify-items:center;align-items:center;gap:4px;padding:.25rem 0 .25rem 6px}.app-input-container.has-icon .icon-container:hover,.app-input-container.has-password .icon-container:hover{cursor:text}.app-input-container.has-icon .app-input-label,.app-input-container.has-password .app-input-label{left:28px}.app-input-container.has-icon .app-input,.app-input-container.has-password .app-input{padding-left:4px}.separator{height:14px;width:1px;border-radius:2px;background-color:var(--color-icon-neutral);transition:background-color .2s ease-in-out;opacity:40%}.has-password .password-icons{display:grid;place-items:center;position:relative;height:18px;width:18px}.has-password .password-icons .icon{position:absolute;opacity:0}.has-password:has(.app-input:placeholder-shown.app-input:not(:focus-visible)) .password-key{opacity:1!important}.has-password:has(.app-input:not(:placeholder-shown)) .password-hidden,.has-password:has(.app-input:focus-visible) .password-hidden{opacity:1!important}.has-password:has(.app-input:not(:placeholder-shown)) .password-hidden:hover,.has-password:has(.app-input:focus-visible) .password-hidden:hover{cursor:pointer}.has-visible:has(.app-input:not(:placeholder-shown)) .password-shown,.has-visible:has(.app-input:focus-visible) .password-shown{opacity:1!important}.has-visible:has(.app-input:not(:placeholder-shown)) .password-shown:hover,.has-visible:has(.app-input:focus-visible) .password-shown:hover{cursor:pointer}.has-visible:has(.app-input:not(:placeholder-shown)) .password-hidden,.has-visible:has(.app-input:focus-visible) .password-hidden{opacity:0!important}.has-number .number-container{position:relative;display:flex;justify-content:center;align-items:center;right:4px;pointer-events:none}.has-number .number-buttons{display:flex;gap:4px;position:absolute;right:0;justify-content:center;align-items:center;opacity:0;transition:opacity .2s ease-in-out;pointer-events:none}.has-number .plus-icon,.has-number .minus-icon{cursor:pointer;pointer-events:none}.has-number:has(.app-input:focus-visible){cursor:text}.has-number:has(.app-input:focus-visible) .number-buttons{opacity:1}.has-number:has(.app-input:focus-visible) .plus-icon{pointer-events:auto}.has-number:has(.app-input:focus-visible) .minus-icon{pointer-events:auto}.has-number:has(.app-input:focus-visible) .cancel-icon{opacity:0!important;pointer-events:none!important}.has-number:has(.app-input:focus-visible) .number-container{width:60px}.has-dropdown .dropdown-menu{width:100%;background-color:#2f2f2f;border:0;border-radius:3px;padding:4px;margin-top:4px;max-height:244px;overflow-y:auto}.has-dropdown .dropdown-menu::-webkit-scrollbar{background-color:#2f2f2f;border-radius:0 3px 3px 0;width:6px}.has-dropdown .dropdown-menu::-webkit-scrollbar-thumb{background-color:#919191;width:2px;border:2px solid #2f2f2f;border-radius:3px}.has-dropdown .dropdown-item{color:#fff;font-weight:400;font-size:14px;line-height:18px;height:26px;padding:4px;transition:background-color .2s ease-in-out;border-radius:2px;position:relative}.has-dropdown .dropdown-item:hover{background-color:#424242}.has-dropdown .dropdown-item:focus-visible{background-color:#424242;border:0;outline:none}.has-dropdown .dropdown-item:not(:first-child){margin-top:4px}.has-dropdown .no-results{color:#919191;font-weight:700}.has-dropdown .selected{font-weight:700}.has-dropdown .selected .dropdown-item-icon{opacity:1}.has-dropdown .dropdown-item-icon{position:absolute;opacity:0;right:6px;top:50%;transform:translateY(-50%);color:#92b1f5}.has-dropdown .app-input-icon{right:26px}.has-dropdown .icon-container{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:18px;height:18px;display:grid;place-items:center;pointer-events:none}.has-dropdown .dropdown-icon{transition:transform .1s ease-in-out,color .2s ease-in-out!important;transform:rotate(0)}.has-dropdown:has(.app-input:focus-visible) .dropdown-icon{transform:rotate(180deg)}.has-right .app-input{text-align:right}.has-right .positive-icon,.has-right .app-input-icon{left:4px;right:auto}.has-right .app-input{order:1}.has-right.has-icon .app-input,.has-right.has-password .app-input{padding-right:0!important}.has-right.has-icon .app-input-label,.has-right.has-password .app-input-label{left:0!important}.has-right.has-icon .icon-container,.has-right.has-password .icon-container{width:30px;padding-left:4px}.has-right.has-icon .icon-container .icon,.has-right.has-password .icon-container .icon{order:2}.has-right.has-dropdown .app-input-icon{left:26px}.has-right.has-dropdown .icon-container{left:4px}.has-right:has(.app-input:placeholder-shown) .warning-icon{display:none!important}.has-right.has-number .separator{order:3}.has-right.has-number .number-buttons{left:0;right:unset}.has-right.has-number .number-container{left:4px;right:unset}.has-right .icon-container{order:2;margin-right:4px}.has-right .icon-container .password-icons{order:2}:host ::ng-deep .highlight{background-color:#3b73ed33!important;color:#92b1f5!important}:host ::ng-deep .selected .highlight{background-color:transparent!important;color:#fff!important}\n"], dependencies: [{ kind: "pipe", type: ErrorMessagePipe, name: "errorMessage" }, { kind: "component", type: SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "svgClass", "class", "viewBox", "svgAriaLabel", "onSVGLoaded", "svgStyle"] }, { kind: "directive", type: PasswordDirective, selector: "[appPassword]", inputs: ["appPassword", "visible", "reveal"] }, { kind: "directive", type: NumberFormatDirective, selector: "[appNumberFormat]", inputs: ["appNumberFormat"] }, { kind: "ngmodule", type: NgbDropdownModule }, { kind: "directive", type: i2.NgbDropdown, selector: "[ngbDropdown]", inputs: ["autoClose", "dropdownClass", "open", "placement", "popperOptions", "container", "display"], outputs: ["openChange"], exportAs: ["ngbDropdown"] }, { kind: "directive", type: i2.NgbDropdownAnchor, selector: "[ngbDropdownAnchor]" }, { kind: "directive", type: i2.NgbDropdownMenu, selector: "[ngbDropdownMenu]" }] });
895
+ }
896
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: InputComponent, decorators: [{
897
+ type: Component,
898
+ args: [{ selector: 'app-input', imports: [
899
+ ErrorMessagePipe,
900
+ SvgIconComponent,
901
+ PasswordDirective,
902
+ NumberFormatDirective,
903
+ NgbDropdownModule,
904
+ ], template: "@let valid = ngControl?.valid && ngControl?.touched && ngControl?.dirty; @let\ninvalid = ngControl?.invalid && ngControl?.touched && ngControl?.dirty; @let\ntype = config().type; @let icon = config().icon; @let alignment =\nconfig().alignment; @let inverse = config().inverse; @let name = config().name;\n@let required = config().required; @let reveal = config().reveal; @let password\n= type === 'password'; @let number = type === 'number'; @let ariaLabel = type\n=== 'password' ? 'Password' : config().name; @let hasDropdown =\nconfig().dropdown;\n\n<div\n class=\"app-input-container\"\n [class]=\"{\n 'has-error': invalid,\n 'has-valid': valid,\n 'has-icon': icon,\n 'has-password': password,\n 'has-visible': password && visible(),\n 'has-number': number,\n 'has-right': alignment === 'right',\n inverse: inverse,\n 'has-dropdown': hasDropdown\n }\"\n ngbDropdown\n [autoClose]=\"'outside'\"\n #dropdown=\"ngbDropdown\"\n>\n @if (config().icon && !password && !number) {\n <div class=\"icon-container\" (mousedown)=\"focus($event)\">\n <svg-icon class=\"icon\" name=\"{{ icon }}\"></svg-icon>\n <div class=\"separator\"></div>\n </div>\n } @if (password){\n <div class=\"icon-container\" (mousedown)=\"toggleVisibility($event)\">\n <div class=\"password-icons\">\n <svg-icon class=\"icon password-key\" name=\"password-key\"></svg-icon>\n <svg-icon class=\"icon password-shown\" name=\"password-shown\"></svg-icon>\n <svg-icon class=\"icon password-hidden\" name=\"password-hidden\"></svg-icon>\n </div>\n <div class=\"separator\"></div>\n </div>\n }\n\n <input\n class=\"app-input\"\n [type]=\"'text'\"\n [name]=\"name\"\n [required]=\"required\"\n [disabled]=\"disabled()\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n [id]=\"id()\"\n [attr.aria-label]=\"ariaLabel\"\n placeholder=\"\"\n autocomplete=\"off\"\n #inputRef\n [appPassword]=\"password\"\n [reveal]=\"reveal || 0\"\n [visible]=\"visible()\"\n [appNumberFormat]=\"number\"\n (focus)=\"hasDropdown && dropdown.open()\"\n (click)=\"hasDropdown && dropdown.open()\"\n ngbDropdownAnchor\n />\n <label class=\"app-input-label\">\n {{ name }}\n </label>\n @if(number){\n <div class=\"number-container\">\n <div class=\"number-buttons\">\n <div class=\"separator\"></div>\n <svg-icon\n name=\"plus\"\n class=\"bg-icon plus-icon\"\n (mousedown)=\"increment($event)\"\n ></svg-icon>\n <svg-icon\n name=\"minus\"\n class=\"bg-icon minus-icon\"\n (mousedown)=\"decrement($event)\"\n ></svg-icon>\n </div>\n </div>\n }\n <svg-icon name=\"checkmark\" class=\"app-input-icon positive-icon\"></svg-icon>\n <svg-icon name=\"warning\" class=\"app-input-icon warning-icon\"></svg-icon>\n <div class=\"app-input-error\">\n @if (invalid) { @for (error of ngControl?.errors | errorMessage ; track\n $index) {\n {{ error }}\n } }\n </div>\n <button\n type=\"button\"\n class=\"app-input-icon cancel-icon bg-icon\"\n (click)=\"reset()\"\n [tabIndex]=\"-1\"\n >\n <svg-icon name=\"cancel\"></svg-icon>\n </button>\n @if(hasDropdown) {\n <div class=\"dropdown-menu\" ngbDropdownMenu>\n @if (!options().length) {\n <p class=\"dropdown-item no-results\">No results</p>\n } @for(option of options(); track $index ){\n <button\n class=\"dropdown-item\"\n (click)=\"handleOption(option, $event)\"\n [class]=\"{\n 'selected': value() === option,\n }\"\n >\n <p [innerHTML]=\"formatOption(option)\"></p>\n <svg-icon name=\"checkmark\" class=\"dropdown-item-icon\"></svg-icon>\n </button>\n }\n </div>\n <div class=\"icon-container\">\n <svg-icon name=\"arrow-down\" class=\"dropdown-icon icon\"></svg-icon>\n </div>\n }\n</div>\n", styles: [".app-input-container{--color-text: #2f2f2f;--color-text-negative: #df3c3c;--color-text-heading: #424242;--color-text-subtle: #919191;--color-text-inverse: #ffffff;--color-icon-neutral: #919191;--color-icon-negative: #e66767;--color-icon-positive: #6692f1;--color-icon-inverse: rgba(255, 255, 255, .6980392157);--color-icon-disable: #cccccc;--color-surface-neutral: #eeeeee;--color-surface-neutral-hover: #dadada;--color-surface-neutral-focus: #1d1d1d;--color-surface-positive: #e9effd;--color-surface-positive-hover: #bed0f9;--color-surface-positive-focus: #0b49d1;--color-surface-negative: #fbe9e9;--color-surface-negative-hover: #f4bebe;--color-surface-negative-focus: #c20c0c;--color-surface-disable: #f7f7f7;position:relative;margin:18px 0;min-width:208px;border-radius:2px;background-color:var(--color-surface-neutral);color:var(--color-text);transition:background-color .2s ease-in-out;display:flex}.app-input-container.inverse{--color-text: #ffffff;--color-text-negative: #ed9292;--color-text-heading: #ffffff;--color-text-inverse: #ffffff;--color-icon-neutral: #aaaaaa;--color-icon-negative: #ed9292;--color-icon-positive: #92b1f5;--color-icon-disable: #6c6c6c;--color-surface-neutral: #424242;--color-surface-neutral-hover: #6c6c6c;--color-surface-neutral-focus: #dadada;--color-surface-positive: rgba(59, 115, 237, .2);--color-surface-positive-hover: #2f519a;--color-surface-positive-focus: #0b49d1;--color-surface-negative: rgba(223, 60, 60, .2);--color-surface-negative-hover: #923030;--color-surface-negative-focus: #c20c0c;--color-surface-disable: rgba(66, 66, 66, .4)}.app-input-container.inverse:not(.has-error):not(.has-valid) .app-input:focus-visible{color:#2f2f2f}.app-input-container.inverse:not(.has-error):not(.has-valid):has(.app-input:focus-visible) .icon{color:#919191!important}.app-input-container.inverse:not(.has-error):not(.has-valid):has(.app-input:focus-visible) .separator{background-color:#919191!important}.app-input-container.inverse:not(.has-error):not(.has-valid):has(.app-input:focus-visible) .bg-icon{background-color:#919191!important;color:#dadada}.app-input-container.inverse:has(.app-input:placeholder-shown):has(.app-input:focus-visible) .icon{color:#919191!important}.app-input-container.inverse:has(.app-input:placeholder-shown):has(.app-input:focus-visible) .bg-icon{background-color:#919191!important;color:#dadada}.app-input-container.inverse:has(.app-input:placeholder-shown):has(.app-input:focus-visible) .separator{background-color:#919191!important}.app-input-container.inverse:has(.app-input:disabled.app-input:not(:placeholder-shown)) .app-input-label{color:#424242!important}.app-input-container:hover{background-color:var(--color-surface-neutral-hover)}.app-input-container:has(.app-input:focus-visible){background-color:var(--color-surface-neutral-focus)}.app-input-container:has(.app-input:focus-visible) .app-input-label{transform:translateY(-20px);font-weight:600;font-size:11px;color:var(--color-text-heading)!important}.app-input-container:has(.app-input:focus-visible) .bg-icon{background-color:var(--color-icon-inverse);color:var(--color-surface-neutral-focus)}.app-input-container:has(.app-input:focus-visible) .separator{background-color:var(--color-icon-inverse)!important}.app-input-container:has(.app-input:not(:placeholder-shown)) .app-input-label{transform:translateY(-20px);font-weight:600;font-size:11px;color:var(--color-text-heading)!important}.app-input-container:has(.app-input:disabled){background-color:var(--color-surface-disable)}.app-input-container:has(.app-input:disabled):hover{background-color:var(--color-surface-disable)}.app-input-container:has(.app-input:disabled):focus{background-color:var(--color-surface-disable)}.app-input-container:has(.app-input:disabled) .app-input-label{color:var(--color-text-subtle)}.app-input-container:has(.app-input:disabled) .separator{background-color:var(--color-icon-disable)}.app-input-container:has(.app-input:required) .app-input-label:after{content:\"*\";color:var(--color-text-negative)}.app-input-label{position:absolute;left:0;font-size:14px;line-height:18px;font-weight:400;pointer-events:none;padding:.25rem 6px;color:var(--color-text);transition:transform .1s ease-in-out,font-weight .1s ease-in-out,color .1s ease-in-out,font-size .1s ease-in-out;transform:translateY(0)}.app-input{padding:.25rem 6px;width:100%;font-size:14px;line-height:18px;font-weight:400;border:0;outline:none;margin-top:auto;background-color:transparent;transition:color .2s ease-in-out;color:var(--color-text)}.app-input:focus-visible{color:var(--color-text-inverse)}.app-input-error{position:absolute;bottom:-16px;right:6px;font-size:11px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .2s ease-in-out,transform .2s ease-in-out;color:var(--color-text-negative);transform:translateY(-10px)}.app-input-container.has-error{background-color:var(--color-surface-negative)}.app-input-container.has-error:hover{background-color:var(--color-surface-negative-hover)}.app-input-container.has-error:hover:has(.app-input:not(:placeholder-shown)) .cancel-icon{opacity:1;pointer-events:auto}.app-input-container.has-error:hover .bg-icon{background-color:var(--color-icon-negative);color:var(--color-surface-negative-hover)}.app-input-container.has-error:has(.app-input:focus-visible){background-color:var(--color-surface-negative-focus);color:var(--color-text-inverse)}.app-input-container.has-error:has(.app-input:focus-visible):has(.app-input:placeholder-shown){background-color:var(--color-surface-neutral-focus)!important}.app-input-container.has-error:has(.app-input:focus-visible):has(.app-input:placeholder-shown) .app-input-error{opacity:0}.app-input-container.has-error:has(.app-input:focus-visible):has(.app-input:not(:placeholder-shown)) .cancel-icon{opacity:1}.app-input-container.has-error:has(.app-input:focus-visible) .bg-icon{background-color:var(--color-icon-inverse);color:var(--color-surface-negative-focus)}.app-input-container.has-error:has(.app-input:not(:focus-visible)).app-input-container:not(:hover) .warning-icon,.app-input-container.has-error:has(.app-input:placeholder-shown:not(:focus-visible)) .warning-icon{opacity:1!important}.app-input-container.has-error .app-input-error{opacity:1;transform:translateY(0);pointer-events:auto}.app-input-container.has-error .app-input::selection{background-color:var(--color-surface-neutral-focus);color:var(--color-text-inverse)}.app-input-container.has-error .icon-container .separator{background-color:var(--color-icon-negative)}.app-input-container.has-error .icon-container .icon{color:var(--color-icon-negative)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)){background-color:var(--color-surface-positive)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):hover{background-color:var(--color-surface-positive-hover)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):hover:has(.app-input:not(:placeholder-shown)) .cancel-icon{opacity:1;pointer-events:auto}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):hover .bg-icon{background-color:var(--color-icon-positive);color:var(--color-surface-positive-hover)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:focus-visible){background-color:var(--color-surface-positive-focus);color:var(--color-text-inverse)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:focus-visible):has(.app-input:not(:placeholder-shown)) .cancel-icon{opacity:1}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:focus-visible):has(.app-input:not(:placeholder-shown)) .bg-icon{background-color:var(--color-icon-inverse);color:var(--color-surface-positive-focus)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:focus-visible):has(.app-input:placeholder-shown){background-color:var(--color-surface-neutral-focus)!important}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)):has(.app-input:not(:focus-visible)).app-input-container:not(:hover) .positive-icon{opacity:1}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)) .app-input::selection{background-color:var(--color-surface-neutral-focus);color:var(--color-text-inverse)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)) .icon-container .separator{background-color:var(--color-icon-positive)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)) .icon-container .icon{color:var(--color-icon-positive)}.app-input-container.has-valid:has(.app-input:not(:placeholder-shown)) .icon-container .password-key{opacity:0}.app-input-icon{position:absolute;right:4px;top:50%;transform:translateY(-50%);pointer-events:none;transition:color .2s ease-in-out,background-color .2s ease-in-out,opacity .2s ease-in-out}.cancel-icon{opacity:0;pointer-events:none}.cancel-icon:hover{cursor:pointer}.bg-icon{background-color:var(--color-icon-neutral);color:var(--color-surface-neutral);border-radius:1px;height:18px;width:18px;padding:0;display:grid;place-items:center;transition:background-color .2s ease-in-out,color .2s ease-in-out,opacity .2s ease-in-out}.positive-icon{color:var(--color-icon-positive);height:18px;width:18px;display:grid;place-items:center;opacity:0}.warning-icon{color:var(--color-icon-negative);height:18px;width:18px;display:grid;place-items:center;opacity:0}.app-input-container.has-icon:has(.app-input:focus-visible) .icon-container .icon,.app-input-container.has-password:has(.app-input:focus-visible) .icon-container .icon,.app-input-container.has-dropdown:has(.app-input:focus-visible) .icon-container .icon{color:var(--color-icon-inverse)}.app-input-container.has-icon:has(.app-input:disabled.app-input:placeholder-shown) .icon-container .icon,.app-input-container.has-password:has(.app-input:disabled.app-input:placeholder-shown) .icon-container .icon,.app-input-container.has-dropdown:has(.app-input:disabled.app-input:placeholder-shown) .icon-container .icon{color:var(--color-icon-disable)}.app-input-container.has-icon .positive-icon,.app-input-container.has-password .positive-icon,.app-input-container.has-dropdown .positive-icon,.app-input-container.has-icon .warning-icon,.app-input-container.has-password .warning-icon,.app-input-container.has-dropdown .warning-icon{opacity:0!important}.app-input-container.has-icon .icon,.app-input-container.has-password .icon,.app-input-container.has-dropdown .icon{height:18px;width:18px;display:grid;place-items:center;color:var(--color-icon-neutral);transition:color .2s ease-in-out,opacity .2s ease-in-out;opacity:1}.app-input-container.has-icon .icon-container,.app-input-container.has-password .icon-container{height:26px;display:flex;justify-items:center;align-items:center;gap:4px;padding:.25rem 0 .25rem 6px}.app-input-container.has-icon .icon-container:hover,.app-input-container.has-password .icon-container:hover{cursor:text}.app-input-container.has-icon .app-input-label,.app-input-container.has-password .app-input-label{left:28px}.app-input-container.has-icon .app-input,.app-input-container.has-password .app-input{padding-left:4px}.separator{height:14px;width:1px;border-radius:2px;background-color:var(--color-icon-neutral);transition:background-color .2s ease-in-out;opacity:40%}.has-password .password-icons{display:grid;place-items:center;position:relative;height:18px;width:18px}.has-password .password-icons .icon{position:absolute;opacity:0}.has-password:has(.app-input:placeholder-shown.app-input:not(:focus-visible)) .password-key{opacity:1!important}.has-password:has(.app-input:not(:placeholder-shown)) .password-hidden,.has-password:has(.app-input:focus-visible) .password-hidden{opacity:1!important}.has-password:has(.app-input:not(:placeholder-shown)) .password-hidden:hover,.has-password:has(.app-input:focus-visible) .password-hidden:hover{cursor:pointer}.has-visible:has(.app-input:not(:placeholder-shown)) .password-shown,.has-visible:has(.app-input:focus-visible) .password-shown{opacity:1!important}.has-visible:has(.app-input:not(:placeholder-shown)) .password-shown:hover,.has-visible:has(.app-input:focus-visible) .password-shown:hover{cursor:pointer}.has-visible:has(.app-input:not(:placeholder-shown)) .password-hidden,.has-visible:has(.app-input:focus-visible) .password-hidden{opacity:0!important}.has-number .number-container{position:relative;display:flex;justify-content:center;align-items:center;right:4px;pointer-events:none}.has-number .number-buttons{display:flex;gap:4px;position:absolute;right:0;justify-content:center;align-items:center;opacity:0;transition:opacity .2s ease-in-out;pointer-events:none}.has-number .plus-icon,.has-number .minus-icon{cursor:pointer;pointer-events:none}.has-number:has(.app-input:focus-visible){cursor:text}.has-number:has(.app-input:focus-visible) .number-buttons{opacity:1}.has-number:has(.app-input:focus-visible) .plus-icon{pointer-events:auto}.has-number:has(.app-input:focus-visible) .minus-icon{pointer-events:auto}.has-number:has(.app-input:focus-visible) .cancel-icon{opacity:0!important;pointer-events:none!important}.has-number:has(.app-input:focus-visible) .number-container{width:60px}.has-dropdown .dropdown-menu{width:100%;background-color:#2f2f2f;border:0;border-radius:3px;padding:4px;margin-top:4px;max-height:244px;overflow-y:auto}.has-dropdown .dropdown-menu::-webkit-scrollbar{background-color:#2f2f2f;border-radius:0 3px 3px 0;width:6px}.has-dropdown .dropdown-menu::-webkit-scrollbar-thumb{background-color:#919191;width:2px;border:2px solid #2f2f2f;border-radius:3px}.has-dropdown .dropdown-item{color:#fff;font-weight:400;font-size:14px;line-height:18px;height:26px;padding:4px;transition:background-color .2s ease-in-out;border-radius:2px;position:relative}.has-dropdown .dropdown-item:hover{background-color:#424242}.has-dropdown .dropdown-item:focus-visible{background-color:#424242;border:0;outline:none}.has-dropdown .dropdown-item:not(:first-child){margin-top:4px}.has-dropdown .no-results{color:#919191;font-weight:700}.has-dropdown .selected{font-weight:700}.has-dropdown .selected .dropdown-item-icon{opacity:1}.has-dropdown .dropdown-item-icon{position:absolute;opacity:0;right:6px;top:50%;transform:translateY(-50%);color:#92b1f5}.has-dropdown .app-input-icon{right:26px}.has-dropdown .icon-container{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:18px;height:18px;display:grid;place-items:center;pointer-events:none}.has-dropdown .dropdown-icon{transition:transform .1s ease-in-out,color .2s ease-in-out!important;transform:rotate(0)}.has-dropdown:has(.app-input:focus-visible) .dropdown-icon{transform:rotate(180deg)}.has-right .app-input{text-align:right}.has-right .positive-icon,.has-right .app-input-icon{left:4px;right:auto}.has-right .app-input{order:1}.has-right.has-icon .app-input,.has-right.has-password .app-input{padding-right:0!important}.has-right.has-icon .app-input-label,.has-right.has-password .app-input-label{left:0!important}.has-right.has-icon .icon-container,.has-right.has-password .icon-container{width:30px;padding-left:4px}.has-right.has-icon .icon-container .icon,.has-right.has-password .icon-container .icon{order:2}.has-right.has-dropdown .app-input-icon{left:26px}.has-right.has-dropdown .icon-container{left:4px}.has-right:has(.app-input:placeholder-shown) .warning-icon{display:none!important}.has-right.has-number .separator{order:3}.has-right.has-number .number-buttons{left:0;right:unset}.has-right.has-number .number-container{left:4px;right:unset}.has-right .icon-container{order:2;margin-right:4px}.has-right .icon-container .password-icons{order:2}:host ::ng-deep .highlight{background-color:#3b73ed33!important;color:#92b1f5!important}:host ::ng-deep .selected .highlight{background-color:transparent!important;color:#fff!important}\n"] }]
905
+ }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
906
+ type: Optional
907
+ }, {
908
+ type: Self
909
+ }] }], propDecorators: { inputRef: [{
910
+ type: ViewChild,
911
+ args: ['inputRef']
912
+ }], PasswordDirective: [{
913
+ type: ViewChild,
914
+ args: [PasswordDirective]
915
+ }], NumberFormatDirective: [{
916
+ type: ViewChild,
917
+ args: [NumberFormatDirective]
918
+ }], dropdown: [{
919
+ type: ViewChild,
920
+ args: ['dropdown']
921
+ }], onRealValueChange: [{
922
+ type: HostListener,
923
+ args: ['realValueChange', ['$event']]
924
+ }] } });
925
+
926
+ // src/app/bytes-to-human-readable.pipe.ts
927
+ class BytesToHumanReadablePipe {
928
+ transform(bytes, precision = 2) {
929
+ if (bytes === null || bytes === undefined || isNaN(bytes)) {
930
+ return '';
931
+ }
932
+ if (bytes === 0) {
933
+ return '0 Bytes';
934
+ }
935
+ const units = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
936
+ const i = Math.floor(Math.log(bytes) / Math.log(1024));
937
+ const unitIndex = Math.min(i, units.length - 1);
938
+ const value = bytes / Math.pow(1024, unitIndex);
939
+ const formattedValue = parseFloat(value.toFixed(precision));
940
+ return `${formattedValue} ${units[unitIndex]}`;
941
+ }
942
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BytesToHumanReadablePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
943
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.14", ngImport: i0, type: BytesToHumanReadablePipe, isStandalone: true, name: "bytesToHumanReadable" });
944
+ }
945
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: BytesToHumanReadablePipe, decorators: [{
946
+ type: Pipe,
947
+ args: [{
948
+ name: 'bytesToHumanReadable',
949
+ }]
950
+ }] });
951
+
952
+ /**
953
+ * This component displays a preview of a document, including its name, size,
954
+ * and provides actions to delete, download, and tag the document.
955
+ */
956
+ class DocumentPreviewComponent {
957
+ showDeleteModal = signal(false);
958
+ /**
959
+ * The application file to be displayed in the preview. This is a required input.
960
+ * @type {InputSignal<AppFile>}
961
+ */
962
+ file = input.required();
963
+ /**
964
+ * An output event that emits the file name when the delete action is triggered.
965
+ * @type {OutputEmitterRef<string>}
966
+ */
967
+ onDelete = output();
968
+ /**
969
+ * An output event that emits the file name when the download action is triggered.
970
+ * @type {OutputEmitterRef<string>}
971
+ */
972
+ onDownload = output();
973
+ /**
974
+ * Handles the delete action. Emits the `fileName` of the current `file` via the `onDelete` output.
975
+ */
976
+ handleDelete() {
977
+ this.showDeleteModal.set(true);
978
+ }
979
+ /**
980
+ * Handles the download action. Emits the `fileName` of the current `file` via the `onDownload` output.
981
+ */
982
+ handleDownload() {
983
+ this.onDownload.emit(this.file().fileName);
984
+ }
985
+ /**
986
+ * Handles the tag action. Currently, it logs a message to the console.
987
+ * A "TODO" indicates that further logic for tagging needs to be implemented here.
988
+ */
989
+ handleTag() {
990
+ console.log('Tag event');
991
+ // TODO: Add tag logic
992
+ }
993
+ cancelDelete() {
994
+ this.showDeleteModal.set(false);
995
+ }
996
+ confirmDelete() {
997
+ this.onDelete.emit(this.file().fileName);
998
+ this.showDeleteModal.set(false);
999
+ }
1000
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentPreviewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1001
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentPreviewComponent, isStandalone: true, selector: "app-document-preview", inputs: { file: { classPropertyName: "file", publicName: "file", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { onDelete: "onDelete", onDownload: "onDownload" }, ngImport: i0, template: "@let fileType = file().type; @let documentName = file().baseName; @let fileSize\n= file().size; @let pdf = fileType === 'pdf'; @let video = ['avi', 'mp4',\n'mov'].includes(fileType); @let image = ['jpg', 'png', 'jpeg',\n'gif'].includes(fileType); @let pageCount = file().pageCount; @let\nimagePreviewUrl = file().imagePreviewUrl;\n\n<div class=\"document\" [class.noTouch]=\"showDeleteModal()\"> \n <div class=\"document-image-container\">\n <img src=\"{{ imagePreviewUrl }}\" class=\"document-image\" />\n <div class=\"badge-tag-container\">\n <div class=\"badges\">\n <p class=\"tag\">No Tag</p>\n </div>\n <div class=\"badges\">\n <p\n class=\"badge file-type\"\n [class]=\"{\n pdf: pdf,\n video: video,\n image: image\n }\"\n >\n {{ fileType }}\n </p>\n <p class=\"badge\">\n @if(pdf && pageCount) {\n <span>{{ pageCount }} p.</span>\n }\n <span class=\"file-size\"> {{ fileSize | bytesToHumanReadable }}</span>\n </p>\n </div>\n </div>\n </div>\n <p class=\"document-name\">\n {{ documentName }}\n </p>\n <div class=\"document-actions\">\n <div class=\"document-actions-container\">\n <button class=\"document-actions-button\" (click)=\"handleTag()\">\n <svg-icon name=\"label\" class=\"icon\"></svg-icon>\n </button>\n </div>\n <div class=\"document-actions-container\">\n <button class=\"document-actions-button\" (click)=\"handleDownload()\">\n <svg-icon name=\"download\" class=\"icon\"></svg-icon>\n </button>\n <button class=\"document-actions-button\" (click)=\"handleDelete()\">\n <svg-icon name=\"delete\" class=\"icon\"></svg-icon>\n </button>\n </div>\n </div>\n <div class=\"delete-modal\">\n <div class=\"modal-buttons\">\n <button class=\"delete-button\" (click)=\"confirmDelete()\">Delete</button>\n <button class=\"cancel-button\" (click)=\"cancelDelete()\">Cancel</button>\n </div>\n </div>\n</div>\n\n\n", styles: [".document-image{height:140px;margin:auto;object-fit:cover;box-shadow:0 0 4px #00000026;max-width:140px}.document-image-container{position:relative}.badge-tag-container{position:absolute;bottom:0}.badges{display:flex;gap:2px}.badges:first-child{margin-bottom:2px}.file-type{text-transform:uppercase}.badge,.tag{font-size:11px;font-weight:800;color:#fff;line-height:14px;padding:2px 4px;border-radius:1px;transition:opacity .2s ease-in-out;text-align:center;background-color:#91919166;transition:background-color .2s ease-in-out}.tag{font-weight:700}.pdf{background-color:#df3c3c66}.video{background-color:#9e47ec66}.image{background-color:#f89b2e66}.document{height:178px;width:148px;padding:4px;background-color:#eee;border-radius:2px;position:relative;opacity:1}.document:hover:not(.noTouch) .badge,.document:hover:not(.noTouch) .tag{background-color:#919191}.document:hover:not(.noTouch) .pdf{background-color:#e66767}.document:hover:not(.noTouch) .video{background-color:#b370f0}.document:hover:not(.noTouch) .image{background-color:#fab15c}.document:hover:not(.noTouch) .document-actions{opacity:1}.document-name{width:140px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;color:#2f2f2f;font-size:14px;line-height:18px;padding:4px 6px;margin-top:4px}.file-size{font-weight:600}.icon{width:18px;height:18px}.document-actions{display:flex;justify-content:space-between;align-items:center;position:absolute;top:4px;left:4px;width:140px;opacity:0;transition:opacity .2s ease-in-out}.document-actions-container{background-color:#6c6c6ce5;border-radius:1px;display:flex}.document-actions-button{background-color:transparent;border:none;height:30px;width:30px;padding:0;display:grid;place-items:center;cursor:pointer;color:#dadada}.delete-modal{position:absolute;top:50%;left:0;transform:translateY(-50%);pointer-events:none;transition:opacity .2s ease;width:100%;height:100%;opacity:0;display:flex;align-items:center;justify-content:center}.document.noTouch{pointer-events:none}.document.noTouch>*:not(.delete-modal){opacity:.3}.document.noTouch .delete-modal{opacity:1!important;pointer-events:auto!important;z-index:10}.modal-buttons{display:flex;align-items:center;flex-direction:column;gap:6px}.modal-buttons button{border-radius:2px;font-weight:500;padding:6px;vertical-align:middle;color:#fff;cursor:pointer}.delete-button{background-color:#df3c3c}.cancel-button{background-color:#6c6c6c}\n"], dependencies: [{ kind: "component", type: SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "svgClass", "class", "viewBox", "svgAriaLabel", "onSVGLoaded", "svgStyle"] }, { kind: "pipe", type: BytesToHumanReadablePipe, name: "bytesToHumanReadable" }] });
1002
+ }
1003
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentPreviewComponent, decorators: [{
1004
+ type: Component,
1005
+ args: [{ selector: 'app-document-preview', imports: [SvgIconComponent, BytesToHumanReadablePipe], template: "@let fileType = file().type; @let documentName = file().baseName; @let fileSize\n= file().size; @let pdf = fileType === 'pdf'; @let video = ['avi', 'mp4',\n'mov'].includes(fileType); @let image = ['jpg', 'png', 'jpeg',\n'gif'].includes(fileType); @let pageCount = file().pageCount; @let\nimagePreviewUrl = file().imagePreviewUrl;\n\n<div class=\"document\" [class.noTouch]=\"showDeleteModal()\"> \n <div class=\"document-image-container\">\n <img src=\"{{ imagePreviewUrl }}\" class=\"document-image\" />\n <div class=\"badge-tag-container\">\n <div class=\"badges\">\n <p class=\"tag\">No Tag</p>\n </div>\n <div class=\"badges\">\n <p\n class=\"badge file-type\"\n [class]=\"{\n pdf: pdf,\n video: video,\n image: image\n }\"\n >\n {{ fileType }}\n </p>\n <p class=\"badge\">\n @if(pdf && pageCount) {\n <span>{{ pageCount }} p.</span>\n }\n <span class=\"file-size\"> {{ fileSize | bytesToHumanReadable }}</span>\n </p>\n </div>\n </div>\n </div>\n <p class=\"document-name\">\n {{ documentName }}\n </p>\n <div class=\"document-actions\">\n <div class=\"document-actions-container\">\n <button class=\"document-actions-button\" (click)=\"handleTag()\">\n <svg-icon name=\"label\" class=\"icon\"></svg-icon>\n </button>\n </div>\n <div class=\"document-actions-container\">\n <button class=\"document-actions-button\" (click)=\"handleDownload()\">\n <svg-icon name=\"download\" class=\"icon\"></svg-icon>\n </button>\n <button class=\"document-actions-button\" (click)=\"handleDelete()\">\n <svg-icon name=\"delete\" class=\"icon\"></svg-icon>\n </button>\n </div>\n </div>\n <div class=\"delete-modal\">\n <div class=\"modal-buttons\">\n <button class=\"delete-button\" (click)=\"confirmDelete()\">Delete</button>\n <button class=\"cancel-button\" (click)=\"cancelDelete()\">Cancel</button>\n </div>\n </div>\n</div>\n\n\n", styles: [".document-image{height:140px;margin:auto;object-fit:cover;box-shadow:0 0 4px #00000026;max-width:140px}.document-image-container{position:relative}.badge-tag-container{position:absolute;bottom:0}.badges{display:flex;gap:2px}.badges:first-child{margin-bottom:2px}.file-type{text-transform:uppercase}.badge,.tag{font-size:11px;font-weight:800;color:#fff;line-height:14px;padding:2px 4px;border-radius:1px;transition:opacity .2s ease-in-out;text-align:center;background-color:#91919166;transition:background-color .2s ease-in-out}.tag{font-weight:700}.pdf{background-color:#df3c3c66}.video{background-color:#9e47ec66}.image{background-color:#f89b2e66}.document{height:178px;width:148px;padding:4px;background-color:#eee;border-radius:2px;position:relative;opacity:1}.document:hover:not(.noTouch) .badge,.document:hover:not(.noTouch) .tag{background-color:#919191}.document:hover:not(.noTouch) .pdf{background-color:#e66767}.document:hover:not(.noTouch) .video{background-color:#b370f0}.document:hover:not(.noTouch) .image{background-color:#fab15c}.document:hover:not(.noTouch) .document-actions{opacity:1}.document-name{width:140px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;color:#2f2f2f;font-size:14px;line-height:18px;padding:4px 6px;margin-top:4px}.file-size{font-weight:600}.icon{width:18px;height:18px}.document-actions{display:flex;justify-content:space-between;align-items:center;position:absolute;top:4px;left:4px;width:140px;opacity:0;transition:opacity .2s ease-in-out}.document-actions-container{background-color:#6c6c6ce5;border-radius:1px;display:flex}.document-actions-button{background-color:transparent;border:none;height:30px;width:30px;padding:0;display:grid;place-items:center;cursor:pointer;color:#dadada}.delete-modal{position:absolute;top:50%;left:0;transform:translateY(-50%);pointer-events:none;transition:opacity .2s ease;width:100%;height:100%;opacity:0;display:flex;align-items:center;justify-content:center}.document.noTouch{pointer-events:none}.document.noTouch>*:not(.delete-modal){opacity:.3}.document.noTouch .delete-modal{opacity:1!important;pointer-events:auto!important;z-index:10}.modal-buttons{display:flex;align-items:center;flex-direction:column;gap:6px}.modal-buttons button{border-radius:2px;font-weight:500;padding:6px;vertical-align:middle;color:#fff;cursor:pointer}.delete-button{background-color:#df3c3c}.cancel-button{background-color:#6c6c6c}\n"] }]
1006
+ }] });
1007
+
1008
+ pdfjsLib.GlobalWorkerOptions.workerSrc = '/pdfjs/pdf.worker.min.mjs';
1009
+ class DocumentService {
1010
+ /**
1011
+ * Generates a data URL thumbnail for a given file.
1012
+ * Handles PDFs, videos, and images.
1013
+ * @param file The file to generate a thumbnail for.
1014
+ * @returns A promise that resolves to a data URL string for the thumbnail.
1015
+ */
1016
+ async generateThumbnail(file) {
1017
+ const extension = file.name.split('.').pop()?.toLowerCase();
1018
+ switch (extension) {
1019
+ case 'pdf':
1020
+ try {
1021
+ return await this.generatePdfThumbnail(file);
1022
+ }
1023
+ catch (error) {
1024
+ console.error('Error generating PDF thumbnail:', error);
1025
+ return '/assets/exampledoc.png';
1026
+ }
1027
+ case 'mp4':
1028
+ case 'mov':
1029
+ case 'avi':
1030
+ try {
1031
+ return await this.generateVideoThumbnail(file);
1032
+ }
1033
+ catch (error) {
1034
+ console.error('Error generating video thumbnail:', error);
1035
+ return '/assets/truck.png';
1036
+ }
1037
+ case 'jpg':
1038
+ case 'jpeg':
1039
+ case 'png':
1040
+ case 'gif':
1041
+ return URL.createObjectURL(file);
1042
+ default:
1043
+ return '/assets/exampledoc.png';
1044
+ }
1045
+ }
1046
+ generatePdfThumbnail(file) {
1047
+ const fileReader = new FileReader();
1048
+ return new Promise((resolve, reject) => {
1049
+ fileReader.onload = async () => {
1050
+ const typedArray = new Uint8Array(fileReader.result);
1051
+ try {
1052
+ const pdf = await pdfjsLib.getDocument(typedArray).promise;
1053
+ const page = await pdf.getPage(1);
1054
+ const viewport = page.getViewport({ scale: 1 });
1055
+ const canvas = document.createElement('canvas');
1056
+ const context = canvas.getContext('2d');
1057
+ const desiredWidth = 280;
1058
+ const scale = desiredWidth / viewport.width;
1059
+ const scaledViewport = page.getViewport({ scale });
1060
+ canvas.height = scaledViewport.height;
1061
+ canvas.width = scaledViewport.width;
1062
+ if (!context) {
1063
+ return reject('Could not get canvas context');
1064
+ }
1065
+ await page.render({ canvasContext: context, viewport: scaledViewport })
1066
+ .promise;
1067
+ resolve(canvas.toDataURL('image/png'));
1068
+ }
1069
+ catch (error) {
1070
+ reject(error);
1071
+ }
1072
+ };
1073
+ fileReader.onerror = () => reject(fileReader.error);
1074
+ fileReader.readAsArrayBuffer(file);
1075
+ });
1076
+ }
1077
+ generateVideoThumbnail(file) {
1078
+ return new Promise((resolve, reject) => {
1079
+ const video = document.createElement('video');
1080
+ const canvas = document.createElement('canvas');
1081
+ const context = canvas.getContext('2d');
1082
+ video.autoplay = true;
1083
+ video.muted = true;
1084
+ video.src = URL.createObjectURL(file);
1085
+ video.onloadeddata = () => {
1086
+ video.currentTime = Math.min(0.1, video.duration / 2);
1087
+ };
1088
+ video.onseeked = () => {
1089
+ const desiredWidth = 280;
1090
+ const scale = desiredWidth / video.videoWidth;
1091
+ canvas.width = desiredWidth;
1092
+ canvas.height = video.videoHeight * scale;
1093
+ if (context) {
1094
+ context.drawImage(video, 0, 0, canvas.width, canvas.height);
1095
+ video.pause();
1096
+ URL.revokeObjectURL(video.src);
1097
+ resolve(canvas.toDataURL('image/png'));
1098
+ }
1099
+ else {
1100
+ reject('Could not get canvas context for video thumbnail');
1101
+ }
1102
+ };
1103
+ video.onerror = (e) => {
1104
+ URL.revokeObjectURL(video.src);
1105
+ reject('Error loading video for thumbnail: ' + e);
1106
+ };
1107
+ });
1108
+ }
1109
+ /**
1110
+ * Reads a PDF file and returns the total number of pages.
1111
+ *
1112
+ * @param file The PDF Blob or File.
1113
+ * @returns A promise that resolves to the page count (number).
1114
+ * @throws If the file is not a valid PDF or an error occurs during processing.
1115
+ */
1116
+ async getPdfPageCount(file) {
1117
+ const fileReader = new FileReader();
1118
+ return new Promise((resolve, reject) => {
1119
+ fileReader.onload = async () => {
1120
+ const typedArray = new Uint8Array(fileReader.result);
1121
+ try {
1122
+ const pdf = await pdfjsLib.getDocument(typedArray).promise;
1123
+ resolve(pdf.numPages);
1124
+ }
1125
+ catch (error) {
1126
+ console.error('Error getting PDF page count:', error);
1127
+ reject(new Error('Failed to load PDF or get page count.'));
1128
+ }
1129
+ };
1130
+ fileReader.onerror = () => {
1131
+ reject(new Error('FileReader error during PDF page count operation.'));
1132
+ };
1133
+ fileReader.readAsArrayBuffer(file);
1134
+ });
1135
+ }
1136
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1137
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentService, providedIn: 'root' });
1138
+ }
1139
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentService, decorators: [{
1140
+ type: Injectable,
1141
+ args: [{
1142
+ providedIn: 'root',
1143
+ }]
1144
+ }] });
1145
+
1146
+ /**
1147
+ * A component that provides a user interface for file uploading via
1148
+ * drag-and-drop or a file input dialog. It displays previews of the
1149
+ * selected files in a carousel.
1150
+ */
1151
+ class DropZoneComponent {
1152
+ /**
1153
+ * Injects the DocumentService for file processing tasks like
1154
+ * thumbnail generation and PDF page counting.
1155
+ * @private
1156
+ */
1157
+ documentService = inject(DocumentService);
1158
+ /**
1159
+ * An array of file extensions that should be excluded from the supported list.
1160
+ * @defaultValue `[]` (an empty array)
1161
+ * @type {FileExtension[]}
1162
+ */
1163
+ excludedFileTypes = input([]);
1164
+ /**
1165
+ * The base array of all file extensions that are generally allowed.
1166
+ * Supported file types will be derived from this list, after excluding
1167
+ * any types specified in `excludedFileTypes`.
1168
+ *
1169
+ * @defaultValue `['avi', 'mov', 'mp4', 'pdf', 'gif', 'png', 'jpg', 'jpeg']`
1170
+ * @type {FileExtension[]}
1171
+ */
1172
+ fileTypes = input([
1173
+ 'pdf',
1174
+ 'png',
1175
+ 'jpg',
1176
+ 'jpeg',
1177
+ 'gif',
1178
+ 'avi',
1179
+ 'mov',
1180
+ 'mp4',
1181
+ ]);
1182
+ /**
1183
+ * A computed signal that derives the list of currently supported file extensions.
1184
+ * It filters the base `fileTypes` array, removing any extensions present
1185
+ * in the `excludedFileTypes` input.
1186
+ */
1187
+ supportedFileTypes = computed(() => [
1188
+ ...this.fileTypes().filter((type) => !this.excludedFileTypes().includes(type)),
1189
+ ]);
1190
+ /**
1191
+ * A signal that holds an array of `AppFile` objects representing the files
1192
+ * that have been selected or dropped by the user.
1193
+ */
1194
+ docs = signal([]);
1195
+ /**
1196
+ * A signal that acts as a boolean flag. It is set to `true` when the user
1197
+ * attempts to upload a file with an unsupported extension.
1198
+ */
1199
+ unsupported = signal(false);
1200
+ /**
1201
+ * Handles the 'change' event from the hidden file input. It extracts the
1202
+ * selected files and passes them to the `processFiles` method.
1203
+ * @param event The `Event` object from the file input element.
1204
+ */
1205
+ onInput(event) {
1206
+ const target = event.target;
1207
+ const files = target.files;
1208
+ this.processFiles(files);
1209
+ }
1210
+ /**
1211
+ * Handles the 'drop' event on the component. It prevents the browser's
1212
+ * default file handling, extracts the dropped files, and passes them to
1213
+ * the `processFiles` method.
1214
+ * @param event The `DragEvent` object containing the dropped files.
1215
+ */
1216
+ onDrop(event) {
1217
+ event.preventDefault();
1218
+ const files = event.dataTransfer?.files;
1219
+ this.processFiles(files);
1220
+ }
1221
+ /**
1222
+ * Asynchronously processes a list of files. For each file, it validates
1223
+ * the extension against `supportedFileTypes`. If valid, it generates a
1224
+ * thumbnail, counts pages for PDFs, creates an `AppFile` object, and adds
1225
+ * it to the `docs` signal. If any file is unsupported, the `unsupported`
1226
+ * flag is set.
1227
+ * @param files The `FileList` object to be processed.
1228
+ */
1229
+ async processFiles(files) {
1230
+ this.unsupported.set(false);
1231
+ for (let i = 0; i < files.length; i++) {
1232
+ const file = files[i];
1233
+ const fileExtension = file.name.split('.').pop()?.toLowerCase();
1234
+ if (!fileExtension ||
1235
+ !this.supportedFileTypes().includes(fileExtension)) {
1236
+ this.unsupported.set(true);
1237
+ continue;
1238
+ }
1239
+ let pageCount;
1240
+ if (fileExtension === 'pdf') {
1241
+ try {
1242
+ pageCount = await this.documentService.getPdfPageCount(file);
1243
+ }
1244
+ catch (error) {
1245
+ console.error(`Failed to get page count for ${file.name}:`, error);
1246
+ }
1247
+ }
1248
+ const imagePreviewUrl = await this.documentService.generateThumbnail(file);
1249
+ const filePreview = {
1250
+ fileName: file.name,
1251
+ baseName: file.name.split('.').slice(0, -1).join('.'),
1252
+ type: fileExtension,
1253
+ size: file.size,
1254
+ imagePreviewUrl: imagePreviewUrl,
1255
+ file: file,
1256
+ pageCount: pageCount,
1257
+ };
1258
+ this.docs.update((docs) => [...docs, filePreview]);
1259
+ if (this.docs().length > 2) {
1260
+ this.carouselIndex.set(this.docs().length - 2);
1261
+ }
1262
+ }
1263
+ }
1264
+ /**
1265
+ * Handles the download action for a specific file.
1266
+ * Note: This is a placeholder and currently only logs the file name.
1267
+ * @param fileName The name of the file to be downloaded.
1268
+ */
1269
+ handleDownload(fileName) {
1270
+ console.log(fileName);
1271
+ }
1272
+ /**
1273
+ * A ViewChild reference to the native `<input type='file'>` element.
1274
+ * Used to programmatically trigger the file selection dialog.
1275
+ */
1276
+ inputRef;
1277
+ /**
1278
+ * Resets the component's state after an unsupported file type error
1279
+ * by setting the `unsupported` signal to `false`.
1280
+ */
1281
+ cancel() {
1282
+ this.unsupported.set(false);
1283
+ }
1284
+ /**
1285
+ * Programmatically triggers a click on the hidden file input element,
1286
+ * which opens the system's file selection dialog.
1287
+ */
1288
+ handleClickToAdd() {
1289
+ this.inputRef.nativeElement.click();
1290
+ }
1291
+ /**
1292
+ * Deletes a file from the preview list. It filters the `docs` array to
1293
+ * remove the specified file and adjusts the carousel position.
1294
+ * @param fileName The name of the file to be deleted.
1295
+ */
1296
+ handleDelete(fileName) {
1297
+ this.carouselLeft();
1298
+ this.docs.set(this.docs().filter((doc) => doc.fileName !== fileName));
1299
+ if (this.docs().length === 0) {
1300
+ this.unsupported.set(false);
1301
+ }
1302
+ }
1303
+ // Carousel logic
1304
+ /**
1305
+ * A signal that stores the current index for the file preview carousel.
1306
+ * This determines which part of the carousel is visible.
1307
+ */
1308
+ carouselIndex = signal(0);
1309
+ /**
1310
+ * A computed signal that calculates the CSS `translateX` value for the
1311
+ * carousel container. This creates the sliding effect based on the
1312
+ * `carouselIndex`.
1313
+ */
1314
+ carouselTransform = computed(() => {
1315
+ const offset = (148 + 6) * this.carouselIndex() * -1; // 148px width + 6px gap
1316
+ return `translateX(${offset}px)`;
1317
+ });
1318
+ /**
1319
+ * Navigates the carousel one step to the left by decrementing the
1320
+ * `carouselIndex`. The index will not go below 0.
1321
+ */
1322
+ carouselLeft() {
1323
+ this.carouselIndex.update((i) => Math.max(0, i - 1));
1324
+ }
1325
+ /**
1326
+ * Navigates the carousel one step to the right by incrementing the
1327
+ * `carouselIndex`. The index will not exceed the maximum possible value
1328
+ * based on the number of documents.
1329
+ */
1330
+ carouselRight() {
1331
+ const maxIndex = Math.max(0, this.docs().length - 2);
1332
+ this.carouselIndex.update((i) => Math.min(maxIndex, i + 1));
1333
+ }
1334
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropZoneComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1335
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DropZoneComponent, isStandalone: true, selector: "app-drop-zone", inputs: { excludedFileTypes: { classPropertyName: "excludedFileTypes", publicName: "excludedFileTypes", isSignal: true, isRequired: false, transformFunction: null }, fileTypes: { classPropertyName: "fileTypes", publicName: "fileTypes", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true }], ngImport: i0, template: "@let docCount = docs().length;\n\n<div class=\"container\">\n <!-- Carousel -->\n @if(docCount > 0) {\n <div class=\"docs\">\n <div class=\"doc-container\" [style.transform]=\"carouselTransform()\">\n @for (doc of docs(); track $index) {\n <app-document-preview\n class=\"doc\"\n [file]=\"doc\"\n (onDelete)=\"handleDelete($event)\"\n (onDownload)=\"handleDownload($event)\"\n ></app-document-preview>\n }\n </div>\n @if(docCount > 2) {\n <button class=\"carousel-button carousel-left\" (click)=\"carouselLeft()\">\n <svg-icon name=\"arrow-left\" class=\"arrow\"></svg-icon>\n </button>\n <button class=\"carousel-button carousel-right\" (click)=\"carouselRight()\">\n <svg-icon name=\"arrow-right\" class=\"arrow\"></svg-icon>\n </button>\n }\n </div>\n }\n\n <!-- Drop Zone -->\n <div\n class=\"drop-zone-container\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"$event.preventDefault()\"\n [class]=\"{\n 'more-docs': docCount >= 2,\n unsupported: unsupported()\n }\"\n >\n <!-- Drop Zone -->\n <div class=\"drop-zone\" (click)=\"handleClickToAdd()\">\n <svg-icon name=\"drop-zone\" class=\"illustration\"></svg-icon>\n <div class=\"drop-zone-text\">\n <p class=\"heading\">\n DRAG FILES @if (docCount < 1) {\n <span>HERE</span>\n }\n </p>\n <p class=\"subtext\">OR CLICK TO ADD</p>\n </div>\n <input\n type=\"file\"\n aria-hidden=\"true\"\n multiple\n class=\"drop-zone-input\"\n #inputRef\n (input)=\"onInput($event)\"\n />\n </div>\n\n <!-- Drop Zone Error -->\n <div class=\"drop-zone-error\">\n <div class=\"drop-zone-text\">\n <p class=\"heading invalid\">INVALID FILE TYPE</p>\n <p class=\"subtext\">SUPPORTED FORMATS</p>\n </div>\n <div class=\"file-types\">\n @for (type of supportedFileTypes(); track $index) {\n <p\n class=\"badge\"\n [class]=\"{\n pdf: type === 'pdf',\n video: ['avi', 'mp4', 'mov'].includes(type),\n image: ['jpg', 'png', 'jpeg', 'gif'].includes(type)\n }\"\n >\n {{ type }}\n </p>\n }\n </div>\n <button class=\"cancel-button\">\n <svg-icon name=\"cancel\" (click)=\"cancel()\"></svg-icon>\n </button>\n </div>\n </div>\n</div>\n", styles: [".container{padding:4px 6px;min-width:468px;display:flex;gap:6px}.docs{flex-shrink:0;height:100%;max-width:302px;overflow:hidden;position:relative;border-radius:2px}.doc-container{display:flex;gap:6px;transition:transform .2s ease-out}.carousel-button{position:absolute;top:50%;transform:translateY(-50%);width:24px;height:32px;background-color:#ffffffb2;border-radius:2px;box-shadow:0 0 5px #0000004d;cursor:pointer;display:grid;place-items:center;padding:0}.drop-zone-input{display:none}.carousel-left{left:4px}.carousel-right{right:4px}.arrow{width:18px;height:18px;color:#2f2f2f}.doc{flex:0 0 148px;height:178px;display:flex;background-color:#eee;border-radius:2px}.drop-zone-container{position:relative;flex:1 0 auto}.drop-zone{display:flex;justify-content:center;align-items:center;flex-direction:row;outline:4px dashed #eeeeee;border-radius:2px;padding:35px 0;margin:4px;gap:10px;transition:background-color .2s ease-in-out;cursor:pointer}.drop-zone:hover{background-color:#eee}.illustration{width:100px;height:100px}.more-docs .illustration{width:80px;height:80px}.more-docs .drop-zone{padding:22px 0;flex-direction:column}.more-docs .drop-zone-error,.more-docs .drop-zone-error .drop-zone-text{padding:0 12px}.unsupported .drop-zone-error{display:flex}.drop-zone-text{-webkit-user-select:none;user-select:none;text-align:center}.drop-zone-text .heading{color:#424242;font-size:14px;line-height:18px;font-weight:700;margin-bottom:4px}.drop-zone-text .invalid{color:#df3c3c}.drop-zone-text .subtext{color:#424242;font-size:11px;line-height:14px;font-weight:600}.drop-zone-error{position:absolute;inset:0;background-color:#fff;display:none;justify-content:center;align-items:center;flex-direction:column;margin:4px;outline:4px dashed #ed9292;border-radius:2px;padding:52px 12px;gap:12px}.drop-zone-error .cancel-button{cursor:pointer;background-color:transparent;position:absolute;top:0;right:0;height:26px;width:26px;padding:0;display:grid;place-items:center;transition:color .2s ease-in-out;color:#919191}.drop-zone-error .cancel-button:hover{color:#424242}.file-types{display:flex;gap:4px;text-transform:uppercase;max-width:100%;flex-wrap:wrap;justify-content:center}.badge{font-size:11px;font-weight:900;color:#fff;line-height:14px;padding:2px 4px;border-radius:1px;text-align:center;background-color:#919191}.pdf{background-color:#e66767}.video{background-color:#b370f0}.image{background-color:#fab15c}\n"], dependencies: [{ kind: "component", type: SvgIconComponent, selector: "svg-icon", inputs: ["src", "name", "stretch", "applyClass", "svgClass", "class", "viewBox", "svgAriaLabel", "onSVGLoaded", "svgStyle"] }, { kind: "component", type: DocumentPreviewComponent, selector: "app-document-preview", inputs: ["file"], outputs: ["onDelete", "onDownload"] }] });
1336
+ }
1337
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DropZoneComponent, decorators: [{
1338
+ type: Component,
1339
+ args: [{ selector: 'app-drop-zone', imports: [SvgIconComponent, DocumentPreviewComponent], template: "@let docCount = docs().length;\n\n<div class=\"container\">\n <!-- Carousel -->\n @if(docCount > 0) {\n <div class=\"docs\">\n <div class=\"doc-container\" [style.transform]=\"carouselTransform()\">\n @for (doc of docs(); track $index) {\n <app-document-preview\n class=\"doc\"\n [file]=\"doc\"\n (onDelete)=\"handleDelete($event)\"\n (onDownload)=\"handleDownload($event)\"\n ></app-document-preview>\n }\n </div>\n @if(docCount > 2) {\n <button class=\"carousel-button carousel-left\" (click)=\"carouselLeft()\">\n <svg-icon name=\"arrow-left\" class=\"arrow\"></svg-icon>\n </button>\n <button class=\"carousel-button carousel-right\" (click)=\"carouselRight()\">\n <svg-icon name=\"arrow-right\" class=\"arrow\"></svg-icon>\n </button>\n }\n </div>\n }\n\n <!-- Drop Zone -->\n <div\n class=\"drop-zone-container\"\n (drop)=\"onDrop($event)\"\n (dragover)=\"$event.preventDefault()\"\n [class]=\"{\n 'more-docs': docCount >= 2,\n unsupported: unsupported()\n }\"\n >\n <!-- Drop Zone -->\n <div class=\"drop-zone\" (click)=\"handleClickToAdd()\">\n <svg-icon name=\"drop-zone\" class=\"illustration\"></svg-icon>\n <div class=\"drop-zone-text\">\n <p class=\"heading\">\n DRAG FILES @if (docCount < 1) {\n <span>HERE</span>\n }\n </p>\n <p class=\"subtext\">OR CLICK TO ADD</p>\n </div>\n <input\n type=\"file\"\n aria-hidden=\"true\"\n multiple\n class=\"drop-zone-input\"\n #inputRef\n (input)=\"onInput($event)\"\n />\n </div>\n\n <!-- Drop Zone Error -->\n <div class=\"drop-zone-error\">\n <div class=\"drop-zone-text\">\n <p class=\"heading invalid\">INVALID FILE TYPE</p>\n <p class=\"subtext\">SUPPORTED FORMATS</p>\n </div>\n <div class=\"file-types\">\n @for (type of supportedFileTypes(); track $index) {\n <p\n class=\"badge\"\n [class]=\"{\n pdf: type === 'pdf',\n video: ['avi', 'mp4', 'mov'].includes(type),\n image: ['jpg', 'png', 'jpeg', 'gif'].includes(type)\n }\"\n >\n {{ type }}\n </p>\n }\n </div>\n <button class=\"cancel-button\">\n <svg-icon name=\"cancel\" (click)=\"cancel()\"></svg-icon>\n </button>\n </div>\n </div>\n</div>\n", styles: [".container{padding:4px 6px;min-width:468px;display:flex;gap:6px}.docs{flex-shrink:0;height:100%;max-width:302px;overflow:hidden;position:relative;border-radius:2px}.doc-container{display:flex;gap:6px;transition:transform .2s ease-out}.carousel-button{position:absolute;top:50%;transform:translateY(-50%);width:24px;height:32px;background-color:#ffffffb2;border-radius:2px;box-shadow:0 0 5px #0000004d;cursor:pointer;display:grid;place-items:center;padding:0}.drop-zone-input{display:none}.carousel-left{left:4px}.carousel-right{right:4px}.arrow{width:18px;height:18px;color:#2f2f2f}.doc{flex:0 0 148px;height:178px;display:flex;background-color:#eee;border-radius:2px}.drop-zone-container{position:relative;flex:1 0 auto}.drop-zone{display:flex;justify-content:center;align-items:center;flex-direction:row;outline:4px dashed #eeeeee;border-radius:2px;padding:35px 0;margin:4px;gap:10px;transition:background-color .2s ease-in-out;cursor:pointer}.drop-zone:hover{background-color:#eee}.illustration{width:100px;height:100px}.more-docs .illustration{width:80px;height:80px}.more-docs .drop-zone{padding:22px 0;flex-direction:column}.more-docs .drop-zone-error,.more-docs .drop-zone-error .drop-zone-text{padding:0 12px}.unsupported .drop-zone-error{display:flex}.drop-zone-text{-webkit-user-select:none;user-select:none;text-align:center}.drop-zone-text .heading{color:#424242;font-size:14px;line-height:18px;font-weight:700;margin-bottom:4px}.drop-zone-text .invalid{color:#df3c3c}.drop-zone-text .subtext{color:#424242;font-size:11px;line-height:14px;font-weight:600}.drop-zone-error{position:absolute;inset:0;background-color:#fff;display:none;justify-content:center;align-items:center;flex-direction:column;margin:4px;outline:4px dashed #ed9292;border-radius:2px;padding:52px 12px;gap:12px}.drop-zone-error .cancel-button{cursor:pointer;background-color:transparent;position:absolute;top:0;right:0;height:26px;width:26px;padding:0;display:grid;place-items:center;transition:color .2s ease-in-out;color:#919191}.drop-zone-error .cancel-button:hover{color:#424242}.file-types{display:flex;gap:4px;text-transform:uppercase;max-width:100%;flex-wrap:wrap;justify-content:center}.badge{font-size:11px;font-weight:900;color:#fff;line-height:14px;padding:2px 4px;border-radius:1px;text-align:center;background-color:#919191}.pdf{background-color:#e66767}.video{background-color:#b370f0}.image{background-color:#fab15c}\n"] }]
1340
+ }], propDecorators: { inputRef: [{
1341
+ type: ViewChild,
1342
+ args: ['inputRef']
1343
+ }] } });
1344
+
1345
+ /*
1346
+ * Public API Surface of ca-components
1347
+ */
1348
+
1349
+ /**
1350
+ * Generated bundle index. Do not edit.
1351
+ */
1352
+
1353
+ export { DropZoneComponent, InputComponent };
1354
+ //# sourceMappingURL=carriera-intern-components.mjs.map