@angular/aria 21.0.0-rc.0 → 21.0.0-rc.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.
Files changed (48) hide show
  1. package/_adev_assets/aria-accordion.json +14 -14
  2. package/_adev_assets/aria-combobox.json +10 -10
  3. package/_adev_assets/aria-grid.json +81 -12
  4. package/_adev_assets/aria-listbox.json +3 -3
  5. package/_adev_assets/aria-menu.json +174 -74
  6. package/_adev_assets/aria-tabs.json +22 -22
  7. package/_adev_assets/aria-toolbar.json +99 -120
  8. package/_adev_assets/aria-tree.json +20 -16
  9. package/fesm2022/_widget-chunk.mjs +266 -144
  10. package/fesm2022/_widget-chunk.mjs.map +1 -1
  11. package/fesm2022/accordion.mjs +12 -13
  12. package/fesm2022/accordion.mjs.map +1 -1
  13. package/fesm2022/aria.mjs +1 -1
  14. package/fesm2022/aria.mjs.map +1 -1
  15. package/fesm2022/combobox.mjs +9 -7
  16. package/fesm2022/combobox.mjs.map +1 -1
  17. package/fesm2022/grid.mjs +61 -12
  18. package/fesm2022/grid.mjs.map +1 -1
  19. package/fesm2022/listbox.mjs +14 -15
  20. package/fesm2022/listbox.mjs.map +1 -1
  21. package/fesm2022/menu.mjs +117 -61
  22. package/fesm2022/menu.mjs.map +1 -1
  23. package/fesm2022/private.mjs +390 -399
  24. package/fesm2022/private.mjs.map +1 -1
  25. package/fesm2022/tabs.mjs +16 -17
  26. package/fesm2022/tabs.mjs.map +1 -1
  27. package/fesm2022/toolbar.mjs +79 -44
  28. package/fesm2022/toolbar.mjs.map +1 -1
  29. package/fesm2022/tree.mjs +22 -19
  30. package/fesm2022/tree.mjs.map +1 -1
  31. package/package.json +2 -10
  32. package/types/_grid-chunk.d.ts +115 -53
  33. package/types/accordion.d.ts +4 -4
  34. package/types/combobox.d.ts +2 -2
  35. package/types/grid.d.ts +12 -3
  36. package/types/listbox.d.ts +3 -4
  37. package/types/menu.d.ts +33 -21
  38. package/types/private.d.ts +263 -341
  39. package/types/tabs.d.ts +4 -4
  40. package/types/toolbar.d.ts +29 -26
  41. package/types/tree.d.ts +5 -6
  42. package/_adev_assets/aria-radio-group.json +0 -389
  43. package/fesm2022/deferred-content.mjs +0 -99
  44. package/fesm2022/deferred-content.mjs.map +0 -1
  45. package/fesm2022/radio-group.mjs +0 -338
  46. package/fesm2022/radio-group.mjs.map +0 -1
  47. package/types/deferred-content.d.ts +0 -38
  48. package/types/radio-group.d.ts +0 -84
package/fesm2022/menu.mjs CHANGED
@@ -1,21 +1,31 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, output, computed, Directive, contentChildren, signal, afterRenderEffect, untracked, model } from '@angular/core';
3
- import { MenuTriggerPattern, MenuPattern, MenuBarPattern, MenuItemPattern } from '@angular/aria/private';
4
- import { toSignal } from '@angular/core/rxjs-interop';
2
+ import { inject, ElementRef, input, signal, computed, effect, Directive, contentChildren, output, afterRenderEffect, untracked, model } from '@angular/core';
3
+ import * as i1 from '@angular/aria/private';
4
+ import { MenuTriggerPattern, DeferredContentAware, MenuPattern, MenuBarPattern, MenuItemPattern, DeferredContent } from '@angular/aria/private';
5
+ import { _IdGenerator } from '@angular/cdk/a11y';
5
6
  import { Directionality } from '@angular/cdk/bidi';
6
7
 
7
8
  class MenuTrigger {
8
9
  _elementRef = inject(ElementRef);
10
+ textDirection = inject(Directionality).valueSignal;
9
11
  element = this._elementRef.nativeElement;
10
- submenu = input(undefined, ...(ngDevMode ? [{
11
- debugName: "submenu"
12
+ menu = input(undefined, ...(ngDevMode ? [{
13
+ debugName: "menu"
14
+ }] : []));
15
+ hasBeenFocused = signal(false, ...(ngDevMode ? [{
16
+ debugName: "hasBeenFocused"
12
17
  }] : []));
13
- onSubmit = output();
14
18
  _pattern = new MenuTriggerPattern({
15
- onSubmit: value => this.onSubmit.emit(value),
19
+ textDirection: this.textDirection,
16
20
  element: computed(() => this._elementRef.nativeElement),
17
- submenu: computed(() => this.submenu()?._pattern)
21
+ menu: computed(() => this.menu()?._pattern)
18
22
  });
23
+ constructor() {
24
+ effect(() => this.menu()?.parent.set(this));
25
+ }
26
+ onFocusIn() {
27
+ this.hasBeenFocused.set(true);
28
+ }
19
29
  static ɵfac = i0.ɵɵngDeclareFactory({
20
30
  minVersion: "12.0.0",
21
31
  version: "20.2.0-next.2",
@@ -31,28 +41,26 @@ class MenuTrigger {
31
41
  isStandalone: true,
32
42
  selector: "button[ngMenuTrigger]",
33
43
  inputs: {
34
- submenu: {
35
- classPropertyName: "submenu",
36
- publicName: "submenu",
44
+ menu: {
45
+ classPropertyName: "menu",
46
+ publicName: "menu",
37
47
  isSignal: true,
38
48
  isRequired: false,
39
49
  transformFunction: null
40
50
  }
41
51
  },
42
- outputs: {
43
- onSubmit: "onSubmit"
44
- },
45
52
  host: {
46
53
  listeners: {
47
54
  "click": "_pattern.onClick()",
48
55
  "keydown": "_pattern.onKeydown($event)",
49
- "focusout": "_pattern.onFocusOut($event)"
56
+ "focusout": "_pattern.onFocusOut($event)",
57
+ "focusin": "onFocusIn()"
50
58
  },
51
59
  properties: {
52
- "attr.tabindex": "_pattern.tabindex()",
60
+ "attr.tabindex": "_pattern.tabIndex()",
53
61
  "attr.aria-haspopup": "_pattern.hasPopup()",
54
62
  "attr.aria-expanded": "_pattern.expanded()",
55
- "attr.aria-controls": "_pattern.submenu()?.id()"
63
+ "attr.aria-controls": "_pattern.menu()?.id()"
56
64
  },
57
65
  classAttribute: "ng-menu-trigger"
58
66
  },
@@ -72,18 +80,23 @@ i0.ɵɵngDeclareClassMetadata({
72
80
  exportAs: 'ngMenuTrigger',
73
81
  host: {
74
82
  'class': 'ng-menu-trigger',
75
- '[attr.tabindex]': '_pattern.tabindex()',
83
+ '[attr.tabindex]': '_pattern.tabIndex()',
76
84
  '[attr.aria-haspopup]': '_pattern.hasPopup()',
77
85
  '[attr.aria-expanded]': '_pattern.expanded()',
78
- '[attr.aria-controls]': '_pattern.submenu()?.id()',
86
+ '[attr.aria-controls]': '_pattern.menu()?.id()',
79
87
  '(click)': '_pattern.onClick()',
80
88
  '(keydown)': '_pattern.onKeydown($event)',
81
- '(focusout)': '_pattern.onFocusOut($event)'
89
+ '(focusout)': '_pattern.onFocusOut($event)',
90
+ '(focusin)': 'onFocusIn()'
82
91
  }
83
92
  }]
84
- }]
93
+ }],
94
+ ctorParameters: () => []
85
95
  });
86
96
  class Menu {
97
+ _deferredContentAware = inject(DeferredContentAware, {
98
+ optional: true
99
+ });
87
100
  _allItems = contentChildren(MenuItem, ...(ngDevMode ? [{
88
101
  debugName: "_allItems",
89
102
  descendants: true
@@ -95,14 +108,8 @@ class Menu {
95
108
  }] : []));
96
109
  _elementRef = inject(ElementRef);
97
110
  element = this._elementRef.nativeElement;
98
- _directionality = inject(Directionality);
99
- textDirection = toSignal(this._directionality.change, {
100
- initialValue: this._directionality.value
101
- });
102
- submenu = input(undefined, ...(ngDevMode ? [{
103
- debugName: "submenu"
104
- }] : []));
105
- id = input(Math.random().toString(36).substring(2, 10), ...(ngDevMode ? [{
111
+ textDirection = inject(Directionality).valueSignal;
112
+ id = input(inject(_IdGenerator).getId('ng-menu-', true), ...(ngDevMode ? [{
106
113
  debugName: "id"
107
114
  }] : []));
108
115
  wrap = input(true, ...(ngDevMode ? [{
@@ -111,7 +118,7 @@ class Menu {
111
118
  typeaheadDelay = input(0.5, ...(ngDevMode ? [{
112
119
  debugName: "typeaheadDelay"
113
120
  }] : []));
114
- parent = input(...(ngDevMode ? [undefined, {
121
+ parent = signal(undefined, ...(ngDevMode ? [{
115
122
  debugName: "parent"
116
123
  }] : []));
117
124
  _pattern;
@@ -119,19 +126,27 @@ class Menu {
119
126
  isVisible = computed(() => this._pattern.isVisible(), ...(ngDevMode ? [{
120
127
  debugName: "isVisible"
121
128
  }] : []));
122
- onSubmit = output();
129
+ onSelect = output();
123
130
  constructor() {
124
131
  this._pattern = new MenuPattern({
125
132
  ...this,
126
133
  parent: computed(() => this.parent()?._pattern),
127
134
  multi: () => false,
128
- skipDisabled: () => false,
135
+ softDisabled: () => true,
129
136
  focusMode: () => 'roving',
130
137
  orientation: () => 'vertical',
131
138
  selectionMode: () => 'explicit',
132
139
  activeItem: signal(undefined),
133
140
  element: computed(() => this._elementRef.nativeElement),
134
- onSubmit: value => this.onSubmit.emit(value)
141
+ onSelect: value => this.onSelect.emit(value)
142
+ });
143
+ afterRenderEffect(() => {
144
+ const parent = this.parent();
145
+ if (parent instanceof MenuItem && parent.parent instanceof MenuBar) {
146
+ this._deferredContentAware?.contentVisible.set(true);
147
+ } else {
148
+ this._deferredContentAware?.contentVisible.set(this._pattern.isVisible() || !!this.parent()?.hasBeenFocused());
149
+ }
135
150
  });
136
151
  afterRenderEffect(() => {
137
152
  if (this._pattern.isVisible()) {
@@ -172,13 +187,6 @@ class Menu {
172
187
  isStandalone: true,
173
188
  selector: "[ngMenu]",
174
189
  inputs: {
175
- submenu: {
176
- classPropertyName: "submenu",
177
- publicName: "submenu",
178
- isSignal: true,
179
- isRequired: false,
180
- transformFunction: null
181
- },
182
190
  id: {
183
191
  classPropertyName: "id",
184
192
  publicName: "id",
@@ -199,17 +207,10 @@ class Menu {
199
207
  isSignal: true,
200
208
  isRequired: false,
201
209
  transformFunction: null
202
- },
203
- parent: {
204
- classPropertyName: "parent",
205
- publicName: "parent",
206
- isSignal: true,
207
- isRequired: false,
208
- transformFunction: null
209
210
  }
210
211
  },
211
212
  outputs: {
212
- onSubmit: "onSubmit"
213
+ onSelect: "onSelect"
213
214
  },
214
215
  host: {
215
216
  attributes: {
@@ -236,6 +237,10 @@ class Menu {
236
237
  isSignal: true
237
238
  }],
238
239
  exportAs: ["ngMenu"],
240
+ hostDirectives: [{
241
+ directive: i1.DeferredContentAware,
242
+ inputs: ["preserveContent", "preserveContent"]
243
+ }],
239
244
  ngImport: i0
240
245
  });
241
246
  }
@@ -260,7 +265,11 @@ i0.ɵɵngDeclareClassMetadata({
260
265
  '(focusout)': '_pattern.onFocusOut($event)',
261
266
  '(focusin)': '_pattern.onFocusIn()',
262
267
  '(click)': '_pattern.onClick($event)'
263
- }
268
+ },
269
+ hostDirectives: [{
270
+ directive: DeferredContentAware,
271
+ inputs: ['preserveContent']
272
+ }]
264
273
  }]
265
274
  }],
266
275
  ctorParameters: () => []
@@ -275,10 +284,7 @@ class MenuBar {
275
284
  _items = () => this._allItems().filter(i => i.parent === this);
276
285
  _elementRef = inject(ElementRef);
277
286
  element = this._elementRef.nativeElement;
278
- _directionality = inject(Directionality);
279
- textDirection = toSignal(this._directionality.change, {
280
- initialValue: this._directionality.value
281
- });
287
+ textDirection = inject(Directionality).valueSignal;
282
288
  value = model([], ...(ngDevMode ? [{
283
289
  debugName: "value"
284
290
  }] : []));
@@ -292,16 +298,16 @@ class MenuBar {
292
298
  items = signal([], ...(ngDevMode ? [{
293
299
  debugName: "items"
294
300
  }] : []));
295
- onSubmit = output();
301
+ onSelect = output();
296
302
  constructor() {
297
303
  this._pattern = new MenuBarPattern({
298
304
  ...this,
299
305
  multi: () => false,
300
- skipDisabled: () => false,
306
+ softDisabled: () => true,
301
307
  focusMode: () => 'roving',
302
308
  orientation: () => 'horizontal',
303
309
  selectionMode: () => 'explicit',
304
- onSubmit: value => this.onSubmit.emit(value),
310
+ onSelect: value => this.onSelect.emit(value),
305
311
  activeItem: signal(undefined),
306
312
  element: computed(() => this._elementRef.nativeElement)
307
313
  });
@@ -353,7 +359,7 @@ class MenuBar {
353
359
  },
354
360
  outputs: {
355
361
  value: "valueChange",
356
- onSubmit: "onSubmit"
362
+ onSelect: "onSelect"
357
363
  },
358
364
  host: {
359
365
  attributes: {
@@ -404,7 +410,7 @@ i0.ɵɵngDeclareClassMetadata({
404
410
  class MenuItem {
405
411
  _elementRef = inject(ElementRef);
406
412
  element = this._elementRef.nativeElement;
407
- id = input(Math.random().toString(36).substring(2, 10), ...(ngDevMode ? [{
413
+ id = input(inject(_IdGenerator).getId('ng-menu-item-', true), ...(ngDevMode ? [{
408
414
  debugName: "id"
409
415
  }] : []));
410
416
  value = input.required(...(ngDevMode ? [{
@@ -426,6 +432,9 @@ class MenuItem {
426
432
  submenu = input(undefined, ...(ngDevMode ? [{
427
433
  debugName: "submenu"
428
434
  }] : []));
435
+ hasBeenFocused = signal(false, ...(ngDevMode ? [{
436
+ debugName: "hasBeenFocused"
437
+ }] : []));
429
438
  _pattern = new MenuItemPattern({
430
439
  id: this.id,
431
440
  value: this.value,
@@ -435,6 +444,12 @@ class MenuItem {
435
444
  parent: computed(() => this.parent?._pattern),
436
445
  submenu: computed(() => this.submenu()?._pattern)
437
446
  });
447
+ constructor() {
448
+ effect(() => this.submenu()?.parent.set(this));
449
+ }
450
+ onFocusIn() {
451
+ this.hasBeenFocused.set(true);
452
+ }
438
453
  static ɵfac = i0.ɵɵngDeclareFactory({
439
454
  minVersion: "12.0.0",
440
455
  version: "20.2.0-next.2",
@@ -493,8 +508,11 @@ class MenuItem {
493
508
  attributes: {
494
509
  "role": "menuitem"
495
510
  },
511
+ listeners: {
512
+ "focusin": "onFocusIn()"
513
+ },
496
514
  properties: {
497
- "attr.tabindex": "_pattern.tabindex()",
515
+ "attr.tabindex": "_pattern.tabIndex()",
498
516
  "attr.data-active": "_pattern.isActive()",
499
517
  "attr.aria-haspopup": "_pattern.hasPopup()",
500
518
  "attr.aria-expanded": "_pattern.expanded()",
@@ -520,7 +538,8 @@ i0.ɵɵngDeclareClassMetadata({
520
538
  host: {
521
539
  'role': 'menuitem',
522
540
  'class': 'ng-menu-item',
523
- '[attr.tabindex]': '_pattern.tabindex()',
541
+ '(focusin)': 'onFocusIn()',
542
+ '[attr.tabindex]': '_pattern.tabIndex()',
524
543
  '[attr.data-active]': '_pattern.isActive()',
525
544
  '[attr.aria-haspopup]': '_pattern.hasPopup()',
526
545
  '[attr.aria-expanded]': '_pattern.expanded()',
@@ -528,8 +547,45 @@ i0.ɵɵngDeclareClassMetadata({
528
547
  '[attr.aria-controls]': '_pattern.submenu()?.id()'
529
548
  }
530
549
  }]
550
+ }],
551
+ ctorParameters: () => []
552
+ });
553
+ class MenuContent {
554
+ static ɵfac = i0.ɵɵngDeclareFactory({
555
+ minVersion: "12.0.0",
556
+ version: "20.2.0-next.2",
557
+ ngImport: i0,
558
+ type: MenuContent,
559
+ deps: [],
560
+ target: i0.ɵɵFactoryTarget.Directive
561
+ });
562
+ static ɵdir = i0.ɵɵngDeclareDirective({
563
+ minVersion: "14.0.0",
564
+ version: "20.2.0-next.2",
565
+ type: MenuContent,
566
+ isStandalone: true,
567
+ selector: "ng-template[ngMenuContent]",
568
+ exportAs: ["ngMenuContent"],
569
+ hostDirectives: [{
570
+ directive: i1.DeferredContent
571
+ }],
572
+ ngImport: i0
573
+ });
574
+ }
575
+ i0.ɵɵngDeclareClassMetadata({
576
+ minVersion: "12.0.0",
577
+ version: "20.2.0-next.2",
578
+ ngImport: i0,
579
+ type: MenuContent,
580
+ decorators: [{
581
+ type: Directive,
582
+ args: [{
583
+ selector: 'ng-template[ngMenuContent]',
584
+ exportAs: 'ngMenuContent',
585
+ hostDirectives: [DeferredContent]
586
+ }]
531
587
  }]
532
588
  });
533
589
 
534
- export { Menu, MenuBar, MenuItem, MenuTrigger };
590
+ export { Menu, MenuBar, MenuContent, MenuItem, MenuTrigger };
535
591
  //# sourceMappingURL=menu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/src/aria/menu/menu.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n computed,\n contentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n model,\n output,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n SignalLike,\n MenuBarPattern,\n MenuItemPattern,\n MenuPattern,\n MenuTriggerPattern,\n} from '@angular/aria/private';\nimport {toSignal} from '@angular/core/rxjs-interop';\nimport {Directionality} from '@angular/cdk/bidi';\n\n/**\n * A trigger for a menu.\n *\n * The menu trigger is used to open and close menus, and can be placed on menu items to connect\n * sub-menus.\n */\n@Directive({\n selector: 'button[ngMenuTrigger]',\n exportAs: 'ngMenuTrigger',\n host: {\n 'class': 'ng-menu-trigger',\n '[attr.tabindex]': '_pattern.tabindex()',\n '[attr.aria-haspopup]': '_pattern.hasPopup()',\n '[attr.aria-expanded]': '_pattern.expanded()',\n '[attr.aria-controls]': '_pattern.submenu()?.id()',\n '(click)': '_pattern.onClick()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(focusout)': '_pattern.onFocusOut($event)',\n },\n})\nexport class MenuTrigger<V> {\n /** A reference to the menu trigger element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the menu element. */\n readonly element: HTMLButtonElement = this._elementRef.nativeElement;\n\n // TODO(wagnermaciel): See we can remove the need to pass in a submenu.\n\n /** The submenu associated with the menu trigger. */\n submenu = input<Menu<V> | undefined>(undefined);\n\n /** A callback function triggered when a menu item is selected. */\n onSubmit = output<V>();\n\n /** The menu trigger ui pattern instance. */\n readonly _pattern: MenuTriggerPattern<V> = new MenuTriggerPattern({\n onSubmit: (value: V) => this.onSubmit.emit(value),\n element: computed(() => this._elementRef.nativeElement),\n submenu: computed(() => this.submenu()?._pattern),\n });\n}\n\n/**\n * A list of menu items.\n *\n * A menu is used to offer a list of menu item choices to users. Menus can be nested within other\n * menus to create sub-menus.\n *\n * ```html\n * <button ngMenuTrigger menu=\"menu\">Options</button>\n *\n * <div ngMenu #menu=\"ngMenu\">\n * <div ngMenuItem>Star</div>\n * <div ngMenuItem>Edit</div>\n * <div ngMenuItem>Delete</div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[ngMenu]',\n exportAs: 'ngMenu',\n host: {\n 'role': 'menu',\n 'class': 'ng-menu',\n '[attr.id]': '_pattern.id()',\n '[attr.data-visible]': '_pattern.isVisible()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(mouseover)': '_pattern.onMouseOver($event)',\n '(mouseout)': '_pattern.onMouseOut($event)',\n '(focusout)': '_pattern.onFocusOut($event)',\n '(focusin)': '_pattern.onFocusIn()',\n '(click)': '_pattern.onClick($event)',\n },\n})\nexport class Menu<V> {\n /** The menu items contained in the menu. */\n readonly _allItems = contentChildren<MenuItem<V>>(MenuItem, {descendants: true});\n\n /** The menu items that are direct children of this menu. */\n readonly _items: Signal<MenuItem<V>[]> = computed(() =>\n this._allItems().filter(i => i.parent === this),\n );\n\n /** A reference to the menu element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the menu element. */\n readonly element: HTMLElement = this._elementRef.nativeElement;\n\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** A signal wrapper for directionality. */\n readonly textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The submenu associated with the menu. */\n readonly submenu = input<Menu<V> | undefined>(undefined);\n\n /** The unique ID of the menu. */\n readonly id = input<string>(Math.random().toString(36).substring(2, 10));\n\n /** Whether the menu should wrap its items. */\n readonly wrap = input<boolean>(true);\n\n /** The delay in seconds before the typeahead buffer is cleared. */\n readonly typeaheadDelay = input<number>(0.5); // Picked arbitrarily.\n\n /** A reference to the parent menu item or menu trigger. */\n readonly parent = input<MenuTrigger<V> | MenuItem<V>>();\n\n /** The menu ui pattern instance. */\n readonly _pattern: MenuPattern<V>;\n\n /**\n * The menu items as a writable signal.\n *\n * TODO(wagnermaciel): This would normally be a computed, but using a computed causes a bug where\n * sometimes the items array is empty. The bug can be reproduced by switching this to use a\n * computed and then quickly opening and closing menus in the dev app.\n */\n readonly items = () => this._items().map(i => i._pattern);\n\n /** Whether the menu is visible. */\n isVisible = computed(() => this._pattern.isVisible());\n\n /** A callback function triggered when a menu item is selected. */\n onSubmit = output<V>();\n\n constructor() {\n this._pattern = new MenuPattern({\n ...this,\n parent: computed(() => this.parent()?._pattern),\n multi: () => false,\n skipDisabled: () => false,\n focusMode: () => 'roving',\n orientation: () => 'vertical',\n selectionMode: () => 'explicit',\n activeItem: signal(undefined),\n element: computed(() => this._elementRef.nativeElement),\n onSubmit: (value: V) => this.onSubmit.emit(value),\n });\n\n // TODO(wagnermaciel): This is a redundancy needed for if the user uses display: none to hide\n // submenus. In those cases, the ui pattern is calling focus() before the ui has a chance to\n // update the display property. The result is focus() being called on an element that is not\n // focusable. This simply retries focusing the element after render.\n afterRenderEffect(() => {\n if (this._pattern.isVisible()) {\n const activeItem = untracked(() => this._pattern.inputs.activeItem());\n this._pattern.listBehavior.goto(activeItem!);\n }\n });\n\n afterRenderEffect(() => {\n if (!this._pattern.hasBeenFocused()) {\n this._pattern.setDefaultState();\n }\n });\n }\n\n // TODO(wagnermaciel): Author close, closeAll, and open methods for each directive.\n\n /** Closes the menu. */\n close(opts?: {refocus?: boolean}) {\n this._pattern.inputs.parent()?.close(opts);\n }\n\n /** Closes all parent menus. */\n closeAll(opts?: {refocus?: boolean}) {\n const root = this._pattern.root();\n\n if (root instanceof MenuTriggerPattern) {\n root.close(opts);\n }\n\n if (root instanceof MenuPattern || root instanceof MenuBarPattern) {\n root.inputs.activeItem()?.close(opts);\n }\n }\n}\n\n/**\n * A menu bar of menu items.\n *\n * Like the menu, a menubar is used to offer a list of menu item choices to users. However, a\n * menubar is used to display a persistent, top-level,\n * always-visible set of menu item choices.\n */\n@Directive({\n selector: '[ngMenuBar]',\n exportAs: 'ngMenuBar',\n host: {\n 'role': 'menubar',\n 'class': 'ng-menu-bar',\n '(keydown)': '_pattern.onKeydown($event)',\n '(mouseover)': '_pattern.onMouseOver($event)',\n '(click)': '_pattern.onClick($event)',\n '(focusin)': '_pattern.onFocusIn()',\n '(focusout)': '_pattern.onFocusOut($event)',\n },\n})\nexport class MenuBar<V> {\n /** The menu items contained in the menubar. */\n readonly _allItems = contentChildren<MenuItem<V>>(MenuItem, {descendants: true});\n\n readonly _items: SignalLike<MenuItem<V>[]> = () =>\n this._allItems().filter(i => i.parent === this);\n\n /** A reference to the menu element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the menubar element. */\n readonly element: HTMLElement = this._elementRef.nativeElement;\n\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n private readonly _directionality = inject(Directionality);\n\n /** A signal wrapper for directionality. */\n readonly textDirection = toSignal(this._directionality.change, {\n initialValue: this._directionality.value,\n });\n\n /** The value of the menu. */\n readonly value = model<V[]>([]);\n\n /** Whether the menu should wrap its items. */\n readonly wrap = input<boolean>(true);\n\n /** The delay in seconds before the typeahead buffer is cleared. */\n readonly typeaheadDelay = input<number>(0.5);\n\n /** The menu ui pattern instance. */\n readonly _pattern: MenuBarPattern<V>;\n\n /** The menu items as a writable signal. */\n readonly items = signal<MenuItemPattern<V>[]>([]);\n\n /** A callback function triggered when a menu item is selected. */\n onSubmit = output<V>();\n\n constructor() {\n this._pattern = new MenuBarPattern({\n ...this,\n multi: () => false,\n skipDisabled: () => false,\n focusMode: () => 'roving',\n orientation: () => 'horizontal',\n selectionMode: () => 'explicit',\n onSubmit: (value: V) => this.onSubmit.emit(value),\n activeItem: signal(undefined),\n element: computed(() => this._elementRef.nativeElement),\n });\n\n afterRenderEffect(() => {\n this.items.set(this._items().map(i => i._pattern));\n });\n\n afterRenderEffect(() => {\n if (!this._pattern.hasBeenFocused()) {\n this._pattern.setDefaultState();\n }\n });\n }\n}\n\n/**\n * An item in a Menu.\n *\n * Menu items can be used in menus and menubars to represent a choice or action a user can take.\n */\n@Directive({\n selector: '[ngMenuItem]',\n exportAs: 'ngMenuItem',\n host: {\n 'role': 'menuitem',\n 'class': 'ng-menu-item',\n '[attr.tabindex]': '_pattern.tabindex()',\n '[attr.data-active]': '_pattern.isActive()',\n '[attr.aria-haspopup]': '_pattern.hasPopup()',\n '[attr.aria-expanded]': '_pattern.expanded()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-controls]': '_pattern.submenu()?.id()',\n },\n})\nexport class MenuItem<V> {\n /** A reference to the menu item element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the menu element. */\n readonly element: HTMLElement = this._elementRef.nativeElement;\n\n /** The unique ID of the menu item. */\n readonly id = input<string>(Math.random().toString(36).substring(2, 10));\n\n /** The value of the menu item. */\n readonly value = input.required<V>();\n\n /** Whether the menu item is disabled. */\n readonly disabled = input<boolean>(false);\n\n // TODO(wagnermaciel): Discuss whether all inputs should be models.\n\n /** The search term associated with the menu item. */\n readonly searchTerm = model<string>('');\n\n /** A reference to the parent menu. */\n private readonly _menu = inject<Menu<V>>(Menu, {optional: true});\n\n /** A reference to the parent menu bar. */\n private readonly _menuBar = inject<MenuBar<V>>(MenuBar, {optional: true});\n\n /** A reference to the parent menu or menubar. */\n readonly parent = this._menu ?? this._menuBar;\n\n /** The submenu associated with the menu item. */\n readonly submenu = input<Menu<V> | undefined>(undefined);\n\n /** The menu item ui pattern instance. */\n readonly _pattern: MenuItemPattern<V> = new MenuItemPattern<V>({\n id: this.id,\n value: this.value,\n element: computed(() => this._elementRef.nativeElement),\n disabled: this.disabled,\n searchTerm: this.searchTerm,\n parent: computed(() => this.parent?._pattern),\n submenu: computed(() => this.submenu()?._pattern),\n });\n}\n"],"names":["submenu","computed","_pattern","ɵfac","i0","ɵɵngDeclareFactory","minVersion","version","ngImport","type","MenuTrigger","deps","target","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","outputs","onSubmit","host","listeners","properties","classAttribute","exportAs","decorators","args","_elementRef","inject","ElementRef","element","nativeElement","_directionality","Directionality","change","initialValue","value","ngDevMode","debugName","input","parent","undefined","MenuPattern","multi","skipDisabled","focusMode","orientation","selectionMode","activeItem","signal","isVisible","listBehavior","goto","afterRenderEffect","hasBeenFocused","setDefaultState","MenuTriggerPattern","root","Menu","ɵɵngDeclareDirective","id","wrap","typeaheadDelay","attributes","queries","propertyName","predicate","MenuItem","descendants","ctorParameters","constructor","emit","MenuBar","ɵdir"],"mappings":";;;;;;;;;;;;;;;;AA0FGA,IAA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;AAAA,QAAA,SAAA,EAAA,sBAAA;AAAA,QAAA,UAAA,EAAA;AAAA,OAAA;MAAAE,cAAA,EAAA;AAAA,KAAA;IAAAyC,OAAA,EAAA,CAAA;MAAAC,YAAA,EAAA,WAAA;AAAAC,MAAAA,SAAA,EAAAC,QAAA;MAAAC,WAAA,EAAA,IAAA;MAAArD,QAAA,EAAA;AAAA,KAAA,CAAA;IAAAS,QAAA,EAAA,CAAA,WAAA,CAAA;AAAArB,IAAAA,QAAA,EAAAJ;AAAA,GAAA,CAAA;;AAEA,EAAA,CAAA,wBAAA,CAAA;AAAAE,EAAAA,UAAA,EAAA,QAAA;EAAAC,OAAA,EAAA,eAAA;AAAAC,EAAAA,QAAA,EAAAJ,EAAA;AAAAK,EAAAA,IAAA,EAAAoE,OAAA;EAAA/C,UAAA,EAAA,CAAA;AACDrB,IAAAA,IAAA,EAAAK,SAAA;IACFiB,IAAA,EAAA,CAAA;;;;;;QAlFY,WAAA,EAAA,4BAAA;AAAA,QAAA,aAAA,EAAA,8BAAA;;;;;;;AAXX,EAAA,cAAA,EAAA2C,MAAA;AAAA,CAAA,CAAA;AAME,MAAA,QAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"menu.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/aria/menu/menu.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {\n afterRenderEffect,\n computed,\n contentChildren,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n model,\n output,\n Signal,\n signal,\n untracked,\n} from '@angular/core';\nimport {\n SignalLike,\n MenuBarPattern,\n MenuItemPattern,\n MenuPattern,\n MenuTriggerPattern,\n DeferredContent,\n DeferredContentAware,\n} from '@angular/aria/private';\nimport {_IdGenerator} from '@angular/cdk/a11y';\nimport {Directionality} from '@angular/cdk/bidi';\n\n/**\n * A trigger for a menu.\n *\n * The menu trigger is used to open and close menus, and can be placed on menu items to connect\n * sub-menus.\n */\n@Directive({\n selector: 'button[ngMenuTrigger]',\n exportAs: 'ngMenuTrigger',\n host: {\n 'class': 'ng-menu-trigger',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.aria-haspopup]': '_pattern.hasPopup()',\n '[attr.aria-expanded]': '_pattern.expanded()',\n '[attr.aria-controls]': '_pattern.menu()?.id()',\n '(click)': '_pattern.onClick()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(focusout)': '_pattern.onFocusOut($event)',\n '(focusin)': 'onFocusIn()',\n },\n})\nexport class MenuTrigger<V> {\n /** A reference to the menu trigger element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** A reference to the menu element. */\n readonly element: HTMLButtonElement = this._elementRef.nativeElement;\n\n /** The menu associated with the trigger. */\n menu = input<Menu<V> | undefined>(undefined);\n\n /** Whether the menu item has been focused. */\n readonly hasBeenFocused = signal(false);\n\n /** The menu trigger ui pattern instance. */\n _pattern: MenuTriggerPattern<V> = new MenuTriggerPattern({\n textDirection: this.textDirection,\n element: computed(() => this._elementRef.nativeElement),\n menu: computed(() => this.menu()?._pattern),\n });\n\n constructor() {\n effect(() => this.menu()?.parent.set(this));\n }\n\n /** Marks the menu trigger as having been focused. */\n onFocusIn() {\n this.hasBeenFocused.set(true);\n }\n}\n\n/**\n * A list of menu items.\n *\n * A menu is used to offer a list of menu item choices to users. Menus can be nested within other\n * menus to create sub-menus.\n *\n * ```html\n * <button ngMenuTrigger menu=\"menu\">Options</button>\n *\n * <div ngMenu #menu=\"ngMenu\">\n * <div ngMenuItem>Star</div>\n * <div ngMenuItem>Edit</div>\n * <div ngMenuItem>Delete</div>\n * </div>\n * ```\n */\n@Directive({\n selector: '[ngMenu]',\n exportAs: 'ngMenu',\n host: {\n 'role': 'menu',\n 'class': 'ng-menu',\n '[attr.id]': '_pattern.id()',\n '[attr.data-visible]': '_pattern.isVisible()',\n '(keydown)': '_pattern.onKeydown($event)',\n '(mouseover)': '_pattern.onMouseOver($event)',\n '(mouseout)': '_pattern.onMouseOut($event)',\n '(focusout)': '_pattern.onFocusOut($event)',\n '(focusin)': '_pattern.onFocusIn()',\n '(click)': '_pattern.onClick($event)',\n },\n hostDirectives: [\n {\n directive: DeferredContentAware,\n inputs: ['preserveContent'],\n },\n ],\n})\nexport class Menu<V> {\n /** The DeferredContentAware host directive. */\n private readonly _deferredContentAware = inject(DeferredContentAware, {optional: true});\n\n /** The menu items contained in the menu. */\n readonly _allItems = contentChildren<MenuItem<V>>(MenuItem, {descendants: true});\n\n /** The menu items that are direct children of this menu. */\n readonly _items: Signal<MenuItem<V>[]> = computed(() =>\n this._allItems().filter(i => i.parent === this),\n );\n\n /** A reference to the menu element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the menu element. */\n readonly element: HTMLElement = this._elementRef.nativeElement;\n\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** The unique ID of the menu. */\n readonly id = input<string>(inject(_IdGenerator).getId('ng-menu-', true));\n\n /** Whether the menu should wrap its items. */\n readonly wrap = input<boolean>(true);\n\n /** The delay in seconds before the typeahead buffer is cleared. */\n readonly typeaheadDelay = input<number>(0.5); // Picked arbitrarily.\n\n /** A reference to the parent menu item or menu trigger. */\n readonly parent = signal<MenuTrigger<V> | MenuItem<V> | undefined>(undefined);\n\n /** The menu ui pattern instance. */\n readonly _pattern: MenuPattern<V>;\n\n /**\n * The menu items as a writable signal.\n *\n * TODO(wagnermaciel): This would normally be a computed, but using a computed causes a bug where\n * sometimes the items array is empty. The bug can be reproduced by switching this to use a\n * computed and then quickly opening and closing menus in the dev app.\n */\n readonly items = () => this._items().map(i => i._pattern);\n\n /** Whether the menu is visible. */\n isVisible = computed(() => this._pattern.isVisible());\n\n /** A callback function triggered when a menu item is selected. */\n onSelect = output<V>();\n\n constructor() {\n this._pattern = new MenuPattern({\n ...this,\n parent: computed(() => this.parent()?._pattern),\n multi: () => false,\n softDisabled: () => true,\n focusMode: () => 'roving',\n orientation: () => 'vertical',\n selectionMode: () => 'explicit',\n activeItem: signal(undefined),\n element: computed(() => this._elementRef.nativeElement),\n onSelect: (value: V) => this.onSelect.emit(value),\n });\n\n afterRenderEffect(() => {\n const parent = this.parent();\n if (parent instanceof MenuItem && parent.parent instanceof MenuBar) {\n this._deferredContentAware?.contentVisible.set(true);\n } else {\n this._deferredContentAware?.contentVisible.set(\n this._pattern.isVisible() || !!this.parent()?.hasBeenFocused(),\n );\n }\n });\n\n // TODO(wagnermaciel): This is a redundancy needed for if the user uses display: none to hide\n // submenus. In those cases, the ui pattern is calling focus() before the ui has a chance to\n // update the display property. The result is focus() being called on an element that is not\n // focusable. This simply retries focusing the element after render.\n afterRenderEffect(() => {\n if (this._pattern.isVisible()) {\n const activeItem = untracked(() => this._pattern.inputs.activeItem());\n this._pattern.listBehavior.goto(activeItem!);\n }\n });\n\n afterRenderEffect(() => {\n if (!this._pattern.hasBeenFocused()) {\n this._pattern.setDefaultState();\n }\n });\n }\n\n // TODO(wagnermaciel): Author close, closeAll, and open methods for each directive.\n\n /** Closes the menu. */\n close(opts?: {refocus?: boolean}) {\n this._pattern.inputs.parent()?.close(opts);\n }\n\n /** Closes all parent menus. */\n closeAll(opts?: {refocus?: boolean}) {\n const root = this._pattern.root();\n\n if (root instanceof MenuTriggerPattern) {\n root.close(opts);\n }\n\n if (root instanceof MenuPattern || root instanceof MenuBarPattern) {\n root.inputs.activeItem()?.close(opts);\n }\n }\n}\n\n/**\n * A menu bar of menu items.\n *\n * Like the menu, a menubar is used to offer a list of menu item choices to users. However, a\n * menubar is used to display a persistent, top-level,\n * always-visible set of menu item choices.\n */\n@Directive({\n selector: '[ngMenuBar]',\n exportAs: 'ngMenuBar',\n host: {\n 'role': 'menubar',\n 'class': 'ng-menu-bar',\n '(keydown)': '_pattern.onKeydown($event)',\n '(mouseover)': '_pattern.onMouseOver($event)',\n '(click)': '_pattern.onClick($event)',\n '(focusin)': '_pattern.onFocusIn()',\n '(focusout)': '_pattern.onFocusOut($event)',\n },\n})\nexport class MenuBar<V> {\n /** The menu items contained in the menubar. */\n readonly _allItems = contentChildren<MenuItem<V>>(MenuItem, {descendants: true});\n\n readonly _items: SignalLike<MenuItem<V>[]> = () =>\n this._allItems().filter(i => i.parent === this);\n\n /** A reference to the menu element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the menubar element. */\n readonly element: HTMLElement = this._elementRef.nativeElement;\n\n /** The directionality (LTR / RTL) context for the application (or a subtree of it). */\n readonly textDirection = inject(Directionality).valueSignal;\n\n /** The value of the menu. */\n readonly value = model<V[]>([]);\n\n /** Whether the menu should wrap its items. */\n readonly wrap = input<boolean>(true);\n\n /** The delay in seconds before the typeahead buffer is cleared. */\n readonly typeaheadDelay = input<number>(0.5);\n\n /** The menu ui pattern instance. */\n readonly _pattern: MenuBarPattern<V>;\n\n /** The menu items as a writable signal. */\n readonly items = signal<MenuItemPattern<V>[]>([]);\n\n /** A callback function triggered when a menu item is selected. */\n onSelect = output<V>();\n\n constructor() {\n this._pattern = new MenuBarPattern({\n ...this,\n multi: () => false,\n softDisabled: () => true,\n focusMode: () => 'roving',\n orientation: () => 'horizontal',\n selectionMode: () => 'explicit',\n onSelect: (value: V) => this.onSelect.emit(value),\n activeItem: signal(undefined),\n element: computed(() => this._elementRef.nativeElement),\n });\n\n afterRenderEffect(() => {\n this.items.set(this._items().map(i => i._pattern));\n });\n\n afterRenderEffect(() => {\n if (!this._pattern.hasBeenFocused()) {\n this._pattern.setDefaultState();\n }\n });\n }\n}\n\n/**\n * An item in a Menu.\n *\n * Menu items can be used in menus and menubars to represent a choice or action a user can take.\n */\n@Directive({\n selector: '[ngMenuItem]',\n exportAs: 'ngMenuItem',\n host: {\n 'role': 'menuitem',\n 'class': 'ng-menu-item',\n '(focusin)': 'onFocusIn()',\n '[attr.tabindex]': '_pattern.tabIndex()',\n '[attr.data-active]': '_pattern.isActive()',\n '[attr.aria-haspopup]': '_pattern.hasPopup()',\n '[attr.aria-expanded]': '_pattern.expanded()',\n '[attr.aria-disabled]': '_pattern.disabled()',\n '[attr.aria-controls]': '_pattern.submenu()?.id()',\n },\n})\nexport class MenuItem<V> {\n /** A reference to the menu item element. */\n private readonly _elementRef = inject(ElementRef);\n\n /** A reference to the menu element. */\n readonly element: HTMLElement = this._elementRef.nativeElement;\n\n /** The unique ID of the menu item. */\n readonly id = input<string>(inject(_IdGenerator).getId('ng-menu-item-', true));\n\n /** The value of the menu item. */\n readonly value = input.required<V>();\n\n /** Whether the menu item is disabled. */\n readonly disabled = input<boolean>(false);\n\n // TODO(wagnermaciel): Discuss whether all inputs should be models.\n\n /** The search term associated with the menu item. */\n readonly searchTerm = model<string>('');\n\n /** A reference to the parent menu. */\n private readonly _menu = inject<Menu<V>>(Menu, {optional: true});\n\n /** A reference to the parent menu bar. */\n private readonly _menuBar = inject<MenuBar<V>>(MenuBar, {optional: true});\n\n /** A reference to the parent menu or menubar. */\n readonly parent = this._menu ?? this._menuBar;\n\n /** The submenu associated with the menu item. */\n readonly submenu = input<Menu<V> | undefined>(undefined);\n\n /** Whether the menu item has been focused. */\n readonly hasBeenFocused = signal(false);\n\n /** The menu item ui pattern instance. */\n readonly _pattern: MenuItemPattern<V> = new MenuItemPattern<V>({\n id: this.id,\n value: this.value,\n element: computed(() => this._elementRef.nativeElement),\n disabled: this.disabled,\n searchTerm: this.searchTerm,\n parent: computed(() => this.parent?._pattern),\n submenu: computed(() => this.submenu()?._pattern),\n });\n\n constructor() {\n effect(() => this.submenu()?.parent.set(this));\n }\n\n /** Marks the menu item as having been focused. */\n onFocusIn() {\n this.hasBeenFocused.set(true);\n }\n}\n\n/** Defers the rendering of the menu content. */\n@Directive({\n selector: 'ng-template[ngMenuContent]',\n exportAs: 'ngMenuContent',\n hostDirectives: [DeferredContent],\n})\nexport class MenuContent {}\n"],"names":["MenuTrigger","_elementRef","inject","ElementRef","textDirection","Directionality","valueSignal","element","nativeElement","menu","input","undefined","hasBeenFocused","signal","_pattern","MenuTriggerPattern","computed","constructor","effect","parent","set","onFocusIn","deps","target","i0","ɵɵFactoryTarget","Directive","isStandalone","selector","inputs","classPropertyName","publicName","isSignal","isRequired","transformFunction","host","listeners","properties","classAttribute","exportAs","ngImport","decorators","args","Menu","_deferredContentAware","DeferredContentAware","optional","_allItems","contentChildren","MenuItem","descendants","_items","filter","i","ngDevMode","debugName","id","_IdGenerator","getId","wrap","typeaheadDelay","items","map","isVisible","onSelect","output","MenuPattern","multi","softDisabled","focusMode","orientation","selectionMode","activeItem","value","emit","afterRenderEffect","MenuBar","contentVisible","untracked","listBehavior","goto","setDefaultState","close","opts","closeAll","root","MenuBarPattern","ɵdir","ɵɵngDeclareDirective","minVersion","version","type","hostDirectives","directive","i1","model","required","disabled","searchTerm","_menu","_menuBar","submenu","MenuItemPattern","outputs","attributes","MenuContent","DeferredContent"],"mappings":";;;;;;;MAwDaA,WAAW,CAAA;AAELC,EAAAA,WAAW,GAAGC,MAAM,CAACC,UAAU,CAAC;AAGxCC,EAAAA,aAAa,GAAGF,MAAM,CAACG,cAAc,CAAC,CAACC,WAAW;AAGlDC,EAAAA,OAAO,GAAsB,IAAI,CAACN,WAAW,CAACO,aAAa;EAGpEC,IAAI,GAAGC,KAAK,CAAsBC,SAAS;;WAAC;EAGnCC,cAAc,GAAGC,MAAM,CAAC,KAAK;;WAAC;EAGvCC,QAAQ,GAA0B,IAAIC,kBAAkB,CAAC;IACvDX,aAAa,EAAE,IAAI,CAACA,aAAa;IACjCG,OAAO,EAAES,QAAQ,CAAC,MAAM,IAAI,CAACf,WAAW,CAACO,aAAa,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